Skip to content

Commit 638ea04

Browse files
claude[bot]claude
andauthored
docs(agents): a negative --is-ancestor reading is void without a positive control (#15355)
* docs(agents): a negative `--is-ancestor` reading is void without a positive control `git merge-base --is-ancestor` is a one-bit answer with no error channel for "I could not see far enough": in a shallow clone it answers exit 1 for a commit that IS in the target's history, silently, at a normal exit code. The failure is one-directional — missing objects can only withhold an ancestry path, never invent one — so exit 0 stands in any clone and only exit 1 needs a control leg. That is the direction the premise checks devs are ordered to run ("not released yet", "not on main", `Blocked-by`) actually ask for. Sits beside the existing shallow-clone guard for `log -S`/`--follow`/`blame` and echoes its `--is-shallow-repository` spelling rather than adding a second one, with the measured caveat that the depth read is a cheap trigger and the control leg is the verdict. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox * docs(agents): wrap the new clause to the ratchet's 120-byte line budget `check:pm-skill-ratchet` prices a per-session token read in BYTES, not display columns, so the CJK lines landed at 137-140B against a 120B budget. Re-wrapped at legal break points (spaces, and between two CJK characters) with the content byte-identical — 8 lines become 9; the file is 459 of a 469 ceiling. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3bd9b34 commit 638ea04

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎.claude/agents/os-dev.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ dispatch prompt 只携带每单增量(裁决引文、裁决 / PM-机制假设分
229229
之后**他人已合并的文件**整批 stage 成你的(实测一次四个 agent 的合并文件,commit 前才逮
230230
住)。「我从哪开始」的 reset/diff/log/rebase 一律锚基本规则 1 记录的 `"$BASE"`。
231231
- **`log -S/--follow/blame` 判日期或先后前**,先 `git rev-parse --is-shallow-repository`,true 就加深申报。
232+
- **`merge-base --is-ancestor` 的「非祖先」在浅检出上是假绿 —— 它没有「我看不了那么远」这
233+
条错误通道。**缺的对象只会**扣下**一条祖先路径、永不凭空造出一条 ⇒ **失效单向:exit
234+
0(「是祖先」)自证,任何检出里都作数;只有 exit 1 要控制腿** —— 而「还没发布」「不在
235+
main 上」「`Blocked-by` 已落地」这些前提核验要的恰是 exit 1。阴性读数按**两条腿的一次测
236+
量**写(与空结果要控制词同形):同一检出、同一目标 ref 上再跑一个**已知在目标历史
237+
里**的 commit,它必须答 exit 0;否则阴性作废 —— `git fetch --deepen` / `--unshallow` 到控制腿转 0
238+
再重读。⛔ 控制腿别挑浅窗内的近亲:实测 depth 50 上 `HEAD~5` 与边界 commit 都照答 exit 0,对
239+
截断完全致盲 —— 控制 commit 至少与被测那个同深。`--is-shallow-repository` 是便宜的触发器
240+
不是判据(实测 `--unshallow` 后它仍可为 true);判据是控制腿。两条腿的退出码都进报告。
232241
- **要做反向验证(「回退修复,看诊断变化」)?先 commit 修复。** 已 commit,恢复只是
233242
`git checkout <your-branch> -- <path>`;对着未提交的编辑, `git checkout origin/main -- <path>` 不留任何恢
234243
复点 —— 工作树曾是唯一副本,而丢弃它是一次正常、无声、exit-0 的操作(恢复机制与字

0 commit comments

Comments
 (0)