Repository navigation
fix(output): round SARIF and context-packet witness confidence to contract precision (#10717) - #11686
Conversation
…tract precision (#10717) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzUqsYyMR8AtSf8AjSK
|
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 26 minutes. View limit details
|
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the tests pin two-decimal rendering but do not characterize rounding at a half-way boundary or across the full confidence range.
- Confirm the domain-level serde serializer changes every DiagnosticConfidence serialization route, not only the context packet; the PR's test proof appears limited to the context witness path.
- Confirm the two changed public output routes are connected to contract_confidence, but the stated one-confidence-on-every-surface claim is broader than the evidence.
- Confirm the added tests exercise f32 artifacts and clean controls, but do not establish cross-language or hosted-CI parity.
Refuted
- The PR claims every confidence-bearing surface now shares one precision contract.; refuted because: The PR body explicitly limits the claim to SARIF and context-packet witness confidence and disclaims cross-language end-to-end parity; the changed routes do use the shared helper.
- The added tests are tautological and would pass on the old implementation.; refuted because: The SARIF fixture explicitly checks old widening is noisy, and the context fixture explicitly checks its computed f32 is not 0.7 before asserting the rounded output; these fixtures distinguish old and new behavior.
Evidence gaps
- Repository-wide proof remains pending because the always-on cargo-test receipt was scheduled, while the ripr sensor failed with exit code 2.
- Model proof intent was rejected by deterministic validation.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzUqsYyMR8AtSf8AjSK
|
CI on head 3174a71 has two failures, both from #11596 on main and neither in this PR's files:
Fix PR #11734 covers both ("role-authority sniff, stale refusal assertions") and is open and labeled. Once it merges I'll merge main into this branch and re-request qualification. Output-contract, architecture and goldens checks passed. Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the stated precision contract is not fully characterized for rounding boundaries or the full confidence range.
- Confirm the PR's one-confidence-on-every-surface wording is broader than the directly verified routes.
- Confirm the changed tests pin noisy and clean values but do not characterize halfway or range boundaries.
- Confirm tests pin representative clean and noisy values but do not characterize midpoint rounding or the full confidence range.
Refuted
- The domain-level serde serializer could serialize Some confidence as null or change the JSON schema shape.; refuted because: The implementation serializes Some as f64 and None as none; the focused context test verifies a numeric Some and omitted None value.
- The tests prove cross-language LSP/check parity or hosted CI parity.; refuted because: The PR explicitly disclaims cross-language end-to-end parity and hosted CI; the changed tests only pin the shared Rust helper and selected output routes.
- The fix duplicates confidence-rounding policy across output formats and risks divergence.; refuted because: The domain serde serializer and SARIF route both invoke the single contract_confidence helper; there is no second rounding algorithm in the diff.
- The PR overclaims cross-language end-to-end parity or one-confidence coverage beyond the changed surfaces.; refuted because: The PR body explicitly disclaims cross-language parity, while the changelog claims one confidence on every surface and the diff routes SARIF and context witness confidence through contract_confidence.
Parked follow-ups
- The changelog correctly warns that witness-derived digests change after serialization precision changes.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- The changed routes implement the stated two-decimal contract, but hosted CI, cross-language parity, and half-boundary rounding are not established by the local tests.
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the precision contract is not fully characterized at halfway boundaries or across the confidence range.
- Confirm the focused tests do not characterize half-way rounding boundaries or the full confidence range.
- Confirm the context-packet test exercises the domain serializer directly rather than a serialized context packet, so it does not prove witness nesting still uses that serializer.
- Confirm the broader claim that one confidence is shared on every surface is not fully established by the changed routes; cross-language parity is explicitly disclaimed in the PR body.
- Confirm the domain-level serializer changes every DiagnosticConfidence JSON route, while the PR's direct assertions cover only the context witness route.
Parked follow-ups
- The changelog correctly identifies a compatibility effect beyond display formatting: serialized witness changes alter repair-card digest inputs, although those digests are scoped to one build.
Evidence gaps
- The scheduled cargo-test run and failed ripr sensor do not provide completed regression evidence for this Rust change.
- Model proof intent was rejected by deterministic validation.
Summary
properties.confidencewasjson!(f32), i.e. thef32widened tof64(0.4rendered0.4000000059604645). It now goes throughdomain::contract_confidence, the helper fix(lsp): round diagnostic confidence to the contract's two decimals (#10717) #11062 added for LSP.witness.confidence.value(DiagnosticConfidence.value, plain serdef32) now serializes through the same helper at the domain type (serialize_with), sof32computation artifacts (e.g.0.1 + 0.6=0.70000005) render0.7.confidencealready print{:.2}; LSP was fixed in fix(lsp): round diagnostic confidence to the contract's two decimals (#10717) #11062. One finding now carries one confidence on every surface that carries one.Source-of-truth Links
Governing issue or accepted claim: #10717 (remaining surfaces after #11062; claim comment on the issue)
Acceptance delta (one sentence): SARIF
properties.confidenceand context-packetwitness.confidence.valuerender the same two-decimal valueripr checkreports, via the one sharedcontract_confidencehelper, pinned by tests that use values which are noisy before the fix.Scope
crates/ripr/src/domain/diagnostic_witness.rs,output/sarif.rs,output/json/context_packet.rs(test),docs/OUTPUT_SCHEMA.md, changelog fragment.Proof
json!(0.4_f32)has more than 6 chars) for 0.4/0.92/0.6, with 0.75 as the already-clean negative control, then asserts the rendered value.0.1_f32 + 0.6_f32(0.70000005before the fix; asserted), plus clean0.4,0.75,0.0andNonecontrols.Not established: hosted CI. Cross-language (Rust/Python/TypeScript) LSP-vs-check parity fixture from the issue's acceptance is not done here; the existing LSP unit test and these tests pin the shared helper, not a per-language end-to-end comparison. MCP carries no finding-level confidence (separate gap).
Claim Boundary
May claim: SARIF and context-packet witness confidence use contract precision. Must not claim: cross-language end-to-end parity.
Rollback
Revert the commit.
Spec-Test-Code Traceability
output::sarif::tests::sarif_finding_confidence_uses_contract_precision,output::json::context_packet::tests::witness_confidence_value_serializes_at_contract_precisiondomain::diagnostic_witness::contract_confidence,serialize_contract_confidenceEngineering Check
panic,unwrap,expect,todo, orunimplemented.docs/OUTPUT_SCHEMA.md, changelog fragment).Generated by Claude Code