Repository navigation
Description
Parent
#862 — actual/learned duration. Depends on scheduler authority #991. Roadmap: #945 C2.1.
Objective
Stop charging a task's timeout ceiling as consumed proof time; release unused time/resources immediately at terminal state.
Scope
- Separate reserved maximum, queue wait, resource wait, setup, process, cleanup, and total elapsed.
- Compute remaining capacity from actual terminal consumption plus live reservations.
- Release every resource/time reservation on success, failure, timeout, cancellation, setup refusal, and receipt failure.
- Correct reason codes so reservation-budget exhaustion is not reported as hard-deadline expiry.
Acceptance
A 600s task completing in 1s releases 599s; the #915/#921 reservation shape admits later work when safe; actual hard-wall expiry remains distinct; queue/resource wait is visible; no negative remaining capacity; TaskLedger/scheduler projections reconcile.
Proof
Fake-clock 1500s-reserved/~63s-consumed regression, terminal-path release truth table, reason-code fixtures, full validation.
Non-goals
No duration learning, task reprioritization, deadline stages, or Cargo cache model.
Rollback
Use conservative estimates for admission while retaining actual duration and terminal release.
Landed elapsed-time settlement and remaining full integration (2026-10-23 UTC)
The real-process lost-budget reproduction is historical evidence at main 2b8e66e, not a reproduced defect on today's main. #1508 normally integrated bounded conservative settlement as main ac06293dd0871531c1826e4a3266c8dc537cf4f6.
Current-source inspection confirms the landed behavior: budget.rs keeps original timeout ceilings as admission caps, substitutes conservatively rounded actual duration only for one unambiguous matching current receipt, and keeps full charges for ambiguous/mismatched/unknown timing. Actual timeouts spend at least their allowance. build.rs and red_green.rs accumulate measured receipt spend in their loops; broker phases call the settled-budget function. This is source inspection of landed implementation and existing native controls, with no new test execution here.
#1503 retains its separate frozen source/18-max-zero qualification history; it is not necessary to adopt that entire blocked branch to acquire the settlement behavior already landed via #1508. The later owner reconciliation explicitly corrects “all settlement work remains unlanded.” It also preserves the remaining distinction: current main's seeded stream still runs initial impact before seeded requests, while #1475/#1484 owns Required-first composition. Reconcile those owners with landed #1508 instead of duplicating elapsed settlement or relabeling historical #1505 Required0/3 as current adopted proof.
Full #992 completion still depends on its declared #991 scheduler authority and must demonstrate resource/time release and consistent projections across success, ordinary failure, timeout, cancellation, setup refusal and receipt/event-persistence failure; queue/resource/setup/process/cleanup time and hard deadline versus allocation reasons remain separate. Reuse landed settlement controls and add only missing integration falsifiers. Preserve live reservations versus actual terminal consumption versus unknown timing, no duplicate refunds/negative capacity, and exact request-bound downstream receipts. No statement here claims that full #991/#992 or whole-portfolio timing acceptance has completed.
The consumer correction also remains applicable: inherited shadow-unsatisfied check/docs joins under unchanged default required_proof_unproven=false are not automatically a blocking dependency of an unrelated passing candidate. They remain unproven and cannot be relabeled satisfied. Enforcement migration belongs to #1015/#1277; Required-first adoption and full scheduler acceptance retain existing owners.
Activity
EffortlessSteven commentedon Oct 13, 2026
Current-main reproduction for the actual-duration owner; no duplicate issue or scheduler implementation.
Investigated the reported #1425/run 38485135060 shadow code against main
2b8e66ebe5f11608fb9e85da4af7c5747252f86f, tree9ccd963a0d526cfce073fd5913fc0a4f9829a6ce. Exclusive local branchrook/portfolio-deadline-investigation-20261013. Repository instructions, #862 and its amendments, #992, duplicate #1126, #1270, #1353, and open #1371 were read before the experiment. #992 remains the canonical actual-terminal-duration repair after #991; #1371 already preserves injected 1500s/63s evidence. This handoff adds bounded real-process evidence rather than another repair front.Conclusion: current admission is conservative, but permanently charging the granted ceiling in later in-process budget calculations is the already-owned lost-work defect, contrary to #862/#992's contract.
src/proof/budget.rs:60subtracts grantedlease.timeout_sec, not command duration.src/proof/build.rs:157andsrc/proof/red_green.rs:192accumulate ceilings inside their execution loops. The request broker passes completed leases back into the budget calculation before build replanning (src/proof/broker.rs:817). The correct repair is not simply replacing every estimate with a fast historical duration: live reservations, actual terminal consumption, unknown timing fallback, task/file caps, latest-safe-start and terminal release need separate treatment.Executed regression: appended only the test below to
src/proof/broker.rsin the isolated lane. It executes a real /bin/true through the existing process runner capped at 2 seconds and records its actual terminal receipt; no Cargo workload or hosted packet is synthesized. Supplied deadline values make the selection controls deterministic. The real receipt measured 0ms at the runner's millisecond resolution (not a claim of zero physical runtime); lease ceiling was 60s. Later Required candidate costs 60s.Command:
CARGO_HOME=/workspace/.cargo RUSTUP_HOME=/workspace/.rustup PATH=/workspace/.cargo/bin:$PATH cargo test --locked --offline --bin ub-review investigation_real_short_process_keeps_timeout_charge -- --nocapture.Positive: 1 passed, 0 failed, all six rows checked. Counterfactual added immediately after the ceiling assertion:
This compiled and failed: 0 passed / 1 failed with the exact #992 message. Removing that assertion and restoring the original experiment passed again, 1/0. Independent Luna read-only source review found no actionable issue and correctly limited the experiment to returned-lease accounting; it did not run tests.
Tested experimental tree
44cffab8eb7eac2ab5d121ba2d2ceb6ba6bb36bd; changed broker blobab37baef4ce2d70f46668905efa062b58aa8ac5f. Patch SHA256b3c6bc00b68a99ccea0ba6b7effc279362089469b2a0fe524f0334da00c2587c; positive logcf7e2dba6f7e90a2a62e96d33a37c2a55385d3ddc8d5f0272bee277fdcabe536; desired-reclamation RED logbb4ee3c2c72d5bc222d84a4a14daa12c04e3664843c0354daa074649a5cb607c; restored positive log0780255b9d8d3e89adb1c28d805538c3299a0d3c022b465c7cb8336aad055e70. Logs and patch retained executor-locally under /workspace/deadline-evidence; the reproducible patch is included below for durable recovery. No committed/pushed candidate. Checkout restored byte-for-byte; git status and diff-check clean at the main head/tree above. No #1306/#1428 files changed.Limitations: the observation detector (
scripts/reconcile-task-projections.py:720–725) only requires zero portfolio budget, positive deadline, and any command shorter than its ceiling. Its code alone does not prove a particular pending task's eligibility or connect that short command to the charged lease. This pass did not download/recompute the #1425 artifact; it proves the current source accounting defect and a concrete Required-selection loss in isolation. No production refund, learned estimates, full broker wall-clock deadline enforcement, full baseline, hosted qualification or canonical scheduler acceptance is claimed. Repair/resume belongs to #992 after #991; no gate change, budget increase, pin change, release, merge or authority migration.Reproduction patch against the exact main head
EffortlessSteven commentedon Oct 15, 2026
Taking the explicitly authorized bounded Required-admission prerequisite in a separate lane; PR1472 remains unchanged at c59e358.
Fresh #992/#991 discussion and current open-PR scan found no active production writer for this repair. #1371/#1460 retain evidence and #1461 retains shadow projection ownership. I own this bounded implementation on branch fix/992-required-admission-task26 from main565e2a8e77a132351580d3f44bae43b6de0b2a70, task-owned H:/Temp/ub-review-task26-scheduler. Other checkouts/resources remain untouched.
Observed trigger: hosted1472's initial impact broker consumed three optional600-second leases before seeded Required check/docs/policy admission. That exhausted1800 seconds and left one of four total focused-task slots. All three Required receipts were absent. This is not a failing command or machine-capacity diagnosis.
Plan: admit known seeded Required requests before optional diff/impact work, then pass their actual receipts and granted leases into the existing later admission/dedup calculations. Keep1800 seconds/four tasks, original command allowlists, immutable revision identity, resource guards, deadlines and fail-closed receipt results. Optional work gets only the remaining capacity; no new scheduler, budget increase or fabricated worker identity. Test the actual broker path with the1800/four-slot workload, plus exhausted time/slots, optional work, failed Required execution and existing receipt controls. Independent review and native final qualification follow focused development proof.
#991 dependency disposition: use the current legacy broker's existing authoritative admission and shadow TaskLedger recording, without migrating authority or declaring #991 complete. This repairs the bounded pre-Required admission ordering authorized here. Full actual-terminal-duration reclamation/live reservations and the broader #992 acceptance remain open; this PR will reference #992 rather than close it. If tests reveal more integration is needed, scope it explicitly before proceeding. Fresh qualification creates a new valid transaction; the closed1472 packet will not be edited or revived.
EffortlessSteven commentedon Oct 15, 2026
Bounded Required-admission repair is now Draft PR1475, head
f2cc3fa3823aecee7aa2b5530547fa06f7149944, tree6d10a34888e5c5635140b2bfcdd8f83e77b0ef52, based on565e2a8e77a132351580d3f44bae43b6de0b2a70. I retain this lane's follow-through; no competing scheduler implementation was found before the claim.Known seeded Required requests now run before optional impact work in both model modes. Later admission uses the same accumulated leases/receipts. A Required-only pass excludes unrelated Bun diff tests; the initial floor still owns those candidates. Time/task caps, allowlists, immutable subjects, late-sensor Cargo ownership and fail-closed outcomes remain intact.
Executed evidence: all34 broker tests pass, including eight workload rows covering1800 seconds/four slots, remaining optional capacity, exhausted time/slots, failed Required results and mixed Bun/Cargo admission. Three compiled source mutants fail at intended runtime assertions (skip Required phase; reset shared budget; import optional Bun), restored source passes. The actual CLI Required/model overlap test passes. Independent exact-tree review found no remaining material source concern after phase-lifetime and Bun-admission corrections.
Final native fmt/check/workspace tests/strict Clippy/docs/policy/staged precommit pass;1139 binary tests and59 CLI tests plus other targets pass, one existing CLI ignore. Preserve the earlier full-run failure in unchanged child-startup test, its isolated pass, and subsequent full pass with four test threads; no source change or skipped test manufactured that pass. Known rustdoc/policy warnings, missing ast-grep, unchanged-workflow actionlint skip and verifier Windows-junction skip remain in the PR.
Fresh contained candidate gate 38700404225 is running. Its new packet and exact required receipts remain to be inspected; no closed1472 packet was edited or ordinary baseline passes substituted. PR1472 stays unchanged Draft at c59e358, with its103/max0 hold.
#991 remains open and no scheduler authority migrates here. Full #992 duration refunds/live reservation release remain open. This is the explicitly authorized bounded admission repair, not completion or closure of either prerequisite.
EffortlessSteven commentedon Oct 15, 2026
Fresh native qualification of Draft PR1475 confirms the bounded repair: Required matched3/passed3/failed0/skipped0 in run38700404225. Actual check9539ms/doc2452ms/policy2325ms receipts bind their original request IDs to merge
b6446d391332378070add312150a2285825b5430, tree6d10a34888e5c5635140b2bfcdd8f83e77b0ef52, revision digest756726f424fbb2d589afd993b403a7f0cd826c68b593922c67a39de7df582745. Candidate staysf2cc3fa3823aecee7aa2b5530547fa06f7149944.Required phase precedes initial impact; only three build leases are granted, conservatively charging1500 seconds against the unchanged1800/four-task allocation. Archive11955598927 is9,576,341 bytes, verified SHA256
18f762e9878723e23c41e2d3b0d449bca0bb9997b04705c090f4d0a42459af32. Independent read-only inspection recomputed revision identity and verified command bindings/output streams. Artifact contract passed; admission records worktree_dirty=true, so no clean-execution equivalence is asserted.The gate remains failed solely on 20 RIPR/max0, with zero ID overlap against1472's retained gap set. Hosted independent baseline passed all seven checks/aggregate. No threshold/suppression/pin change, source rerun, Ready or merge action.
Keep denominators distinct: planner accounting0/3 follows its existing unconditional head-only exclusion; these successful focused-build receipts are correctly head-only. This is neither missing execution nor stale identity. Existing #1474 diagnostics/#1459 currentness coordination do not change that eligibility rule; a typed build-versus-red/green contract decision is separate and unchanged here.
#991 remains open: task-projection shadow still reports28 issues across queue/fill/portfolio-revision projections; publication reconciliation is coherent. No shadow label implies authority acceptance. Coverage telemetry had no LCOV artifact. Full terminal-duration reclamation/live reservation release and full #992 acceptance remain open. The new packet does not repair or replace1472's closed packet or clear its103/max0 hold.
EffortlessSteven commentedon Nov 4, 2026
Closing as completed on main (2026-11-04 open-issue board sweep; 29-issue verified batch).
Ground truth: already fixed on main.