Repository navigation
status's record layer: a deleted worktree is not a worktree, two checkouts of one workspace are one record, and a --no-push record is never sent to resume - #18
Conversation
…eckouts of one workspace are one record, and a `--no-push` record is never sent to `resume` Copilot's two reviews on PR #13 carried ten findings between them, most as suppressed comments; the independent review's 0b8dbe9 answered four and nothing followed, so this answers the rest. git worktree list --porcelain keeps a linked worktree's block until git worktree prune runs, and worktree_on_branch returned that path without checking it: a recorded feature whose directory was deleted read as present, at the parked commit, and therefore CLEAN — the one answer that hides the case the layer exists for — while the unrecorded sweep accused the same stale block of never having been parked. Both check the path now, as read_worktrees has since the local layer. record_candidates emits one row per <org>/<basename>, which is what resume counts as one record (F4 of the review on openRepoShape #83): two checkouts of one workspace repository — the default path: and an orgs: override that is a second clone of it — read as "two orgs record this id", and a local-path origin names no owner to settle that with, so a record that was never ambiguous was skipped unread. A leg parked with --no-push said resume refuses it and then that resume <Name> brings it back; where both states hold that is one line now, naming the only exit there is, and the missing parked commit no longer offers --no-push as a reason a pushed: true record rules out, nor promises a fetch this layer cannot speak for. Five tests, one per fix. AGENTS.md rule 4 and the README carry the --no-push exception, each cap raised in a dated entry. Four findings were already answered and are left alone: 0x1F between the record's fields, the diverged worktree's test, a declared leg path that is absent (it returns and never falls through to $root/<role>), and the sweep of a root the record does not mention. PR #13. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
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 3 hours by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's GuideThe PR fixes record-layer status handling by deduplicating equivalent workspace checkouts, treating deleted worktrees as absent rather than clean or unparked, and making no-push and missing-commit diagnostics mutually consistent; regression tests and documentation are updated accordingly. Sequence diagram for no-push record recoverysequenceDiagram
participant User
participant status
participant resume
participant park
participant Workstation
User->>status: status
status->>resume: resume
resume-->>status: refuses --no-push record
status-->>User: report only exit is to park again
User->>Workstation: return to workstation with commit
User->>park: park
park-->>Workstation: record parked commit again
Flow diagram for corrected record-layer status handlingflowchart TD
A[status reads workspace records and worktrees] --> B[record_candidates deduplicates by org and basename]
B --> C{worktree path is a directory}
C -->|no| D[ignore stale worktree block]
C -->|yes| E[compare worktree with parked record]
E --> F{record has --no-push}
F -->|yes| G[report resume refusal and park again from original workstation]
F -->|no| H[report resume or worktree status]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟡 Changes recommended
status --help still omits the --no-push recovery exception.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR improves status record handling for deleted worktrees, duplicate checkouts, and --no-push records.
Changes:
- Ignore stale deleted worktree metadata.
- Deduplicate equivalent workspace records.
- Clarify diagnostics, recovery guidance, and add regression tests.
File summaries
| File | Description |
|---|---|
tests/test_status_command.py |
Adds regression coverage. |
tests/test_repo_hygiene.py |
Updates documentation caps. |
status |
Updates record discovery and worktree diagnostics. |
README.md |
Clarifies parked-record behavior. |
AGENTS.md |
Documents --no-push recovery. |
Review details
- 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.
…, so the help text no longer sends somebody to a `resume` that refuses that record Copilot's review of PR #18 (anchored at status:83): the usage heredoc still said a recorded feature with no worktree here is brought back by `resume <Name>`, full stop, while the finding it describes now says the opposite where the record was parked with --no-push — the same contradiction inside `status` that this branch took out of the findings, the header, AGENTS.md rule 4 and the README. The parked-record sentence in the help gains the exception in the README's compressed form, at the paragraph's own width. One test holds it, reading the help with the wrapping normalised so the paragraph can be re-wrapped and not the sentence. Every other `resume <Name>` line in park and status was read too: each is the ESTATE-level one — "brings one back", about an estate that is not on this machine at all, which resume does clone and bootstrap — and none of them states the per-feature rule, so none changes. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Address the two moderate status findings involving case-insensitive deduplication and fetch ordering.
Review details
Suppressed comments (2)
status:1487
- The lookup above is case-insensitive, but this deduplication key keeps the basename's original case. If two configured checkouts contain the same record as
Atlas.yamlandatlas.yaml, both candidates matchwantyet produce different keys, so a single logical record can still be reported as ambiguous. Normalize the basename in the key as well.
key="$(lower "${dir##*/}")/$base"
status:1756
- With
--fetch, this check still runs before the mounted leg's row is processed:read_recordis called from the root row, whilefetch_remotefor mounted legs runs later. A pushed parked commit that is only on the leg's origin therefore triggers this “not here” finding even though the same run fetches it immediately afterward, contradicting the command's “fetched first” contract. Fetch all repositories beforeread_record, or defer this comparison until after the leg fetch.
# exit: this runs in the ROOT's row, and a leg's own repository is
# fetched after it, so `FETCHED_OK` is not this repository's answer.
- Files reviewed: 5/5 changed files
- Comments generated: 0 new
- Review effort level: Lite
…, because a registration git still holds is what stops the exit the record layer would otherwise name The independent review of PR #18: the previous commit stopped calling a deleted worktree clean, but routed it to "no worktree on that branch here … `resume <Name>` brings it back", and `resume` will not bring it back. The extension's resume.sh matches a leg in leg_registered_at on the REGISTERED PATH alone — git-common.sh's load_git_worktrees hands it `worktree list --porcelain -z` raw, with no test that the directory is there — so a stale block at the path it computes reads as already done ("worktree already registered at …; left as it is") and nothing is recreated, and a stale block at another path leaves its plain `git worktree add` to be refused ("already used by worktree at …" / "is a missing but already registered worktree; use 'add -f' to override, or 'prune' or 'remove' to clear", both confirmed against git 2.43). resume.sh names the hazard itself where it rolls back what it created: "a phantom registration a later resume reads as 'already registered' for a path that is not there". So worktree_on_branch now has three answers rather than two — the worktree, or 2 and the stale path, or nothing — and check_parked_leg names the prune first and the resume second; a --no-push record with a stale registration names the prune and still never names resume, since there is nothing here to resume. The scan's comment ends where git does: only `worktree add --force` makes a live worktree beside a stale block for the same branch. AGENTS.md rule 4 gains the rule the two findings imply — a stale registration is `git worktree prune`'s to clear, never `worktree add --force` and never a delete under `.git/worktrees/` — and its cap moves 142 -> 145 in a dated entry. The README is unchanged: it lists the four states the layer reads, and this is not a fifth one, it is the same "no worktree here" with a step in front of its exit, which the finding itself spells out. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…rds, as they already fold the org and as both of them matched it, so `Atlas.yaml` and `atlas.yaml` in two checkouts are one record Copilot's second review of PR #18, on status:1487: the lookup is case-insensitive and the key was not. Both files match the basename with lower (resume's manifest_candidates says so in its own comment, "compared CASE-INSENSITIVELY", and status's record_candidates mirrors it), so two checkouts of one workspace repository holding testfam.yaml and TestFam.yaml both matched the wanted name and then produced two different keys: resume REFUSED with "2 workspace manifests record 'TestFam', in different orgs" listing testorg twice, which --org cannot answer, and status noted "2 records for 'atlas' in different orgs" and read none. One line in each file, the same fold on both halves of the key, so the mirror the record layer promises — status judging the record the way resume will — still holds; the shared resolver block and expand_home are untouched. A test in each suite, each built the way that suite builds estates: two checkouts spelling the one record differently, one answer. Two DISTINCT orgs are still ambiguous, which is the case --org exists for, and the tests that hold that are unchanged and still pass. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…any of them, which is what it has always said it does, so the record layer no longer reports a parked commit as missing in the run that fetches it Copilot's second review of PR #18, on status:1756: the fetches ran row by row while the record layer is read on the ROOT's row, so a feature parked from another workstation into a LEG's origin was reported as a parked commit that "is not here" by the very run that fetched it a moment later — a finding that vanished on the second run, and the opposite of the sentence the README, AGENTS.md rule 4 and the command's own header carry ("in every repository first, so the answers are current"). The independent reviewer of this branch recorded the same hazard. So fetch_estate_first makes every fetch before any row is printed and stores each repository's result by path — the lines it printed, the findings it made, FETCHED_OK and UPSTREAM_FETCHED_OK — and replay_fetch puts them back on their own row, which is why the report reads exactly as it did: the failure of the root's fetch is still the root's finding and the leg's "nothing new" is still the leg's line, now asserted in the failed-fetch test. estate_repos is read once into `rows` and both passes walk it. With every repository fetched first, FETCHED_OK is this repository's answer for every role, so the missing parked commit says which of the two reasons is left: after a fetch that worked, "never fetched" is ruled out and the line says origin has not got it either, the way no_origin_branch_finding has always split that case. Two tests: a spec leg whose parked commit only its own bare origin has, read under --fetch, and a parked commit still missing after this run's fetch. No document changes: both already describe this order, and now it is the one the command runs in. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Locked stale worktree registrations are not handled, and related recovery guidance is incomplete.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 4
- Review effort level: Lite
…n, keys the fetch store by physical path and fetches each repository once, because an exit that git skips is not an exit Copilot's third review of PR #18, four comments on the one gap the previous commit's own comment named: `git worktree prune` SKIPS a locked registration, and every line and document said prune. Verified here against git 2.43: for a locked worktree whose directory is gone, `prune -v` prints nothing and clears nothing, `worktree remove --force` refuses ("cannot remove a locked working tree; use 'remove -f -f' to override or unlock first"), and `worktree unlock <path>` on a registration whose directory is gone exits 0, after which prune removes it and `worktree add` succeeds. So worktree_on_branch has four answers rather than three — the porcelain's `locked` line comes after `branch` in the same block, so the block is read to its blank line before the answer is settled — and both ghost findings, the plain one and the --no-push one, name unlock then prune for a locked registration and prune alone for an unlocked one. The --no-push line still never names `resume`. AGENTS.md rule 4, the README's `status` paragraph and `status --help` carry the same state and the same exit; the two caps move 145 -> 147 and 242 -> 244 in dated entries. With it, the second independent review's three nits. The fetch store is keyed by PHYSICAL path (`physical_path`, the idiom locate_record already uses on workspace checkouts): `estate_repos` builds a leg's path out of `.gitmodules` and the record layer asks about the path `project.yaml` gives that role, so `./spec` and `spec` were one leg and two keys, and a leg fetched two rows below was told this repository had never fetched it — a test with those two spellings holds it. fetch_estate_first skips a path it has already fetched, so a `family.yaml` that lists a member twice is fetched once and the duplicate row replays the one fetch that was made; no test, because the report cannot see the difference — replay_fetch answers both rows from the first entry either way, and a second fetch that transfers nothing does not even reach the server's post-upload-pack hook, which I probed. And `--fetch`'s help block says every repository is fetched before the first row is printed, so an ssh prompt that blocks with no row in front of it belongs to a fetch. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical and moderate findings remain in status worktree-registration handling.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
status:1847
- When there are multiple stale registrations for the same branch,
lockedis only recorded whilestaleis still empty. If an unlocked stale block is followed by a locked one (possible with theworktree add --forceduplicate state this parser explicitly discusses), this returns 2 and reports the first path, so the suggestedworktree pruneskips the later locked registration andresumeremains blocked. Track the locked registration independently and prioritize/report it before choosing the cleanup command.
if [ "$hit" -eq 1 ] && [ -z "$stale" ]; then locked=1; fi
;;
"")
if [ "$hit" -eq 1 ] && [ -z "$stale" ]; then stale="$path"; fi
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
…es the LOCKED one of two stale registrations, because the exit has to clear what actually blocks `resume` Copilot's fourth review of PR #18, two findings on worktree_on_branch, both verified against git 2.43 before a word of the fix was written. Delete only a worktree's .git file and the DIRECTORY stays while git calls the registration "prunable gitdir file points to non-existent location": the -d test alone read that as a live worktree and, sitting at the parked commit, said nothing at all, while resume still saw the registration. So a `prunable` block is stale whatever is on disk, and -d still decides the blocks git has not judged — it computes no `prunable` for a `locked` one, which is exactly the case whose directory can be gone with nothing said about it. The prune clears such a registration and leaves the directory, and `git worktree add` then refuses the path in its own words, "already exists" (`worktree remove` refuses it too: "validation failed, cannot remove working tree: '…/.git' does not exist"), so the finding names both halves and says the directory is MOVED ASIDE — it holds whatever the worktree held. The same `prunable` reading gates the unrecorded sweep, because a registration git itself calls stale is not a worktree `park` could carry. The second: `worktree add --force` is how one branch ends up with two stale registrations, and `prune` takes every unlocked one with it while skipping the locked one, so the locked registration is now tracked across the whole scan and is the one reported — an unlock of it plus that prune clears both, where naming the unlocked path left the locked one standing and resume still blocked. The whole list is read before the answer is chosen: a live worktree beats any stale registration, a locked stale one beats an unlocked one. Two regression tests, each biting against 8cecba1 (the prunable one reported 0 findings there; the double one named the unlocked path). AGENTS.md rule 4, the README and `status --help` carry the leftover directory; the caps move 147 -> 149 and 244 -> 245 in dated entries. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Two moderate issues remain in status involving unusable locked worktrees and fetch-event ordering.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
status:2047
- The unrecorded-worktree sweep has the same gap for a locked stale registration: when the directory remains but its
.git/gitdir is unusable, Git reportslockedrather thanprunable, so this guard emitsnever parkedfor a path that is not a worktree at all. Require the worktree gitdir to validate before treating the block as an on-disk worktree, consistently withworktree_on_branch.
elif [ -n "$branch" ] && [ -d "$path" ] && [ "$prunable" -eq 0 ]; then
status:1010
- The new store separates successful fetch lines from fetch findings, so it loses the old per-remote event order. If
originfails andupstreamsucceeds, the old row-by-row code recorded the origin failure first, butreplay_fetchprints the upstream success line before the stored failure; this contradicts the claim that the report reads exactly as before and makes the row's fetch diagnostics misleading. Preserve an ordered event stream (or replay the origin/upstream results in call order) instead of storing the two classes separately.
FETCH_SAID+=("$FETCH_SAY")
FETCH_FOUND+=("$(printf '%s\n' ${FINDINGS[@]+"${FINDINGS[@]}"})")
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
… is there, because git computes no `prunable` for a LOCKED block and a locked one can be a directory with nothing in it Copilot's fifth review of PR #18, its first finding, verified against git 2.43 before the fix: lock a worktree, delete only its `.git` file, and the porcelain says `locked` and nothing else — no `prunable`, because git does not judge a locked block — so the directory test alone called it a live worktree, the record layer reported the parked feature CLEAN (0 findings, proved against 86aea4d), and the sweep accused the leftover directory of never having been parked. What a worktree has is its own `.git`: a FILE holding `gitdir: <repo>/.git/worktrees/<name>` for a linked one, a DIRECTORY for the main one. worktree_is_usable is that test, and both readers use it — worktree_on_branch calls a block live only when git has not called it prunable AND the worktree is usable, otherwise it takes the stale path, locked or not; the sweep skips what is not a worktree, as it already skipped what git calls prunable. The exit is the one already documented for a locked registration with its directory left behind, unlock then prune then move the directory aside, so AGENTS.md, the README and the help are unchanged. Two tests, both biting against 86aea4d. The review's second finding is WRONG and nothing changed for it. It says the store "loses the old per-remote event order", so a row with a failed origin and a live upstream now prints the upstream success before the origin failure where the row-by-row code printed the failure first. The row-by-row code did not: `finding` never prints, it appends to FINDINGS, and a row prints its findings only after every read of that row is done — so main printed the upstream `say` line first too, and `replay_fetch` puts the stored lines and the stored findings back in exactly those two places. Settled empirically as well, not just by reading: twin estates (dead origin, live upstream remote, `--fetch`), main's `status` from 9d4c8ae beside this one, temp root and hex normalised — identical exit code, stdout and stderr, both printing "fetched upstream: upstream/main is here now" above "- fetch failed: …". Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
On Copilot's fifth-review comment at The second independent review's 39-scenario differential harness found the same for this scenario. The other fifth-review finding (a locked registration whose directory remains but whose |
…er directory under the root no longer has `git status` run inside it and the root's own dirty paths reported on that row Brett Heap's RULING of 2026-09-11 on the note this branch left: take it now. `read_worktrees` gated on the DIRECTORY alone, while the record layer and its sweep had moved to `worktree_is_usable` — a directory with its own `.git`, the file a linked worktree has and the directory the main one has. The extension puts feature worktrees UNDER the root, so a registered path whose `.git` is gone is a plain directory inside the root's own working tree: `git status` there finds no repository, walks UP, and hands back the ROOT's dirty paths, which this layer then printed on the worktree's row under a branch that has nothing to do with them — proved against ff3bc65, where the row read "worktrees/001-a-thing on 001-a-thing: dirty, 1 path(s)" and the one path was the root's own untracked directory. One line, and now the three readers of `worktree list --porcelain` agree about what a worktree on disk is. One test, biting against ff3bc65, and it is the realistic shape rather than a contrived one: the worktree is placed under the root, as `worktree_root:` puts it. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
There was a problem hiding this comment.
🟡 Changes recommended
Three unresolved moderate findings remain in status.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
status:1945
- The recovery commands emitted here are not copyable when either
repoorghostcontains whitespace (for example, a custom$PROJECTS_DIRwith spaces):git -C /path with spaces ...is parsed as separate arguments. Quote or shell-escape both paths in this locked form and in the prune-only assignment above before presenting this as the required way to unblockresume.
ghost="$out"
ghost_is="a stale worktree registration for it is still recorded at $ghost and LOCKED, which \`worktree prune\` skips"
clear="\`git -C $repo worktree unlock $ghost\`, then \`git -C $repo worktree prune\`"
status:1893
- When a branch has both a locked and an unlocked stale registration, returning only
stale_lockedloses the other path.git worktree pruneclears both registrations but leaves every stale directory in place; if the unlocked path is the feature path thatresumewill recreate, the emitted guidance moves only the locked path andresumestill fails because the target directory exists. Preserve/report all stale paths that still have directories, or explicitly instruct moving all of them aside.
[ -z "$stale_locked" ] || { printf '%s\n' "$stale_locked"; return 3; }
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
| if [ "$first" -eq 1 ]; then | ||
| first=0 | ||
| elif [ -n "$path" ] && [ -d "$path" ]; then | ||
| elif [ -n "$path" ] && worktree_is_usable "$path"; then |
|
On Copilot's sixth-review comment at
git init -q root && cd root && git commit -q --allow-empty -m init && git branch -q feat
git worktree add -q wt feat
rm -rf wt && mkdir wt && git init -q wt # the leftover directory reused as another repository
git worktree list --porcelain | grep -c prunable # 0 — not prunable; `.git` exists, so `worktree_is_usable` is true too
rm -rf wt/.git # now only the directory remains
git worktree list --porcelain | grep prunable # prunable gitdir file points to non-existent location — and `worktree_is_usable` is false |
…adable rather than as pushed, so a hand-edited record no longer draws "the record says it was pushed" and is no longer offered the one exit `resume` refuses it for The follow-up to note (d) of the second independent review of #18 (2026-09-11), taken as that reviewer's note — nobody has ruled on it: "a hand-edited record whose `pushed:` is valueless is neither `false` nor `true`, and `status`'s missing-commit arms then say 'the record says it was pushed' (pre-existing from 2a488b4)". Every arm of the record layer tested `[ "$pushed" = false ]` and read everything else as `true`, so a bare `pushed:`, `pushed: ""` and `pushed: yes` alike drew "the record says it was pushed" — a claim the record does not make — and, with no worktree here, were offered "`resume <Name>` brings it back", the exit the extension's own `resume.sh` refuses such a leg for (its RR6 is `[ "$pushed" != true ]`, so an unreadable value is refused exactly as `--no-push` is). The field now has three readings: a value that is neither word is named for what it is, in a finding of its own as `--no-push` has one; the no-worktree line names the exit that works (park it again from the workstation that parked it, which writes the record afresh); and the missing-commit line names every reason still standing rather than the one the record would have to be read as `true` to support, dropping "never fetched it" after a fetch that worked, as the `pushed: true` arm already did. `resume` is untouched: it reads no `pushed:` and hands the record to `make resume`, and `resume.sh` settles it before anything is fetched — proved by loading a record with `pushed:` valueless and `pushed: yes` through the extension's own `workspace_load_project`, which yields "" and "yes", each failing its `!= true`. `park.sh` writes `true` or `false` for every leg it parks and carries an existing entry forward untouched for one it refuses (`workspace_write_manifest` drops a key whose value is empty, so it never writes `pushed:` bare), so such a record is a hand-edit or a bad merge. And because `workspace_load_project` strips a `#` comment from every line before it reads a value, `pushed:` — the one field this layer judges rather than matches or prints — loses one here too, so `pushed: true # note` reads as `true` here as it does in `resume.sh`, and `false # note` as the `--no-push` record it is. `status --help`, AGENTS.md rule 4 and the README carry the second exception, one line each; hygiene caps AGENTS.md 149→150, README 245→246 in dated entries. Five regression tests beside the record-layer tests they belong with, each failing against main. The independent review's 22-pair guard (11 record-layer scenarios × `pushed: true` / `false`, main's `status` against this branch's) found no byte of difference for a well-formed record. Recorded for later, not taken here: a leg whose `pushed:` KEY is absent is dropped by `record_rows` while `resume.sh` defaults it to `false` and refuses, so `status` says nothing about a record `resume` refuses; and `resume.sh`'s own refusal line says "was parked with --no-push" for any value that is not `true`, in another repository. PR #19 Co-Authored-By: Claude Fable 5.1 <[email protected]>



The follow-up #13 owed to Copilot, whose two reviews on that PR carried ten findings; the independent review's commit 0b8dbe9 answered four of them and nothing followed the other six (two of them one bug named twice). Each is verified against
statuson main and either fixed here or cited to the line that already answers it.Fixed, each with a regression test built the way the record-layer tests build estates (bare repositories in a temporary directory, a fake
$HOME, no network):record_candidatescounted raw rows, so two checkouts of one workspace repository (the defaultpath:plus anorgs:override) read as "2 records … in different orgs" and, with a filesystem-path origin, could not be settled: it now emits one row per<org>/<basename>, the other half of the physical-path dedup already inlocate_record, the wayresumecounts (F4 of the review on openRepoShape One binding per lane: the record says host/os/container, liveness is pronounced only from inside that binding, and a second place ASKS for the handoff before it binds (Amendment 18 acts 1-10) #83).git worktree pruneread as present at the parked commit, hence clean: the staleworktree list --porcelainblock is skipped unless its path is a directory, asread_worktreeshas done since the local layer, so it is the "no worktree here" finding.--no-pushrecord with no worktree here said "resumerefuses it" and then "resume <Name>brings it back": where both hold it is one line naming the only exit, parking again from the workstation that has the commit. AGENTS.md rule 4 and the README said the bare rule too; both now carry the exception, and the two line caps in tests/test_repo_hygiene.py move by that (140→142, 241→242) in dated entries.pushed: truerecord that rules it out: the wording is now conditional onpushed.Three more commits from the reviews of this PR. From the independent review: a recorded feature whose worktree directory was deleted but whose registration
git worktree list --porcelainstill holds is not a caseresume <Name>can bring back — the Speckit extension'sresume.shmatches registrations by path alone inleg_registered_atand prints "already registered … left as it is", and a plaingit worktree addover the ghost is refused by git — soworktree_on_branchnow tells a held-but-gone registration apart from none at all, the finding namesgit -C <repo> worktree prunefirst andresume <Name>second, the--no-pushline names the prune and still never namesresume, and AGENTS.md rule 4 says a stale registration isgit worktree prune's to clear, neverworktree add --force. From Copilot's second review: the record/manifest lookup compares the basename case-insensitively in bothstatusandresume, but the dedup key folded only the org, soTestOrg/Atlas.yamlandTestOrg/atlas.yamlin two checkouts of one workspace read as two orgs andresumerefused with--orgunable to answer; both keys now fold both halves, one line each. Andstatus --fetchnow fetches every repository of the estate FIRST, before any row is printed, exactly as the README and AGENTS.md rule 4 have said all along:fetch_estate_firststores each fetch's lines, findings and flags per repository,replay_fetchputs them back on their own row so the report reads as before, andread_recordtherefore runs after the leg's own fetch — a parked commit that lived only on the spec leg's origin was reported "not here" and then fetched further down the same report. Because the fetch is now first for every role, the missing-commit wording after a fetch that worked says origin has not got it either, the wayno_origin_branch_findingdoes. Then a merge of main (the pin bump to openRepoShape 32450eb and #17) so the suite runs against the pin main carries, and one last commit from Copilot's third review and the second independent review: a LOCKED stale registration isgit -C <repo> worktree unlock <path>first, becauseworktree pruneskips a locked block (verified on git 2.43: unlock of a registration whose directory is gone exits 0, prune then clears it), and the finding, AGENTS.md rule 4, the README andstatus --helpall say which kind it is; the fetch store is keyed by physical path so a leg spelled./specinproject.yamlandspecin.gitmodulesis one repository; a member a family lists twice is fetched once; and--fetch's help says every repository is fetched before the first row, so a blocking ssh prompt belongs to a fetch, not to the row on screen. And from Copilot's fourth review: a blockgit worktree listitself marksprunableis stale whatever is on disk — a worktree directory whose.gitfile is gone read as live and clean — and the exit then names the prune and a move of the leftover directory aside (never a delete;git worktree addrefuses a path that exists, andworktree removerefuses a path with no.git); of two stale registrations for one branch (worktree add --force) the locked one is named, since unlock-then-prune clears both; the unrecorded sweep skips a prunable block too. AGENTS.md rule 4, the README andstatus --helpcarry the clause. From Copilot's fifth review: git never computesprunablefor a locked block, so a locked registration whose directory remains but whose.gitis gone read as live and clean;worktree_is_usable(the directory and its.gitboth exist —-e, since the main worktree's.gitis a directory) now decides liveness inworktree_on_branch, the unrecorded sweep and the local layer'sread_worktrees, so the three readers agree about what a worktree on disk is. The fifth review's other claim, thatreplay_fetchreorders a failed origin against a live upstream, is answered in the comments with a byte-identical diff against main. Suite on the final head with the submodule at 32450eb: see the last commit's CI run.Already answered on main, cited in the review trail: the 0x1f field separator in
read_record(0b8dbe9), the diverged-worktree test, the declared-leg path never falling through to the name fallback (proved with a throwaway test), and the no-block-for-this-root case still sweeping unrecorded worktrees (0b8dbe9).🤖 Generated with Claude Code
Summary by Sourcery
Harden the status record layer so worktree state, record identity, fetch results, and recovery guidance remain accurate across stale registrations, duplicate checkouts, and no-push records.
Bug Fixes:
Enhancements:
Documentation:
Tests: