Repository navigation
feat(verdict-corpus): Perl verdict corpus with fact packets, and Perl findings on the changed line - #6612
Conversation
`cargo xtask verdict-corpus validate|check|report` take `--language <rust|typescript|python|perl>` and read `fixtures/<language>-verdict-corpus`. corpus.json gains a `language` (absent = rust); a directory declaring another language is refused. Rust keeps its run and report paths and its report bytes; other languages nest under <language>/ and name their language in both report files. Separate directories keep TypeScript, Python and Perl label changes from re-blessing the Rust expected report (RIPR-SPEC-0233). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UJ4NsYR4vJfn1cC6yRC1N5
…0238 RIPR-SPEC-0233 is taken by the Python oracle rules spec. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UJ4NsYR4vJfn1cC6yRC1N5
A Perl finding sat on the owner's declaration line read as one-based,
which with the real producer's zero-based coordinates is the line above
`sub name {`. ripr now takes the change's line when exactly one reading
(zero-based or one-based) is a line the diff adds, and otherwise keeps
the old location. Probe and canonical gap identity do not change.
Also drops two clone-on-copy calls that failed lang-perl clippy.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
…ortlessMetrics/ripr-swarm into claude/project-thread-y214zg
36 runtime-labeled cases across Test::More, Test2::V0 and Test::Exception, each with the packet the pinned perl-ripr-facts producer wrote. Cases built from RIPR-SPEC-0235 packet shapes are marked edited_producer and reported apart. The harness passes each packet with --perl-facts to the lang-perl build and counts unresolved_subject Perl findings (#3280). Perl rates join the trust scoreboard. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
…-y214zg # Conflicts: # crates/ripr/src/analysis/language/perl/tests.rs
…subjects Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Summary by CodeRabbit
WalkthroughThe pull request adds language selection to the verdict-corpus harness, supplies a Perl corpus with pinned fact packets and expected reports, and updates Perl analysis to locate findings on uniquely matched changed lines. ChangesPer-language verdict corpus
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant CorpusHarness
participant PerlBinary
participant Ripr
participant Report
CLI->>CorpusHarness: select language and load corpus
CorpusHarness->>PerlBinary: resolve Perl fixture binary
CorpusHarness->>Ripr: run case with pinned fact packet
Ripr-->>CorpusHarness: return findings
CorpusHarness->>Report: score cases and write report
Merge Risk: ⚪ Minimal · up to The changelog matches the documented Perl corpus and check behavior. No material merge-blocking risk is evident. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 7 systems. Changed systems: Architecture concerns Review details
Pre-merge checks ·
|
There was a problem hiding this comment.
Reporter summary
Every specialist lane failed preflight and produced no evidence, and the late cargo-test sensor timed out after 900s without a receipt, so this review has zero substantive lane conclusions to weigh. The PR itself is large but well-scoped (a Perl verdict corpus plus a single behavior change to the Perl adapter's change-line location, with tests, spec, traceability, and changelog fragments) and claims byte-identical Rust report bytes plus authored Perl subjects; without a working lane or cargo-test receipt, I cannot confirm those claims or check for risks beyond what the diff itself states.
- Perl change lines need one coordinate basis across the packet, and an overflowing start line is skipped instead of panicking. - The lang-perl fixture binary gets its own name, so a process that builds both feature sets never runs the wrong one. - Relabel three cases whose rewrite was not exactly behavior-preserving (freeze-class defined vs truthy; two float rewrites), and correct two reasoning values. - Perl scoreboard metrics read producer-packet rates only, and the spec and changelog say no CI lane runs verdict-corpus check yet. - fact_producer.commit must be lowercase hex. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
|
Fragment preparation for #6800, inspected current head Source inspection found: The shared Return the exact repaired head and source diff here. Actual-checker execution remains pending executable custody as specified in #6800; no new Cargo build or installation is authorized in this source-only lane. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
|
Status for the night, at head Fragment repair (#6800). Done on this PR
Left open
Follow-up issues: #6581, #6582, #6583, #6584, #6586, #6619. 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! |
Main moved the verdict corpus to one file per case and row, renumbered the per-language corpora spec to RIPR-SPEC-0245 (0238 is now Python's oracle rules), and added check-all. This port: - moves the Perl packet validation, --perl-facts run, lang-perl build and packet-provenance rates onto main's harness; provenance now lives on each row and the summary derives it; - splits the Perl corpus into per-case files, adds each rewrite mutant's mutated_line, and re-blesses its rows (verdicts unchanged; eight stale exposed_without_discriminator contradictions are gone after #6584); - keeps main's #6586 currentness rule and only places Perl findings on the diff-settled changed line; - moves the Perl corpus section into RIPR-SPEC-0245 and points the Perl scoreboard metrics at the derived producer rates. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
Both builds write target/debug/ripr. The Perl build now holds an exclusive lock beside that binary across its build, its copy to ripr-lang-perl and a default rebuild, and the default build takes the same lock, so neither a thread nor another xtask process can swap the binary between the Perl build and its copy (Devin review on #6612). Also states the current reason Perl findings stay unresolved_subject in the corpus projection (#6586, #3221), and tightens two Perl tests: the producer-case helper no longer falls back to an edited case, and each provenance bucket's case count is pinned. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
|
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.
Confirmed findings
RIPR-SPEC-0238is referenced from RIPR-SPEC-0245 but the spec-0238 file fragment is owned by a sibling PR (per seeded thread: shared file is identical across #6686/#6798/#6612/#6597). When this PR merges first it inherits a doc fragment it does not author. Not a blocker; spec-0238 owner should land the same repair via #6686 or the doc lands with a brief mismatched cross-reference until then.- xtask/src/reports/verdict_corpus.rs:1199 — is_perl_corpus uses dir.file_name().and_then(name.to_str).strip_suffix with a borrowed slice; if the corpus dir is symlinked or its file_name differs from the canonical lowercase, the test mistakenly treats it as non-Perl and skips producer/packet validation. The architectural fix is to key off the corpus.json schema header (e.g. a declared language field) rather than the directory name.
- with_fixture_build_lock opens
target/debug/.ripr-fixture-build.lockwith OpenOptions::create(true).truncate(false).write(true) on each build; on Windows over SMB or on slow NFS this lockfile may remain after a process crash and serialise future fixture builds. Not security, no CVE. - assertion
seen == 13plus per-metricratio = rate.split('.')lookup covers only the new Perl metrics in lockstep; if a future language adds another dotted path the same call will silently fold into one of the existing branches. Pin the per-language expected count set and add a language↔metric manifest comment so a future contributor cannot regress the gate by adding a metric without updating the count. (xtask/src/reports/dx_scoreboard/tests.rs:2577). - ub-active-view is a JS/WASM/buffer lane; this PR is a Perl verdict corpus and Rust analyzer/harness change. The lane's subject matter does not intersect the diff, so this is a no-finding lane.
Verification questions
- Confirm by_packet_provenance aggregation reuses existing OriginRates via origin_rates(&subset) keyed on PacketProvenance::as_str(); subset filter is r.packet_provenance == Some(provenance), and rows carry packet_provenance as Option. Sum invariant proven in test (producer.cases_total + edited.cases_total == corpus.cases.len()).
Refuted
- Perl change_id pairing logic could index past current packet length under a stale buffer snapshot.; refuted because: Pairing iterates
packet.changesanddiff_file.added_lines; both are owned Vecs under the same scope, no external view retains an earlier length. Change-id lookups are bounds-checked by BTreeMap::get, not by raw indexing. - with_fixture_build_lock could deadlock by re-entering the same lock from the inner run_corpus fan-out.; refuted because: fs::File::lock is advisory and held on the file fd; the lock is acquired once in with_fixture_build_lock and released when
lockdrops at function return. No re-entry path exists because the inner call is the leaf. - Origin-controlled packet path could traverse out of dir via canonicalize() or ..; refuted because: Validator's perl_facts_violations rejects paths not under packets/ and unsafe paths; only after that gate does run_case call path::absolute. No escape.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- report_keeps_edited_packet_rates_apart_from_producer_rates checks provenance-split numerator sums against the top-level totals; if a corpus ever grows a third
PacketProvenancevariant the per-provenance counts will silently leave rows out of any bucket, and+ edited.numerator == top.numeratorwill fail opaquely. Amatchover allPacketProvenancevariants in the sums assertion (or anis_subsetdebug assert) is enough; flagging as a parked follow-up, not a blocker. - Devin's producer-authenticity concern (sha256 pins bytes, not authorship) is already parked under #3221; regenerating packets after the coordinate basis is fixed is the agreed plan. No new sibling risk found.
…cking builds The build lock from 833ec21 made fixture-cache children wait on it instead of on Cargo's own artifact lock, which three contention tests require (Rust gates on 833ec21). Drop the lock. The Perl build still copies to ripr-lang-perl and restores the default build. If another process's default build lands before the copy, every packet case now fails with a named error (its Perl language run is `unavailable`) instead of scoring as silent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
# Conflicts: # .ripr/traceability.toml # docs/specs/RIPR-SPEC-0245-per-language-verdict-corpora.md # xtask/src/reports/dx_scoreboard/tests.rs
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- The new
ripr_perl_fixture_binarycopies target/debug/ripr to target/debug/ripr-lang-perl without a Cargo lock. A concurrent cargo build (or repo-test harness without the same hash lock) can race the copy. Worst case:refuse_unavailable_perlerrors every packet case with a named error, never a silent verdict. No secrets, no RCE. - all 36 expected rows agree with the corpus labels and the rebuild-from-rows test passes; the 13/36 producer-passing claim is only verifiable by the broker via cargo xtask verdict-corpus check --language perl, not by inspection.
Verification questions
- Confirm validator_holds_perl_packets_to_their_pins_and_provenance covers eight tamper shapes (no facts, bad sha, path outside packets/, edited without edits, producer with edits, no producer, short commit, uppercase commit). It does NOT cover: an edit packet whose sha256 matches a hand-built packet on disk, or a packet edited into a path containing '..'.
- Confirm the rust corpus has its own expected rows; only the Perl corpus adds the packet_provenance field. If a future language adapter grows its own packet-shaped corpus, the row field stays Option and render_report_json omits when None, so no silent regression. The field is also present in expected/rows for Perl only; no sibling corpus to confuse today.
Parked follow-ups
- RIPR-SPEC-0238 fragment is cross-PR shared and the seed says this PR will land with the wrong cross-reference until #6686 writes it.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Keeps both the Perl and Python entries in traceability and RIPR-SPEC-0245. The scoreboard test now counts 16 corpus-row rates. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
Keeps this branch's resolution; the tree is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
|
Status on 614d161 (Perl thread winding down for the night):
Next step, for whoever picks this up: once #7547 merges, merge main into this branch, check that no routed-rust run is in flight, then toggle Draft→Ready. Post the review of record and merge when green. I left the PR Ready, but the required check has not run on this head. Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- packet_to_findings_with_currentness threads &BTreeMap<change_id,line> through the call; the map outlives change_lines_from_diff but is consumed (collected into the probe loop) before the function returns, and the diff &ChangedFile slice is borrowed for the call duration. No self-referential aliasing. Reported for completeness; not a public issue.
- xtask/src/reports/fixtures.rs:847 — ripr_perl_fixture_binary copies target/debug/ripr to target/debug/ripr-lang-perl with no size guard; a zero-byte file from a failed cargo build would later be invoked as the Perl binary and only the corpus refusal saves the run. Consider copying only after run() returns Ok, then re-checking fs::metadata(&perl).len() > 0 before returning.
- run_corpus prebuilds both fixtures only if the corpus carries any packet case (perl_facts.is_some) or non-packet case; a corpus that mixes packets with non-packets still triggers both builds even when the only packet cases would not run in this process. This costs one extra lang-perl build on any future mixed-language corpus, which is harmless today because no such corpus exists.
Verification questions
- Confirm is_perl_corpus keys off dir.file_name() == "perl", so a symlinked corpus dir misclassifies; matches the seeded Devin observation and is keyed to a directory path, not file content.
- Confirm edited-packet provenance is a per-case opt-in via 'edits' text. A reviewer can confirm a packet's sha matches the producer's bytes, but cannot confirm a 'producer' packet is actually the producer's output without reading the producer's commit and re-running it. This is documented (RIPR-SPEC-0245 'producer receipt belongs with #3221') and the claim boundary explicitly excludes 'producer-authorship checked'.
Parked follow-ups
- No comparable guard exists for callers of ripr_fixture_binary outside run_corpus. Other xtask/test surfaces that exercise ripr today (xtask/src/reports/fixtures.rs callers, precommit, miri, mutants harnesses via with_fixture_build_lock) write to target/debug/ripr. The new lang-perl build also writes to that path then copies. If any other xtask surface invokes ripr_fixture_binary concurrently with a Perl-corpus run on the same machine, it could overwrite ripr-lang-perl before/after the copy. The seeded review-comment explicitly noted this race; 86a94eb chose 'fail closed on unavail' as the safety net rather than serializing.
- Refuse-unavailable covers the wrong-binary case at run time (a Perl case whose binary lacks lang-perl is a named error, not a silent verdict). The build-race sibling path is parked per the seeded thread; this lane has no additional blocker. Helper documentation in fixtures.rs:818-828 already names the ordering caveat and points at run_case/refuse_unavailable_perl as the safety net.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- Late cargo-test receipt was absent at packet time; cannot confirm runtime byte-identity of Rust report rows.
…corpus branch Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7
|
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
- Basis disagreement between cases produces an empty BTreeMap by design (the
bases.len() > 1guard). Findings then keep the owner's start_line and start_column, so location ownership remains the owner's range — a Copy value. No memory hazard, but worth noting the guard in an audit so a future maintainer does not 'fix' it by retaining the partial map. - fact_producer.credential.exposure: the command lives in repo JSON, and corpus validation only checks that every field is non-empty and commit is a 40-char lowercase sha. A Perl corpus can therefore pin a producer command that includes tokens the publisher never intended to expose; a reviewer reading
fact_producer.commandfor an expected shape does not see what runs at production call sites.
Refuted
- box-from-slice / Box::from(slice) allocation failure on the digest path could silently produce a zero-length sha256 and pass the pin check; refuted because: sha256_hex is implemented via the sha2 crate producing a 32-byte fixed array into a Vec; allocation failure returns Err, never a zero-length box. validator surfaces that Err as 'is unreadable', not as a sha256 mismatch.
- The Perl adapter reads packet bytes back as a string with packet_text and could leak to JSON, including the sha256 pin being broadcast in stderr if logging is verbose; refuted because: No secret material exists in the packet (test diffs, file content, oracle metadata); sha256 is committed alongside bytes; no credentials in scope. Adversary model is reviewer, not external attacker.
- The 9 edited packets could be hand-built to match a sha256 on disk and bypass provenance; refuted because: Documented by Devin as PacketProvenance limits (sha256 pins bytes not authorship); validator_holds_perl_packets_to_their_pins_and_provenance tests eight tamper shapes but not path-traversal (../) or packet hash collisions; #3221 is the named issue; edits_cover and bare_cover tests cover the provenance field; sha256 mismatch is the documented check.
Parked follow-ups
- Diff narrowed the probe line to one-based only when exactly that reading matches an added line, else falls back to owner fallback. checked-by-tests
perl_finding_lines_need_one_basis_across_the_packetcovers u32/MAX overflow and disagreement. - Line 416 claims
probe.locationis(line, 1, ...)only when settled; owner fallback path is unchanged. Cached spec diff lacked theSourceLocation::new(... 1)body so I could not double-check the column. parked pending a build that produces the binary.
Review of record — head 211290fCI on this head: Combined tree: I merged 211290f with current main 57ce572 locally (clean merge).
Angles and findings
Resolution: nothing blocking. Merging (squash). Generated by Claude Code |
Requested by Steven · project thread
Summary
Before: ripr's Perl verdicts had no labeled corpus, so a change to a Perl oracle or reach rule could not show whether it made a verdict wrong. Perl findings also sat on the owner's
subline rather than the changed line.After:
fixtures/perl-verdict-corpusholds 36 runtime-labeled Perl cases across Test::More, Test2::V0 and Test::Exception. The requiredverdict-corpus check-allgate scores them with the Rust and TypeScript corpora, and the Perl rates are on the trust scoreboard. A Perl finding lands on the changed line when the diff confirms it.change_lines_from_difftakes whichever reading is the only added line in the diff, and every settled change in a packet must agree on that basis. Otherwise the finding stays on the owner (fail closed). The probe id is unchanged, and main's perl: human output hides every Perl finding because source_currentness is always unresolved_subject #6586 currentness rule is unchanged.fact_producer(a pinned perl-ripr-facts commit). Each case gainsperl_facts: the packet, its sha256, aproduceroredited_producerprovenance, and the edits. Packet cases run on thelang-perlbuild with--perl-facts. If a concurrent default build replaces the binary before the Perl copy, packet cases fail with a named error and are never scored as silent. Packet cases also countunresolved_subjectfindings: ripr keeps zero-based producer findings unresolved. Rows carrypacket_provenance, and the derived summary reportsby_packet_provenance. Rust and TypeScript rows are byte-identical.authored-perl-testmore-shop,-test2-ledger,-testexception-account), 36 cases. Truth comes from hand-written mutants underprove -l t, each with itsmutated_line, because no Perl mutation tool drives all three libraries. 27 cases use the producer packet as written. The other 9 edit a producer packet to reach RIPR-SPEC-0235 examples 1, 12, 13, 14, 19, 23, 24, 25 and 28; their rates are reported separately.Results, producer packets only: 5/15 false actionable, 3/12 false exposed, 0/12 false silent, 8/27 abstained. All verdicts are unchanged by the merge of main. Eight
exposed_without_discriminatorcontradictions are gone after #6584. Gaps filed: #6581, #6582, #6583, #6584 (fixed on main), #6586 (fixed on main), #6619. Evidence was also added to #5421.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: none
Spec: RIPR-SPEC-0245 (Perl corpus section added), RIPR-SPEC-0235 (examples as cases)
ADR: none
Plan item: verdict-corpus coverage per language
Governing issue or accepted claim: #3221 (location); Steven's "effectively full corpus coverage" ask
Acceptance delta (one sentence): Perl verdicts are scored against runtime mutant truth with a regression gate.
Candidate Relationships
Candidate branch:
claude/project-thread-y214zgStack parent or prerequisite PR (if any): none; the TypeScript harness landed on main (#6686) and this branch merges it.
Proposed replacement of PR (if any; not yet accepted): none
Scope Classification
Production delta:
crates/ripr/src/analysis/language/perl/mod.rs: the probe location comes from the diff-confirmed changed line.Evidence/support delta:
Single acceptance criterion:
cargo xtask verdict-corpus check-allpasses and fails on any Perl verdict change.Non-goals:
Support-tier Impact
Claim/proof notes:
Proof
The required check runs on the CI head.
Claim Boundary
May claim: the corpus measures ripr's Perl verdicts on these 36 cases, and every rate is recorded. Must not claim population rates, or that ripr's Perl support is accurate: the producer rates show real false exposed and false actionable verdicts.
Rollback
Revert the squash commit.
Spec-Test-Code Traceability
xtask/src/reports/verdict_corpus_tests.rs(7 Perl tests),perl/tests.rs(3 location tests)xtask/src/reports/verdict_corpus.rs,xtask/src/reports/fixtures.rs,crates/ripr/src/analysis/language/perl/mod.rsfixtures/perl-verdict-corpus/expected/rowstrust.perl_verdict_corpus_*Static Language Check
killed,survived,untested,proven, andadequate.Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.fixtures/**, already allowlisted.Gates
cargo fmt --checkcargo xtask precommit🤖 Generated with Claude Code
https://claude.ai/code/session_011spuQeUHZ5cHS2Hix5zZd7