Repository navigation
managed-projection reads this checkout's row as the writers do, lane-trees tells an unlistable trees directory from no inventory, and the manual's seven-column row is qualified (#157 items 4a, 4c, 4d, 4e) - #213
Conversation
done: issue #157 items 4a/4c/4d/4e re-proved on main by reading; proving tests written first in tests/test_deferred_97_findings_157.py (4a: the managed-projection arm and lane-start's gate over an unpushed local marker; 4d: a pin that a vocabulary-free malformed local row stays legacy and set-row-state refuses its shape; 4e: lane-trees over an unlistable trees/). left: run the tests against main (the run was stopped while waiting on the shared pytest lock), then the fixes: 4a in the managed-projection arm with the local check shared with managed_seam_refuse; 4c the manual's table row; 4e lane_trees_list returning 10 and the lane-trees arm exiting 10 (the lane-reconcile verdict half sits in lane 3's region and is skipped); update the shell suite's 14547 assertion; docs; PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
item 4e) lane_trees_list globbed trees/*.yaml whatever the directory's permissions, so a trees directory this process could not read or search answered 8, a lane that recorded no tree. It now returns 10 there, and the lane-trees arm exits 10 with the directory named, the code lane-state already spends for a record that is there and could not be read. The lane-reconcile half, which would turn that into an indeterminate verdict, sits in lane_reconcile's tail and is left for after lane 3's triad branch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…anual's seven-column row (#157 items 4a, 4c, 4d) 4a: managed-projection read the published row only, while every lanes-edit.sh writer also reads this checkout's row and refuses vocabulary only that copy carries. lane-start, lane-handoff and lane-end gate on managed-projection, so an unpushed local marker passed lane-start's gate and the launch went on until a later writer refused. The arm now answers 1 for it, through managed_local_hint, which managed_seam_refuse now shares. The shell suite's case 6(c) asserted the old 8 for exactly this register and now asserts 1. 4c: the manual's exit-1 row said "a row that is not seven columns" unqualified; it is a row carrying the vocabulary that is not seven columns. 4d: no code change, as the issue argues. A row with no vocabulary cannot be a marker in either copy, and the writer that rewrites it refuses the shape itself. The manual's exit-8 row and managed_local_hint's comment say so. Co-Authored-By: Claude Opus 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 23 hours and 38 minutes by commenting |
Reviewer's GuideThe PR makes managed-projection and lane-start fail closed for unpublished local managed-owner markers, introduces a distinct exit-10 path for unreadable trees inventories, and aligns documentation and integration/regression tests with these semantics. The requested lane-reconcile indeterminate verdict is intentionally deferred because its rewrite region conflicts with another branch. Sequence diagram for fail-closed managed projection of local markerssequenceDiagram
participant Caller
participant ManagedProjection as managed-projection
participant PublishedRow as Published register row
participant LocalHint as managed_local_hint
participant LocalRow as Checkout register row
Caller->>ManagedProjection: managed-projection <lane>
ManagedProjection->>PublishedRow: lane_is_managed_owned
PublishedRow-->>ManagedProjection: 8 no published vocabulary
ManagedProjection->>LocalHint: managed_local_hint <lane>
LocalHint->>LocalRow: row_of_lane_local
LocalRow-->>LocalHint: local managed vocabulary
LocalHint-->>ManagedProjection: 1 local-only vocabulary
ManagedProjection-->>Caller: exit 1 UNKNOWN
Note over Caller: lane-start, lane-handoff, and lane-end refuse before writing
Flow diagram for unreadable trees inventory handlingflowchart TD
A[lane-trees] --> B[lane_trees_list]
B --> C{trees directory exists?}
C -->|No| D[Exit 8: no recorded trees]
C -->|Yes| E{Readable and searchable?}
E -->|Yes| F[List tree records]
E -->|No| G[Exit 10: inventory cannot be listed]
G --> H[lane-trees refuses and names trees directory]
H --> I[lane-worktrees fails closed without changes]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…usal (#157 item 4a, review) The refusal managed-projection and managed_seam_refuse print for a row whose vocabulary only this checkout's copy carries assumed that copy was AHEAD of origin and pointed at `git -C $LANES_REPO log origin/<branch>..HEAD`. Two cases it misled: - a checkout BEHIND an origin that dropped the vocabulary answers the same 1, that log prints nothing, and the remedy is a fast-forward; - with LANES_REPO set to a runtime clone and no LANES_WORKSPACE_ROOT, the file read is workspace.yaml's tree, and the command named the clone. Both now print one sentence from managed_local_remedy: the file read ($LANES_FILE), AHEAD with its remedy (publish or undo), BEHIND with its remedy (fast-forward), and the fetch-and-status that tells which. The manual's exit-1 row says the same. New cases: a checkout behind such an origin, and a runtime clone, whose refusal names the workspace file and not the clone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l traps remove against an inherited value The audit #213's review asked for: `cleanup`, `rename_undo` and `release_lock` remove paths through `pbh_tmp`, `rl_htmp`, `TMPD`, `SE_CACHE_FILE`, `RL_SNAP`, `LANES_IDX_DIR`, `LANES_WT_IDX_DIR`, the `RL_*` undo paths and `LOCK`. All but `SE_CACHE_FILE` were set at top level before the trap once `pbh_tmp`, `rl_htmp` and `TMPD` were. `SE_CACHE_FILE` was first assigned at the state-event cache, so a signal before that line removed whatever it inherited. It now starts empty beside the other three, and the environment test exports a victim path under every one of these names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…emporary file and one atomic rename, so a writer killed mid-stamp leaves the handoff whole (#212) * WIP: checkpoint before account swap; done: proving test for #158; left: the fix done: tests/test_rename_publication_atomic_158.py, the proving test written first. Its fault cases inject a crash inside the stamp's write and a kill, a failure and a SIGTERM between the write and the replace, for a moved and an in-place handoff. A normal-path case pins the splice bytes, the mode and the committed blob. Not yet run: the scoped run was queued behind another lane's suite on the shared lock and was stopped for the swap. left: run the test on main to show it fails; make the Rule 3 stamp in lanes-edit.sh rename-lane (~:14383) publish through a same-directory mktemp + cp -p + cat + mv -f, as publish-handoff does (~:16285), plus cleanup() removal of that temporary; rerun; open the PR; watch CI. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Publish rename-lane's Rule 3 handoff stamp through a same-directory temporary file and one atomic rename The stamp was written with `cat <stamped copy> > <handoff>`, and the redirect truncates the handoff before the first stamped byte lands: a writer killed inside that `cat`, or a machine that lost power there, left a handoff cut short that every later read took for the real one, and `rename_undo` -- a trap -- never runs on SIGKILL. The stamped bytes now go to an exclusive `mktemp` file beside the handoff in the physical directory it resolves to, take its mode with `cp -p`, and replace it with `mv -f`: `publish-handoff`'s own mechanics, inlined because that verb takes the lock this write holds. `cleanup` removes the temporary on every handled exit. The splice proof, the symlink refusals, the mutex and the rollback bookkeeping are unchanged. This makes the stamp atomic, not the rename: the four moves' crash recovery stays the separate question #158 names. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Start cleanup's three temporaries empty, so a variable exported into the environment never names a path cleanup removes `cleanup` runs on every exit and removes `pbh_tmp`, `rl_htmp` and `TMPD` by name, and none of them was set at top level: with `rl_htmp=<file>` exported, a read-only `canon-lane` deleted that file (the review of #212), and `TMPD=<dir>` made it `rm -rf` the directory. `pbh_tmp` and `TMPD` had the hole on main. They are now set empty before the trap is installed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Test that an in-place handoff in a read-only directory refuses with exit 5 and rolls back whole The one behaviour #158 changes on purpose: the temporary file beside the handoff needs its directory writable, where the in-place redirect needed only the file. f87fd5a stamped this case and exited 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Say in the handoff skill that rename's stamp is now atomic and the four-file rename is still not (#224) Co-Authored-By: Claude Opus 5.5 <[email protected]> * Start SE_CACHE_FILE empty too, and hold every path the exit and signal traps remove against an inherited value The audit #213's review asked for: `cleanup`, `rename_undo` and `release_lock` remove paths through `pbh_tmp`, `rl_htmp`, `TMPD`, `SE_CACHE_FILE`, `RL_SNAP`, `LANES_IDX_DIR`, `LANES_WT_IDX_DIR`, the `RL_*` undo paths and `LOCK`. All but `SE_CACHE_FILE` were set at top level before the trap once `pbh_tmp`, `rl_htmp` and `TMPD` were. `SE_CACHE_FILE` was first assigned at the state-event cache, so a signal before that line removed whatever it inherited. It now starts empty beside the other three, and the environment test exports a victim path under every one of these names. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Brett Heap <[email protected]>
…uest's test merge is against the current main Co-Authored-By: Claude Opus 5.5 <[email protected]>
…uest's test merge is against the current main Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
…86, so CI tests this PR on today's main Main moved past 2cb14a9 (#238, #240, #213 landed), and CI tests the PR's merge with main, so the condition below is tested on the main it will land on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… this PR on today's main No conflict: of the three commits since 2cb14a9, #238 and #240 touch only park, resume, status and their tests, and #213 touches lanes-edit.sh (managed_seam_refuse, managed_local_hint, managed_local_remedy, lane_trees_list and the managed-projection and lane-trees verbs), docs/README-lanes.md and tests/test_lane_helpers.sh (its managed-seam cases) only away from this PR's functions and hunks, and all three shared files merged as exactly main's version plus this PR's own change. Co-Authored-By: Claude Opus 5.5 <[email protected]>



Refs #157 (items 4a, 4c, 4d, 4e)
Items 1 to 3 of #157 need rulings from Brett and are left alone. Item 4b belongs to the #138 register-hardening PR. Lines under what was wrong are on main
f87fd5a, and lines of edited functions are on this branch.4a. An unpushed local marker reached
lane-start's transcript move: fixedWhat was wrong.
lane-start'sseam_refuse(lane-start:1505-1517), and the gates oflane-handoffandlane-end, asklanes-edit.sh managed-projection. That arm read the published row only (lanes-edit.sh:16616-16628,8) exit 8 ;;at:16626). Everylanes-edit.shwriter, throughmanaged_seam_refuse(:12089-12105), also reads this checkout's row (:12099-12104) and refuses vocabulary that only this copy carries. So with a marker committed here and not pushed, the gate passed and the launch went on until a later writer refused. The shell suite pinned the gap: case 6(c) attests/test_lane_helpers.sh:14547-14548expected8for exactly that register.The fix is the one the issue names: the arm answers 1 when this checkout's row carries the vocabulary and the published read says 8. The local check moved out of
managed_seam_refuseintomanaged_local_hint, so the arm and every writer ask one implementation. The arm's refusal names the register file it read and how to tell, and fix, either direction of the disagreement.lanes-edit.sh:managed_seam_refuse(now:12093-12104) calls the newmanaged_local_hint(:12106-12123). Themanaged-projectionarm's8)branch (:16645-16671) asks it. Both refusals end withmanaged_local_remedy's sentence (:12125-12135); see Review round below. The seam's header comment (:409-424) and the arm's exit list now carry the local case.tests/test_lane_helpers.sh:14538-14555: case 6(c) now asserts 1, the register file it read, and both remedies.docs/README-lanes.md: the managed-projection table's exit-1 row, and the paragraph after it, say thatmanaged-projectionreads both copies, so the three gates refuse what the writers refuse.A consequence:
lanes-indexasksmanaged-projectionfor itsownercolumn, so a lane whose register checkout carries an unpublished marker now indexes asunknownuntil that change is pushed or undone. That is fail-closed, andunknownis never carried over a later sync.4c. The manual's "a row that is not seven columns": fixed (wording)
The exit-1 row of the managed-projection table (
docs/README-lanes.md:3337on main,:3339here) now says "a row carrying the vocabulary that is not seven columns", the correction the issue asks for. The code comment atlanes-edit.sh:11905already lists it under vocabulary that does not parse, so it is unchanged. #97's PR body is a merged PR's and is not edited here.4d. A malformed local row with no vocabulary: no code change
Re-checked on main; the issue's reasoning holds. The published reader answers 8 for a row whose split fails and that carries no vocabulary (
lanes-edit.sh:11974-11975). The local check inmanaged_seam_refuseasks for the vocabulary only (:12099-12104). So the two copies agree that the lane is legacy, and a row with no vocabulary cannot be a marker. The writer that rewrites the row then refuses the shape itself:set-row-stateexits 2 at:13426.managed_local_hintkeeps that boundary on purpose, and its comment says why. The manual's exit-8 row now states it too.The new test pins both halves, and it also guards the 4a change against over-refusing. With a seventh separator committed only in this checkout and no vocabulary,
managed-projectionstill answers 8.set-row-statethen refuses with 2 and its separators message, not the seam's UNKNOWN, and changes nothing.4e. An unreadable
trees/directory read as no inventory: half fixed, half leftWhat was wrong.
lane_trees_list(lanes-edit.sh:12617-12662on main) checked[ -d trees ](:12621) and then globbed. A directory this process may not read or search yields an empty glob, so it answered 8, which means the lane recorded no tree.lane-treesexited 8 for it.lane-worktrees' sweep reads 8 as a lane with no inventory, and itsaddreads 8 as "no record yet, go on".Fixed here.
lane_trees_listreturns 10 whentrees/is there and is not both readable and searchable, the testworktree_rowsalready makes (:13184on main). Thelane-treesarm (now:16817-16832) exits 10 and names the directory. That is the codelane-statealready spends for a record that is there and could not be read. The exit table in the file's header (row 10,:514-526) and the manual's exit table and inventory section say so.lane-worktreesthen fails closed on the 10 with no change of its own. Its sweep refuses the lane as "a read failed, which is never an answer" for alane-treesexit other than 0 and 8 (lane-worktrees:550-552,:2028-2030), and itsaddrefuses anything but 0 and 8 (:5454-5458).Left, and why. The issue also asks for
lane-reconcile's verdict to becomeindeterminate. That needs two edits inlane_reconcile's tail:lane_trees_list's status where the loop is fed at:13001, which today drops it with|| :;lrc_drcblock (:13098-13101).Both are inside the region lane openRepoTools-3's branch
feat/triad-lane-toolingis rewriting. That branch adds its own T018 overrides at exactly that point. So that half is left for after that branch lands. With this PR the fix there is two lines: capture the status, and on 10 set the verdict toindeterminate.Review round (independent Opus review: LAND, with two low items taken)
The remedy wording. Both refusals of a disagreeing local copy,
managed-projection's andmanaged_seam_refuse's, assumed the copy was AHEAD of origin. They pointed atgit -C $LANES_REPO log origin/<branch>..HEAD, which misled in two cases:LANES_REPOset to a runtime clone and noLANES_WORKSPACE_ROOT, the file read is workspace.yaml's tree, while the command named the clone.Both refusals now print one sentence from
managed_local_remedy(lanes-edit.sh:12125-12135). It names the file actually read ($LANES_FILE), gives AHEAD with its remedy (publish the change or undo it) and BEHIND with its remedy (fast-forward), and gives thegit -C <dir> fetch && git -C <dir> status --short --branch -- LANES.mdthat tells which. The manual's exit-1 row (docs/README-lanes.md:3339) says the same. Two new cases cover it: a checkout behind such an origin, and a runtime clone, whose refusal names the workspace file and never the clone.Filed, not taken: #225. A control root that cannot be searched makes
[ -d <root>/trees ]false, one level above this PR's 4e check.lane-treesthen still answers 8, andlane-statedoes the same for its snapshot, solane-reconcilesaysno-state. That is not this PR's item, and its reconcile half shares 4e's left-over region.Tests
tests/test_deferred_97_findings_157.pyis new, and every case runs the reallane-startandlanes-edit.shin the lane-start sandbox (test_lane_start_claude_current.Sandbox). The sandbox uses a bare origin, a register clone, a fake tmux and a fake gh, and nothing reaches the network.managed-projectionover an unpushed localMANAGED OWNER · ledger-1answers 1 with no owner printed. The refusal names the register file read and both remedies.LANES_REPOpointed at a runtime clone, the refusal names workspace.yaml's register file and never the clone (review round).lane-startrefuses at its gate with 1 ("managed-projection repoZ-1exited 1 ... a lane start is refused here"). The register HEAD here and on origin, the status, the register bytes, the lane log, the Claude launch log and the tmux log are all unchanged.trees/is still 8.trees/at mode 000, 300 or 600 is 10, with the directory named and nothing printed on stdout. These cases are skipped as root, like the suite's other permission cases.At
076a0cb(before the review round), run locally under the shared lock, against a copy of mainf87fd5aand then against this branch, in one hold of the lock. The PR was opened while the first 20-minute wait for the lock ran out; the second wait got it at 19:00Z.The failures on main are the findings themselves:
managed-projection repoZ-1returned 8, where the test expects 1.lane-start repoZ 1exited 0, where the test expects 1. Its stderr ends with the launch line…/resolved/bin/claude --name repoZ-1 --session-id …: the launch went through to the end over an unpushed marker.lane-trees repoZ-1returned 8 for each of the three modes, where the test expects 10.At
2f690dc(the review round), this branch under the shared lock,flock -w 1800:The shell suite's case 6(c) (
tests/test_lane_helpers.sh) was not run locally. It is one slow test of the whole suite, and CI's Linuxtestsjob is the record for it.🤖 Generated with Claude Code
Summary by Sourcery
Make lane ownership and tree-inventory reads fail closed when local register state or inventory directories cannot be trusted.
Bug Fixes:
Enhancements:
Documentation:
Tests: