Repository navigation
test(owner-pin): a shared OwnerPinSyntax names each test's own covering macro site (#6967) - #6969
Conversation
…6967) #5416 names the macro binding behind a refused assertion for every (probe, related test, assertion), and the local-site lookup re-parsed the test's file on each call. A diff touching xtask's command catalog took `ripr check` from 52 s to over 15 minutes and timed out #6658's PR-evidence gate. The sites now come from a (name, test file) memo on OwnerPinSyntax, beside the existing workspace-site memo; they depend only on the name and the immutable index. The same input runs in 94 s. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q9Bgpf8hhaUiZESbgRnEvG
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Review of record: head fb1c68aThe production diff is byte-identical to the
Proof:
Disposition: ready. This merges once the required check is green on this head. Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Limit details: You’ve used all 10 included reviews currently available. Summary by CodeRabbit
Walkthrough
ChangesTest-file macro scan cache
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No issue requiring a change before merge was identified. Merge after the normal checks pass. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the test and reports proof, but it says the PR contains only a test and no production change. The file summary includes a production memo change, and the objectives describe that memo as part of the PR. The description also omits several template sections, including candidate relationships, rollback, claim boundary, traceability, and engineering checks. Resolution Align the description with the actual changes: clarify whether the production memo is included or already landed, and update the scope and acceptance delta accordingly. Complete the relevant template sections, especially Candidate Relationships, Scope, Claim Boundary, Rollback, Spec-Test-Code Traceability, Engineering Check, and Gates. Mark CI Economics as
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
A rabbit checks each macro trail, Comment |
…ring site Two inline modules rebind assert_eq! at different lines; the memoized lookup must pick the site covering each test, matching a fresh OwnerPinSyntax (Devin review on #6969). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q9Bgpf8hhaUiZESbgRnEvG
Codex Review SummaryThis 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. |
…regression test Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q9Bgpf8hhaUiZESbgRnEvG
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Return-path now clones the site tuple (site.clone()) because the memo stores Vec values; this is a small extra allocation per refusal but is bounded by memo cardinality.
Refuted
- Memo caches the selected site per (name, file), causing both tests to see the same line.; refuted because: Memo value is Vec<(String, MacroBindingSite)>; the per-test site_covers filter runs after the lookup, so each test gets its own covering site. The new test would fail if this were true.
- Memo is keyed by (name, file) so per-test site_covers filter still runs per call - test should be red on old code and green on new; refuted because: Existing 69 owner_pin tests + new shared-syntax test still pass; old behavior would re-parse but produce same site, so the test alone cannot distinguish old vs new by outcome - the distinction is performance, asserted by bisect/timing in PR body, not by the unit test.
- RefCell re-entrancy or borrow panic because the memo closure touches self/OwnerPinSyntax; refuted because: closure captures only index-derived data; module_resolved reads OnceCell resolved_modules, not the new RefCell; or_insert_with is a one-shot miss path.
- The memo closure could borrow the memo recursively and panic via RefCell.; refuted because: Closure only calls macro_binding_sites with name, file, facts.source, index, module_resolved; memo is not captured. The existing workspace_macro_sites memo on the same struct uses the same pattern without issue.
- Closure inside
or_insert_withonly readstest.file.sourceviaindex.files(), plus puremacro_binding_sitesargs (name, file, source, index, module_resolved) — it never re-entersselformemo, so no RefCell aliasing and no cross-test contamination possible. Memo is keyed on (name, file) so different test files never share entries.
Evidence gaps
- PR-body timing claim (94 s vs >15 min) and unchanged-verdict claim (#6658 corpus 204 rows) are not reproducible in this lane; cargo-test receipt is scheduled-late.
- Model proof intent was rejected by deterministic validation.
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- PR is test-only and reviews rely on seeded thread's byte-identical claim about the production change in #6658. Without cargo-test receipt yet (scheduled-late), green-on-PR cannot be independently verified.
Verification questions
- Confirm test source string has assert_eq! rebinds at lines 3 and 9 when interpreted as a full Rust file; need to confirm site line semantics match the indexed-file view used by macro_binding_sites.
Refuted
- Test distinguishes old vs new: shared OwnerPinSyntax across two inline modules must return distinct sites (3 and 9); a file-only or single-site cache would collapse to one line and fail.
- Test cannot distinguish old from new because old behavior would also produce the same sites; refuted because: The memo value is Vec<(String, MacroBindingSite)> per (name, file); site_covers filters after lookup, so each test gets its own covering site. Old code without memo would still resolve the same sites per test - so the test by outcome alone does not separate old vs new. However, the PR body explicitly states the distinction is performance (bisect/timing), not unit-test outcome; the unit test is a regression guard against a wrong memo key, which is exactly what it asserts.
- Shared OwnerPinSyntax memo caches the selected site per (name,file), so both tests get the same line; refuted because: macro_binding_sites returns the full Vec per (name,path) lookup; equality_assertion_refusal filters via site_covers per call after the memo. The new test asserts lines == [3,9], which a per-file cache would fail.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Review of record (update): head 35714ff#6658 landed the memo on main (2045792) with byte-identical production code. Merging main into this PR leaves one change: the regression test
Disposition: ready. Merging. This closes #6967. Generated by Claude Code |
Summary
Before: #6658 landed the test-file macro-site memo for #6967 on main (2045792). No test checked that one shared
OwnerPinSyntaxstill gives each test its own coveringassert_eq!rebinding site once the per-file sites are memoized.After:
a_shared_owner_pin_syntax_names_each_tests_own_covering_sitebuilds one test file with two inline modules, each rebindingassert_eq!(lines 3 and 9). It checks that a sharedOwnerPinSyntaxreturns the same refusals as a fresh one per test, and that the sites are lines 3 and 9. A memo that cached the selected site per (name, file) instead of the whole site list would fail it.This PR first carried the memo itself so main would be fixed even if #6658 slipped. #6658 merged first with the identical change, so the merge of main leaves only the test.
Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Governing issue: #6967
Acceptance delta (one sentence): the memo's per-test site selection has a regression test.
Scope Classification
Non-goals: no production change.
Support-tier Impact
Proof
cargo test -p ripr --lib owner_pin: 70 passed (69 plus the new test).cargo xtask precommitpasses.cargo xtask verdict-corpus check-allreports no drift (204 cases).Closes #6967.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Q9Bgpf8hhaUiZESbgRnEvG