Skip to content

status reads a parked feature the way resume's collect_legs will judge it — per feature, before any leg — so a feature resume refuses whole never has a leg line offering resume <Name>, a feature with no legs or an unmountable role is a finding, and the absent-pushed: line names the refusal rather than one loader's reading - #22

Merged
brettheap merged 15 commits into
mainfrom
fix/record-feature-level-readings
Sep 12, 2026

Conversation

@brettheap

@brettheap brettheap commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Four follow-ups to reviewer's notes, taken on the notes alone — nobody has ruled on them — and all of one kind: the record layer reading a feature THE WAY resume.sh's collect_legs WILL JUDGE IT, which is per FEATURE, before any leg of it is read.

  1. The absent-pushed: clause said "resume reads a missing one as not pushed and refuses it" — main's loader's mechanism, which workBenches The name guard's two remaining indeterminate reads pick a branch of the (b) table instead of naming the read: the register's TEXT and the lane's binding log #60 (merged 2026-09-12) changed: the loader now reads a missing key as nothing and resume refuses it for that. Both loaders refuse at RR6 and both leave the same re-park, so the clause names the refusal and the exit and not the reading one loader makes to reach it; the three comments that described the old mechanism say which loader does what and that the outcome is the same. Words only.
  2. role: nope drew "the record names a leg this root does not mount here" — true, and it named no exit and did not say that collect_legs (spec/code only in a three-leg checkout, repo only in single, *) return 1) refuses the WHOLE feature for it in the shape words ("was parked from a single project and this checkout is single", "REFUSED: … — shape mismatch", exit 2 — verified against both versions of the extension). The finding now says so and names both exits. The arm is SPLIT on what proves the refusal: collect_legs maps roles by NAME onto the paths load_repo_shape computed and never reads the directory, so a leg this root mounts that is not a checkout (an unfetched submodule) keeps its old sentence byte for byte; only a role leg_repo_for_role cannot answer at all is the whole-feature refusal.
  3. A feature the record lists no leg for — an empty legs:, legs: [], or leg items with no - role: line — was counted and then silent, while collect_legs's closing [ "${#LEG_ROLES[@]}" -gt 0 ] refuses it whole. read_record gains a first pass over the rows that counts each feature's legs, keyed per branch ROW (the loader makes a feature of every - branch: line), and the finding lands in the record's own order; the unrecorded-worktree sweep still knows that branch as recorded.
  4. From Copilot's review of status reads a record leg that names no parked_commit: — and one the record gives no role — the way resume will refuse them, instead of offering resume <Name> for the first and saying nothing about the second #21: a feature with one roleless leg still printed "resume <Name> brings it back" for a sibling leg with no worktree here, a command that cannot recreate it. The same first pass now makes the whole-feature verdict — a leg with no role, or a role leg_repo_for_role cannot answer — before any leg's arm runs, and hands it to check_parked_leg; for such a feature the two arms that named resume say instead that resume refuses the whole feature and why, with a stale registration's prune still first, while a sibling's other readings (dirty, moved on, missing commit) are unchanged. An empty verdict leaves every arm byte-identical.

status --help, AGENTS.md rule 4 and the README widen one clause each for 2 and 3 (they already said "the whole feature", which 4 makes the per-leg lines stop contradicting); hygiene caps AGENTS.md 153→155, README 249→251 in dated entries. Fourteen new or changed tests, each failing against #21's head (04dc60e), and the independent review of this branch ran its own guard against that head: 317 comparisons over 37 record-layer scenarios × nine spellings of pushed:, the 182 that these commits do not address all byte-identical, the 108 that differ all the intended ones. That review's findings are taken in a fifth commit: the second pass's per-feature verdict lookup is guarded for a record whose root: key sits between a feature's - branch: and its legs (a leg row with no branch row — subscript -1 was an error on bash 3.2 and the last feature's verdict on bash 5); leg_repo_for_role answers a declared spec/code leg with no path: at the role's own name, as _shape_record_leg defaults it, so an unfetched submodule in a genuinely three-leg root keeps the short "does not mount here" line rather than a shape refusal resume would not make; and the load_repo_shape rule is stated exactly — kind: project-manifest, schema: project-repo-schema, and both a spec and a code leg declared, path optional. Suite: 306 passed with it, and its guard against the four commits' tip, 317 comparisons, byte-identical outside the two states it changes. And from Copilot's review of this PR, a sixth commit: leg_repo_for_role read project.yaml's role: and path: without cutting a # comment, which load_repo_shape cuts from every line, so - role: spec # the spec leg declared without a path: was misread as a role this root cannot mount; and a - branch: with no value was dropped from the record layer with its legs while the loader makes a feature of it and resume refuses it (at RR2 with the name blank, or as a shape mismatch with no legs) — it is now one finding on the root's row carrying RR2's two exits. Two tests, both failing against the previous head; suite 308. And from Copilot's SECOND round on this PR, a seventh commit, both suppressed findings taken and both real: record_rows decided whether a row went out AT the line it read it from, so every row above the key that SELECTS the block was thrown away for a block that did match — and a root= selector (every family member, and a record found under the folder name) is answered at the root: key, which a hand-edit or a bad merge can leave below features:. With it at the foot of the block that is every row, and the layer said "no block for this root" about a record it had just matched; with it inside the feature it was Copilot's own case, a blank - branch: row suppressed while the leg row under it went out, reaching read_record with seen_branches == 0 and drawing "resume Atlas brings it back" for a feature resume refuses at RR2 under a blank name. The rows are HELD now and flushed in the record's own order the moment the block is known to match — record_rows lifted out of both status files and run against a two-block family record for six selectors gives byte-identical output, so nothing a record park wrote reads differently. And leg_repo_for_role read a full-line # comment at COLUMN 0 as the indent-zero key that closes a leg, dropping the path: under it: load_repo_shape cuts # off every line and skips what is left when it is empty, so a - role: code whose path: spec sits under such a comment loads as CODE_LEG=<root>/spec there (run against git-common.sh 2026-09-12) where this reader answered <root>/code and called it a leg this root does not mount — the same cut #20 gave record_rows for the same line. Three tests, all failing against the previous head, and the leg-row guard that branch added is now the belt to a brace no record can undo, its test rewritten to the corrected reading. An eighth commit, from Copilot's third round: a path: whose own value carries a # comment is read where the loader reads it — that cut landed with the sixth commit, but no test held the path: arm down, only its role: siblings — so path: spec # note on a code leg is now proved read at spec/, the checkout the manifest names, not at the role's default (biting against 4825d61, the head before the cut). Suite: 312 passed. Recorded for later, not taken: a role this root DOES mount that collect_legs refuses anyway — assembly, repo in a root load_repo_shape calls three-leg (one project checked out at two shapes, the commonest mismatch there is), spec in a root whose project.yaml declares no code leg, or any word that matches a directory under the root — needs a reading of this root's shape against the record's, which the next branch builds; and two record entries with one branch name draw one name two verdicts, faithfully (resume answers both), with nothing yet saying they are two entries.

Stacked on #21 until it landed as 4ca4690; brought onto main by merging it in (the branch is a superset of the squash), the merge proved byte-identical to a rebase onto main.

🤖 Generated with Claude Code

Summary by Sourcery

Make status judge parked features consistently with resume before reporting individual legs, so its findings never recommend resuming a feature that resume will reject.

Bug Fixes:

  • Align status findings with resume by evaluating each parked feature before its legs and reporting whole-feature refusals for missing roles, unmountable roles, and features with no legs.
  • Preserve detection and reporting of records with blank branch names, including their legs and the appropriate refusal outcome.
  • Prevent incorrect record parsing when selector keys, comments, or optional leg paths appear in unexpected positions or formats.
  • Avoid offering resume <Name> for any leg of a feature that resume will refuse as a whole.

Enhancements:

  • Make absent pushed: findings describe the shared refusal rather than depending on one loader’s internal interpretation.
  • Keep per-leg findings and ordering intact while attaching feature-level verdicts to the correct feature and preserving stale-registration guidance.

Documentation:

  • Update the README, AGENTS.md, and status --help guidance to cover whole-feature refusals and features with no legs.

Tests:

  • Add comprehensive regression coverage for feature-level refusal handling, record ordering, malformed and comment-containing manifests, selector placement, blank branch names, and prevention of invalid resume advice.

Chores:

  • Adjust documentation line-length hygiene caps to accommodate the expanded guidance.

brettheap and others added 10 commits September 11, 2026 22:15
…ich `resume` refuses as moved-on — instead of offering `resume <Name>` for it or, with a worktree here, saying nothing at all

The follow-up to note 7 of the independent review of #20 (2026-09-11), recorded there as out of scope and taken on the reviewer's note alone — nobody has ruled on it: a leg whose record carries `pushed: true` and NO `parked_commit:` fell out of the record layer in both directions. `check_parked_leg`'s `[ -n "$commit" ] || return 0` sat AFTER the no-worktree arm, so with no worktree here the line was "no worktree on that branch here; parked 2026-09-10T20:00:00Z on Falcon — `resume Atlas` brings it back", and with a worktree here there was no line at all, exit 0 — while the extension's `resume.sh` refuses that record: RR6 passes on `pushed: true`, RR4 finds no worktree to call already-done, RR3 nothing in the way, RR2 the branch on origin, and RR1 (`[ "$remote_tip" != "$parked_commit" ]`) refuses it, because an absent parked commit never equals a tip. Run against such a record on 2026-09-11 the extension answered "Error: 001-a-thing (repo leg) has moved since it was parked; that feature was NOT recreated. / parked commit     (parked 2026-09-10T20:00:00Z on Falcon) / current tip    050d1ee9cd784e57c80817d7fb7068d696750249   (origin/001-a-thing)", exit 2. That fails the house rule harder than silence does — the layer did not merely stay quiet about a record `resume` refuses, it NAMED AN EXIT THAT CANNOT WORK — and the other half is the silence itself: the `return 0` skipped the three tip arms, which are the only thing this layer says about a worktree that is here. The state is now read as its own, before the arm that names `resume`: with no worktree here the line says the record names no parked commit, that `resume` matches origin's tip against it before it recreates anything and refuses the leg as having moved on, and the exit — park it again from the workstation that has that feature, which writes the record afresh, because `emit_recorded_feature` carries a REFUSED feature's entry forward untouched and `workspace_write_manifest` drops the empty key again, so only a park that parks it THROUGH records a commit; with a worktree here the line says what cannot be compared — moved-on, behind and diverged cannot be told apart with nothing to compare against, and the empty string is not a commit: the first of those arms, `cat-file -e "$commit^{commit}"`, fails on it, and what would print is "its parked commit  is not here — the record says it was pushed, so this repository has never fetched it", a blank sha and a reason invented for a commit the record never named (the independent review of this branch, 2026-09-11, proved it by removing the arm) — and names no refusal, since `resume.sh`'s RR4 calls a leg whose worktree is already at the path it computes recreated and only warns, "the parked WIP was NOT un-committed". A stale registration still has its prune named first, as the `--no-push` and unreadable-`pushed:` arms do. Absent and bare `parked_commit:` are ONE state here, unlike `pushed:`, and need no field of their own: `workspace_load_project` leaves `MANIFEST_LEG_COMMIT` at the empty string either way and `trim_unquote` does the same, so both readers make one state of them. The `pushed:` arms keep their order and their words — they are RR6, which `resume` reaches first, and their one line already names the same re-park — so a `--no-push` or unreadable leg with no commit and no worktree is unchanged, and with a worktree here the missing commit is a second finding after the first, in `resume`'s own order. `status --help`, AGENTS.md rule 4 and the README gain the exception in their own words, not the `pushed:` clause's: this one is refused at RR1, not RR6, so "which `resume` refuses the same way" would be a claim about the extension that is not true; hygiene caps AGENTS.md 150→152, README 246→248, in dated entries naming the rule. Two regression tests beside the note-8 ones they belong with, both failing against a40cbb7 (there: the `resume Atlas` line, and exit 0 with nothing said), and the widened help test with them. The review guard, well-formed records only: 34 comparisons of a40cbb7's `status` against this one — 17 record-layer scenarios × `pushed: true`/`false`, commit and role present — byte-identical in exit code, stdout and stderr.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…s the WHOLE feature for, in words about the project's shape — instead of dropping the leg and saying nothing

The follow-up to note 8 of the independent review of #20 (2026-09-11), recorded there as out of scope and taken on the reviewer's note alone — nobody has ruled on it: a leg whose `- role:` value is EMPTY drew nothing at all from `status` — no finding, exit 0, with no worktree here, with one in sync, and under `--fetch` — while the extension creates that leg and refuses the feature for it. `record_rows`'s `[ -n "$role" ]` was doing two jobs at both emit sites, "a leg is open" and "the leg has a role", and the second dropped the row; `workspace_load_project` does no such thing — its indent-10 arm takes the `- ` item, keys on `role` and assigns whatever the scalar is, empty or not — so `resume.sh`'s `collect_legs`, which maps `spec`, `code` and `repo` onto this checkout and has `*) return 1` for everything else, refuses the WHOLE FEATURE: run against such a record on 2026-09-11 the extension answered "Error: 001-a-thing was parked from a single project and this checkout is single; that feature was NOT recreated", exit 2, and the same answer with a good `repo` leg sitting beside the roleless one — every other leg of that feature goes with it. The words are about the SHAPE, which is not what is wrong, so a person who reads them has a sentence that contradicts itself and no way to the record's actual fault; that is the line `status` now prints in advance. `$open` does the "a leg is open" job now — set at the `- role:` line, cleared where the leg ends — so the role's value means only what it says, the row goes out with an empty role field, and the row's six fields are unchanged, an empty field between two 0x1F separators shifting nothing. `check_parked_leg` answers it BEFORE `leg_repo_for_role` is asked, because that function's last test for an empty role is `[ -d "$root/" ]`, always true, and it would hand back the root and read the leg as if the record had named `repo`; and it is not the "the record names a leg this root does not mount here" arm, whose words are true of `role: nope` and misleading where the record names no role at all — the fix is not to mount anything and the refusal is of the whole feature, so the finding is the root's, names the refusal, and names the exit: park it again from the workstation that has that feature, because `emit_recorded_feature` carries a REFUSED feature's legs forward and `role` is the ONE leg key `workspace_write_manifest` keeps when its value is empty (`if value == "" and out_key != "role": continue`), so a refused park writes the leg back as `- role: ""`, which both readers unquote to the empty string again. A leg with NO `- role:` LINE AT ALL is left as it was, deliberately: the loader's `[ "$key" = "role" ] || continue` starts no leg for it and nothing opens one here, so neither reader has a LEG to read, and a test holds that half. What the two readers do NOT agree about is the FEATURE such a record leaves with no legs at all, which `collect_legs` refuses and this layer still says nothing about — the note at the end of this message. `status --help`, AGENTS.md rule 4 and the README carry the exception in their own words — `resume` refuses the whole feature for this one, not the leg — with hygiene caps AGENTS.md 152→153 and README 248→249 in dated entries. Two regression tests beside the ones for note 7 and note (d), both failing against a40cbb7 (there: exit 0 and no line; and the roleless leg missing from a three-leg feature's findings). The review guard, well-formed records only: 34 comparisons of a40cbb7's `status` against this one — 17 record-layer scenarios × `pushed: true`/`false`, commit and role present — byte-identical in exit code, stdout and stderr. Recorded for later, not taken here: a feature whose record leaves it with NO LEGS AT ALL — an empty `legs:`, or leg items with no `- role:` line — is refused by the same `collect_legs` (its closing `[ "${#LEG_ROLES[@]}" -gt 0 ]`) and is still silent here; that is a per-FEATURE reading this layer does not do yet, and it is nobody's note.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…he roleless-line test says what the two readers do and do not agree about, and the no-role finding stops sending the person to a workstation it cannot vouch for

The independent REPORT-ONLY review of this branch (2026-09-11): 204 comparisons of a40cbb7's `status` against this one — 17 record-layer scenarios × six spellings of `pushed:` × plain and `--fetch` — byte-identical, all five new tests failing against a40cbb7, every combination of `pushed:` state × commit × worktree checked against `resume.sh`'s order; verdict merge after fixes, the fixes being two sentences the review disproved by running the code. First: the worktree-present arm's comment said comparing against an empty commit "would fail `merge-base --is-ancestor` its way into 'diverged'" — it would not get there; the FIRST tip arm, `cat-file -e "$commit^{commit}"`, fails on the empty string, and what would print is "its parked commit  is not here — the record says it was pushed…", a blank sha and a reason invented for a commit the record never named (the review proved it by removing the guard). The comment, the test docstring and the commit message now say that. Second: the roleless-LINE half of the empty-role test claimed "silence about it is the two readers agreeing"; they agree there is no LEG, and do not agree about the FEATURE, which that record leaves with no legs at all and `collect_legs`'s closing `[ "${#LEG_ROLES[@]}" -gt 0 ]` refuses ("REFUSED: 001-a-thing — shape mismatch", exit 2) while this layer says nothing — the per-feature reading the message already records as not done; the test comment and the message say both halves. The nits taken with them: the no-role finding sent the person to `parked_on` unconditionally, though with `pushed: true` the commit is on origin and the feature may be anywhere, so it now names "the workstation that has it" and says what the record says about where; and the RR6 sentence in the no-commit comment is scoped to the no-worktree path, where it is true — with a worktree here the `pushed:` states fall through and the missing commit is a second finding.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…eg with no role name the pull request that carries them, this repository's #21, beside the review notes they answer

Co-Authored-By: Claude Fable 5.1 <[email protected]>
… loader reads it — a `#` comment stripped first — so `- role: # note` is a leg with no role here as it is to `resume`, and not a role this root does not mount

Copilot's review of #21 (2026-09-11): `role:` was read with `trim_unquote` alone, so a YAML-empty role written as `- role: # note` or `- role: "" # note` was not empty here — it was `# note` — while `workspace_load_project` takes `#` and everything after it off EVERY line before it splits key from value, and so treats that leg as roleless and refuses the whole feature; here the leg went on to `leg_repo_for_role` and drew "the record names a leg this root does not mount here", the mounting arm's true words about a record `resume` refuses for a different reason entirely. #19 had closed this gap for `pushed:` alone, the one value the layer then judged; `role:` and `parked_commit:` are judged now too, and a `parked_commit: <sha> # note` read whole would have failed `cat-file -e` its way into "not here" for a commit that is here. So one helper, `record_scalar`, cuts a `#` comment and then unquotes, and every value `record_rows` reads goes through it — `id:`, `root:`, the project keys, `branch:`, `role:`, `parked_commit:`, `wip_depth:`, `pushed:` — because the parity is per LINE, as the loader's is: this layer reads the record the way `resume.sh` will judge it, not the way YAML would. One test with the three shapes Copilot named plus the commented parked commit, biting against 83a0f15 (there: "does not mount here" for both roleless spellings, and the commented sha read as no commit at all).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…than the reading one loader makes to reach it, so the line does not go stale the day workBenches #60 lands

The follow-up to the independent review of workBenches #60 (2026-09-11), taken on the reviewer's note alone — nobody has ruled on it: `check_parked_leg`'s clause for a leg whose record carries no `pushed:` key read "`resume` reads a missing one as not pushed and refuses it", which is one loader's MECHANISM written into this command's output. It is true of workBenches' main, where `workspace_load_project` seeds every leg's `MANIFEST_LEG_PUSHED` with `false` at the `- role:` line and RR6 (`[ "$pushed" != true ]`) then refuses the leg in the `--no-push` words — run against such a record on 2026-09-11 that extension answered "Error: 001-a-thing (repo leg) was parked with --no-push; that feature was NOT recreated", exit 2. workBenches #60 stops the invention: the seed becomes the empty string, a new `MANIFEST_LEG_PUSHED_SEEN[]` keeps an absent key apart from a bare one exactly as `record_rows`'s sixth field does here, and RR6 refuses the same leg in words of its own — run against the same record the same day with that branch's scripts, "Error: 001-a-thing (repo leg): the record has no `pushed:` for this leg; that feature was NOT recreated. / Whether its parked commit 44c6189… ever left Falcon cannot be read from the record. / Park it again from there, which writes the record afresh", exit 2, with a REFUSED line reading "the record has no `pushed:` for the repo leg" where main's reads "parked with --no-push". So the day #60 lands, the clause becomes a line about the other end that the other end has stopped agreeing with — the one thing a layer that exists to read the record the way `resume.sh` will judge it must not print. WHAT IS TRUE UNDER BOTH is the refusal and the exit, and this layer only ever needed those: RR6 is the same test in both, an absent key loads as `false` to one loader and as the empty string to the other and neither is `true`, so the leg is not recreated either way; and a park that REFUSES that feature writes `pushed: false` back under main — `emit_recorded_feature` carries the loaded entry forward untouched — and drops the key again under #60, where `workspace_write_manifest` drops an empty value, so under both only a park that parks the feature THROUGH writes a record that reads. The clause says that much and stops: "`resume` refuses a leg whose record has no `pushed:`". The three comments that described main's mechanism as the mechanism now say which loader does what and that the outcome — refused, re-park — is the same under both: `record_rows`'s account of why the dropped leg was silence, `check_parked_leg`'s fourth-state paragraph, and its exit paragraph, which now names what a refused park writes under each. Paragraph 3 of the record section's numbered list is left exactly as it stands, its account of main dated and true; a paragraph after the list says what #60 changes and that no finding depends on it. NO BEHAVIOUR CHANGES BEYOND THE WORDS: the arms, their tests and the finding order are untouched. The three test strings that pinned the old clause carry the new one, two docstrings say which loader their verified `resume` output came from, and one new test holds the rule the clause exists for — the line names the refusal and the exit and neither loader's reading, so it must carry neither "reads a missing one as not pushed", which is main's, nor "--no-push", which is the claim the record does not make; it fails against 83a0f15, where the first of those is what prints. `status --help`, AGENTS.md rule 4 and the README are untouched and no cap moves: none of them ever carried this clause, and what they do say — that a `pushed:` which is missing or neither true nor false is one `resume` refuses the same way and the same re-park settles — is true of both loaders, RR6 being the same test in each. The review guard: 225 comparisons of 83a0f15's `status` against this one — 25 record-layer scenarios × nine spellings of `pushed:` (`true`, `false`, bare, `""`, `maybe`, two with trailing `#` comments, `TRUE`, ` true `) — byte-identical in exit code, stdout and stderr, and 25 more with the key ABSENT, the one input this commit addresses, identical once the old clause is substituted back into this one's output.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…the WHOLE feature and names both exits, instead of naming the leg and stopping

The follow-up to the independent review of #21 (2026-09-11), taken on the reviewer's note alone — nobody has ruled on it: a leg whose role this root cannot mount drew "parked feature 001-a-thing (nope leg): the record names a leg this root does not mount here" and stopped there. True, and it reads as ONE leg of the feature going unread — while `resume.sh`'s `collect_legs` maps EVERY leg's role onto this checkout (`spec` and `code` only where `REPO_SHAPE` is three-leg, `repo` only where it is single, `*) return 1` for every other word) and the one that does not map takes the FEATURE with it, its good legs included. Run on 2026-09-11 against a scratch single-shape estate — a bare remote in a temp dir, a fake `$HOME`, the extension's own scripts — `role: nope` answered "Error: 001-a-thing was parked from a single project and this checkout is single; that feature was NOT recreated", "REFUSED: 001-a-thing — shape mismatch", exit 2, and the same with a good `repo` leg beside it: the sentence about the SHAPE that says nothing about the role, which is exactly what the empty-role arm beside this one exists to explain in advance. So this arm now says what that one says, in the same words and the same order — the leg's own opening clause, then the whole-feature refusal, then the exit — and the two read as the pair they are. ONE WORDING FOR TWO KINDS OF ROLE, because this layer cannot tell them apart and must not pretend to: `leg_repo_for_role` answers the root for `repo` and `assembly`, else the path `project.yaml` gives the role, else a folder named for it, else NOTHING — and nothing is the state that proves the refusal, because `git-common.sh`'s `load_repo_shape` calls a checkout `three-leg` only where `project.yaml` declares BOTH a `spec` and a `code` leg path, so a role this root has no repository for is a role `collect_legs` cannot map, whether it is a misspelling (`nope`) or another shape's role (`code` in the fixture's Atlas, `spec` in the family fixture's members, which declare an `assembly` leg and no other); it refuses both as a shape mismatch, the first at its `*) return 1` and the second at its own `[ "$REPO_SHAPE" = … ] || return 1` (both verified the same day, exit 2 each). THE ARM SPLITS FOR THAT REASON: it fired on two states and says the refusal for only one. A LEG THIS ROOT MOUNTS THAT IS NOT A CHECKOUT — an unfetched submodule, a directory with no `.git` in it, the state `git-common.sh`'s own `shape_leg_is_checkout` guards — keeps the sentence it had, byte for byte, because `collect_legs` maps a role by NAME onto the paths `load_repo_shape` computed from `project.yaml` and never looks at the directory: in a genuinely three-leg root that leg is mapped and the feature is not refused for the shape at all, and claiming it would be this layer inventing a `resume.sh` line. A test holds that half unchanged. The exit is therefore worded for both: a park from the workstation that has the feature writes the roles ITS shape has, which settles a misspelling, and where that shape is not this checkout's the record is RIGHT and the feature comes back in a checkout of that shape — a line that promised only the re-park would send somebody round that second loop for ever. `status --help`, AGENTS.md rule 4 and the README widen the no-role clause they already carry rather than adding one, and carry the second exit with it; both paragraphs repack as they take the words, so the caps move AGENTS.md 153 -> 155 and README 249 -> 250 in dated entries naming what the lines bought. Two regression tests beside the note-8 ones: the finding in full for `nope` and for `code`, plain and under `--fetch`, with the no-`parked_on:` spelling of the exit and with an unfetched `spec` submodule holding the other half of the arm to its old sentence and to no refusal; and an unmountable leg beside a good one, both lines printed, the record's order — both failing against 83a0f15, where the short clause is all there is, as does the widened help test. The review guard, well-formed records only: 207 comparisons of 83a0f15's `status` against this one — 23 record-layer scenarios × nine spellings of `pushed:` — byte-identical in exit code, stdout and stderr, the two scenarios this commit addresses (a `nope` role with a worktree here and without) being the two left out. Recorded for later, not taken here and nobody's note: 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` — reaches `leg_repo_for_role` and gets a repository back, so the leg is read against disk and nothing here mentions the refusal (`role: assembly` in that same scratch estate: "shape mismatch", exit 2, the same day). Reading that one means computing this root's shape the way `load_repo_shape` does and holding the record's `shape:` against it, which is a reading of its own.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
… refuses whole, in the shape words again — instead of counting it and saying nothing

The follow-up to note 1 of the independent review of #21 (2026-09-11) and to the note-8 commit's own "recorded for later", taken on the reviewer's note alone — nobody has ruled on it: a feature the record leaves with NO LEGS AT ALL drew nothing whatever from `status` — no finding, exit 0, the parked-record note counting the feature and saying no more — with a worktree here and without, plain and under `--fetch`. Three spellings reach that state and the two readers agree about all three: an empty `legs:`, the `legs: []` that `workspace_write_manifest` itself writes for a feature it has no legs for, and leg items with no `- role:` line, which start no leg in `workspace_load_project` (`[ "$key" = "role" ] || continue`) and open none here. `resume.sh` is not silent about any of them: `collect_legs` ends `[ "${#LEG_ROLES[@]}" -gt 0 ]`, so it refuses the WHOLE feature in the shape words — run on 2026-09-11 against a scratch single-shape estate, a bare remote in a temp dir and a fake `$HOME` with the extension's own scripts, each spelling answered "Error: 001-a-thing was parked from a single project and this checkout is single; that feature was NOT recreated", "REFUSED: 001-a-thing — shape mismatch", exit 2. This is the hole the last three notes closed for legs, in its per-FEATURE shape, and it needed a per-feature reading: every reading this layer had was a leg's, and there is no leg here to hang one on. `read_record` now judges the features BEFORE it reads the legs — a first pass over `record_rows`'s rows counts each feature's legs, and the main loop reads the count back at that feature's `branch` row, which is where the finding prints, so it lands in the record's own order between the legs of the features around it rather than after everything. ONE ENTRY PER `branch` ROW, NOT PER BRANCH NAME, because `workspace_load_project` makes a new feature of every `- branch:` line and `collect_legs` judges each on its own legs; `$recorded` and the feature COUNT still fold duplicates, since those answer "is this branch in the record", which is one question however many entries there are. The finding is the feature's, names no leg, and names the exit the roleless arm names — a park that parks the feature THROUGH, because `emit_recorded_feature` carries a REFUSED feature's legs forward out of the loaded manifest, which for this one is none, and `workspace_write_manifest` writes the hole back as `legs: []` (both read off those functions the same day). THE UNRECORDED-WORKTREE SWEEP NEEDED NOTHING AND IS HELD ANYWAY: `record_rows` emits the `branch` row wherever the branch line is, legs or none, and `$recorded` is built from those rows, so a worktree on that branch is not accused of never having been parked — a test says so, because the next person to touch this loop has to keep it true. `status --help` and the README widen the clause and the list they already carry, README 249 -> 250 -> 251 across this branch's two document commits in dated entries; AGENTS.md takes the state in the words it has and repacks, so its cap does not move. Four tests: the finding for all three spellings, plain and under `--fetch`; the sweep's silence about a worktree whose legless feature the record names, with the count still counting it; the record's own order, one legless feature between two with legs; and the third phase of the roleless-LINE test, which built exactly this record and asserted silence — it now asserts the FEATURE-level finding and still holds that no LEG-level finding names that line, which is the half the two readers really do agree about. All four fail against 83a0f15. The review guard, well-formed records only: 162 comparisons of 83a0f15's `status` against this one — 18 record-layer scenarios × nine spellings of `pushed:` — byte-identical in exit code, stdout and stderr, the seven scenarios this branch addresses left out.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…f its legs: the verdict is made per feature, before any leg of it is read

Copilot on this repository's #21, second round (2026-09-11), verbatim: "This finding is emitted per leg, but `read_record` still invokes `check_parked_leg` for every sibling. Thus a feature with one roleless leg also prints the normal `resume <Name> brings it back` advice for another leg, even though this message says `resume` refuses the whole feature; the combined report recommends a command that cannot recreate it. Track the roleless state at feature scope and suppress/qualify sibling resume advice, or otherwise make the whole-feature refusal unambiguous." Taken as it stands, and widened to every whole-feature refusal this layer reads: a leg with NO ROLE, a ROLE THIS ROOT CANNOT ANSWER (the commit before last) and a feature with NO LEGS (the commit before this one) are all `collect_legs` throwing the feature out, and the same combined report followed from each. Two lines in `check_parked_leg` offered `resume` — the no-worktree arm and the one that names a stale registration first — and they are the only two: the `--no-push`, unreadable-`pushed:` and absent-parked-commit arms each rule `resume` out for themselves already, which is the rule this change finishes rather than starts. THE VERDICT IS THE FEATURE'S, SO IT IS MADE WHERE THE FEATURES ARE. `read_record`'s first pass — the one the no-legs reading added, which counts each feature's legs before the main loop reads any of them — now asks of every leg the two questions `collect_legs` asks, has it a role and can `leg_repo_for_role` answer that role, and keeps the FIRST clause that costs the feature, because `collect_legs` returns at the first role it cannot map and a second would only lengthen a line about a feature that is already gone. It cannot be asked of a leg as the leg arrives: with the spoiling leg last in the record — the order Copilot's example does not even need — no reader that judges a leg as it reads it can know, and the record's order is the loader's, not the reader's convenience. `check_parked_leg` takes the verdict as a tenth argument (`${10:-}`, since `set -u` is on and it is the one argument a caller may leave off) and, where it is non-empty, those two lines say what `collect_legs` will do — "no worktree on that branch here, parked … on Falcon; `resume` refuses the WHOLE feature, because a leg of it in the record has no role, so it does not bring this leg back — park that feature again from the workstation that has it (the record says Falcon)" — with the stale registration's prune kept at the FRONT of its line, because `resume` cannot recreate a worktree git believes it has whatever else it refuses, and only the `resume` at the end of it goes. Everything else a sibling says is untouched: dirty, moved on, behind, diverged, a parked commit that is not here, `--no-push` — `resume` never answered those. EMPTY FOR EVERY FEATURE `resume` DOES NOT REFUSE WHOLE, which is what keeps every other record's report byte-identical, and a record with one refused feature and one good one prints both kinds of line, which a test holds. Three tests: both causes × both orders, with no `resume Atlas` anywhere in the report; the stale registration, prune first and `resume` gone; and the per-feature scope, one refused feature beside one that is not. The two existing tests that pinned a sibling's old line — note 8's "does not take the legs around it with it" and this branch's unmountable-role twin — carry the new sentence and say why; all five fail against 04dc60e, this branch's base. No document changes and no cap moves: `status --help`, AGENTS.md rule 4 and the README already say `resume` refuses the WHOLE feature for these three states and that only the re-park settles them, which is exactly what the per-leg lines now stop contradicting. The review guard, well-formed records only: 162 comparisons of 83a0f15's `status` against this one — 18 record-layer scenarios × nine spellings of `pushed:` — byte-identical in exit code, stdout and stderr, the seven scenarios this branch addresses left out; and the same 162 against 04dc60e.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…, and a `spec` or `code` leg the manifest declares with no `path:` maps where the loader maps it

The independent REPORT-ONLY review of this branch's four commits (2026-09-12, "merge after fixes"), taken whole. THE BLOCKER IS THE VERDICT LOOKUP: `read_record`'s second pass read `${feature_why[seen_branches - 1]:-}` at every `leg` row, where the first pass guards the same lookup with `[ "$legs" -gt 0 ]`, and `$seen_branches` CAN be 0 at a `leg` row. `record_rows` emits a `branch` row only where `$matched` is 1 AT the `- branch:` line, while `$matched` can be set LATER, by a `    root:` line — the selector every family member is matched by, and every record filed under the folder name, and the one key that does not clear `$branch` the way `- id:` does. So a record whose `root:` sits between a feature's `- branch:` line and its legs yields a `leg` row with no `branch` row before it, and the subscript is then -1: "bad array subscript" on bash 3.2 for an empty array and a full one alike, and on bash 4.2 and later, with a non-empty one, the LAST feature's verdict — a whole-feature refusal printed about a feature the leg is no leg of. Both were run on bash 5.2.21 against 5cb123b, this branch's tip: the one-feature spelling dies mid-report, "status: line 2735: feature_why: bad array subscript" on stderr and stdout stopping at the root's row with no record line and no footer, exit 1 that says findings and means a crash — and under `--all` it takes the sweep with it, whose closing "N estate(s) in sync" line never prints (run both ways against the same mangled record); the two-feature spelling prints "no worktree on that branch here, parked ? on ?; `resume` refuses the WHOLE feature, because its `nope` leg names a role this root does not mount" on the leg of the feature that has no `nope` leg. The arm now makes the same guard the first pass makes — `$refused` empty where there is no feature to take a verdict from — so the line is the one 04dc60e printed for that leg and the report reaches its footer. `$refused` and not the reviewer's `$where`, because `read_record` already has a local of that name for the "the record says <workstation>" clause. SECOND, `leg_repo_for_role` LEARNS THE PATH THE OTHER END DEFAULTS: it read a role's path from a `path:` key in `project.yaml` or a same-named directory and answered NOTHING otherwise, while `git-common.sh`'s `_shape_record_leg` is `spec) _SHAPE_LEG_SPEC_PATH="${path:-spec}"` and `code) … "${path:-code}"` — so a root that declares `- role: spec` with no `path:`, and whose `spec/` is not checked out, fell into the whole-feature refusal, which is a line `resume` never prints there: `load_repo_shape` calls that manifest three-leg, and `resume.sh` refuses the whole ESTATE before it reads a feature at all, "Error: the spec leg 'spec' is not an initialised Git checkout at '…/spec'. / Run 'git submodule update --init' (or 'make bootstrap') in the project root first.", exit 1 — neither the refusal the line claimed nor either exit it offered. Where the manifest declares such a leg the answer is now `$root/spec` or `$root/code`, mirroring `_shape_record_leg`, and only for those two roles, since every other word is one `collect_legs` refuses at its `*) return 1` however the root is laid out; the state returns to the short line under it, "the record names a leg this root does not mount here", which is what this layer can prove. The default is answered AFTER the directory test, so no root that answered before answers differently. THIRD, THE WARRANT FOR THE SPLIT IS SAID AS `load_repo_shape` WRITES IT, in the arm's comment and in the docstring that repeated it: three-leg is `kind: project-manifest` AND `schema: project-repo-schema` AND BOTH a `spec` and a `code` LEG — the leg, not its `path:`, which `_shape_record_leg` defaults to the role's own name. The same docstring justified holding the unfetched-submodule half unchanged with "in a three-leg root that leg is mapped and the feature is not refused for the shape", said of the Atlas fixture — which declares `assembly` and `spec`, no `code` and no `schema:`, so `load_repo_shape` calls it `single` and `spec` IS a role `collect_legs` refuses; the reason it gives now is the one the assertion beside it already gave, a refusal this layer cannot PROVE. FOURTH, the arm's "what this arm does not see" list is widened past `assembly` and `spec`-in-single to `repo` in a root `load_repo_shape` calls three-leg — one project checked out at two shapes, the commonest mismatch there is — and any other word that matches a directory under the root. AND THE STALE NAMES GO: workBenches #60 merged as 98b8bd1 and is that repository's main, so the loader that seeds `false` is "workBenches before #60 (ec2b450)" — the review named two of those, and the same claim stands at four places in `status` and two docstrings, all six corrected, because the two left behind would have said something now false; "Neither is a record that reads" becomes "Neither is a record that says what happened"; and the README cap entry a 2026-09-12 commit made is dated that day (`git log --format=%ad --date=short 0b29551` is 2026-09-12; 964d22d, which made "153 -> 155" and "249 -> 250", is 2026-09-11 and stands). Two regression tests, both failing against 5cb123b: the mangled `root:`-selected record, in both spellings — the complete report, footer line and all, with the plain leg line as 04dc60e printed it, where the tip crashes; and the declared-`spec`-with-no-`path:` root, whose only parked-feature line is the short one, where the tip claims the whole-feature refusal. No `status --help`, AGENTS.md or README change, and no cap moves: nothing a person reads has changed, only which record reaches which existing line. The review's guard, run whole: 317 comparisons — 37 record-layer scenarios × nine spellings of `pushed:` — of 5cb123b's `status` against this one, byte-identical in exit code, stdout and stderr, none of them being either state this commit changes. `python3 -m pytest tests -q`: 306 passed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 12, 2026 03:19
…his repository's #22, beside the review notes they answer

Co-Authored-By: Claude Fable 5.1 <[email protected]>

@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 22 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

The PR changes status to evaluate each parked feature up front, matching resume's collect_legs behavior, so empty or unresolvable features are reported as whole-feature refusals and no finding offers an unusable resume command; it also hardens ordering/path edge cases and updates documentation and tests.

Sequence diagram for whole-feature refusal before leg findings

sequenceDiagram
    participant Status
    participant Record
    participant Shape
    participant ResumeRules
    Status->>Record: read_record
    Record->>Record: count feature legs by branch row
    Record->>Shape: leg_repo_for_role
    Shape-->>Record: mounted repository or no answer
    Record->>ResumeRules: collect_legs verdict
    alt no leg, missing role, or unresolvable role
        ResumeRules-->>Status: whole-feature refusal
        Status-->>Status: report refusal reason and exit
    else feature is collectable
        ResumeRules-->>Status: per-leg verdict
        Status->>Status: check_parked_leg
        Status-->>Status: report usable resume Name only when applicable
    end
Loading

Flow diagram for per-feature parked-status evaluation

flowchart TD
    A[Read parked feature record] --> B[First pass: count legs and resolve roles]
    B --> C{Feature can be collected?}
    C -->|No leg, missing role, or unresolvable role| D[Report whole-feature refusal]
    C -->|Yes| E[Evaluate each leg]
    E --> F{Leg-specific finding?}
    F -->|No| G[Report resume Name]
    F -->|Yes| H[Report leg finding without unusable resume command]
    D --> I[Keep feature in recorded-worktree set]
    G --> I
    H --> I
Loading

File-Level Changes

Change Details Files
Align parked-feature status findings with resume's feature-level collection and refusal semantics.
  • Add a first pass that counts legs and computes one refusal verdict per branch before emitting leg findings.
  • Report empty-leg features as feature-level findings and preserve record order and recorded-worktree tracking.
  • Treat unmountable roles as whole-feature shape refusals only when the local shape cannot resolve the role; retain the existing short finding when the role is mounted but its directory is unavailable.
  • Propagate whole-feature refusal text to sibling leg findings so status never offers a resume command that resume will reject; keep stale-registration pruning first.
  • Guard verdict lookup for malformed ordering where leg rows precede a matched branch row, and match role paths using the same defaulting and shape rules as resume.
  • Update absent-pushed wording, help text, AGENTS.md, README.md, hygiene caps, and add coverage for the new feature-level cases and edge conditions.
status
tests/test_status_command.py
tests/test_repo_hygiene.py
AGENTS.md
README.md

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

Unresolved critical and moderate issues remain, along with a documentation nit.

Pull request overview

This PR aligns status parked-feature reporting with resume’s whole-feature validation.

Changes:

  • Adds feature-level checks for missing, roleless, and unmappable legs.
  • Prevents misleading sibling resume advice.
  • Expands tests and updates documentation and help text.
File summaries
File Summary
tests/test_status_command.py Adds regression coverage; an outdated absent-pushed: explanation remains in a test docstring.
tests/test_repo_hygiene.py Updates documentation hygiene limits.
status Adds feature validation; critical inline-comment parsing and moderate empty-branch: issues remain.
README.md Documents refusal cases and recovery guidance.
AGENTS.md Updates operational guidance.
Review details

Suppressed comments (2)

status:2728

  • The new feature pass only sees branch rows, but record_rows suppresses a present - branch: whose value is empty ([ -n "$branch" ] at line 1964). The workspace loader creates a feature for every - branch: line, so branch: or branch: # comment with no legs still has no array entry and remains silently omitted instead of receiving the new no-leg finding. Preserve branch-row presence independently of whether its name is empty before applying this pass.
            branch) feature_legs+=(0); feature_why+=("") ;;

tests/test_status_command.py:2942

  • The preceding absent-pushed: explanation in this docstring still says the extension seeds a missing key with false in the present tense, even though this PR records #60's change to an empty value plus a presence flag. Please mark that sentence as pre-#60 history or describe only the shared refusal; otherwise this test documentation reintroduces the loader-specific mechanism this change removes.
    The independent review of #21, the same day, widens that fifth rather
    than adding a sixth: a role THIS CHECKOUT'S SHAPE DOES NOT MOUNT is
    refused by the same `collect_legs`, for the same whole feature, in the
    same "shape mismatch" words. What it adds is the second exit, because
    the two are not one — a misspelt role is a record to write afresh, and a
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread status Resolved
…ds it — a `#` comment cut first — and a `- branch:` with no value is the feature `resume` refuses that it is, not a feature this layer never saw

Copilot's review of #22 (2026-09-12), both findings taken. The inline one: `leg_repo_for_role` read a leg's `role:` and `path:` out of `project.yaml` with `trim_unquote` alone, while `load_repo_shape` takes `#` and everything after it off EVERY line before it reads a key, so `- role: spec # the spec leg`, declared with no `path:` and not checked out here, never matched the role this reader wanted and the leg fell to the arm that calls it a role this root cannot mount and `resume` refuses whole — where `resume` maps `spec` fine and refuses the whole ESTATE for the missing checkout instead. Both values go through `record_scalar` now, the cut `record_rows` already makes for the record, for the same reason. The suppressed one: `record_rows` emitted a `branch` row only for a non-empty name and gated a leg row on the same, so a `- branch:` with no value — bare, or empty under a comment — vanished from this layer with its legs, while `workspace_load_project` makes a feature of every `- branch:` line and `resume.sh` refuses the one named nothing: with legs, at RR2 with the name blank, "Error:  is no longer on origin in the repo leg … REFUSED:  — gone from origin", exit 2; with none, as a shape mismatch — both run against the extension the same day. The row goes out with the empty name, `$named` and not the name is what lets a leg row out (a `- branch:` seen before its block matched by a `root:` selector still lets its legs out, and a leg before any `- branch:` line is still dropped), and `read_record` answers the unnamed feature on the root's row with one line — counted as the loader counts it, its name kept out of the recorded set, its legs not read one by one since there is no branch to find a worktree by — carrying RR2's own two exits: remove the block if the feature landed, park it again from the workstation that has it if it was parked. Two docstrings that described the pre-#60 loader in the present tense say "before workBenches #60 (ec2b450)". Two tests, both failing against 4825d61 (there: the whole-feature refusal for the commented role, and silence for the unnamed feature). Suite: 308 passed.

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

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

Two moderate issues in status can still make its verdict disagree with resume.

Review details

Suppressed comments (2)

status:1980

  • When the record is selected by root=... and that root: key appears after an empty - branch: line, this branch row is still suppressed because matched was false at the branch (1979-1980). The following leg row then reaches read_record with seen_branches == 0, so the new empty-branch handling is skipped and check_parked_leg can offer resume <Name>, even though resume rejects the blank branch at RR2; a legless version is silent for the same reason. Preserve/defer the branch metadata until the block is matched, or handle an empty branch before the no-verdict guard.
            if [ "$matched" -eq 1 ]; then
                printf 'branch\037%s\n' "$branch"

status:2045

  • load_repo_shape strips a full-line # comment and keeps the current leg, but this parser falls through to [![:space:]]*) role="" for a comment at column 0. For example, a spec role followed by # note and then path: docs is mapped here to the default spec path (or reported as unmountable) instead of the loader's docs path, so the feature verdict can disagree with resume; ignore full-line comments in this case before resetting role.
            '  - role:'*)
                role="$(record_scalar "${line#*:}")"; path=""
                [ "$role" != "$want" ] || declared=1
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…ock is read, so a `root:` below the `features:` no longer loses the block, and a `#` comment at column 0 inside a `project.yaml` leg no longer takes the `path:` under it away from its role

Copilot's second round on #22 (2026-09-12), both suppressed findings taken; both were real, and both reproduced against 9b7882a before a line of `status` moved.

FIRST, `record_rows` DECIDED WHETHER A ROW WENT OUT AT THE LINE IT READ IT FROM, and a block is not known to be the selected one until the key that selects it is read. An `id=` selector is answered by the block's FIRST line, so every row after it knew where it stood; a `root=` selector — the one every family member is matched by, and the one a record found under the folder name falls back to — is answered at the `    root:` key, which `workspace_write_manifest` writes above `features:` and a hand-edit or a bad merge can leave below it. Every row emitted above that line was then thrown away for a block that DID match. For the layout `park` writes, whose `features:` is the block's last key, that is the WHOLE BLOCK: against 9b7882a, a record whose `root: Atlas` sits at the foot of its block yields no rows at all for `root=Atlas` and the layer says "parked record: no block for this root in Atlas.yaml" about a record it has just found and matched — the feature uncounted, its `parked_at:`/`parked_on:` unread, and its branch kept out of the recorded set, so a worktree on that branch reads as never parked. For a `root:` left INSIDE the feature it is the shape Copilot named: the blank `- branch:` row is suppressed while the leg row under it goes out, reaching `read_record` with `seen_branches == 0`, so the empty-branch arm is skipped and the leg draws "    - parked feature  (repo leg): no worktree on that branch here; parked ? on ? — `resume Atlas` brings it back" (run against 9b7882a) — `resume` for a feature named nothing, which it refuses at RR2 with the name blank, and a blank name and two `?` in one line. `workspace_load_project` has no such order: it matches at the `- id:` line and reads a block's keys by their INDENT, wherever they sit in it. So the rows are HELD and flushed — every arm appends to `$held`, the buffer goes out whole in the record's own order as soon as the block is known to match, and a block that never matches is dropped at the next `- id:`, the only line that starts another. The emitted bytes are unchanged for every record `park` writes: `matched` is 1 at the `root:` line above `features:`, so each row is flushed on the line after the one that appended it. Proved directly rather than asserted — `record_rows` lifted out of 9b7882a's `status` and out of this one and run against a two-block family record for six selectors (`id=` and `root=` for each block, and one of each matching nothing): byte-identical output every time, `od -c` digests compared.

AND THE LEG-ROW GUARD `read_record` GREW IN 9b7882a IS NOW THE BELT TO THAT BRACE. A `leg` row goes out only while a branch is open, `$named` is set by the very line that appends that branch's row, and the two are flushed in the record's order — so no record builds a leg row with no branch row before it any more. The guard stays, matching the first pass's, because an index this reader invents is a claim about a feature the record does not make; and the test that locked in the crash it fixed is rewritten rather than dropped, because the record it was written for now READS: `test_a_root_key_between_a_branch_and_its_legs_still_reads_that_feature` keeps both reviews in its docstring and asserts the corrected line — the workstation and the date where "? on ?" stood, "1 feature(s)" where "0 feature(s)" stood, and, with a second feature after it, each feature's verdict on its own line as before.

SECOND, `leg_repo_for_role` READ A FULL-LINE `#` COMMENT AT COLUMN 0 AS THE KEY THAT CLOSES A LEG. The round before taught its values to lose a `#` the way `load_repo_shape` loses one; the LINE was still read whole, so a `# note` a hand left at column 0 inside `project.yaml`'s legs list matched `[![:space:]]*) role=""` and ended the item — and the `path:` under it went to no role, leaving `spec` and `code` on `_shape_record_leg`'s default, the role's own name, and every other role with nothing. `load_repo_shape` takes `#` and everything after it off every line before it reads one and SKIPS what is left when it is empty (`[ -n "$trimmed" ] || continue`), so that line closes nothing there and the `path:` below it still belongs to the leg above. Run against the extension's own `git-common.sh` on 2026-09-12, a `- role: code` whose `path: spec` sits under such a comment loads as `REPO_SHAPE=three-leg`, `_SHAPE_LEG_CODE_PATH=spec`, `CODE_LEG=<root>/spec` — a mounted checkout `collect_legs` maps and `resume` resumes — where `status` at 9b7882a answered `<root>/code` and printed "    - parked feature 001-a-thing (code leg): the record names a leg this root does not mount here". One arm, `'#'*) ;;`, ahead of the indent-zero one: the same cut `record_rows` was given for the same line in #20 (a2c8521, "a full-line `#` comment at column 0 inside a leg is no leg-ender"), for the same reason. An INDENTED comment needed no arm at either end — it matches no key here and trims to nothing there.

THREE NEW TESTS, ALL THREE FAILING AGAINST 9b7882a with only the tests added: the `root:` at the foot of its block ("no block for this root" there, the feature and its leg read here), Copilot's own layout with a blank `- branch:` above the `root:` (the `resume Atlas` offer under a blank name there, the unnamed-feature line and no leg line here), and the column-0 comment inside a `project.yaml` leg ("does not mount here" there, `resume Atlas` here). No `status --help`, AGENTS.md or README change and no cap moves: nothing a person reads is worded differently, only which record reaches which existing line. `python3 -m pytest tests -q`: 311 passed.

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

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

The default-path fallback needs complete three-leg shape validation, and path: comment parsing needs regression coverage.

Review details

Suppressed comments (2)

status:2128

  • This fallback treats any declared spec/code role as mappable, even when the manifest lacks the required kind: project-manifest/schema: project-repo-schema combination or declares only one of the two legs. load_repo_shape is three-leg only when all of those conditions and both roles are present, so collect_legs rejects spec/code in a single-shape root. With this fallback, status can inspect $root/$want (and even offer resume if it is a checkout) instead of reporting the whole-feature refusal. Gate the default-path case on the complete three-leg shape.
    spec | code) [ "$declared" -eq 0 ] || { printf '%s\n' "$root/$want"; return 0; } ;;

status:2085

  • This new record_scalar path is intended to make inline comments in project.yaml match load_repo_shape, but the added regression tests cover comments after role: and full-line comments, not a comment after path:. Please add a case such as path: checkout # note where the path differs from the role name; otherwise this parity branch can regress without detection.
                path="$(record_scalar "${line#*:}")"
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap

Copy link
Copy Markdown
Contributor Author

On Copilot's third round (3427aa3), suppressed comment at status:2128 — "gate the default-path case on the complete three-leg shape": real, and already recorded in this PR's body as not taken here ("needs a reading of this root's shape against the record's, which the next branch builds"). The stacked branch fix/record-origin-gone-and-shape builds exactly that reading (read_root_shape re-implements load_repo_shape's kind + schema + both-legs test and role_maps_here judges the record's roles the way collect_legs will); its independent review ran 22 manifests through the real git-common.sh and found zero disagreements. The narrow gate suggested here would not close the hole it describes: the suite's Atlas fixture (kind: project-manifest, no schema:, assembly + spec, no code, so single to the loader) reaches $root/spec through the path: arm at status:2115, never through the default at 2128 — only the shape reading answers it. The second suppressed comment (status:2085, a path: checkout # note regression case) is a fair coverage gap and lands as one more test commit on this branch before it merges.

…s it, and now there is a test that says so, because the two that covered its siblings never read one

Copilot's THIRD round on #22 (2026-09-12), its `status:2085` note taken: the coverage gap is real and the guard is worth having even though nothing is broken today. 9b7882a sent BOTH of `leg_repo_for_role`'s values through `record_scalar`, the cut `load_repo_shape` makes on every line before it splits key from value — and only the `role:` half got a test. The round-before test declares `- role: spec # the spec leg` with no `path:` at all, and the round-after one puts a full-line comment at column 0 ABOVE a clean `path:`; neither reads a `path:` whose own value carries a `#`, so the one line that does — `path="$(record_scalar "${line#*:}")"` — could have been reverted to `trim_unquote` and the suite stayed green.

WHAT IT PROVES IS THE PATH, NOT THE DEFAULT. `path: spec # the checkout it is mounted at` is `spec` to `load_repo_shape`: run against the extension's own `git-common.sh` on 2026-09-12 a `code` leg declared that way loads as `REPO_SHAPE=three-leg`, `_SHAPE_LEG_CODE_PATH=spec`, `CODE_LEG=<root>/spec`. Read whole it is `<root>/spec # the checkout it is mounted at`, a path with no `.git` in it, and the leg draws "the record names a leg this root does not mount here" — and it does NOT fall through to `_shape_record_leg`'s default either, because the `path:` arm answers before the default does, so the role's own name never comes into it.

IT DOES NOT BITE AGAINST THE COMMIT BEFORE THIS ONE, and that is the honest report: the parser 3427aa3 ships reads it right, as 9b7882a's already did. It bites against 4825d61, the commit before the cut landed, where the same fixture answers "    - parked feature 001-a-thing (code leg): the record names a leg this root does not mount here" for a leg `resume` mounts and resumes — run here on 2026-09-12, and the only run of the three (4825d61, 9b7882a, 3427aa3) that fails. A regression guard is what it is: a line nothing else in the suite holds down.

The manifest the two comment tests build is now one helper, `code_leg_onto_the_spec_checkout`, with the reason the `code` leg is declared onto `spec/` said once where it belongs — the path has to differ from the role's own name or the two readings agree and there is nothing to tell apart — and the line they both expect is one constant, `CODE_LEG_AT_SPEC`. No `status` change, no `status --help`, AGENTS.md or README change, and no cap moves. `python3 -m pytest tests -q`: 312 passed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@brettheap
brettheap changed the base branch from fix/record-no-commit-and-empty-role to main September 12, 2026 17:46
Copilot AI review requested due to automatic review settings September 12, 2026 17:46
@sonarqubecloud

Copy link
Copy Markdown

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

Two unresolved moderate findings remain in status.

Review details

Suppressed comments (2)

status:2128

  • declared only records that this role appeared in project.yaml; it does not establish that the root is actually a three-leg shape. For a single-shape manifest that declares spec but has no schema: project-repo-schema/code leg, load_repo_shape remains single and collect_legs rejects a recorded spec leg, while this fallback returns $root/spec; the first pass then treats the feature as resumable and can offer resume for a feature that resume refuses. Gate this default on the same kind/schema/both-leg predicate as load_repo_shape (or reuse that shape result).
    spec | code) [ "$declared" -eq 0 ] || { printf '%s\n' "$root/$want"; return 0; } ;;

status:1994

  • The project row is still snapshotted when features: is encountered, before the selector may establish that this block matches. For a hand-edited record that moves parked_at/parked_on (or the lane/active keys) below features:—the loader accepts keys in any order—the held block is selected but this row keeps empty metadata, so findings report an unknown workstation/date and the footer shows ? instead of the record's values. Build or update the project row after the block's metadata has been fully read.
        '    features:'*)
            held="$held$(printf 'project\037%s\037%s\037%s\037%s' "$parked_at" "$parked_on" "$lane" "$active")$NL"
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap
brettheap merged commit 0eb29b3 into main Sep 12, 2026
7 checks passed
@brettheap
brettheap deleted the fix/record-feature-level-readings branch September 12, 2026 17:52
brettheap added a commit that referenced this pull request Sep 13, 2026
…y 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`

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/.  <sha>  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).

PR #23

Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Oct 5, 2026
The macOS gate on #164 failed test_the_holds_view_answers_as_who_does
at `'opensoft/repoA#22' not in view`, and failed it on darwin only.
The view was not the cause. The fixture wrote lanes/log/REPOA-2.md
beside lanes/log/repoA-2.md. On macOS's default case-insensitive
disk those are one file, so the "other spelling" CLAIMED was appended
after the RELEASED in a single log, and the lane really does hold
#22. The test's own comparison against `who` passed on darwin for
exactly that reason. A Linux run that writes the two logs into one
file reproduces it: the view and `who` both answer HELD.

The view never used a bare-column aggregate. It picks each lane's
last line on an object with a correlated NOT EXISTS over (file,
ordinal), with ordinal stored as an INTEGER and the file compared in
byte order.

So the fixtures change, not the view. commit_paths writes blobs with
hash-object and update-index --cacheinfo under core.ignorecase=false,
then commits and pushes. Two spellings are therefore two paths on
every platform, and the test asserts that the pushed tree holds both.
The transcript-pointer case had the same blind spot: it passed on
macOS without the collision it exists to test. It is moved onto the
same helper and now asserts that the two PAUSED lines sit at one line
number.

A new case pins the ordering. One lane writes two objects with lines
out of UTC order, at lines 4/5 and 10/11. The test checks that the
view and `who` follow the file, and that line 10 comes after line 9.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Oct 5, 2026
…e register, nudged after each landed write and read only behind --index; history reads across lanes (#164)

* Add lanes-index: the derived index of the lane register

Amendment 14 (ratified by Brett Heap 2026-10-05, "ratify 48") keeps the
register's truth where it is and adds a DERIVED index of it, written
behind the sources by the indexer alone and read only by tooling that
decides nothing. This is that indexer: `sync`, `reconcile [--dry-run]`,
`status`, and `export`, the read flags' own reader.

It reads `origin/<branch>` of the workspace checkout at one commit,
never the working tree, and upserts records keyed by (source, record id)
and versioned by a content digest, so a replay changes nothing. The
source's provenance is compared and swapped in the same transaction as
the rows, and a commit that does not descend from the indexed one writes
nothing. `reconcile` compares stored rows by content, so a row changed
by hand is found; on a wiped index it is the rebuild.

The store is SQLite under XDG_STATE_HOME, or QA Postgres through `psql`
only where `url=` is configured, with a writer and a SELECT-only reader
credential. The configuration is refused when group- or world-readable,
inside a git work tree or under ~/.agents/, or when a URL carries a
password. The owner column is `managed-projection`'s answer (0/8/1);
the indexer carries no parser of the marker. The ledger half's tables
and #161's `worktrees` table are created empty.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Nudge the indexer after a landed push, and read it behind --index

Amendment 14(d): after a push has landed and the mutex is released,
`lanes-edit.sh` starts one detached `lanes-index sync` from `cleanup`,
with stdin closed, output on /dev/null, never waited and its status never
read. It is skipped where `lanes-index` is not on PATH or LANES_INDEX=off,
so the suite's thousands of writes pay one `command -v` and print nothing.

Amendment 14(b): `--index` on `lanes` and `history`, typed per invocation
and never from the environment, swaps the eight published-read primitives
for the index's image and leaves every local read alone, so the answer is
the source read's byte for byte where the index is current. Stderr says
which was read; any failure to answer falls back to the sources with the
source read's exit. LANES_IDX_DIR is assigned empty at start-up, so no
act can reach the index.

`history --all` and `history --repo <owner/repo>` answer the cross-lane
question that was refused with 64: every lane's NOTED and RULED lines on
one timeline, from the sources, with or without the flag.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Place lanes-index as the sixteenth installed file

`openRepoTools --install` places `lanes-index` beside the lane helpers,
at the end of INSTALLABLES so every index a test takes still names the
file it did. The file count moves 15 -> 16 and the artifact count 29 ->
30 wherever they are stated, with the count history extended rather than
restated; the stale receipt sentence now says 30 artifacts, 28 rows.

The hygiene suite also compiles `lanes-index`, the one shipped command
that is Python: a syntax error there fails every workstation's first sync.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Document the derived index in the lanes manual

"The derived index (Amendment 14)": what it is for and what it never
does, the three words and the nudge, `--index` and its two stderr lines,
the configuration and its refusals, the two Postgres roles with their
GRANTs, the schema (the ledger half's tables and #161's `worktrees`
created empty), and the eight tests' promise. The `history` usage gains
`--all` and `--repo`.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Test the derived index against Amendment 14's eight promises

tests/test_lanes_index.py builds a whole estate in tmp_path and holds the
indexer to offline no-read, poisoned index, wiped-index reconcile,
replay, monotonic provenance, a hung indexer, the managed seam and
fallback, plus LOG_AWK parity, byte-identical --index reads, the
configuration refusals and the Postgres writer/reader split against a
fake psql. No real database is created.

The shell suite gains a section running lane-start --dry-run, the name
guard, writes and reads three ways from one snapshot: no index, an
installed indexer against an unreachable store, and a poisoned SQLite.
Both the suite and conftest set LANES_INDEX=off so no other case nudges
an installed indexer.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Take round-one review findings on the derived index

Six findings on #164, all genuine, all taken:

- Resolve the configuration and SQLite paths before asking git which
  work tree holds them: a 0600 symlink outside every repository that
  points into one bypassed clause (c)'s refusal (Copilot).
- Key a transcript pointer by its file when two logs one case apart
  carry a PAUSED at the same line, as log_lines already is (Copilot).
- Ask origin/<branch> again once every owner is in: managed-projection
  reads the ref, not the snapshot sha, so a ref that moved writes
  nothing and sync reads the new tip whole (Copilot).
- Refuse a Postgres read with no reader_url= instead of falling back
  to the writer's credential; the read flags then answer from the
  sources (Copilot).
- Close the rerun handshake on both sides: a contender marks and looks
  once more, and the holder looks again after it releases, so no mark
  is left with nobody due to read it (Codex).
- Skip the same-tip fast path while any owner is unknown, so a failed
  managed-projection read clears on the next sync (Codex).

Each fix has a case in tests/test_lanes_index.py.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Take round-two review findings on the derived index

Copilot's second round raised two findings on changed lines and two
on lines it had missed in round one. All four are genuine:

- Compute the holds view the way holders_of does, which is the answer
  `who` gives. A lane's last line on an object is found
  case-insensitively and in file order. A lane does not hold the
  object while another lane's own last line there is a TAKEOVER.
  Before this, the view picked the last line per physical file and
  never applied supersession.
- Chmod the SQLite store to 0600 on every write-open, not only when it
  is created, so a mode that drifted is put right before more rows
  go in.
- Read the Postgres schema version before running any DDL. The DDL
  includes CREATE OR REPLACE VIEW, which used to rewrite a store of
  another schema before it was refused. Now only an absent schema is
  bootstrapped.
- Accept --out for export only, so `sync --out` is a usage error
  instead of a silent write.

Each change has a case in tests/test_lanes_index.py, and each case
fails against the previous head.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep the read line out of a fallen-back fetch's notes

Under `lanes --fetch --index`, when the fetch falls back the wrapper
forwards the helper's `read:` line to stderr. It also prints all of
the helper's notes again on stdout, beneath the "read LOCALLY"
footer. So the index line appeared twice, once on stdout, and
`--index` changed the listing it promises to leave byte-identical.
Copilot raised this in round 3 as a line it had missed before. It is
taken because it breaks the PR's own parity promise.

This commit also says in the manual that the holds view keys an
object as written. A line that names a repository by a spelling
lanes/repos.tsv has since renamed is its own key there, while `who`
folds its argument into the canonical spelling. A live comparison of
170 objects against `who` found exactly that one difference.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep git gc out from under the Amendment 14 snapshot

CI's tests-no-submodule job at 50594dc failed three checks in the
shell suite's Amendment 14 section, in the unreachable-store run of
its first write. The log shows why:

    rm: cannot remove '.../origin.git': Directory not empty

By that point the suite has pushed thousands of commits, so the
control run's push can start a detached `git gc --auto` in origin.
That gc kept writing while a14_restore removed the repository. The
removal left the directory behind, `cp -a` copied the snapshot inside
it, and the next push found no repository at origin. The same
section passed at the three heads before this one, in both Linux
jobs.

Switch automatic gc off in origin and in the clone before the first
snapshot (the snapshot carries the setting forward). Wait out any gc
already running before each snapshot and restore. Retry a removal
that a straggler is still writing into. If a tree will not go away,
report it instead of copying into it.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Build the case-variant log fixtures through git, not the disk

The macOS gate on #164 failed test_the_holds_view_answers_as_who_does
at `'opensoft/repoA#22' not in view`, and failed it on darwin only.
The view was not the cause. The fixture wrote lanes/log/REPOA-2.md
beside lanes/log/repoA-2.md. On macOS's default case-insensitive
disk those are one file, so the "other spelling" CLAIMED was appended
after the RELEASED in a single log, and the lane really does hold
#22. The test's own comparison against `who` passed on darwin for
exactly that reason. A Linux run that writes the two logs into one
file reproduces it: the view and `who` both answer HELD.

The view never used a bare-column aggregate. It picks each lane's
last line on an object with a correlated NOT EXISTS over (file,
ordinal), with ordinal stored as an INTEGER and the file compared in
byte order.

So the fixtures change, not the view. commit_paths writes blobs with
hash-object and update-index --cacheinfo under core.ignorecase=false,
then commits and pushes. Two spellings are therefore two paths on
every platform, and the test asserts that the pushed tree holds both.
The transcript-pointer case had the same blind spot: it passed on
macOS without the collision it exists to test. It is moved onto the
same helper and now asserts that the two PAUSED lines sit at one line
number.

A new case pins the ordering. One lane writes two objects with lines
out of UTC order, at lines 4/5 and 10/11. The test checks that the
view and `who` follow the file, and that line 10 comes after line 9.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Never hand an inherited PGPASSFILE to psql

PostgresStore._env dropped an inherited PGPASSWORD but kept an
inherited PGPASSFILE, and it set PGPASSFILE only when passfile= was
configured. With no passfile= (a passwordless role), libpq therefore
read whatever file the calling environment named, or ~/.pgpass by
default. That broke clause (c)'s rule that the credential comes from
the configured 0600 file and nowhere else. Copilot raised it on
8fa6ca2.

Both inherited variables are now dropped. PGPASSFILE is always set:
to passfile= when one is configured, and otherwise to an empty 0600
file the indexer keeps in its own state directory. libpq finds no
password there, so peer, trust and certificate authentication still
work. The new case fails against the previous head: the inherited
file reached psql.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[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