Skip to content

feat(pm): git-history ancestor and dev-worktree.sh take over two procedures os-dev retyped by hand - #38018

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-35237-slice7-ancestor-worktree
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-35237-slice7-ancestor-worktree

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Part of #35237

Clause-②: no
Metadata-protocol: none
Rule-change: none

Slice 7 of the card (the last slice its release notes name): git-history ancestor and dev-worktree.sh, with the os-dev.md pointers. The card stays open for the seat to judge its done-when across all seven slices.

维护者速读

  • 用户能看到什么变化:用户无感。开发 agent 开工时「建自己的工作区」和判断「某个提交是否已经在主干里」这两件事,从每次手敲一串命令,改成各跑一个脚本。
  • 为什么做:这是「把技能里反复手敲的流程做成脚本」这张卡的最后一片;手敲版在不完整的代码副本上会把「其实已经合入」读成「没合入」,而且看不出任何异常。
  • 出错会怎样:只影响车队内部工具,不动产品代码。脚本拿不准时拒绝回答而不是给一个错答案,不明说就不向远端推送任何东西;发现问题可以整体撤回这一个改动。
  • 要你做什么:合并这一个改动(它改了开发 agent 的规则文件,属于要你点头才落地的范围)。

What changes

Angle-bracket placeholders of the source files are spelled as capital words below (N, SLUG, REPO, SHA, BRANCH).

1. node scripts/pm/git-history.mjs ancestor --commit=SHA [--ref=origin/main] [--control=SHA]

What it mechanises: the two-leg procedure of references/dev-traps.md 〈浅检出上的祖先读数〉. git merge-base --is-ancestor on a shallow clone fails in one direction only: exit 0 proves itself, and exit 1 is also what a shallow cut produces for a real ancestor that sits below it. The prose had a dev run a second leg by hand (a commit known to be in the ref's history, at least as deep as the tested one, must answer 0 on the same clone), deepen until it does, and read again.

The command runs both legs and prints yes or no alone on stdout, with both legs and the exit code git gave each in a one-line receipt on stderr:

  • a yes prints at once and never fetches;
  • a no stands only when no cut can hide the tested commit: the ref's history carries no graft at all, or every graft boundary under the ref is older than the tested commit by the skew margin. The newest boundary is the control leg, and that leg is run;
  • --control=SHA adds the operator's own leg on top. It must answer 0 and must not be newer than the tested commit (a near relative inside the shallow window is refused);
  • otherwise it climbs the same additive ladder touch climbs (--deepen=N doubling, then --unshallow) and reads again, and refuses with exit 2 and empty stdout when the negative still cannot be told from a cut;
  • a boundary walk that could not be read is refused too. It is never taken for a complete history, which is the one reading that proves a no.

Three decisions (each judged to hold by the contract review of the first head):

  1. The control is chosen by the tool. The floor is the one commit that is always in the history and always deep enough, and it covers a second cut on another line of a merged history, which one hand-picked control does not.
  2. A proven no exits 3. Not 0, so ancestor … && echo landed cannot read a no as a yes. Not 1, because 1 is this tool's usage exit. The other commands keep their exit contract.
  3. "Deeper" is read by committer date, with --margin-days (default 7) as slack. A history whose committer dates run backwards along ancestry defeats it; a complete clone needs no such assumption. The file header says so.

2. bash scripts/pm/dev-worktree.sh --branch=claude/issue-N-SLUG [--probe]

What it mechanises: rule 1 of os-dev.md (Worktree-first), step by step, in the rule's own order.

Rule 1 line What the script runs
build the worktree from a fetched origin/main git fetch origin main, then git worktree add --no-track beside the checkout, named REPO-issue-N from the branch (--worktree=NAME when the claim names it)
Resume-from: BRANCH@SHA --resume-from=BRANCH@SHA: the same-name branch from origin/BRANCH, after checking that its tip is that sha. The merge of origin/main stays os-regen-merge.sh's; the script names it
record BASE before the first edit HEAD is pinned in a file in the worktree's own git dir; --base prints it. A resumed branch pins after its merge with --pin-base. A pin is never moved
push the empty branch before any edit only with --probe: git push -u origin BRANCH
a card-thread branch is never pushed the default. With no flag nothing is pushed, whatever the branch is called; --no-probe says the default out loud
403 stops, only a network error is retried exit 3 after one push on a 403; a network error is retried on --backoff (default 2, 4, 8, 16 s) and then given up with exit 4; any other refusal is exit 5 with no retry
issue-N/ under the scratchpad --scratchpad=DIR
pnpm install in the tree run last (--no-install skips it)

Nothing is pushed on a spelling alone. A branch name cannot tell a self-built branch from the alias a card thread builds its tree under, so no name is probed by default. A run without --probe prints PROBE=skipped and the line that says what a self-built branch still owes; the same command with --probe completes it.

It never forces: no --force, no -B, no checkout in the shared tree. An existing path, an existing local branch, or a branch already on origin with no --resume-from is refused before anything is created. A second run for a tree it already built re-creates nothing, and with --probe sends the probe only if the branch is still empty and absent from origin.

The build starts from a checkout, because that is where git worktree add runs. Every WRITE there is refused: the tree is always built beside the checkout, and --pin-base refuses in the shared checkout.

Not mechanised, and why: the merge of origin/main on a resume (already os-regen-merge.sh); the clean-up step; a card thread whose platform branch is already checked out in the shared tree (the script refuses an existing local branch, so that case stays by hand, and now pushes nothing either way).

3. The pointers

File Line Before After
os-dev.md rule 1, command line git fetch origin main && git worktree add --no-track ../REPO-issue-N -b claude/issue-N-SLUG origin/main bash scripts/pm/dev-worktree.sh --branch=claude/issue-N-SLUG:自 origin/main 建 ../REPO-issue-N。
os-dev.md rule 1, probe line 建好分支后先推空分支(任何编辑前 git push -u origin BRANCH):落地标记兼写路由探针。 建好分支后先推空分支(任何编辑前 dev-worktree.sh --probe):落地标记兼写路由探针。
dev-traps.md control-leg line 它必须答 exit 0;否则阴性作废,git fetch --deepen / --unshallow 到控制腿转 0 再重读。 它必须答 exit 0;否则阴性作废,加深到控制腿转 0 重读;现读 git-history.mjs ancestor。

Every other line of rule 1 and of the dev-traps section is unchanged, the card-thread ⛔ line included. Each changed line keeps its rule sentence and names the script as its reading; only the typed command leaves.

The os-dev.md ancestor line is back to main's text. The first head appended the reader to it. Naming the script on the probe line costs 26 bytes, the file sits at its 33504-byte ceiling, and that line was the only place the bytes could come from without cutting a rule sentence. The line still orders the dev-traps section read before any ancestor judgment, and that section's control-leg line names git-history.mjs ancestor. The form that keeps all three pointers was measured and fits at exactly 33504 bytes, but only by writing the probe line as 「加 --probe」 with no script name, naming git-history.mjs without its subcommand, and dropping bash from the command line.

Why Rule-change: none holds: the three lines change which command is typed, not what a dev may do, in what order, or what goes to the maintainer. The worktree is still built before any edit from a fetched origin/main, the base is still recorded before the first edit, the empty branch is still pushed before any edit by the dev who owns a self-built branch, a card-thread branch is still never pushed (now by default), a 403 still stops with no retry, and a negative ancestor reading still owes a control leg that answers 0.

Budget: os-dev.md 356 → 356 lines, 33504 → 33500 bytes (ceiling 33504, not moved); dev-traps.md 34 → 34 lines, 2627 → 2627 bytes (ceiling 2627). Whole PR: 1683 changed lines (+1671 / -12) over 5 files.

4. Wiring

git-history.mjs --self-test already runs in lint.yml's shallow-history step. dev-worktree.sh --self-test joins the existing check:pm-with-fleet chain in package.json. No new CI job, no workflow edit.

Tests

Both self-tests carry a named-battery floor and a verdict handshake.

Self-tests at b829905
node scripts/pm/git-history.mjs --self-test      exit 0   git-history --self-test: all cases passed.   (123 cases, 7 batteries; the ancestor battery registers 38)
bash scripts/pm/dev-worktree.sh --self-test      exit 0   ✓ dev-worktree self-test: 85 cases pass across 7 batteries — offline, a bare fixture origin, no network.

The ancestor battery reproduces the defect first, on a 40-commit repository cloned at depth 5 (git 2.43.0):

git merge-base --is-ancestor X origin/main exit
c38, inside the window 0
c2, in main's real history, its object not in the clone 128
c2 again, after its object was fetched by sha 1
a commit built on c2 that never merged 1

The dev-worktree self-test builds real worktrees against a bare origin in a temp dir. A git shim on PATH answers the probe from a plan (403, network, other, or the real push) and counts the pushes; a pnpm shim records the install.

Cases added by the review round:

  • no flag, the claude/issue-N-SLUG spelling: the tree is built, zero pushes, origin has no such branch, the base is pinned; the same command with --probe then sends one push;
  • a branch under any other spelling needs no flag and is not pushed; --no-probe is still accepted;
  • an injected boundary walk that answers null reads unreadable, on the clone and the commit whose honest reading is no;
  • an injected parent read that answers null makes the complete clone's root an undecided boundary, and an undecided boundary proves nothing;
  • the floor's control leg carries the exit code git gave for it;
  • a real blob's sha as --commit on a complete clone is usage (exit 1), where it was answered no.
Ablations (each through scripts/ablation-replace.mjs; mutation proven on disk, restore proven blob == HEAD)

At b829905e0, for the review round:

File Mutation Self-test
dev-worktree.sh the default probe mode is probe again exit 1, 5 red (the no-flag case first: one push where zero is pinned)
git-history.mjs the boundary walk is read with a fallback to the empty list again exit 1, 1 red (the injected null walk reads no)
git-history.mjs an unreadable parentless commit is not recorded exit 1, 2 red
git-history.mjs the prefix problem is not turned into usage exit 1, 1 red (the blob case)

The first attempt at the second row did not run: its anchor occurred twice in the file and the tool wrote nothing. It was re-run with a longer anchor.

At 6bf1b0608, for the first head (the graft-boundary row is superseded by the two rows above; the others still describe current code):

File Mutation Self-test
git-history.mjs the floor comparison accepts any boundary exit 1, 8 red
git-history.mjs the near-relative check on --control never fires exit 1, 3 red
git-history.mjs no parentless commit is read as a graft boundary exit 1, 11 red
dev-worktree.sh the 403 pattern never matches exit 1, 7 red
dev-worktree.sh --no-probe is not honoured exit 1, 1 red
dev-worktree.sh a branch already on origin is logged instead of refused exit 1, 2 red
dev-worktree.sh the Resume-from sha is not compared with the tip exit 1, 2 red
Live readings on this container's shallow clone (one graft boundary under origin/main, dated 2026-11-16)
ancestor --commit=d44b5e3d --no-fetch     yes   exit 0   (the squash commit of this card's slices 3, 5 and 6)
ancestor --commit=d1a21fcaf --no-fetch    no    exit 3   tested leg exit 1 · control leg 8436f67a2 exit 0 (2026-11-16, at least 7 days older)

Taken at the first head. d1a21fcaf is this branch's own first commit, so the no is true. dev-worktree.sh was run live only on paths that write nothing to origin. A live fresh build with --probe would leave a probe branch on origin that no seat can delete, so that path is measured in the self-test only; the classifier has not seen this platform's own refusal text, and a line it cannot place reads other (exit 5, stop, no retry).

Review round 1

The contract review of the first head (e1dcc0304) answered FAIL with one mandatory finding (M1) and one recommended one (S1). At b829905e0:

  • M1, taken on the seat's route. The script never pushes on a spelling alone, and rule 1's probe line names the script with --probe.
  • S1, taken. A boundary walk that cannot be read is unreadable (exit 2); a parentless commit whose parents cannot be read is an undecided boundary, which proves nothing.
  • N1, taken. A hex string that is ambiguous, or that names an object which is not a commit, is usage.
  • N2, taken by running the leg. The floor's control leg is run and the receipt prints the exit code git gave.
  • N4, taken, all three. A git worktree add that fails after making the branch is refused with a verdict that names the branch it left; the refusal for a path that holds another branch names --worktree=NAME; an unpinned tree is told its base is unpinned, not that it "is no longer an empty branch".
  • N3 and N5, left as recorded. The classifier's uneven edges are bounded and on the stopping side; the usage line does not yet say that a proven no is proven against the ref as last fetched.

Acceptance notes

  • --pin-base pins HEAD. It is the base only while the tree's first edit is still ahead, and the script says so when it finds a tree it did not build.
  • The margin is a heuristic and is named as one. A no proved by the floor rests on committer dates being monotone along ancestry within --margin-days. A complete clone is the assumption-free leg.
  • Raw merge-base --is-ancestor is still spelled in four reference files outside this surface (cross-repo-coordination.md, lanes/security.md, readings-queue.md, readings-shell.md). They are seat procedures, not the dev's; the seat carries them on the card.
  • AGENTS.md names git-history.mjs for the windowed question only. It is outside this surface and unchanged.
  • os-dev.md is 4 bytes under its ceiling. The ceiling row lives in the ratchet script, which is outside this surface, so it was not lowered here.
  • Ablations were run although os-dev.md lists scripts among the things not ablated: each one mutates a behaviour a self-test pins.

Verification

Read first (by risk):

  1. .claude/agents/os-dev.md: two lines of rule 1 (the command line and the probe line). This is fleet rule text; judge Rule-change: none here.
  2. scripts/pm/dev-worktree.sh: the probe-mode default in mode_build, probe_push and classify_push_failure. This is the only code in the PR that writes to origin, and it runs only under --probe.
  3. scripts/pm/git-history.mjs: graftBoundaries, negativeIsProven and ancestorReading. This is the proof a no rests on.

Two-minute check: bash scripts/pm/dev-worktree.sh --self-test && node scripts/pm/git-history.mjs --self-test. Expect the two success lines quoted under Tests, exit 0, in about 15 seconds.

Gates and CI at b829905
Local, at b829905e0 (tree clean):
  dispatch-gates --commands   84 derived families (5 paths vs merge base 4af32b99d)
  all 84 run, each exit recorded before any pipe: 78 exit 0, 6 exit 3 (PREREQUISITE NOT MET)
  dispatch-gates --ran        exit 0  "84 derived famil(ies) accounted for — 78 run, 6 NOT-MEASURED (6 DERIVED from a recorded exit 3)."
  NOT MEASURED locally (they read a built dist; the diff touches no package, so none was built):
    check:doc-formula-expressions, check:dts-closure, check:dual-build-cjs-loads,
    check:i18n-coverage, check:lean-entry-closure, check:sourcemap-no-sources-content
  named inside the 78: check:pm-with-fleet, check:pm-skill-ratchet (os-dev.md 33500/33504, dev-traps.md 2627/2627),
    check:pm-skill-id-lint, check:pm-governed-prose, check:pm-dispatch-gates, check:bash32-floor,
    check-self-test-wired, check:nul-bytes, check:commit-card-trailers

CI check-runs on b829905e0, read when the local round ended: 59 runs — 45 success, 10 skipped, 0 failed,
  0 in_progress at the seat's re-read after the run finished: 60 runs, 50 success, 10 skipped, 0 failed.
  success: Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard,
    PR-body guards. The pull reads mergeable: true.

…e or refuses

`git merge-base --is-ancestor` answers exit 1 for a real ancestor that
sits below a shallow cut. `ancestor` runs the tested leg and a control
leg: a yes prints at once, a no stands only when the ref's history is
complete or every graft boundary under it is older than the tested
commit, and anything else deepens and then refuses with empty stdout.
A proven no exits 3, so it is neither a yes nor the usage exit.

Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ
Co-authored-by: Claude <noreply@anthropic.com>
…ev names both readers

dev-worktree.sh builds the task's worktree beside the checkout from a
freshly fetched origin/main (or from origin/BRANCH at a claimed
Resume-from sha), pins the base in the worktree's own git dir, sends
the empty-branch probe (a 403 stops, only a network error is retried),
makes the issue's scratchpad directory and runs pnpm install. A branch
declared platform-assigned is never pushed, and nothing is forced.

os-dev.md rule 1 and its ancestor line, and the dev-traps section they
point at, keep their rule sentences and name the two scripts; both
files are byte-neutral.

Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ
Co-authored-by: Claude <noreply@anthropic.com>
…what --pin-base pins

Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ
Co-authored-by: Claude <noreply@anthropic.com>
…ice7-ancestor-worktree

Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 27, 2026
@github-actions github-actions Bot added size/xl dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation labels Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ

Contract-review-claim: session_01ASNY8UcT2uJmgTyCPnMiMZ · head e1dcc03 · 2026-11-27T19:03Z

The dispatching seat runs this head's contract-tier review in an isolated at-tier sub-agent (contract-review.md); the record follows on this PR.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e1dcc030470fc3e5fa9025da1347df93de12e149
Local-runs: none
Scope: .claude/agents/os-dev.md, .claude/skills/pm-dispatch/references/dev-traps.md + scripts/pm/git-history.mjs, scripts/pm/dev-worktree.sh, package.json
Rule-change-verified: none

PR #38018 (slice 7 of card #35237), reviewed at the head above against merge-base 4af32b99d. Read: the card body and all 27 comments, the PR body, the five-file list, the net diff, and the 65 check-runs on the head (51 success, 14 skipped, 0 failed or pending). Nothing was built, run or re-run. Placeholders are spelled as capital words (N, SLUG, REPO, BRANCH, SHA).

One must-fix (M1), one should-fix (S1), five nits. The two scripts are careful work and the ancestor proof is sound; the FAIL is on the agreement between rule 1's text and what the script it now names does by default.

① Derived judgments

  • git-history.mjs gains ancestor, and exit 3 for it alone. Right. count, log, ensure and touch keep 0 / 2 / 1. --commit and --control on those commands were already usage (unknown option), so nothing narrows.
  • ancestor --commit accepts any revision that resolves, or 7–64 lowercase hex that does not; a name that resolves to nothing is usage. Right on a shallow clone (an absent sha is refused, exit 2). On a complete clone an absent sha is a no: right for a sha that is truly absent, wrong in one corner (N1).
  • dev-worktree.sh probes by default only a branch spelled claude/issue-DIGITS followed by - or the end; any other name must say --probe or --no-probe. Right as a refusal to guess. Wrong as the only guard, because the default arm is the spelling rule 1 itself prints (M1).
  • The probe classifier reads 403 before network, and anything it cannot place as other (no retry). Right in order and in its safe side. Two uneven edges (N3).
  • package.json: check:pm-with-fleet also runs dev-worktree.sh --self-test. Right. The family already runs in lint.yml (pnpm check:pm-with-fleet, job Lint · repo & tooling gates, success on this head, failures collected over every step). git-history.mjs --self-test already runs in the same job. No workflow edit, no new job.
  • Byte ratchet. Right. os-dev.md is 33504 bytes at the head and at the merge-base (ceiling 33504); dev-traps.md is 2627 and 2627 (ceiling 2627). No ceiling row moved. Every changed line is at or under 120 bytes.
  • No published surface. Right. No workspace package, schema, generated artifact or product path is in the diff; the root package.json is private.
  • Security. No hits path is under skills/** or ui/skills/**, so this face's record carries no Security-touching line. No changed hunk teaches permission, sharing, credential, token or authentication behaviour: the 403 rule line is unchanged, and the probe line only loses its typed command.
  • Rule change. The body declares Rule-change: none, and it holds hunk by hunk. os-dev.md:27 swaps a typed command for a script; :31 drops a typed command and keeps its sentence; :194 and dev-traps.md:24 add a reader. None changes what a dev may do without the maintainer, the order of grading, dispatch or scope, or what goes to him. M1 is a disagreement between an unchanged ⛔ line and the script's default, not a change of rule.

② Semver level

skip-changeset is right: the diff publishes nothing (.claude/**, scripts/pm/**, one scripts entry of the private root package.json). Check Changeset is success on the head. The body's line Clause-②: no is right: no product contract, metadata key or spec path moves, and Metadata-protocol: none is right for the same reason.

③ Boundary flags

The PR body's three decisions:

  1. The control is chosen by the tool (the newest graft boundary under the ref). Holds. A real ancestor the walk missed lies below some boundary, and that boundary is its descendant; when every boundary is older than the tested commit by the margin, none can hide it. The operator's --control can only add a requirement. This is stricter than the hand procedure, and only in the refusing or deepening direction.
  2. A proven no exits 3. Holds. 0 would let ancestor … && echo landed read a no as a yes, and 1 is this file's usage exit.
  3. "Deeper" is committer date with --margin-days (default 7). Holds as a named heuristic; the file header says what defeats it, and a complete clone needs none of it.

Report 7223320514, deviations:

  • package.json in the order vs in the claim. The claim amendment 7213829354 lists the chain wiring in this surface; it governs. PR feat(pm): round-open.mjs and check-handover --inflight read the round-open mutex and the in-flight check #37878 has since merged (ebb2d82527) and changed a different line (check:pm-prior-rulings). That line is the only drift on these five files between the merge-base and origin/main 6e2a8f2bb, and GitHub reads the PR mergeable: true, mergeable_state: clean.
  • Merge commit message amended before the push to carry the trailer pair; the earlier merge carries none. History only, no tree effect; nothing was forced on a pushed ref. The trailer-less merge is carrier item 7's subject, not this PR's.
  • Model-free trailers. As AGENTS.md has it.
  • Ablations run on scripts. More evidence than the rule asks for; each restore was proven. No effect on the tree.
  • "Refuses to run inside the shared checkout" read as "no write there". Accepted. The typed command the script replaces also ran from the shared checkout. The script reads it through -C "$top" (fetch, ls-remote, show-ref, rev-parse, worktree), builds the tree beside it, and --pin-base refuses there.
  • The probe path was never run live. Accepted, with its limit named: the 403 and network strings in the self-test are git's and GitHub's stock lines, and this platform's own push refusal text has not been seen by the classifier. A miss lands on other (exit 5, stop, no retry), the safe side. The first live fresh build is the measurement.
  • This tree's own base is in the scratchpad, not pinned by the script. Fine; the script did not exist when the tree was built.

Report 7223320514, not_done:

  • 29 derived families not re-run at the final head. Answered by CI. Each of the 29 names is invoked by a workflow at this head (read in .github/workflows), and the head's check-runs are 51 success, 14 skipped, 0 failed.
  • overlap-check.mjs not re-run at the head. Answered by the mergeable reading and the drift reading above.
  • Check-runs unread, body still WIP. The check-runs are read here. The body's Verification block is stale by its own statement and the seat's issue_patch owes the final text before the PR leaves draft; its two machine lines (Clause-②: no, Rule-change: none) are present and correct. If M1 is fixed in the rule text, the body's pointer table changes with it.
  • Contract-tier review owed. This record.

open_questions: none. out_of_scope_findings: the four reference files that still spell raw merge-base --is-ancestor as a hand procedure, and AGENTS.md naming git-history.mjs for the windowed question only. Both are outside the claim's surface and are right to stay out of this PR. Escalated to the seat as carrier items on #35237 (the report says "noted, not filed"; they belong in the carrier list beside items 3–10).

SQL push-down: not applicable. The diff holds no data access, no id materialisation and no in-app join.

④ Design judgment

.claude/agents/os-dev.md (hits)

  • :27, the command line. Holds for a self-built branch. The line keeps its sentence (from origin/main, tree named REPO-issue-N) and names the script. The script does what the removed command did: git fetch origin main, then git worktree add --no-track beside the checkout with a new branch (dev-worktree.sh:326, :334). A claim with Resume-from: run through this line is refused and routed to --resume-from (:330), so line 28 needs no flag of its own.
  • :31, the probe line. Keeps its rule sentence; the typed push left; it names no reader (M1).
  • :194, the ancestor line. Holds. The sentence is kept and git-history.mjs ancestor is named as its reading.

M1 (must-fix) — rule 1 no longer says that its script pushes, and the ⛔ on line 32 can only be obeyed with a flag the rule never names. Line 27 says of the script only that it builds the tree. Run exactly as line 27 spells it (--branch=claude/issue-N-SLUG), the script also sends git push -u origin BRANCH: an unset probe mode plus the issue spelling selects probe (dev-worktree.sh:290-292), and the push is sent at :361. Line 32 (unchanged) says a card-thread branch is platform-assigned and is ⛔ never given the empty-branch push. Before this PR a dev typed worktree add, read line 32, and pushed nothing. After it, the push has happened inside step one unless the dev passed --no-probe, which appears in the script's header and usage and nowhere in os-dev.md.

The script's own guard is real and tested: a name that is not the issue spelling stops with usage and says which flag a card thread takes (:294, self-test "will not guess"). The hole is the rule's own spelling. A card thread whose platform branch is checked out in the shared tree cannot reuse that name (the script refuses an existing local branch, :312; the PR body says this case "stays by hand"), so the dev needs a local alias, and the alias line 27 prints is the issue spelling. That alias is then pushed to origin under a name the platform did not assign. Where the thread may push only its own branch (the measured case in claim 7022183772), the answer is a 403, the script prints VERDICT blocked-403, and line 33 turns it into a false blocked report. Where the push is allowed, origin keeps a probe branch nobody uses, which the PR body itself calls one "no seat can delete".

This is also the done-when form of Release: 7017468070 unmet on a changed line: line 31 kept its sentence and lost its procedure, but does not name the script as its reading. On a self-built branch the cost is only a second, harmless push by a dev who does not know the first was sent. On a card thread it is the breach above.

Fix, either of: (a) line 31 names the script as the probe's reading and line 32 names --no-probe, paid for inside the 33504-byte ceiling; (b) the script stops defaulting, so the probe is never sent on a spelling alone. Whichever is taken, a self-test case should pin it and the PR body's pointer table should follow.

.claude/skills/pm-dispatch/references/dev-traps.md (hits)

:24 holds. The sentence is kept (the control must answer 0; otherwise the negative is void; deepen until it does; read again); the two git spellings became 「加深」 and the reader is named. The section's unchanged lines were checked against the script one by one:

dev-traps line ancestor
exit 0 proves itself in any checkout; only exit 1 owes a control a yes returns before any boundary or control is read and never fetches (git-history.mjs:880-883)
a negative is written on two legs, same checkout, same ref tested leg by merge-base --is-ancestor; control = the newest graft boundary under the same resolved ref, or the operator's --control run on it
the control must answer 0, else void; deepen and re-read a --control that is absent or answers non-zero is unproven, climbs --deepen doubling then --unshallow, and reads again (self-test "curedControl")
⛔ no near relative: the control is at least as deep as the tested commit the floor must be older than the tested commit by the margin; a --control newer than the tested commit is refused with no ladder climbed
both legs' exit codes go in the report both are in the stderr receipt (see N2 for the floor leg)
the shallow flag is a trigger, not the criterion the predicate is the graft boundaries under the ref; a depth-20 clone answers no without fetching while still shallow

scripts/pm/git-history.mjs (implementing)

Tried and held: a real ancestor below the cut with its object present (raw exit 1) is refused, then deepened to yes; an absent sha on a shallow clone is refused; an unresolvable ref, a ref with no remote to deepen from, --no-fetch, a mistyped flag, a missing --commit and a positional sha are each exit 2 or 1 with empty stdout, never 3; several cuts under a merged history are decided by the newest; a boundary with no readable date decides nothing. A no is never printed on the shallow flag alone.

S1 (should-fix) — an unreadable boundary read is taken for a complete history, the one value that proves a negative. ancestorReading reads graftBoundaries(cwd, refSha) ?? [] (:893), and negativeIsProven answers proven, by: complete for an empty list (:845). graftBoundaries returns null when its git rev-list fails for any reason, because git() with allowFail maps every failure to null (:292-304), not only an unresolvable ref as its docblock says. Inside it, isGraftBoundary answers false when a commit's parents cannot be read (:603, :605), which also reads "real root". So a failed spawn or a failed object read between the tested leg and the boundary walk turns "could not look" into no, exit 3, with the receipt "every root under the ref is a real root". The file's two existing callers of the sibling read refuse on null (:369, :505); this one is the exception. It needs a failure that hits only that call, so it is rare, but it is the fail-open this command exists to end, and the fix is to return unreadable (exit 2) on null, count an unreadable parentless commit as an undecided boundary, and pin both with an injected case.

Nits:

  • N1 (nit) — a hex prefix that is ambiguous among commits resolves to nothing (commitShaOf, :770), passes the hex test at :1230, and on a complete clone is answered no with "is not an object in this clone". Git's own answer, read on the shared checkout: git rev-parse --verify --quiet 0148^{commit} exits 1 with two commits under that prefix. At the 8–10 hex this fleet quotes the chance is negligible; the receipt would still be untrue. Refusing an ambiguous prefix as usage closes it.
  • N2 (nit) — on a floor-proven no the receipt prints control leg SHA exit 0 (:1298) for a merge-base that was not run. It is true by construction, but the same file's absent-sha case is praised in its self-test for not "quoting an exit code git never gave". Run the leg, or say "by construction" in place of the number.
  • N3 (nit) — the classifier reads RPC failed; HTTP 401 (and any non-403, non-5xx status in that form) as network and retries it four times, while the bare 401 line reads other; OpenSSL's "Connection was reset" and an HTTP/2 stream error read other and are not retried. Both are bounded and neither is a loop.
  • N4 (nit) — refuse prints "nothing was created" after a failed git worktree add (dev-worktree.sh:335), which can leave the new branch behind; the refusal for a path that holds another branch (:308) does not name --worktree=NAME, the flag a second PR on one card needs; PROBE=owed tells an unpinned but still empty tree that it "is no longer an empty branch".
  • N5 (nit) — a no never fetches, so it is proven against the ref as last fetched: a commit that landed after the last fetch reads no. The receipt names the ref sha and the tip date, and the hand procedure had the same reach; a word in the usage line would stop "PROVEN" being read as "fresh".

scripts/pm/dev-worktree.sh (implementing)

Rule 1 line by line: tree from a fetched origin/main, beside the checkout, --no-track, new branch — agrees. Resume-from — agrees: same-name branch from origin/BRANCH after the tip is checked against the claimed sha; the merge is left to os-regen-merge.sh and named; the base is pinned after it. Never edit the shared checkout — agrees. Base before the first edit — agrees (pinned at creation, read back by --base, never moved). Empty-branch push before any edit — sent, before pnpm install; the pre-push hook passes on a fresh tree without dependencies (read in .githooks/pre-push and scripts/check-regen-pending.mjs). Card thread never pushed — does not agree by default (M1). 403 stops, only a network error is retried — agrees: one push and exit 3; network on a bounded schedule, then exit 4; anything else exit 5 with no retry. Scratchpad and install — agree.

Tried and held: nothing forces (no --force, no -B, no checkout or reset in the shared tree; the one + refspec updates a remote-tracking ref only); an existing path, an existing local branch and a branch already on origin are refused before anything is created; a moved Resume-from tip is refused; a re-run never pushes work as a probe (owed); a 403 that carries transport words is still a 403; --pin-base refuses in the shared checkout and refuses a second pin; a run from inside another worktree still builds beside the main checkout. Beyond the replaced prose the script adds two refusals (branch already on origin; Resume-from sha not the tip) and the pin file; all three are on the stopping side and none widens what a dev may do.

package.json (implementing) — holds; see ①.

A fix for M1 and S1 earns a delta review at its head.

Implemented-by: claude/issue-35237-slice7-ancestor-worktree
Reviewed-by: session_01ASNY8UcT2uJmgTyCPnMiMZ

VERDICT: FAIL

…y walk is never a complete history

dev-worktree.sh sent the empty-branch push by default for the very
spelling rule 1 prints, so a card thread's alias could be pushed under
a name the platform never assigned. No spelling is probed by default
now: the push needs --probe, --no-probe says the default out loud, and
os-dev rule 1's probe line names the script with --probe.

git-history ancestor read a failed boundary walk as an empty list, the
one value that proves a negative. A walk that cannot be read is
refused, a parentless commit whose parents cannot be read is an
undecided boundary, the floor's control leg is run and its exit code
printed, and a hex prefix that is ambiguous or names a non-commit is
usage.

Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ

Contract-review-claim: session_01ASNY8UcT2uJmgTyCPnMiMZ · head b829905 · 2026-11-27T19:49Z

Delta review of fix round 1 for record 7226409572 (M1, S1), by the same isolated at-tier reviewer. The PR body was replaced with its final (non-WIP) text at this head by the seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b829905e0a2886bdf737684b3d157975c869602d
Local-runs: none
Scope: .claude/agents/os-dev.md, .claude/skills/pm-dispatch/references/dev-traps.md + scripts/pm/git-history.mjs, scripts/pm/dev-worktree.sh, package.json
Rule-change-verified: none

Delta review of PR #38018 on record 7226409572 (FAIL at e1dcc0304: M1, S1, N1–N5). Judged: the one fast-forward commit e1dcc0304..b829905e0 (three files), the lines it made me re-read, the dev's report 7226877140, the PR body as it now stands, and the check-runs on the new head (64 runs: 51 success, 13 skipped, 0 failed, 0 pending). Nothing was built, run or re-run. Placeholders are spelled as capital words.

M1 closed. S1 closed. N1, N2 and N4 closed; N3 and N5 left as nits. Two new nits (N6, N7). No must-fix, no should-fix.

① Derived judgments

  • dev-worktree.sh: the push has one arm, --probe. Right. With no flag every spelling is built and nothing is pushed (:300-301); probe_push is reached only when the mode is probe (:372, :381), and only --probe sets it (:915). The earlier usage stop for a non-issue spelling is gone, which widens what is accepted, on the non-writing side only.
  • ancestor --commit: an ambiguous hex prefix, or a hex string that names a non-commit object, is now usage (exit 1). Right. Both were answered no on a complete clone before.
  • ancestor: an unread boundary walk, an unreadable parentless commit, and a floor whose control leg does not answer 0 are refusals (exit 2). Right. Each was a no (exit 3) or an unrun leg before.
  • Byte ratchet. Right. os-dev.md is 33500 bytes (ceiling 33504, not moved), dev-traps.md 2627 (ceiling 2627, untouched this round). The two changed rule lines are 118 and 112 bytes.
  • File list and faces. Unchanged: the same five paths, the same hits, the rules face.
  • Rule change. Rule-change: none still holds, and the script's new default does not touch it. The PR's diff of os-dev.md against main is now two lines: :27 swaps a typed command for the script, and :31 swaps the typed push for dev-worktree.sh --probe. Lines 32 and 33 and line 194 are main's text. A script default is not rule text. What it changed is which act sends the push, and it changed it back to the order main has: building a tree pushes nothing, and the empty-branch push is its own named act, owed on a self-built branch and forbidden on a card thread. Nothing alters what a dev may do without the maintainer, the order of grading, dispatch or scope, or what goes to him.
  • Security. As in the first record: no hits path is under skills/** or ui/skills/**, and no changed hunk teaches permission, credential, token or authentication behaviour.

② Semver level

Unchanged. skip-changeset is right (nothing published is in the diff), and the body's Clause-②: no and Metadata-protocol: none are right.

③ Boundary flags

Report 7226877140, deviations:

  • os-dev.md:194 returned to main's text to pay for M1's bytes. Judged in ④: acceptable, and the right one of the two forms offered.
  • The ceiling row for os-dev.md was not lowered to 33500. Accepted. The row lives in check-skill-line-ratchet.mjs, outside this claim's surface, and the ratchet check is green with 4 bytes of headroom. Carrier: the seat, with the first record's two carrier items.
  • No merge of origin/main this round. GitHub reads the PR mergeable: true, mergeable_state: clean at this head.
  • Model-free trailers; ablations run on scripts. As answered in the first record.
  • CI read once with four Test UI shards in progress. Read here complete: 51 success, 13 skipped, none failed or pending. The 13 skipped are the opt-in and conditional runs (upgrade harness, packed-tarball smoke, dogfood shards, temporal conformance, queue verdicts, duplicate label, changeset and size runs).

open_questions: none. out_of_scope_findings: none this round. N3 and N5 are left by the dev as recorded; both are nits and neither holds the round. The PR body is no longer WIP, carries its three machine lines, and its pointer table matches the tree.

SQL push-down: not applicable.

④ Design judgment

M1 — closed. Replayed on the tree. A card-thread dev who builds a tree under the spelling rule 1 prints (--branch=claude/issue-N-SLUG, no flag) now gets a tree, a pinned base, PROBE=skipped, and a line that says a platform-assigned branch is never pushed; nothing reaches origin. Line 32 holds by default and needs no flag. Line 31 keeps its rule sentence and names its reader, dev-worktree.sh --probe, in the place where main had the typed push. The self-test pins the no-flag case on the rule's own spelling at zero pushes, then the same command with --probe at one. Both halves of M1 (the breach, and the changed line that named no reader) are gone.

Question 1 — line 194 back to main's text. Acceptable, and the taken form is the right one.

  • The done-when form of Release: 7017468070 binds a line whose retyped procedure moved into a script. Line 194 never held the procedure. It is a pointer that orders the dev-traps section read before any ancestor judgment, and it reads exactly as on main. The procedure's prose is in dev-traps.md:22-26, and :24, a changed line, keeps its sentence and names git-history.mjs ancestor. A dev who obeys line 194 reaches the reader in one hop, including a card thread that reads os-dev.md by hand.
  • The cost is real but small: os-dev.md alone no longer names the command. It is the cheapest line to give up, because it is the only one of the three where the reader is still named on the path the rule already orders.
  • The alternative form is worse on each of its three lines, and broken on one. Line 31 as 「加 --probe」 names a flag and no script on the very line M1 was about. Line 194 with git-history.mjs and no ancestor names a file, not the reading. Line 27 without bash does not run as printed: scripts/pm/dev-worktree.sh is mode 100644 in the tree at this head. I would not take it.

S1 — closed. ancestorReading no longer coerces: readBoundaries(cwd, refSha) returning null is unreadable, exit 2, with its own remedy (git-history.mjs:951-952). graftBoundaries reads each parentless commit's named and traversal parents itself and marks the commit undecided when either read fails (:863); negativeIsProven refuses on an undecided boundary before it looks at any date (:896). isGraftBoundary is unchanged for touch, which is right: there an unreadable commit is refused on its own leg. The three injected cases sit on the complete clone and the commit whose honest reading is no, so each one would have printed no before the fix.

Nits from the first record.

  • N1 closed: hexPrefixProblem (:790) asks git for every object under the prefix; two or more is ambiguous, one is a non-commit, both are usage. Pinned with a real blob's sha through the CLI.
  • N2 closed, the stronger way: the floor's control leg is run (:963), its exit code is the one printed (:1389), and a boundary that does not answer 0 voids the no (:994).
  • N4 closed, all three parts: a worktree add that fails after making the branch names the branch it left (dev-worktree.sh:343); the path-holds-another-branch refusal names --worktree=NAME (:313); an unpinned tree reads owed with "has no pinned base" (:375).
  • N3 (nit) — open, left by the dev: the classifier's uneven edges. Bounded, on the stopping side.
  • N5 (nit) — open, left by the dev: the usage line does not say a proven no is proven against the ref as last fetched.

New in this round.

  • N6 (nit) — disambiguate (git-history.mjs:800) maps a failed git rev-parse --disambiguate to an empty list, which reads "absent". That is the shape S1 closed, but it only matters when the prefix is also ambiguous or a non-commit, so it needs two rare events at once. Returning the failure as usage would finish the job.
  • N7 (nit) — the two-step path rule 1 now prints costs a little. dev-worktree.sh --probe typed as line 31 spells it is usage, because --branch is required again (dev-worktree.sh:282); the message says so. And the second run repeats pnpm install unless --no-install is passed (:389). Neither affects correctness; the skipped-probe log line could name --probe --no-install.

What the commit made me re-read, and held. No path pushes without --probe: both probe_push call sites sit behind the mode test, and a re-run with --probe still refuses to push work as a probe (owed) and still sends nothing when the branch is already on origin. --probe with --no-probe is still usage. A resumed branch with no flag is built and not pushed, like any other. The remaining refuse call sites all stand before anything is created or inside a re-run, so "nothing was created" is true where it is still printed. The self-test floors rose with the cases (ancestor 32 to 38, the probe 15 to 19, re-run 13 to 14), and the one removed case ("will not guess") pinned behaviour that no longer exists. dev-traps.md and package.json are untouched by the commit and stand as judged.

Nits alone end the round.

Implemented-by: claude/issue-35237-slice7-ancestor-worktree
Reviewed-by: session_01ASNY8UcT2uJmgTyCPnMiMZ

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ

维护者速读

  • 用户能看到什么变化:用户无感。这是开发 agent 自己的工具:建工作树(os-dev 规则 1)和"浅检出上判断某提交是不是祖先"这两段原来每次手打的步骤,现在各有一个脚本(dev-worktree.sh、git-history.mjs ancestor)。
  • 为什么做:pm scripts: turn retyped prose procedures into scripts, including a card-pick reader by epic and area (step 6) #35237(p1)车队技能整理第六步的 slice 7;os-dev.md 只改两行指针(规则句不变),dev-traps.md 改一行。
  • 出错会怎样:建树脚本默认不往远端推任何东西(要推空分支须显式 --probe),卡线程分支默认不会被误推;祖先读数读不清时拒答而不是乱答。撤回 = 回退本 PR。
  • 要你做什么:这条改了 .claude/agents/os-dev.md(每个 dev 都照它干活)和 dev-traps.md,是 Tier H,需要你审批。契约审核 PASS 评论 7226982184,Head-sha: b829905e0a2886bdf737684b3d157975c869602d。批准后由席位落地。

席位意见:建议批准。首轮契约审核 FAIL(7226409572:M1 默认推送与卡线程禁令冲突、S1 读不清时误判)经一轮修复全部关闭,终轮无必修、无应修;规则变更两轮都核为 none。

席位核对

ACCEPT · 2026-11-27T19:55Z · L1 · Head-sha: b829905e0a2886bdf737684b3d157975c869602d · reports: os-dev-report 7223320514, 7226877140 on #35237

  1. Shape: draft against main; body first line is Part of #35237 (the card stays open for carrier item 3 and items 4–10); no closing keyword. 5 files, +1671/−12 (under 3000). skip-changeset: .claude/**, scripts/pm/**, one scripts entry of the private root package.json; nothing published. Body replaced with its final (non-WIP) text at this head.
  2. Premise, measured: at the claim no scripts/pm/dev-worktree.sh existed and os-dev.md:27 spelled the git worktree add procedure inline; git-history.mjs had no ancestor.
  3. Gates (check-runs on this head): 64: 51 success, 13 skipped, 0 red, 0 running. Local at this head (dev): 84 derived families, 78 exit 0, 6 NOT MEASURED (built dist; no package in the diff); self-tests git-history 123, dev-worktree 85; four ablations red and restored. os-dev.md 33500 bytes (ceiling 33504), dev-traps.md 2627 (ceiling 2627).
  4. Accepted deviations: os-dev.md:194 back to main's text to pay M1's bytes — the delta record 7226982184 ④ judged it acceptable and the right form (line 194 held no retyped procedure; dev-traps.md:24 names the reader on the path line 194 orders). Nits N3, N5, N6, N7 left open (nits alone end the round). Ablations were run on scripts (more evidence than the rule asks).
  5. Out of scope → where it went: carrier notes on pm scripts: turn retyped prose procedures into scripts, including a card-pick reader by epic and area (step 6) #35237 (this round's third note): N3, N5–N7; the os-dev.md ceiling row could drop to 33500 (check-skill-line-ratchet.mjs, outside this surface); the four reference files still spelling raw merge-base --is-ancestor; AGENTS.md naming git-history.mjs for the windowed question only. Skills-docs: not owed.
  6. Landing: Tier H (.claude/agents/os-dev.md, dev-traps.md on the register). Hand-off = pm:awaiting-merge + review request in one stroke after this record. After an authorized approval the seat lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ

Landing · 2026-11-27T19:57Z · ACCEPT (seat record above) at head b829905e · Tier S

reading value
check-governed-merges.mjs --pr 38018 GOVERNED, Tier S — .claude/**×2 under the declaration split (maintainer ruling 2026-11-19 on #35321, 「1+2+4」): body Rule-change: none, record on this head Rule-change-verified: none; 1683 lines ≤ 3000
contract review on this head PASS 7226982184 (Served-tier: CONTRACT_REVIEW_TIER, delta of FAIL 7226409572)
check-runs at head b829905e 64: 51 success, 13 skipped, 0 red, 0 running
landing-k.mjs --pr 38018 K = 2 (< 15), no locale or shared-budget leg

Correction to the seat record above: its 维护者速读 line 「要你做什么」 says this is Tier H and needs the maintainer's approval. The tool reads Tier S, so the hand-off was refused (「Tier S 不交人」) and the owning seat lands it: pr_ready + automerge_enable now. Part of #35237: the card stays open with carrier item 3 and items 4–15; the seat strips its state at the merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 19:57
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 8d34c44 Nov 27, 2026
65 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35237-slice7-ancestor-worktree branch November 27, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/xl skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants