Repository navigation
eval(verdict-corpus): replay runtime truth with verdict-corpus relabel - #6596
Conversation
Every mutant of a behavior-preserving rewrite now carries mutated_line, the exact anchor line it replays, and failing_test must be one test name. cargo xtask verdict-corpus relabel copies each selected subject, runs the case's own cargo test command on the unedited tree, the edit, and each mutant on the labeled toolchain, and fails on any drift: outcome, failing test, derived truth, a mutant that does not compile or changes nothing, disagreeing repeated runs, or a missing toolchain. --sample/--seed pick a deterministic subset; upstream excerpts replay from --checkouts at the pinned commit. Also corrects five equivalence reviews whose inputs or messages did not match the subject's tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
…y bytesize property relabel now runs each case on its labeled rustc via RUSTUP_TOOLCHAIN (never auto-installing) and records baseline and edit outcomes. A full replay found 11 cases labeled on 1.97.0 that only build there, and a quickcheck property in bytesize 1.3 (alloc_tests::string_round_trip) that fails on random inputs regardless of the edit; those four cases now skip it. Also reads #[should_panic] failures by their test name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Summary by CodeRabbit
WalkthroughThe change adds ChangesVerdict Corpus Relabel
Estimated code review effort: 4 (Complex) | ~60 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Xtask
participant Relabel
participant SubjectTree
participant Cargo
participant Receipt
Xtask->>Relabel: dispatch relabel arguments
Relabel->>SubjectTree: prepare case and apply edit or mutant
Relabel->>Cargo: run repeated offline test commands
Cargo-->>Relabel: return run outcomes
Relabel->>Receipt: write relabel.json with outcomes and drift
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 68.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 64 functions across 6 files. (1 skipped: 1 unsupported.) Full details: Description checkExplanation The description explains the change, scope, proof, claim boundary, rollback, and traceability. It omits several template sections, including Swarm / Source Boundary, Candidate Relationships, Scope, Support-tier Impact, Engineering Check, and Gates, so it is not complete enough against the repository template. Resolution Add the omitted template sections. Confirm the Swarm / Source Boundary; provide source-of-truth links and candidate-relationship status; state the scope and production/evidence deltas; document support-tier impact; complete the Engineering Check and Gates with applicable results or reasons they do not apply.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit checks each test-run trail, Comment |
… network Review of the exact head found the replay could reach outside its run-owned tree. Cargo now runs offline with the caller's RUSTC, wrappers and RUSTFLAGS-family variables cleared; checkouts with tracked-file changes or symlinks that leave the checkout are refused; test commands may not pass --manifest-path, --target-dir, --config, -Z or -C (validate refuses them too); repeated runs that fail in different tests now disagree; a blank CRLF anchor line keeps its line ending. The spec lists the remaining known limits and the traceability entry names the relabel code and tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
… other's trees Subject trees now live under a per-process directory inside the work dir and are removed at the end of the run; the per-subject cargo target dirs stay shared, since cargo locks them. The spec also names the aborted-binary case, where only the failed outcome is checked. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
Re-review of ce1c589 showed two links that each pass the lexical check can chain to a path above the checkout. copy_checkout now canonicalizes each link and requires it to stay under the canonical root, falling back to the lexical check only for a dangling link. Also refuses short-flag bundles that carry -Z or -C, clears RUSTC_BOOTSTRAP, refuses checkouts with untracked files (gitignored output still passes), names differing failing-test sets when repeated runs disagree, removes the per-process trees on error too, and tests validate's refusal of an unreplayable test command. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
A dangling link could only be judged lexically, so a chain ending outside the checkout still passed and could come alive in the copy. A link that does not canonicalize is now refused; none of the pinned upstream checkouts has one. The spec also notes that the short-flag check refuses attached values containing Z or C. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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. |
…ed_line #6338 landed on main with free-text mutants only, which the new validator refuses. Each of its 87 mutants now carries mutated_line; verdict-corpus relabel replays all 43 cases with 0 drift, and the expected report is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Review of recordHead: Angles: correctness and edge cases (flag parsing, outcome classification, tree cleanup); tests and regressions; spec and contract (RIPR-SPEC-0219, the fixture SPEC and traceability); security and isolation (checkout copy, symlinks, environment).
Evidence on this head:
Nothing blocking remains. Merge waits for green CI 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! |
Review of record, update for head
|
| Source | Finding | Resolution |
|---|---|---|
| Devin (🔴) | When rustdoc failed after the unit tests passed, the run read as tests_failed and could count a mutant as detected |
3a15138: such a run is now build_failed; a doctest compile failure is still a named failing test |
| Devin (🟥) | A tracked symlink into an ignored or untracked path dangles in the copy | 3a15138: a link must resolve to a copied path; all 20 tracked links in the pinned checkouts still pass |
| Devin | No end-to-end test of relabel_case |
filed as #6706 (an opt-in test, because it needs cargo builds and the pinned toolchain) |
| Devin | The description said 104 cases, the changelog 147 | the description is updated to 147 |
| Delta review (correctness and edge cases, test strength) | nothing blocking. Three non-blocking misreads: a test's own running … output counted as a binary header; a nonzero exit after passing results read as a build failure; a test result: FAILED line with no failed count read as a build failure |
7e7d61e fixes all three, each with a test |
The delta reviewer confirmed that each new test fails if its fix is reverted.
Evidence on 7e7d61e:
- 46 verdict_corpus tests pass.
cargo xtask precommitpasses.- A replay of 10 sampled authored cases shows 0 drift, as does a replay of the serde, rusqlite and semver upstream cases on 3a15138.
- The full 147-case replay from the earlier review stands. These commits touch only run classification and the checkout copy, and the sampled replays exercise both paths.
Nothing blocking remains.
Generated by Claude Code
A caller's RUSTDOC or build.rustdoc could run doctests with a different rustdoc than the rustc the version probe checked. Replays now set both to the rustup proxy, as RUSTC already was. A sampled replay with RUSTDOC=/bin/false in the caller's environment shows 0 drift. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
|
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 addendum. The head is now CodeRabbit's 🟡 outside-diff finding was valid: a caller's Evidence:
The change is three environment entries plus a spec sentence, and nothing else changed. Nothing blocking remains. Generated by Claude Code |
There was a problem hiding this comment.
Confirmed findings
- This lane's scope (JS-backed memory crossing worker, async, GC, detach, and transfer boundaries) does not intersect the diff. The change is a synchronous Rust xtask subcommand that shells out to cargo; there is no JavaScript runtime, no WebAssembly/JS bridge, no worker thread, no async task, no transferable object, and no shared-memory handle in the new code. A comment would be noise on a non-surface; recorded here for the human reviewer.
- End-to-end test of relabel_case on a real crate was acknowledged as a gap and filed as #6706 (opt-in due to cargo+toolchain requirement). The 147-case replay and two negative experiments substitute for unit-level coverage, but a regression in the decision path could ship undetected until a manual run.
Verification questions
- Confirm run_tests in Runner sets RUSTC=rustc and RUSTDOC=rustdoc (proxy names), not absolute paths; relies on PATH-resolved rustup proxies. If a runner's PATH lacks the rustup shim, the labeled toolchain is silently bypassed. Spec acknowledges RUSTC points at the rustup proxy; the test test_command_args_accepts_only_plain_cargo_test confirms command parsing but no test pins that RUSTC/RUSTDOC = absolute rustup proxy path under --checkouts.
- Confirm all replicated mutations in this diff are replayable test cases run on behalf of an xtask subcommand; build scripts and tests are not sandboxed, but the corpus is read-only, the checkouts are verified clean at the pinned commit, only tracked files are copied, and the labeled toolchain is the only rustc/rustdoc that runs. No secrets are read or written; no new spawn site beyond run::capture_output_measured / run_output_owned; the relabel tool never clones, fetches, or edits the corpus. The seeded review thread confirms prior findings (doctest classification, symlink chain, ignored files, network sandbox) were addressed by code changes pinned in the thread.
Refuted
- test_command
cargo testcould be hijacked via whitespace-only shell metacharacters (e.g.cargo testwith trailing space) to bypass parser; refuted because: Parser splits on whitespace and requires the first word be exactlycargo, secondtest. Shell-metachar check iteratesrestand refuses any word containing\|/;/&/>/</`/$. UTF-8 whitespace other than ASCII space/tab would still split cleanly with split_whitespace, and the metachar list would not catch Unicode lookalikes — but cargo invocation rejects such bytes via its own argv parser, so no replayable path exists. Box::from(slice)allocation failure does not returnNone; recoverable fallback claims are dropped.- Short-flag bundling refuses any -Z/-C even when legitimate (e.g. cargo test -p), parser checks whole word contains Z/C.
- No ArrayBuffer/TypedArray/DetachArrayBuffer surfaces exist in this Rust xtask; the relabel path only owns Vec/Vec with no aliasing. Resizable-buffer/active-view UB category does not apply.
cargo test -- -Zaccepted post---violates a no-Z rule and makes the test_command_args test tautological; refuted because: test_command_args only filters NON_RUNNING_TEST_FLAGS after--. -Z is short-flag-bundle-rejected only when in the cargo-arg region.cargo test -- --skip a -Zlegitimately parses to ['test','--','--skip','a','-Z']; the test asserts that. Non-tautological.- run_tests's envs Vec<&str> is reused across the repeat loop, and a previous run could leave a borrow into a backing String that a later env mutation invalidates.; refuted because: envs is a const slice of (&str, &str) built from a local array of &'static str and short-lived String::as_str; the slice is rebuilt only via the local array each call, and the inner loop only mutates the runs Vec, never the env backing.
- The relabel command could leak cloned PathBuf/tree handles across a worker boundary if an async task is dropped mid-replay.; refuted because: The command is fully synchronous: relabel_case awaits each capture_output_measured call inline, uses only stack-local PathBuf values, scopes trees to process::id() under work_dir, and removes them in a closure on both success and error. No async drop point, no worker handoff, and no shared-memory handle exists to leak.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
…mutated_line #6572 landed on main with free-text mutants only, which the validator in this PR refuses. Each of its 139 mutants now carries mutated_line; verdict-corpus relabel replays all 56 cases with 0 drift, and the expected report is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H
|
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 reviewer attention before upstream: findings remain.
Confirmed findings
- Regressions in the toolchain-probe path (labeled_toolchain/toolchain_release) are only covered by parser tests; an installed_release panic or wrong-release match would only surface in a real replay. Add a small test that calls installed_release-equivalent parsing on a synthetic rustc --version string, or stub the probe.
- The changelog and
changelog.d/verdict-corpus-relabel.mdclaim 'replays of all 203 cases' while the PR description and the relabel receipt header still say 147 (the body states the 147 figure is the 104 originals + 43 from #6338). The 203 number does not match the diff: only 147 mutated_line additions are present in corpus.json and the relabel receipt path. The PR's claim boundary already says 'every current label reproduces' rather than a count; reconcile the changelog or annotate why '203' appears (e.g., future in-flight corpus PRs #6572/#6577 are counted).
Verification questions
- Confirm copy_checkout refuses links that escape via chain or resolve to untracked/dangling targets; unix-only symlink branch.
- Confirm spec admits the replay never clones/fetches and is offline, but a stale cargo cache (registry + git deps) is trusted: a poisoned cache entry changes replay outcomes silently. Mitigations: pinned commits, offline mode, and the same anchor/diff for all cases; residual for human to verify cache integrity on a shared runner.
Refuted
- split('
') in apply_mutated_line could split a CRLF file inconsistently and shift a mutation to the wrong line on Windows-style line endings; refuted because: The function explicitly handles the trailing \r on the line being replaced (strip_suffix('\r')) and re-appends the same carriage; tested with the 'a\r\n b\r\nc' case in apply_mutated_line_keeps_indent_and_line_numbers, and the symlink helper is #[cfg(unix)] so the whole feature is Unix-only, removing any CRLF concern in practice. - Replay applies mutated_line to a file string and the change is lost if anchor.line is stale (active-view / stale length snapshot analog for an in-memory buffer).; refuted because: anchor.line is a 1-based file line read from the corpus diff and applied_mutated_line indexes split('
') with a checked_sub and a length check; the test apply_mutated_line_keeps_indent_and_line_numbers covers out-of-range and CRLF; no backing-store length-snapshot analogy applies because the file is fully read each pass and restored after the mutant run. - No JS runtime, worker, async task, transferable, or shared-memory handle exists in the diff. The new module is synchronous Rust that shells out to cargo/git via run_output_owned and capture_output_measured; spawn sites are std::process-based, not JS. Lane is non-surface for this PR.
- The 20-entry env vector in Runner::run_tests is duplicated logic from the rest of xtask's process-spawn code and should live in a shared helper.; refuted because: Searched xtask/src for any existing centralized env-construction helper; the only related call is run::capture_output_measured which already accepts an env slice, and there is no canonical builder. Duplication is bounded to one site and the env list is a contract, not a reusable abstraction.
Parked follow-ups
- Runowned-tree cleanup is the one process-boundary detail that was load-bearing; the closure in relabel plus per-pid trees_root keeps removal on both success and error paths, matching the seeded review thread's resolved B1. Architecture-acceptable, no leak to other modules.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Replies to the ub-review findings on f59e7e3.
Generated by Claude Code |
Resolve corpus conflicts by appending the authored-trap-kit subject and its 23 cases to main's corpus, adding the verified mutated_line values for all 69 mutants (#6596 rule), bumping corpus_version to 2026-10-06.2 and re-blessing the expected report. No existing row changed; trap outcomes are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jr5a2Q6UrWrqxcKNBHhR5d
Requested by Steven · project thread
Summary
Before: every verdict-corpus label rested on mutants someone ran once, by hand. Mutants were free-text descriptions (
n > 100,(delete the statement),0), so nothing could replay them without guessing which span they replaced, and nothing checked that a label still reproduces.After:
cargo xtask verdict-corpus relabelre-derives truth. For each selected case it copies the subject and runs the case's owncargo testcommand on the labeled toolchain: once on the unedited tree, once on the edit, and once on each mutant. It fails on drift. Every rewrite mutant now carriesmutated_line, the exact anchor line it replays, andfailing_testmust be one test name.validateenforces both.How: a new module,
xtask/src/reports/verdict_corpus_relabel.rs. Drift is any of:--repeat, default 2);RUSTUP_TOOLCHAINand never auto-installs.--sample <n> --seed <s>picks a deterministic subset by sha256(seed, case id), so a scheduled run can rotate. Authored subjects replay offline. Upstream excerpts replay only from--checkouts <dir>/<subject_id>, under these conditions:git status;Cargo runs with
CARGO_NET_OFFLINE=trueand no inherited rustc wrappers or flags.RUSTCandRUSTDOCpoint at the rustup proxies. Build scripts and tests are not sandboxed; the spec states this as a known limit. Test commands that cannot be replayed are refused, by bothrelabelandvalidate:--no-run,--manifest-path,--target-dir,--config, and-Z/-Cbundles;--:--list,--format,-qand--quiet.The tool never clones, fetches or edits the corpus.
Audit results (the reason for the tool)
mutated_line, so this PR backfills it for their 99 cases.rusqlite-singlethreaded-magicdoes not build on 1.95, whereassert_matchesis unstable. The labels hold on 1.97, and relabel now replays each case on its own toolchain.alloc_tests::string_round_tripis a quickcheck property in bytesize 1.3 (bytesize-66a3715). It failed 1 of 5 replays, independent of the edit, and that can flip the twonot_discriminatedlabels. The four cases on that subject now runcargo test -- --skip alloc_tests::string_round_trip. The property never calls the changed methods (as_kb/as_mibhave no callers). All 10 replays were clean afterwards.failing_testfields held lists or notes (test_basic, test_cargo3202, … (+3 more)). Each now names one test; the rest moved toequivalence_review.mutated_lineis added. Its values are in/mnt/project-files/verdict-corpus-relabel/pr-6577-mutated-lines.json, and a comment on eval(verdict-corpus): 25 authored cases for older spec-defined test shapes #6577 says so.Decision (reversible):
validaterequiresmutated_linerather than treating it as optional, so new cases cannot land unreplayable. Corpus PRs that merge after this one need the field.Source-of-truth Links
Spec: RIPR-SPEC-0219, updated for the four subcommands,
mutated_line, the relabel contract, known limits and non-goals.Acceptance delta (one sentence): corpus labels can be re-derived from scratch, and drift fails a command.
Scope Classification
Non-goals:
Policy Impact
run::capture_output_measured/run_output_owned, and cargo runs offline.Proof
Negative experiments:
mutated_lineequivalent to the edit reportslabeled tests_failed but the tests pass, plus the truth drift;mutated_linereportsdoes not compile (error: this file contains an unclosed delimiter).Claim Boundary
May claim: every current label reproduces on its labeled toolchain under replay. Must not claim: exhaustive mutation adequacy; the labels cover only the listed mutants. There is no automated end-to-end test of
relabel_caseyet (#6706).Rollback
Revert the PR; the
mutated_linefield and the validate rules go with it.Spec-Test-Code Traceability
Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a (no workflow change).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Vq4dF6CC5aHi8PNFwTYc9H