Skip to content

status reads a parked feature the way resume refuses it before any commit is compared — a branch origin has lost is RR2's refusal of the WHOLE feature, and a role this checkout's shape has no place for is collect_legs's — reading this checkout's shape as load_repo_shape reads it, with one parser of project.yaml - #23

Merged
brettheap merged 7 commits into
mainfrom
fix/record-origin-gone-and-shape
Sep 13, 2026

Conversation

@brettheap

@brettheap brettheap commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Seven commits, the follow-ups the independent reviews of #21 and #22 recorded as out of scope and nobody has ruled on, each a reading of the record THE WAY resume.sh WILL JUDGE IT, verified against the extension's own scripts on scratch estates (bare remotes in a temp dir, a fake $HOME).

A branch origin has lost. resume.sh's RR2 fetches +refs/heads/<branch>:refs/remotes/origin/<branch> quietly in the leg's repository and refuses on the empty string — "Error: 001-a-thing is no longer on origin in the repo leg; that feature was NOT recreated … If the feature landed, delete its entry … If it was deleted by mistake, push it again from the workstation that parked it", REFUSED — gone from origin, exit 2 — BEFORE RR1 compares any commit, and takes the whole feature with it. check_parked_leg never read origin/<branch> for a leg, so both lines that name resume <Name> offered it whatever origin had. The reading is the local layer's own has_ref and is AS OF THE LAST FETCH like every other answer here: without a fetch this run the line keeps the exit that works and names the other reading beside it ("… unless origin has lost that branch: … — status --fetch settles which"), because a branch pushed elsewhere since this clone last fetched looks exactly the same and RR2's own fetch then finds it; after a fetch that WORKED in that repository there is nothing left to settle and the line is RR2's refusal with RR2's two exits and no resume at all — delete the - branch: block where the feature landed, or push the branch again from the workstation that parked it. It sits in resume.sh's order, RR6 → RR4 → RR3 → RR2 → RR1: after the pushed: arms, only where there is no worktree here, never for a feature collect_legs refuses whole, and before the absent-parked-commit arm, so a record naming no commit whose branch is gone is refused for the branch under --fetch and keeps its line without one. Five tests failing against main; three existing tests took the clause.

This checkout's shape. collect_legs maps spec and code only onto a three-leg checkout, repo only onto a single one, and every other word — assembly included, a role the three-leg SHAPE has and resume maps in no shape — onto neither; and load_repo_shape calls a checkout three-leg on FOUR declarations, kind: project-manifest, schema: project-repo-schema, and a spec LEG and a code LEG in legs: (the leg, not its path:, since _shape_record_leg stores ${path:-spec}). The layer already refused a role this root had no REPOSITORY for; the same refusal reached with a repository in hand — assembly anywhere, spec in a root that declares no code leg, repo in a real three-leg root, one project checked out at two shapes — drew nothing. read_root_shape now makes exactly the loader's test (a differential harness of fifteen manifests against the real load_repo_shape, no disagreement, the same under bash 3.2) and the finding names the ROLE, this checkout's shape AND WHY in the loader's terms, the refusal, and the exits, holding the record's own shape: against it without judging it — resume's own sentence, "parked from a single project and this checkout is single", contradicts itself. The verdict is the feature's, asked in read_record's first pass as a third question, and the leg ENDS at that line where there is no worktree here. Five tests failing against main, a seed_three_leg_root fixture, three existing tests carry the new lines; status --help, AGENTS.md rule 4 and the README widen "does not mount" to "has no place for", caps 159→162 and 255→256 in dated entries.

The fix round of this branch's independent review (2026-09-12; verdict merge after fixes, one blocker, two should-fix, four nits, every one taken). The blocker: RR2's whole-feature line was PRINTED and not MADE — a sibling leg in another repository still said "resume Trio brings it back" two lines under it. The lost branch is now the fourth question read_record's first pass asks, kept in an array of its own because collect_legs runs to the end before any RR does; the culprit leg still speaks in RR2's words, every sibling carries the verdict with RR2's two exits (never the re-park the other whole-feature refusals name, because the feature may have LANDED), and it is a verdict only under a fetch that worked there. S1: the caveat no longer offers status --fetch to a run whose fetch in that repository just failed — fetch_tried_at tells that run from one made without the flag. S2: ONE parser of project.yaml — read_root_shape records each leg's role and path: as it walks the loader's way, and leg_repo_for_role reads those back instead of its own column-keyed scan, so a legs: list indented four spaces (which the loader reads without blinking) is no longer reported as a role this root does not mount with the whole feature refused for it, a refusal resume does not make; verified by sourcing git-common.sh. Three tests failing against the previous head; the help test took the widened clause; no cap moves. The two earlier commit messages were rewritten in the same round (unpushed history, trees unchanged): they named the pre-rebase base and carried its numbers. Guard, the review's own harness adapted: 54 record-layer scenarios × nine spellings of pushed:, 486 comparisons, main against itself identical in all 486; main against this head 334 identical, and the 152 that differ are the three readings and nothing else (fifteen scenarios in all nine spellings, seventeen in the one spelling that reaches the branch-gone reading); the previous head against this one 457 identical, the 29 that differ being the fix round exactly. Suite: 325 passed at that commit.

Copilot's first round on this branch (2026-09-12), three suppressed moderate comments, every one verified empirically before anything was changed. A declared path: "." on a spec or a code leg IS THE ROOT at the other end: _shape_record_leg keeps any non-empty path, so load_repo_shape builds CODE_LEG=<root>/. for ".", ., '.' and . # a note alike (an EMPTY path: is the only spelling that falls to the role's own name) and collect_legs hands that straight to LEG_REPOS — a scratch estate with that manifest RESUMED out of the root, "code worktrees/001-a-thing/. clean", exit 0, while status said "the record names a leg this root does not mount here", a whole-feature refusal resume does not make. leg_repo_for_role takes the declared path whatever it says now and answers . as $root, the spelling the run's fetch store is keyed by; a differential harness of its own holds it against the real load_repo_shape over twelve manifests, 24 comparisons, nine differing at the previous head and none now. The record's PROJECT ROW is built where the block ENDS, not at features:: workspace_load_project takes shape:, parked_at:, parked_on:, parked_by_lane: and active_feature: by INDENT in any order — run on a record carrying all five BELOW its feature list it returned every one of them, while this layer read them as absent and said "parked ? on ?" twice, dropped the clause that holds the record's shape: against this checkout, and told a person the record does not say where a record that says Falcon was parked. And a role of NEITHER shape is offered NO checkout at all: the re-park remediation is not impossible — that "shape" is the workstation's, and park.sh's build_legs writes only spec+code or repo — but the tail promised a checkout of the OTHER shape to a role resume refuses in BOTH, assembly and docs each answering "shape mismatch", exit 2, in a real three-leg root as in a single one, which contradicts what AGENTS.md rule 4, status --help and the README already say ("a role of NEITHER shape is a record no checkout resumes"). role_shape_exits words the split once and the mount arm takes it too. Three tests failing against the previous head, two existing pins re-cut; no document line moves, so no cap moves. Guard: the same harness with TEN new scenarios, 50 × nine spellings of pushed:, 450 comparisons — the previous head against itself identical in all 450, against this one 306 identical, and the 144 that differ are 72 for the exit, 45 for the .-declared leg (the same manifest with a NAMED path byte-identical, which is the control) and 27 for the project keys. Suite: 328 passed.

Copilot's SECOND round on this branch (2026-09-12), one suppressed comment, verified against the previous head before anything moved: fetch_tried_at answered the PRESENCE of the pre-pass's entry, and fetch_remote stores an entry for two returns it makes WITHOUT running a fetch — a repository git cannot read, and one with no origin remote — so the record layer's caveat said "the fetch this run made there failed" two lines under a row that had just said "no remote named origin, so nothing could be fetched". Real in three states under --fetch, all run against e18ec53: a root with its origin removed, a spec leg with its origin removed in the three-leg fixture, and a leg whose gitdir was deleted. fetch_remote now sets one word per repository — ok, failed, no-remote, unreadable — the pre-pass stores it as FETCH_STATE_AT, and fetch_state_at replaces fetch_tried_at (its one caller), so the caveat states what actually happened: a fetch that failed keeps its sentence byte for byte, no remote says there was none to ask, an unreadable repository says no fetch was made there, and a run that never fetched there keeps status --fetch. One test failing against the previous head in all three states, each pinned beside the row it must not contradict; no document line moves, so no cap moves. Guard: 56 scenarios × nine spellings, 504 comparisons, the previous head against itself identical in all 504 and against this one 501 identical — the three that differ are the pushed: true spelling of those three states, the only spelling that reaches the clause, with a fetch that REALLY failed byte-identical as the control. Suite: 329 passed.

Copilot's THIRD round on this branch (2026-09-12), one critical, two suppressed comments and a test nit, every one verified before anything moved. THE CRITICAL: the gone-from-origin verdict was promoted to the whole feature without regard for an EARLIER leg's refusal, so a record whose first leg was parked --no-push (RR6) or names no parked_commit: (RR1), with a later leg whose branch origin has lost, gave every sibling RR2's verdict — and RR2's EXITS with it, the first of which is to DELETE the record's - branch: block, which is the wrong thing to do about a feature refused because a leg was never pushed. resume.sh walks the legs in the RECORD's order and breaks at the first refusal, so the verdict is the first REFUSING leg's: four runs against the extension on 2026-09-13, on a scratch three-leg estate with two legs in two repositories, pinned it — the --no-push leg first answered "REFUSED: 001-a-thing — parked with --no-push", the leg with no parked commit first "— divergence", the gone leg first "— gone from origin", and the --no-push leg WITH ITS WORKTREE STANDING at the parked commit still "— parked with --no-push", because RR6 is before RR4 and carries no worktree condition, the same estate with that leg's pushed: true answering "— gone from origin" as the control. One pair of arrays holds the first refusal and its kind now, its arms RR6, RR2, RR1 in resume.sh's own order; the culprit leg keeps its own line, every sibling carries the verdict, and the exits travel with the KIND — RR2's own two for gone, the re-park for pushed and moved, because only a park that parks the feature through writes the record afresh. SUPPRESSED, TAKEN: under --fetch, a mapped leg path project.yaml names and .gitmodules does not read as none and drew "status --fetch settles which" at a person who had just run the flag; of the comment's two exits the SECOND is taken — the flag's scope is not widened, because --fetch is bounded to the root and the legs the estate declares — and the state is unlisted, which says what this run did. SUPPRESSED, DISPROVED: "load_repo_shape also accepts an indentless sequence here (legs: followed by - role: at column 0)" — it does not. It tests [ "$indent" -eq 0 ] ABOVE its - case, so a column-0 item closes the legs list there exactly as it does here; ten manifests with the indentation as the variable, the real load_repo_shape sourced from git-common.sh beside this file's own read_root_shape on 2026-09-13, no disagreement — every column-0 spelling single at both ends (SHAPE_SPEC_PATH=, SHAPE_CODE_PATH=) and every indented one three-leg at both with the same paths. NIT, TAKEN: the path: . loop carries path: '.' now; it does not bite, because trim_unquote has taken single quotes off since it was written, which is what a coverage nit is. And the independent verification's nit N-b: the shape line's disagreement clause moves AFTER the exit, whose *) arm opens "nor does any other checkout, of either shape" and had nothing left to deny with the disagreement spliced in front of it. Three tests failing against the previous head, plus a fourth block that fails on its own — there the spec leg drew RR2's verdict and RR2's exits for a feature refused because the code leg was never pushed — and five existing byte-for-byte pins took the clause order. Guard: b8321d0's own test file against this commit's status, 142 status tests, 134 passed, 3 skipped, and the 5 that fail are exactly the shape-line pins; every other record-layer test of that file, the gone-branch verdict reaching the legs beside it included, is unchanged. Suite: 332 passed.

Copilot's FOURTH round on this branch (2026-09-13), no new inline comments and three suppressed, which are one finding said in three places: that the wording promises --fetch settles a missing origin/<branch> while the implementation leaves four states unsettled. ONE OF THE THREE IS TAKEN. status --help said "under --fetch, which is the only way that is settled, a missing origin/<branch> here is origin's answer" — and the gone-from-origin verdict is made inside if fetched_ok_at "$repo" and nowhere else, so a fetch that FAILED there (the review's S1), a repository with no origin remote or one git cannot read (round 2), and a path this run's fetch never listed (round 3) are every one of them a run made WITH the flag that settles nothing, each drawing the resume line and a caveat instead of the refusal. The clause names the FETCH rather than the flag now — "after a fetch that WORKED in that repository, which is the only way it is settled" — and its tail, "and without one it is named beside the resume that still brings back a branch this clone has merely not fetched", covers those four exactly as it already covered a run made without the flag; five lines of help before, five after. THE OTHER TWO ARE NOT TAKEN, and the difference is not convenience: AGENTS.md rule 4's "only status --fetch settles that" and the README's "which only --fetch settles" are claims of EXCLUSIVITY — that nothing else settles it — which is true of all four of those states and of every run made without one, and is the guidance a person or an agent needs; the help's clause was the one that made the consequence FOLLOW from the flag, which is why it is the one that moved, and rewriting two true sentences would spend AGENTS.md and README lines against caps that exist to stop exactly that. One existing test took the line — the help's byte-for-byte pin, with a dated docstring entry quoting the round and saying why the other two stay — and it fails against dc93459; no test is added, because the line was already pinned. Suite: 332 passed. No document line moves, so no cap moves.

Recorded for later, not taken: worktree_on_branch finds a worktree on the branch anywhere in the leg's repository while resume.sh's leg_registered_at matches the PATH it computes, so RR1, RR3, RR4's second arm and RR5 are readings this layer does not yet make for a leg with no worktree at that path — the stacked branch fix/record-worktree-path-parity is where they are built; and the --no-push, unreadable- and absent-pushed: legs are RR6 refusals of the whole feature at the other end and are still read per leg here (pre-existing; no line of them claims the whole feature, so none contradicts one).

🤖 Generated with Claude Code

Summary by Sourcery

Align status with resume by reporting origin-loss and checkout-shape refusals accurately across parked-feature records.

New Features:

  • Report parked features whose origin branch is missing in accordance with resume’s whole-feature refusal behavior.
  • Detect checkout-shape and role mismatches using the repository loader’s project manifest semantics.
  • Propagate the first applicable whole-feature refusal to all legs while preserving resume’s refusal order and remediation.
  • Track precise fetch outcomes so status explanations distinguish successful, failed, unavailable, unreadable, and unlisted repositories.

Bug Fixes:

  • Prevent status from offering resume for sibling legs when another leg already makes the feature non-resumable.
  • Correct handling of roles mapped to the root via path: . and manifests with nonstandard indentation.
  • Read project-level record fields regardless of their position relative to the feature list.
  • Avoid attributing branch-loss findings to fetches that did not successfully reach the relevant repository.

Enhancements:

  • Align status findings, exits, and shape diagnostics with resume.sh, collect_legs, and load_repo_shape behavior.
  • Consolidate project manifest parsing so role paths and checkout shapes are derived consistently.
  • Distinguish roles belonging to the other checkout shape from roles supported by neither shape.

Documentation:

  • Update AGENTS.md, README.md, and help text to document branch-loss refusals, shape mismatches, and their applicable remediation.

Tests:

  • Add comprehensive status coverage for origin branch loss, fetch states, refusal precedence, checkout shapes, manifest parsing, root-declared leg paths, and multi-leg verdict propagation.
  • Add three-leg repository fixtures and expand documentation-length and help-text regression checks.

brettheap and others added 3 commits September 12, 2026 18:42
…uses at RR2, before it compares any commit — instead of promising a `resume` that cannot run

The independent review of #21 (2026-09-11), recorded there as out of scope and nobody having ruled on it, verbatim: "if origin has lost the branch, `resume.sh` refuses first at RR2 — 'Error: `<branch>` is no longer on origin in the `<role>` leg' — with a different remedy paragraph; `check_parked_leg` never reads `origin/<branch>` for this leg, so it cannot tell." Every arm of that function read the leg against its OWN history — the branch tip here, the parked commit here — and the two lines that name `resume` offered it to any leg with no worktree, whatever origin had. WHAT RR2 TESTS IS A REF IN THE LEG'S REPOSITORY, NOT A QUESTION TO ORIGIN: it fetches `+refs/heads/<branch>:refs/remotes/origin/<branch>` there first — quietly, `|| true`, and not at all under `--dry-run` — and then reads that ref, refusing on the empty string. So the reading is the one the local layer already makes of a tracking branch, `has_ref "$repo" "refs/remotes/origin/$branch"`, and it is AS OF THE LAST FETCH like every other answer this command gives. Verified on 2026-09-12 against scratch estates — bare remotes in a temp dir, a fake `$HOME`, the extension's own scripts at workBenches' main (98b8bd1) — five runs: with the branch deleted in the bare and pruned in the clone, "Error: 001-a-thing is no longer on origin in the repo leg; that feature was NOT recreated. / The manifest recorded it at <sha>, parked <at> on Falcon. / If the feature landed, delete its entry: … remove the `- branch: 001-a-thing` block / If it was deleted by mistake, push it again from the workstation that parked it.", "REFUSED: 001-a-thing — gone from origin", exit 2; with the parked commit left OUT of that record, the same RR2 refusal and not RR1's "has moved since it was parked", which is what RR2 coming before RR1 means; with the remote-tracking ref put back by hand while origin still lacked the branch, RESUMED, exit 0, because RR2's own fetch neither creates nor deletes that ref; with the worktree already at the path it computes, "[specify] 001-a-thing (repo): worktree already registered at …; left as it is", exit 0, because RR4 comes before RR2; and with the branch on origin, the ordinary resume.
TWO READINGS, BECAUSE A MISSING `origin/<branch>` IS USUALLY BENIGN HERE and this layer never guesses. A recorded feature with no worktree on this workstation was parked on another one, and a branch pushed there since this clone last fetched has no remote-tracking ref here for the most ordinary reason there is — RR2's own fetch then finds it and the feature comes back. So WITHOUT a fetch this run the line keeps the exit that works and names the other reading beside it, "`resume Atlas` brings it back, unless origin has lost that branch: there is no `origin/001-a-thing` here as of the last fetch, and `resume` refuses a leg whose branch is not on origin, taking the WHOLE feature with it ("001-a-thing is no longer on origin in the repo leg") — `status --fetch` settles which"; AFTER a fetch that worked in that repository there is nothing left to settle, and the line is RR2's refusal with RR2's two exits and no `resume` at all — "no `origin/001-a-thing` here after this run's fetch: origin has not got that branch … the exits are to delete its `- branch: 001-a-thing` block from the record where the feature landed, or to push the branch again from Falcon where it went by mistake". Both exits, because they are not one and neither is the re-park every other exception in this layer ends in. `fetched_ok_at` is the pre-pass's answer for THAT repository, root or leg, as the missing-commit arms use it; a fetch that FAILED there is not one that settled anything, and reads as no fetch.
WHERE IT SITS IS `resume.sh`'s OWN ORDER, RR6 → RR4 → RR3 → RR2 → RR1. After the `pushed:` arms, which are RR6's and refuse before origin is read. Only where there is no worktree here, because RR4 calls such a leg already recreated. Never for a feature `collect_legs` refuses WHOLE, whose verdict is made before any RR runs and is the sibling arm's to say. And before the absent-parked-commit arm, which is RR1's, so a record that names no commit AND whose branch is gone is refused for the branch — under `--fetch`, where that is settled; without one the absent-commit arm keeps the line it had, because that line is true whenever origin does still have the branch and nothing here chooses between them.
Five tests, all failing against 0eb29b3, this branch's base: the branch on origin, whose line is the one it always was, byte for byte, and then the same record with the branch dropped from origin, whose line carries the reading; the `--fetch` refusal with both exits and no `resume Atlas`; the stale registration named first and the refusal after it; the gone branch outranking the absent parked commit under `--fetch` and NOT without it; and the three states where the reading must stay quiet — a worktree here, a feature refused whole, and a `--no-push` leg — with the reading itself first, so the test bites. THREE EXISTING TESTS TOOK THE NEW CLAUSE, and they took it differently. The per-feature verdict test gained a FIXTURE LINE and no new assertion: it pins a sibling's line byte for byte, and that line belongs to a branch that is ON ORIGIN, so `origin_has_branch` puts it there. The mangled-record test had TWO byte-for-byte pins REWRITTEN, because the branch its record names was never pushed to that clone's origin and the caveat now follows "brings it back" on both of them. And the help test took the new exception and the finding list beside it. Every other pinned line in the suite was already a substring, or a state this reading leaves alone. `status --help` widens the exception and the finding list it already carries; AGENTS.md rule 4 and the README take the new exception with its own exits, 155 -> 159 and 251 -> 255 in dated entries naming the rule the lines bought.
The fix round's guard, 0eb29b3's `status` against this one over 54 record-layer scenarios × nine spellings of `pushed:`: 486 comparisons, 461 byte-identical in exit code, stdout and stderr, and the base against ITSELF identical in all 486, which is what says the harness reads nothing but the change. Every one of the 25 that differ is the `pushed: true` spelling of a leg with no worktree here whose repository has no `origin/<branch>` — the only spelling that reaches this reading, RR6's arms answering the other eight before origin is read, and precisely what this commit addresses. Fifteen of them are a run that settled nothing, fourteen made without the flag and one whose fetch there failed: deleting the caveat from this commit's report leaves the base's, byte for byte. The other ten are RR2's refusal in place of a promise.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…s, so a role `resume` maps onto no checkout of it is read as the whole-feature refusal it is

The reading the feature-level commit on this branch recorded and did not take, in its own words (964d22d, `fix/record-feature-level-readings`): "a role this root DOES mount that `collect_legs` refuses anyway — `assembly`, or `spec` in a root whose `project.yaml` declares no `code` leg, which `load_repo_shape` therefore calls `single` — for which `leg_repo_for_role` hands back a repository, so the leg is read against disk and nothing here mentions the refusal". The arm before it reads a role this root has no REPOSITORY for and says the refusal; this one is the same refusal reached with a repository in hand, and the layer had nothing to say about it because it did not know what shape this checkout is.
THE RULE IS FOUR CONDITIONS, ALL OF THEM DECLARATIONS, and `read_root_shape` makes exactly the test `git-common.sh` makes: `project.yaml` is there, its indent-zero `kind:` is `project-manifest`, its indent-zero `schema:` is `project-repo-schema`, and its `legs:` list declares BOTH a `spec` LEG and a `code` LEG — the LEG and not its `path:`, because `_shape_record_leg` stores `"${path:-spec}"` and `"${path:-code}"` and a `- role: spec` with no `path:` at all still fills that variable (the independent review of this branch's base, 2026-09-12, which found the rule written into this file as "a `spec` and a `code` leg path", wrong on both counts and wrong in the direction that matters). Anything short of the four is `single`, a family holder included. The parser is `load_repo_shape`'s, keyed on indent and stripping `#` first, rather than `legs_of`'s, which drops the `assembly` leg and the `.` path this question needs; the two are held to agree by a differential harness of fifteen manifests — this suite's own Atlas fixture, a real three-leg root, legs declared with no `path:`, comment-laden and quoted and deep-indented and truncated ones, a family holder with no manifest at all — every one of them read by the real `load_repo_shape` and by `read_root_shape`, with no disagreement — and read again under bash 3.2, which is a Mac's, with the same fifteen answers.
WHAT `collect_legs` DOES WITH A ROLE IS THEN A THREE-LINE `case`, and this layer makes the same one: `spec` and `code` map only onto a three-leg checkout, `repo` only onto a single one, and every other word maps onto NEITHER — `assembly` included, which is a role the three-leg SHAPE has and `resume` maps in no shape at all, and any word that merely matches a directory under the root, which `leg_repo_for_role`'s last case answers by folder name. Verified against the extension on 2026-09-12 on scratch estates shaped like this suite's fixtures: `role: assembly` and `role: spec` in a single root that mounts an `assembly` leg at `.` and a `spec` leg at `spec/` both answered "Error: 001-a-thing was parked from a three-leg project and this checkout is single; that feature was NOT recreated", "REFUSED: 001-a-thing — shape mismatch", exit 2; `role: repo` in a real three-leg root answered the same with "and this checkout is three-leg" — ONE PROJECT CHECKED OUT AT TWO SHAPES, the commonest way into this state — and `role: spec` in that root RESUMED.
THE LINE SAYS THE SHAPE, WHICH IS WHAT `resume` DOES NOT. Its sentence names the record's `shape:` and this checkout's and stops: no role, and where the record agrees, "parked from a single project and this checkout is single", which contradicts itself. So the finding names the ROLE, the shape this checkout is AND WHY in `load_repo_shape`'s own terms — "`resume` maps the role `assembly` onto no checkout of either shape … and this one is single (its `project.yaml` declares no `schema: project-repo-schema` and no `code` leg)" — and then the refusal and the exits the two arms above it already word, the third exit included: a role of NEITHER shape is a record no checkout resumes, and a re-park cannot make one. THE RECORD'S OWN `shape:` IS HELD AGAINST IT AND NOT JUDGED: `record_rows` now carries it out of the project block, and where it disagrees the line says so and says which of the two is right is not readable here — it decides nothing at either end, `collect_legs` maps roles onto the shape of the CHECKOUT.
THE VERDICT IS THE FEATURE'S, so `read_record`'s first pass asks the shape question of every leg as a third question after the two it already asks, LAST so those two keep the clauses they had, and every sibling leg's line carries it; the culprit leg's own line is the long one. It is said before the mount arm below it, which is the same disk read more narrowly — a leg this root mounts that is not a checkout wants `make bootstrap`, true and beside the point where `collect_legs` refuses the feature whatever the directory holds — and that arm keeps its sentence, and its silence about any refusal, for a root whose shape DOES map the role: there an unfetched `spec/` is not a shape mismatch at all, `resume.sh` refusing the whole ESTATE first with "the spec leg 'spec' is not an initialised Git checkout … Run 'git submodule update --init' (or 'make bootstrap')", exit 1. And the leg ENDS at that line where there is no worktree here, because the arms below would then only answer "what would `resume` do" and it has been answered; with a worktree here they are about this workstation's own work — moved on, behind, diverged, a parked commit that is not here — and they run, under it.
Five tests, all failing against 0eb29b3, this branch's base: `assembly` in a single root, with and without the record's `shape:` agreeing; `spec` in a single root that really mounts it, at the parked commit and moved on; `repo` in a three-leg root, which needed a fixture of that shape — `seed_three_leg_root`, both legs mounted, four conditions met — and carries no disagreement clause, because there is none; that same root mapping `spec` and `code` and nothing else, where a `spec` leg at its parked commit is silent, an unfetched one keeps "does not mount here" with no refusal claimed, and `assembly` is refused; and the verdict reaching a good `repo` leg beside a `spec` one, with no `resume Atlas` in the report. THREE EXISTING TESTS CARRY THE NEW LINES and say why: the unmountable-role test's last block, whose "a leg this root mounts that is not a checkout claims no refusal" was only ever true of a root whose shape maps that role and is now held in the three-leg fixture, where it is; the roleless-sibling test, whose `spec` leg gains the refusal in front of its `--no-push` line; and the spec-leg-in-its-own-repository test, whose second half is now what proves the repository, the first being the same line either way. `status --help`, AGENTS.md rule 4 and the README widen "a role this shape does not mount" to "has no place for" and take the third exit, 159 -> 162 and 255 -> 256 in dated entries naming the rule the lines bought.
The fix round's guard, 0eb29b3's `status` against this one over the same 54 scenarios × nine spellings: 486 comparisons, 361 byte-identical in exit code, stdout and stderr, the base against itself identical in all 486. The 125 that differ are the two readings of these two commits and nothing else. TWELVE scenarios differ in ALL NINE SPELLINGS (108), and every one of them is a role no checkout of this shape maps — `assembly` in this suite's single-shape root and in the three-leg fixture, `spec` in the single one, `repo` in the three-leg one, and the sibling and multi-feature records that carry that verdict onto a good leg — because this reading is made before the `pushed:` arms and the spelling cannot change it. The other SEVENTEEN differ in the one spelling that reaches the commit before this one, `pushed: true`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…than one leg's line, reads `project.yaml` with the one parser it already had, and stops offering `status --fetch` to a run whose fetch there failed

THE REFUSAL WAS PRINTED AND NOT MADE, which is the blocker of the independent review of this branch (2026-09-12), verbatim: "The RR2 refusal ("origin has not got that branch, so `resume` refuses the WHOLE feature") is PRINTED as a whole-feature refusal but is NOT made the FEATURE's verdict, so a SIBLING leg in the same report still says "`resume <Name>` brings it back"." `resume.sh`'s RR2 is `refused=true; break`, and the loop's caller is `[ "$refused" = false ] || continue`: the feature goes out whole, every other leg of it with it. A three-leg estate is where that shows — a feature whose `spec` leg's branch origin has lost beside a `code` leg in ANOTHER repository whose branch is still there — and there the base printed RR2's refusal on one line and `resume Trio` two lines under it, which is the pair the rule at the top of `check_parked_leg` exists to forbid: a person reads the REPORT, not one line of it. THE QUESTION IS NOW THE FOURTH `read_record`'s FIRST PASS ASKS, after "has it a role", "can this root answer that role" and "does this shape map it", and it is kept in an array of its own because `collect_legs` runs to the end BEFORE any RR does: where it refuses the feature, RR2 never reads origin at all, and its verdict is the one every leg carries. What the fourth question asks is what RR2 will ask of that leg, in `resume.sh`'s own order: the record's `pushed:` is the literal `true`, because RR6 comes first and refuses anything else before origin is read; then — only under `--fetch` — a fetch that WORKED in that leg's own repository, no worktree on the branch there, because RR4 calls such a leg already recreated, and no `refs/remotes/origin/<branch>`, which is the ref RR2 reads.

THE CULPRIT LEG STILL SAYS IT IN RR2's OWN WORDS, so the arm is guarded on the verdict's KIND and not on its absence: a leg that meets the same test says it for itself — as two unmappable roles each draw the long shape line — while a leg of a feature `collect_legs` throws out stays exactly as silent as it was. AND BOTH EXITS TRAVEL WITH THE VERDICT. The re-park that settles a misspelt role, another shape's role and a feature with no legs is the WRONG thing to name for a branch origin has lost — the feature may have LANDED, and a park from the workstation that still has the worktree would push it back — so the sibling's line ends in RR2's two exits, worded once in `origin_gone_exits` and said on both lines. The state list at the top of the file takes state 8 into the paragraph that says 5, 6 and 7 are refusals of the whole feature (the review's note 3), with the two things that make it differ: its exits are its own, and it is a verdict only UNDER `--fetch`, because without a fetch nothing is settled, no verdict is made, and state 1's line keeps its exit with the other reading beside it.

A FETCH THAT FAILED HERE SETTLED NOTHING, which is the review's S1: the caveat ended "— `status --fetch` settles which" under a run that had just made that fetch and watched it fail, naming the flag the person was already holding. `fetched_ok_at` is false for three different runs — one made without the flag, one whose fetch in THIS repository failed, and one that never fetched there at all — and only the first is answered by the flag. `fetch_tried_at` tells the second from the third, the store holding one entry per repository of the estate as `estate_repos` lists them while the record layer asks about the path `project.yaml` gives a role, which is usually one of those and need not be. So the second ends "the fetch this run made there failed, so nothing has settled it" — the row above it has already said why, and that what follows is as of the last fetch that worked — and the third keeps the flag.

ONE PARSER OF `project.yaml` IN THIS FILE, NOT TWO, which is the review's S2 in its own words. `read_root_shape` walks the manifest the way `load_repo_shape` walks it — `#` and everything after it off every line, an empty line skipped, a `- ` item at ANY indent opening a leg, keys two past its own belonging to it — while `leg_repo_for_role` scanned the same file again by COLUMN, `'  - role:'*` and `'    path:'*`, and the two came apart wherever the file was not indented the way this suite indents it. A `legs:` list at FOUR spaces is one the loader reads without blinking and that scan matched not at all: the shape reader called the root three-leg, `collect_legs` maps `code` onto a three-leg checkout, and the leg was still reported as "a role this root does not mount" with the WHOLE feature refused for it — a refusal `resume` does not make. The walk records each leg's role and its `path:` as it passes now, and `leg_repo_for_role` reads those back, LAST ONE WINS as `_shape_record_leg` assigns rather than tests, with the same defaults under it. Verified by sourcing `git-common.sh` and running `load_repo_shape` on the same manifests on 2026-09-12: the four-space list, with and without a column-0 `#` comment inside the item, loads as `REPO_SHAPE=three-leg`, `SHAPE_SPEC_PATH=spec`, `SHAPE_CODE_PATH=spec`, `CODE_LEG=<root>/spec`; the review's own spelling of it — a two-space list whose `spec` leg carries `path: docs` under such a comment and whose `code` leg carries `path: src` — loads as `docs` and `src`. Only the INDENT bites at this branch's head: the column-0 comment half of that scenario was answered at this end by #22's third round (3427aa3), which is on `main` and under this branch since the rebase.

THREE TESTS, ALL FAILING AGAINST 79538ab, this branch's head before this commit: the feature-level verdict in the three-leg fixture, the `spec` leg's branch gone from origin and the `code` leg's still there, which pins both lines byte for byte and the absence of `resume Trio` and of any re-park — and, in its second half, the same record with a ROLELESS leg in place of the good one, refused for the role in the words and with the exit that refusal has always had, nothing in the report mentioning origin; the caveat under a fetch that failed here, with the same record under no flag keeping "`status --fetch` settles which"; and the four-space `legs:` list, with and without the column-0 comment, read at the checkout the manifest names. ONE EXISTING TEST TOOK THE WIDENED CLAUSE — the help test, whose byte-for-byte pin of that paragraph now says the refusal takes the WHOLE feature, with the dated docstring entry that says why — and nothing else in the suite moved: 325 passed. `status --help`, AGENTS.md rule 4 and the README say "the WHOLE feature with it" in the one clause that did not, re-wrapped inside the lines they had, so no cap moves (AGENTS.md 162, README 256).

THE GUARD IS THE REVIEW'S OWN HARNESS ADAPTED — twin estates in temp dirs out of this suite's fixture builders, the temp root and every hex sha normalised, exit code, stdout and stderr diffed — over 54 record-layer scenarios × nine spellings of `pushed:`, 486 comparisons each way. 0eb29b3's `status` against ITSELF is identical in all 486, which is what says the harness reads nothing but the change; against this head it is 334 identical and 152 differing, and the 152 are this branch's three readings and nothing else: fifteen scenarios in all nine spellings (135), twelve of them the shape reading and three the `legs:` list this commit's parser reaches, and seventeen in the one spelling of `pushed:` that reaches the branch-gone reading. AGAINST 79538ab, this branch's head before this commit, 486 comparisons, 457 identical and 29 differing, which is this commit exactly: the three four-space-manifest scenarios in all nine spellings (27), where the leg is read at the path the manifest names instead of refused; and two in the `pushed: true` spelling — the three-leg record whose `spec` leg's branch origin has lost, where the sibling `code` leg takes the feature's verdict and RR2's exits in place of `resume Trio`, and the record under a fetch that failed here, where the caveat stops naming the flag. The roleless-sibling records are byte-identical in all nine spellings at both ends, which is the precedence this commit keeps.

RECORDED AND NOT TAKEN, every one of them a reading of `resume.sh` this layer still does not make. `worktree_on_branch` finds a worktree on the branch ANYWHERE in the leg's repository while `resume.sh`'s `leg_registered_at` matches the PATH it computes under the worktree root, so a worktree on that branch at another path leaves the RR2 reading quiet where RR2 would still refuse (the review's note 4; one sentence in the state-8 comment here, and the stacked branch `fix/record-worktree-path-parity` is where it is built). RR1 is not read at all for a leg with no worktree here — origin's tip against the parked commit, which is the test that refuses a feature that has MOVED ON — so that line still says `resume <Name>` where `resume` would answer "has moved since it was parked"; nor is RR5, a local branch that is not the parked commit; nor RR3, an unrelated path at the worktree path it computes. The last three all want that computed path, which is the stacked branch's subject. And the `--no-push`, unreadable-`pushed:` and absent-`pushed:` legs are RR6 refusals of the whole feature at the other end and are still read per leg here, which the review recorded as pre-existing and out of its scope: no line of them claims the whole feature, so no line of them contradicts one.

THE TWO MESSAGES BELOW THIS ONE WERE REWRITTEN IN THE SAME ROUND (the review's notes 1 and 2), history that has never been pushed and trees that are unchanged: they named 5cb123b as this branch's base — the commit it sat on before the rebase onto `main` — and carried guard numbers measured against it, and the first claimed "ONE EXISTING TEST GAINED A FIXTURE LINE AND NO NEW ASSERTION", which was untrue of the mangled-record test, where two byte-for-byte pins were rewritten to carry the new caveat.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 12, 2026 18:57

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 10 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates status to mirror resume's RR2 branch-origin and checkout-shape refusals, using a single loader-compatible project.yaml parser, propagating whole-feature verdicts correctly, and adding extensive regression coverage and documentation.

Sequence diagram for status checks mirroring resume refusals

sequenceDiagram
    participant User
    participant Status
    participant Record as read_record
    participant Shape as read_root_shape
    participant Repo as leg repository
    participant Resume as resume.sh

    User->>Status: status --fetch
    Status->>Record: read_record
    Record->>Shape: read_root_shape(project.yaml)
    Shape-->>Record: checkout roles and paths
    Record->>Repo: fetch origin branch
    Repo-->>Record: fetch result and has_ref
    alt branch missing after successful fetch
        Record-->>Status: RR2 whole-feature refusal
        Status-->>User: delete landed entry or push branch again
    else role has no place in checkout shape
        Record-->>Status: whole-feature shape refusal
        Status-->>User: checkout the matching shape or correct record
    else branch and role are valid
        Record-->>Status: per-leg findings
        Status-->>User: status output matching resume ordering
    end
Loading

State diagram for branch-origin verdicts

stateDiagram-v2
    [*] --> Unfetched
    Unfetched --> Unfetched: status without fetch
    Unfetched --> Fetching: status --fetch
    Fetching --> FetchFailed: fetch fails
    Fetching --> BranchPresent: origin branch exists
    Fetching --> BranchGone: origin branch missing
    FetchFailed --> Unfetched: retain working exit and caveat
    BranchPresent --> LegChecks: continue RR ordering
    BranchGone --> WholeFeatureRefused: RR2 refuses whole feature
    WholeFeatureRefused --> [*]: delete landed entry or push branch again
    LegChecks --> [*]
Loading

File-Level Changes

Change Details Files
Align status findings with resume's branch-origin refusal and feature-level control flow.
  • Track each leg's origin/ state as of the last successful fetch, including fetch-failure caveats.
  • Add RR2-style whole-feature findings and the correct landed-versus-repush exits.
  • Propagate branch-gone verdicts to sibling legs while preserving collect_legs and RR ordering.
status
tests/test_status_command.py
Derive role availability from the checkout shape using a shared project.yaml parser.
  • Mirror load_repo_shape's manifest conditions and indentation-tolerant leg parsing.
  • Record role-to-path mappings during shape parsing for leg repository lookup.
  • Report roles unsupported by either checkout shape with shape-specific whole-feature refusals and exits.
status
tests/test_status_command.py
Expand regression coverage for origin, shape, ordering, and parser edge cases.
  • Add single- and three-leg fixtures with bare remotes and branch deletion scenarios.
  • Cover sibling propagation, stale worktree precedence, absent commits, fetch failures, and role mappings.
  • Add differential/parser validation and update affected existing assertions.
tests/test_status_command.py
Update operational documentation and help text to describe the new refusal semantics.
  • Document branch-gone origin handling, --fetch settling behavior, and its two exits.
  • Widen role wording from mounting to having a place in the checkout shape, including neither-shape roles.
  • Adjust documentation line-count caps and hygiene expectations.
AGENTS.md
README.md
tests/test_repo_hygiene.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Three moderate issues remain unresolved in status.

Pull request overview

Aligns status diagnostics with resume for missing origin branches and unsupported checkout roles.

Changes:

  • Adds origin-loss detection and whole-feature refusal propagation.
  • Unifies checkout-shape parsing and role validation.
  • Expands tests and documentation.
File summaries
File Summary
status Implements branch-origin and shape diagnostics; three moderate issues remain around path: ".", late shape: fields, and unsupported-role remediation.
tests/test_status_command.py Adds regression coverage for branch loss, shape mismatches, and refusal propagation.
tests/test_repo_hygiene.py Updates documentation length limits.
README.md Documents new refusal conditions.
AGENTS.md Updates operational guidance.
Review details

Suppressed comments (3)

status:2395

  • This special-cases path: "." as if the path were omitted, but the extension's _shape_record_leg preserves any non-empty path and builds SPEC_LEG/CODE_LEG as $root/$SHAPE_*_PATH; therefore a declared spec or code leg with path: "." is mapped to the root repository. Status will instead inspect $root/spec or $root/code (or report it missing), so its worktree/origin findings disagree with resume. Only apply the role-name default when path is empty.
    if [ -n "$path" ] && [ "$path" != "." ]; then

status:2076

  • The project row is serialized when features: is encountered, but workspace_load_project accepts the other project-level keys at the same indent in any order. If a hand-edited or merged manifest places shape: after the feature list, this assignment updates the local variable after the project row has already been buffered, so RECORD_SHAPE remains empty and the new shape-disagreement diagnostic is silently omitted even though resume reads the field. Emit the project row only after all project-level fields have been collected, or update the buffered row when shape: is seen.
            held="$held$(printf 'project\037%s\037%s\037%s\037%s\037%s' "$parked_at" "$parked_on" "$lane" "$active" "$shape")$NL"

status:2760

  • For roles such as assembly or docs, role_shape_long correctly says that resume maps the role onto no checkout of either shape, but this common suffix still says the feature can come back in a checkout of the other shape. role_maps_here returns false for those roles in both shapes, so that remediation is impossible and contradicts the new help/README wording that a role of neither shape has no resumable checkout. Use a separate exit clause for the *) case instead of always appending the other-shape remedy.
        shape_line="parked feature $branch ($role leg): $(role_shape_long "$role"), so it refuses the WHOLE feature — the other legs with it — reporting it as a shape mismatch, and nothing here brings it back$shape_says — park that feature again from the workstation that has it ($where), which writes the roles its own shape has; where that shape is not this checkout's, the feature comes back in a checkout of that shape, not here"
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…ilds the record's project row out of every project key the loader takes in any order, and stops offering a role of NEITHER shape a checkout of the other

A LEG DECLARED `path: .` IS THE ROOT AT THE OTHER END, which is Copilot's first round on #23 (2026-09-12), verbatim: "this special-cases `path: "."` as if the path were omitted, but the extension's `_shape_record_leg` preserves any non-empty path and builds `SPEC_LEG`/`CODE_LEG` as `$root/$SHAPE_*_PATH`; therefore a declared `spec` or `code` leg with `path: "."` is mapped to the root repository. Status will instead inspect `$root/spec` or `$root/code` (or report it missing), so its worktree/origin findings disagree with `resume`. Only apply the role-name default when `path` is empty." IT DOES, IN EVERY SPELLING OF `.`: `_shape_record_leg` is `"${path:-code}"`, `.` is not empty, and `_shape_set_scalar` has already taken the quotes off — run against the extension on 2026-09-12 on one manifest with its `code` leg carrying `path: "."`, `path: .`, `path: '.'` and `path: . # a note` in turn, all four loaded as `REPO_SHAPE=three-leg`, `SHAPE_CODE_PATH=.`, `CODE_LEG=<root>/.`, and an EMPTY `path:` was the only spelling that fell to the default `code`. `collect_legs` hands `$CODE_LEG` straight to `LEG_REPOS`, so the leg `resume` reads is the ROOT: end to end on a scratch estate the same day — bare remotes in a temp dir, a fake `$HOME`, the extension's own scripts — that manifest and a record parking a `code` leg RESUMED, "code  worktrees/001-a-thing/.  <sha>  clean", exit 0, with the new worktree in the ROOT's own `git worktree list`; `status` on the same estate said "the record names a leg this root does not mount here", a whole-feature refusal `resume` does not make. The declared path is taken whatever it says now, and `.` is answered as `$root` and not as `$root/.`: they are one directory, and `$root` is the spelling `estate_repos` uses, which is what the run's fetch store is keyed by. A DIFFERENTIAL HARNESS OF ITS OWN holds the two answers together — the real `load_repo_shape`'s `SPEC_LEG`/`CODE_LEG` against `leg_repo_for_role`, over twelve manifests where the `path:` is the variable — 24 comparisons in a three-leg root, of which b47be37 differed in nine and this commit differs in none.

THE PROJECT ROW IS BUILT WHERE THE BLOCK ENDS, NOT AT `features:`, which is the same round's second comment: "the project row is serialized when `features:` is encountered, but `workspace_load_project` accepts the other project-level keys at the same indent in any order. If a hand-edited or merged manifest places `shape:` after the feature list, this assignment updates the local variable after the `project` row has already been buffered, so `RECORD_SHAPE` remains empty and the new shape-disagreement diagnostic is silently omitted even though `resume` reads the field." IT HOLDS FOR ALL FIVE KEYS THIS ROW CARRIES, because the loader's indent-4 arm is one `case` reached by INDENT and not by position: run against the extension on 2026-09-12 on a record whose `shape:`, `parked_at:`, `parked_on:`, `parked_by_lane:` and `active_feature:` all sit BELOW its feature list, `workspace_load_project` returned every one of them — `MANIFEST_SHAPE=three-leg`, `MANIFEST_PARKED_AT=2026-09-10T20:00:00Z`, `MANIFEST_PARKED_ON=Falcon`, the lane and the active feature — with the feature and its leg intact. Read at the `features:` line, every one of them was empty here, and four readings went with them: the root's note line said "parked ? on ?", the leg's own line said "parked ? on ?" where the record names both, the unmappable-role finding lost the clause that holds the record's `shape:` against this checkout, and its exit said "the record does not say where" about a record that says Falcon. So the row is built AT THE FLUSH, from what the whole block left behind, and `$has_features` — set by the `features:` key and by nothing else — decides whether there is a row at all, exactly as that key did before. THE EMITTED BYTES DO NOT MOVE for a record `park` writes: `features:` is the last project-level key it emits, the rows of the matched block go out in the order they were appended with the project row in front of them, and this function's whole output is read in a `$(…)` at the one call site, so holding it to the end of the block is invisible. The incremental flush went with it — it existed to get rows out before the block was known to match, which the buffer already answers.

A ROLE OF NEITHER SHAPE IS OFFERED NO CHECKOUT AT ALL, AND THE REASON THE ROUND GIVES FOR IT IS HALF WRONG. Verbatim: "for roles such as `assembly` or `docs`, `role_shape_long` correctly says that `resume` maps the role onto no checkout of either shape, but this common suffix still says the feature can come back in a checkout of the other shape. `role_maps_here` returns false for those roles in both shapes, so that remediation is impossible and contradicts the new help/README wording that a role of neither shape has no resumable checkout. Use a separate exit clause for the `*)` case instead of always appending the other-shape remedy." THE REMEDIATION IS NOT IMPOSSIBLE: the tail's "that shape" is the WORKSTATION's, named two clauses earlier, and the re-park it names rewrites the role — `park.sh`'s `build_legs` is `LEG_ROLES=("spec" "code")` in a three-leg root and `("repo")` in a single one and writes no other word in either, so the park always produces a record some checkout maps, and this suite's own end-to-end run of `resume.sh` on a `code` leg brought such a feature back, exit 0. WHAT IS REAL IS THE CONTRADICTION, and it is with the lines this branch's own commits added: AGENTS.md rule 4 says "that re-park settles a misspelling, another shape's role wants a checkout of that shape, and a role of NEITHER shape is a record no checkout resumes", `status --help` says "where the role is really another shape's, only a checkout of that shape, and where it is neither shape's, no checkout at all", and the README says it in fewer words — three exits, and the tail said the SECOND of them to both kinds — leaving a person reading `assembly` with a checkout somewhere that resumes the record AS IT STANDS, and there is none. Run against the extension on 2026-09-12 in a real three-leg root, both legs mounted and the four conditions met, `role: assembly` and `role: docs` each answered "Error: 001-a-thing was parked from a three-leg project and this checkout is three-leg; that feature was NOT recreated", "REFUSED: 001-a-thing — shape mismatch", exit 2 — the same refusal both words draw in a single root (the commit before this one, the same estates). Refused in BOTH shapes is a record no checkout brings back, so the `*)` exit says that first and then the one thing that changes it, naming the three words `park` writes so the re-park is not a guess. It is `role_shape_exits` and it is worded ONCE, as `origin_gone_exits` is, because the MOUNT arm carries the same tail and reaches the same two kinds: a `spec` or a `code` this manifest declares no leg for is another shape's role and keeps its sentence byte for byte, and a word that matches no directory here — `nope` — is neither shape's and takes the new one.

THREE TESTS, ALL FAILING AGAINST b47be37, this branch's head before this commit: the `code` leg declared at the root in both spellings, whose proof is the ROOT's own history and not the absence of a line — a worktree on that branch at the parked commit is in sync, and one commit past it is "moved on", and both are readings of the repository the manifest declares the leg into; the five project keys below the feature list, which pins the note line and the whole `assembly` finding including the disagreement clause and the re-park's "the record says Falcon"; and the role of neither shape, over `assembly`, `docs` and `nope` in a single root and `assembly` in the three-leg fixture, with `spec` and `code` beside them keeping the other-shape tail they had. TWO EXISTING TESTS TOOK THE SPLIT and nothing else in the suite moved: the `assembly` test's two byte-for-byte pins take the new exit (a constant of its own, beside the one it is not), and the unmountable-role test's loop stops sharing one tail between `nope` and `code`, with the paragraph that said "one wording for both" rewritten to say which half is still one and which is not. 325 passed before, 328 now. No line of `status --help`, AGENTS.md or the README moved: all three already said what the `*)` exit now says, which is how the contradiction was found, and the other two readings are parity inside this layer and change no rule. So no cap moves (AGENTS.md 162, README 256).

THE GUARD IS THE SAME HARNESS, WIDENED: twin estates out of this suite's fixture builders in temp dirs, the temp root and every hex sha normalised, exit code, stdout and stderr diffed, over 50 record-layer scenarios × nine spellings of `pushed:` — the 40 the review's harness carried and TEN new ones for this round, a `code` leg at `path: "."`, at `path: .`, with a worktree, without one, moved on, under `--fetch` with the branch gone, and at a named path as the control; the five project keys below `features:` with an `assembly` leg, a `repo` leg and a `repo` leg whose branch origin has not got; and `role: docs`. 450 comparisons. b47be37's `status` against ITSELF is identical in all 450, which is what says the harness reads nothing but the change; against this commit it is 306 identical and 144 differing, and the 144 are these three readings and nothing else. EIGHT scenarios differ in all nine spellings for the exit (72) — `nope` and `assembly` in the single-shape root with and without `--fetch`, `assembly` in a record that AGREES about the shape, the sibling leg that takes the verdict, `assembly` and `nope` in the three-leg fixture, and `docs` — because the role is read before the `pushed:` arms and no spelling changes it. FIVE differ for the `.`-declared leg (45), where the leg is read in the root in every spelling and each spelling therefore says its own thing about it — the `--no-push` and unreadable-`pushed:` arms find a worktree there, and under `--fetch` the gone-from-origin reading is made in the root's repository — while the SIXTH, the same manifest with a named `path:`, is byte-identical and is the control. THREE differ for the project keys below `features:` (27), where the note line, the leg's `parked … on …`, the disagreement clause and the re-park's `$where` all come back.

RECORDED AND NOT TAKEN, and it is the same shape as the second comment above: an indent-4 key CLOSES the feature list at the loader (`in_features=false` at the top of that arm), so a `- branch:` below one — or before any `features:` at all — is a feature `workspace_load_project` never makes, while `record_rows` still emits a `branch` row for it and `read_record` still reports it. Verified against the extension on 2026-09-12: a block whose `shape:` and `parked_on:` sit between two features loaded the FIRST feature and its leg, both trailing keys, and no second feature. This commit makes the project row right for such a record and leaves the feature list alone, because the reading is a different one — it changes which features a report has, not what one row of it carries, and it rewrites a pinned line of the blank-branch test, whose record puts a `root:` key between a feature and its legs and would lose those legs at the other end. `status` claims work `resume` will not bring back there, which is the direction that wants its own commit and its own run against `resume.sh`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 12, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Correct the message or tracking for repositories without an origin remote, where no fetch was attempted.

Review details

Suppressed comments (1)

status:3167

  • fetch_tried_at is true for every repository entered by the pre-pass, including a readable repository where fetch_remote returned early because no origin remote exists (status:937-940). In that case this message says “the fetch this run made there failed” even though no fetch was attempted, which makes the new diagnostic inaccurate; use wording that covers an unsettled origin fetch/no remote or track an actually attempted fetch separately, and update the affected assertion.
        if [ -z "$refused" ]; then
            if fetch_tried_at "$repo"; then
                settles="the fetch this run made there failed, so nothing has settled it"
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

… made there at all — no `origin` remote, or a repository git cannot read — instead of calling both of them a fetch that failed

THE STORE HELD FOUR STATES IN ONE FLAG, which is Copilot's second round on #23 (2026-09-12), verbatim: "`fetch_tried_at` is true for every repository entered by the pre-pass, including a readable repository where `fetch_remote` returned early because no `origin` remote exists (status:937-940). In that case this message says "the fetch this run made there failed" even though no fetch was attempted, which makes the new diagnostic inaccurate; use wording that covers an unsettled origin fetch/no remote or track an actually attempted fetch separately, and update the affected assertion." IT IS REAL IN THREE STATES, all of them under `--fetch` with a `pushed: true` record whose branch this clone has no `origin/<branch>` for and no worktree on, run against e18ec53 on 2026-09-12: a ROOT whose `origin` was removed drew "fetch: no remote named origin, so nothing could be fetched" on its own row and "the fetch this run made there failed, so nothing has settled it" in the caveat two lines under it; a `spec` LEG with its `origin` removed, in the three-leg fixture whose shape maps that role, drew the same pair; and a leg whose gitdir was deleted drew "fetch: not a readable git repository (a gitfile whose gitdir is gone?), so nothing could be fetched" and the same caveat. A REPORT THAT CONTRADICTS ITSELF IS WORSE THAN ONE THAT SAYS LESS, and this one contradicted itself about what this run did.

`fetch_remote` HAS THREE RETURNS AND ONLY ONE OF THEM RAN A FETCH, so the word it sets is the word the caveat says. `FETCH_ORIGIN_STATE` is `unreadable` at the `rev-parse --git-dir` return, `no-remote` at the `remote get-url` return, `failed` where `git fetch` itself failed and `ok` where it worked — the ORIGIN remote's alone, because `upstream` has its own flag, its own line and no reading that branches on why its fetch did not happen. The pre-pass stores it beside the two flags as `FETCH_STATE_AT`, and `fetch_state_at` reads it back for any repository of the estate — `none` where the store has no entry, which is a repository no fetch reached and every repository of a run made without the flag. That replaces `fetch_tried_at`, which answered the PRESENCE OF THE ENTRY and had one caller: a function that cannot tell the three apart is one this layer should not keep, and the store is where the difference already lived. `fetched_ok_at` is untouched — it asks a narrower question, and `ok` never reaches this clause because it returns above it.

FOUR RUNS, FOUR CLAUSES, and only two of them are the flag's. A fetch that FAILED there keeps its sentence byte for byte, "the fetch this run made there failed, so nothing has settled it", because it is true of that run and the row above has already printed why. A repository with NO `origin` remote says "that repository has no `origin` remote for this run's fetch to have asked, so nothing has settled it" — the fix is on its row, not in this clause, and inventing one here would be a second diagnosis of the same thing. One git cannot READ says "that repository could not be read this run, so no fetch was made there and nothing has settled it", for the same reason and in its own words: nothing is wrong with its remotes. And `none` keeps "`status --fetch` settles which", which is the run that has not asked yet.

ONE TEST, FAILING AGAINST e18ec53, this branch's head before this commit, in all three states, each pinned beside the ROW it must not contradict; the three tests around it — the fetch that really failed, the no-remote row, the unreadable row — pass against both heads, which is what says this commit moved the caveat and nothing else. 328 passed before, 329 now. No document line moves: `status --help`, AGENTS.md rule 4 and the README say every answer is as of the last fetch and that a fetch that fails is a finding on that row, which is what this clause now says in each of its cases, so no cap moves (AGENTS.md 162, README 256).

THE GUARD IS THE SAME HARNESS WITH SIX MORE SCENARIOS: twin estates out of this suite's fixture builders in temp dirs, the temp root and every hex sha normalised, exit code, stdout and stderr diffed, over 56 record-layer scenarios × nine spellings of `pushed:` — the 50 the round before carried, and this round's root with no `origin` under the flag and without it, the leg with no `origin` under the flag and without it, the leg whose gitdir is gone, and A FETCH THAT REALLY FAILED as the control. 504 comparisons. e18ec53's `status` against ITSELF is identical in all 504; against this commit it is 501 identical and 3 differing, and the three are the `pushed: true` spelling of the three states above — the one spelling that reaches this clause, RR6's arms answering the other eight before origin is read at all. The control is byte-identical in all nine, and so is every scenario of the three rounds before it.

RECORDED AND NOT TAKEN: the missing-parked-commit arms below this one also branch on `fetched_ok_at` alone, and their `else` says "this repository has never fetched it, or origin no longer has it" — which is TRUE of a repository with no `origin` remote and of one git cannot read, and says nothing about this run that its row contradicts, so it makes no false claim and is left exactly as it is. Naming the state there would be a second diagnosis of what the row above has already diagnosed, which is the rule this commit's own clauses follow.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 12, 2026 22:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

One critical and two moderate issues remain unresolved, plus a test coverage nit.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

status:2288

  • load_repo_shape also accepts an indentless sequence here (legs: followed by - role: at column 0), but this guard skips that item and closes in_legs instead. A valid three-leg manifest is therefore classified as single with no recorded leg paths, so status can report a shape refusal where resume maps the spec/code legs. Process - items regardless of whether their indentation is zero.
                if [ "$indent" -gt 0 ]; then

status:3222

  • When --fetch is active, fetch_state_at can still be none for a mapped role path that project.yaml names but estate_repos did not enumerate (the code explicitly allows that path not to be one of the fetch-store entries). This fallback then tells the user to run status --fetch, even though that flag has already run and repeated runs will not fetch a path absent from .gitmodules; either fetch all mapped leg repositories or report that this repository was not included in the fetch.
            *) settles="\`status --fetch\` settles which" ;;

tests/test_status_command.py:4095

  • The regression test claims to exercise all three non-empty spellings of path: ., but this loop only covers the double-quoted and unquoted forms. Add the single-quoted form so the loader-parity behavior handled by trim_unquote is actually protected.
    for spelling in ('    path: "."\n', "    path: .\n"):
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread status Resolved
… refuses at — the record's order, and RR6 before RR2 before RR1 inside one leg — instead of a later leg's gone-from-origin reading, says so where this run's fetch never listed that repository at all, and lets the shape exit keep the clause it answers

THE VERDICT WAS A LATER LEG'S, which is Copilot's THIRD round on #23 (2026-09-12) and its one inline comment, the round's only critical, verbatim: "`feature_gone` is propagated to every leg without accounting for an earlier per-leg refusal. For example, if the first leg has `pushed: false` (RR6) or no `parked_commit:` (RR1) and a later leg has a missing origin branch, `resume` stops at the first leg in record order, but this makes the whole feature report RR2's gone-origin verdict and exits. Track the first applicable refusal/order before promoting a later origin check to a feature verdict, or suppress that promotion when an earlier leg already blocks resume." IT IS REAL, AND WHAT MAKES IT WORSE THAN A WRONG REASON IS THE EXIT IT CARRIES: RR2's first exit is to DELETE the record's `- branch:` block, and the sibling's line said that of a feature refused because one of its legs was never pushed — a record to park again, and never one to delete. `resume.sh`'s per-leg loop walks `LEG_ROLES` in `collect_legs`'s order, which is `MANIFEST_LEG_ROLE`'s, which is the file's; RR6, RR4, RR3, RR2, RR1 and RR5 are each `refused=true; break`, and the line under the loop is `[ "$refused" = false ] || continue`. So the refusal a person gets is the FIRST one in the record, and a later leg's is one `resume` never reaches.

FOUR RUNS AGAINST THE EXTENSION on 2026-09-13, on a scratch three-leg estate — bare remotes in a temp dir, the extension's own scripts, one feature, two legs in two repositories, the record's order the variable:

  `code` (`pushed: false`) then `spec` (branch deleted on origin)
    "Error: 001-a-thing (code leg) was parked with --no-push; that feature was NOT recreated", "REFUSED: 001-a-thing — parked with --no-push", exit 2
  `code` (no `parked_commit:`) then the same `spec`
    "Error: 001-a-thing (code leg) has moved since it was parked; that feature was NOT recreated", "REFUSED: 001-a-thing — divergence", exit 2
  `spec` FIRST, the same `code` under it
    "Error: 001-a-thing is no longer on origin in the spec leg; that feature was NOT recreated", "REFUSED: 001-a-thing — gone from origin", exit 2
  `code` (`pushed: false`) WITH ITS WORKTREE STANDING at the parked commit, then the same `spec`
    "REFUSED: 001-a-thing — parked with --no-push", exit 2 — and, on the same estate with that leg's `pushed: true`, "REFUSED: 001-a-thing — gone from origin"

THE LAST PAIR IS RR6 AGAINST RR4 and it is what decides the shape of the fix: RR6 is the FIRST test of the loop, before RR4, and carries no worktree condition, so a `--no-push` leg breaks the loop with its worktree in place — while RR2 and RR1 are read only for a leg RR4 has not already called recreated, and a question written beside them would have inherited that guard and let the gone leg take the feature after all.

SO ONE PAIR OF ARRAYS HOLDS THE FIRST REFUSAL AND ITS KIND, filled in the pass that already counts each feature's legs, and its arms are RR6, RR2, RR1 in that order — `resume.sh`'s order inside one leg — under an `elif` that fires only while the pair is still empty, which is the record's order between legs. `feature_gone` and its single kind are gone: `feature_rr` carries the sentence and `feature_rr_kind` the word, `gone`, `pushed` or `moved`. RR6 is `[ "$d" != true ]` and nothing else, because it is certain from the record alone, and `pushed_verdict` says its four states about somebody else's leg where `resume.sh`'s own three-armed message says them about the culprit's. RR2 keeps `origin_lost_leg` — `--fetch`, a fetch that worked in that repository, no worktree on the branch, no `refs/remotes/origin/<branch>`. RR1 is `moved_on_leg`, asked of an absent `parked_commit:` alone, which is the one reading of RR1 this layer makes, and asked AFTER RR2 of the same leg, because that is where `resume.sh` asks it.

THE CULPRIT KEEPS ITS OWN LINE AND THE SIBLINGS TAKE THE VERDICT, which is the split RR2 already had, guarded on the KIND now rather than on the verdict's absence. The origin reading runs for `[ -z "$refused" ]` or a `gone` verdict and for nothing else, so a feature an earlier leg refuses at RR6 or RR1 has no line claiming origin at all; the `--no-push`, unreadable-`pushed:` and absent-`parked_commit:` arms return above the verdict arm, so the leg that costs the feature goes on saying it in its own words. AND THE EXITS TRAVEL WITH THE KIND: `gone` keeps RR2's own two, because that feature may have LANDED and a park from the workstation that still has the worktree would push it back; `pushed` and `moved` are the re-park, in the words their own culprit lines end in, because only a park that parks the feature THROUGH writes the record afresh — with the push RR6 wants, and with the commit RR1 matches against origin's tip.

A REPOSITORY THIS RUN'S FETCH NEVER LISTED IS NOT ONE THE FLAG WILL SETTLE, which is the round's suppressed comment at status:3222, verbatim: "When `--fetch` is active, `fetch_state_at` can still be `none` for a mapped role path that `project.yaml` names but `estate_repos` did not enumerate (the code explicitly allows that path not to be one of the fetch-store entries). This fallback then tells the user to run `status --fetch`, even though that flag has already run and repeated runs will not fetch a path absent from `.gitmodules`; either fetch all mapped leg repositories or report that this repository was not included in the fetch." IT IS REAL, and it is the fault the round before fixed from its other side: a run that HAS fetched being told to fetch. OF ITS TWO EXITS THE SECOND IS TAKEN, because the first would widen what the flag does: `status --fetch`'s one write is bounded to the repositories the estate declares, the root and the legs of its `.gitmodules`, which is what AGENTS.md rule 4, the README and `status --help` all say. So `fetch_state_at` answers `none` only where the flag was not given — the run `status --fetch` settles — and `unlisted` where it was given and the store has no entry for that path, and the line says what this run did instead of naming the flag the person is holding.

AND THE INDENTLESS `- role:` SEQUENCE IS NOT ONE `load_repo_shape` ACCEPTS, which is the round's other suppressed comment, at status:2288, verbatim: "`load_repo_shape` also accepts an indentless sequence here (`legs:` followed by `- role:` at column 0), but this guard skips that item and closes `in_legs` instead. A valid three-leg manifest is therefore classified as `single` with no recorded leg paths, so `status` can report a shape refusal where `resume` maps the `spec`/`code` legs. Process `-` items regardless of whether their indentation is zero." ITS PREMISE IS FALSE, so no code moves for it. `load_repo_shape` tests `[ "$indent" -eq 0 ]` FIRST, above its `- ` case, so a column-0 item closes the legs list at that end exactly as it does at this one. Run on 2026-09-13 by sourcing the real `git-common.sh` and calling `load_repo_shape` beside this file's own `read_root_shape`, over ten manifests where the indentation is the variable: the manifest the comment describes — `legs:` then `- role: spec`, `  path: spec`, `- role: code`, `  path: code`, the items at column 0 — answered `REPO_SHAPE=single` with `SHAPE_SPEC_PATH=` and `SHAPE_CODE_PATH=` at the loader and `ROOT_SHAPE=single` here; so did the same list with an `assembly` item in front of it, the same with a column-0 `# note` inside an item, and the same with every scalar quoted. The INDENTED spellings — two spaces, one space, four spaces, and a bare `-` with its keys under it — are `three-leg` at both ends with the same paths, `docs` and `src` where the manifest says so. Ten manifests, no disagreement. A `- ` item at any indent GREATER than zero is what the walk here opens a leg for, and that is the loader's rule, not a guard to remove.

THE `path: '.'` SPELLING IS THE ROUND'S TEST NIT and it is taken: "The regression test claims to exercise all three non-empty spellings of `path: .`, but this loop only covers the double-quoted and unquoted forms. Add the single-quoted form so the loader-parity behavior handled by `trim_unquote` is actually protected." The loop is three spellings now. It does NOT bite against b8321d0 — `trim_unquote` has taken single quotes off since it was written, and the comment beside it already named all three — which is what the nit is: coverage of behaviour that was already right, and the one item of this round that changes no output.

AND THE DISAGREEMENT CLAUSE GOES AFTER THE EXIT (the independent verification of this branch, 2026-09-12, its nit N-b). `role_shape_exits`'s `*)` arm opens "nor does any other checkout, of either shape", which answers "nothing here brings it back" — and with "; the record calls the project X where this checkout is Y …" spliced between the two, that "nor" had nothing left to deny. Both halves are true in either order and only one of them is an antecedent, so the antecedent keeps its place and the disagreement follows the exit.

THREE NEW TESTS AND A FOURTH BLOCK, all failing against b8321d0, this branch's head before this commit. The record's order, in a three-leg fixture: the `--no-push` leg first and the gone leg second, a leg the record names no commit for first and the gone leg second, the gone leg first as the control, and the `--no-push` leg with its worktree standing — each pinning both lines byte for byte and the absence of "is no longer on origin" and of any `- branch:` deletion where `resume` never reads origin. All four spellings RR6 refuses, in both orders, none of them offering `resume Trio`. And the caveat in a repository `project.yaml` mounts where `.gitmodules` declares nothing, with the same record under no flag keeping "`status --fetch` settles which". THE FOURTH BLOCK FAILS ON ITS OWN against b8321d0, where the `spec` leg drew RR2's verdict and RR2's exits — "delete its `- branch: 001-a-thing` block from the record where the feature landed" — for a feature refused because the `code` leg was never pushed. Five existing byte-for-byte pins took the clause order and nothing else in the suite moved: 329 passed at b8321d0, 332 now.

THE GUARD IS b8321d0's OWN TEST FILE AGAINST THIS COMMIT's `status`: 142 status tests, 134 passed, 3 skipped, and the 5 that fail are exactly the pins of the shape line whose clause order this commit moves. Every other record-layer test of that file is unchanged — the gone-branch verdict reaching the legs beside it included — which is what says the new verdict reaches the states it was written for and no others. The record-layer differential harness of the earlier rounds was NOT re-run this round; this cross-run and the four extension runs above are what stands in its place.

No document line moves: `status --help`, AGENTS.md rule 4 and the README already say that `--fetch` reaches the root and the legs `.gitmodules` declares, and that these refusals take the WHOLE feature, which is what each of these clauses says in its own case. So no cap moves (AGENTS.md 162, README 256).

Base: b8321d0.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 13, 2026 18:07
@brettheap

Copy link
Copy Markdown
Contributor Author

Round 3's suppressed comment at status:2288 is disproved, so no code moves for it. Verbatim:

load_repo_shape also accepts an indentless sequence here (legs: followed by - role: at column 0), but this guard skips that item and closes in_legs instead. A valid three-leg manifest is therefore classified as single with no recorded leg paths, so status can report a shape refusal where resume maps the spec/code legs. Process - items regardless of whether their indentation is zero.

The premise is false: a column-0 item is not a leg at the OTHER end either. git-common.sh's load_repo_shape tests [ "$indent" -eq 0 ] as the FIRST branch of its in_legs = true block, ABOVE the [ "${trimmed:0:2}" = "- " ] case — so an indentless - role: closes the legs list there exactly as it does here, and such a manifest is single at both ends. The guard this comment asks us to remove is what keeps the two readers agreeing, not what makes them differ.

Run on 2026-09-13, sourcing the real git-common.sh and calling load_repo_shape, beside a harness of this file's own read_root_shape bytes, over ten manifests where the indentation is the only variable. The manifest the comment describes:

kind: project-manifest
schema: project-repo-schema
legs:
- role: spec
  path: spec
- role: code
  path: code
LOADER m01_col0 REPO_SHAPE=single SHAPE_SPEC_PATH= SHAPE_CODE_PATH= SPEC_LEG=m01_col0 CODE_LEG=m01_col0
STATUS m01_col0 ROOT_SHAPE=single ROLES=[] PATHS=[] WHY=its `project.yaml` declares no `spec` leg and no `code` leg

The same answer from the loader and from this file for every column-0 spelling — with an assembly item in front of the two, with a column-0 # note inside an item, and with every scalar quoted. The INDENTED spellings are three-leg at both ends with the same paths:

LOADER m03_two  REPO_SHAPE=three-leg SHAPE_SPEC_PATH=spec SHAPE_CODE_PATH=code
STATUS m03_two  ROOT_SHAPE=three-leg ROLES=[spec code] PATHS=[spec code]
LOADER m04_four REPO_SHAPE=three-leg SHAPE_SPEC_PATH=docs SHAPE_CODE_PATH=src
STATUS m04_four ROOT_SHAPE=three-leg ROLES=[spec code] PATHS=[docs src]
LOADER m05_one  REPO_SHAPE=three-leg SHAPE_SPEC_PATH=spec SHAPE_CODE_PATH=code
STATUS m05_one  ROOT_SHAPE=three-leg ROLES=[spec code] PATHS=[spec code]
LOADER m06_dash_alone REPO_SHAPE=three-leg SHAPE_SPEC_PATH=spec SHAPE_CODE_PATH=code
STATUS m06_dash_alone ROOT_SHAPE=three-leg ROLES=[spec code] PATHS=[spec code]

Ten manifests, no disagreement. - at any indent GREATER than zero is what the walk here opens a leg for, which is the loader's rule; processing a column-0 item as a leg would make this reader claim legs resume does not map, which is the direction of error this branch exists to close.

The round's other three items are taken in dc93459.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Mixed readiness assessments and unresolved final nits warrant human review.

Review details

Suppressed comments (3)

AGENTS.md:102

  • This rule overstates status --fetch: the implementation cannot settle branch loss when the fetch fails, no origin exists, the repository is unreadable, or the mapped path is unlisted. Please say that a successful fetch reaching that repository is what settles the missing origin branch.
   unless ORIGIN HAS LOST THE BRANCH — only `status --fetch` settles that —

README.md:67

  • This documentation says --fetch alone settles whether the branch is gone, but a fetch can fail, have no origin, or never reach a project.yaml-mapped path; the implementation deliberately reports those cases as unresolved. Please qualify this as a successful fetch in that repository so the operational guidance matches the command's output.
where it is neither shape's, none; with the branch gone from origin, which
only `--fetch` settles, `resume` refuses the WHOLE feature as gone from origin

status:158

  • This help text says that --fetch settles a missing origin/<branch> unconditionally, but the implementation distinguishes failed, no-remote, unreadable, and unlisted repositories and leaves those readings unresolved. Qualify this with a successful fetch that actually reached the repository, otherwise the help contradicts the row-level guidance.
WHOLE feature with it — under `--fetch`, which is the only way that is
settled, a missing `origin/<branch>` here is origin's answer and the exits are
  • Files reviewed: 4/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…fter a fetch that WORKED in that repository — not under the flag, which the last two rounds taught this layer can fail there, find no `origin`, find nothing readable, or never reach the repository at all

THE HELP PROMISED WHAT THE FLAG CANNOT DELIVER, which is Copilot's FOURTH round on #23 (2026-09-13), one of its three suppressed comments, at status:158, verbatim: "This help text says that `--fetch` settles a missing `origin/<branch>` unconditionally, but the implementation distinguishes failed, no-remote, unreadable, and unlisted repositories and leaves those readings unresolved. Qualify this with a successful fetch that actually reached the repository, otherwise the help contradicts the row-level guidance." IT IS RIGHT, AND IT IS THIS BRANCH'S OWN RULE TURNED ON ITS HELP: the gone-from-origin verdict is made inside `if fetched_ok_at "$repo"` and nowhere else, and the four states the two rounds before this one named — a fetch that FAILED there (round 1's S1), a repository with no `origin` remote and one git cannot read (round 2), and a path this run's fetch never listed (round 3) — are every one of them a run made WITH the flag that settles nothing, and every one of them draws the `resume` line with a caveat instead of the refusal. A help that says `--fetch` settles it describes a command that does not exist in three of those four.

SO THE CLAUSE NAMES THE FETCH AND NOT THE FLAG. "under `--fetch`, which is the only way that is settled, a missing `origin/<branch>` here is origin's answer" becomes "after a fetch that WORKED in that repository, which is the only way it is settled, a missing `origin/<branch>` is origin's answer". The tail is untouched and is now exactly right where it was merely lucky: "and without one it is named beside the `resume` that still brings back a branch this clone has merely not fetched" covered a run made without the flag, and covers those four with it, because in all five the line is the same one. `here` goes with `--fetch`, since "that repository" has just been named. Five lines of help before, five after.

THE SAME ROUND'S OTHER TWO COMMENTS ARE NOT THIS AND ARE NOT TAKEN. AGENTS.md:102 — "This rule overstates `status --fetch`: the implementation cannot settle branch loss when the fetch fails, no `origin` exists, the repository is unreadable, or the mapped path is unlisted. Please say that a successful fetch reaching that repository is what settles the missing origin branch." — is about "only `status --fetch` settles that", and README.md:67 about "with the branch gone from origin, which only `--fetch` settles". BOTH ARE CLAIMS OF EXCLUSIVITY, not of sufficiency: "only X settles that" says nothing else settles it, which is true of all four of those states and of every run made without the flag, and is the guidance a person or an agent needs — what to run, and that nothing else answers it. The help's clause was the one that said the consequence FOLLOWS from the flag, which is why it is the one that moved. Rewriting two true sentences would cost AGENTS.md and README lines against caps that exist to stop exactly that, and would say less clearly what they say now.

ONE EXISTING TEST TOOK THE LINE and nothing else in the suite moved: the help test's byte-for-byte pin of that paragraph, with a dated docstring entry that quotes the round, says why the clause is right and says why the other two are not. It FAILS against dc93459, this branch's head before this commit. 332 passed there, 332 now — this commit adds no test, because the line it moves was already pinned. No AGENTS.md or README line moves, so no cap moves (AGENTS.md 162, README 256).

Base: dc93459.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 13, 2026 18:21
@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

Round 4 (2026-09-13): one of the three suppressed comments is taken in 789ac90; the other two are answered here.

TAKEN — status:158. Verbatim:

This help text says that --fetch settles a missing origin/<branch> unconditionally, but the implementation distinguishes failed, no-remote, unreadable, and unlisted repositories and leaves those readings unresolved. Qualify this with a successful fetch that actually reached the repository, otherwise the help contradicts the row-level guidance.

Right, and it is this branch's own rule turned on its help: the gone-from-origin verdict is made inside if fetched_ok_at "$repo" and nowhere else, so the four states the rounds before named — a fetch that FAILED there, a repository with no origin remote, one git cannot read, and a path this run's fetch never listed — are every one of them a run made WITH the flag that settles nothing, each drawing the resume line and a caveat instead of the refusal. The clause now names the fetch and not the flag:

-WHOLE feature with it — under `--fetch`, which is the only way that is
-settled, a missing `origin/<branch>` here is origin's answer and the exits are
+WHOLE feature with it — after a fetch that WORKED in that repository, which is
+the only way it is settled, a missing `origin/<branch>` is origin's answer and

Its tail is untouched and is now exactly right where it was merely lucky: "and without one it is named beside the resume that still brings back a branch this clone has merely not fetched" covered a run made without the flag, and covers those four with it, because in all five the line printed is the same one. Five lines of help before, five after; the help test's byte-for-byte pin took it, with a dated docstring entry, and fails against dc93459.

NOT TAKEN — AGENTS.md:102 and README.md:67, because both sentences are true as written. They are:

AGENTS.md: … or unless ORIGIN HAS LOST THE BRANCH — only status --fetchsettles that — whichresume refuses as GONE FROM ORIGIN …
README: … with the branch gone from origin, which only --fetchsettles,resume refuses the WHOLE feature as gone from origin …

Both are claims of EXCLUSIVITY — that nothing else settles it — not of sufficiency. "Only X settles that" is true of every one of the four states above and of every run made without the flag: none of them settles it, and none of them is a way of settling it other than a --fetch. It is also the guidance a person or an agent actually needs at that point — what to run, and that nothing else answers the question — while the row and the record-layer caveat say, per repository, whether this particular run settled it and why not.

The help's clause was the one that made the consequence FOLLOW from the flag ("under --fetch … is origin's answer"), which is why it is the one that moved. Rewriting two true sentences would spend AGENTS.md and README lines against the caps that exist to stop exactly that (162 and 256, held by tests/test_repo_hygiene.py), and would say less clearly what they already say.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A stale-registration RR3 case can be incorrectly overridden by a later RR2 verdict.

Review details

Suppressed comments (1)

status:3701

  • A stale-registration leg before a later gone-origin leg is not represented in this verdict pass. worktree_here only returns success for a live worktree, so the pass records the later RR2 as the feature verdict and propagates its delete/push exits to the stale sibling; resume stops at RR3 first and requires pruning/unlocking the registration before it can do anything (AGENTS.md:111-114). Track/suppress that earlier RR3 case before promoting RR2, and add the ordering regression test.
                            elif [ "$FETCH" -eq 1 ] && origin_lost_leg "$root" "$b" "$a"; then
  • Files reviewed: 4/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap

Copy link
Copy Markdown
Contributor Author

Round 5's suppressed comment at status:3701 is the STACKED BRANCH's, not this one's. Verbatim:

A stale-registration leg before a later gone-origin leg is not represented in this verdict pass. worktree_here only returns success for a live worktree, so the pass records the later RR2 as the feature verdict and propagates its delete/push exits to the stale sibling; resume stops at RR3 first and requires pruning/unlocking the registration before it can do anything (AGENTS.md:111-114). Track/suppress that earlier RR3 case before promoting RR2, and add the ordering regression test.

It names exactly the reading this branch records as outside itself, in the description above and in b47be37's and dc93459's commit bodies: worktree_on_branch finds a worktree on the branch ANYWHERE in the leg's repository, while resume.sh's leg_registered_at matches the PATH it computes — so RR3, RR5 and RR4's second arm are readings this layer does not yet make, and fix/record-worktree-path-parity is the stacked branch where they are built and where they become the feature's verdict. Answering it here would mean bringing that computed path into this reading, which is that branch's whole subject. Carried there, not dropped.

@brettheap
brettheap merged commit 0aded19 into main Sep 13, 2026
7 checks passed
@brettheap
brettheap deleted the fix/record-origin-gone-and-shape branch September 13, 2026 18:33
brettheap added a commit that referenced this pull request Sep 13, 2026
…an off-path leg whose branch origin has lost carries RR2's two exits and not a `git worktree move`; names no move at all where the worktree root is itself a symlink, because that move runs and fixes nothing; and quotes the REF in the diverged command beside the path

COPILOT'S THIRD ROUND ON #27 (2026-09-13): one inline comment and four suppressed, every one run against workBenches' own scripts or git before anything moved. THREE ARE TAKEN — two of them one finding read from two sides — AND ONE IS NOT.

SUPPRESSED, TAKEN — RR2's PREDICATE ASKS RR4's QUESTION NOW, and the arm it feeds takes RR2's exits. Two comments, one finding. On the predicate, verbatim: "The `worktree_here` check above delegates to `worktree_on_branch`, so it returns true for any live worktree on this branch, not just the path RR4 computes. With `--fetch`, an off-path worktree plus a successfully fetched missing `origin/<branch>` should reach RR2 in `resume`, but this return suppresses the first-pass `gone` verdict and can make sibling legs recommend the wrong re-park/move exit." On the arm, verbatim: "This off-path/add-failure arm runs before the RR2 origin check, but it does not honor a `gone` verdict … this row instead recommends moving the worktree and hides the delete/push exits for the actual refusal." ONE RUN SETTLES BOTH: on a scratch three-leg estate on 2026-09-13, one leg, its worktree at `$HOME/elsewhere/001-a-thing` and its branch deleted on origin, `resume.sh` answered "Error: 001-a-thing is no longer on origin in the spec leg; that feature was NOT recreated", "REFUSED: 001-a-thing — gone from origin", exit 2 — RR4 missing ON THE PATH, RR3 finding nothing there, RR2 refusing before any add — while this layer named a `git worktree move`, which brings back no branch origin has lost. `already_recreated` is RR4's first arm asked of a leg row — a registration AT the computed path whose branch is this one, the one state `resume.sh` `continue`s past — and it replaces `worktree_here` in `origin_lost_leg`. THE FINDING IS STILL THE OFF-PATH ONE, because where the worktree sits is true of THIS workstation, RR2's own words do not carry it and `park` here will not collect it either; what changes is the EXIT, which is now RR2's own two, and the clause that says which refusal it is. It also closes the note this branch recorded and did not take against `moved_on_leg`, from the side that has the wrong EXITS rather than the wrong name.

SUPPRESSED, TAKEN — NO MOVE WHERE THE WORKTREE ROOT IS ITSELF A LINK, verbatim: "`off_path_exit` still advertises this move when `worktree_root` is a symlink. `record_worktree_root` deliberately preserves that lexical spelling, while Git reports the physical worktree path; moving an off-path worktree to this `want` therefore leaves `registered_at` unable to match it, so the next `resume` still refuses at RR3." RUN END TO END on 2026-09-13: the `git worktree move` this layer named exited 0, git then held the worktree at the PHYSICAL `…/real-wt/001-a-thing/spec`, and `resume.sh` answered "Error: '…/wtlink/001-a-thing/spec' exists and is not a registered worktree of the spec leg", "REFUSED: 001-a-thing — an unrelated path is in the way", exit 2. A move that runs and fixes nothing is the exact thing the rule at the top of `check_parked_leg` forbids. AND THE EXIT THAT DOES WORK WAS RUN TOO: the same estate with `worktree_root` set to the path git spells RESUMED the feature, exit 0 — so that is what the line names, and the resolving is still not done inside `record_worktree_root`, because a root resolved harder than the other end resolves it would compute a path `resume` does not, which is the finding this branch already carries from the other side.

INLINE, TAKEN — THE REF IS AN OPERAND TOO, verbatim: "The generated `git log` command now quotes the repository path but still interpolates `branch` unquoted. Git refnames can contain shell metacharacters such as `$`, so a valid recorded branch can make this copy-pasted diagnostic expand or split in the user's shell. Pass the ref through the same shell-operand formatter and cover a metacharacter-bearing branch in the command-output test." Right, and it is the round before this one finished properly: `git check-ref-format` takes a `$` in a refname, and `git log --oneline <sha>..feat/$HOME-thing` in a shell is `git log --oneline <sha>..feat/` followed by whatever `$HOME-thing` expands to. The whole revision range is ONE operand, so the whole range goes through `sh_operand`, which leaves an ordinary branch untouched — which is why the pin beside it did not move.

SUPPRESSED, NOT TAKEN — A LATER LEG'S RR6 LINE IS THE ONE `main`'s THIRD ROUND SETTLED, verbatim: "`mine` only gates the later path checks; the RR6 output blocks below still run before the carried-verdict block. Thus with an earlier leg obstructed at its computed path and a later sibling recorded `pushed: false` (or an unreadable value) with no worktree, this sibling returns its own `--no-push`/unreadable finding instead of carrying the first leg's `inway` verdict and exit." THE BEHAVIOUR IS REAL and it is DELIBERATE, and not this branch's to change: `main`'s third round on #23 made exactly this choice for the same shape with a GONE leg first — "the `--no-push` leg keeps the line it always had — its own refusal, in its own words" — and `test_the_features_verdict_is_the_first_leg_resume_refuses_at` pins it byte for byte, `findings[1]` being "parked with --no-push on Falcon and no worktree on that branch here … park it again from there" with a gone leg in front of it. What that line says is true of the record whatever else is wrong, it names no `resume <Name>`, and its exit — a park from the workstation that holds the WIP commit — is one that RUNS and is needed whatever clears the path. Changing it here would overturn a ruling of the commit below this branch, in a round about paths.

THE GUARD, against the head this branch pushed (df91ee8), on TWIN estates built out of the suite's own builders, offline, normalised — with TWO FAMILIES ADDED for the states this round is about, 64 in all: an off-path worktree whose branch origin has lost, under `--fetch`, and an off-path worktree under a SYMLINKED worktree root. The first differs in ONE spelling of nine, `true`, which is the only one that reaches a `pushed:`-gated reading at all; the second in all nine, because the move it named is replaced whatever the record says about the push. 64 families, 414 comparisons, 404 byte-identical, and the 10 that differ are those two and nothing else. Suite: 367 passed, 0 failed; in the bite tree 34 status tests fail with `main`'s `status` and the two `test_upstream_pin.py` failures there are the ones that need a real git checkout. No document line moves, so no cap moves: AGENTS.md 182, README.md 268.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
brettheap added a commit that referenced this pull request Sep 14, 2026
…utes for it — a worktree on that branch anywhere else and anything else AT that path are both refusals of the WHOLE feature, asked in `resume.sh`'s own order and stopped at the first leg that refuses — computing that path out of the root GIT would spell, and out of `$SPECKIT_GIT_WORKTREE_ROOT` before any file

Four commits, the stacked branch #23's own body records as where these are built ("`worktree_on_branch` finds a worktree on the branch anywhere in the leg's repository while `resume.sh`'s `leg_registered_at` matches the PATH it computes, so RR1, RR3, RR4's second arm and RR5 are readings this layer does not yet make"), each verified against the extension's own scripts on scratch estates — bare remotes in a temp dir, a fake `$HOME`, workBenches' `resume.sh`, `park.sh`, `git-common.sh` and `workspace-common.sh` — before a line was written.

The PATH, and the silence it closed. The independent reviewer's note of 2026-09-12, verbatim: "`worktree_on_branch` (in `status`) matches any path while RR4 matches only the computed one." `worktree_on_branch` answers with the worktree checked out on the recorded branch WHEREVER IT SITS and every arm of `check_parked_leg` read "there is one" as "the feature is here" — with the tip at the parked commit that is no line at all and exit 0, which is the worst shape a hole in this layer can take. `resume.sh`'s RR4 is `leg_registered_at "$leg_repo" "$tree"`, an exact-string match against ONE path: `collect_legs` computes `$WORKTREE_ROOT/$branch` for a `repo` leg and `$WORKTREE_ROOT/$branch/$SHAPE_SPEC_PATH` (or `…CODE…`) for a three-leg one, out of THIS checkout's `worktree_root` and never out of the record's. On a scratch estate with the worktree on the branch at `$HOME/elsewhere/001-a-thing` the extension answered "fatal: '001-a-thing' is already used by worktree at '…/elsewhere/001-a-thing'", "REFUSED: 001-a-thing — git worktree add failed", exit 2, while `status` said "0 finding(s) in 1 repository", exit 0. The path is now computed out of the same three sources in the same order `get_config_value` reads them — `$SPECKIT_GIT_WORKTREE_ROOT`, else the LAST `worktree_root:` in `.specify/extensions/git/git-config.yml`, else THE SHAPE'S default — with `config_scalar` cutting a `#` only where whitespace comes in front of it and `lexical_path` normalising no harder than `os.path.abspath` does, both held against the real sed and the real `abspath` over thirteen inputs. The leg ENDS at that line because `park` is blind to it too (`park --dry-run` answered "No open features under 'worktrees'; nothing to park." on the same estate), so the arms below it would name a re-park that cannot run; the exit is the `mkdir -p` and `git worktree move` that can, and where the path found is the leg's own checkout it names no command at all, because git refuses that move. Seven tests, `status --help`, AGENTS.md rule 4 and the README take the reading, 162 → 169 and 256 → 261 in dated entries.

RR4's QUESTION ASKED THE WAY RR4 ASKS IT. The first commit's arm asked "is the worktree found on the recorded branch AT the computed path"; RR4 asks "is ANY worktree registered AT the computed path", the branch read afterwards — the independent review's blocker 2 — and the two part company wherever one branch is checked out twice, which `git worktree add --force` makes: run with the leg's worktree at `worktrees/001-a-thing` and a forced second on the branch outside the root, the extension RESUMED, exit 0, while the arm refused the whole feature and named a `git worktree move` ONTO the very worktree the feature had just resumed from. `registered_at` is now an exact-string walk of `worktree list --porcelain`, `prunable` its own answer because `_git_worktree_finalize_record` stages a block only where it is false. With it comes the other side of the same question, recorded and not taken by the commit below: RR3, a path that merely EXISTS there. A plain DIRECTORY answered "REFUSED: 001-a-thing — an unrelated path is in the way", exit 2, a plain FILE the same byte for byte, a worktree of `002-other` "an unrelated worktree is in the way", and so did a detached one, one git held LOCKED, and one locked whose `.git` had been deleted. EVERY EXIT WAS RUN against git 2.43: `worktree move` into an occupied destination does not fail, it nests; onto a path git still holds registered it dies; it refuses a LOCKED worktree until an `unlock`; `prune` SKIPS a locked registration; and it refuses a main working tree. So the exit turns on what git holds there — a `worktree move` where it holds a worktree, an `mv` where it holds none, the `unlock` in front of either, the `prune` beside the `mv`. Thirteen new tests and one widened, AGENTS 169 → 177 and README 261 → 267.

THE REVIEW OF THE FIRST COMMIT, taken whole (verdict merge after fixes). BLOCKER 1: `$root` is a lexical string and git's is always physical, so an estate reached through a symlink compared one with the other and turned a HEALTHY feature into a whole-feature refusal — run both ways on one estate, `resume.sh` answered "RESUMED: 001-a-thing", exit 0, while this layer named a `git worktree move` between two spellings of one directory. `RECORD_WORKTREE_ROOT` is computed from `physical_path "$root"` now, and NO FURTHER: `get_config_value` resolves no symlink and `resolve_path_from_repo_root` is `abspath`, so where the worktree ROOT is itself a link both ends miss and the refusal survives, which was run too. SHOULD-FIX 1: the quoted `git worktree add` failure is the mechanism in one off-path state of five — moved on it is RR1, behind it RR5, gone from origin RR2, with no parked commit RR1 again — so the line names the outcome and keeps the quoted sentence in a parenthesis for the state that prints it. SHOULD-FIX 2: AGENTS.md and the README said the root is read "out of THIS checkout's `git-config.yml`, and read no other" while both verbs read `$SPECKIT_GIT_WORKTREE_ROOT` first. NIT 1: the rationale for `[ "$tree" = "$repo" ]` now says what the test answers. With them, the state the commit above recorded and did not take — a PRUNABLE registration at the computed path with nothing on disk, which RR4 misses and RR3 passes and the run dies on at the end ("a missing but already registered worktree", "REFUSED: 001-a-thing — git worktree add failed") — is said in the stale-registration arms' own words, with their prune, and the same prune goes in FRONT of the move where a dead registration holds the destination. And the off-path reading became the FEATURE's, which it was not: a three-leg record proved a sibling leg still said "`resume Trio` brings it back" while the culprit leg said the feature was refused. Five new tests, AGENTS 177 → 181, the README re-wrapped inside its cap.

THE REBASE ONTO `main`, and Copilot's FIFTH round on #23 settled empirically. `main` took #23's rounds 3 to 5, and its third round made the whole-feature verdict THE FIRST REFUSING LEG'S IN THE RECORD'S ORDER — RR6, RR2 and RR1 in one walk. The two readings above are refusals of the same loop, so they are asked inside that walk, in `resume.sh`'s order: RR6, then RR4 and RR3, then RR2, then RR1, the first answer kept with the exit that travels with it, and one verdict and one kind handed down (`pushed`, `inway`, `gone`, `moved`, or `add` for the `git worktree add` that runs last of all). THE ROUND, verbatim: "A stale-registration leg before a later gone-origin leg is not represented in this verdict pass … `resume` stops at RR3 first." Five estates, 2026-09-13, `spec` recorded first and `code` second with `code`'s branch deleted on origin. (a) A stray DIRECTORY at the `spec` leg's path: "REFUSED: 001-a-thing — an unrelated path is in the way", exit 2 — REAL, and `main` answered the gone verdict with RR2's exits, which are the wrong thing to do about a directory. (b) A PRUNABLE registration there with nothing on disk, in both spellings: "REFUSED: 001-a-thing — gone from origin", exit 2 — the premise is WRONG for a stale registration, because `load_git_worktrees` drops a prunable block whichever branch it names. (c) The `spec` leg's worktree off the path: "gone from origin" again — WRONG there too, the add being the last thing the run does. The control, a LOCKED registration for another branch with nothing on disk, which git calls no prunable: "an unrelated worktree is in the way", RR4's second arm on the earlier leg. And a leg RR6 refuses still says where its OWN worktree sits — RR6 is "whichever of its own checks this leg reaches first" — while an EARLIER leg's RR6 silences a later leg's path, both run. Three new tests, all three biting; no document line moves, so no cap moves. Recorded and not taken: `moved_on_leg` asks `worktree_here`, which is wider than RR4's question, so a leg with no `parked_commit:` and an off-path worktree is RR1's divergence at the other end and the off-path line here — the exit it names is the `worktree move`, which makes that very run RESUME (both halves run 2026-09-13), so the reading is not narrowed and the comment on that function says why.

Guard: `main`'s `status` (0aded19) against this branch's tip on TWIN estates — each side builds its own out of the suite's own builders, offline, and the temp root, every object name and every timestamp are normalised before exit code, stdout and stderr are compared. 60 scenario families, 394 comparisons, 246 byte-identical; the 148 that differ are 36 families and every one is a state these four commits address — fifteen the path-parity reading in all nine spellings of `pushed:` (it is made before the tip arms, and RR6 does not silence a leg's own line), fourteen what is AT that path in the one spelling that reaches RR4 and RR3, and the rest a locked registration at an off-path destination, a stray directory with the worktree elsewhere, a prunable block on the recorded branch with a live worktree elsewhere, two three-leg whole-feature families, and cases (a) and (b) above. THE 24 THAT MUST NOT MOVE DID NOT: case (c), a HEALTHY feature under a symlinked projects directory, two worktrees on one branch with one AT the computed path, a dead registration on the RECORDED branch with nothing on disk, every on-path state, no worktree here, no record at all, a config override that AGREES, an absolute and a `../`-laden `worktree_root`, a stale registration on the path, origin gone with no worktree, an unrecorded worktree, an empty role, `role: assembly`, `role: spec` in a single checkout, a feature a sibling leg costs whole, and the four healthy three-leg families.

Suite: 360 passed, 0 failed, with `upstream/openRepoShape` initialised. Against `main`'s `status` in a `cp -a` of this tree, 25 status tests fail — 23 of the 28 this branch adds, the five that do not being gates that must pass there (a feature `collect_legs` refuses whole, a feature refused whole, a HEALTHY estate under a symlinked projects directory, two worktrees on one branch with one AT the computed path, and a `--no-push` record with a stray directory at that path) — plus Copilot's `path: "."` test and the help's byte-for-byte pin, which took the new words — and the two `test_upstream_pin.py` failures there are the ones that need a real git checkout and fail in any copied tree. Caps: AGENTS.md 181, README.md 267, both re-measured on this base with the dated entries merged (the README paragraph the second commit splits is re-wrapped whole, which is the one document line that moves).

RECORDED FOR LATER, NOT TAKEN: the exits this layer names for a leg declared `path: "."` do not run. `leg_tree_path` answers `<worktree_root>/<branch>/.` for such a leg because that is the string `collect_legs` computes and the string this layer must compare against, but spoken as a command operand `mv '…/001-a-thing/.' <dest>` is refused by coreutils outright and `git worktree move <tree> '…/001-a-thing/.'` exits 0 and puts the worktree INSIDE the destination. And no destination would help: RR4 matches that string against no worktree git can spell, so the other end is not idempotent for it either — the run after a successful resume refuses the worktree it just created, "REFUSED: 001-a-thing — an unrelated path is in the way", exit 2 (run 2026-09-12). The reading is a strict improvement on the base, which called that estate present and clean; the exit is a round of its own, and under it a `collect_legs` that computes `$WORKTREE_ROOT/$branch` for a leg whose path is `.`, which is workBenches'.

Lane: openrepotools-3 (openRepoTools-3)

PR #27

Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 14, 2026
…ill make, and a `- branch:` or a `- role:` the record's KEY ORDER leaves under a shut list is a finding naming the list that shut it and the two exits in the order that does not lose the work, instead of a `resume <Name>` that brings none of it back

`workspace_load_project` — the loader `resume` and `park` both read a record
through — reads a block by INDENT and SHUTS a list at the first key shallower
than its items. `in_features=false` is the first line of its indent-4 arm,
before the `case` that sets it true again for `features:` alone; `in_legs=false`
is the first line of its indent-8 arm; its `- branch:` arm sits behind
`[ "$in_features" = true ] || continue` and its `- role:` arm behind
`[ "$in_legs" = true ] || continue`. So a project-level key a bad merge left
between two features, or between a feature and its `legs:`, does not reorder
the record — it ENDS the list, and everything under it is lines `resume` makes
no feature and no leg out of.

`status` had no such state: it matched the indent of a line and nothing above
it. So it counted features `resume` never makes and legs it never collects,
and offered `resume <Name>` for both — work `status` claims and `resume` will
not bring back, in the direction that matters most, because a person reading
it believes the feature is safe.

## The twelve records, the loader's answer, and what `main` says

Run against the INSTALLED extension on this rebase, 2026-09-14 —
`git-common.sh` and `workspace-common.sh` sourced in place, twelve hand-built
records, the `MANIFEST_*` arrays printed — with the answers the runs of
2026-09-12 and 2026-09-13 recorded. `main` and this branch are read by lifting
`record_rows` out of each `status` and running it over the same twelve.

| record | the loader | `main` | this branch |
|---|---|---|---|
| (d) the ordinary record `park` writes, two features | 2 features, 2 legs | 2, 2 ✅ | 2, 2 ✅ |
| (a) a project key BETWEEN two features | 1 feature, 1 leg | 2, 2 ❌ | 1, 1 ✅ |
| (b) a project key between a `- branch:` and its `legs:` | 1 feature, 0 legs | 1, 1 ❌ | 1, 0 ✅ |
| (c1) a `- branch:` above every `features:` key | 0 features, 0 legs | 1, 1 ❌ | 0, 0 ✅ |
| (c2) …and with no `features:` key at all | 0 features, 0 legs | 1, 1 ❌ | 0, 0 ✅ |
| (e) a feature-level key between `legs:` and its items | 1 feature, 0 legs | 1, 1 ❌ | 1, 0 ✅ |
| (f) a feature-level key BETWEEN two legs | 1 feature, 1 leg | 1, 2 ❌ | 1, 1 ✅ |
| (g) a project key between two legs | 1 feature, 1 leg | 1, 2 ❌ | 1, 1 ✅ |
| (h) a SECOND `features:` key after a project key (the list REOPENS) | 2 features, 2 legs | 2, 2 ✅ | 2, 2 ✅ |
| (i) a `- branch:` below a project key, no legs | 1 feature, 1 leg | 2, 1 ❌ | 1, 1 ✅ |
| (j) a BLANK `- branch:`, a project key above its `legs:` | 1 feature named nothing, 0 legs | 1, 1 ❌ | 1, 0 ✅ |
| (k) a second `features:` key BELOW an unread `- branch:` | 1 feature, 2 legs, both filed under the feature ABOVE it (`MANIFEST_LEG_FEATURE` is `0 0`) | 2, 2, the second leg under the phantom ❌ | 1, 2, both under the feature above ✅ |

`main` agrees on (d) and (h) and on nothing else — the same answer e18ec53
gave, and for a reason worth one line: **`record_rows` is byte-identical
between e18ec53 and 7efc850**. #23's rounds 3–5 and #27's whole computed-path
reading are in `read_record` and below it; neither touched the row reader.

**And what that costs the person reading it** (run against 7efc850's own
`status`, on the estates this suite builds, 2026-09-14):

* (a) — `2 feature(s)` and `resume Atlas` offered twice, once for a feature `resume` never selects.
* (b), (e) — `(repo leg): no worktree on that branch here … `resume Atlas` brings it back` for a leg `collect_legs` never collects, which is a feature `resume` refuses WHOLE.
* (c) — `1 feature(s)` and that same offer; and with no `features:` key at all the note line is `parked record: 1 feature(s), parked ? on ?`, the project row suppressed and the date and the workstation with it.
* (f), (g) — in the three-leg fixture, the phantom leg's own line: ``resume Trio` brings it back, unless origin has lost that branch … taking the WHOLE feature with it ("001-a-thing is no longer on origin in the code leg")` — a whole-feature refusal over a leg `resume` never reads, and `resume Trio` twice.
* (i) — a second feature, and `the record lists no leg for it`, which is `collect_legs`'s refusal of a feature it REACHES.
* (j) — RR2's refusal, `is no longer on origin`, of a feature `collect_legs` throws out before RR2 is reached.

## What changed

`record_rows` carries the loader's two flags, set where the loader sets them:
every line at indent 0, 2 or 4 shuts the feature list and `features:` alone
reopens it; every line at indent 6 or 8 shuts the leg list and `legs:` reopens
it inside an open feature list; nothing at indent 10 or 12 moves either, and a
full-line comment is no line to either reader.

* A `- branch:` under a shut list gets a **`nofeature`** row instead of a `branch` row, and does NOT become `$branch` — `$branch` is this reader's `feature_index`, the last feature the loader MADE, which is record (k).
* A `- role:` under a shut leg list gets a **`noleg`** row carrying the branch, the role and WHICH LIST WAS SHUT — because that is the line a person has to go and find.
* `read_record` counts the unread legs onto the feature in its first pass and prints, in the second, one finding per unread `- branch:` and one per feature whose legs went unread: the whole-feature refusal where the feature keeps no leg, the one-leg line where it keeps some, and the two defects in ONE line where the branch has no name (rather than the "lists no leg" a record that lists one should not be told).
* The why and the exits are worded once, in `record_unread_why` and `record_unread_exits`. The why names ONE arm, never both. The exits are **the record's key ORDER first** — the one hand-edit these rules ask for — and **the re-park second, and only from the workstation that has the feature**: `workspace_write_manifest` rewrites the project's whole block and `emit_recorded_feature` carries forward only what `MANIFEST_FEATURE_BRANCHES` holds, so a park run anywhere else writes the block back without these lines at all. The lines are one park from gone.
* The project row's gate takes an `$unread` half beside `$has_features`, so a block whose `- branch:` sits above every `features:` key still gets the row its finding needs the date and the workstation out of. Every record `park` writes is byte for byte the rows it always was.

**It composes with #27's verdict walk by being invisible to it.** The walk's
questions — `collect_legs`'s three, then RR6, RR4/RR3, RR2, RR1 in
`resume.sh`'s own order, each gated on "no earlier leg refused" — are asked in
the `leg)` arm of the first pass and nowhere else, and a line under a shut list
emits no `leg` row. That is the loader again: it puts no such line in
`MANIFEST_LEG_ROLE`, so `collect_legs` never walks it and no RR is ever asked
of it. A `nofeature` row appends no feature entry either, so every array the
walk reads back is still indexed by the features the loader MAKES.

## The differential guard, rebuilt `7efc850` → `9b06ecb`

Twin estates out of this suite's own fixture builders in a temp dir; the temp
root and every hex sha normalised; exit code, stdout and stderr diffed. Eleven
record shapes × seven phases — five spellings of `pushed:` (`true`, `false`,
the key absent, the key with no value, a word that is neither) with no worktree
here, one with a worktree on the branch, one with the branch dropped from
origin under `--fetch`. **77 comparisons.**

`main`'s `status` run AGAIN after this branch's run is byte-identical in all
77 — the harness reads nothing but the change, and neither run moved the
estate. Against this branch: **14 identical, 63 differing**, and the split is
exactly the loader's.

| shape | pushed:true | pushed:false | pushed absent | pushed empty | pushed word | worktree | gone (`--fetch`) |
|---|---|---|---|---|---|---|---|
| (a) | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF |
| (b) | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF |
| (c1) | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF |
| (c2) | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF |
| **(d)** | **SAME** | **SAME** | **SAME** | **SAME** | **SAME** | **SAME** | **SAME** |
| (e) | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF |
| (f) | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF |
| (g) | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF |
| **(h)** | **SAME** | **SAME** | **SAME** | **SAME** | **SAME** | **SAME** | **SAME** |
| (i) | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF |
| (j) | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF | DIFF |

Every difference is an arm above: (a), (c) and (i) the feature count and the
branch's own finding (the indent-4 arm); (b) and (e) the whole-feature refusal
that replaces a leg read against disk (the project-indent and the
feature-indent arm); (f) and (g) the phantom leg's line becoming the finding
about the leg that will not come back, while the leg that does keeps its
`resume`; (c2) also the note line, which is the project row's new `$unread`
half; (j) the one line that now says both defects. Two differences are not a
finding's wording and are named for that reason: **(c) in the worktree phase
also gains `worktree on 001-a-thing (root): not in the parked record — never
parked`**, because a branch the loader makes no feature of is in no recorded
set and `park`, reading the record through that same loader, would park it as
new — and the footer's finding COUNT moves with it. The `--fetch` phase adds
no reading of its own: the role is read before any RR.

## Bite, suite, caps, invariants

**Eight tests bite.** This branch's `tests/` against `main`'s `status` in a
scratch tree, 2026-09-14: `8 failed, 6 passed` —
`test_a_project_key_between_two_features_leaves_the_second_unread`,
`test_a_branch_above_every_features_key_is_a_feature_resume_never_makes`,
`test_a_feature_level_key_between_legs_and_its_items_leaves_no_leg`,
`test_a_key_between_two_legs_costs_that_leg_and_not_the_feature`,
`test_a_second_features_key_reopens_the_list_and_its_legs_keep_the_feature`
(the five new ones),
`test_a_root_key_between_a_branch_and_its_legs_still_reads_that_feature` and
`test_a_blank_branch_above_the_root_key_is_still_the_feature_resume_refuses`
(the two that took the split), and
`test_the_help_carries_the_no_push_exception_its_findings_do`.

**The suite: 480 passed at 7efc850, 485 here** (`python3 -m pytest tests -q`,
both in a real checkout with the submodule at the pinned commit).

**The caps are the measured counts, not either side's number.** `main` reached
AGENTS.md 214 / README.md 377 while this branch waited; the ten and six lines
it wrote on 162 and 256 land in the same rule 4 sentence and the same
exception, over none of the lines the entries above them bought. Measured
after the rebase: **AGENTS.md 224, README.md 383**, each with its own dated
entry in `tests/test_repo_hygiene.py` beside `main`'s, which all stay.
(Those were the counts AT THE REBASE. `main` has since moved to `63a74af`
and the checked-in caps are now **224 / 409** — see *The merge of `main` at
`63a74af`* below.)

**Invariants**: the shared estate resolver byte-identical across `park`,
`resume` and `status`; `expand_home` byte-identical across `status` and
`resume`; `gh api` only in `gh_api_line`; no bash-4-only grammar; `bash -n
status` clean; shellcheck 0.9.0's finding profile identical to `main`'s; and
this commit adds no `"${arr[@]}"` expansion at all (its one array read is
`${#feature_legs[@]}`, the count `main`'s own `leg)` arm already uses).

## The rebase

`e18ec53` → `7efc850`, still ONE commit. The conflicts were the three texts
this reading shares with #23 and #27, and the two caps: the `--help` exception
paragraph, where `main`'s "after a fetch that WORKED in that repository"
replaces "under `--fetch`" and the key-order clause follows it; `read_record`'s
locals and its first pass, where the `noleg` arm and its three arrays join
#27's `feature_rr`/`feature_add` walk rather than the `feature_gone` it
replaced; and the two cap entries. AGENTS.md and the README merged clean.
Everything above was re-measured on the rebase.

Recorded and NOT taken, as before: `workspace_load_project` takes a list item
by stripping `- ` and TRIMMING AGAIN, so `-   branch:` and `-   role:` are a
feature and a leg to it while this reader's patterns match neither. Re-run
2026-09-14: `main` and this branch answer IDENTICALLY on both. It is neither
this branch's regression nor its to fix; it wants an item parser this layer
has never had.

## Copilot's three rounds, `8a77d39`, `2bedf9b` and `55bb7a1`

Round 1 on `9b06ecb` (three inline threads, six suppressed), round 2 on
`8a77d39` (one suppressed) and round 3 on `2bedf9b` (one inline) are **six
findings, all six real and all six taken**; the loader run that decided each is
in [this
comment](#33 (comment)).

* **The noun, six places.** "at the next **key** at feature indent" — in
  `status --help`, AGENTS.md rule 4, the README, both cap docstrings and the
  help string the suite pins byte-for-byte. `grep -rn "next at "` over the
  tree now returns nothing.
* **A reopened list is a clean slate for `$dropped`.** The legs of a list
  reopened below an unread `- branch:` are collected onto the feature ABOVE
  it, so a `- role:` left under a shut leg list there is that feature's
  defect — and, left set, `$dropped` suppressed its row entirely: the leg went
  out in SILENCE, and where the feature above kept no read leg the report said
  "the record lists no leg for it" about a record that lists one.
* **A list that was never OPENED has no key that shut it.** `record_unread_why`
  takes two arms more, `nolist` and `nolegs`, which name the key that opens
  each list and say it is missing above that line, rather than sending a hand
  to a closing key the record has not got.
* **And the third state may not swallow the second** — not Copilot's finding
  but the hole taking the one above opened. The loader makes a feature at
  indent 6 only where the item's key is `branch`, so any other line there
  leaves the feature above it current, and THAT feature has its `legs:` key.
  `nolegs` is the `- branch:` line's alone.
* **No unread-leg line promises back a feature this run already refuses.** The
  legs it DOES read can carry a whole-feature verdict of their own; the
  verdict is read back in the order the `leg)` arm reads it, and where there
  is one the sentence says so and stops.
* **A leg the record gives no role is named by the role it has not got.**
  `- role: # note` is that line to both readers — `record_scalar`'s reading
  from #21 — and the finding about it had been naming the leg with a pair of
  empty backticks. Recorded and not taken: with the key put back such a leg is
  one `collect_legs` READS, which `check_parked_leg`'s roleless arm already
  answers on the run after the key moves.

* **A blank `- branch:` that keeps a leg still names the one it drops.** The
  combined line was reached only where the feature keeps NO leg; where it keeps
  one the run fell through to "a `- branch:` in the record has no value" and
  stopped — and since the blank name suppresses every per-leg line and the
  `noleg` arm only counts, the dropped line was said NOWHERE. The new arm is
  the third of four and keeps RR2's refusal, because a feature that keeps a leg
  `collect_legs` collects is not refused as a shape mismatch; the exits stay the
  blank name's, since no re-ordering settles a feature named nothing.

**Bite**: 5 tests fail against `9b06ecb`, 2 more against `8a77d39`, 1 more
against `2bedf9b`. **Suite**: 485 → 488 → 490 → **491**. **Caps unmoved by those four commits**: AGENTS.md 224, README.md 383 (the later merge of `main` raises them to 224 / 409 — see below). **Row
differential `9b06ecb` → `8a77d39` over 21 records**: the feature and leg
counts identical in all 21 — every difference is which line a finding names,
one line that was never printed, and one name that was printed empty. The
estate-level guard above is `7efc850` → `9b06ecb` and is not rebuilt for these
rounds, for that reason. Invariants unchanged at each step, shellcheck profile
included.

## The merge of `main` at `63a74af`

`main` moved to `63a74af` (#26, Amendment 11's lane tooling) while this branch
waited on review, so the branch merges it — **a merge commit, `e2952d9`, not a
rebase**, because three Copilot rounds are recorded against `8a77d39`,
`2bedf9b` and `55bb7a1`, and a rebase would rewrite all three and leave the
review pointing at commits that no longer exist.

#26 touches neither `status` nor `tests/test_status_command.py`, so the overlap
is three files. `AGENTS.md` and `README.md` merged CLEAN and both readings
stand in their places: the merged `AGENTS.md` differs from this branch's by
exactly `main`'s one line (the `--install` count, nine → eleven), and the
merged `README.md` differs from `main`'s by exactly this branch's six.

**The one conflict was the two README cap entries, and both sides were right** —
each appended a dated entry after `270 AND 363 MEET AT 377` and each rewrote the
same `assert`. Both entries are kept, and a third, `383 AND 403 MEET AT 409`,
records the arithmetic. Nothing is dropped.

**The caps are the measured counts of the MERGED files:**

| file | this branch | `main` | **merged, checked in** |
|---|---|---|---|
| `AGENTS.md` | 224 | 214 | **224** |
| `README.md` | 383 | 403 | **409** |

`README.md` is 377 + 6 (this branch) + 26 (`main`), the line sets disjoint, and
neither side's number would have done: 409 fails `<= 383` **and** `<= 403`.
`AGENTS.md` does not move because #26 changed a *word* of it and not a line —
and its 224 is still the number measured after the merge rather than the one the
branch was carrying.

**Suite on the merged tree**: `python3 -m pytest tests -q` → **549 passed**,
rc=0 (the 491 measured here at `55bb7a1`, plus the 58 arriving with #26). Among
those 58, `ALL_BASH` now holds every shipped file to A9 Addendum 4's rule
against a `case` opened inside a `$( )`; it meets this branch's 379 added lines
of `status` for the first time here, and they carry none.

Lane: openrepotools-3 (openRepoTools-3)

PR #33

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants