Repository navigation
a14_three waits out every sync its unreachable leg forks and ends the poisoned leg's nudge at once, so no sync holds the index lock into the next leg (opensoft/openRepoTools#165, lane 4's batch 6 Q18) - #36
Conversation
… poisoned leg's nudge at once, so no sync holds the index lock into the next leg (opensoft/openRepoTools#165, lane 4's batch 6 Q18) THE RACE. lanes-index runs one sync at a time per workstation on an fcntl lock in its state directory, and a sync that finds the lock held leaves a mark and returns 0 before it opens any store (lanes-index:2257-2262). A write's nudge is that sync, forked detached by the write's exit trap (lanes-edit.sh:3844) and waited for by nobody. a14_three forked two such syncs it never waited out: * the unreachable leg's: a14_wait_psql returns at the sync's FIRST psql line, with the sync still running and holding the lock; * the poisoned leg's: its PATH carried no indexer of its own, so a host with lanes-index installed (every lane workstation; a clean CI runner has none) forked a real sync into the poisoned store from every write. The next a14_three then found the lock held and its unreachable-leg nudge returned without reaching psql: T430's run-1110d-1, "set-lane-state ... its nudge DID reach for that store", expected [0], got [1]. A real sync into the poisoned store also mends the rows the leg exists to read wrong (the inventory sync deletes the forged row and rewrites the rows a write changed). THE DESIGN. Test file only; lanes-index and lanes-edit.sh are untouched. * Unreachable leg: a wrapper lanes-index, first on its PATH, logs a start line and a done line around the real script, run by its own absolute path ($A14_BIN, unchanged). a14_wait_nudges polls that log (300 x 0.1 s) until every sync that began has ended, and a write leg also needs one to have begun, before a14_restore. No lock is probed and no flock is used. * Poisoned leg: a wrapper that ends sync at once (no lock, no store) and hands every other subcommand to the real script, so a read of the poisoned store is still a read of it. The suite's bin directory holds no lanes-index, so without a wrapper an act that read the index would find none on a clean runner. * a14_three asserts the drain with one more is per call. THE PROOF. The suite has no section selector at this commit, so the whole section was not run (tests/run.sh and pytest were not run either). bash -n of the file is clean, and the real a14_three, a14_wait_psql and a14_wait_nudges text of the old and new file were driven over a model indexer with the same lock semantics: * old file, host indexer on PATH, slow poisoned sync: 2 of 4 write legs fail with "nudge DID reach ... expected [0], got [1]"; * old file, no host indexer, slow unreachable sync: 1 fails the same way, and 5 of 12 restores ran with a sync still in flight; * new file, three variants (host indexer, none, both syncs slow): 32 passed, 0 failed, and 12 of 12 restores saw no sync in flight; * a 3 s sync makes a14_wait_nudges wait 3.11 s and return 0; a sync that never ends makes it return 1 after about 32 s, which a14_three reports as an is failure; a write leg with no wrapper run fails the same way, and a read leg returns at once. Lane: openRepoTools-3 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
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 17 hours by commenting |
Reviewer's GuideTestsUpdate the Amendment 14 test harness to track unreachable-leg syncs, wait for them to finish before restoring snapshots, and suppress poisoned-leg nudges while preserving real reads.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…meout names its counts, and two comments say what was measured (#36 review) Part of opensoft/openRepoTools#165 (lane 4's batch 6 Q18). Fix round on #36 after its independent review, which read it READY at 0be5f1b with three optional NITs; the first change is owed by lane 3 on opensoft/openRepoTools#165. Test file only. * The unreachable leg's wrapper logs start and done only when the subcommand is sync, with or without --source inventory, and execs the tree's own script ($A14_BIN) for every other subcommand with no log line. A mode question or a register prefetch is not a nudge, and counted as one it would let a write leg's "one began" prove only that lanes-index ran. a14_nudge_counts therefore counts exactly the syncs. The poisoned leg's wrapper and the control leg are untouched. * The timeout's failure description carries the counts from the wrapper's log and the count begun before the leg, so a failure shows whether a sync was stuck or never began. The status is taken before the description is built: its command substitution would otherwise be the status the assertion reads. * The wait's bound is stated as it is: 300 polls, each a 0.1 s sleep and an awk run, about 32 s idle and about 49 s under heavy load. * The poisoned leg's comment no longer says an act that read the index would prove nothing: it would still differ from the control leg on stderr, and what main lacked was the poisoned content. Proof, with the whole shell suite not run (CI verifies): bash -n is clean; the real a14 helpers over the model indexer pass 32 of 32 in three variants with no sync in flight at any restore; export, mode and register read through the wrapper leave the counts at 0 0, sync and sync --source inventory make them 1 1 and 2 2; a sync that never ends fails the assertion after about 32 s with "1 0; begun before this leg: 0", and a leg that forks nothing fails it with "0 0; begun before this leg: 0". Lane: openRepoTools-3 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…udge-race Part of opensoft/openRepoTools#165 (lane 4's batch 6 Q18); the branch is #36. main moved from 749e969 by #34, which adds only .github/workflows/verify.yml, so the merge changes nothing in tests/test_lane_helpers.sh. Lane: openRepoTools-3 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…is not a nudge cannot satisfy the wait (#36) Part of opensoft/openRepoTools#165 The unreachable leg's wrapper runs the real script for a sync with A14_CALLER=sync in its environment and keeps its plain exec for every other subcommand. The fake psql logs "psql sync" for that caller and "psql other" for any other, with its stderr text and exit status as they were. a14_wait_psql counts only the sync lines (new a14_psql_syncs), and the count a14_three takes before the leg is taken the same way, so both sides of the comparison count alike. Once T504's register prefetch or T409's mode question reaches psql, an uncounted call would satisfy the wait before the nudge had reached its store. The read leg's "reached for no store at all" keeps counting every line, with its own baseline: a read that reaches psql by any caller is what it exists to catch. The poisoned leg, the control leg and the nudge counts are unchanged. Test file only. Lane: openRepoTools-3 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Brett approved landing #35 and #36 through one narrow real-code Mergify batch after full CI and exact-head Codex review. Queue configuration is in #42. Please leave this PR unmerged and its branch unchanged for this bounded batch; no hold on other work or repository-wide freeze is requested. This coordination does not restart, rebind, retarget or edit any lane session. |
|
@Mergifyio queue openrepotools-real-code-35-36 |
|
@Mergifyio refresh |
|
✅ Merged into
|
✅ Pull request refreshed |
…osed-lane code#35 landed first, so this PR takes main again, as lane 3 asked (opensoft/openRepoTools#165, 6784609742). The one conflict was the tail of tests/test_a23_lane_handoff.py, where both PRs append after code#27's block. The union keeps main's block first, then this PR's, and drops no line of either. Lane: openRepoTools-5 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…tten, as `--late` does, instead of taking it from CLOSED to SWAPPING (opensoft/openRepoTools#118) (#32) A lane whose log's last lane-kind line is an `ENDED` or a `RETIRED` is closed. `lane-handoff` on it read the lifecycle's `CLOSED` as the compare-and-swap's expected value and took the lane to `SWAPPING`, then `SWAPPED`, appending a `PAUSED` after the `ENDED`: a terminal lane reopened by a `/handoff` typed in a pane that was still there. - `lane-handoff`: `--late`'s read of `lane-last` and its `ENDED` or `RETIRED` refusal move into `read_last_lane_line` and `refuse_a_closed_lane`. Every mode but `--late` calls them right after the managed-ledger seam's refusal, before the restart intent, the window, the handoff, the register, the object log or the lifecycle is touched. A closed lane exits 2 with `--late`'s words, and `--late` keeps its own order and words. - The log is the lane's state: a lane that a later `STARTED` or `RESUMED` reopened is never refused, and a `lane-last` read that fails exits 1 before any write (Amendment 7(d)). - tests/test_a23_lane_handoff.py: a closed lane is refused before any write, for the plain handoff, `--restart`, `--exit` and `--in-process`; a failed read of the last line is not an open lane; and a lane started again after its close is handed off as before. It is the option Brett Heap chose for opensoft/openRepoTools#118, "Refuse, as --late does (Recommended)". The issue stays open for the transition table its "What's open" also asks for. Lane openRepoTools-3's independent review read READY at 1915f48, after the fix round for its MUST and SHOULD, and its delta check read READY at the merge 959e21a. The merge 4d211d2 took code main 92f9e10 (#36 and #35): lane 3 checked that its tree equals git merge-tree's in every file but tests/test_a23_lane_handoff.py, which holds both sides' blocks, main's first, and Codex found no major issue there. The head 0356714 then merges code main d3c55e5 (#44 and #45, two CI changes), and its tree, 3284253, is git merge-tree's of d3c55e5 and 4d211d2, so it adds nothing of its own. Codex found no major issue at 0356714. All 18 checks that ran passed at 0356714 on main d3c55e5 (Sourcery's review was skipped and the Mergify queue check was neutral), so the tested tree is this commit's tree, 3284253. Lane openRepoTools-3 lands it under Brett Heap's standing landing word, which he extended on 2026-11-10 to lane-tooling fixes any lane writes, once lane 3 has reviewed them. Part of opensoft/openRepoTools#118 Lane: openRepoTools-5 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>



Lane: openRepoTools-3
Claim: none (lane 3's ruling on lane 4's batch 6 Q18, opensoft/openRepoTools#165)
Summary
Test-only fix to
tests/test_lane_helpers.shat749e969: no sync that ana14_threeleg forks may still be running when the next leg starts.lanes-indexandlanes-edit.share untouched.Lane 4's batch 6 Q18 found the race: set-lane-state's
a14_threefails with "its nudge DID reach for that store", expected [0], got [1] (T430's run-1110d-1), because a detached sync from the leg before it still heldlanes-index.lock. Lane 3 ruled: "Lane 3 opens the fix on the code leg: wait for the poisoned leg's detached sync before the nexta14_three."The race, as read at
749e969lanes-indexruns one sync at a time per workstation, on anfcntl.flockofstate_dir()/lanes-index.lock(SyncLock,lanes-index:1539-1580). A sync that finds the lock held leaves a mark and returns 0 before it opens any store (lanes-index:2257-2262).index_nudge(lanes-edit.sh:3844-3857) from the write's exit trap, and nobody waits for it.:16558onmain) ran with the suite's own PATH. The suite puts nolanes-indexon it (the copy at:712-722omits it, andSCRIPT_DIRis the sandbox bin directory), so a host that has one installed, as every lane workstation does, forked a real sync into the poisoned store from every write, unwaited. A clean CI runner has none, so the race needs a workstation.lanes-index:1626-1651), and the inventory sync deletes stored rows the inventory no longer names (lanes-index:2162-2166), which includes the forgedrepoRC-5:/a14/forgedrow. Later poisoned legs then read a partly true index.a14_wait_psqlreturns at the sync's first psql line, with the sync still running and the lock held, so it can also outlive its leg.Design
lanes-indexis first on its PATH. It appendsstartanddonelines to a log around the real script, which it runs by its own absolute path ($A14_BIN/lanes-index, unchanged). Newa14_wait_nudgespolls the log (300 polls of 0.1 s) until every sync that began has ended, and a write leg also requires one to have begun, so a wrapper that was never on PATH is a failure and not a quiet pass. It runs beforea14_restore. Oneisper call asserts it. No lock is probed and noflockis used: a probe that took the lock would make the nudge it waits for drop its sync.syncat once (no lock, no store) and hands every other subcommand to the real script. A stub that ended every call would also have ended anexport, so an act that read the poisoned index would have found nothing to read. Reads of the poisoned store stay real, and the forged rows stay forged.start. An act that forked two nudges, the second of which had not yet started when the first ended, would be missed. None of the five write acts in the section does: the three register writers set only the register nudge (cp_pushed,lanes-edit.sh:3460) and set-lane-state and set-lane-tree set only the inventory one (lanes-edit.sh:22269and22470), and the lifecycle follow that can set both runs only after a started, resumed, ended or retired line (lanes-edit.sh:15529-15531).Proof
The suite has no section selector at
749e969(noOPENREPOTOOLS_SHELL_SECTIONSreader in the file), so the a14 section cannot run alone.tests/run.shand pytest were not run; the code leg's CI runs the whole shell suite on this PR.bash -n tests/test_lane_helpers.shis clean, and the repository's text hygiene rules (unescaped backticks in descriptions, unbraced variables before a non-ASCII character, GNU-only utilities,caseinside a substitution) were replayed over the file: nothing new.a14_three,a14_wait_psqlanda14_wait_nudgestext of the old and the new file was driven over a model indexer with the same lock semantics, four calls each (three writes and one read):a14_threereported asFAIL ... none left holding the index's lock, expected [0], got [1]. A write leg with no wrapper run failed the same way, and a read leg returned at once.sync --source inventory, exit 7, logstartthendone 7). The poisoned leg's endedsyncandsync --source inventorywith exit 0, took no lock and wrote nothing, and itsexportreached the real script.🤖 Generated with Claude Code
Summary by Sourcery
Make Amendment 14 lane-helper tests wait for detached syncs and isolate poisoned-index behavior so successive legs cannot interfere with one another.
Bug Fixes:
Enhancements:
Tests: