Skip to content

lane-end --retire passes over a helper too old for duplicate-holder and never reads a skipped read as nothing; duplicate-holder drops the lane's own tree; the suite's pgrep and ps can fail - #25

Merged
brettheap merged 2 commits into
mainfrom
fix/109-112-duplicate-holder
Nov 10, 2026
Merged

brettheap merged 2 commits into
mainfrom
fix/109-112-duplicate-holder

Conversation

@brettheap

@brettheap brettheap commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openRepoTools-3
Claim: opensoft/openRepoTools#109 (comment), opensoft/openRepoTools#110 (comment), opensoft/openRepoTools#111 (comment), opensoft/openRepoTools#112 (comment)

Two commits: 73c9caf, the four fixes, and 7e1d13a, the fixes from the review of 73c9caf (READY AFTER FIXES: S1, S3 and the NIT on the die arm; S2 is answered in this text).

main: this branch starts at 86d635b. Three commits have landed on main since:

  • 3460f5e touches the release workflow and its test.
  • 9a219ed touches lanes-edit.sh and tests/test_lane_helpers.sh, well away from these hunks.
  • b4b6b15 touches tests/test_lanes_index.py.

git merge-tree --write-tree b4b6b15 7e1d13a is clean (tree 38ca7ad).

The four defects

opensoft/openRepoTools#109 and opensoft/openRepoTools#110 cannot be reached by any lanes-edit.sh that has shipped. The change for them is defensive:

  • lane-end's seam check runs first (seam_refuse, lane-end:3068). It asks managed-projection and dies 1 on any exit but 0 or 8.
  • managed-projection came in ec12254 (2026-10-04). duplicate-holder came in f0b891b (2026-10-03) and transcript-holders in 285b551 (2026-09-14). f0b891b is an ancestor of ec12254, and counting the dispatcher arms at each commit confirms the order.
  • So a helper old enough to lack either verb also lacks managed-projection, and dies 1 at the seam before either read.
  • The tests' oldhelper wrapper passes managed-projection through to the current helper. It therefore imitates a helper that never shipped.
  • The code is kept because it fails safe, and a comment at lane-end:3132-3135 now says the path is defensive.

The fixes (line numbers on 7e1d13a)

The new cases

No existing case's expectation changes. Only lane-end calls duplicate-holder. No existing fixture puts the lane's own pid under a wrapper, and no existing case makes either read exit 2 under lane-end --retire.

Probes: 86d635b, 73c9caf and 7e1d13a

Triage A's probe, adapted. It runs under env -i on copies of each tree's tools, with the fake tmux, pgrep and ps extracted verbatim from that tree's own test file.

probe 86d635b 73c9caf 7e1d13a
B1 duplicate-holder: the lane's own pid L as wrapper W's child 0, a W/L row 8 8
B2 lane-end --retire W 2, "Retire the OTHER pid" 8 8
B3 lane-end --retire L 2 2 2
B4 duplicate-holder: W over L and a second holder D 0 8 1, naming W, L and D
B5 lane-end --retire D 2 8, "nothing of any kind" 1, the helper's words relayed
D0 to D5 triage's error wrappers, and the control 0, then 1 each same same
S1 to S4 FAKE_PGREP_F_RC, FAKE_PGREP_P_RC, FAKE_PS_FAIL_PID on the parent, then on the child 0 each (ignored) 1 each 1 each
S4b FAKE_PS_FAIL_ARGS_PID on the child 0 (ignored) 0 (ignored) 1
S5 lane-end --retire W with FAKE_PGREP_F_RC=3 0 (the probe's own pair was TERMed) 1 1
E1 current helper, --retire DUP2 0 0 0
E2 helper without duplicate-holder 1, "failed (exit 2)" 0 0
E3 helper without transcript-holders 8, "nothing of any kind" 1 1
E4 helper without either 1, "failed (exit 2)" 1, "A read that did not run" 1, the same

Apart from S5 on 86d635b, every probe process was still alive after each act. All of them were gone after each run, and no lane-end-* temp file was left.

The new test blocks, run verbatim. The three blocks were extracted from 7e1d13a's test file and run in a fixture of the same shape, with the suite's own run, is, has and hasnt and 7e1d13a's fakes. Results by tools:

The review's S1 mutant. On 7e1d13a's tools, lanes-edit.sh:9039's return 1 was turned into continue:

  • With 7e1d13a's blocks: 42 passed, 2 failed. Both failures are the child case: rc 0 where 1 was expected, and a row listed.
  • With 73c9caf's blocks: 37 passed, 0 failed, which reproduces the review's finding.

What ran, and what CI must run

  • bash -n on lane-end, lanes-edit.sh and tests/test_lane_helpers.sh is clean under bash 5.2.21. git diff --check is clean, and the new assertion descriptions pass the hygiene rule on backticks (SUITE_ASSERT_DESC).
  • The shell suite was not run. tests/test_lane_helpers.sh has no section selector or env filter (it does not honour OPENREPOTOOLS_SHELL_SECTIONS). tests/run.sh -k can select only test_the_lane_helper_suite_passes, which is the whole suite.
  • The new cases have run only as the extracted blocks above, never inside the suite's own fixture. CI must run tests and tests-no-submodule, including both shell shards, plus guard-launch-mode and package.

Fixes opensoft/openRepoTools#109
Fixes opensoft/openRepoTools#110
Fixes opensoft/openRepoTools#111
Fixes opensoft/openRepoTools#112

🤖 Generated with Claude Code

…nd never reads a skipped read as nothing; duplicate-holder drops the lane's own tree; the suite's pgrep and ps can fail

opensoft/openRepoTools#109: lane-end --retire read every exit 2 from
`lanes-edit.sh duplicate-holder` as a process table that failed, so a
helper that predates the verb (it answers "unknown subcommand
'duplicate-holder'", exit 2) stopped the act before the older
transcript-holders read, which could still prove a duplicate. The read's
stderr is now kept, and only those words are the old helper: the skip is
noted, marked (dh_skipped), and the act goes on. Any other 2 is still a
failure: lanes-edit.sh's own contract for these reads tells its two kinds
of 2 apart by its words.

opensoft/openRepoTools#110: a transcript-holders exit 2 was noted and then
fell through to "nothing of any kind is live" (8). With dh_skipped and
thh_skipped, a target that none of the reads that ran proved is refused
with 1 ("A read that did not run is not 'nothing'"), and the "either"
notes are not printed for a read that did not run.

opensoft/openRepoTools#111: duplicate_holder_pids fenced the lane's own
live pid only as a candidate, so the lane's pid as a wrapper's CHILD came
back as a duplicate pair. The companion loop now drops a pair whose child
is the lane's own live pid, as it drops a companion's host.

opensoft/openRepoTools#112: the suite's fake pgrep and ps could only miss.
FAKE_PGREP_F_RC, FAKE_PGREP_P_RC and FAKE_PS_FAIL_PID make them fail the
way a read fails; unset, nothing changes.

Tests: five failure cases beside the duplicate-holder baseline (#112), the
own-pid-as-child case beside the companion cases (#111), and repoLV-1's
retire act over an `oldhelper` wrapper beside the thfail cases (#109,
#110).

Lane: openRepoTools-3
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

Implementation

Make lane-end --retire distinguish an unsupported duplicate-holder verb from a failed read, and refuse to report absence when either holder read was skipped.

  • lane-end L3117-3152, L3724-3738 (+5 small edits)

Exclude the lane’s own process tree from duplicate-holder results, but fail the read when that tree also contains another verified holder that cannot safely be retired.

  • lanes-edit.sh L9060-9086

Tests

Extend the process-inspection fakes and cover failing pgrep and ps reads, including retirement behavior when the process table cannot be read.

  • tests/test_lane_helpers.sh L575-586, L619-629, L5570-5604 (+3 small edits)

Cover wrappers containing the lane’s own live session, both alone and alongside a second holder of the same transcript.

  • tests/test_lane_helpers.sh L5639-5686

Exercise retirement with helpers that lack holder-reading verbs, and verify that skipped reads are not treated as proof that no holder exists.

  • tests/test_lane_helpers.sh L11578-11634

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

…econd holder; the child ps case reaches the child check (opensoft/openRepoTools#111, opensoft/openRepoTools#112)

Fixes from the review of 73c9caf (READY AFTER FIXES).

opensoft/openRepoTools#111 (S3): the first fix dropped every pair whose
child is the lane's own live pid. So a wrapper over the lane's own session
AND a second verified holder of the same transcript answered 8, and
`lane-end --retire <second holder>` said "nothing of any kind is live"
while that holder ran. duplicate_holder_pids now drops such a pair only
when no other child verified; otherwise it returns 1, naming the wrapper,
the lane's pid and the second holder, which no retire act can end without
ending the lane's own session through its wrapper. The new W/L/D case sits
beside the first opensoft/openRepoTools#111 case.

opensoft/openRepoTools#112 (S1): the "ps fails on the child" case failed
every ps of $DUP_CHILD, which is a pgrep -f candidate too, so it stopped at
that pid's own candidate read (lanes-edit.sh:8934) and never reached the
child check (:9039): with :9039's `return 1` turned into `continue` it
still passed. FAKE_PS_FAIL_ARGS_PID fails only that pid's `ps -o args=`
read, and the case now uses it.

opensoft/openRepoTools#109 (review NIT): lane-end's die arm for a failed
duplicate-holder read relays the helper's captured words, as
lane_register_follow does. A comment records that the skip path is
defensive: no lanes-edit.sh that has shipped reaches it, because
seam_refuse asks managed-projection (ec12254) first and dies 1 on a helper
that lacks it.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 and 8 hours by commenting @sourcery-ai review. Upgrade to get a review now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment