Skip to content

fix(proof): withhold deterministic proof credit after signal termination - #1646

Merged
EffortlessSteven merged 5 commits into
mainfrom
fix/1542-signal-terminated-no-credit
Nov 5, 2026
Merged

EffortlessSteven merged 5 commits into
mainfrom
fix/1542-signal-terminated-no-credit

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Defect (#1542)

A proof command killed by infrastructure (OOM / cgroup kill) completes as status="failed", exit_code=null, timed_out=false. The receipt constructor's catch-all serialized that as an ordinary failure, and the focused producers promoted any failed command to deterministic aggregate credit: red/green base+tests -> discriminating (gate-passing for required proofs), HEAD-only / red-green HEAD / focused build -> head_failed. An infra kill therefore produced false deterministic proof evidence, exactly the signature confirmed in the issue.

Fix

Keep a genuine exit-7 failure promoting exactly as before, and refuse credit when the failing command carries no exit code:

  • Producers (src/proof/red_green.rs HEAD-only arm, red/green HEAD arm, red/green base arm; src/proof/build.rs build arm): "failed" if <cmd>.exit_code.is_some() keeps the credit arm; a failed command with no exit code projects the new aggregate result terminated_without_exit_code. The red/green producer also stops before launching base+tests when HEAD terminates this way.
  • Consumers: proof_receipt_is_missing_evidence (src/decision_core.rs) classifies the new result as missing evidence, so witness status stays needs-witness and required proofs stay non-blocking (Skipped) through the existing _ arms; the terminal work-queue verifier admits the new result (src/work_queue/terminal.rs); review_text's missing-proof consumer renders it as terminated without an exit code with no established test verdict (src/review_text.rs); the gate Skipped-arm comment lists it (src/gate.rs).
  • Raw command receipts are unchanged: status stays "failed" with reason, streams, and duration preserved under the existing schema, as the issue's selected bounded candidate requires (pinned by signal_terminated_command_preserves_raw_failed_receipt_projection).

Validation

From worktree F:/Temp/fix-1542, shared target dir (Windows; Unix-gated tests skipped here, covered by the Linux gate):

  • cargo fmt --all --check — clean.
  • cargo clippy --locked --workspace --all-targets — no warnings from this diff. Three pre-existing platform-conditional warnings verified byte-identical on origin/main: tests/common/executable_fixture.rs fixture_status, tests/pr_context_hydration.rs:40 children (push is behind #[cfg(target_os = "linux")]), src/proof/red_green.rs:385 import.
  • cargo test --locked --bin ub-review proof:: — 199 passed, 0 failed (includes the 4 new tests).
  • cargo test --locked --bin ub-review -- proof:: decision_core gate:: review_text terminal render witness — 374 passed, 1 failed: proof::broker::tests::accounting_matrix_releases_early_commands_before_required_build, a pre-existing Windows parallel-batch flake that fails identically on pristine origin/main under the same batch (verified in a detached baseline worktree) and passes in isolation on both.
  • Fail-before proof: reverting only the four producer guards makes the three new producer regressions fail on the pre-fix behavior (killed base -> "discriminating", killed head -> "head_failed", killed build -> "head_failed"); restored, all pass.

Known gaps

  • Windows STATUS_CONTROL_C_EXIT-class terminations carry a Some(exit_code), so this guard does not withhold them. The issue's bounded candidate guards on "an available exit code" while preserving the raw receipt schema; NTSTATUS-class detection would require the schema/vocabulary change fix(proof): withhold deterministic proof credit after signal termination #1542 explicitly excludes. Unix signal kills (exit_code: None) — the reported infra-kill class — are covered.
  • live_self_terminating_base_command_yields_no_discriminating_credit (real /bin/sh self-SIGTERM through the shared process adapter) and the other Unix-gated tests did not run on Windows; the Linux gate covers them.

Fixes #1542

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 152 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: f59e047b-f400-43c1-9620-3b843a11066e
Commits

Reviewing files that changed from the base of the PR and between b899c18 and 77124b7.

Files selected for processing: 8

  • .ripr/suppressions.toml
  • src/decision_core.rs
  • src/gate.rs
  • src/proof/build.rs
  • src/proof/command.rs
  • src/proof/red_green.rs
  • src/review_text.rs
  • src/work_queue/terminal.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven
EffortlessSteven force-pushed the fix/1542-signal-terminated-no-credit branch 2 times, most recently from 072da04 to 2db06b3 Compare November 5, 2026 00:35
@EffortlessSteven
EffortlessSteven force-pushed the fix/1542-signal-terminated-no-credit branch from 9df38f7 to f18d073 Compare November 5, 2026 00:57
@EffortlessSteven
EffortlessSteven merged commit 9892a2d into main Nov 5, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(proof): withhold deterministic proof credit after signal termination

2 participants