Skip to content

fix(analysis): contain a panic in the seam-evidence shared-table warm (#11524) - #12001

Merged
EffortlessSteven merged 3 commits into
mainfrom
claude/fix-11524
Nov 3, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
claude/fix-11524

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

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_tables wraps the warm in catch_unwind (mirrors fix(rust): contain classify macro scan priming unwind #11366's classify-pool prime) and records warm_failed; the payload is dropped.
  • evidence_for checks the flag and returns incomplete_evidence: all five stages Opaque, no related tests, no missing discriminators, no new-test target. Classification yields opaque (not headline-eligible, so no repair signal). The flag persists, so later smaller stages also skip the memos.
  • Test-only injection field inject_warm_panic (no global state) and test a_panicking_shared_table_warm_fails_every_seam_closed in tests/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 typed producer_failure limitation on src/values.rs.
  • changelog.d fragment.

Verified

  • cargo test -p ripr --lib warm: 71 passed (including the new test and the existing warm tests).
  • Uncontained control: with catch_unwind temporarily 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 precommit stops at check-process-policy on a pre-existing main issue unrelated to this change (orphaned allowlist entry for crates/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.
  • The seam walk has no analysis-outcome channel, so the typed producer_failure limitation (EvidencePass::producer_failure_limitations) is #[cfg(test)] and not yet surfaced in user-visible outputs; the stage summaries carry the named seam_evidence_incomplete limit meanwhile. Threading it into outputs is a follow-up.
  • Only the shared-table warm is contained, as scoped by the issue; lazy memo reads on stages below the 1000-seam warm threshold are not.
  • No review pass or CI qualification yet; not requested.

Generated by Claude Code

…#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
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 148 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 47f35d24-fa57-4768-a9ea-1d62672c2cd0
Commits

Reviewing files that changed from the base of the PR and between 24f1ff6 and de8991b.

Files selected for processing: 3
  • changelog.d/11524-seam-warm-panic.md
  • crates/ripr/src/analysis/test_grip_evidence.rs
  • crates/ripr/src/analysis/test_grip_evidence/tests/warm_entrypoint.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@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.

Independent review (fresh-context reviewer, head e160739): REVIEW_INCOMPLETE

Inspected:

  • Head e160739a22842b6e8bcab31369d1e893e15a14a5 against base a69bf0214f7bd7e0537a1cdd07e95608e5a366e8; 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 REST pulls/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.rs whole 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 EvidencePass in test_grip_evidence.rs; the consumers are evidence_for_seams (:279) and the per-seam entry evidence_for_seam (:539). Ran the content-based duplicate check against the other five PRs in this batch: #12001 is DISJOINT from every one, so there is no sibling claim to reconcile.
  • Checked the mechanism. warm_shared_tables (:488) wraps the warm in catch_unwind inside std::sync::Once::call_once, so the panic is caught before it can escape the closure and Once completes normally rather than being poisoned - a panic escaping call_once would make every later call panic again, and this placement avoids that. evidence_for checks warm_failed after the warm and before the parallel stage loop, so no seam of that pass reaches the memos. EvidencePass::new (:311) builds its own CompactGripContext::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 stages StageState::Opaque with Confidence::Low, empty related tests, empty missing discriminators and no new-test target, which classifies as opaque and so is not headline-eligible. Ordering is already imported at :73, so the new Ordering::Acquire / Ordering::Release uses resolve, and resume_unwind is not in the gate's forbidden set (xtask/src/no_panic.rs:191-203 lists unwrap(, expect(, panic!, todo!, unimplemented!, unreachable! only), so check-no-panic-family will 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 :513 and :519. A second injection point - after prime_pin_syntax_scan and before unseen_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_evidence inserts seam.file() for every seam it answers, so incomplete_files ends up holding the file of every seam in the pass, not the file whose warm failed; the limitation it builds is therefore one producer_failure limitation per file in the pass, each carrying the same "seam evidence stopped on an internal error" detail. The new test asserts limitations.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_files is 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. The Mutex<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_unwind returns, 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_unwind adds 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_evidence holds the incomplete_files lock across the whole map and allocates a PathBuf per seam for the BTreeSet::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 the catch_unwind wrapper does not make any previously short-circuited computation run.

Not run:

  • The Rust toolchain on this host is not on PATH, so cargo test -p ripr --lib warm, cargo xtask precommit, cargo xtask check-no-panic and cargo xtask check-changelog-fragments could not be run locally. The body's "71 passed" for cargo test -p ripr --lib warm and 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-policy fails on the orphaned crates/ripr/src/output/first_pr/run_chain.rs allowlist row for use std::process::Command, which is the main-red PR #11975 addresses under #11720. This PR touches no policy/ file and nothing under crates/ripr/src/output/first_pr/, so it cannot cause or cure that failure; because precommit stops 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-ready label, and the Rust qualification workflow triggers only on pull_request: types: [labeled] with that label required by its route job, so no Rust lane was ever requested. The head's check-runs contain no Ripr Rust Small Result / Rust gates / ci-result entry - the required check is absent rather than red - and every Rust lane present reports skipped. This PR is also a draft, so it can never be REVIEW_READY as it stands, and the strict-workspace-Clippy lane in particular has never run against the new #[cfg(test)] reader of incomplete_files or the new catch_unwind block.
  • 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_path error paths at test_grip_evidence.rs:339-383, where a failed with_path is 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

@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 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.

@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.

Independent review (fresh-context reviewer, head 13b7c80): REVIEW_INCOMPLETE

Inspected:

  • Head 13b7c804c3726f73854a10a2dc449f0612c3e667 vs base a69bf0214f7bd7e0537a1cdd07e95608e5a366e8 (current main); two commits (e160739a2 "fix(analysis): contain a panic in the seam-evidence shared-table warm...", then head 13b7c804c "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) and crates/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-identity and others); ub-review was 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 after context.prime_pin_syntax_scan() has populated the macro-site scan memo and before unseen_reach_names() and type_mentions(), and the new test a_warm_panic_after_the_scan_memo_is_populated_fails_every_seam_closed asserts context.workspace_scan_passes() >= 1 before checking the stand-ins, so the partial-memo state is proven rather than assumed. Point 1 still fires before any table is built and asserts workspace_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 the Once is not poisoned; warm_failed is 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 the seams.len() >= WARM_MIN_SEAMS condition, so a later smaller stage on the same pass also gets the stand-in - and the test asserts exactly that with pass.evidence_for(&seams[..10]). The stand-in path names seam_evidence_incomplete on every stage, leaves related tests, missing discriminators and the new-test target empty, and the test checks the classification comes out SeamGripClass::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, and std::panic::resume_unwind is not among forbidden_panic_patterns() (xtask/src/no_panic.rs:191-203).
  • incomplete_files is still write-only in production. The only reader, producer_failure_limitations, is #[cfg(test)], so the Mutex<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_evidence returns 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 one AtomicBool and one Mutex<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 the catch_unwind boundary costs one landing pad around the warm rather than anything per seam.

Not run:

  • The Rust toolchain on this host is not on PATH, so cargo test -p ripr --lib analysis::test_grip_evidence, cargo clippy, cargo xtask precommit and cargo xtask check-no-panic-family could 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-ready label was ever applied and the Rust workflow (trigger pull_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 reports skipped. Applying merge-ready is 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_smoke selector-recovery failures owned by PR #11982, and the Python compare_literal_values_fails_open_on_undecoded_literals failure 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.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 3, 2026 14:45
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@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 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.

Copy link
Copy Markdown
Member Author

Review of record: REVIEW_READY at head de8991b

Full diff vs main read (test_grip_evidence.rs, warm_entrypoint.rs, changelog fragment).

  • Semantic owner: EvidencePass in analysis/test_grip_evidence.rs owns the shared-table warm; containment is in warm_shared_tables via catch_unwind inside the Once, setting warm_failed, so the Once is not poisoned and later stages also short-circuit in evidence_for.
  • Fail-closed direction: the stand-in has all five stages Opaque/Low, no related tests, no missing discriminators, no new-test target, and classifies opaque (not headline-eligible), so it can never produce a repair signal. Panic payload is dropped (can quote repo text). Normal path is unchanged when the warm succeeds. incomplete_files is written in production and read only by the cfg(test) limitation builder (a documented follow-up for user-visible surfacing).
  • Test stimulus and oracle: unarmed control reaches real evidence; two injection points (before any table, and after the scan memo is populated, asserting the memo was in fact populated); 1000 seams retained; every seam opaque with the named summary; later 10-seam stage also fails closed; serialized evidence lacks the payload; typed producer_failure limitation on src/values.rs. The PR body records that removing catch_unwind makes the test fail.
  • Spec/changelog/golden parity: fragment changelog.d/11524-seam-warm-panic.md names reliability(rust): seam-evidence caller of prime_workspace_macro_scan has no panic containment (residual of #11116) #11524; no output/schema/golden change on the non-panic path.
  • Checks: Ripr Rust Small Result completed/success on this exact head; 0 review threads (including outdated).

Findings: none material. Merging with expectedHeadSha.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants