Repository navigation
status: the fifth layer — the parked record against disk: what park recorded, read against the worktrees here the way resume will judge them - #13
Conversation
…k` recorded, read against the worktrees here the way `resume` will judge them Brett Heap's RULING of 2026-09-11, verbatim: "next layer: parked record against disk". The last of the five layers named when status landed (#9). park RECORDS every open feature of an estate in the person's private workspace repository — workspaces/<org>/<id>.yaml, one block per project, one entry per feature, and per leg the commit it was parked at and whether it was pushed — and resume rebuilds the worktrees from that record on the next workstation. Between the two, record and disk drift apart in exactly the ways resume later refuses, and this reads them beforehand: 1. A recorded feature with no worktree here on its branch: parked, not resumed — `resume <Name>` is the exit, never a worktree added here. 2. A worktree whose branch tip is not the parked commit: moved on since it was parked (the count, and "park again before leaving"); BEHIND it — the record is newer, parked later elsewhere, which resume refuses to reset; diverged; or a parked commit this machine never fetched. 3. A leg parked with --no-push: only the parking workstation has the WIP commit, and resume refuses it. 4. A worktree on disk the record does not know: never parked, and park is what carries it — read in the root and in every mounted leg. The record is found the way resume finds it: ~/.agents/workspace.yaml names the workspace checkout (and per-org overrides), every checkout's workspaces/<org>/*.yaml is scanned for the estate's id (project.yaml's for a standalone, family.yaml's for a family), basename compared case-insensitively. A family's record has one block per MEMBER, matched by `root: <Family>/<member>`; the holder has none. Each leg is read in the repository its role lives in, mapped through project.yaml's legs. No config, no record, or two orgs recording the same id are NOTES at the estate level, not findings. Nothing reads the workspace repository's remote: the record is as of its last pull, and the estate's line says so. Tests 218 -> 229: no config and no record as notes; a recorded feature with no worktree; a worktree at the parked commit (in sync); moved on; behind a newer record; parked with --no-push; a worktree the record does not know; a spec leg read in the leg's own repository, then a parked commit that is not here; two orgs; a family record matched to each member by root, the holder silent. README 232 -> 239, AGENTS.md 133 -> 140 (rule 4: the three things an assistant reaches for and must not — a worktree add, a reset, a hand-edit of the record), caps raised in dated entries. 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 7 hours by commenting @sourcery-ai review. Upgrade to get a review now.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Reviewer's GuideThis PR implements the fifth status layer by reading the locally checked-out workspace repository’s park records and reconciling every recorded feature leg and local worktree using resume-compatible estate, organization, family, and role matching. It surfaces actionable drift findings without fetching or mutating repositories, updates the documentation and hygiene constraints, and adds comprehensive integration coverage. Sequence diagram for status parked-record reconciliationsequenceDiagram
participant Status
participant Config as workspace.yaml
participant WorkspaceRepo
participant Estate as project.yaml_or_family.yaml
participant Disk
Status->>Config: read path:
Config-->>Status: workspace repository checkout
Status->>WorkspaceRepo: scan workspaces/<org>/*.yaml
WorkspaceRepo-->>Status: parked feature records
Status->>Estate: read root: and role mappings
Estate-->>Status: estate and leg repositories
Status->>Disk: inspect branch tips and worktrees
Disk-->>Status: local worktree state
Status->>Status: compare parked commits, pushed, and worktree presence
Status-->>Status: report drift findings or estate-level NOTE
Flow diagram for parked record status findingsflowchart TD
A[status reads local refs and checked-out workspace record] --> B{Record found for estate?}
B -->|No config or no record| N[Estate-level NOTE]
B -->|Yes| C{Recorded feature has worktree here?}
C -->|No| R[Finding: resume Name brings it back]
C -->|Yes| D{Worktree matches parked commit?}
D -->|Yes| S[In sync]
D -->|No| E{Parked record is newer, branch diverged, or commit is unavailable?}
E -->|Yes| F[Finding: resume refuses or commit is not here]
E -->|No| G[Finding: moved on; park again before leaving]
C -->|Disk worktree is absent from record| U[Finding: never parked; use park]
D --> H{pushed is false?}
H -->|Yes| P[Finding: parked with no push; resume refuses it]
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
Unresolved moderate findings remain in status, including record discovery, parsing, worktree handling, and test coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds the fifth status validation layer, comparing parked workspace records with local estate worktrees.
Changes:
- Validates parked records across standalone, family, and leg worktrees.
- Adds record/disk synchronization tests.
- Updates README.md and AGENTS.md guidance.
File summaries
| File | Summary |
|---|---|
tests/test_status_command.py |
Adds parked-record validation scenarios. |
tests/test_repo_hygiene.py |
Updates documentation checks and limits. |
status |
Implements parked-record discovery and drift reporting. |
README.md |
Documents the fifth status layer. |
AGENTS.md |
Adds guidance for parked-record findings. |
Review details
Suppressed comments (6)
status:1553
- These intermediate rows use TAB as a separator, but
read_recordparses them withIFS=$'\t'; in Bash, TAB is IFS whitespace and adjacent separators collapse. The code treatsparked_by_laneandactive_featureas optional, so a record with an empty lane but a nonempty active feature shifts that value into the lane field and prints incorrect parked-record metadata. Use a non-IFS delimiter/sentinel for both the producer and consumer, asread_branchesdoes with 0x1f.
' features:'*)
if [ "$matched" -eq 1 ]; then
printf 'project\t%s\t%s\t%s\t%s\n' "$parked_at" "$parked_on" "$lane" "$active"
status:1643
- The new
elsebranch reports diverged worktrees, but no test creates a parked commit and current tip where neither is an ancestor; the added tests cover only the in-sync, moved-on, behind, missing-commit, and no-push paths. Please add coverage for this distinct state so the divergence detection and message cannot regress silently.
elif g "$repo" merge-base --is-ancestor "$tip" "$commit" 2>/dev/null; then
finding "parked feature $branch ($role leg): this worktree is BEHIND the parked commit $(short "$commit"), parked ${parked_at:-?} on ${parked_on:-?} — the record is newer, and \`resume\` refuses to reset it"
else
finding "parked feature $branch ($role leg): diverged from the parked commit $(short "$commit"), parked ${parked_at:-?} on ${parked_on:-?}"
status:1597
- When
project.yamldeclares this role at a custom path that is absent, the code falls through to$root/$want. If that directory exists, status validates the parked commit against an unrelated checkout instead of reporting the declared leg as unmounted. Track that the role was declared and suppress the name-based fallback once a declaration forwantis found.
if [ -d "$root/$want" ]; then
printf '%s\n' "$root/$want"
return 0
fi
return 1
status:1706
- If a record file exists but has no block for this family member, returning here skips
unrecorded_worktrees; any linked feature worktree for that member is therefore invisible even though the record does not know it. Continue with an empty recorded set before returning so the advertised unrecorded-worktree check still runs.
if [ "$have_block" -eq 0 ]; then
say " parked record: no block for this root in ${RECORD_FILE##*/}"
return 0
status:1672
- The same
worktree list --porcelainstream can contain aprunableentry whose path is no longer on disk. This case still emits a “never parked” finding for the stale metadata, producing a false finding after a deleted linked worktree; gate this branch on[ -d "$path" ]as well.
*) finding "worktree on $branch ($where): not in the parked record — never parked, and \`park\` is what carries it" ;;
status:1607
git worktree list --porcelaincan retain a block for a deleted worktree and mark itprunable. This branch returns that stale path without checking it exists, so a parked feature whose worktree directory is gone can be treated as present (and even reported clean) instead of producing the required “no worktree here”/resumefinding. Require the returned path to be a directory before accepting it.
"branch refs/heads/$want") printf '%s\n' "$path"; return 0 ;;
- 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.
| [ -d "$checkout/workspaces" ] || continue | ||
| for dir in "$checkout"/workspaces/*/; do | ||
| dir="${dir%/}" | ||
| [ -d "$dir" ] || continue |
…"behind", 0x1F between record fields, checkouts counted once, and a root the record does not mention still swept The independent review of this layer found the finding that mattered: after a successful resume, a feature's tip is legitimately the parked commit minus the WIP commits resume itself soft-reset away (resume.sh's wip_gap_is_ours is why resume does not refuse it), and status called that normal state "BEHIND … resume refuses to reset it" — on every run, until the next park, and with a remedy AGENTS.md rule 1 forbids. wip_depth is now read from the record and the same test is made here. Also from the review: record fields are joined by 0x1F, not TAB, so a key park.sh leaves out (it writes none for an empty value) cannot shift the later fields — a leg with pushed: false and no parked_commit lost the --no-push finding and reported a parked commit called "false"; workspace checkouts are counted once by physical path, as resume's add_workspace does, so an orgs: override pointing at the default's clone is one clone, not "two orgs record this id"; a checkout the config names and this machine lacks is said, and an unreadable config is said, rather than read as "no record"; a root the record does not mention still has its worktrees swept, since every one of them is unparked; the record is found by the estate's id (as park files it) and then by its folder (as resume looks it up), and a standalone block by id then by root; a branch is known from its own row, so a leg dropped for want of pushed: is never accused of being unparked; the diverged finding names the log to read; the unrecorded-worktree finding no longer promises park will carry a worktree outside the worktree root; and AGENTS.md's stranded "Its" and the same BEHIND claim are fixed. A hygiene test holds status's expand_home byte-identical to resume's. Tests 229 -> 240: the post-resume WIP state (not a finding) beside the same gap with a non-WIP commit (a finding); an absent optional key; diverged; a root the record does not mention; an unparked worktree in a leg; two orgs settled by the origin's owner; an override on the same checkout; a checkout not on this machine; a record filed under the folder name; the layer under --all located per estate. README 239 -> 241. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
There was a problem hiding this comment.
🟡 Changes recommended
Four unresolved findings remain in status, including three moderate issues.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (4)
status:1535
- This ambiguity count does not match
resume's manifest discovery: if the default workspace path and an org override are two checkouts of the same workspace repository, both can yield the same<org>/<id>.yaml, butresumetreats that as one candidate by org and basename.statuscounts both as two records (and, when no origin owner is available, skips a valid record as ambiguous). Deduplicate candidates by org and basename before both counting and selectingRECORD_FILE.
count="$(printf '%s\n' "$candidates" | grep -c . || true)"
if [ "$count" -eq 1 ]; then
RECORD_FILE="${candidates#* }"
return 0
status:1741
- This sweep also treats every non-primary
worktreeblock as a worktree on disk, even though stale linked-worktree metadata remains after its directory is deleted. That produces a false “not in the parked record” finding for a path that is not present; gate the finding on the capturedpathexisting, matchingread_worktrees's check.
elif [ -n "$branch" ]; then
status:1695
- When
pushedis false and this machine has no worktree for the branch, this emits the--no-pushfinding and then emitsno worktree ... \u0060resume Atlas\u0060 brings it back. Those directions conflict: the first line saysresumerefuses this record, so the second tells the user to run an operation that cannot recover it. Treat the no-push state as terminal for this leg (or suppress the resume instruction) before checkingtree.
if [ "$pushed" = false ]; then
finding "parked feature $branch ($role leg): parked with --no-push on ${parked_on:-another workstation}; only that workstation has the WIP commit, and \`resume\` refuses it"
fi
tree="$(worktree_on_branch "$repo" "$branch" || true)"
if [ -z "$tree" ]; then
status:1704
- For a
pushed: truerecord, reaching this branch means the parked commit is missing locally, but the message still says it may have been parked with--no-push; that state is explicitly ruled out by the record and is already reported separately when false. Make the missing-commit wording conditional onpushed(or say onlynever fetchedhere) so the recovery guidance matches the record.
if ! g "$repo" cat-file -e "$commit^{commit}" 2>/dev/null; then
finding "parked feature $branch ($role leg): its parked commit $(short "$commit") is not here — never fetched, or parked with --no-push on ${parked_on:-another workstation}"
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
| "worktree "*) path="${line#worktree }" ;; | ||
| "branch refs/heads/$want") printf '%s\n' "$path"; return 0 ;; |
…eckouts of one workspace are one record, and a `--no-push` record is never sent to `resume` The follow-up #13 owed to Copilot, whose two reviews on that PR carried ten findings; 0b8dbe9 answered four and this answers the rest, each verified against main and either fixed with a regression test or cited to the line that already answers it, plus what this PR's own two reviews found. `record_candidates` counted raw rows, so two checkouts of one workspace repository read as "2 records … in different orgs" and a filesystem-path origin could not settle it: it now dedupes on `<org>/<basename>` the way `resume` does (F4 of the review on openRepoShape #83), and both keys now fold the basename's case as the lookups already did. A recorded feature whose worktree directory was deleted without `git worktree prune` read as present at the parked commit, hence clean, and the unrecorded sweep accused the same stale block of never having been parked: both check the path now, and because `resume.sh`'s `leg_registered_at` matches registrations by path alone and leaves a ghost "as it is", a held-but-gone registration is told apart from none and the finding names `git -C <repo> worktree prune` before `resume <Name>`, with `git worktree unlock <path>` first when the registration is locked, since prune skips a locked block; a block git itself marks `prunable` is stale whatever is on disk, and a directory the prune leaves behind is moved aside, never deleted, because `git worktree add` refuses a path that exists; of two stale registrations for one branch the locked one is named, since unlock-then-prune clears both; and a block is live only when git has not called it prunable AND the worktree is usable (`worktree_is_usable`: the directory and its `.git` both exist), because git never judges a locked block, so a locked registration whose `.git` is gone read as live — the record layer, the unrecorded sweep and the local layer's `read_worktrees` now agree about what a worktree on disk is (AGENTS.md rule 4, the README and `status --help` say the same: a stale registration is the prune's to clear, never `worktree add --force`, never a delete under `.git/worktrees/`). A `--no-push` record with no worktree here said "`resume` refuses it" and then "`resume <Name>` brings it back": one line now, naming the only exit, and `status --help`, AGENTS.md rule 4 and the README carry the exception. The missing-parked-commit line no longer offers `--no-push` under a `pushed: true` record. And `status --fetch` now fetches every repository of the estate FIRST, before any row is printed, as the README and rule 4 have said all along: `fetch_estate_first` stores each fetch's lines, findings and flags, `replay_fetch` puts them back on their own row so the report reads as before, and the record is read after the leg's own fetch, so a parked commit that lived only on the spec leg's origin is no longer reported "not here" and then fetched further down the same report; the fetch results are keyed by physical path, so a leg spelled `./spec` in `project.yaml` and `spec` in `.gitmodules` is one repository, and a member a family lists twice is fetched once. Hygiene caps: AGENTS.md 140→149, README 241→245, in dated entries. Suite on the final head with the submodule at 32450eb: 278 passed, 0 skipped. PR #18 Co-Authored-By: Claude Fable 5.1 <[email protected]>



Ruling: Brett Heap, 2026-09-11, verbatim: "next layer: parked record against disk" — the last of the five layers named when
statuslanded (#9): local (#9),--fetch(#10), the fork (#11), the shape pin (#12), and this. Againstmain.What it reads
parkRECORDS every open feature of an estate in the person's private workspace repository —workspaces/<org>/<id>.yaml, one block per project, one entry per feature, and per leg the commit it was parked at and whether it was pushed — andresumerebuilds the worktrees from that record on the next workstation. Between the two, record and disk drift apart in exactly the waysresumelater refuses, and this layer reads them beforehand, the wayresume.shwill judge them:resume <Name>is the exit; nothing here adds a worktree.resumerefuses to reset; diverged from it; or a parked commit this machine never fetched.--no-push: the record sayspushed: false, only the workstation that parked it has the WIP commit, andresumerefuses it.parkexists to carry — read in the root and in every mounted leg.The record is found the way
resumefinds it.${AGENT_PROTOCOL_ROOT:-~/.agents}/workspace.yamlnames the workspace repository and its checkout (path:), plus per-org overrides underorgs:; every checkout'sworkspaces/<org>/*.yamlis scanned for the estate's id —project.yaml's for a standalone,family.yaml's for a family — with the basename compared case-insensitively, asresumecompares it. A family's record has one block per MEMBER, matched byroot: <family folder>/<member folder>(the casingworkspace_manifest_root_valuewrites); the holder has none. Each leg is read in the repository its role lives in: the root forrepoandassembly, the leg's own checkout forspec,codeand any other roleproject.yamlplaces.No config, no record for this estate, or two orgs recording the same id (with neither being the org this root's origin names) is a NOTE at the estate level, not a finding: a machine that never parked has nothing to be out of sync with. Nothing here reads the workspace repository's remote — the record is as of its last pull, and the estate's line says so.
Docs
README.md 232 -> 239, AGENTS.md 133 -> 140, caps raised in dated entries. AGENTS.md rule 4 names the three things an assistant reaches for and must not: a
git worktree addfor a feature the record has and disk does not (resume <Name>is the exit), a reset for a worktree behind a newer record (rule 1 stands), and a hand-edit of the record for a worktree it does not know (parkis the exit). The hygiene document test now holds "workspace.yaml" in README, AGENTS.md and the command's header. The list of layers still to come is gone from every document, because none is.Tests
218 -> 229. The config and the workspace checkout are plain files under the fake home, the record written as
park.shwrites it; worktrees are real linked worktrees with pushed branches, so the only findings under test are this layer's. Covered: no config and no record as notes; a recorded feature with no worktree, namingresume Atlas; a worktree at the parked commit, in sync; moved on, with the count; BEHIND a newer record, naming the workstation that parked it; parked with--no-push; a second worktree the record does not know; a spec leg read in the leg's own repository (role mapped throughproject.yaml), then its parked commit not here; two orgs recording the same id; a family record matched to each member byroot:with the holder row silent (against the real family-root template's clone).bash -n statuspasses;shellcheck statusreports only SC2317.python3 -m pytest tests -q: 229 passed locally with the submodule initialised.Not merged
Opened for review. An independent review of this layer was running when it was opened; anything it finds lands as a follow-up commit here before the merge. workBenches re-vendors all four after this lands.
🤖 Generated with Claude Code
Summary by Sourcery
Add the parked workspace record as the fifth
statuslayer, showing when local worktrees differ from whatparkrecorded and directing recovery throughresumeorpark.New Features:
status, comparing workspace manifests written byparkwith local worktrees across estate roots and mounted legs.Bug Fixes:
Enhancements:
resumeandparkare the appropriate exits for parked-record drift.Documentation:
Tests:
statusandresumeretain consistent home-path expansion logic and that user-facing documentation describes the workspace record.