From c6d554a0fd5e1f4d6703b3569cf6b8af7abd1a22 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Sep 2026 02:48:13 +0000 Subject: [PATCH] docs(agents): guard history dating against a shallow clone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `git log -S`, `git log --follow` and `git blame` answer from the horizon commit in a shallow clone — exit 0, plausible sha, plausible date, no warning — so a dev asked to date a line of history can report a wrong answer with no signal. One standing clause now requires `git rev-parse --is-shallow-repository` before a date or an ordering is trusted, deepening when it is true, and declaring it in the report. Scoped to history reads only. A content read at a ref (`git show ref:path`, `git grep … ref --`) is depth-safe and is deliberately not caught by the wording. Paid same-file at ratchet headroom 0: the Definition-of-done line "用户可见的改动加 changeset。" is dropped as a strict restatement of basic rule 4, which states the same obligation more precisely ("用户可见的改动需要 `.changeset/*.md`") at a more binding site. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1 --- .claude/agents/os-dev.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 537cc802a9..2be056c37a 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -229,6 +229,7 @@ dispatch prompt 只携带每单增量(裁决引文、裁决 / PM-机制假设分 `origin/main` 是共享指针,别的 agent 一次 fetch 就推进它:`git reset --soft origin/main` 把你分支点 之后**他人已合并的文件**整批 stage 成你的(实测一次四个 agent 的合并文件,commit 前才逮 住)。「我从哪开始」的 reset/diff/log/rebase 一律锚基本规则 1 记录的 `"$BASE"`。 +- **`log -S/--follow/blame` 判日期或先后前**,先 `git rev-parse --is-shallow-repository`,true 就加深申报。 - **要做反向验证(「回退修复,看诊断变化」)?先 commit 修复。** 已 commit,恢复只是 `git checkout -- `;对着未提交的编辑, `git checkout origin/main -- ` 不留任何恢 复点 —— 工作树曾是唯一副本,而丢弃它是一次正常、无声、exit-0 的操作(恢复机制与字 @@ -300,7 +301,6 @@ dispatch prompt 只携带每单增量(裁决引文、裁决 / PM-机制假设分 - 实现满足 issue 的验收判据。 - 测试:新增/更新覆盖;跑受影响包的 `pnpm test` / `pnpm typecheck`,为报告留真实输出 (范围 按「本地验证范围」圈定)。 -- 用户可见的改动加 changeset。 - 用 `git push -u origin claude/issue--` 推上去(网络失败退避重试)。 - **Draft** PR 指向 `main`,正文首行 `Fixes #` —— **合并不应关卡时用 `Part of #`**(你只实现 了可执行的那一半;说明留下的是哪一半)。⛔ 永不 `Fixes` 一张还在决策箱的卡 —— 合并