Skip to content

fix(seams): mirror current legacy walker in bounded inventory (arity + twin filter) - #7151

Merged
EffortlessSteven merged 1 commit into
mainfrom
fix/main-seam-inventory-arity
Oct 8, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
fix/main-seam-inventory-arity

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Closes #7150.

Production delta (crates/ripr/src/analysis/seam_inventory.rs, single file, 47+/2-)

c60f1ca (squash of #6836) landed a bounded walker written against the Oct-5 tree: a stale 3-arg build_seam_from_shape call against the current 5-arg definition (E0061 — main does not compile) and a missing error_path_twins filter (bounded path would retain seams the legacy oracle never emits). This mirrors the current legacy walker shape-for-shape: empty-shapes skip, per-file line index, twin computation + skip, 5-arg construction call.

Evidence delta

New oracle test bounded_matches_legacy_on_error_path_twins: error-path fixture asserting twins exist (non-vacuous) and bounded == legacy at None/full/K=1 limits.

Acceptance

Proof run

cargo check -p ripr --lib (Finished 1m05s)
cargo test -p ripr --lib seam_inventory (102 passed)
cargo test -p ripr --lib repo_exposure (103 passed)
cargo test -p ripr --lib classification (41 passed)
cargo test -p ripr --lib bounded_matches_legacy_on_error_path_twins with filter removed (FAILED as required)
cargo fmt --check -p ripr (clean); cargo clippy -p ripr --lib (no warnings)

Head: 05edf03. Rollback: revert this commit (main stays red without it). Non-goals: no discovery/classification meaning change, no collector redesign.

…+ twin filter)

c60f1ca squash-merged a stale bounded copy: 3-arg build_seam_from_shape call against the 5-arg definition (E0061, main does not compile) and a missing error_path_twins filter (bounded path would retain seams the legacy oracle never emits). Mirror the current legacy walker shape-for-shape and pin twin parity with bounded_matches_legacy_on_error_path_twins (fails without the filter).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T09:26:27.966132Z 05edf03 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Author self-review on exact head 05edf03 (COMMENT is the disposition record, not approval).

reviewed_head_sha: 05edf03
integration_basis: origin/main c60f1ca (broken base; this PR is the repair)
claim_boundary: #7150 only — restore compilation + twin parity in the bounded walker. No discovery/classification meaning change, no collector redesign.
changed_surfaces_inspected: full diff (seam_inventory.rs 47+/2-); legacy seams_from_index_files 2484-2512 vs bounded 2645-2685 line-compared; error_path_twins contract (rust_index.rs 255-304); new oracle test.
blocking_findings: none.
verification:

  • Root cause confirmed, not inferred: E0061 reproduced from the gate log (2667 call vs 2689 def) and re-verified in the base tree; cargo check Finished post-fix.
  • Mirror fidelity: per-file body now matches legacy statement-for-statement (empty skip, owner lookup, line index, twins zip + skip, 5-arg call); only the sink differs (collector.push vs seams.push), which is the claimed delta. build_line_starts already imported (line 36).
  • Oracle grip: twin test asserts twins exist in-fixture (failed-vacuous impossible) and bounded == legacy at 3 limits; filter-removal mutation FAILS the test (observed), filter present passes.
  • Suites: seam_inventory 102/102, repo_exposure 103/103, classification 41/41; fmt + clippy clean.
    proof_or_review_missing: exact-head hosted gate (just marked Ready).
    residuals: none new; #4997 correction posted. Main-red urgency noted: every merge-ref gate is red until this lands.
    disposition: REVIEW_INCOMPLETE until exact-head Ripr Rust Small Result succeeds.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates inventory_seams_from_index_bounded in crates/ripr/src/analysis/seam_inventory.rs to filter out error-path twin shapes, aligning its behavior with the legacy walker. It also optimizes performance by building the line index once per file and reusing it when deriving spans for each shape. Additionally, a unit test has been added to verify that the bounded walker correctly drops these twin shapes. There are no review comments, so I have no feedback to provide.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 695f5e88-d270-4376-be3f-4e5e883f5ba7
📥 Commits

Reviewing files that changed from the base of the PR and between 551456d and 05edf03.

📒 Files selected for processing (1)
  • crates/ripr/src/analysis/seam_inventory.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.


Summary by CodeRabbit

  • Bug Fixes
    • Bounded seam inventories now exclude duplicate twin probe shapes, matching legacy inventory results with or without limits.

Walkthrough

The bounded seam inventory now skips error-path twin shapes before constructing seams. A regression test compares bounded results with the corresponding legacy inventory results under multiple limits.

Changes

Bounded inventory parity

Layer / File(s) Summary
Twin filtering and parity test
crates/ripr/src/analysis/seam_inventory.rs
The bounded walker skips shapes flagged as twins before seam construction. The regression test compares its results with the legacy inventory for unlimited, full-count, and one-seam limits.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 05edf

The bounded inventory change appears aligned with the legacy behavior, with no specific merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 3 | ❌ 1 | ❓ 1

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the production change, test evidence, acceptance status, non-goals, and rollback. However, it omits most required template sections, including source boundary, source-of-truth… Complete the repository template. Add the missing required sections and record applicable values, use n/a where appropriate, and list the status of each relevant gate. Also document the source boundary, relationships to other PRs, traceab…
Linked Issues check ❓ Inconclusive For #7150, the reported change adds the twin filter, the five-argument build_seam_from_shape call, the line index, and the empty-shape skip. The new non-vacuous oracle test compares bounded and lega… Provide reviewable evidence that cargo check -p ripr passes at the reviewed head, without the --lib restriction.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The reported pull request changes only crates/ripr/src/analysis/seam_inventory.rs. The changes implement the #7150 bounded-walker parity fix and its regression test. No unrelated discovery, classifi…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files.
Title check ✅ Passed The title clearly identifies the main change: aligning the bounded seam inventory with the legacy walker by fixing argument arity and adding twin filtering.
Full details: Linked Issues check

Explanation

For #7150, the reported change adds the twin filter, the five-argument build_seam_from_shape call, the line index, and the empty-shape skip. The new non-vacuous oracle test compares bounded and legacy inventories at the stated limits. The reported suite, format, and clippy checks support the remaining coding requirements. However, the proof run records cargo check -p ripr --lib, while the issue requires cargo check -p ripr; the evidence does not establish that all package targets compile.

Full details: Description check

Explanation

The description explains the production change, test evidence, acceptance status, non-goals, and rollback. However, it omits most required template sections, including source boundary, source-of-truth links, candidate relationships, scope classification, support-tier and policy impact, claim boundary, traceability, static language check, engineering check, and gate statuses.

Resolution

Complete the repository template. Add the missing required sections and record applicable values, use n/a where appropriate, and list the status of each relevant gate. Also document the source boundary, relationships to other PRs, traceability from specification to tests and code, claim limits, and policy or support-tier impact.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the seams in rows,
And skips the twins before they grow.
With limits set, it tests each view,
Against the legacy inventory, too.
Then hops away with parity true.

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • Sibling-path coverage limited to seam_inventory.rs in this diff; no other inventory_*_bounded or collector-push sites were changed. Within PR scope the bounded walker is the sole site.

Verification questions

  • Confirm new oracle test bounded_matches_legacy_on_error_path_twins asserts non-vacuous fixture (twins.contains(&true) guard) and parity at 3 limits (None/full/K=1). Mutation test (filter removed) FAILS as required - test is load-bearing for the contract, not decorative.

Refuted

  • The oracle test bounded_matches_legacy_on_error_path_twins could pass vacuously if the fixture yielded zero twins; refuted because: Test explicitly asserts if !twins.contains(&true) and returns an error otherwise, so a vacuous pass is impossible.
  • Line-starts hoisting belongs in a dedicated helper or further up the call chain to avoid per-file recomputation when many files share a source map.; refuted because: Further hoisting would require sharing source bytes across FileFacts (ownership change) or a global cache keyed by file path (introduces statefulness and invalidation surface). Per-file computation is the correct boundary given Facts<'a> borrows; recomputation cost is bounded by file count, not shape count, and the prior per-shape cost was strictly worse.
  • Twin filter is a behavior change beyond parity (adds new filter not in legacy); refuted because: Twin filter is explicitly mirrored from legacy; error_path_twins contract is the legacy walker contract; removing it is what changes parity (mutation-verified).

@EffortlessSteven
EffortlessSteven merged commit 5b6e1c1 into main Oct 8, 2026
37 of 40 checks passed
@EffortlessSteven
EffortlessSteven deleted the fix/main-seam-inventory-arity branch October 8, 2026 10:21

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW_READY — exact-head review of 05edf03fa (main-red repair; gate green, 0 threads).

  • Production hunk mirrors the legacy walker line-for-line: probe_shapes.is_empty() early-continue, per-file build_line_starts(&facts.source), error_path_twins + skip, 5-arg build_seam_from_shape. I independently derived the same fix from reading the legacy walker (:2489-2511) before this PR surfaced — the two match exactly.
  • Oracle (live, non-vacuous): bounded_matches_legacy_on_error_path_twins asserts the fixture yields a twin, then bounded==legacy at 3 limits; without the filter the twin seam would fail the equality.
  • Fail direction: compile fix (no behavior choice); the twin filter only drops seams the legacy oracle never emits (parity direction, covered by the pre-existing bounded_unlimited_equals_legacy_exactly family plus the new test).

Merging on the green required gate to un-red main.

cursor Bot pushed a commit that referenced this pull request Oct 8, 2026
Candidate-head rust compile was blocked by the inherited 3-arg
build_seam_from_shape call. #7151 landed that repair on main; this
lane stays test-only.

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
EffortlessSteven added a commit that referenced this pull request Oct 8, 2026
seam_inventory bounded loop: take main's #7151 loop head (the twin filter
and its comment); the shared 5-argument build_seam_from_shape call with
the per-file line index already converged from both sides.

Local proof on the merged tree: cargo build --bin ripr 0 errors; fmt
--check clean; clippy -p ripr --all-targets -D warnings clean; cargo test
-p ripr --lib classify + seam_inventory + classifier + proximity = 945
passed; helper_wrapper_reach 19 passed; cargo xtask goldens check exit 0;
cargo xtask verdict-corpus check exit 0 (350 cases, 67/350 false
verdicts, 2/454 contradictions); policy cascade (no-panic-family,
process-policy, allow-attributes, static-language, executable-files,
network-policy, lint-policy) all exit 0.
EffortlessSteven added a commit that referenced this pull request Oct 8, 2026
…; keep both sides

Conflicts in 3 files, all append-adjacent: traceability.toml (keep PR test entry + 4 main entries), RIPR-SPEC-0222 (same), store.rs thread-locals (keep LOCK_WAIT_OVERRIDE + PLAN_MODEL_MISMATCHES + MODEL_SKEW). No semantic choice; PR lock code intact. Local proof deferred: main is red until #7151 lands.
EffortlessSteven added a commit that referenced this pull request Oct 8, 2026
…precisely

cache gc collected every regular file including <stem>.lock, so TTL/size deletion could unlink a held lock and let a second writer lock a fresh inode at the same path (Devin BUG + CodeRabbit threads). Exclude .lock files under either sharded layer from both selection sites, with the layer half matched against the shared producer inventory. Regression test pins both layers. Also replace trim_end_matches(.json) with strip_suffix at both lock-name sites (Gemini low); behavior-identical on hex-digest filenames, so no dedicated test. STAGED: unpushed, proof deferred until main is green (#7151).
EffortlessSteven added a commit that referenced this pull request Oct 8, 2026
After #7151 repaired main, the toggle-only re-route of #6686 still tested a pre-fix merge ref. Record the push-to-refresh rule and the ancestry check.
EffortlessSteven added a commit that referenced this pull request Oct 8, 2026
…ication (#5350) (#6782)

* fix(cache): hold a per-key advisory lock across classified-cache publication (#5350)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LDXUGxuP9Eo5X9tkRcuteG

* fix(cache): keep publication locks out of GC; strip lock-name suffix precisely

cache gc collected every regular file including <stem>.lock, so TTL/size deletion could unlink a held lock and let a second writer lock a fresh inode at the same path (Devin BUG + CodeRabbit threads). Exclude .lock files under either sharded layer from both selection sites, with the layer half matched against the shared producer inventory. Regression test pins both layers. Also replace trim_end_matches(.json) with strip_suffix at both lock-name sites (Gemini low); behavior-identical on hex-digest filenames, so no dedicated test. STAGED: unpushed, proof deferred until main is green (#7151).

* fix(cache): propagate competing-publish error instead of expect in race test

Strict clippy (-D warnings) rejects expect() in the publication race test added for the Devin ANALYSIS thread. Capture the competing status Result in the shared cell and transpose it outside the commit hook so a real error fails the test with its message. Proof: publication suite 8/8, seam_cache 147/147, xtask cache 15/15, clippy clean, fmt clean.

* docs(6782): record commit-window race test in SPEC-0222 test mapping and traceability

---------

Co-authored-by: Claude <noreply@anthropic.com>
EffortlessSteven added a commit that referenced this pull request Oct 8, 2026
…ck (#7150) (#7153)

* docs(learnings): stale-basis squash needs a combined-tree compile check (#7150)

* docs(learnings): re-route toggles do not refresh the merge ref (#6686)

After #7151 repaired main, the toggle-only re-route of #6686 still tested a pre-fix merge ref. Record the push-to-refresh rule and the ancestry check.

* docs(learnings): grammar and epistemic precision on the merge-ref rule (#7153 review)

Comma after By merge time (Gemini); drop the unsupported only-a-push exclusivity claim while keeping the verified push-recomputes behavior (CodeRabbit).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main does not compile: stale bounded-inventory mirror (E0061) plus missing twin filter after #6836

1 participant