Repository navigation
The inventory tests' norm takes the sandbox root out before the tree-id and pid rules, so a TMPDIR with a c<digits>- segment no longer fails two tests (opensoft/openRepoTools#334) - #24
Merged
Conversation
…e-id and pid rules, so a TMPDIR with a `c<digits>-` segment no longer fails two tests (opensoft/openRepoTools#334) Test-only: `Inventory.norm` in `tests/test_lanes_index.py` is the one function changed, plus one new parametrized test. No product code and no golden file changes. ## What was wrong `norm` applied `TREE_ID` to the whole answer before it took out the sandbox root. A root whose own path holds a segment `TREE_ID` matches, such as `rv-c302-309-work` (a review folder), was cut up first (`rv-<TREE>`), so no root was left to take out, and the two tests that compare one sandbox's answer with another's failed for no reason but the folder the suite ran from: `test_offline_no_read_the_inventory_acts_are_byte_identical_against_an_unreachable_index` and `test_a_poisoned_worktrees_table_changes_no_inventory_acts_answer`. The pid rule also ran before the root was taken out, so a root with the live session's pid as a segment had the same fault. ## What changed `norm` takes the root out first, as resolved and then as given, and only then applies `TREE_ID` and the pid rule; `normal` follows as before and is no longer handed the root, which is already out. `test_norm_takes_the_sandbox_root_out_before_any_rule_that_could_cut_it_up` writes one answer under four roots (a plain one; one holding `rv-c302-309-work`; a link whose target holds it, so the segment is in the resolved path alone; one with the pid as a segment) and requires the same text from each. ## Port This ports commit `77ff7bf` (`77ff7bfc6db9f705a98f13285cf63cb235422148`, branch `fix/334-norm-replaces-root-first` in the monorepo opensoft/openRepoTools) onto the code leg's `main` at `86d635b`. The diff applies unchanged: `tests/test_lanes_index.py`, +72/-3. ## To reproduce opensoft/openRepoTools#334 Run the inventory tests from a TMPDIR whose path holds a `c<digits>-` segment, for example `mkdir -p /tmp/rv-c302-309-work` and then `TMPDIR=/tmp/rv-c302-309-work bash tests/run.sh -k test_lanes_index`: the two tests named above fail on `main`'s `norm` (called directly, as `77ff7bf` recorded) and pass with this change. The new parametrized test also fails on `main`'s `norm` for the three roots that hold a rule's match, and passes for all four with this change. Lane: openRepoTools-3 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reviewer's GuideTestsChange
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
brettheap
marked this pull request as ready for review
November 10, 2026 12:33
|
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 5 hours by commenting |
This was referenced Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Lane: openRepoTools-3
Claim: opensoft/openRepoTools#334 (comment)
Draft: needs an independent review before it lands (opensoft/openRepoTools#334 says so).
The defect
Inventory.normintests/test_lanes_index.pyappliedTREE_IDto the whole answer before it took out the sandbox root (on codemain86d635b, lines 1783-1785). A root whose own path holds a segmentTREE_IDmatches, such asrv-c302-309-work, was cut up first (rv-<TREE>), so no root was left to take out. Two tests that compare one sandbox's answer with another's then fail for no reason but the folder the suite ran from:test_offline_no_read_the_inventory_acts_are_byte_identical_against_an_unreachable_indexandtest_a_poisoned_worktrees_table_changes_no_inventory_acts_answer. The pid rule also ran before the root was taken out, so a root with the live session's pid as a segment had the same fault. CI is unaffected, because its path has noc<digits>-segment.The fix
normnow takes the root out first (as resolved, then as given), then appliesTREE_ID, then the pid rule, thennormal(text)(no longer handed the root, which is already out). New testtest_norm_takes_the_sandbox_root_out_before_any_rule_that_could_cut_it_upwrites one answer under four roots (plain; arv-c302-309-worksegment; a link whose target holds that segment; the pid as a segment) and requires the same text from each. Test-only:tests/test_lanes_index.py, +72/-3, one commit.Port source
This ports commit
77ff7bfc6db9f705a98f13285cf63cb235422148(77ff7bf, branchfix/334-norm-replaces-root-firstin the monorepo opensoft/openRepoTools, never PR'd) onto codemain86d635b778c9943a8d6a8b3d785080800cc48e4a. It was applied withgit cherry-pick -nand applied cleanly, with no hand edits: the diff is the same hunks.Verification
Narrow run on this branch (head
06102a4), underTMPDIR=/tmp XDG_STATE_HOME=/tmp/l3-334, astimeout 3600 bash tests/run.sh -k 'test_lanes_index':That run's TMPDIR has no
c<digits>-segment, so it shows the change breaks nothing and that the new test passes; it does not by itself show the fix. I did not rerunrun.shunder a TMPDIR holding such a segment. The old-versus-new difference is the probe below, which runs a COPY ofInventory.normextracted byastfrom86d635b's file and from this branch's file, over one answer written under a plain root and under a rootrv-c123-work/root.$SBstands for the sandbox directory.Under the
c123-root the oldnormleaves the root in the text (rv-<TREE>, and itswk-334-<HEX>folder name cut by the hex rule) and the two answers differ. The newnormreturns the same text from both roots.🤖 Generated with Claude Code
Summary by Sourcery
Fix inventory normalization so equivalent answers remain identical regardless of the sandbox root path.
Bug Fixes:
Tests: