Harden the worktree recipe with --no-track, and name .git/config in the shared-namespace inventory - #13403
Queued
zhuangjianguo wants to merge 1 commit into
Queued
Harden the worktree recipe with --no-track, and name .git/config in the shared-namespace inventory#13403zhuangjianguo wants to merge 1 commit into
--no-track, and name .git/config in the shared-namespace inventory#13403zhuangjianguo wants to merge 1 commit into
Conversation
…it/config in the shared-namespace inventory The prescribed 'git worktree add -b <branch> origin/main' writes the new branch's upstream config (branch.NAME.remote / branch.NAME.merge) into the one .git/config every linked worktree shares, and that write can fail AFTER the branch is created -- leaving a branch with no worktree, a state the recipe never mentions. --no-track skips the config write entirely and still bases the worktree on origin/main; nothing in the agent flow needs the upstream, because 'git push -u origin <branch>' sets one a command later. Line-neutral in both files (AGENTS.md 1162/1162, CLAUDE.md 86/86). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EXxTW8mvPBhoHxmyPZ63de
os-zhuang
marked this pull request as ready for review
August 30, 2026 10:38
os-zhuang
approved these changes
Aug 30, 2026
os-zhuang
enabled auto-merge
August 30, 2026 10:38
os-zhuang
added this pull request to the merge queue
Aug 30, 2026
Any commits made after this event will not be merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #13052
Governed surface — landing posture
AGENTS.mdandCLAUDE.mdare on the governed-surface list, so this is the manual lane: PASS + draft + review request to an authorised approver + status comment. No auto-merge is armed and the PR is not queued (arming it would hit the Governed Surface Queue Guard and burn a queue cycle — the shape recorded on #13034).What landed
Two line-neutral edits, both in the card's remedy #1.
1. The prescribed worktree recipe now carries
--no-track— rootAGENTS.mdPrime Directive #11 and rootCLAUDE.md. This is what stops the half state at its source: with default tracking,git worktree add -bwrites the new branch's upstream keys (branch.NAME.remote/branch.NAME.merge) into the one.git/configevery linked worktree shares, and that write can fail after the branch is created.--no-trackskips the write entirely.2.
AGENTS.md§9 names the file — the shared-namespace inventory'snot the configbecomesnot `.git/config`(+3 bytes, no reflow), so the inventory names the actual shared file rather than a category.The
--no-trackclaim, measured against git itselfReproduced in an isolated scratch repo (bare origin + clone, nothing shared), on the same git this container runs, git 2.43.0:
branch.NAME.remoteafterbranch.NAME.mergeafterworktree add PATH -b BRANCH origin/main(current)originrefs/heads/mainworktree add --no-track PATH -b BRANCH origin/mainworktree add --no-track -b BRANCH PATH origin/mainSo
--no-trackremoves the config write in either argument order and still bases the worktree onorigin/main— the replacement recipe is not weaker on the property the recipe exists for. This very PR's worktree was created with it.Does it change a later
git pull origin main? Measured: no.git pull origin mainin the--no-trackworktree exits 0 and uses the explicit refspec, which never consultsbranch.NAME.merge. Neither instruction file documentsgit pullor--set-upstreamanywhere, so no documented dev flow depends on the removed keys — andgit push -u origin BRANCH, which the flow already prescribes, sets the upstream one command later (observed on this branch's own first push).Incidental, and an argument in the same direction: under the current recipe the new branch's upstream is
origin/main, so a baregit pullin a task worktree mergesmaininto the feature branch silently. Under--no-tracka baregit pullstops with a loud "no tracking information" error instead.What did NOT land, and the arithmetic
The card's remedy #1 also asks that the shared-namespace inventory gain the
.git/configlayer — i.e. the treatmentrefs/stashandrefs/remotes/*get in §9: named, with its mechanism and its consequence. That does not fit, and the shortfall is measured rather than estimated.Both files sit at their ratchet ceiling with zero headroom —
AGENTS.md1162/1162,CLAUDE.md86/86 — so any prose addition must be paid for line-for-line inside the block being edited.-btracking write that hits it · state that the recipe therefore says--no-track): ≈ 190 bytes ≈ +2 lines at §9's ~90-byte wrap.under the name of a "revert", and staged→as a "revert", staged; ~11 from droppingmechanicalin the no-hook sentence; ~9 fromrestore against that commit→restore against it; ~10 of slack on the block's last line).CLAUDE.md: ≈ 75 bytes needed for the excerpt's config clause against ≈ 25 recoverable.The ceiling is load-bearing here, not a formality — ablated and restored:
⇒ the prose half needs a maintainer ceiling ruling, quoted in the raising PR — the route this repo's own ratchet history already uses (the 958→961, 1149→1150, 1150→1158 and 1158→1162 raises). It is escalated on the card rather than smuggled in here.
Worth noting that the card itself pre-authorises this split: its remedy list makes the half-state paragraph conditional — "Recipe hardening: if the recipe stays as it is, add one line about the half state and its cleanup". The recipe did not stay as it is, so the narrative is not the operative guidance; naming the layer still is, and that is the part escalated.
Measured vs inferred — preserved
The card's own split is kept intact and nothing here upgrades it:
git worktree listclean, retry failing on branch-already-exists) — reported from direct observation on the card; and, in this PR, the--no-trackconfig-write behaviour in the table above..git/configbeing one shared file that-bwrites stands on its own, independent of why the write failed.Verification
Gate family re-derived from the actual diff with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(change set read by the script itself, not from a hand-written diff) — it returned exactly the dispatched list, no additions. Union run atd0e2ad434, exit codes captured before any pipe:pnpm check:pm-skill-ratchet✓ AGENTS.md is 1162 lines (ceiling 1162; headroom 0).·✓ CLAUDE.md is 86 lines (ceiling 86; headroom 0).pnpm check:pm-governed-prose✓ 2 instruction surface(s) name all 5 registered governed surfaces … and claim no others.pnpm check:pm-governed-merges✓ check-governed-merges --self-test: 204 assertions …pnpm check:agent-test-spelling✓ 0 violations — 402 file(s) · 4883 bare -- token(s) …pnpm check:docs-audit-scope✓ docs-accuracy-audit scope is in sync with content/docs/: 189 hand-written doc(s).pnpm check:pm-skill-id-lint✓ check-skill-id-lint: 23 file(s) clean (pattern /#[0-9]{3,}/g).pnpm check:required-contexts✓ 6 required context name(s) pinned across 2 workflow(s); 5 instruction surface(s) scanned …node scripts/check-required-contexts.mjsnode scripts/check-nul-bytes.mjscheck-nul-bytes: OK (scanned 7426 text file(s) … no raw ASCII control bytes).check:required-contextsfirst exited 1 withPREREQUISITE NOT MET — the dependency yaml is not installedin a fresh worktree. That is a not-measured result, not a red gate — it was re-run green afterpnpm install, and both readings are recorded rather than the convenient one.Also verified: no line exceeds the 120-byte budget (
AGENTS.md235 → 113 bytes, 236 → 99, 397 → 87);CLAUDE.md32 is 132 bytes and is inside a fence, whichclassifyLineexempts by shape.Changeset
None, and
skip-changesetapplied. This diff publishes nothing from any package — two repo-root instruction files. The Check Changeset gate has no path-based exemption (it counts added.changeset/*.mdagainst the merge base), so the label is the mechanism, and it is the standing precedent for this exact surface: the last eight commits touchingAGENTS.mdcarry no changeset, including #11934, which last edited this very recipe in both files.Out of scope
The same recipe text lives in
objectui(CLAUDE.md:16andAGENTS.md:234, both verified locally) and probablycloud. Not touched here — filed as objectstack-ai/objectui#6880 after a dedup search returned only prior members of the same family, none of them open, so the drift is tracked in the repo it lands in rather than widening this PR.Generated by Claude Code