Repository navigation
fix(xtask): mutation-spot-check accepts calibration schema 0.2 and 0.3 (RIPR-SPEC-0292) - #9017
Conversation
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
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 56 minutes. View limit details
Comment |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.10could be parsed as1.0or0.2coerced to0.20is refuted: gate usesValue::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.10could be parsed as1.0or0.2coerced to0.20is refuted: gate usesValue::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.
There was a problem hiding this comment.
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.1plus 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.
|
Gate failure disposition (run 39531911741, head The single failing subject is The failing test was introduced by #9015 ( 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 |
|
Update after re-fire on post-#9034 main (run 39536601625): the selector_recovery subject still fails, byte-identical assertion (same expected probe |
There was a problem hiding this comment.
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-checkand 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.
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_recordsadmitted 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, addingprovenanceandhow_to_readwithout 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_versionis 0.2 or 0.3, classifying per the version recorded in the document, behind aSUPPORTED_CALIBRATION_SCHEMA_VERSIONSconstant in xtask. Importing the renderer'sMUTATION_CALIBRATION_SCHEMA_VERSIONwas rejected: it ispub(crate)incrates/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, andMUTATION_CALIBRATION_SCHEMA_VERSIONincrates/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
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 tocanonical_precise, and a 0.4 document is refused with the message pinning the found version, the supported set, and the renderer's version owner.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
Validation
cargo fmt --allcargo check -p xtask --all-targetscargo clippy -p xtask --all-targets(no warnings)cargo test -p xtask mutation_spot_check(24 passed, 0 failed)