Repository navigation
Description
Parent
#768 — safe wind-down and deadline authority.
Roadmap: #945 C2.3. Deterministic acceleration parent: #1268.
Dependencies
- B6a.2 orchestrator(plan): make Required work immediately ready and protect deterministic completion reserves #1273 — deterministic SharedRunPlan readiness and completion-reserve contract.
- C2.2 runtime(time): estimate compatible task p50 p95 and replan after terminal events #993 — compatible p50/p95 estimates and replanning inputs.
- C1.6 scheduler: remove legacy execution pools and derive queue lease and portfolio projections from TaskLedger #991 — live scheduler authority for actual task state.
#984 later augments the same plan with model proof/reconsideration/final-lead/delivery reserves. It is not a prerequisite for the model-off deadline state machine. Model-stage consumers may enter these states only after #1120 and their C4/C5 prerequisites.
Objective
Replace one cutoff with explicit live product-level deadline phases shared by deterministic model-off execution and later model-on augmentation.
States
signal_target
normal_decision_window
optional_admission_stopped
deterministic_finalization_reserve
hard_kill
The augmented plan may expose model-specific sub-reserves inside the normal/finalization windows. Required deterministic tasks and terminal cleanup/outcome capacity remain authoritative.
Scope
- Define deterministic transitions from a monotonic injected clock, B6a.2 orchestrator(plan): make Required work immediately ready and protect deterministic completion reserves #1273 plan bounds and C2.2 runtime(time): estimate compatible task p50 p95 and replan after terminal events #993 compatible duration estimates.
- Compute each task's latest safe start from conservative p95 plus receipt, verification, packet-budget, FinalizedOutcome and cleanup margin.
- Stop long/weak optional work first while preserving Required and short exact high-value work when safe.
- At
optional_admission_stopped, admit no new task whose latest safe start has passed. - At
deterministic_finalization_reserve, admit no new executable work; allow only drain/terminal receipt, verification, outcome, packet finalization and cleanup operations. - At
hard_kill, terminate/terminalize hung work according to process authority. - Make Required work that cannot fit explicit
not_proven; never defer it as optional or let prior optional consumption hide the gap. - Emit stable phase, transition, latest-safe-start and rejection reasons tied to plan/task/clock identities.
- Preserve model-off as the complete first active shape.
- Provide extension points for B6b.2 orchestrator(plan): add protected model proof, final-lead and delivery reserves #984 model-specific reserves without adding a second clock/deadline authority.
Acceptance
- State transitions are deterministic under the injected monotonic clock.
- Required tasks start according to B6a.2 orchestrator(plan): make Required work immediately ready and protect deterministic completion reserves #1273 and optional work cannot consume their planned capacity.
- Short exact valuable work may start after long broad work becomes unsafe.
- No new executable task starts in deterministic finalization reserve.
- Required work that cannot fit becomes an exact
not_proveninput. - Optional/deferred work remains nonblocking and artifact-only unless it carries an applicable Required consumer.
- Hard kill is distinct from soft admission stop and produces a terminal timeout/cancel receipt plus resource release.
- Queue/resource wait and actual elapsed time remain distinct from deadline phase.
- Model-off requires no placeholder model stage/reserve.
- Later B6b.2 orchestrator(plan): add protected model proof, final-lead and delivery reserves #984 model reserves map into the same state machine without changing deterministic phase semantics.
- Replay from the same plan, estimates and event clock is identical.
- No public wording, gate enforcement or branch-protection behavior changes.
Proof
- Complete phase-boundary truth table.
- Short-exact-after-long-broad case.
- Required-unfit and optional-deferred cases.
- Finalization-reserve no-new-work and receipt/verification/outcome/packet/cleanup completion.
- Soft-stop versus deliberate hard hang/kill.
- Queue/resource wait versus execution/deadline timing.
- Model-off replay and later model-reserve augmentation compatibility.
- Clock rollback/jump, stale estimate/plan, invalid reserve and forged phase-transition negatives.
- Full scheduler/time/task/outcome/verifier/workspace/fmt/Clippy/policy validation.
Non-goals
- No duration learning; C2.2 runtime(time): estimate compatible task p50 p95 and replan after terminal events #993 supplies estimates.
- No full drain/cancel/zero-pending implementation; C2.4 runtime(wind-down): drain in-flight work terminalize the queue and reach zero pending before finalization #995.
- No model budget scheduler or provider calls.
- No Cargo cache identity/reuse.
- No GitHub watchdog or workflow concurrency.
- No second deadline state machine.
Completion
Close when live model-off execution has one replayable deadline authority that admits short valuable work safely, protects deterministic finalization, exposes Required inability as not_proven, and hard-kills only at the explicit wall.
Rollback
Use conservative earlier optional-stop and finalization boundaries while retaining typed states and reasons. Never return to one ambiguous global cutoff.
Activity