Skip to content

Teach the shared-refs family rule at recipe level (worktree isolates tree and HEAD only) - #11137

Merged
os-zhuang merged 1 commit into
mainfrom
claude/issue-10743-shared-refs-family-rule
Aug 23, 2026
Merged

Teach the shared-refs family rule at recipe level (worktree isolates tree and HEAD only)#11137
os-zhuang merged 1 commit into
mainfrom
claude/issue-10743-shared-refs-family-rule

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Fixes #10743

What

Teaches the family rule at recipe level, per the grading scope: git worktree isolates the working tree and HEAD, and nothing else under .git/ — refs (including refs/remotes/*), the stash stack, config, hooks are common to every worktree. A recipe is worktree-safe only if it never names shared state.

.claude/agents/os-dev.md (395 before, 399 after, ceiling 399):

  • Rule 1 (worktree-first) now records the base at branch time: BASE=$(git rev-parse HEAD) before any work.
  • The stash clause is rewritten into the family rule, stated once in the file's voice, with the family signature (operation looks local, reports success, only symptom is other agents' files in git status) stated once for both instances. It adds the shared-pointer hazard — git reset --soft origin/main stages other agents' merged files, landed after your branch point, as yours (measured shape: four agents' merged files staged by one soft reset, caught pre-commit) — and the discipline: "where I started" reset/diff/log/rebase anchor the recorded "$BASE".
  • Net +6 paid down to +4 (exact headroom) by deleting two genuine in-file duplicates: resource rule 6's lock-queue-is-the-only-legal-wait sentence (fully stated by rule 7 and clean-finish item 4) and rule 6's SIGTERM-mid-ablation incident sentence (fully stated in the ablation clause together with its trap remedy).

.claude/skills/pm-dispatch/references/platform-readings.md (134 before, 134 after, ceiling 134 — zero headroom):

  • New single-line fact row in the reading-traps section: shared refs/remotes/origin/main, the soft-reset failure shape, and the recorded-base-sha discipline.
  • Paid 1 line by deduplicating inside the merge-queue timeline bullet: the queue-branch ls-remote spelling (kept verbatim in the zero-cost-equivalents row, now pointed to) and the positive-hit-sufficient reading (also carried by the enable-verify sequence). The queue-saturation boundary fact is retained; no fact or safe procedure deleted.

Conditional surfaces — no carrier spelling found

Grepped AGENTS.md, CLAUDE.md, pm-dispatch SKILL.md and the dispatch runbook for recipes anchoring origin/main as an implicit "where I started": every hit is either a deliberate read of current main (premise verification, git merge origin/main in merge-queue context, same-day churn scans) or an already-taught hazard description (the checkout-from-ref clauses). Their stash-alternative recipes anchor HEAD~1 / implicit HEAD, which is worktree-safe. Per the adjudicated scope, no new sections were added to those files.

Verification

All 8 derived gate families green at head 194dcb7e9 (union re-run after the final commit; node scripts/pm/dispatch-gates.mjs with no hand-fed paths derived the set):

  • check:pm-skill-ratchet — "✓ check-skill-line-ratchet: .claude/agents/os-dev.md is 399 lines (ceiling 399; headroom 0)." and "✓ check-skill-line-ratchet: .claude/skills/pm-dispatch/references/platform-readings.md is 134 lines (ceiling 134; headroom 0)."
  • check:pm-skill-id-lint — "✓ check-skill-id-lint: 17 file(s) clean (pattern /#[0-9]{3,}/g)."
  • check:doc-authoring — "✓ doc authoring guard: 389 files clean — no bare metadata literals."
  • check:nul-bytes — "check-nul-bytes: OK (scanned 6446 text file(s) ...)" plus the extra-gate control-byte self-scan on both touched files (no hits).
  • check:agent-model-declared, check:pm-governed-merges, check:skill-frame-sync, check:doc-formula-expressions — all self-tests and scans green (verdict lines in the report comment).

Docs-only .claude/ change: no changeset; skip-changeset label applied via the additive POST with read-back after bots settle.

Governed surfaces — draft PR, human merge only.

Generated by Claude Code


Generated by Claude Code

…atform-readings

git worktree isolates the working tree and HEAD, and nothing else under
.git/ — refs (including refs/remotes/*), the stash stack, config and hooks
are common to every worktree. os-dev.md now states the family rule once
(folding the stash clause into it), records BASE=$(git rev-parse HEAD) at
branch time in the worktree recipe, and anchors "where I started"
reset/diff/log/rebase to the recorded "$BASE", never to origin/main — a
shared pointer another agent's fetch advances, whose soft reset stages
their merged files as yours while reporting success. platform-readings
gains the measured fact row. Ceilinged files pay by in-file deletion of
genuine duplicates and land exactly at their ceilings (399, 134).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MsbKEG4LtERSLaDrbehM3e
@claude claude Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 22, 2026
@os-zhuang os-zhuang self-assigned this Aug 22, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

PM 验收 — ACCEPT(终态)

复核:席位 session_01MsbKEG4LtERSLaDrbehM3e 全 diff 审毕(+17/−13 两文件)。裁定范围逐项落地:家族规则(worktree 只隔离工作树与 HEAD,.git/ 下 refs/stash/config/hooks 皆共享;家族同签名一处陈述覆盖 stash 与共享指针双实例)以配方层写入 os-dev.md——规则 1 增 BASE=$(git rev-parse HEAD) 记录点,「我从哪开始」的 reset/diff/log/rebase 一律锚 "$BASE"、⛔ 永不锚 origin/main。棘轮支付双双核实为真删非 re-wrap:os-dev.md 399/399(规则 6 两句确属重复——锁排队唯一合法等待由规则 7 + 干净收尾完整承载,SIGTERM 中途消融事例由消融条款连同 trap 补救完整承载);platform-readings 134/134(队列分支拼写指向零成本等价物行原文、负向推断句压缩重述,零事实损失)。条件面四文件全部实测「无载体拼写」不扩面——AGENTS.md 961/961 未动,正确。讽刺守卫自证(本单自身以记录 base sha 锚定 diff)。

治理面终态:draft 保持,仅维护者合并;已指派。⚠️ 落地提示:本 PR 入队时同样会撞 Console Pin Gate 的确定性红(与 #11126/#11129 同因)——建议与那两单一起,等 objectui#5710 → #10856 pin bump 落地后一次性重投/入队三单。合并后剥 #10743 状态标。


Generated by Claude Code

@os-zhuang
os-zhuang marked this pull request as ready for review August 23, 2026 00:37
@os-zhuang
os-zhuang added this pull request to the merge queue Aug 23, 2026
os-zhuang pushed a commit that referenced this pull request Aug 23, 2026
…3 maintainer ruling

The merge group for this PR went red on check-skill-line-ratchet: os-dev.md
composes to 401 lines against main (which #11112 took to 395), and to 405 once
the queued #11137 (395→399) lands ahead of it — each PR green alone, over the
ceiling only in composition. Maintainer ruling, 2026-08-23, on this PR
(option B of the three put to them, verbatim): 「B:提天花板 399→405」 —
keep the +6-line cross-repo caveat and raise the ceiling, quoted in the PR
body as the ratchet requires. Sized to exactly 405 so headroom returns to
zero once both queued PRs land.

Gate + 19-case self-test green at this commit.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MsbKEG4LtERSLaDrbehM3e
Merged via the queue into main with commit c9bafab Aug 23, 2026
27 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-10743-shared-refs-family-rule branch August 23, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants