Skip to content

fix(output): round SARIF and context-packet witness confidence to contract precision (#10717) - #11686

Merged
EffortlessSteven merged 4 commits into
mainfrom
claude/confidence-float-noise
Oct 31, 2026
Merged

EffortlessSteven merged 4 commits into
mainfrom
claude/confidence-float-noise

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

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.confidence and context-packet witness.confidence.value render the same two-decimal value ripr check reports, via the one shared contract_confidence helper, 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.
  • No schema shape change (value precision only); no golden changed.

Proof

cargo test -p ripr --lib contract_precision   # 3 passed (LSP, SARIF, context witness)
cargo xtask precommit                         # exit 0
cargo xtask check-output-contracts            # exit 0
cargo xtask goldens check                     # exit 0, nothing blessed
  • SARIF test asserts the pre-fix fixture is noisy (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.
  • Context witness test uses 0.1_f32 + 0.6_f32 (0.70000005 before the fix; asserted), plus clean 0.4, 0.75, 0.0 and None controls.

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

  • Tests: output::sarif::tests::sarif_finding_confidence_uses_contract_precision, output::json::context_packet::tests::witness_confidence_value_serializes_at_contract_precision
  • Code: domain::diagnostic_witness::contract_confidence, serialize_contract_confidence

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented.
  • Public JSON/schema change documented (value precision only; docs/OUTPUT_SCHEMA.md, changelog fragment).

Generated by Claude Code

…tract precision (#10717)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzUqsYyMR8AtSf8AjSK
@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 31, 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 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 149 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 959cc303-372a-438f-a725-d4196f41db53
Commits

Reviewing files that changed from the base of the PR and between 264db59 and 0f6b06e.

Files selected for processing: 5
  • changelog.d/10717-sarif-context-confidence-two-decimals.md
  • crates/ripr/src/domain/diagnostic_witness.rs
  • crates/ripr/src/output/json/context_packet.rs
  • crates/ripr/src/output/sarif.rs
  • docs/OUTPUT_SCHEMA.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

EffortlessSteven commented Oct 31, 2026 •

Copy link
Copy Markdown
Member Author

CI on head 3174a71 has two failures, both from #11596 on main and neither in this PR's files:

  • Rust gates: check-rust-source-role-authority ("crates/ripr/src/app/repair_attempt/mod.rs re-derives source role with #[cfg(test)]").
  • Rust-only feature lane: cli::commands::agent::refusal_tests::gap_before_phase_refuses_dirty_production_premise_before_the_snapshot and before_phase_refuses_dirty_production_premise_before_the_seam_inventory (stale refusal assertions); 12633 other tests passed.

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

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

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

@EffortlessSteven
EffortlessSteven merged commit 17b4d75 into main Oct 31, 2026
59 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/confidence-float-noise branch October 31, 2026 18:37
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.

2 participants