Repository navigation
fix(analysis): contain a panic in the seam-evidence shared-table warm (#11524) - #12001
Conversation
…#11524) A panic while EvidencePass primes the workspace macro scan, unseen-reach names or type-mention index is caught. The pass then answers every seam with an opaque stand-in (no related test, discriminator or repair signal) and never reads the possibly-incomplete memos. The payload is dropped. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzQvtpKrgEnbdSoyCd8
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 4 minutes. View limit details
CodeRabbit Verify
|
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head e160739): REVIEW_INCOMPLETE
Inspected:
- Head
e160739a22842b6e8bcab31369d1e893e15a14a5against basea69bf0214f7bd7e0537a1cdd07e95608e5a366e8; one commit, three changed files:crates/ripr/src/analysis/test_grip_evidence.rs+144/-23,crates/ripr/src/analysis/test_grip_evidence/tests/warm_entrypoint.rs+69/-0,changelog.d/11524-seam-warm-panic.md+6/-0. Read via RESTpulls/12001/files(3 files, under the 300-file truncation floor). Contribution figures: PR-reported additions=219 deletions=0 across 3 files; the true contribution against the current base tip is the same 242 lines across 3 paths, 0 lines inherited from main - well under the admission action's 3000-line / 160-file refusal. - Read
crates/ripr/src/analysis/test_grip_evidence.rswhole at this head (181933 bytes) and the new test file, so that the containment mechanism, the fault-injection point and the memo-sharing question could be checked rather than assumed. - The semantic owner is
EvidencePassintest_grip_evidence.rs; the consumers areevidence_for_seams(:279) and the per-seam entryevidence_for_seam(:539). Ran the content-based duplicate check against the other five PRs in this batch: #12001 isDISJOINTfrom every one, so there is no sibling claim to reconcile. - Checked the mechanism.
warm_shared_tables(:488) wraps the warm incatch_unwindinsidestd::sync::Once::call_once, so the panic is caught before it can escape the closure andOncecompletes normally rather than being poisoned - a panic escapingcall_oncewould make every later call panic again, and this placement avoids that.evidence_forcheckswarm_failedafter the warm and before the parallel stage loop, so no seam of that pass reaches the memos.EvidencePass::new(:311) builds its ownCompactGripContext::try_new(index).ok(), so the memo tables are owned by the pass and no other pass can read a half-populated one - the "the possibly-incomplete memo is never read" half of the acceptance delta holds by structure. The stand-in uses the conservative vocabulary the product contract requires: all five stagesStageState::OpaquewithConfidence::Low, empty related tests, empty missing discriminators and no new-test target, which classifies asopaqueand so is not headline-eligible.Orderingis already imported at:73, so the newOrdering::Acquire/Ordering::Releaseuses resolve, andresume_unwindis not in the gate's forbidden set (xtask/src/no_panic.rs:191-203listsunwrap(,expect(,panic!,todo!,unimplemented!,unreachable!only), socheck-no-panic-familywill not flag the injection.
Blocking:
- None. The containment is correctly placed, the fail-closed stand-in is conservative and non-actionable, and the panic payload is kept out of the serialized evidence.
Non-blocking:
- The named test does not exercise the scenario the acceptance delta names. The fault injection sits at
test_grip_evidence.rs:507, immediately before the three memo-filling calls at:513(prime_pin_syntax_scan),:519(unseen_reach_names) and:525(type_mentions). So in the armed run the panic happens before any memo is populated, and "the possibly-incomplete memo is never read" cannot be distinguished from "the memo was never populated". The fix satisfies the claim because the flag check precedes the stage loop, but the test named in the body does not prove it: a wrong implementation that returned the stand-in only when the warm had populated nothing would pass this test and still mis-handle a panic between:513and:519. A second injection point - afterprime_pin_syntax_scanand beforeunseen_reach_names- would make the oracle discriminate the case the delta actually claims. - The typed limitation is
#[cfg(test)]and, once it is surfaced as the body intends, its shape does not scale.incomplete_evidenceinsertsseam.file()for every seam it answers, soincomplete_filesends up holding the file of every seam in the pass, not the file whose warm failed; the limitation it builds is therefore oneproducer_failurelimitation per file in the pass, each carrying the same "seam evidence stopped on an internal error" detail. The new test assertslimitations.len() == 1, which holds only because the thousand-seam fixture is one file (src/values.rs); on a real workspace with hundreds of files the same code path would produce hundreds of identical limitations. The follow-up that surfaces this should decide the cardinality deliberately - one limitation for the pass, naming the affected scope - rather than inheriting a per-file loop that only looks right under a one-file fixture. - In a non-test build
incomplete_filesis written and never read: the only reader is the#[cfg(test)]producer_failure_limitations. That is a write-only collection in production, and the path it records (the file of every seam in the pass) is not the attribution a user would need. TheMutex<BTreeSet<PathBuf>>is the right shape for the eventual surface, but collecting per-seam files for a pass-wide failure is work whose result does not carry the information it appears to. - The payload is kept out of the findings, but the panic hook has already run by the time
catch_unwindreturns, so the default hook still prints the panic message - and its text - to the process's stderr. The doc comment's reason for dropping the payload, "it can quote repository text", therefore holds for the serialized evidence only, not for the process output. If the point is to keep repository text out of what the run emits, the hook would need suppressing or the message scrubbed; if the point is only the findings surface, the comment should say so, because as written it reads as a broader guarantee than the code makes.
Efficiency:
- Neutral in the steady state, with one bounded cost added on the failure path.
catch_unwindadds a closure and a landing pad around the warm, which runs once per pass, so the overhead is constant and unmeasurable against a whole-index table build. The fail-closed path replaces the parallel per-seam stage loop with a single-threaded map over the seams, which is strictly cheaper than the work it replaces. Two costs are newly reachable and both are bounded:incomplete_evidenceholds theincomplete_fileslock across the whole map and allocates aPathBufper seam for theBTreeSet::insert, so the failure path costs one allocation and one set insert per seam - 1000 for the fixture - and the set itself grows only to the number of distinct files. No loop, scan or structure changes growth rate, there is no new process, I/O or cache, and thecatch_unwindwrapper does not make any previously short-circuited computation run.
Not run:
- The Rust toolchain on this host is not on
PATH, socargo test -p ripr --lib warm,cargo xtask precommit,cargo xtask check-no-panicandcargo xtask check-changelog-fragmentscould not be run locally. The body's "71 passed" forcargo test -p ripr --lib warmand its uncontained-control experiment are therefore read, not reproduced here. - The body's own gap list is accurate and I confirmed the mechanism behind its first item:
check-process-policyfails on the orphanedcrates/ripr/src/output/first_pr/run_chain.rsallowlist row foruse std::process::Command, which is the main-red PR #11975 addresses under #11720. This PR touches nopolicy/file and nothing undercrates/ripr/src/output/first_pr/, so it cannot cause or cure that failure; becauseprecommitstops there, Clippy and the gates after it did not run locally and there is no local evidence for them either. - There is no hosted Rust evidence on this head, and the absence is structural rather than a red lane. This PR carries no
merge-readylabel, and the Rust qualification workflow triggers only onpull_request: types: [labeled]with that label required by its route job, so no Rust lane was ever requested. The head's check-runs contain noRipr Rust Small Result/Rust gates/ci-resultentry - the required check is absent rather than red - and every Rust lane present reportsskipped. This PR is also a draft, so it can never beREVIEW_READYas it stands, and the strict-workspace-Clippy lane in particular has never run against the new#[cfg(test)]reader ofincomplete_filesor the newcatch_unwindblock. - I did not execute the new test, so the 1000-seam fixture's cost and the classification assertions are read from source. I also did not verify the
AnalysisLimitation::new/with_detail/with_patherror paths attest_grip_evidence.rs:339-383, where a failedwith_pathis deliberately swallowed and the limitation kept without a path - that fallback is readable but untested here.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head e160739a22842b6e8bcab31369d1e893e15a14a5. Not an approval.
…ted (#11524) Add a second injection point between prime_pin_syntax_scan and the remaining tables so the oracle distinguishes "memo never read" from "memo never populated", and state the pass-wide scope of incomplete_files and the payload guarantee in comments. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzQvtpKrgEnbdSoyCd8
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm the implementation and changelog claim every seam of the pass fails closed, but the scope is not enforced at the EvidencePass boundary for all possible callers or lifetime semantics.
Parked follow-ups
- The typed producer_failure limitation is explicitly cfg(test)-only, while the PR body says the seam walk has no analysis-outcome channel and names this as a follow-up.
- The typed producer_failure limitation is exposed only under cfg(test), while production consumers receive the named opaque stage summary; this is an acknowledged follow-up rather than a new defect.
- The PR body acknowledges that producer_failure_limitations is test-only, so the typed limitation is not yet available in user-visible outputs. This is a scoped follow-up rather than a correctness defect in the fail-closed behavior.
Evidence gaps
- Exact-head execution evidence for the changed Rust behavior is not available because cargo-test receipt is absent and the ripr sensor failed with exit code 2.
- The package test suite was scheduled but no completion receipt is present, so the claimed 71-test pass is not independently established by available evidence.
- Model proof intent was rejected by deterministic validation.
- The shared-table panic is contained and all seams fail closed, but the exact-head cargo-test receipt is absent while the ripr sensor failed.
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head 13b7c80): REVIEW_INCOMPLETE
Inspected:
- Head
13b7c804c3726f73854a10a2dc449f0612c3e667vs basea69bf0214f7bd7e0537a1cdd07e95608e5a366e8(currentmain); two commits (e160739a2"fix(analysis): contain a panic in the seam-evidence shared-table warm...", then head13b7c804c"test(analysis): cover a seam warm panic after the scan memo is popula..."); three files, +250/-23:crates/ripr/src/analysis/test_grip_evidence.rs+154/-23,crates/ripr/src/analysis/test_grip_evidence/tests/warm_entrypoint.rs+90/-0,changelog.d/11524-seam-warm-panic.md+6/-0 (new). REST core quota was exhausted, so the diff was reconstructed from head and base blobs and diffed locally; metadata came from GraphQL. - Sources read at this head:
crates/ripr/src/analysis/test_grip_evidence.rs(EvidencePass,warm_shared_tables,incomplete_evidence,producer_failure_limitations,SEAM_EVIDENCE_INCOMPLETE) andcrates/ripr/src/analysis/test_grip_evidence/tests/warm_entrypoint.rs. Policy read:xtask/src/no_panic.rs:191(forbidden_panic_patterns),changelog.d/README.md:25-29. - This supersedes my earlier review on head
e160739a2; that review is bound to the old head. - Check-runs on this head: every Rust-relevant lane present is
skipped(ci-result,rust-tests-junit,rust-coverage,future-clippy,msrv,windows-advisory,windows-advisory-subset,macos-advisory,cargo-deny,dependency-review,ranking,source-identityand others);ub-reviewwas still IN_PROGRESS. Only the Python/wheel lanes,workflow policy and wheel applicability,Python package source contract, GitGuardian, CodeRabbit and the AI-review bots completed.
Blocking:
- None found. The containment mechanism is sound, and the new head closes the gap I raised on the earlier head.
Non-blocking:
- The new head closes the gap I flagged on
e160739a2: the earlier injection fired before any memo was built, so the test never exercised a partially-populated memo. Injection point 2 now fires aftercontext.prime_pin_syntax_scan()has populated the macro-site scan memo and beforeunseen_reach_names()andtype_mentions(), and the new testa_warm_panic_after_the_scan_memo_is_populated_fails_every_seam_closedassertscontext.workspace_scan_passes() >= 1before checking the stand-ins, so the partial-memo state is proven rather than assumed. Point 1 still fires before any table is built and assertsworkspace_scan_passes() == 0, so both ends of the range are covered. - The containment is still correct in the ways that matter. The panic is caught inside the closure passed to
Once::call_once, so the closure returns normally and theOnceis not poisoned;warm_failedis set only when the caught result is an error, and the flag is checked after the warm call and before the parallel seam walk, so no seam reads a possibly-incomplete memo. The flag is checked outside theseams.len() >= WARM_MIN_SEAMScondition, so a later smaller stage on the same pass also gets the stand-in - and the test asserts exactly that withpass.evidence_for(&seams[..10]). The stand-in path namesseam_evidence_incompleteon every stage, leaves related tests, missing discriminators and the new-test target empty, and the test checks the classification comes outSeamGripClass::Opaque, so the fail-closed direction is the one that produces no repair candidate. - The payload handling is explicit and tested. The panic payload is not written into evidence or the limitation detail, and the test asserts the serialized evidence does not contain the injected string; the code comment also states that the process panic hook may still report it separately, which matches what I observed on the earlier head. The injection is
#[cfg(test)]-gated, andstd::panic::resume_unwindis not amongforbidden_panic_patterns()(xtask/src/no_panic.rs:191-203). incomplete_filesis still write-only in production. The only reader,producer_failure_limitations, is#[cfg(test)], so theMutex<BTreeSet<PathBuf>>is populated on the failure path in a shipped build with nothing consuming it. This is unchanged from my earlier review and is not an inconsistency with the fragment, which claims a named stage summary rather than a user-visible limitation - but if the limitation is meant to reach users later, the producer-side reader is the missing half, and until then the set and its lock are carried for a test-only consumer.- The positive control is worth keeping. The test first runs the same pass shape unarmed and asserts the evidence is real and that no limitation is produced, so the armed assertions observe the containment rather than a fixture that never reaches the warm.
Efficiency:
- The failure path is cheaper than the normal path:
incomplete_evidencereturns one opaque stand-in per seam and bypasses the parallel seam walk entirely, so a warm that panics after tens of seconds of table building still pays only the stand-in cost. The steady-state cost of the change is oneAtomicBooland oneMutex<BTreeSet<PathBuf>>per pass, and the set is touched only on the failure path, where it takes one insert per distinct seam file. No new I/O, process spawn, scan or growth rate is introduced on the normal path, and thecatch_unwindboundary costs one landing pad around the warm rather than anything per seam.
Not run:
- The Rust toolchain on this host is not on
PATH, socargo test -p ripr --lib analysis::test_grip_evidence,cargo clippy,cargo xtask precommitandcargo xtask check-no-panic-familycould not run locally. Every Rust-level statement above comes from reading source at this head and from hosted metadata, not from a local build; in particular I could not observe the new test's result. - No hosted Rust evidence exists on this head. The PR is a draft and carries no labels at all, so no
merge-readylabel was ever applied and the Rust workflow (triggerpull_request: types: [labeled], route job requiring that label) never requested a Rust lane. The required check is absent rather than red, and every Rust lane present reportsskipped. Applyingmerge-readyis what would produce a required-lane verdict here. - The merge-base contribution figure could not be recomputed with the batch helper because it uses the exhausted REST API; the figures above are GitHub's PR-level additions/deletions and path count.
- I did not re-diagnose the inherited main-reds recorded earlier in this campaign (the orphaned process-policy allowlist row owned by PR #11975, the two
cli_smokeselector-recovery failures owned by PR #11982, and the Pythoncompare_literal_values_fails_open_on_undecoded_literalsfailure owned by PR #11918); this PR touches none of those files.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 13b7c804c3726f73854a10a2dc449f0612c3e667. Not an approval.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the new test covers both panic-before-build and panic-after-scan-memo-population, and verifies opaque classification plus a later smaller stage.
- Confirm the typed producer_failure limitation is exposed only through a #[cfg(test)] method, so production output consumers cannot retrieve the per-file limitation described in the PR body.
Parked follow-ups
- The typed producer_failure limitation remains test-only, so production consumers receive only the named opaque stage summary.
- The implementation and changelog consistently scope containment to the shared-table warm; lazy memo reads outside that warm remain outside this change.
- The changelog states that every seam reads as an opaque stand-in naming seam_evidence_incomplete, but production consumers do not receive the typed producer_failure limitation; only the stage summary exposes the named limit.
Evidence gaps
- The PR claims every seam fails closed, but no exact-head cargo-test completion receipt is available in the supplied evidence.
- Model proof intent was rejected by deterministic validation.
- The new tests validate opaque classification, payload exclusion, and later-stage behavior, but exact-head package execution is not yet evidenced in the packet.
- The architecture claim lacks a completed exact-head test receipt in this review packet.
Review of record: REVIEW_READY at head de8991bFull diff vs main read (test_grip_evidence.rs, warm_entrypoint.rs, changelog fragment).
Findings: none material. Merging with expectedHeadSha. Generated by Claude Code |
Governing issue or accepted claim: #11524
Acceptance delta (one sentence): a panic inside the seam-evidence pass's shared-table warm (prime_pin_syntax_scan / unseen_reach_names / type_mentions) no longer unwinds the run; every seam of that pass fails closed to an opaque, non-actionable stand-in naming
seam_evidence_incomplete, and the possibly-incomplete memo is never read.What changed
EvidencePass::warm_shared_tableswraps the warm incatch_unwind(mirrors fix(rust): contain classify macro scan priming unwind #11366's classify-pool prime) and recordswarm_failed; the payload is dropped.evidence_forchecks the flag and returnsincomplete_evidence: all five stages Opaque, no related tests, no missing discriminators, no new-test target. Classification yieldsopaque(not headline-eligible, so no repair signal). The flag persists, so later smaller stages also skip the memos.inject_warm_panic(no global state) and testa_panicking_shared_table_warm_fails_every_seam_closedintests/warm_entrypoint.rs: unarmed control reaches real evidence; armed run keeps all 1000 seams, asserts opaque stand-ins, a later 10-seam stage also fails closed, payload text absent from serialized evidence, and a typedproducer_failurelimitation onsrc/values.rs.Verified
cargo test -p ripr --lib warm: 71 passed (including the new test and the existing warm tests).catch_unwindtemporarily removed, the new test FAILED (panic escapes); restored, it passes.cargo xtask precommit: fmt, no-panic-family, allow-attributes, local-context, dependencies and earlier checks pass.Not verified / gaps
cargo xtask precommitstops atcheck-process-policyon a pre-existing main issue unrelated to this change (orphaned allowlist entry forcrates/ripr/src/output/first_pr/run_chain.rs, from feat(first-pr): run-chain timeout, Windows quoting, Python/TypeScript e2e (#11720 remainder) #11924); checks after it, including Clippy, did not run locally. Hosted exact-head CI is needed.producer_failurelimitation (EvidencePass::producer_failure_limitations) is#[cfg(test)]and not yet surfaced in user-visible outputs; the stage summaries carry the namedseam_evidence_incompletelimit meanwhile. Threading it into outputs is a follow-up.Generated by Claude Code