Skip to content

fix(xtask): mutation-spot-check accepts calibration schema 0.2 and 0.3 (RIPR-SPEC-0292) - #9017

Merged
EffortlessSteven merged 4 commits into
mainfrom
fix/spot-check-schema
Oct 21, 2026
Merged

EffortlessSteven merged 4 commits into
mainfrom
fix/spot-check-schema

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #8996

Acceptance delta (one sentence): cargo xtask mutation-spot-check classifies both 0.2 and 0.3 mutation-calibration reports, and a report at any other schema version is refused with an actionable message naming the supported versions.

Design decision

classify_records admitted exactly one hard-coded calibration schema version (CALIBRATION_SCHEMA_VERSION = "0.2"). RIPR-SPEC-0286 (PR #8988, still in flight) moves the renderer to schema 0.3, adding provenance and how_to_read without changing the joined-record shape the spot check scores. Because this base still renders 0.2, the fix must work both before and after #8988 lands.

Decision: admit documents whose schema_version is 0.2 or 0.3, classifying per the version recorded in the document, behind a SUPPORTED_CALIBRATION_SCHEMA_VERSIONS constant in xtask. Importing the renderer's MUTATION_CALIBRATION_SCHEMA_VERSION was rejected: it is pub(crate) in crates/ripr, and making xtask depend on the product crate (or widening the constant's visibility) for one gate is a bigger coupling than the drift risk justifies. The duplicated constant carries a comment naming the owner and spec, and the refusal message names the owner so a future renderer bump that forgets the set is diagnosable from the error alone.

Refusal message

A document at any other version (older than 0.2, newer than the supported set, or missing schema_version) fails closed before any record is scored. The message names the version found in the document, the supported versions, and MUTATION_CALIBRATION_SCHEMA_VERSION in crates/ripr/src/output/mutation_calibration.rs (with its before/after RIPR-SPEC-0286 values), and tells the operator to rebuild ripr and re-run the spot check.

Spec

  • docs/specs/RIPR-SPEC-0292-spot-check-schema-admission.md (registered in docs/specs/README.md, policy/doc-artifacts.toml, .ripr/traceability.toml, and the four verdict-corpus spec-coverage files as out-of-scope for corpus labeling)

Test updates

  • calibration_without_span_joins_or_with_missing_records_is_refused (existing): repinned to the new actionable refusal message (0.1 case).
  • calibration_schema_0_3_classifies_and_unknown_versions_are_refused (new): a 0.3 document classifies to canonical_precise, and a 0.4 document is refused with the message pinning the found version, the supported set, and the renderer's version owner.
  • Existing 0.2-synthesizing tests (only_canonical_joins_of_supported_families_are_scoreable, a_run_scoring_one_family_still_ingests, operator_token_is_a_diagnostic_that_cannot_veto_a_canonical_join, and the dx-scoreboard ingest tests) are unchanged and stay green: 0.2 remains admitted.

Non-goals

  • No change to classification logic, dispositions, or scored verdict families; admission is a gate in front of the unchanged classifier.
  • No import of the renderer constant into xtask (see Design decision); the duplicated-with-pointer constant is the deliberate design.
  • No change to report generation; the renderer's schema version and the 0.3 additions remain owned by RIPR-SPEC-0286 / PR fix(calibrate): preserve saved provenance and schema reader compatibility #8988.
  • Versions older than 0.2 stay refused (pre-0.2 reports lack the span-containment join).

Validation

  • cargo fmt --all
  • cargo check -p xtask --all-targets
  • cargo clippy -p xtask --all-targets (no warnings)
  • cargo test -p xtask mutation_spot_check (24 passed, 0 failed)
  • Touched TOMLs parse with no duplicate ids (doc-artifacts, traceability, four corpus spec-coverage files)

Devin Review

classify_records gated on a single hard-coded calibration schema
version (0.2), so the gate would refuse every report once RIPR-SPEC-0286
(PR #8988, in flight) moves the renderer to 0.3. Admit documents whose
schema_version is 0.2 or 0.3 and classify per the version in the
document; both share the joined-record shape the spot check scores.

xtask cannot import the renderer's pub(crate)
MUTATION_CALIBRATION_SCHEMA_VERSION, so the supported set is a
duplicated constant with a comment pointing at the owning constant and
spec. A document at any other version (older than 0.2, newer than the
supported set, or missing the field) is refused with an actionable
message naming the found version, the supported versions, and the
renderer's version owner.

Spec: docs/specs/RIPR-SPEC-0292-spot-check-schema-admission.md
Issue: #8996
@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 Oct 21, 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 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 77 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
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 997efddb-cfe9-4fcd-8327-3a90863b37f2
📥 Commits

Reviewing files that changed from the base of the PR and between 0d58bf7 and 80da9a9.

📒 Files selected for processing: 10
  • .ripr/traceability.toml
  • changelog.d/8996-spot-check-schema-admission.md
  • docs/specs/README.md
  • docs/specs/RIPR-SPEC-0292-spot-check-schema-admission.md
  • fixtures/perl-verdict-corpus/spec-coverage.toml
  • fixtures/python-verdict-corpus/spec-coverage.toml
  • fixtures/rust-verdict-corpus/spec-coverage.toml
  • fixtures/typescript-verdict-corpus/spec-coverage.toml
  • policy/doc-artifacts.toml
  • xtask/src/reports/mutation_spot_check.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@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 sUPPORTED_CALIBRATION_SCHEMA_VERSIONS is a duplicated gate; drift only surfaces via the actionable refusal message rather than a compile-time check. Per RIPR-SPEC-0292 Rule 2 this is the deliberate trade-off, so opposition demotes it to a residual risk rather than a blocker — verify only that the doc-pointer comment and the refusal-message owner name survive any later renames of MUTATION_CALIBRATION_SCHEMA_VERSION in crates/ripr/src/output/mutation_calibration.rs.

Refuted

  • The unsupported branch might dereference a JSON number version and misclassify 0.10 as 1.0 or coerce 0.2==0.20; refuted because: schema_version is read via Value::as_str() after failing through to "missing"; membership test is &str contains on &[&str]; no numeric coercion path exists.
  • The duplicated constant will silently rot when the renderer moves to 0.4 and xtask forgets to bump the set, silently misclassifying future reports.; refuted because: The refusal message names the renderer's owning constant and its before/after RIPR-SPEC-0286 values, and explicitly instructs 'rebuild ripr and re-run cargo xtask mutation-spot-check'. A drift surfaces as a readable Err per record, not a silent misclassification; collapse is fail-closed, not fail-open.
  • Admitting 0.3 unconditionally could let a renderer that dropped required pre-0.2 fields classify as canonical_precise, because the gate is purely on schema_version not on field presence; refuted because: The 0.3 spec text and the new test only assert joined-record shape parity; pre-0.2 fields are not re-checked at this gate. However, 0.3 is defined as 0.2 + provenance + how_to_read, so a valid 0.3 document is a superset of a valid 0.2 document by the owning renderer's contract. Pre-0.2 documents are still refused by the supports gate. The objection is therefore logically consistent with the in-flight RIPR-SPEC-0286 contract rather than a bug in this PR.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

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

Refuted

  • A non-canonical schema_version spelling (e.g. '0.3 ' or 'v0.3') could bypass admission or be misclassified as 0.3 via numeric coercion.; refuted because: schema_version is read via Value::as_str() with unwrap_or("missing"); membership is &str equality against &[&str]. No numeric coercion, no trimming, no prefix match. Whitespace or alternate spellings fail closed with the exact found string printed, which matches Rule 3.
  • Prior opposition concern that 0.10 could be parsed as 1.0 or 0.2 coerced to 0.20 is refuted: gate uses Value::as_str() and &[&str]::contains, no numeric coercion.
  • A 0.10 calibration doc would be misclassified as 1.0 or coerced equal to 0.2 because schema_version flows through a numeric path.; refuted because: schema_version is read via Value::as_str().unwrap_or("missing") in classify_records; SUPPORTED_CALIBRATION_SCHEMA_VERSIONS is &[&str], membership is &str contains; no f64/u64 parse, no semver-style compare, no numeric coercion anywhere on the gate path.
  • Importing MUTATION_CALIBRATION_SCHEMA_VERSION from crates/ripr into xtask (via a feature flag or a new pub constant) is a smaller, more correct fix than duplicating the supported set in xtask.; refuted because: xtask must not depend on the product crate per the workspace layout, and the constant is pub(crate) by design; widening visibility or adding a xtask-only dep for one gate is a larger coupling than the drift risk that the doc-pointer comment and refusal-message owner-name already diagnose from the error alone. Smallest complete fix for this issue is the admission gate, not a cross-crate refactor.
  • The supported set could silently classify an unknown future schema as compatible.; refuted because: The gate is exact string membership and unknown versions produce an actionable refusal; future renderer drift remains a deliberate maintenance risk, not a demonstrated defect.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.
  • Prior opposition concern that 0.10 could be parsed as 1.0 or 0.2 coerced to 0.20 is refuted: gate uses Value::as_str() and &[&str]::contains, no numeric coercion.

The merge-ready precommit diff-check rejects a new blank line at EOF;
the spot-check registration row left one behind.

@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 reviewer attention before upstream: findings remain.

Confirmed findings

  • ripr sensor failed with exit 2; the spec/traceability additions are gated by ripr's classifier so failures there could mask doc registration regressions. Cargo-test receipt is still scheduled-late, so this is a missing-evidence flag, not a behavior bug.

Verification questions

  • Confirm new 0.3-classifies test pins identical joined-record shape processing and refuses 0.4 with the owner-naming actionable message; repinned 0.1 test asserts schema 0.1 plus supported-set plus owner-string substrings.

Refuted

  • Importing MUTATION_CALIBRATION_SCHEMA_VERSION from crates/ripr into xtask (e.g. via a feature flag or pub constant) is a smaller, more correct fix than the duplicated-with-pointer constant.; refuted because: xtask must not depend on the product crate per workspace layout, and the existing constant is pub(crate); widening visibility for one spot-check gate is a bigger coupling than the drift the comment-and-error-pointer guards. The opposition lane explicitly demotes this to residual risk per RIPR-SPEC-0292 Rule 2.
  • Concern: a 0.10 calibration document could be misclassified as 1.0, or '0.2' parsed as 0.20, because the gate flows schema_version through a numeric path.; refuted because: schema_version is read via Value::as_str().unwrap_or("missing") in classify_records; SUPPORTED_CALIBRATION_SCHEMA_VERSIONS is &[&str] and membership is &[&str]::contains(&&str) - plain string equality on the exact supported values. There is no f64/u64 parse, no semver-style compare, no trim, no prefix match anywhere on the gate path. A version like '0.10' would never equal '0.2' or '0.3' under string equality and would be refused with the exact found string printed.

Parked follow-ups

  • Duplicate-constant drift is a residual risk per spec Rule 2; refusal message names owner MUTATION_CALIBRATION_SCHEMA_VERSION so a forgotten bump is diagnosable from error alone.
  • Residual drift risk: if crates/ripr/src/output/mutation_calibration.rs is renamed/relocated, the refusal message string and the xtask comment name stale paths; this is accepted as the deliberate trade-off (RIPR-SPEC-0292 Rule 2) and is a parked follow-up rather than a blocker.
  • Parked follow-up, not a finding: the new 0.3/0.4 test asserts the 0.4 refusal message wording but not the 0.3 success-path wording; the doc-pointer comment and MUTATION_CALIBRATION_SCHEMA_VERSION ownership name live only in source comments and the configurable error string. A later rename of the renderer-side constant name (or of the crates/ripr/src/output/mutation_calibration.rs path) would not be caught by tests; only by manual audit. This is exactly the gate-trade-off RIPR-SPEC-0292 Rule 2 calls out and the prior thread already flagged.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Gate failure disposition (run 39531911741, head fd7522aec): INHERITED MAIN BREAKAGE, not this diff.

The single failing subject is selector_recovery_scope::selector_recovery_replays_committed_worktree_and_supplied_diff_scopes ("committed explain recovery changed subject … expected probe:src_committed.rs … excluded probe:src_worktree.rs"). This diff touches only xtask/src/reports/mutation_spot_check.rs plus spec/traceability/corpus registrations — no cli/explain/context/selector path.

The failing test was introduced by #9015 (8bb3399bd). A repair lane claiming issue #9033 is already in flight (head a270c445d: "main's selector_recovery… passes again by applying #9034's dirty-tree default for explain/context only when no --base was given") and is currently parked at admission (candidate_not_open_ready).

Holding this PR's re-fire until main's selector-recovery subject passes again; re-firing before that would just re-roll a known-red main subject. Local check-spec-numbering/check-traceability/check-support-tiers-adjacent gates for this diff's own surface pass.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Update after re-fire on post-#9034 main (run 39536601625): the selector_recovery subject still fails, byte-identical assertion (same expected probe src_committed.rs:predicate:cccbf91e, same excluded src_worktree.rs:predicate:70c58575, same input identity sha256). So the #9033-lane premise that #9034's dirty-tree default restores this test did not hold in the hosted gate — the failure is deterministic, not flaky. This PR remains held; it cannot earn the required check until main's selector-recovery subject passes. The merge-ready label is intentionally left off to avoid queue churn.

@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 reviewer attention before upstream: findings remain.

Confirmed findings

  • Hosted gate failure on selector_recovery is inherited from main (#9015/#9033/#9034) per PR thread; not regressed by this diff but blocks this PR from earning required check until main turns green.
  • Documented owner pointer (MUTATION_CALIBRATION_SCHEMA_VERSION path + before/after RIPR-SPEC-0286 values) is duplicated in source comment and refusal message; a future rename of the owner constant would silently rot the diagnostic until the next refused report. Demote to residual risk per RIPR-SPEC-0292 Rule 2.

Verification questions

  • Confirm ripR sensor failed exit 2 on this PR; spec/traceability/policy/corpus additions route through that same classifier path. Re-run ripr before merge to confirm doc registrations pass and the failure is unrelated to the 0.2/0.3 admission change.

Refuted

  • Importing MUTATION_CALIBRATION_SCHEMA_VERSION from crates/ripr into xtask would be a smaller, more correct fix than duplicating the supported set with a doc pointer.; refuted because: Rejected by RIPR-SPEC-0292 Rule 2 and PR body's Design decision: xtask cannot depend on the product crate; constant is pub(crate); widening visibility for one spot-check gate is larger coupling than the drift risk the refusal-message owner-pointer guards. Opposition lane demotes this to residual risk per Rule 2.
  • No public API surface is touched, so this lane should be empty; refuted because: Diff is public: failure message + supported-version set change is observable behavior of cargo xtask mutation-spot-check and the msg text appears in unit-test assertions.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.
  • ripr sensor exit 2 is independent of this diff; doc/traceability additions are gated through the same classifier PR #9017 is editing.
  • rip sensor failed exit 2; spec/traceability additions are ripr-classifier-gated, so a failure could mask doc-registration regressions; cargo-test receipt still scheduled-late.

@EffortlessSteven
EffortlessSteven merged commit 9531281 into main Oct 21, 2026
46 of 47 checks passed
@EffortlessSteven
EffortlessSteven deleted the fix/spot-check-schema branch October 21, 2026 08:52
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.

1 participant