Skip to content

status reads a pushed: that is neither true nor false as unreadable 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 - #19

Merged
brettheap merged 3 commits into
mainfrom
fix/record-pushed-valueless
Sep 11, 2026

Conversation

@brettheap

@brettheap brettheap commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

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.

🤖 Generated with Claude Code

Summary by Sourcery

Make status identify unreadable pushed: values accurately and direct users to re-park them instead of attempting resume.

New Features:

  • Treat pushed: values other than true or false as an explicit unreadable record state in status.
  • Provide recovery guidance for unreadable records that directs users to re-park them from the original workstation rather than using resume.
  • Handle inline comments consistently when interpreting pushed: values.

Bug Fixes:

  • Prevent status from incorrectly claiming that unreadable records were pushed or offering a resume path that refuses them.
  • Report all applicable missing-commit explanations for unreadable pushed: values while still excluding reasons ruled out by a successful fetch.

Enhancements:

  • Align status help, README guidance, and agent instructions with the recovery behavior for unreadable pushed: values.

Documentation:

  • Update user-facing status guidance and recovery instructions for records with unreadable pushed: values.

Tests:

  • Add regression coverage for unreadable values, missing worktrees, stale registrations, inline comments, missing commits, and fetch behavior.
  • Update documentation hygiene limits for the expanded guidance.

brettheap and others added 2 commits September 11, 2026 16:30
…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 second independent review of #18 recorded this on 2026-09-11, and it is
taken here as that reviewer's note — nobody has ruled on it: "(d) 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)". Against 628b1be 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 "its parked commit
… is not here — the record says it was pushed, so this repository has never
fetched it", a claim the record does not make; and with no worktree here the
same fall-through offered "`resume <Name>` brings it back", which is the
exit the extension's `resume.sh` refuses such a leg for — its RR6 is `[
"$pushed" != true ]`, so an unreadable value is refused there exactly as
`--no-push` is.

The field now has three readings. A value that is neither word is named for
what it is — "its `pushed:` has no value, which is neither true nor false",
"its `pushed:` says 'yes', …" — 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) instead of one
that does not; 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:` at all 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`. `status --help`, AGENTS.md rule 4 and
the README promised the recovery the new findings rule out and now carry the
second exception, one line each, with the two hygiene caps raised in dated
entries. Four regression tests beside the record-layer ones they belong with;
the suite is 282 green.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…`#` comment stripped — so `pushed: true # note` is not told that `resume` refuses it, and `status --help` lists the unreadable-`pushed:` finding beside `--no-push`

The independent review of this follow-up (2026-09-11), REPORT ONLY, two should-fixes and three nits, every one taken; its 22-pair regression guard (11 record-layer scenarios × `pushed: true` / `false`, main's `status` against this branch's) found no byte of difference, and all four new tests fail against a2c8521. The should-fix that mattered: `workspace_load_project` strips a `#` comment from EVERY line (`content="${raw%%#*}"`) before it reads a value, so `resume.sh` sees `pushed: true # note` as `true` and RECREATES the leg, while `record_rows` read the line whole and the new arms called it "neither true nor false" — a clean estate turned into exit 1 with a finding that named a refusal `resume` would not make and withheld the exit that works. `pushed:` is the one field this layer JUDGES rather than matches or prints, so it alone loses the comment here too, the way the shape-pin `path:` already does; `false # note` therefore reads as the `--no-push` record it is, where against a2c8521 it read as `true`. The second: `status --help`'s parenthetical carried the new exception but its LIST of findings did not, while the README's did, so the list names it now and the help test pins both sentences. The nits: the help's shared clause said "the workstation that has the WIP commit", a fact the unreadable findings decline to assert, and says "the workstation that parked it" as the README does; and two comments said `park.sh` writes `true` or `false` "and nothing else", where `emit_recorded_feature` carries an existing entry forward untouched for a feature it REFUSES — the conclusion stands, the premise is now stated as narrowly as it is true. One test with both comment cases, biting against the first commit of this branch.

Two notes from the same review are 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 — `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`, the guess this branch removes from `status`, in another repository.

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

@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 by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR makes status recognize pushed: as a three-state field, reporting malformed or empty values as unreadable and recommending re-parking rather than offering the incompatible resume path, while preserving valid-record behavior and documenting the exception. Regression coverage exercises malformed values, missing worktrees and commits, stale registrations, inline comments, fetch filtering, help text, and documentation hygiene.

Sequence diagram for status versus resume with an unreadable pushed value

sequenceDiagram
    participant Record as Workspace record
    participant Status
    participant Resume
    participant Make as make resume
    participant ResumeSh as resume.sh

    Status->>Record: workspace_load_project
    Record-->>Status: pushed: valueless or yes
    Status->>Status: Report unreadable pushed value
    Status-->>Record: Recommend re-parking
    Resume->>Record: Load record
    Resume->>Make: resume
    Make->>ResumeSh: Execute resume.sh
    ResumeSh->>ResumeSh: Check pushed != true
    ResumeSh-->>Resume: Refuse the leg
Loading

Flow diagram for status handling of pushed values

flowchart TD
    Record["workspace record"] --> Parse["workspace_load_project"]
    Parse --> Valid{"pushed is true or false?"}
    Valid -->|true| Pushed["Treat as pushed"]
    Valid -->|false| NoPush["Treat as --no-push"]
    Valid -->|neither| Unreadable["Report unreadable pushed value"]
    Unreadable --> Repark["Re-park from the workstation that parked it"]
    NoPush --> Repark
    Pushed --> Resume["Offer resume when the worktree is absent"]
Loading

File-Level Changes

Change Details Files
Treat non-boolean pushed: values as unreadable instead of implicitly treating them as pushed.
  • Distinguish true, false, and all other values, including empty and quoted-empty values.
  • Strip inline comments consistently so commented boolean values retain their intended readings.
  • Report the unreadable value explicitly and avoid asserting that the record was pushed.
status
Align status findings and recovery guidance with resume's refusal behavior.
  • Do not offer resume for records with unreadable pushed: values when no worktree exists.
  • Recommend re-parking from the workstation that created the record.
  • Preserve all applicable missing-commit explanations for unreadable values, while still suppressing reasons ruled out by a successful fetch.
  • Keep well-formed true/false behavior unchanged.
status
tests/test_status_command.py
Document the new unreadable-record exception across user and contributor guidance.
  • Update rule 4, README status guidance, and status --help to identify non-boolean pushed: values as records that resume refuses.
  • Increase and test the dated documentation line-count caps.
AGENTS.md
README.md
status
tests/test_repo_hygiene.py
tests/test_status_command.py

Tips and commands

Interacting with Sourcery

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

Customizing Your Experience

Access your dashboard to:

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

Getting Help

…that carries it, this repository's #19, beside the review note it answers

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@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.

🟢 Approval recommended

No unresolved blocking issues were identified, and the changes include regression coverage.

Pull request overview

Updates status to handle unreadable pushed: metadata consistently with resume.

Changes:

  • Reports invalid pushed states and provides valid recovery guidance.
  • Corrects missing-commit diagnostics.
  • Adds regression tests and updates documentation.
File summaries
File Summary
tests/test_status_command.py Adds regression coverage.
tests/test_repo_hygiene.py Adjusts documentation line-count caps.
status Handles unreadable metadata and diagnostics.
README.md Documents recovery behavior.
AGENTS.md Updates operational guidance.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

Copilot AI review requested due to automatic review settings September 11, 2026 16:56

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.

🟢 Approval recommended

Only a minor documentation-contract nit remains; no blocking issues were identified.

Review details

Suppressed comments (1)

status:149

  • The user-facing summary is updated here, but the earlier fifth-layer contract comment in this same file (lines 82-87) still says a missing worktree is resumable unless the record says --no-push; it omits the newly supported unreadable-pushed: state and therefore gives maintainers an incomplete recovery contract. Please update that in-file summary as part of this change so the two descriptions stay consistent.
brings it back — unless the record says `--no-push`, or its `pushed:` is
neither true nor false, which `resume` refuses the same way: then only the
workstation that parked it can park it again; and where `git
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap
brettheap merged commit 8e7c37b into main Sep 11, 2026
7 checks passed
@brettheap
brettheap deleted the fix/record-pushed-valueless branch September 11, 2026 17:24
brettheap added a commit that referenced this pull request Sep 11, 2026
…hich `resume` refuses in the `--no-push` words — instead of dropping the leg and saying nothing

The follow-up to the note the independent review of #19 recorded there as out of scope (2026-09-11), taken on the reviewer's note alone — nobody has ruled on it: a record leg with no `pushed:` KEY at all drew nothing from `status`. `record_rows` emitted a leg's row AT its `pushed:` line, so a leg without one had no row and vanished from the record layer — no finding, exit 0, for every state of such a record (no worktree here, a worktree in sync, the parked commit missing with and without `--fetch`) — while the extension's `workspace_load_project` seeds every leg's pushed with `false` at the `- role:` line and overwrites it only where a `pushed:` follows, so `resume.sh`'s RR6 (`[ "$pushed" != true ]`) refuses that leg: run against such a record, the extension answered "Error: 001-a-thing (repo leg) was parked with --no-push; that feature was NOT recreated", exit 2. The same family as note (d), which #19 answers, and worse — a wrong line can be argued with, a missing one cannot. And it is reachable without a hand-edit: `workspace_write_manifest` drops a key whose value is empty, so one `park` that REFUSES a feature whose record had a bare `pushed:` rewrites it without the key, and the next refused park writes `pushed: false`, a `--no-push` claim nobody made. The row now goes out where the LEG ENDS — the next `- role:`, the next feature's `- branch:`, the next key at any shallower indent, or the end of the file — and carries a sixth field written by `record_rows` and never from the record, which is what tells an ABSENT `pushed:` from the bare one that is present and valueless; `check_parked_leg` reads absent as a fourth state of the field, in findings shaped like the other three: what the record does not say, that `resume` reads a missing one as not pushed and refuses it, and the exit that works — park it again from the workstation that parked it. With no worktree here no arm names `resume <Name>`, a stale registration still has its prune named first, and the missing-commit arms rule out no more than an unreadable value does, `fetched_ok_at` split included. `status --help`, AGENTS.md rule 4 and the README gain "missing or" rather than a sentence of their own, so both line caps hold where they are. A second commit, from the review of this branch: a full-line `#` comment at column 0 inside a leg is no leg-ender — the loader strips `#` from every line, so `pushed: true` below such a note is `true` to `resume.sh` and now here too — plus the review's three comment nits. Proved by seven tests beside note (d)'s, each failing against main (8e7c37b), and by the independent review's guard: 162 comparisons of main's `status` against this branch's across 18 record-layer scenarios and 9 spellings of `pushed:` (`true`, `false`, bare, `""`, `maybe`, `true # note`, `false # note`, `TRUE`, ` true `), byte-identical in exit code, stdout and stderr; the only outputs that change are for a leg the record says nothing about, and for a hand-shuffled leg, which is now read as the loader reads it. Recorded for later, not taken here: a record with `pushed: true` and NO `parked_commit:` still draws "`resume <Name>` brings it back" while `resume.sh` refuses it ("has moved since it was parked"); and an empty `- role:` value is dropped here while the loader creates the leg and `resume` refuses the whole feature.

PR #20

Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 11, 2026
… 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]>
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