claw-code 源码分析:再实现与合规叙事——技术文档、免责声明与协作礼仪如何降低项目风险?
涉及材料根目录README.md、长文随笔README 所列文件名、rust/README.md、rust/CONTRIBUTING.md、PARITY.md、.gitignorearchive/、result/18.md/result/28.md相关结论。1. 风险从哪里来再实现项目的特殊暴露面「再实现 / clean-room / inspired」类仓库同时面临法律与品牌是否暗示占有原作品、是否被误认为官方或授权分支。版权与证据是否复制受限表达PR 与发布物能否证明独立实现路径。社群与舆论爆款流量下讨论易从技术滑向站队缺少礼仪与边界会放大冲突。用户期望Star 与营销句式抬高「已可替代原版」的预期与实际 parity 脱节。claw-code 用分层叙事 可执行文档 贡献约束把这些暴露面部分工程化。下面按层拆解。2. 叙事层为何重写、伦理与外部论述README 用独立小节解释动机与价值取舍研究 harness → 不愿以外泄快照为主树 → 聚焦 Python 移植并显式点出法律与伦理与外部长文## Why this rewrite exists I originally studied the exposed codebase to understand its harness, tool wiring, and agent workflow. After spending more time with the legal and ethical questions—and after reading the essay linked below—I did not want the exposed snapshot itself to remain the main tracked source tree. This repository now focuses on Python porting work instead.仓库布局把随笔文件与源码并列列出使「合规/正当性讨论」成为版本化知识资产而非评论区口水├── tests/ # Python verification ├── assets/omx/ # OmX workflow screenshots ├── 2026-03-09-is-legal-the-same-as-legitimate-ai-reimplementation-and-the-erosion-of-copyleft.md └── README.md风险降低机制把意图intent与方法method固定在 README便于律师、媒体、贡献者引用同一文本减少「项目到底主张什么」的漂移。若本地 clone 未包含该.md仍以 README 索引为准。3. 免责声明层所有权与隶属关系文末Ownership / Affiliation Disclaimer用否定句划界直接针对误认官方、误认权利转移两类高频风险## Ownership / Affiliation Disclaimer - This repository does **not** claim ownership of the original Claw Code source material. - This repository is **not affiliated with, endorsed by, or maintained by the original authors**.风险降低机制在侵权或不正当竞争争议中公开、前置的否定声明虽非法务意见但能支撑「无混淆故意」叙事给平台与赞助商可展示的合规姿态降低 fork/报道时默认写成续作的概率。4. 技术文档层把「我们做了什么 / 没做什么」写成可审计陈述4.1 产品自述Rust 侧的 clean-room 定位rust/README.md首段钉死灵感来源与非拷贝# Claw Code Claw Code is a local coding-agent CLI implemented in safe Rust. It is **Claude Code inspired** and developed as a **clean-room implementation**: it aims for a strong local agent experience, but it is **not** a direct port or copy of Claude Code. The Rust workspace is the current main product surface. The claw binary provides interactive sessions, one-shot prompts, workspace-aware tools, local agent workflows, and plugin-capable operation from a single workspace.4.2 Parity 文档方法与「未复制」声明PARITY.md在范围说明里写清只读对比、无 TS 源码拷贝Scope: read-only comparison between the original TypeScript source at /home/bellman/Workspace/claw-code/src/ and the Rust port under rust/crates/. Method: compared feature surfaces, registries, entrypoints, and runtime plumbing only. No TypeScript source was copied.并显式not feature-parity避免技术读者把 MVP 当全量克隆亦见result/28.md。4.3 移植状态未完成声明## Current Parity Checkpoint The port now mirrors the archived root-entry file surface, top-level subsystem names, and command/tool inventories much more closely than before. However, it is **not yet** a full runtime-equivalent replacement for the original TypeScript system; the Python tree still contains fewer executable runtime slices than the archived source.风险降低机制技术文档承担反幻觉功能——降低「用户因文档夸大而主张依赖/索赔」的概率在争议场景中可引用固定段落说明未承诺等价替换。4.4 仓库边界外泄快照不进入主跟踪树README 写明exposed snapshot 不再作为被跟踪状态.gitignore忽略archive/从工程上减少「把对照源误提交」的操作风险与result/18.md一致。5. 协作礼仪层CONTRIBUTING 如何约束行为、间接降险rust/CONTRIBUTING.md不仅是工具链说明也是协作契约## Code style - Follow the existing patterns in the touched crate instead of introducing a new style. - Format code with rustfmt. - Keep clippy clean for the workspace targets you changed. - Prefer focused diffs over drive-by refactors. ## Pull requests - Branch from main. - Keep each pull request scoped to one clear change. - Explain the motivation, the implementation summary, and the verification you ran. - Make sure local checks pass before requesting review. - If review feedback changes behavior, rerun the relevant verification commands.风险降低机制间接约束降低的风险类型单 PR 单一清晰变更难以夹带大块「来源不明的粘贴」审查者可读、可追责。动机 实现摘要 验证命令留下provenance 痕迹便于事后审计「是否独立实现」。禁止顺手大重构减少掩盖拷贝的 diff 噪音降低与上游表面相似度突增的误读。行为变更必带测试与PARITY/功能主张对齐证据减少口头承诺。Python 侧虽无单独CONTRIBUTING.mdunittest discover与tests/test_porting_workspace.py承担可重复验证的同类功能result/26.md。6. 社群出口讨论导流与礼仪空间README 将社群指向instruct.kr / Discord把 harness 讨论从 issue 洪流中部分导流到专门场域## Community ... Join the [**instructkr Discord**](https://instruct.kr/) — the best Korean language model community. Come chat about LLMs, harness engineering, agent workflows, and everything in between.风险降低机制减少 GitHub issue 沦为纯立场争吵的概率礼仪与主题由社群规范承载若再配合 CODE_OF_CONDUCT 会更完整——本仓库根目录未强制要求属于可增强项。7. 小结三层叠加模型伦理/动机叙事Why rewrite 外部长文索引 ↓ 法律边界声明不主张所有权、非隶属 ↓ 技术事实陈述clean-room、PARITY 方法、未完成、无拷贝 TS ↓ 协作可审计性CONTRIBUTING、测试、CI技术文档回答「能力与差距」免责声明回答「我们不代表谁」协作礼仪回答「改动如何可被审查与复现」。三者都不替代律师意见但共同压低误读、误用与不可审计贡献的概率——这正是再实现项目在舆论与合规双重压力下的务实风控组合。