Skip to content

lane-reconcile reads a swapped repository as wrong-repository and names a gone tree's kept registration on one row; READY counts recorded trees (opensoft/openRepoTools#116, opensoft/openRepoTools#117) - #29

Merged
brettheap merged 1 commit into
mainfrom
fix/116-117-reconcile-repo-identity-and-handoff-count
Nov 10, 2026
Merged

brettheap merged 1 commit into
mainfrom
fix/116-117-reconcile-repo-identity-and-handoff-count

Conversation

@brettheap

@brettheap brettheap commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openRepoTools-5
Claim: opensoft/openRepoTools#116 (comment), opensoft/openRepoTools#117 (comment)

One commit, 75cd0b0, on code main ecd1bce. It fixes opensoft/openRepoTools#116's half 2 and both parts of opensoft/openRepoTools#117, as one PR, as lane 3's triage proposed. Lane 3 offered both to lane 5 on opensoft/openRepoTools#165 (6767535266), under Brett's "Yes, extend it (Recommended)": "Any lane may write a lane-tooling fix. Lane 3 reviews it and lands it under the standing word once it is READY and every check is green."

READY for lane 3's review, with its paired opensoft/openRepoTools-spec#22, which holds the manual's text for the spec leg's docs/README-lanes.md. CI ran the whole suite on this head, 75cd0b0, and all 14 checks are green.

opensoft/openRepoTools#116, half 2: a swapped repository no longer reads ok

  • The record: set-lane-tree records the tree's git common directory as an optional repo: line in its sidecar. It reads it before the sidecar lock, as the rule there requires.
  • The comparison: lane_reconcile compares that with what git answers for the path now.
    • A different repository is wrong-repository. It names both repositories and counts toward recovery.
    • An identity git cannot give now is unreadable, never a match.
    • A record without repo:, as every record written before this has, is not compared.
  • Not the recorded checkout: for a lane with no legs that is the lane's dir, even for a tree of another repository.
  • Departure from the triage: lane-trees' row stays at 13 fields, and lane_reconcile reads repo from the sidecar. The T018 goldens pin those rows byte for byte, and two shell readers (lane_reconcile and worktree_rows) read exactly 13 names.

opensoft/openRepoTools#117: the READY line counts what it recorded, and a gone tree's kept registration is one row

  • Part 1: lane-handoff counts a tree as recorded only once set-lane-tree has succeeded. The READY line says inventory: N of M polled worktree(s) recorded only where the counts differ. The equal-count text, which the goldens pin, is unchanged.
  • Part 2: for a recorded tree whose directory is gone, lane_reconcile asks git worktree list --porcelain in the recorded checkout, then in the lane's dir. It looks under the recorded spelling and the parent's physical one.
    • Where git still registers the tree, the same missing or possible-loss row names the prune, as a person's act.
    • The physical spelling joins the seen set, so a symlinked spelling no longer prints a second stale-registration row.

Checked

  • New cases (tests/test_reconcile_identity_116_117.py, 6, and two in tests/test_triad_lane_tooling_handoff.py): every one fails at base ecd1bce and passes here.

  • The two T018 golden cases pass.

  • Regressions:

    • lifecycle test_113: 10 passed;
    • lifecycle test_114: 6 passed;
    • lifecycle test_115_a_tree_record_that_is_not_whole: 14 passed;
    • test_repo_hygiene.py: 240 passed and 18 skipped.
  • The run.sh verify (-k 'reconcile_identity_116_117 or test_117_the_ready_line or c45a452s_byte_for_byte or repo_hygiene') is still queued behind py-bench's shared test lock, and it is a subset of what CI ran. Its result follows as a comment.

  • Not run locally:

    • the shell suite;
    • the other 14 test_115 cases;
    • test_deferred_97_findings_157, test_pathless_tree_record_302, test_unsearchable_control_root_291, test_subfield_misreads_301, test_dir_with_space_295, test_supervised_restart_regressions, test_lanes_index and test_lane_worktrees.

    CI runs them all.

  • Selectors: the suite gains 8 ids. Words such as reconcile, identity, recorded, registration, prune and gone now select more.

Not in this PR

A tree whose observation was refused still does not keep the lane SWAPPING, as the triage noted. It now shows in N of M. Changing the lifecycle is a possible follow-up.

🤖 Generated with Claude Code

…es a gone tree's kept registration on one row; READY counts recorded trees (opensoft/openRepoTools#116, opensoft/openRepoTools#117)

opensoft/openRepoTools#116, its second half. A tree record now carries
`repo`, the path's git common directory, read with `git_common_real` before
`set-lane-tree` takes the sidecar lock and passed to `lane_tree_put` as an
optional thirteenth argument. `lane_reconcile` reads it from the sidecar and
compares it with `git_common_real` of the path now: a different one is
`wrong-repository`, counted toward recovery, and nothing else of the record
is compared against that tree; an identity git cannot give now is
`unreadable`; a record with no `repo` (every one a released helper wrote) is
not compared. The recorded `checkout` is not what is compared: for a lane
with no legs it is the lane's `dir`, even for a tree of another repository.

`lane-trees`' row keeps its thirteen fields. The T018 goldens hold it byte
for byte (tests/fixtures/t018/single-repository.golden, the
`lane-handoff: inventory` section, and
tests/fixtures/t018-handoff/single-repository-decoys.golden), and two shell
readers, `lane_reconcile` and `worktree_rows`, read exactly thirteen names,
so a fourteenth field would have been read into their schema word. So the
identity is read from the sidecar rather than appended to the row.

opensoft/openRepoTools#117. `lane-handoff` counts `writer_recorded` only
where `set-lane-tree` succeeded, and its READY line says
`N of M polled worktree(s) recorded` where the two differ; where every
polled tree was recorded the line is the one the goldens hold. In
`lane_reconcile`'s arm for a recorded path that is gone, the registrations
of the recorded checkout and then of the lane's `dir` are asked for the path
under its recorded spelling and its parent's physical one (`path_real`).
Where one holds it, the `missing` or `possible-loss` row names
`git -C <checkout> worktree prune` and the physical spelling joins the seen
set, so the sweep neither drops the remedy nor names the tree a second time
as `stale-registration`.

Tests: tests/test_reconcile_identity_116_117.py, six cases, and two cases in
tests/test_triad_lane_tooling_handoff.py. Each fails at ecd1bce and
passes here; both T018 golden cases pass here unchanged.

Lane: openRepoTools-5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

Schema and migrations

Persist the path’s git common directory as an optional repo field in each tree sidecar, capturing it before the lock and passing it to the writer without changing the lane-trees row shape.

  • lanes-edit.sh L15635-15648, L22378-22383 (+2 small edits)

Implementation

Compare a recorded repository identity with git’s current answer, reporting mismatches as wrong-repository and failed identity reads as unreadable, while preserving compatibility with records lacking repo.

  • lanes-edit.sh L16190-16220

Check registrations for gone recorded trees under both recorded and physical path spellings, name the prune on the existing recovery row, and prevent the sweep from reporting the same tree again.

  • lanes-edit.sh L16142-16174

UI

Show the READY inventory count as recorded entries out of polled worktrees when observation or writing leaves some entries unrecorded, while retaining the existing equal-count wording.

  • lane-handoff L2002-2008, L2139-2145, L3052-3057 (+1 small edits)

Tests

Cover swapped-repository identity checks, legacy records, unreadable identity, and one-row reporting of gone trees whose registrations remain.

  • tests/test_reconcile_identity_116_117.py L1-167

Verify READY inventory counts for fully recorded inventories and for trees whose observation or sidecar write is refused.

  • tests/test_triad_lane_tooling_handoff.py L1290-1385

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

@sonarqubecloud

Copy link
Copy Markdown

@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

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

brettheap added a commit to opensoft/openRepoTools-spec that referenced this pull request Nov 10, 2026
…ir registers, and says one clone swapped for another still reads ok (opensoft/openRepoTools#116, opensoft/openRepoTools#117)

Fix round for lane 3's review of #22, post
6779244411 on opensoft/openRepoTools#165, written against the code half
75cd0b0 (opensoft/openRepoTools-code#29):

- MUST 1, the stale-registration bullet: a gone tree is one row naming the
  prune "while its recorded checkout or the lane's `dir` still registers it",
  and the remedy is named "where one of those reads finds it", no longer
  "wherever that `git worktree list --porcelain` read succeeds". The bullet
  now says what happens otherwise: a gone tree that only another repository
  registers, in a lane with no legs, reads plain `missing` or `possible-loss`
  with no prune named and no stale-registration row (the review's probe P3).
  The symlinked-spelling claim is scoped to a tree one of those reads finds.
- SHOULD 1, the wrong-repository bullet: the tree reads `wrong-repository`
  only where the common directory git answers for differs from the recorded
  one, and a recorded tree that is itself a clone records `<path>/.git`, so
  another clone put at that path, or a restored backup of one, on the same
  branch at the same commit still reads `ok` (the review's NIT 1 and probe
  P2).

Nothing else of the manual changes. The review's SHOULD 1 on
opensoft/openRepoTools-code#29 changes code and is a later follow-up, so the
manual describes what 75cd0b0 does now. The review's SHOULD 2, the bare
references in bf9cafe's body, is met by lane 3's squash with its own
qualified message, so nothing is amended.

Lane: openRepoTools-5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@brettheap
brettheap merged commit 10799a5 into main Nov 10, 2026
15 checks passed
@brettheap
brettheap deleted the fix/116-117-reconcile-repo-identity-and-handoff-count branch November 10, 2026 21:53
brettheap added a commit to opensoft/openRepoTools-spec that referenced this pull request Nov 10, 2026
…pository and names a gone tree's prune, and READY counts recorded trees (opensoft/openRepoTools#116, opensoft/openRepoTools#117) (#22)

The manual's half of opensoft/openRepoTools#116 (its second half) and
opensoft/openRepoTools#117, written against the code half 75cd0b0
(opensoft/openRepoTools-code#29, landed as 10799a5):

- The worktree inventory section says the handoff's READY block counts the
  records it wrote, `inventory: N worktree(s) recorded` where every polled tree
  was recorded and `inventory: N of M polled worktree(s) recorded` where one was
  not (opensoft/openRepoTools#117).
- The tree record's key paragraph says a record may also carry `repo`, its
  path's git common directory, and is whole without it
  (opensoft/openRepoTools#116).
- The reconciliation section says lane-reconcile compares the repository a
  record names with the one git answers for at its path now, lists
  `wrong-repository` among the classifications and gives it a bullet
  (opensoft/openRepoTools#116).
- The stale-registration bullet says a gone tree is one row naming the prune
  "while its recorded checkout or the lane's `dir` still registers it", with
  the remedy named "where one of those reads finds it". A gone tree that only
  another repository registers, in a lane with no legs, reads plain `missing`
  or `possible-loss` with no prune named and no stale-registration row
  (opensoft/openRepoTools#117).
- The wrong-repository bullet says a tree reads `wrong-repository` only where
  the common directory git answers for differs from the recorded one. A
  recorded tree that is itself a clone records `<path>/.git`, so another clone
  put at that path, or a restored backup of one, on the same branch at the
  same commit still reads `ok`.

Two claims were narrowed to the code half 75cd0b0: where a failed read names
no prune, and where the inventory line prints.

Lane openRepoTools-3's independent review read READY AFTER FIXES at bf9cafe. Its MUST 1 and SHOULD 1 are met in dbac37f, in the review's words, and lane openRepoTools-3's delta check of that commit passed. Its SHOULD 2, the bare references in bf9cafe's body, is met by this squash's qualified message. It lands by squash right after its code half, under Brett Heap's standing landing word, which he extended to the lane-tooling fixes any lane writes once lane 3 reviews them READY.

Lane: openRepoTools-5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…pclaude` or `claude-profile` off its PATH, so a real launcher can no longer change the restart line the t018 golden compares (#31)

The Bench in tests/test_triad_lane_tooling.py drops from its PATH every directory that holds one of its tools or `lanes-index`, so that no real tool is found beside the copies it installs. It did not name the three launchers that `lane-handoff` looks up with `command -v`, in the order `lclaude`, `pclaude`, `claude-profile` (lane-handoff `supervise_argv` and the `lane_profile_word` line before its LATE branch). On a workstation whose launcher directory holds none of the tools, such as /workspace/projects/workBenches/scripts on Eagle, that directory stayed on the bench's PATH, `lane-handoff` found the real `lclaude`, and the READY line's restart command was `lclaude <profile>` where the golden has `pclaude --lane repoS-1 <profile>`. test_t018_single_repository_outputs_are_c45a452s_byte_for_byte failed on it, with that directory first on PATH; with the three names in the filter it passes.

This is lane 3's T405 note (opensoft/openRepoTools#165, 6767463594: "lane 3 adds `lclaude`, `pclaude` and `claude-profile` to the `Bench` filter, in a one-line PR on code `main`"), handed to lane 5 in 6767535266 under Brett Heap's answer "Yes, extend it (Recommended)", whose option read: "Any lane may write a lane-tooling fix. Lane 3 reviews it and lands it under the standing word once it is READY and every check is green." It has no issue.

Lane openRepoTools-3's independent review read READY at 51a5028, with one NIT left for later: the bench's env filter does not strip PCLAUDE, which cannot move the t018 golden. It landed through lane 3's merge queue as the prefix after #29: tests.yml run 42905356123 passed every job on tree f3ba42d, which this commit's tree equals.

Lane: openRepoTools-5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 11, 2026
…eeping both test blocks, #27's first

The merge brings #28, #29, #31 and #33 onto this
branch, on top of the #27 that lane 3 checked at 10799a5.

One conflict, at the end of tests/test_a23_lane_handoff.py: #27
appended its test_the_no_tmux_refusal_names_its_mode_not_both_words block
there, and this branch appended the #118 block (the _closed and _held helpers
and the three test_118 cases) at the same place. Resolved by keeping both,
unchanged and with two blank lines between them: code#27's block first, then
this branch's. No other file conflicted; lane-handoff merged by itself.

The resolved tests/test_a23_lane_handoff.py is blob
3927b53, the blob lane 3 computed on 10799a5.
No commit after 10799a5 on code main touches that file or lane-handoff
(git diff 10799a5 749e969 -- tests/test_a23_lane_handoff.py is empty), so the
blob is the same.

Checked before this commit: bash -n lane-handoff passes; each of the five test
ids of the two blocks passes, run one at a time (2 for code#27's block, 3 for
this branch's).

Lane: openRepoTools-5
Co-Authored-By: Claude Sonnet 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

1 participant