Repository navigation
Description
Problem
Headless Harbor cells currently request benchmark deadline settlement with stopSession(..., mode: "after_step"). An active provider stream or tool step can outlive the settlement window, allowing Harbor's hard timeout to kill the host before maka-cell-output.json and trusted runtime usage are persisted.
Evidence collected in #1021:
- v1: 9 checkpoint-only cells across 8 pairs;
- v2: 5 checkpoint-only cells across 4 complete pairs despite a 120-second settlement grace;
- affected cells hit their native 900/1800/3600-second agent timeout and lacked final cell output.
Checkpoint usage must remain excluded from official economy totals because it can omit the final provider or compact call.
Scope
Implement a bounded cell deadline contract:
- at the soft deadline, immediately stop the active provider/tool step;
- aggregate the durable runtime events that exist after cancellation;
- atomically publish runtime events followed by final cell output before the Harbor hard timeout;
- retain Harbor hard kill as the final process fallback.
after_step is not a model-visible request to wrap up, and an unbounded active step cannot provide a reliable settlement guarantee. The final tokenSummary is the aggregate derived from durable runtime events after forced settlement; it is never backfilled from checkpoint usage and may not include usage that the provider did not report for the cancelled call.
This issue owns cell termination and final-artifact durability. Run scheduling and report completeness belong to the sibling issue linked from #1021.
Acceptance criteria
- A synthetic backend or tool step that outlives the soft deadline is force-stopped before the host hard deadline.
- The cell atomically publishes
runtime-events.jsonland thenmaka-cell-output.json, with deadline provenance and the final runtime-derived token summary when available. - The attempt remains a single Pass@1 sample and is represented as budget-exhausted rather than an infrastructure exclusion.
- No continuation turn starts after the deadline latch.
- Normal completion racing with the deadline produces exactly one terminal outcome.
- Checkpoint-only usage is not promoted to final usage.
- A Harbor-level regression test covers the real host deadline path.
Out of scope
- Continuing schedules after cell failures or reporting partial evidence by axis (fix(harness): continue A/B schedules after cell infra failures and report evidence by axis #1080).
- Oracle evidence reuse and CI audit (feat(harness): add reusable advisory Oracle evidence with incremental CI audit #1081).
- General provider/runtime resume behavior (Add timeout checkpoint/resume for autonomous Harbor task runs before attempt-level retry #186).
- Live provider or Oracle benchmark reruns.
Parent: #1021.
Activity
[-]fix(headless): stage Harbor deadline settlement and persist final cell artifacts[/-][+]fix(headless): force Harbor deadline settlement and atomically persist final cell artifacts[/+]