Skip to content

fix(proof): distinguish exhausted proof budget from an expired runner deadline #1353

Closed

Description

@EffortlessSteven

Parents / bounded scope

#1339/#1341 truthful current-product diagnostics; #1310 terminal accounting and #1270 economics retain their owners. Related future #992/#994 scheduling work is not replaced. This leaf corrects the reason attached to an existing deferral; it does not raise budgets, activate a scheduler or make unexecuted Required work pass.

Source-confirmed defect

At main 7453db0a4f1976b4a6b5481da06e4cfd0837b902, src/proof/broker.rs::select_proof_portfolio computes:

let effective_max_seconds = input.budget.max_total_seconds
    .min(input.runtime.deadline_remaining_seconds);

Its failure branch reports hard deadline has expired; proof was safely wound down whenever effective_max_seconds == 0 || deadline_cannot_fit. These conditions also hold when the proof allocation is zero but the hard deadline is still far away, or a task cannot fit a nonzero remaining deadline. Neither proves an expired deadline.

Retained real example: PR #1347 head 9fa5ac2353194209b26d89672fb7c66bf4810a93, run 38006904966, artifact 11651950018, ZIP SHA256 540af8070e670d6985fc8ad7988e0753309a719f033cec41d2731097d540ac3e. review/proof_portfolio.json records:

  • budget_seconds=0, remaining_seconds=0;
  • runtime.deadline_remaining_seconds=3406;
  • three Required build tasks deferred with the expired-deadline reason.

The packet is historical evidence, not a newly executed main run. The current selector still contains the exact branch. A fresh issue search for the literal expired-deadline reason found no dedicated diagnostic repair.

Outcome

Report the actual limiting condition using the narrowest existing diagnostic/receipt contract: configured proof work disabled, allocated proof time exhausted, hard deadline truly expired, estimated task cannot fit remaining wall time, task/file-count capacity exhausted, or runner resource lease does not fit. Preserve deterministic precedence when more than one constraint applies.

Selection, execution, Required status, receipt satisfaction and thresholds must remain unchanged. Do not relabel missing execution as completed work. Changes to typed fields/status vocabulary need explicit producer/verifier compatibility; correcting text must not create an unowned parallel scheduler-reason model.

Acceptance / tests

  • First add a regression through the actual selector for proof budget 0 and deadline 3406: task remains unexecuted, reason must not assert deadline expiry.
  • Positive proof budget and deadline 0 reports genuine expiry.
  • Remaining deadline > 0 but below estimated task cost reports inability to fit, not time already expired.
  • Positive wall time with exhausted allocation, zero task count, zero allowed test files and insufficient resources are distinguishable with deterministic precedence.
  • Required and optional tasks retain their existing selection/deferral and non-pass accounting; satisfying exact receipts still bypass unnecessary execution.
  • Boundary tests cover zero/equality/one-below costs and saturating arithmetic without charging timeout ceilings as observed elapsed time.
  • Serialized portfolio, terminal/fill diagnostics and human recovery guidance agree about the limiting condition.
  • Negative tests would fail if reasons collapse back to generic deadline expiry; retain focused red/green plus current baseline, required checks and independent exact-head review.

Non-goals / rollback

No larger proof allocation, Required-first migration, deduplication, cache changes, analyzer pin/threshold/suppression changes, workflow changes, deployment or release. This does not claim to fix the underlying Required starvation; #1309/#1310 and the canonical plan/scheduler train retain that work. Preserve the observed contradictory packet and restore compatibility explicitly if the diagnostic change must be reverted.

Activity

  1. added
    bug
    on Oct 10, 2026
  2. EffortlessSteven commented on Oct 10, 2026

    @EffortlessSteven
    MemberAuthor

    @codex implement this bounded diagnostic repair in a new PR against current main 7453db0. Preserve all scheduling, budgets, status vocabulary, Required satisfaction, analyzer pins and suppressions; change only the explanation of the actual limiting constraint. Use the existing select_proof_portfolio path and tests, retain tests-first RED for budget0/deadline3406, true deadline0, nonzero deadline too small, task/file/resource constraints and exact-receipt controls. Record actual test results and request independent exact-head review. Do not merge a red required gate or alter protection/release settings. This is a bounded implementation lane; I am separately handling #1340/#1342 README onboarding and will not edit src/proof/broker.rs.

  3. chatgpt-codex-connector commented on Oct 10, 2026

    @chatgpt-codex-connector

    Summary

    • Updated select_proof_portfolio to preserve the existing scheduling decisions and status vocabulary while reporting the actual limiting constraint: runner capacity, expired deadline, exhausted proof-time allocation, exhausted task/file capacity, or insufficient remaining deadline.
    • Added selector-level regression coverage for the reported budget=0 / deadline=3406 case, genuine deadline expiration, nonzero-but-insufficient deadlines, and zero task/file capacities. The tests confirm that work remains deferred rather than being treated as executed.
    • Added equality, one-below, and saturating-u64 boundary coverage without changing task-cost accounting.
    • Updated serialized-portfolio and human-summary assertions while retaining Required work as unproven and preserving its existing accounting.
    • Updated the existing nonzero-deadline test to require an inability-to-fit explanation rather than falsely claiming the deadline already expired.
    • Committed the changes as 43b4c128b07affb37897c79e6063fecbf694cd38 and created the requested PR metadata, including a request for independent exact-head review.

    Testing

    • ✅ cargo test portfolio_reports_the_actual_safe_wind_down_constraint -- --nocapture — initially produced the expected tests-first RED failure because budget exhaustion was incorrectly reported as deadline expiration.
    • ✅ cargo test portfolio_reports_the_actual_safe_wind_down_constraint
    • ✅ cargo test portfolio_deadline_cost_boundary_is_inclusive_and_saturating
    • ✅ cargo test portfolio_winds_down_when_the_remaining_deadline_cannot_fit_a_task
    • ✅ cargo test portfolio_declines_work_that_does_not_fit_the_current_box
    • ✅ cargo test portfolio_does_not_reuse_receipt_from_another_head
    • ✅ cargo fmt --check
    • ✅ git diff --check
    • ✅ cargo test — all 1,120 unit tests and integration suites passed; one subprocess-driver test was intentionally ignored.
    • ✅ cargo clippy --all-targets --all-features -- -D warnings
    • ✅ git status --short --branch — clean working tree after commit.

    View task →

  4. EffortlessSteven commented on Oct 10, 2026

    @EffortlessSteven
    MemberAuthor

    @codex follow through on the existing task result, not a new implementation. GitHub commit lookup cannot resolve reported 43b4c128b07affb37897c79e6063fecbf694cd38, and a fresh open-PR search for #1353 returned none. Creating PR metadata in the task is not remote publication. Push the reviewed local commit to a new ordinary branch and open the real GitHub PR using the available authenticated integration, preserving base7453db0 and history. Do not merge or change any credential/protection setting. Reply with the actual remote PR URL and SHA. If that environment has no push capability, explicitly say so and return the exact unified diff plus tests-first failure output in a durable GitHub comment so the completed work is recoverable; do not report publication success without checking the remote objects.

  5. chatgpt-codex-connector commented on Oct 10, 2026

    @chatgpt-codex-connector

    Summary

    • Recovered the bounded diagnostic repair on a new local branch, fix/proof-wind-down-diagnostics, based directly on 7453db0a4f1976b4a6b5481da06e4cfd0837b902.
    • Committed the repair as 9318e507d8f6fd71df74fda1ccd307f0278fb13e.
    • The selector now distinguishes actual runner-capacity, expired-deadline, proof-allocation, task-count, file-count, remaining-wall-time, and remaining-allocation constraints without changing its selection/status logic.
    • Updated serialized-portfolio and human-summary assertions while preserving Required work as unproven.
    • Added selector-level regression coverage for budget 0 with deadline 3406, genuine deadline expiration, insufficient nonzero wall time, zero task capacity, and zero file capacity.
    • Added equality, one-below, and saturating-u64 deadline/cost boundary coverage.

    Publication status

    No remote PR URL exists. I am explicitly not reporting publication success.

    The environment has no authenticated Git push capability:

    fatal: could not read Username for 'https://github.com': No such device or address
    

    A subsequent remote-object check returned no refs/heads/fix/proof-wind-down-diagnostics entry. The available make_pr integration only recorded PR metadata; it did not publish the commit or create a remote GitHub PR.

    Recoverable unified diff

    diff --git a/src/proof/broker.rs b/src/proof/broker.rs
    index a86ceae..f272c5e 100644
    --- a/src/proof/broker.rs
    +++ b/src/proof/broker.rs
    @@ -443,10 +443,25 @@ pub(crate) fn select_proof_portfolio(input: ProofPortfolioInput<'_>) -> ProofPor
                 } else {
                     "declined_for_higher_value_proof"
                 };
    +            let remaining_allocation = input.budget.max_total_seconds.saturating_sub(used_seconds);
    +            let remaining_deadline = input
    +                .runtime
    +                .deadline_remaining_seconds
    +                .saturating_sub(used_seconds);
                 let reason = if !fits_box {
                     "proof lease does not fit the current runner capacity"
    -            } else if effective_max_seconds == 0 || deadline_cannot_fit {
    +            } else if input.runtime.deadline_remaining_seconds == 0 {
                     "hard deadline has expired; proof was safely wound down"
    +            } else if remaining_allocation == 0 {
    +                "proof-time allocation is exhausted"
    +            } else if used_tasks >= input.budget.max_focused_tests {
    +                "proof task capacity is exhausted"
    +            } else if !file_available {
    +                "focused test-file capacity is exhausted"
    +            } else if candidate_task.estimated_cost_sec > remaining_deadline {
    +                "estimated task cost cannot fit the remaining hard-deadline wall time"
    +            } else if candidate_task.estimated_cost_sec > remaining_allocation {
    +                "estimated task cost cannot fit the remaining proof-time allocation"
                 } else if candidate_task.required {
                     "required floor could not fit inside the remaining safe proof budget"
                 } else {
    @@ -2641,10 +2656,7 @@ mod tests {
                 .ok_or_else(|| anyhow::anyhow!("merged portfolio lost primary task-a"))?;
             ensure!(decision_a.required);
             ensure!(decision_a.status == "deferred_by_safe_wind_down");
    -        ensure!(
    -            decision_a.reason
    -                == "required floor could not fit inside the remaining safe proof budget"
    -        );
    +        ensure!(decision_a.reason == "proof task capacity is exhausted");
             ensure!(
                 snapshot
                     .decisions
    @@ -2678,7 +2690,7 @@ mod tests {
             ensure!(summary.contains("task-a"), "{summary}");
             ensure!(summary.contains("req-a"), "{summary}");
             ensure!(
    -            summary.contains("required floor could not fit inside the remaining safe proof budget"),
    +            summary.contains("proof task capacity is exhausted"),
                 "{summary}"
             );
             ensure!(summary.contains("receipts: none"), "{summary}");
    @@ -2885,7 +2897,89 @@ mod tests {
                 .first()
                 .ok_or_else(|| anyhow::anyhow!("missing deadline decision"))?;
             ensure!(decision.status == "deferred_by_safe_wind_down");
    -        ensure!(decision.reason.contains("hard deadline"));
    +        ensure!(decision.reason.contains("cannot fit"));
    +        Ok(())
    +    }
    +
    +    #[test]
    +    fn portfolio_reports_the_actual_safe_wind_down_constraint() -> Result<()> {
    +        let test = focused_test_task("parser", Vec::new(), 30);
    +        let cases = [
    +            (
    +                proof_budget_for_test(1, 0),
    +                portfolio_runtime_for_test(3_406, 4, Some(8_192), Some(20_000)),
    +                "proof-time allocation is exhausted",
    +            ),
    +            (
    +                proof_budget_for_test(1, 60),
    +                portfolio_runtime_for_test(0, 4, Some(8_192), Some(20_000)),
    +                "hard deadline has expired",
    +            ),
    +            (
    +                proof_budget_for_test(1, 60),
    +                portfolio_runtime_for_test(29, 4, Some(8_192), Some(20_000)),
    +                "cannot fit",
    +            ),
    +            (
    +                proof_budget_for_test(0, 60),
    +                portfolio_runtime_for_test(60, 4, Some(8_192), Some(20_000)),
    +                "task capacity is exhausted",
    +            ),
    +            (
    +                ProofBudget {
    +                    max_focused_test_files: 0,
    +                    ..proof_budget_for_test(1, 60)
    +                },
    +                portfolio_runtime_for_test(60, 4, Some(8_192), Some(20_000)),
    +                "test-file capacity is exhausted",
    +            ),
    +        ];
    +
    +        for (budget, runtime, expected_reason) in cases {
    +            let selection = select_proof_portfolio(ProofPortfolioInput {
    +                test_tasks: std::slice::from_ref(&test),
    +                build_tasks: &[],
    +                proof_requests: &[],
    +                proof_receipts: &[],
    +                head: "head",
    +                budget,
    +                runtime,
    +            });
    +            ensure!(selection.test_tasks.is_empty());
    +            let decision = selection
    +                .decisions
    +                .first()
    +                .ok_or_else(|| anyhow::anyhow!("missing safe-wind-down decision"))?;
    +            ensure!(decision.status == "deferred_by_safe_wind_down");
    +            ensure!(
    +                decision.reason.contains(expected_reason),
    +                "expected {expected_reason:?}, got {:?}",
    +                decision.reason
    +            );
    +        }
    +        Ok(())
    +    }
    +
    +    #[test]
    +    fn portfolio_deadline_cost_boundary_is_inclusive_and_saturating() -> Result<()> {
    +        let test = focused_test_task("parser", Vec::new(), u64::MAX);
    +        for (deadline, selected) in [(u64::MAX, true), (u64::MAX - 1, false)] {
    +            let selection = select_proof_portfolio(ProofPortfolioInput {
    +                test_tasks: std::slice::from_ref(&test),
    +                build_tasks: &[],
    +                proof_requests: &[],
    +                proof_receipts: &[],
    +                head: "head",
    +                budget: ProofBudget {
    +                    per_command_timeout_sec: u64::MAX,
    +                    max_total_seconds: u64::MAX,
    +                    ..proof_budget_for_test(1, u64::MAX)
    +                },
    +                runtime: portfolio_runtime_for_test(deadline, 4, Some(8_192), Some(20_000)),
    +            });
    +            ensure!((!selection.test_tasks.is_empty()) == selected);
    +            ensure!(selection.remaining_seconds == if selected { 0 } else { deadline });
    +        }
             Ok(())
         }

    Testing

    • ✅ cargo test portfolio_reports_the_actual_safe_wind_down_constraint -- --nocapture — tests-first RED produced: expected "proof-time allocation is exhausted", got "hard deadline has expired; proof was safely wound down".
    • ✅ cargo test portfolio_reports_the_actual_safe_wind_down_constraint
    • ✅ cargo test portfolio_deadline_cost_boundary_is_inclusive_and_saturating
    • ✅ cargo test portfolio_winds_down_when_the_remaining_deadline_cannot_fit_a_task
    • ✅ cargo test portfolio_declines_work_that_does_not_fit_the_current_box
    • ✅ cargo test portfolio_does_not_reuse_receipt_from_another_head
    • ✅ cargo test — 1,120 unit tests and all integration suites passed; one subprocess-driver test was intentionally ignored.
    • ✅ cargo clippy --all-targets --all-features -- -D warnings
    • ✅ cargo fmt --check
    • ✅ git diff --check
    • ✅ git status --short --branch — clean local branch after commit.
    • ⚠️ git push -u origin fix/proof-wind-down-diagnostics — unavailable because the environment has no GitHub credentials.
    • ⚠️ git ls-remote origin 'refs/heads/fix/proof-wind-down-diagnostics' — returned no remote branch, confirming that the commit was not published.

    View task →

  6. EffortlessSteven commented on Oct 10, 2026

    @EffortlessSteven
    MemberAuthor

    Parent coordination has assigned this cloud session as the sole isolated recovery/qualification owner for #1353. I am continuing the retained candidate from #1353 (comment); I will preserve that attribution and will not edit the previous task's local branch.

    Verified current main 7453db0 and broker blob a86ceae3912f1b9a073c199b5558b44c908c6fbc. All 11 open PR file lists had no broker.rs edits. The original diff is retained unchanged; its final hunk needs one blank trailing context line, which reconstructs broker blob f272c5e9557133c99d67f9355c9802c91749721e. This is content recovery, not recovery of reported local commit 9318e507.

    Next: actual tests-only RED, recovered diagnostic GREEN, boundary/receipt/diagnostic controls, independent exact-head review, and a verified real draft PR. I will recheck for any newly published competing branch/PR before publication. Normal required checks remain authoritative; no protection, threshold, pin, suppression, publication or deployment change. The failed gh read remains stopped.

  7. EffortlessSteven commented on Oct 10, 2026

    @EffortlessSteven
    MemberAuthor

    Actual continuation published: #1355, verified remote head 5983b7f; source tree243cd4798109e7eaff6332725a29fc505d1786e5. Two real GitHub commits preserve tests-first history and retained-patch attribution. This is source-content recovery, not a claim to recover local9318e507.

    Executed here: actual retained RED for allocation0/deadline3406; expanded tests-only RED with four intended failures; recovered32-broker-test GREEN; full identical-tree baseline1243pass/1intentionalignore and all seven deterministic checks; eight runtime-discriminating temporary mutants. Exact fetched remote head also passes32 broker tests. Independent exact-remote-head LLM source review found no actionable defects: #1355 (comment).

    The PR was created as a real draft and has progressed through normal Ready. Hosted independent baseline and required ub-review/gate are running. No merge eligibility is claimed until those outcomes are verified. No budget/status/threshold/pin/suppression, protection, credential, runner-security, release or deployment change. The previous task's branch and #1317 remain untouched; the actual gh Forbidden read remains stopped.

  8. EffortlessSteven commented on Oct 10, 2026

    @EffortlessSteven
    MemberAuthor

    #1353 continuation checkpoint: PR #1355, current published head 5983b7f. Actual retained RED reproduced allocation0/deadline3406 mislabeled expired; expanded tests-only RED had four diagnostic failures. Recovered GREEN passes32 broker tests; eight runtime mutants are killed. Full local and hosted independent baseline each pass1243 top-level tests with one intentional ignore. Independent exact-head source review and GitHub Codex found no actionable/major issues.

    Required gate is now actually RED: sole blocking reason ripr new_unsuppressed=2 > configured maximum0. Artifact verification passed. No merge or gate/pin/suppression changes. Reproducing exact pinned RIPR locally to inspect possible bounded test corrections; hosted raw finding IDs are not yet inspected. Archive11686320125 was uploaded (GitHub-reported digest6da54542ae8fc0869b97d012fa107827731e6268e4cc5ff193bbd38b7a4a85d6). Stopped transfer/protection/comment-read boundaries are recorded in PR qualification receipt; no denied action is retried or rerouted.

  9. EffortlessSteven commented on Oct 11, 2026

    @EffortlessSteven
    MemberAuthor

    PR #1355 now has verified published head 0213853, tree1a128215a0b8757552b1caf8d788f7c8aa38d133. The retained production hunk is unchanged. Added a meaningful whole-artifact serialization oracle: allocation120/live deadline90/selected estimate60 leaves reservation30 and preserves runtime90, complete Required decisions, task/request identities and absent receipts.

    Actual final tests on old production:8pass/5diagnosticfailures. The artifact oracle kills both wrong-deadline-source and subtraction-removal mutants at runtime; restored33broker tests pass. Full local final tree passes1,244 top-level tests/1intentionalignore; fmt/check/Clippy/docs/policy/verifier pass. Pinned local RIPR now2→0 with unchanged16findings/9unknowns, no suppression/threshold/pin changes. Independent exact-published-head review is clear. New required gate and new independent baseline are pending. Previous5983 requiredgate was actually red, never waived. No merge yet. Stopped access boundaries remain unchanged.

  10. added a commit that references this issue on Oct 11, 2026
  11. EffortlessSteven commented on Oct 11, 2026

    @EffortlessSteven
    MemberAuthor

    Completed the bounded #1353 diagnostic repair in PR #1355, merged normally into protected main at 411d68f. Qualified published head 0213853; tree1a128215a0b8757552b1caf8d788f7c8aa38d133. Verified main, merge parents7453db0/02138530, and exact tree equivalence. All three logical commits are preserved.

    Source: recovered the retained candidate by restoring its missing blank context line. Production diagnostic hunk is verbatim; historical local9318e507 is not claimed recovered. Only broker.rs changes. Selection, budgets, status vocabulary, Required satisfaction, thresholds, pins and suppressions are preserved; #1317 remains untouched.

    Actual runtime: retained RED reproduces allocation0/live deadline3406 mislabeled expired. Final tests on unchanged base production yield8pass/5diagnosticfailures. Recovered final broker GREEN33pass; full local and hosted final baselines each1,244top-level tests pass/1intentionalignore. Eight original runtime mutants plus the additional wrong-deadline-source mutant are killed; the final whole-artifact oracle independently kills both deadline read/subtraction faults with runtime equality failures. It pins reservation30 beside live deadline90, exact decisions, Required/request metadata and empty receipts. Fmt/check/Clippy/docs/policy/verifier pass.

    Hosted authority: independent baseline and required gate PASS at02138530. Gate artifact verification passed. Independent exact-head review finds no actionable defects; GitHub Codex finds no major issues. Previous5983 gate actually failedRIPR2>maximum0; the meaningful artifact oracle changes pinned local RIPR2→0 (same16findings/9unknowns), and normal current-head hosted qualification is green. No gate waiver or bypass.

    Remaining integration boundary: final advisory task projection reconciliation retains41 issues (including duration-domain/unproven-proof observations); publication reconciliation is coherent. Underlying Required starvation and terminal/economics work retain their separate owners and are not claimed fixed. Stopped access actions remain stopped: gh retained-comment read Forbidden, signed baseline ZIP transfer proxy403, full main-protection read integration403. Archive digests are provider-reported; local archive bytes/hashes are unverified. No denied action was retried or rerouted. No package/release publication, deployment, credentials, permissions or runner-security changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtest

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions