From 473997f8277cbdb74bc6aca7ec09f4b6a47d582a Mon Sep 17 00:00:00 2001 From: Shane Vitarana Date: Mon, 3 Aug 2026 17:16:21 -0400 Subject: [PATCH 1/2] Report liveness while a provider call is in flight (Trace ABI v8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A host's no-progress watchdog cannot distinguish "blocked on the network" from "wedged in WASM" by silence alone, so it was killing healthy runs whose subcall simply took a while. Measured on a real corpus: a run doing genuine work was SIGKILLed at 210s against a 180s no-progress budget, while every turn that ever succeeded finished in under 76s. Batch subcalls are the worst case and explain why raising the number would not have fixed it. They post to `/responses/batch`, which does not match the `/responses` suffix the relay streams on, so they emit no `reasoning_delta` either — nothing at all reaches the host between the subcall's start and its completion, however long that takes. The new transient `heartbeat` event carries `elapsed_ms` and nothing else. No content, so it is not a retention or privacy question, and it can never reach a run record. Emitted from the relay rather than the engine, which is the whole point. Pyodide runs on the relay's thread, so this timer cannot fire while generated code spins in WASM — exactly when a watchdog SHOULD fire. It ticks only while the event loop is free, i.e. only while the process is genuinely healthy waiting on I/O. That is the discrimination the host was missing, and a test pins it directly: ticks land during an await, and none land while the thread is blocked. Raising the timeout was the alternative and was rejected: it trades one guess for another and still kills a batch that runs a minute longer. ABI 7 -> 8. Hosts must accept the new event and move to the trace_v8_* conformance fixtures. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 36 ++--- .github/workflows/release.yml | 4 +- UPGRADING.md | 8 +- docs/trace-abi.md | 8 +- examples/pyodide-host/e2e_test.ts | 2 +- pyodide/event_channel_probe.ts | 2 +- pyodide/event_channel_test.ts | 2 +- pyodide/events_test.ts | 8 +- pyodide/heartbeat_test.ts | 79 +++++++++++ src/droste/execution/progress.py | 1 + src/droste/execution/trace.py | 9 +- src/droste/substrates/_relay/events.ts | 9 +- src/droste/substrates/_relay/relay.ts | 30 +++- src/droste/testing/__init__.py | 12 +- src/droste/testing/_trace_fixtures.py | 2 +- ...ution.ndjson => trace-v8-execution.ndjson} | 18 +-- ...cycle.ndjson => trace-v8-lifecycle.ndjson} | 134 +++++++++--------- tests/test_answer_checkpoints.py | 8 +- tests/test_runner_subcall_reporting.py | 4 +- tests/test_subcall_input_capacity.py | 2 +- tests/test_trace_abi.py | 44 +++--- 21 files changed, 271 insertions(+), 151 deletions(-) create mode 100644 pyodide/heartbeat_test.ts rename src/droste/testing/fixtures/{trace-v7-execution.ndjson => trace-v8-execution.ndjson} (74%) rename src/droste/testing/fixtures/{trace-v7-lifecycle.ndjson => trace-v8-lifecycle.ndjson} (89%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e26fda9..d4a8f77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,7 +140,7 @@ jobs: PY - name: Distributions bundle the exact event ABI corpus (#144) run: | - for f in trace-v7-execution.ndjson trace-v7-lifecycle.ndjson runner-v10-refusal.ndjson; do + for f in trace-v8-execution.ndjson trace-v8-lifecycle.ndjson runner-v10-refusal.ndjson; do unzip -l dist/*.whl | grep -q "droste/testing/fixtures/$f" || { echo "wheel is missing droste/testing/fixtures/$f"; exit 1; } @@ -154,21 +154,21 @@ jobs: from droste.testing import ( runner_v10_refusal_ndjson, - trace_v7_execution_ndjson, - trace_v7_lifecycle_ndjson, + trace_v8_execution_ndjson, + trace_v8_lifecycle_ndjson, ) source = Path(sys.argv[1]) - assert trace_v7_execution_ndjson() == (source / "trace-v7-execution.ndjson").read_bytes() - assert trace_v7_lifecycle_ndjson() == (source / "trace-v7-lifecycle.ndjson").read_bytes() + assert trace_v8_execution_ndjson() == (source / "trace-v8-execution.ndjson").read_bytes() + assert trace_v8_lifecycle_ndjson() == (source / "trace-v8-lifecycle.ndjson").read_bytes() assert runner_v10_refusal_ndjson() == (source / "runner-v10-refusal.ndjson").read_bytes() PY sdist_root="$(tar tzf dist/droste-*.tar.gz | sed -n '1s#/.*##p')" tar xzf dist/droste-*.tar.gz -C "$tmp" - cmp src/droste/testing/fixtures/trace-v7-lifecycle.ndjson \ - "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v7-lifecycle.ndjson" - cmp src/droste/testing/fixtures/trace-v7-execution.ndjson \ - "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v7-execution.ndjson" + cmp src/droste/testing/fixtures/trace-v8-lifecycle.ndjson \ + "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v8-lifecycle.ndjson" + cmp src/droste/testing/fixtures/trace-v8-execution.ndjson \ + "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v8-execution.ndjson" cmp src/droste/testing/fixtures/runner-v10-refusal.ndjson \ "$tmp/$sdist_root/src/droste/testing/fixtures/runner-v10-refusal.ndjson" @@ -319,7 +319,7 @@ jobs: PY - name: Distributions bundle the exact event ABI corpus (#144) run: | - for f in trace-v7-execution.ndjson trace-v7-lifecycle.ndjson runner-v10-refusal.ndjson; do + for f in trace-v8-execution.ndjson trace-v8-lifecycle.ndjson runner-v10-refusal.ndjson; do unzip -l dist/*.whl | grep -q "droste/testing/fixtures/$f" || { echo "wheel is missing droste/testing/fixtures/$f"; exit 1; } @@ -333,21 +333,21 @@ jobs: from droste.testing import ( runner_v10_refusal_ndjson, - trace_v7_execution_ndjson, - trace_v7_lifecycle_ndjson, + trace_v8_execution_ndjson, + trace_v8_lifecycle_ndjson, ) source = Path(sys.argv[1]) - assert trace_v7_execution_ndjson() == (source / "trace-v7-execution.ndjson").read_bytes() - assert trace_v7_lifecycle_ndjson() == (source / "trace-v7-lifecycle.ndjson").read_bytes() + assert trace_v8_execution_ndjson() == (source / "trace-v8-execution.ndjson").read_bytes() + assert trace_v8_lifecycle_ndjson() == (source / "trace-v8-lifecycle.ndjson").read_bytes() assert runner_v10_refusal_ndjson() == (source / "runner-v10-refusal.ndjson").read_bytes() PY sdist_root="$(tar tzf dist/droste-*.tar.gz | sed -n '1s#/.*##p')" tar xzf dist/droste-*.tar.gz -C "$tmp" - cmp src/droste/testing/fixtures/trace-v7-lifecycle.ndjson \ - "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v7-lifecycle.ndjson" - cmp src/droste/testing/fixtures/trace-v7-execution.ndjson \ - "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v7-execution.ndjson" + cmp src/droste/testing/fixtures/trace-v8-lifecycle.ndjson \ + "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v8-lifecycle.ndjson" + cmp src/droste/testing/fixtures/trace-v8-execution.ndjson \ + "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v8-execution.ndjson" cmp src/droste/testing/fixtures/runner-v10-refusal.ndjson \ "$tmp/$sdist_root/src/droste/testing/fixtures/runner-v10-refusal.ndjson" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee1c0ff..5b92179 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,8 +80,8 @@ jobs: staging="droste-relay-$GITHUB_REF_NAME" mkdir -p "$staging/conformance" relay-dist cp src/droste/substrates/_relay/*.ts pyodide/README.md "$staging/" - cp src/droste/testing/fixtures/trace-v7-execution.ndjson \ - src/droste/testing/fixtures/trace-v7-lifecycle.ndjson \ + cp src/droste/testing/fixtures/trace-v8-execution.ndjson \ + src/droste/testing/fixtures/trace-v8-lifecycle.ndjson \ src/droste/testing/fixtures/runner-v10-refusal.ndjson \ "$staging/conformance/" printf '%s %s\n' "$GITHUB_REF_NAME" "$GITHUB_SHA" > "$staging/DROSTE_VERSION" diff --git a/UPGRADING.md b/UPGRADING.md index 0b22de4..d2a7f77 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -29,10 +29,10 @@ value and never schema-checks it. A provider that raises is reported through a `RuntimeWarning` and the checkpoint carries `payload: null` — a checkpoint can never fail a run. -Hosts must accept Trace ABI 7 and update to the `trace_v7_*` conformance -fixtures (`droste.testing.trace_v7_lifecycle_ndjson` / -`trace_v7_execution_ndjson`, backing `trace-v7-lifecycle.ndjson` / -`trace-v7-execution.ndjson`). Scaffold manifests report `abis.trace: 7`, so +Hosts must accept Trace ABI 7 and update to the `trace_v8_*` conformance +fixtures (`droste.testing.trace_v8_lifecycle_ndjson` / +`trace_v8_execution_ndjson`, backing `trace-v8-lifecycle.ndjson` / +`trace-v8-execution.ndjson`). Scaffold manifests report `abis.trace: 7`, so every manifest id changes; pinned ids must be re-derived. Strict v6 readers reject the new event and the new version, so this is an atomic consumer migration. diff --git a/docs/trace-abi.md b/docs/trace-abi.md index 9d2a5bd..4861758 100644 --- a/docs/trace-abi.md +++ b/docs/trace-abi.md @@ -230,12 +230,12 @@ and sdist. Python consumers load them through package resources: ```python from droste.testing import ( runner_v10_refusal_ndjson, - trace_v7_execution_ndjson, - trace_v7_lifecycle_ndjson, + trace_v8_execution_ndjson, + trace_v8_lifecycle_ndjson, ) -execution_lines = trace_v7_execution_ndjson().splitlines() -event_lines = trace_v7_lifecycle_ndjson().splitlines() +execution_lines = trace_v8_execution_ndjson().splitlines() +event_lines = trace_v8_lifecycle_ndjson().splitlines() pre_admission_refusal = runner_v10_refusal_ndjson() ``` diff --git a/examples/pyodide-host/e2e_test.ts b/examples/pyodide-host/e2e_test.ts index c5507d6..e2f0981 100644 --- a/examples/pyodide-host/e2e_test.ts +++ b/examples/pyodide-host/e2e_test.ts @@ -33,7 +33,7 @@ const RUNNER_REFUSAL_FIXTURE = new URL( import.meta.url, ); const TRACE_LIFECYCLE_FIXTURE = new URL( - "../../src/droste/testing/fixtures/trace-v7-lifecycle.ndjson", + "../../src/droste/testing/fixtures/trace-v8-lifecycle.ndjson", import.meta.url, ); const TEST_BUDGET = { diff --git a/pyodide/event_channel_probe.ts b/pyodide/event_channel_probe.ts index eb9ab23..353b001 100644 --- a/pyodide/event_channel_probe.ts +++ b/pyodide/event_channel_probe.ts @@ -4,7 +4,7 @@ const mode = Deno.args[0]; const channel = eventChannelFromEnvironment(); const fixture = await Deno.readTextFile( new URL( - "../src/droste/testing/fixtures/trace-v7-lifecycle.ndjson", + "../src/droste/testing/fixtures/trace-v8-lifecycle.ndjson", import.meta.url, ), ); diff --git a/pyodide/event_channel_test.ts b/pyodide/event_channel_test.ts index b8a7d1c..2e0c8fc 100644 --- a/pyodide/event_channel_test.ts +++ b/pyodide/event_channel_test.ts @@ -8,7 +8,7 @@ import { import { isRlmEvent } from "../src/droste/substrates/_relay/events.ts"; const TRACE_LIFECYCLE_FIXTURE = new URL( - "../src/droste/testing/fixtures/trace-v7-lifecycle.ndjson", + "../src/droste/testing/fixtures/trace-v8-lifecycle.ndjson", import.meta.url, ); diff --git a/pyodide/events_test.ts b/pyodide/events_test.ts index 80867fb..5feaa87 100644 --- a/pyodide/events_test.ts +++ b/pyodide/events_test.ts @@ -37,6 +37,7 @@ const BODIES: Record> = { }, execution_error: { iteration: 1, error_type: "ValueError", message: "bad" }, reasoning_delta: { text: "thinking" }, + heartbeat: { elapsed_ms: 15000 }, subcall: { phase: "start", call_id: "call-1", @@ -169,7 +170,7 @@ function wire( run_id: "run-1", seq: 1, timestamp: "2026-07-14T00:00:00Z", - version: 7, + version: 8, persistence_class: persistence ?? PERSISTENCE_BY_TYPE[type], depth: 0, ...body, @@ -383,7 +384,7 @@ Deno.test("successful output beginning ERROR remains an output event", () => { Deno.test("Python and relay accept the same execution golden NDJSON", async () => { const fixture = new URL( - "../src/droste/testing/fixtures/trace-v7-execution.ndjson", + "../src/droste/testing/fixtures/trace-v8-execution.ndjson", import.meta.url, ); const lines = (await Deno.readTextFile(fixture)).trim().split("\n"); @@ -427,7 +428,7 @@ Deno.test("Python and relay accept the same execution golden NDJSON", async () = Deno.test("Python and relay accept the same lifecycle golden NDJSON", async () => { const fixture = new URL( - "../src/droste/testing/fixtures/trace-v7-lifecycle.ndjson", + "../src/droste/testing/fixtures/trace-v8-lifecycle.ndjson", import.meta.url, ); const lines = (await Deno.readTextFile(fixture)).trim().split("\n"); @@ -609,6 +610,7 @@ Deno.test("vocabulary matches the engine's emitters", () => { "code", "done", "execution_error", + "heartbeat", "extract", "iteration_start", "llm_response", diff --git a/pyodide/heartbeat_test.ts b/pyodide/heartbeat_test.ts new file mode 100644 index 0000000..5bff2f5 --- /dev/null +++ b/pyodide/heartbeat_test.ts @@ -0,0 +1,79 @@ +// Liveness while a provider call is in flight. +// +// A host's no-progress watchdog cannot tell "blocked on the network" from +// "wedged in WASM" by silence alone, and was killing healthy runs whose subcall +// simply took a while. Batch calls make this worst: they post to +// `/responses/batch`, which does not match the `/responses` streaming suffix, so +// they emit no `reasoning_delta` either — nothing at all between the subcall's +// start and its completion. +// +// The heartbeat is emitted from the relay rather than the engine on purpose. +// Pyodide runs on this same thread, so a timer here cannot fire while generated +// code spins in WASM — which is exactly when a watchdog SHOULD fire. It ticks +// only while the event loop is free, i.e. only when the process is healthy. +// +// Run: deno test --allow-read --allow-env pyodide/heartbeat_test.ts +import { assert, assertEquals } from "jsr:@std/assert@1"; + +const { isRlmEvent, PERSISTENCE_BY_TYPE, RLM_EVENT_TYPES } = await import( + "../src/droste/substrates/_relay/events.ts" +); + +function wire(body: Record): string { + return JSON.stringify({ + type: "heartbeat", + version: 8, + run_id: "run-1", + seq: 4, + timestamp: "2026-08-03T00:00:00Z", + depth: 0, + persistence_class: "transient", + ...body, + }); +} + +Deno.test("the relay forwards a heartbeat", () => { + assert(isRlmEvent(wire({ elapsed_ms: 15_000 }))); + assert(isRlmEvent(wire({ elapsed_ms: 0 }))); +}); + +Deno.test("a heartbeat carries liveness and nothing else", () => { + // Content would make it retainable and turn a liveness ping into a privacy + // question. The body is exactly one non-negative reading. + assert(!isRlmEvent(wire({ elapsed_ms: 15_000, text: "leaked" }))); + assert(!isRlmEvent(wire({}))); + assert(!isRlmEvent(wire({ elapsed_ms: -1 }))); + assert(!isRlmEvent(wire({ elapsed_ms: "15000" }))); +}); + +Deno.test("heartbeats are transient, so they never reach a run record", () => { + assertEquals(PERSISTENCE_BY_TYPE.heartbeat, "transient"); + assert(RLM_EVENT_TYPES.has("heartbeat")); +}); + +Deno.test("the timer only ticks while the event loop is free", async () => { + // The property the whole design rests on. Reproduced here with the same + // shape the relay uses: an interval alongside awaited work. + const ticks: number[] = []; + const started = Date.now(); + const timer = setInterval(() => ticks.push(Date.now() - started), 20); + try { + // Awaiting yields, so the timer runs — a healthy provider wait. + await new Promise((resolve) => setTimeout(resolve, 120)); + assert(ticks.length >= 3, `expected ticks while awaiting, got ${ticks.length}`); + + // Blocking the thread is what a wedged Pyodide execution looks like from + // here. No tick may land during it, which is what lets a watchdog still + // (correctly) detect a wedge. + const before = ticks.length; + const spinUntil = Date.now() + 120; + while (Date.now() < spinUntil) { /* occupy the single thread */ } + assertEquals( + ticks.length, + before, + "a blocked thread must not be able to report itself alive", + ); + } finally { + clearInterval(timer); + } +}); diff --git a/src/droste/execution/progress.py b/src/droste/execution/progress.py index 63a571d..2d0a02c 100644 --- a/src/droste/execution/progress.py +++ b/src/droste/execution/progress.py @@ -40,6 +40,7 @@ "output", # {iteration, stdout, calls_made, answer_ready, answer_content_chars} "execution_error", # {iteration, error_type, message} — a step failed; repair may follow "reasoning_delta", # relay-side {text}, from streamed /responses + "heartbeat", # relay-side {elapsed_ms} — a provider call is still in flight "subcall", # broker-correlated subcall lifecycle facts "repair", # discriminated repair lifecycle facts "extract", # discriminated terminal extraction lifecycle facts diff --git a/src/droste/execution/trace.py b/src/droste/execution/trace.py index 9cea952..0855c25 100644 --- a/src/droste/execution/trace.py +++ b/src/droste/execution/trace.py @@ -17,7 +17,7 @@ from typing import Any, Callable, Mapping from uuid import uuid4 -TRACE_ABI_VERSION = 7 +TRACE_ABI_VERSION = 8 class PersistenceClass(str, Enum): @@ -44,7 +44,9 @@ class PersistenceClass(str, Enum): "checkpoint", } ) -TRANSIENT_EVENT_TYPES = frozenset({"startup", "progress", "reasoning_delta", "usage_progress"}) +TRANSIENT_EVENT_TYPES = frozenset( + {"startup", "progress", "reasoning_delta", "usage_progress", "heartbeat"} +) PERSISTENCE_BY_TYPE: Mapping[str, PersistenceClass] = MappingProxyType( { @@ -90,6 +92,9 @@ class PersistenceClass(str, Enum): {}, ), "reasoning_delta": ({"text": str}, {}), + # Pure liveness, carrying no content: the relay is still waiting on a + # provider call. `elapsed_ms` is diagnostic only, never a budget input. + "heartbeat": ({"elapsed_ms": int}, {}), "subcall": ( { "phase": str, diff --git a/src/droste/substrates/_relay/events.ts b/src/droste/substrates/_relay/events.ts index c4375a9..c93671f 100644 --- a/src/droste/substrates/_relay/events.ts +++ b/src/droste/substrates/_relay/events.ts @@ -15,6 +15,7 @@ export const RLM_EVENT_TYPES = new Set([ "output", // {iteration, stdout, calls_made, answer_ready, answer_content_chars} "execution_error", // {iteration, error_type, message} — a step failed; repair may follow (#35) "reasoning_delta", // {text} — emitted relay-side from streamed /responses + "heartbeat", // {elapsed_ms} — relay-side liveness while a provider call is in flight "subcall", // broker-correlated start/progress/completion/failure "repair", // discriminated repair start/completion/failure "extract", // discriminated extract start/completion/failure @@ -33,6 +34,7 @@ export const PERSISTENCE_BY_TYPE: Readonly> = { startup: "transient", progress: "transient", reasoning_delta: "transient", + heartbeat: "transient", usage_progress: "transient", iteration_start: "configurable", llm_response: "configurable", @@ -284,6 +286,11 @@ function validBody(type: string, body: Record): boolean { return exactBody(body, ["iteration", "error_type", "message"]) && integerField("iteration") && stringField("error_type") && stringField("message"); + case "heartbeat": + // Liveness only. Carries no content, so nothing to validate beyond the + // envelope and a non-negative elapsed reading. + return exactBody(body, ["elapsed_ms"]) && integerField("elapsed_ms") && + Number(body.elapsed_ms) >= 0; case "reasoning_delta": return exactBody(body, ["text"]) && stringField("text"); case "subcall": @@ -431,7 +438,7 @@ export function isRlmEvent(line: string): boolean { Number.isInteger(o.seq) && o.seq > 0 && typeof o.timestamp === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(o.timestamp) && - o.version === 7 && + o.version === 8 && o.persistence_class === PERSISTENCE_BY_TYPE[o.type] && Number.isInteger(o.depth) && o.depth >= 0 && (o.depth === 0 diff --git a/src/droste/substrates/_relay/relay.ts b/src/droste/substrates/_relay/relay.ts index 0ed5af3..35cf5c8 100644 --- a/src/droste/substrates/_relay/relay.ts +++ b/src/droste/substrates/_relay/relay.ts @@ -455,7 +455,7 @@ function writeRelayEvent(obj: Record): void { depth: 1, seq: ++relaySeq, timestamp: new Date().toISOString(), - version: 7, + version: 8, persistence_class: "transient", }; eventChannel.writeFrame(JSON.stringify(event)); @@ -552,6 +552,28 @@ function finishHTTPFailureAssociation(adapterRaised: boolean): number { return association.status; } +// A provider call is the one place this process legitimately does nothing for +// minutes: it is blocked on the network, not wedged. The host cannot tell those +// apart from silence alone, and its no-progress watchdog was killing healthy +// runs whose subcall simply took a while — batch calls especially, which do not +// stream and so emit no `reasoning_delta` either. +// +// Emitting from here rather than from the engine is deliberate. Pyodide runs on +// this same thread, so if generated code is spinning in WASM this timer cannot +// fire and the watchdog still (correctly) sees a wedged process. It only ticks +// while the event loop is free, which is exactly when the process is healthy. +const HEARTBEAT_INTERVAL_MS = 15_000; + +function withProviderHeartbeat(work: () => Promise): Promise { + const startedAt = Date.now(); + const timer = setInterval(() => { + emitEvent({ type: "heartbeat", elapsed_ms: Date.now() - startedAt }); + }, HEARTBEAT_INTERVAL_MS); + // Never let liveness reporting hold the process open past its work. + if (typeof Deno !== "undefined" && Deno.unrefTimer) Deno.unrefTimer(timer); + return work().finally(() => clearInterval(timer)); +} + py.globals.set( "host_fetch", async (m: string, u: string, h: string, b: string) => { @@ -585,7 +607,11 @@ py.globals.set( if (wantsStream) { headers["Accept"] = 'application/x-ndjson; profile="responses-stream/v2"'; } - const r = await fetch(u, { method: m, headers, body: b }); + // The wait that matters: for a non-streamed call the server finishes + // before headers arrive, so this await IS the whole provider latency. + const r = await withProviderHeartbeat(() => + fetch(u, { method: m, headers, body: b }) + ); // Exact runner callback JSON failures are protocol values for Python. // Every other HTTP error stays a thrown, bounded transport failure. if (!r.ok) { diff --git a/src/droste/testing/__init__.py b/src/droste/testing/__init__.py index e6b468a..367babc 100644 --- a/src/droste/testing/__init__.py +++ b/src/droste/testing/__init__.py @@ -16,16 +16,16 @@ from .subcall_client import MockSubcallClient -def trace_v7_lifecycle_ndjson() -> bytes: +def trace_v8_lifecycle_ndjson() -> bytes: """Return the shared Trace ABI v7 lifecycle conformance corpus.""" - return files(__package__).joinpath("fixtures/trace-v7-lifecycle.ndjson").read_bytes() + return files(__package__).joinpath("fixtures/trace-v8-lifecycle.ndjson").read_bytes() -def trace_v7_execution_ndjson() -> bytes: +def trace_v8_execution_ndjson() -> bytes: """Return the shared Trace ABI v7 response/code/output/error conformance corpus.""" - return files(__package__).joinpath("fixtures/trace-v7-execution.ndjson").read_bytes() + return files(__package__).joinpath("fixtures/trace-v8-execution.ndjson").read_bytes() def runner_v10_refusal_ndjson() -> bytes: @@ -50,6 +50,6 @@ def runner_v10_refusal_ndjson() -> bytes: "require_ordered_terminal_events", "require_unknown_completion", "run_while_blocked", - "trace_v7_execution_ndjson", - "trace_v7_lifecycle_ndjson", + "trace_v8_execution_ndjson", + "trace_v8_lifecycle_ndjson", ] diff --git a/src/droste/testing/_trace_fixtures.py b/src/droste/testing/_trace_fixtures.py index 409ebc2..db5c1b5 100644 --- a/src/droste/testing/_trace_fixtures.py +++ b/src/droste/testing/_trace_fixtures.py @@ -22,7 +22,7 @@ def _ndjson(events: tuple[RunEvent, ...]) -> bytes: ) -def build_trace_v7_execution_ndjson() -> bytes: +def build_trace_v8_execution_ndjson() -> bytes: """Build the deterministic code/output/error projection corpus.""" started_at = datetime(2026, 7, 16, tzinfo=timezone.utc) diff --git a/src/droste/testing/fixtures/trace-v7-execution.ndjson b/src/droste/testing/fixtures/trace-v8-execution.ndjson similarity index 74% rename from src/droste/testing/fixtures/trace-v7-execution.ndjson rename to src/droste/testing/fixtures/trace-v8-execution.ndjson index 6ebe74b..d002c7b 100644 --- a/src/droste/testing/fixtures/trace-v7-execution.ndjson +++ b/src/droste/testing/fixtures/trace-v8-execution.ndjson @@ -1,9 +1,9 @@ -{"iteration":1,"response":"```python\nprint('first iteration')\n```","run_id":"golden-execution-root","seq":1,"timestamp":"2026-07-16T00:00:00Z","type":"llm_response","version":7,"persistence_class":"configurable","depth":0} -{"iteration":1,"code":"print('first iteration')","run_id":"golden-execution-root","seq":2,"timestamp":"2026-07-16T00:00:01Z","type":"code","version":7,"persistence_class":"configurable","depth":0} -{"iteration":1,"stdout":"ERROR: ordinary successful stdout\n","calls_made":0,"answer_ready":false,"answer_content_chars":0,"stdout_chars":34,"run_id":"golden-execution-root","seq":3,"timestamp":"2026-07-16T00:00:02Z","type":"output","version":7,"persistence_class":"configurable","depth":0} -{"iteration":2,"response":"```python\nraise ValueError('synthetic failure')\n```","run_id":"golden-execution-root","seq":4,"timestamp":"2026-07-16T00:00:03Z","type":"llm_response","version":7,"persistence_class":"configurable","depth":0} -{"iteration":2,"code":"raise ValueError('synthetic failure')","run_id":"golden-execution-root","seq":5,"timestamp":"2026-07-16T00:00:04Z","type":"code","version":7,"persistence_class":"configurable","depth":0} -{"iteration":2,"error_type":"ValueError","message":"synthetic execution failure","run_id":"golden-execution-root","seq":6,"timestamp":"2026-07-16T00:00:05Z","type":"execution_error","version":7,"persistence_class":"configurable","depth":0} -{"iteration":1,"response":"```python\nprint('child run')\n```","run_id":"golden-execution-child","seq":1,"timestamp":"2026-07-16T00:00:06Z","type":"llm_response","version":7,"persistence_class":"configurable","parent_run_id":"golden-execution-root","depth":1} -{"iteration":1,"code":"print('child run')","run_id":"golden-execution-child","seq":2,"timestamp":"2026-07-16T00:00:07Z","type":"code","version":7,"persistence_class":"configurable","parent_run_id":"golden-execution-root","depth":1} -{"iteration":1,"stdout":"child output\n","calls_made":0,"answer_ready":false,"answer_content_chars":0,"stdout_chars":13,"run_id":"golden-execution-child","seq":3,"timestamp":"2026-07-16T00:00:08Z","type":"output","version":7,"persistence_class":"configurable","parent_run_id":"golden-execution-root","depth":1} +{"iteration":1,"response":"```python\nprint('first iteration')\n```","run_id":"golden-execution-root","seq":1,"timestamp":"2026-07-16T00:00:00Z","type":"llm_response","version":8,"persistence_class":"configurable","depth":0} +{"iteration":1,"code":"print('first iteration')","run_id":"golden-execution-root","seq":2,"timestamp":"2026-07-16T00:00:01Z","type":"code","version":8,"persistence_class":"configurable","depth":0} +{"iteration":1,"stdout":"ERROR: ordinary successful stdout\n","calls_made":0,"answer_ready":false,"answer_content_chars":0,"stdout_chars":34,"run_id":"golden-execution-root","seq":3,"timestamp":"2026-07-16T00:00:02Z","type":"output","version":8,"persistence_class":"configurable","depth":0} +{"iteration":2,"response":"```python\nraise ValueError('synthetic failure')\n```","run_id":"golden-execution-root","seq":4,"timestamp":"2026-07-16T00:00:03Z","type":"llm_response","version":8,"persistence_class":"configurable","depth":0} +{"iteration":2,"code":"raise ValueError('synthetic failure')","run_id":"golden-execution-root","seq":5,"timestamp":"2026-07-16T00:00:04Z","type":"code","version":8,"persistence_class":"configurable","depth":0} +{"iteration":2,"error_type":"ValueError","message":"synthetic execution failure","run_id":"golden-execution-root","seq":6,"timestamp":"2026-07-16T00:00:05Z","type":"execution_error","version":8,"persistence_class":"configurable","depth":0} +{"iteration":1,"response":"```python\nprint('child run')\n```","run_id":"golden-execution-child","seq":1,"timestamp":"2026-07-16T00:00:06Z","type":"llm_response","version":8,"persistence_class":"configurable","parent_run_id":"golden-execution-root","depth":1} +{"iteration":1,"code":"print('child run')","run_id":"golden-execution-child","seq":2,"timestamp":"2026-07-16T00:00:07Z","type":"code","version":8,"persistence_class":"configurable","parent_run_id":"golden-execution-root","depth":1} +{"iteration":1,"stdout":"child output\n","calls_made":0,"answer_ready":false,"answer_content_chars":0,"stdout_chars":13,"run_id":"golden-execution-child","seq":3,"timestamp":"2026-07-16T00:00:08Z","type":"output","version":8,"persistence_class":"configurable","parent_run_id":"golden-execution-root","depth":1} diff --git a/src/droste/testing/fixtures/trace-v7-lifecycle.ndjson b/src/droste/testing/fixtures/trace-v8-lifecycle.ndjson similarity index 89% rename from src/droste/testing/fixtures/trace-v7-lifecycle.ndjson rename to src/droste/testing/fixtures/trace-v8-lifecycle.ndjson index 834e9ea..c278443 100644 --- a/src/droste/testing/fixtures/trace-v7-lifecycle.ndjson +++ b/src/droste/testing/fixtures/trace-v8-lifecycle.ndjson @@ -1,67 +1,67 @@ -{"run_id":"golden-success","seq":1,"timestamp":"2026-07-15T00:00:00Z","type":"startup","version":7,"persistence_class":"transient","depth":0,"engine_version":"0.17.0","runner_protocol":10,"provider_protocol":4,"scaffold_manifest_id":"sha256:1be656c1c8a79c157e40e84b5f7c2ec6909d5911ed1c5fc6754acbaa6077fae9","scaffold_manifest_version":3} -{"run_id":"golden-success","seq":2,"timestamp":"2026-07-15T00:00:01Z","type":"iteration_start","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":1000} -{"run_id":"golden-success","seq":3,"timestamp":"2026-07-15T00:00:02Z","type":"repair","version":7,"persistence_class":"configurable","depth":0,"phase":"start","kind":"missing_code","iteration":1} -{"run_id":"golden-success","seq":4,"timestamp":"2026-07-15T00:00:03Z","type":"repair","version":7,"persistence_class":"configurable","depth":0,"phase":"completion","kind":"missing_code","iteration":1} -{"run_id":"golden-success","seq":5,"timestamp":"2026-07-15T00:00:04Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"unary-ok","operation":"llm_query","iteration":1,"reservation":{"tokens":20,"subcalls":1,"wall_ms":990,"depth":0}} -{"run_id":"golden-success","seq":6,"timestamp":"2026-07-15T00:00:05Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"completion","call_id":"unary-ok","operation":"llm_query","iteration":1,"checkpoint":{"tokens":8,"subcalls":1}} -{"run_id":"golden-success","seq":7,"timestamp":"2026-07-15T00:00:06Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"batch-failed","operation":"llm_batch","iteration":1,"reservation":{"tokens":40,"subcalls":2,"wall_ms":985,"depth":0},"batch_count":2} -{"run_id":"golden-success","seq":8,"timestamp":"2026-07-15T00:00:07Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"failure","call_id":"batch-failed","operation":"llm_batch","iteration":1,"checkpoint":{"tokens":0,"subcalls":0},"batch_count":2,"error":{"code":"handler_error","type":"RuntimeError"}} -{"run_id":"golden-success","seq":9,"timestamp":"2026-07-15T00:00:08Z","type":"output","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"stdout":"answer ready\n","calls_made":3,"answer_ready":true,"answer_content_chars":2,"stdout_chars":13} -{"run_id":"golden-success","seq":10,"timestamp":"2026-07-15T00:00:09Z","type":"usage_progress","version":7,"persistence_class":"transient","depth":0,"boundary":"root","kind":"resolved","root":{"input_tokens":6,"cache_read_tokens":2,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":10,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":10} -{"run_id":"golden-success","seq":11,"timestamp":"2026-07-15T00:00:09Z","type":"usage_progress","version":7,"persistence_class":"transient","depth":0,"boundary":"subcall","kind":"resolved","root":{"input_tokens":6,"cache_read_tokens":2,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":10,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":6,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":2,"total_tokens":8,"requests":3,"successes":1,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":18} -{"run_id":"golden-success","seq":12,"timestamp":"2026-07-15T00:00:09Z","type":"usage","version":7,"persistence_class":"durable","depth":0,"kind":"resolved","root":{"input_tokens":6,"cache_read_tokens":2,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":10,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":6,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":2,"total_tokens":8,"requests":3,"successes":1,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":18,"wall_time_ms":320} -{"run_id":"golden-success","seq":13,"timestamp":"2026-07-15T00:00:10Z","type":"budget","version":7,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":10,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":58,"subcalls":3,"wall_ms":320,"depth":0},"remaining":{"tokens":942,"subcalls":7,"wall_ms":680,"depth":1}} -{"run_id":"golden-success","seq":14,"timestamp":"2026-07-15T00:00:11Z","type":"policy","version":7,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"passed","violation_type":null} -{"run_id":"golden-success","seq":15,"timestamp":"2026-07-15T00:00:12Z","type":"result","version":7,"persistence_class":"configurable","depth":0,"result":{"answer":"42","answer_metadata":{},"ready":true,"iterations":1,"tokens_used":18,"subcalls":3,"successful_subcalls":1,"extracted":false,"error":null,"extract_error":null,"recovered_error":null,"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":100,"subcall_output_tokens":10,"subcalls":10,"tokens":1000,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":100,"subcall_tokens":10},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":25000,"execution_timeout_ms":0,"output_chars":25000},"id":"sha256:1be656c1c8a79c157e40e84b5f7c2ec6909d5911ed1c5fc6754acbaa6077fae9"},"stdout_chars":13}} -{"run_id":"golden-success","seq":16,"timestamp":"2026-07-15T00:00:13Z","type":"done","version":7,"persistence_class":"durable","depth":0,"status":"success","ready":true,"extracted":false,"iterations":1,"usage":{"kind":"resolved","root":{"input_tokens":6,"cache_read_tokens":2,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":10,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":6,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":2,"total_tokens":8,"requests":3,"successes":1,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":18,"wall_time_ms":320},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":10,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":58,"subcalls":3,"wall_ms":320,"depth":0},"remaining":{"tokens":942,"subcalls":7,"wall_ms":680,"depth":1}},"policy":{"contract_enforced":true,"outcome":"passed","violation_type":null},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":null,"extract_error":null,"recovered_error":null,"scaffold_manifest_id":"sha256:1be656c1c8a79c157e40e84b5f7c2ec6909d5911ed1c5fc6754acbaa6077fae9","scaffold_manifest_version":3,"stdout_chars":13} -{"run_id":"golden-recovered","seq":1,"timestamp":"2026-07-15T00:01:00Z","type":"iteration_start","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":500} -{"run_id":"golden-recovered","seq":2,"timestamp":"2026-07-15T00:01:01Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"semantic-batch","operation":"llm_batch_with_errors","iteration":1,"reservation":{"tokens":30,"subcalls":2,"wall_ms":990,"depth":0},"batch_count":2} -{"run_id":"golden-recovered","seq":3,"timestamp":"2026-07-15T00:01:02Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"completion","call_id":"semantic-batch","operation":"llm_batch_with_errors","iteration":1,"checkpoint":{"tokens":15,"subcalls":2},"batch_count":2} -{"run_id":"golden-recovered","seq":4,"timestamp":"2026-07-15T00:01:03Z","type":"output","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"stdout":"","calls_made":2,"answer_ready":false,"answer_content_chars":14,"stdout_chars":0} -{"run_id":"golden-recovered","seq":5,"timestamp":"2026-07-15T00:01:04Z","type":"execution_error","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"error_type":"PolicyError","message":"Policy violation: incomplete structured semantic batch evidence remains unresolved (1 failed item(s) across 1 batch request(s)); rerun each exact request successfully before confirming the answer."} -{"run_id":"golden-recovered","seq":6,"timestamp":"2026-07-15T00:01:05Z","type":"extract","version":7,"persistence_class":"configurable","depth":0,"phase":"start","iteration":1} -{"run_id":"golden-recovered","seq":7,"timestamp":"2026-07-15T00:01:06Z","type":"extract","version":7,"persistence_class":"configurable","depth":0,"phase":"completion","iteration":1} -{"run_id":"golden-recovered","seq":8,"timestamp":"2026-07-15T00:01:07Z","type":"usage_progress","version":7,"persistence_class":"transient","depth":0,"boundary":"root","kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30} -{"run_id":"golden-recovered","seq":9,"timestamp":"2026-07-15T00:01:07Z","type":"usage_progress","version":7,"persistence_class":"transient","depth":0,"boundary":"subcall","kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30} -{"run_id":"golden-recovered","seq":10,"timestamp":"2026-07-15T00:01:07Z","type":"usage","version":7,"persistence_class":"durable","depth":0,"kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30,"wall_time_ms":450} -{"run_id":"golden-recovered","seq":11,"timestamp":"2026-07-15T00:01:08Z","type":"budget","version":7,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":500,"subcalls":3,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":45,"subcalls":2,"wall_ms":450,"depth":0},"remaining":{"tokens":455,"subcalls":1,"wall_ms":550,"depth":1}} -{"run_id":"golden-recovered","seq":12,"timestamp":"2026-07-15T00:01:09Z","type":"policy","version":7,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"violated","violation_type":"PolicyError"} -{"run_id":"golden-recovered","seq":13,"timestamp":"2026-07-15T00:01:10Z","type":"result","version":7,"persistence_class":"configurable","depth":0,"result":{"answer":"best-effort evidence","answer_metadata":{},"ready":false,"iterations":1,"tokens_used":30,"subcalls":2,"successful_subcalls":2,"extracted":true,"error":null,"extract_error":null,"recovered_error":{"type":"PolicyError","message":"Policy violation: incomplete structured semantic batch evidence cannot be cleared within the subcall budget: clearing all 1 unresolved recorded exact request(s) requires at least 2 call(s), but only 1 remain.","code":null,"details":{"reason":"semantic_exact_retry_budget_exhausted","required_subcalls":2,"remaining_subcalls":1,"unresolved_batches":1,"unresolved_items":1}},"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":100,"subcall_output_tokens":10,"subcalls":3,"tokens":500,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":100,"subcall_tokens":10},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":25000,"execution_timeout_ms":0,"output_chars":25000},"id":"sha256:d0e6bb585d002c3670d549e93fd9c87179753b280d01875e0aa40cf0565c2c47"},"stdout_chars":0}} -{"run_id":"golden-recovered","seq":14,"timestamp":"2026-07-15T00:01:11Z","type":"done","version":7,"persistence_class":"durable","depth":0,"status":"success","ready":false,"extracted":true,"iterations":1,"usage":{"kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30,"wall_time_ms":450},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":500,"subcalls":3,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":45,"subcalls":2,"wall_ms":450,"depth":0},"remaining":{"tokens":455,"subcalls":1,"wall_ms":550,"depth":1}},"policy":{"contract_enforced":true,"outcome":"violated","violation_type":"PolicyError"},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":null,"extract_error":null,"recovered_error":{"type":"PolicyError"},"scaffold_manifest_id":"sha256:d0e6bb585d002c3670d549e93fd9c87179753b280d01875e0aa40cf0565c2c47","scaffold_manifest_version":3,"stdout_chars":0} -{"run_id":"golden-output-limit","seq":1,"timestamp":"2026-07-15T00:02:00Z","type":"iteration_start","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":1000} -{"run_id":"golden-output-limit","seq":2,"timestamp":"2026-07-15T00:02:01Z","type":"execution_error","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"error_type":"SandboxError","message":"Sandbox output exceeded 4096 characters (attempted 4097). Summarize or aggregate results instead of printing raw rows."} -{"run_id":"golden-output-limit","seq":3,"timestamp":"2026-07-15T00:02:02Z","type":"repair","version":7,"persistence_class":"configurable","depth":0,"phase":"start","kind":"execution_error","iteration":1} -{"run_id":"golden-output-limit","seq":4,"timestamp":"2026-07-15T00:02:03Z","type":"repair","version":7,"persistence_class":"configurable","depth":0,"phase":"failure","kind":"execution_error","iteration":1,"error":{"type":"RuntimeError","message":"repair provider unavailable"}} -{"run_id":"golden-output-limit","seq":5,"timestamp":"2026-07-15T00:02:04Z","type":"usage_progress","version":7,"persistence_class":"transient","depth":0,"boundary":"root","kind":"resolved","root":{"input_tokens":12,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":4,"total_tokens":16,"requests":2,"successes":1,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":16} -{"run_id":"golden-output-limit","seq":6,"timestamp":"2026-07-15T00:02:04Z","type":"usage","version":7,"persistence_class":"durable","depth":0,"kind":"resolved","root":{"input_tokens":12,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":4,"total_tokens":16,"requests":2,"successes":1,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":16,"wall_time_ms":200} -{"run_id":"golden-output-limit","seq":7,"timestamp":"2026-07-15T00:02:05Z","type":"budget","version":7,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":0,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":50,"max_iterations":30},"consumed":{"tokens":416,"subcalls":0,"wall_ms":200,"depth":0},"remaining":{"tokens":584,"subcalls":0,"wall_ms":800,"depth":1}} -{"run_id":"golden-output-limit","seq":8,"timestamp":"2026-07-15T00:02:06Z","type":"policy","version":7,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"not_evaluated","violation_type":null} -{"run_id":"golden-output-limit","seq":9,"timestamp":"2026-07-15T00:02:07Z","type":"result","version":7,"persistence_class":"configurable","depth":0,"result":{"answer":"```python\nprint('x' * 4097)\n```","answer_metadata":{},"ready":false,"iterations":1,"tokens_used":16,"subcalls":0,"successful_subcalls":0,"extracted":false,"error":{"type":"RuntimeError","message":"repair provider unavailable","code":null,"details":null},"extract_error":null,"recovered_error":null,"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":100,"subcall_output_tokens":50,"subcalls":0,"tokens":1000,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":100,"subcall_tokens":50},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":4097,"execution_timeout_ms":0,"output_chars":4096},"id":"sha256:a949075b0c302bdf05188f98f97b4024669f2ebdf89e07f6c712267a9ef2b775"},"stdout_chars":4097}} -{"run_id":"golden-output-limit","seq":10,"timestamp":"2026-07-15T00:02:08Z","type":"done","version":7,"persistence_class":"durable","depth":0,"status":"error","ready":false,"extracted":false,"iterations":1,"usage":{"kind":"resolved","root":{"input_tokens":12,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":4,"total_tokens":16,"requests":2,"successes":1,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":16,"wall_time_ms":200},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":0,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":50,"max_iterations":30},"consumed":{"tokens":416,"subcalls":0,"wall_ms":200,"depth":0},"remaining":{"tokens":584,"subcalls":0,"wall_ms":800,"depth":1}},"policy":{"contract_enforced":true,"outcome":"not_evaluated","violation_type":null},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":{"type":"RuntimeError"},"extract_error":null,"recovered_error":null,"scaffold_manifest_id":"sha256:a949075b0c302bdf05188f98f97b4024669f2ebdf89e07f6c712267a9ef2b775","scaffold_manifest_version":3,"stdout_chars":4097} -{"run_id":"golden-extract-failed","seq":1,"timestamp":"2026-07-15T00:03:00Z","type":"iteration_start","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":500} -{"run_id":"golden-extract-failed","seq":2,"timestamp":"2026-07-15T00:03:01Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"semantic-batch-failed-extract","operation":"llm_batch_with_errors","iteration":1,"reservation":{"tokens":30,"subcalls":2,"wall_ms":990,"depth":0},"batch_count":2} -{"run_id":"golden-extract-failed","seq":3,"timestamp":"2026-07-15T00:03:02Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"completion","call_id":"semantic-batch-failed-extract","operation":"llm_batch_with_errors","iteration":1,"checkpoint":{"tokens":15,"subcalls":2},"batch_count":2} -{"run_id":"golden-extract-failed","seq":4,"timestamp":"2026-07-15T00:03:03Z","type":"output","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"stdout":"","calls_made":2,"answer_ready":false,"answer_content_chars":17,"stdout_chars":0} -{"run_id":"golden-extract-failed","seq":5,"timestamp":"2026-07-15T00:03:04Z","type":"execution_error","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"error_type":"PolicyError","message":"Policy violation: incomplete structured semantic batch evidence remains unresolved (1 failed item(s) across 1 batch request(s)); rerun each exact request successfully before confirming the answer."} -{"run_id":"golden-extract-failed","seq":6,"timestamp":"2026-07-15T00:03:05Z","type":"extract","version":7,"persistence_class":"configurable","depth":0,"phase":"start","iteration":1} -{"run_id":"golden-extract-failed","seq":7,"timestamp":"2026-07-15T00:03:06Z","type":"extract","version":7,"persistence_class":"configurable","depth":0,"phase":"failure","iteration":1,"extract_error":{"type":"InsufficientEvidence","message":"Unable to determine from the work so far."}} -{"run_id":"golden-extract-failed","seq":8,"timestamp":"2026-07-15T00:03:07Z","type":"usage_progress","version":7,"persistence_class":"transient","depth":0,"boundary":"root","kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30} -{"run_id":"golden-extract-failed","seq":9,"timestamp":"2026-07-15T00:03:07Z","type":"usage_progress","version":7,"persistence_class":"transient","depth":0,"boundary":"subcall","kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30} -{"run_id":"golden-extract-failed","seq":10,"timestamp":"2026-07-15T00:03:07Z","type":"usage","version":7,"persistence_class":"durable","depth":0,"kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30,"wall_time_ms":450} -{"run_id":"golden-extract-failed","seq":11,"timestamp":"2026-07-15T00:03:08Z","type":"budget","version":7,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":500,"subcalls":3,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":45,"subcalls":2,"wall_ms":450,"depth":0},"remaining":{"tokens":455,"subcalls":1,"wall_ms":550,"depth":1}} -{"run_id":"golden-extract-failed","seq":12,"timestamp":"2026-07-15T00:03:09Z","type":"policy","version":7,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"violated","violation_type":"PolicyError"} -{"run_id":"golden-extract-failed","seq":13,"timestamp":"2026-07-15T00:03:10Z","type":"result","version":7,"persistence_class":"configurable","depth":0,"result":{"answer":"Error: Policy violation: incomplete structured semantic batch evidence cannot be cleared within the subcall budget: clearing all 1 unresolved recorded exact request(s) requires at least 2 call(s), but only 1 remain.","answer_metadata":{},"ready":false,"iterations":1,"tokens_used":30,"subcalls":2,"successful_subcalls":2,"extracted":false,"error":{"type":"PolicyError","message":"Policy violation: incomplete structured semantic batch evidence cannot be cleared within the subcall budget: clearing all 1 unresolved recorded exact request(s) requires at least 2 call(s), but only 1 remain.","code":null,"details":{"reason":"semantic_exact_retry_budget_exhausted","required_subcalls":2,"remaining_subcalls":1,"unresolved_batches":1,"unresolved_items":1,"withheld_content":"retained evidence"}},"extract_error":{"type":"InsufficientEvidence","message":"Unable to determine from the work so far.","code":null,"details":null},"recovered_error":null,"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":100,"subcall_output_tokens":10,"subcalls":3,"tokens":500,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":100,"subcall_tokens":10},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":25000,"execution_timeout_ms":0,"output_chars":25000},"id":"sha256:d0e6bb585d002c3670d549e93fd9c87179753b280d01875e0aa40cf0565c2c47"},"stdout_chars":0}} -{"run_id":"golden-extract-failed","seq":14,"timestamp":"2026-07-15T00:03:11Z","type":"done","version":7,"persistence_class":"durable","depth":0,"status":"error","ready":false,"extracted":false,"iterations":1,"usage":{"kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30,"wall_time_ms":450},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":500,"subcalls":3,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":45,"subcalls":2,"wall_ms":450,"depth":0},"remaining":{"tokens":455,"subcalls":1,"wall_ms":550,"depth":1}},"policy":{"contract_enforced":true,"outcome":"violated","violation_type":"PolicyError"},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":{"type":"PolicyError"},"extract_error":{"type":"InsufficientEvidence"},"recovered_error":null,"scaffold_manifest_id":"sha256:d0e6bb585d002c3670d549e93fd9c87179753b280d01875e0aa40cf0565c2c47","scaffold_manifest_version":3,"stdout_chars":0} -{"run_id":"golden-cancelled","seq":1,"timestamp":"2026-07-15T00:04:00Z","type":"iteration_start","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":1000} -{"run_id":"golden-cancelled","seq":2,"timestamp":"2026-07-15T00:04:01Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"cancelled-call","operation":"llm_query","iteration":1,"reservation":{"tokens":10,"subcalls":1,"wall_ms":990,"depth":0}} -{"run_id":"golden-cancelled","seq":3,"timestamp":"2026-07-15T00:04:02Z","type":"subcall","version":7,"persistence_class":"configurable","depth":0,"phase":"failure","call_id":"cancelled-call","operation":"llm_query","iteration":1,"checkpoint":{"tokens":0,"subcalls":0},"error":{"code":"cancelled","type":"CapabilityCancelled"}} -{"run_id":"golden-cancelled","seq":4,"timestamp":"2026-07-15T00:04:03Z","type":"execution_error","version":7,"persistence_class":"configurable","depth":0,"iteration":1,"error_type":"CapabilityCallError","message":"CapabilityCancelled: capability call was cancelled"} -{"run_id":"golden-cancelled","seq":5,"timestamp":"2026-07-15T00:04:04Z","type":"repair","version":7,"persistence_class":"configurable","depth":0,"phase":"start","kind":"execution_error","iteration":1} -{"run_id":"golden-cancelled","seq":6,"timestamp":"2026-07-15T00:04:05Z","type":"repair","version":7,"persistence_class":"configurable","depth":0,"phase":"failure","kind":"execution_error","iteration":1,"error":{"type":"RuntimeError","message":"repair provider unavailable"}} -{"run_id":"golden-cancelled","seq":7,"timestamp":"2026-07-15T00:04:06Z","type":"usage_progress","version":7,"persistence_class":"transient","depth":0,"boundary":"root","kind":"partial","root":{"input_tokens":8,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":12,"requests":2,"successes":1,"complete":false},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":12} -{"run_id":"golden-cancelled","seq":8,"timestamp":"2026-07-15T00:04:06Z","type":"usage_progress","version":7,"persistence_class":"transient","depth":0,"boundary":"subcall","kind":"partial","root":{"input_tokens":8,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":12,"requests":2,"successes":1,"complete":false},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":1,"successes":0,"complete":false},"unattributed":{"total_tokens":0},"total_tokens":12} -{"run_id":"golden-cancelled","seq":9,"timestamp":"2026-07-15T00:04:06Z","type":"usage","version":7,"persistence_class":"durable","depth":0,"kind":"partial","root":{"input_tokens":8,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":12,"requests":2,"successes":1,"complete":false},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":1,"successes":0,"complete":false},"unattributed":{"total_tokens":0},"total_tokens":12,"wall_time_ms":150} -{"run_id":"golden-cancelled","seq":10,"timestamp":"2026-07-15T00:04:07Z","type":"budget","version":7,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":1,"depth":1,"wall_ms":1000,"root_output_tokens":50,"subcall_output_tokens":5,"max_iterations":30},"consumed":{"tokens":372,"subcalls":1,"wall_ms":150,"depth":0},"remaining":{"tokens":628,"subcalls":0,"wall_ms":850,"depth":1}} -{"run_id":"golden-cancelled","seq":11,"timestamp":"2026-07-15T00:04:08Z","type":"policy","version":7,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"not_evaluated","violation_type":null} -{"run_id":"golden-cancelled","seq":12,"timestamp":"2026-07-15T00:04:09Z","type":"result","version":7,"persistence_class":"configurable","depth":0,"result":{"answer":"```python\nprint(llm_query('cancel me'))\n```","answer_metadata":{},"ready":false,"iterations":1,"tokens_used":12,"subcalls":1,"successful_subcalls":0,"extracted":false,"error":{"type":"RuntimeError","message":"repair provider unavailable","code":null,"details":null},"extract_error":null,"recovered_error":null,"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":50,"subcall_output_tokens":5,"subcalls":1,"tokens":1000,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":50,"subcall_tokens":5},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":25000,"execution_timeout_ms":0,"output_chars":25000},"id":"sha256:b689ad95c39f7bd038640a287fb25600b7951badbd9af332ff9310a72fbba99d"},"stdout_chars":0}} -{"run_id":"golden-cancelled","seq":13,"timestamp":"2026-07-15T00:04:10Z","type":"done","version":7,"persistence_class":"durable","depth":0,"status":"error","ready":false,"extracted":false,"iterations":1,"usage":{"kind":"partial","root":{"input_tokens":8,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":12,"requests":2,"successes":1,"complete":false},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":1,"successes":0,"complete":false},"unattributed":{"total_tokens":0},"total_tokens":12,"wall_time_ms":150},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":1,"depth":1,"wall_ms":1000,"root_output_tokens":50,"subcall_output_tokens":5,"max_iterations":30},"consumed":{"tokens":372,"subcalls":1,"wall_ms":150,"depth":0},"remaining":{"tokens":628,"subcalls":0,"wall_ms":850,"depth":1}},"policy":{"contract_enforced":true,"outcome":"not_evaluated","violation_type":null},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":{"type":"RuntimeError"},"extract_error":null,"recovered_error":null,"scaffold_manifest_id":"sha256:b689ad95c39f7bd038640a287fb25600b7951badbd9af332ff9310a72fbba99d","scaffold_manifest_version":3,"stdout_chars":0} +{"run_id":"golden-success","seq":1,"timestamp":"2026-07-15T00:00:00Z","type":"startup","version":8,"persistence_class":"transient","depth":0,"engine_version":"0.17.0","runner_protocol":10,"provider_protocol":4,"scaffold_manifest_id":"sha256:1be656c1c8a79c157e40e84b5f7c2ec6909d5911ed1c5fc6754acbaa6077fae9","scaffold_manifest_version":3} +{"run_id":"golden-success","seq":2,"timestamp":"2026-07-15T00:00:01Z","type":"iteration_start","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":1000} +{"run_id":"golden-success","seq":3,"timestamp":"2026-07-15T00:00:02Z","type":"repair","version":8,"persistence_class":"configurable","depth":0,"phase":"start","kind":"missing_code","iteration":1} +{"run_id":"golden-success","seq":4,"timestamp":"2026-07-15T00:00:03Z","type":"repair","version":8,"persistence_class":"configurable","depth":0,"phase":"completion","kind":"missing_code","iteration":1} +{"run_id":"golden-success","seq":5,"timestamp":"2026-07-15T00:00:04Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"unary-ok","operation":"llm_query","iteration":1,"reservation":{"tokens":20,"subcalls":1,"wall_ms":990,"depth":0}} +{"run_id":"golden-success","seq":6,"timestamp":"2026-07-15T00:00:05Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"completion","call_id":"unary-ok","operation":"llm_query","iteration":1,"checkpoint":{"tokens":8,"subcalls":1}} +{"run_id":"golden-success","seq":7,"timestamp":"2026-07-15T00:00:06Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"batch-failed","operation":"llm_batch","iteration":1,"reservation":{"tokens":40,"subcalls":2,"wall_ms":985,"depth":0},"batch_count":2} +{"run_id":"golden-success","seq":8,"timestamp":"2026-07-15T00:00:07Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"failure","call_id":"batch-failed","operation":"llm_batch","iteration":1,"checkpoint":{"tokens":0,"subcalls":0},"batch_count":2,"error":{"code":"handler_error","type":"RuntimeError"}} +{"run_id":"golden-success","seq":9,"timestamp":"2026-07-15T00:00:08Z","type":"output","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"stdout":"answer ready\n","calls_made":3,"answer_ready":true,"answer_content_chars":2,"stdout_chars":13} +{"run_id":"golden-success","seq":10,"timestamp":"2026-07-15T00:00:09Z","type":"usage_progress","version":8,"persistence_class":"transient","depth":0,"boundary":"root","kind":"resolved","root":{"input_tokens":6,"cache_read_tokens":2,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":10,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":10} +{"run_id":"golden-success","seq":11,"timestamp":"2026-07-15T00:00:09Z","type":"usage_progress","version":8,"persistence_class":"transient","depth":0,"boundary":"subcall","kind":"resolved","root":{"input_tokens":6,"cache_read_tokens":2,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":10,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":6,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":2,"total_tokens":8,"requests":3,"successes":1,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":18} +{"run_id":"golden-success","seq":12,"timestamp":"2026-07-15T00:00:09Z","type":"usage","version":8,"persistence_class":"durable","depth":0,"kind":"resolved","root":{"input_tokens":6,"cache_read_tokens":2,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":10,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":6,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":2,"total_tokens":8,"requests":3,"successes":1,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":18,"wall_time_ms":320} +{"run_id":"golden-success","seq":13,"timestamp":"2026-07-15T00:00:10Z","type":"budget","version":8,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":10,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":58,"subcalls":3,"wall_ms":320,"depth":0},"remaining":{"tokens":942,"subcalls":7,"wall_ms":680,"depth":1}} +{"run_id":"golden-success","seq":14,"timestamp":"2026-07-15T00:00:11Z","type":"policy","version":8,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"passed","violation_type":null} +{"run_id":"golden-success","seq":15,"timestamp":"2026-07-15T00:00:12Z","type":"result","version":8,"persistence_class":"configurable","depth":0,"result":{"answer":"42","answer_metadata":{},"ready":true,"iterations":1,"tokens_used":18,"subcalls":3,"successful_subcalls":1,"extracted":false,"error":null,"extract_error":null,"recovered_error":null,"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":100,"subcall_output_tokens":10,"subcalls":10,"tokens":1000,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":100,"subcall_tokens":10},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":25000,"execution_timeout_ms":0,"output_chars":25000},"id":"sha256:1be656c1c8a79c157e40e84b5f7c2ec6909d5911ed1c5fc6754acbaa6077fae9"},"stdout_chars":13}} +{"run_id":"golden-success","seq":16,"timestamp":"2026-07-15T00:00:13Z","type":"done","version":8,"persistence_class":"durable","depth":0,"status":"success","ready":true,"extracted":false,"iterations":1,"usage":{"kind":"resolved","root":{"input_tokens":6,"cache_read_tokens":2,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":10,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":6,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":2,"total_tokens":8,"requests":3,"successes":1,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":18,"wall_time_ms":320},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":10,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":58,"subcalls":3,"wall_ms":320,"depth":0},"remaining":{"tokens":942,"subcalls":7,"wall_ms":680,"depth":1}},"policy":{"contract_enforced":true,"outcome":"passed","violation_type":null},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":null,"extract_error":null,"recovered_error":null,"scaffold_manifest_id":"sha256:1be656c1c8a79c157e40e84b5f7c2ec6909d5911ed1c5fc6754acbaa6077fae9","scaffold_manifest_version":3,"stdout_chars":13} +{"run_id":"golden-recovered","seq":1,"timestamp":"2026-07-15T00:01:00Z","type":"iteration_start","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":500} +{"run_id":"golden-recovered","seq":2,"timestamp":"2026-07-15T00:01:01Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"semantic-batch","operation":"llm_batch_with_errors","iteration":1,"reservation":{"tokens":30,"subcalls":2,"wall_ms":990,"depth":0},"batch_count":2} +{"run_id":"golden-recovered","seq":3,"timestamp":"2026-07-15T00:01:02Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"completion","call_id":"semantic-batch","operation":"llm_batch_with_errors","iteration":1,"checkpoint":{"tokens":15,"subcalls":2},"batch_count":2} +{"run_id":"golden-recovered","seq":4,"timestamp":"2026-07-15T00:01:03Z","type":"output","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"stdout":"","calls_made":2,"answer_ready":false,"answer_content_chars":14,"stdout_chars":0} +{"run_id":"golden-recovered","seq":5,"timestamp":"2026-07-15T00:01:04Z","type":"execution_error","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"error_type":"PolicyError","message":"Policy violation: incomplete structured semantic batch evidence remains unresolved (1 failed item(s) across 1 batch request(s)); rerun each exact request successfully before confirming the answer."} +{"run_id":"golden-recovered","seq":6,"timestamp":"2026-07-15T00:01:05Z","type":"extract","version":8,"persistence_class":"configurable","depth":0,"phase":"start","iteration":1} +{"run_id":"golden-recovered","seq":7,"timestamp":"2026-07-15T00:01:06Z","type":"extract","version":8,"persistence_class":"configurable","depth":0,"phase":"completion","iteration":1} +{"run_id":"golden-recovered","seq":8,"timestamp":"2026-07-15T00:01:07Z","type":"usage_progress","version":8,"persistence_class":"transient","depth":0,"boundary":"root","kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30} +{"run_id":"golden-recovered","seq":9,"timestamp":"2026-07-15T00:01:07Z","type":"usage_progress","version":8,"persistence_class":"transient","depth":0,"boundary":"subcall","kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30} +{"run_id":"golden-recovered","seq":10,"timestamp":"2026-07-15T00:01:07Z","type":"usage","version":8,"persistence_class":"durable","depth":0,"kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30,"wall_time_ms":450} +{"run_id":"golden-recovered","seq":11,"timestamp":"2026-07-15T00:01:08Z","type":"budget","version":8,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":500,"subcalls":3,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":45,"subcalls":2,"wall_ms":450,"depth":0},"remaining":{"tokens":455,"subcalls":1,"wall_ms":550,"depth":1}} +{"run_id":"golden-recovered","seq":12,"timestamp":"2026-07-15T00:01:09Z","type":"policy","version":8,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"violated","violation_type":"PolicyError"} +{"run_id":"golden-recovered","seq":13,"timestamp":"2026-07-15T00:01:10Z","type":"result","version":8,"persistence_class":"configurable","depth":0,"result":{"answer":"best-effort evidence","answer_metadata":{},"ready":false,"iterations":1,"tokens_used":30,"subcalls":2,"successful_subcalls":2,"extracted":true,"error":null,"extract_error":null,"recovered_error":{"type":"PolicyError","message":"Policy violation: incomplete structured semantic batch evidence cannot be cleared within the subcall budget: clearing all 1 unresolved recorded exact request(s) requires at least 2 call(s), but only 1 remain.","code":null,"details":{"reason":"semantic_exact_retry_budget_exhausted","required_subcalls":2,"remaining_subcalls":1,"unresolved_batches":1,"unresolved_items":1}},"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":100,"subcall_output_tokens":10,"subcalls":3,"tokens":500,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":100,"subcall_tokens":10},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":25000,"execution_timeout_ms":0,"output_chars":25000},"id":"sha256:d0e6bb585d002c3670d549e93fd9c87179753b280d01875e0aa40cf0565c2c47"},"stdout_chars":0}} +{"run_id":"golden-recovered","seq":14,"timestamp":"2026-07-15T00:01:11Z","type":"done","version":8,"persistence_class":"durable","depth":0,"status":"success","ready":false,"extracted":true,"iterations":1,"usage":{"kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30,"wall_time_ms":450},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":500,"subcalls":3,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":45,"subcalls":2,"wall_ms":450,"depth":0},"remaining":{"tokens":455,"subcalls":1,"wall_ms":550,"depth":1}},"policy":{"contract_enforced":true,"outcome":"violated","violation_type":"PolicyError"},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":null,"extract_error":null,"recovered_error":{"type":"PolicyError"},"scaffold_manifest_id":"sha256:d0e6bb585d002c3670d549e93fd9c87179753b280d01875e0aa40cf0565c2c47","scaffold_manifest_version":3,"stdout_chars":0} +{"run_id":"golden-output-limit","seq":1,"timestamp":"2026-07-15T00:02:00Z","type":"iteration_start","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":1000} +{"run_id":"golden-output-limit","seq":2,"timestamp":"2026-07-15T00:02:01Z","type":"execution_error","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"error_type":"SandboxError","message":"Sandbox output exceeded 4096 characters (attempted 4097). Summarize or aggregate results instead of printing raw rows."} +{"run_id":"golden-output-limit","seq":3,"timestamp":"2026-07-15T00:02:02Z","type":"repair","version":8,"persistence_class":"configurable","depth":0,"phase":"start","kind":"execution_error","iteration":1} +{"run_id":"golden-output-limit","seq":4,"timestamp":"2026-07-15T00:02:03Z","type":"repair","version":8,"persistence_class":"configurable","depth":0,"phase":"failure","kind":"execution_error","iteration":1,"error":{"type":"RuntimeError","message":"repair provider unavailable"}} +{"run_id":"golden-output-limit","seq":5,"timestamp":"2026-07-15T00:02:04Z","type":"usage_progress","version":8,"persistence_class":"transient","depth":0,"boundary":"root","kind":"resolved","root":{"input_tokens":12,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":4,"total_tokens":16,"requests":2,"successes":1,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":16} +{"run_id":"golden-output-limit","seq":6,"timestamp":"2026-07-15T00:02:04Z","type":"usage","version":8,"persistence_class":"durable","depth":0,"kind":"resolved","root":{"input_tokens":12,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":4,"total_tokens":16,"requests":2,"successes":1,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":16,"wall_time_ms":200} +{"run_id":"golden-output-limit","seq":7,"timestamp":"2026-07-15T00:02:05Z","type":"budget","version":8,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":0,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":50,"max_iterations":30},"consumed":{"tokens":416,"subcalls":0,"wall_ms":200,"depth":0},"remaining":{"tokens":584,"subcalls":0,"wall_ms":800,"depth":1}} +{"run_id":"golden-output-limit","seq":8,"timestamp":"2026-07-15T00:02:06Z","type":"policy","version":8,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"not_evaluated","violation_type":null} +{"run_id":"golden-output-limit","seq":9,"timestamp":"2026-07-15T00:02:07Z","type":"result","version":8,"persistence_class":"configurable","depth":0,"result":{"answer":"```python\nprint('x' * 4097)\n```","answer_metadata":{},"ready":false,"iterations":1,"tokens_used":16,"subcalls":0,"successful_subcalls":0,"extracted":false,"error":{"type":"RuntimeError","message":"repair provider unavailable","code":null,"details":null},"extract_error":null,"recovered_error":null,"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":100,"subcall_output_tokens":50,"subcalls":0,"tokens":1000,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":100,"subcall_tokens":50},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":4097,"execution_timeout_ms":0,"output_chars":4096},"id":"sha256:a949075b0c302bdf05188f98f97b4024669f2ebdf89e07f6c712267a9ef2b775"},"stdout_chars":4097}} +{"run_id":"golden-output-limit","seq":10,"timestamp":"2026-07-15T00:02:08Z","type":"done","version":8,"persistence_class":"durable","depth":0,"status":"error","ready":false,"extracted":false,"iterations":1,"usage":{"kind":"resolved","root":{"input_tokens":12,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":4,"total_tokens":16,"requests":2,"successes":1,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":16,"wall_time_ms":200},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":0,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":50,"max_iterations":30},"consumed":{"tokens":416,"subcalls":0,"wall_ms":200,"depth":0},"remaining":{"tokens":584,"subcalls":0,"wall_ms":800,"depth":1}},"policy":{"contract_enforced":true,"outcome":"not_evaluated","violation_type":null},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":{"type":"RuntimeError"},"extract_error":null,"recovered_error":null,"scaffold_manifest_id":"sha256:a949075b0c302bdf05188f98f97b4024669f2ebdf89e07f6c712267a9ef2b775","scaffold_manifest_version":3,"stdout_chars":4097} +{"run_id":"golden-extract-failed","seq":1,"timestamp":"2026-07-15T00:03:00Z","type":"iteration_start","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":500} +{"run_id":"golden-extract-failed","seq":2,"timestamp":"2026-07-15T00:03:01Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"semantic-batch-failed-extract","operation":"llm_batch_with_errors","iteration":1,"reservation":{"tokens":30,"subcalls":2,"wall_ms":990,"depth":0},"batch_count":2} +{"run_id":"golden-extract-failed","seq":3,"timestamp":"2026-07-15T00:03:02Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"completion","call_id":"semantic-batch-failed-extract","operation":"llm_batch_with_errors","iteration":1,"checkpoint":{"tokens":15,"subcalls":2},"batch_count":2} +{"run_id":"golden-extract-failed","seq":4,"timestamp":"2026-07-15T00:03:03Z","type":"output","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"stdout":"","calls_made":2,"answer_ready":false,"answer_content_chars":17,"stdout_chars":0} +{"run_id":"golden-extract-failed","seq":5,"timestamp":"2026-07-15T00:03:04Z","type":"execution_error","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"error_type":"PolicyError","message":"Policy violation: incomplete structured semantic batch evidence remains unresolved (1 failed item(s) across 1 batch request(s)); rerun each exact request successfully before confirming the answer."} +{"run_id":"golden-extract-failed","seq":6,"timestamp":"2026-07-15T00:03:05Z","type":"extract","version":8,"persistence_class":"configurable","depth":0,"phase":"start","iteration":1} +{"run_id":"golden-extract-failed","seq":7,"timestamp":"2026-07-15T00:03:06Z","type":"extract","version":8,"persistence_class":"configurable","depth":0,"phase":"failure","iteration":1,"extract_error":{"type":"InsufficientEvidence","message":"Unable to determine from the work so far."}} +{"run_id":"golden-extract-failed","seq":8,"timestamp":"2026-07-15T00:03:07Z","type":"usage_progress","version":8,"persistence_class":"transient","depth":0,"boundary":"root","kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30} +{"run_id":"golden-extract-failed","seq":9,"timestamp":"2026-07-15T00:03:07Z","type":"usage_progress","version":8,"persistence_class":"transient","depth":0,"boundary":"subcall","kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30} +{"run_id":"golden-extract-failed","seq":10,"timestamp":"2026-07-15T00:03:07Z","type":"usage","version":8,"persistence_class":"durable","depth":0,"kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30,"wall_time_ms":450} +{"run_id":"golden-extract-failed","seq":11,"timestamp":"2026-07-15T00:03:08Z","type":"budget","version":8,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":500,"subcalls":3,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":45,"subcalls":2,"wall_ms":450,"depth":0},"remaining":{"tokens":455,"subcalls":1,"wall_ms":550,"depth":1}} +{"run_id":"golden-extract-failed","seq":12,"timestamp":"2026-07-15T00:03:09Z","type":"policy","version":8,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"violated","violation_type":"PolicyError"} +{"run_id":"golden-extract-failed","seq":13,"timestamp":"2026-07-15T00:03:10Z","type":"result","version":8,"persistence_class":"configurable","depth":0,"result":{"answer":"Error: Policy violation: incomplete structured semantic batch evidence cannot be cleared within the subcall budget: clearing all 1 unresolved recorded exact request(s) requires at least 2 call(s), but only 1 remain.","answer_metadata":{},"ready":false,"iterations":1,"tokens_used":30,"subcalls":2,"successful_subcalls":2,"extracted":false,"error":{"type":"PolicyError","message":"Policy violation: incomplete structured semantic batch evidence cannot be cleared within the subcall budget: clearing all 1 unresolved recorded exact request(s) requires at least 2 call(s), but only 1 remain.","code":null,"details":{"reason":"semantic_exact_retry_budget_exhausted","required_subcalls":2,"remaining_subcalls":1,"unresolved_batches":1,"unresolved_items":1,"withheld_content":"retained evidence"}},"extract_error":{"type":"InsufficientEvidence","message":"Unable to determine from the work so far.","code":null,"details":null},"recovered_error":null,"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":100,"subcall_output_tokens":10,"subcalls":3,"tokens":500,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":100,"subcall_tokens":10},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":25000,"execution_timeout_ms":0,"output_chars":25000},"id":"sha256:d0e6bb585d002c3670d549e93fd9c87179753b280d01875e0aa40cf0565c2c47"},"stdout_chars":0}} +{"run_id":"golden-extract-failed","seq":14,"timestamp":"2026-07-15T00:03:11Z","type":"done","version":8,"persistence_class":"durable","depth":0,"status":"error","ready":false,"extracted":false,"iterations":1,"usage":{"kind":"resolved","root":{"input_tokens":20,"cache_read_tokens":5,"cache_creation_tokens":2,"output_tokens":10,"total_tokens":30,"requests":2,"successes":2,"complete":true},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":2,"successes":2,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":30,"wall_time_ms":450},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":500,"subcalls":3,"depth":1,"wall_ms":1000,"root_output_tokens":100,"subcall_output_tokens":10,"max_iterations":30},"consumed":{"tokens":45,"subcalls":2,"wall_ms":450,"depth":0},"remaining":{"tokens":455,"subcalls":1,"wall_ms":550,"depth":1}},"policy":{"contract_enforced":true,"outcome":"violated","violation_type":"PolicyError"},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":{"type":"PolicyError"},"extract_error":{"type":"InsufficientEvidence"},"recovered_error":null,"scaffold_manifest_id":"sha256:d0e6bb585d002c3670d549e93fd9c87179753b280d01875e0aa40cf0565c2c47","scaffold_manifest_version":3,"stdout_chars":0} +{"run_id":"golden-cancelled","seq":1,"timestamp":"2026-07-15T00:04:00Z","type":"iteration_start","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"remaining_tokens":1000} +{"run_id":"golden-cancelled","seq":2,"timestamp":"2026-07-15T00:04:01Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"start","call_id":"cancelled-call","operation":"llm_query","iteration":1,"reservation":{"tokens":10,"subcalls":1,"wall_ms":990,"depth":0}} +{"run_id":"golden-cancelled","seq":3,"timestamp":"2026-07-15T00:04:02Z","type":"subcall","version":8,"persistence_class":"configurable","depth":0,"phase":"failure","call_id":"cancelled-call","operation":"llm_query","iteration":1,"checkpoint":{"tokens":0,"subcalls":0},"error":{"code":"cancelled","type":"CapabilityCancelled"}} +{"run_id":"golden-cancelled","seq":4,"timestamp":"2026-07-15T00:04:03Z","type":"execution_error","version":8,"persistence_class":"configurable","depth":0,"iteration":1,"error_type":"CapabilityCallError","message":"CapabilityCancelled: capability call was cancelled"} +{"run_id":"golden-cancelled","seq":5,"timestamp":"2026-07-15T00:04:04Z","type":"repair","version":8,"persistence_class":"configurable","depth":0,"phase":"start","kind":"execution_error","iteration":1} +{"run_id":"golden-cancelled","seq":6,"timestamp":"2026-07-15T00:04:05Z","type":"repair","version":8,"persistence_class":"configurable","depth":0,"phase":"failure","kind":"execution_error","iteration":1,"error":{"type":"RuntimeError","message":"repair provider unavailable"}} +{"run_id":"golden-cancelled","seq":7,"timestamp":"2026-07-15T00:04:06Z","type":"usage_progress","version":8,"persistence_class":"transient","depth":0,"boundary":"root","kind":"partial","root":{"input_tokens":8,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":12,"requests":2,"successes":1,"complete":false},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":0,"successes":0,"complete":true},"unattributed":{"total_tokens":0},"total_tokens":12} +{"run_id":"golden-cancelled","seq":8,"timestamp":"2026-07-15T00:04:06Z","type":"usage_progress","version":8,"persistence_class":"transient","depth":0,"boundary":"subcall","kind":"partial","root":{"input_tokens":8,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":12,"requests":2,"successes":1,"complete":false},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":1,"successes":0,"complete":false},"unattributed":{"total_tokens":0},"total_tokens":12} +{"run_id":"golden-cancelled","seq":9,"timestamp":"2026-07-15T00:04:06Z","type":"usage","version":8,"persistence_class":"durable","depth":0,"kind":"partial","root":{"input_tokens":8,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":12,"requests":2,"successes":1,"complete":false},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":1,"successes":0,"complete":false},"unattributed":{"total_tokens":0},"total_tokens":12,"wall_time_ms":150} +{"run_id":"golden-cancelled","seq":10,"timestamp":"2026-07-15T00:04:07Z","type":"budget","version":8,"persistence_class":"durable","depth":0,"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":1,"depth":1,"wall_ms":1000,"root_output_tokens":50,"subcall_output_tokens":5,"max_iterations":30},"consumed":{"tokens":372,"subcalls":1,"wall_ms":150,"depth":0},"remaining":{"tokens":628,"subcalls":0,"wall_ms":850,"depth":1}} +{"run_id":"golden-cancelled","seq":11,"timestamp":"2026-07-15T00:04:08Z","type":"policy","version":8,"persistence_class":"durable","depth":0,"contract_enforced":true,"outcome":"not_evaluated","violation_type":null} +{"run_id":"golden-cancelled","seq":12,"timestamp":"2026-07-15T00:04:09Z","type":"result","version":8,"persistence_class":"configurable","depth":0,"result":{"answer":"```python\nprint(llm_query('cancel me'))\n```","answer_metadata":{},"ready":false,"iterations":1,"tokens_used":12,"subcalls":1,"successful_subcalls":0,"extracted":false,"error":{"type":"RuntimeError","message":"repair provider unavailable","code":null,"details":null},"extract_error":null,"recovered_error":null,"prompt_pack":{"id":"droste.generic.full","revision":"1.0.3","profile":"full","resolution_tier":"generic","model_family":"generic","provenance_source":"droste","provenance_benchmark":null,"provenance_score":null,"content_sha256":"61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7"},"scaffold_manifest":{"schema_version":3,"abis":{"capability":1,"kernel":1,"prompt_pack":1,"provider":4,"runner":10,"trace":7},"budget":{"depth":1,"root_output_tokens":50,"subcall_output_tokens":5,"subcalls":1,"tokens":1000,"wall_ms":1000,"max_iterations":30},"capabilities":{"manifest_hash":"sha256:33a8de001c12c2f7ba57236980c4aafab7a1b8bfcc60ac4bb891a3a3c0089579","model_visible_globals":["answer"]},"contracts":{"overrides":{"refinement_prompt":null,"system_prompt":null,"system_prompt_additions":null,"user_prompt":null},"subcall_identity":"capability-call-parent-v1","templates":{"error_repair":"sha256:1056c9f99b9fcbc3fd021775a80c18f38b2454cb92cb062cb089aa86b8067913","extract_system":"sha256:6616daeb153049f23365d9c04cac1e255dbb76a7f81d807d6c830e2720dc6af8","extract_user":"sha256:81c0370baeceb252547baca669cd6c82d55ac858c3283d3cd41554d7082c0ec1","missing_code_repair":"sha256:4033a5d7901934c6b6de279d5b21ced97354ccff4bcb1fb10c211dba89a57173","refinement":"sha256:9b4700c0db49443f39d1b43c0dc0f43d9aa1d809cba0585fdcb5ea3d399c8046"},"terminal":"answer-ready-v1"},"engine":{"source_revision":null,"version":"0.17.0"},"inference":{"concurrency":5,"input_capacity":{"subcall":{"state":"unknown","tokens":null}},"output_limits":{"root_tokens":50,"subcall_tokens":5},"root":{"id":"root-model","revision":null},"root_sampling":{},"seed":null,"subcall":{"id":"root-model","revision":null},"subcall_sampling":{}},"parent_child":{"identity":"capability-call-parent-v1","trace_depth":"root-zero-child-increment"},"prompt_pack":{"content_hash":"sha256:61da9b9cfae4f2b6c0efddc4c9232cbbfdd9e8187f977874a4ba62aefc9bcfb7","id":"droste.generic.full","profile":"full","revision":"1.0.3"},"sandbox":{"capture_output_chars":25000,"execution_timeout_ms":0,"output_chars":25000},"id":"sha256:b689ad95c39f7bd038640a287fb25600b7951badbd9af332ff9310a72fbba99d"},"stdout_chars":0}} +{"run_id":"golden-cancelled","seq":13,"timestamp":"2026-07-15T00:04:10Z","type":"done","version":8,"persistence_class":"durable","depth":0,"status":"error","ready":false,"extracted":false,"iterations":1,"usage":{"kind":"partial","root":{"input_tokens":8,"cache_read_tokens":3,"cache_creation_tokens":1,"output_tokens":4,"total_tokens":12,"requests":2,"successes":1,"complete":false},"subcall":{"input_tokens":0,"cache_read_tokens":0,"cache_creation_tokens":0,"output_tokens":0,"total_tokens":0,"requests":1,"successes":0,"complete":false},"unattributed":{"total_tokens":0},"total_tokens":12,"wall_time_ms":150},"budget":{"kind":"snapshot","source":"budget_ledger","configured":{"tokens":1000,"subcalls":1,"depth":1,"wall_ms":1000,"root_output_tokens":50,"subcall_output_tokens":5,"max_iterations":30},"consumed":{"tokens":372,"subcalls":1,"wall_ms":150,"depth":0},"remaining":{"tokens":628,"subcalls":0,"wall_ms":850,"depth":1}},"policy":{"contract_enforced":true,"outcome":"not_evaluated","violation_type":null},"retention":{"policy_id":"conformance-all-content","retain":["execution_error","extract","iteration_start","output","repair","result","subcall"],"expires_at":null,"host_managed_expiry":false,"replay_retained":false},"error":{"type":"RuntimeError"},"extract_error":null,"recovered_error":null,"scaffold_manifest_id":"sha256:b689ad95c39f7bd038640a287fb25600b7951badbd9af332ff9310a72fbba99d","scaffold_manifest_version":3,"stdout_chars":0} diff --git a/tests/test_answer_checkpoints.py b/tests/test_answer_checkpoints.py index e1b7e0d..6006b0e 100644 --- a/tests/test_answer_checkpoints.py +++ b/tests/test_answer_checkpoints.py @@ -1,4 +1,4 @@ -"""Answer-state checkpoints (Trace ABI v7). +"""Answer-state checkpoints (Trace ABI v8). All answer-critical state used to live only in the loop's memory until the terminal result. A host that lost the process — a watchdog kill, a crashed @@ -72,8 +72,8 @@ def _valid_body(**overrides: object) -> dict[str, object]: # --- Layer 1: the wire contract ---------------------------------------------- -def test_trace_abi_is_version_seven_and_knows_checkpoint() -> None: - assert TRACE_ABI_VERSION == 7 +def test_trace_abi_is_version_eight_and_knows_checkpoint() -> None: + assert TRACE_ABI_VERSION == 8 assert "checkpoint" in EVENT_TYPES @@ -167,7 +167,7 @@ def test_checkpoint_follows_each_executed_step_whose_draft_moved() -> None: assert [event["ready"] for event in checkpoints] == [False, True] assert [event["iteration"] for event in checkpoints] == [1, 2] assert all(event["payload"] is None for event in checkpoints) - assert all(event["version"] == 7 for event in checkpoints) + assert all(event["version"] == 8 for event in checkpoints) assert all(event["persistence_class"] == "configurable" for event in checkpoints) diff --git a/tests/test_runner_subcall_reporting.py b/tests/test_runner_subcall_reporting.py index da35b27..a26974f 100644 --- a/tests/test_runner_subcall_reporting.py +++ b/tests/test_runner_subcall_reporting.py @@ -253,7 +253,7 @@ def __init__(self, **kwargs: Any) -> None: "seed": 17, } assert manifest["abis"]["runner"] == 10 - assert manifest["abis"]["trace"] == 7 + assert manifest["abis"]["trace"] == 8 assert manifest["engine"]["source_revision"] == "commit-a" assert manifest["id"].startswith("sha256:") assert "trajectory" not in response @@ -295,7 +295,7 @@ def __init__(self, **kwargs: Any) -> None: ] assert len({event["call_id"] for event in live_subcalls}) == 1 assert live_subcalls[1]["checkpoint"] == {"tokens": 5, "subcalls": 1} - assert all(event["iteration"] == 1 and event["version"] == 7 for event in live_subcalls) + assert all(event["iteration"] == 1 and event["version"] == 8 for event in live_subcalls) assert capability["outcome"]["capability_id"]["operation"] == "llm_query" assert "params" not in capability["outcome"] assert "result" not in capability["outcome"] diff --git a/tests/test_subcall_input_capacity.py b/tests/test_subcall_input_capacity.py index fafea8c..7a41cae 100644 --- a/tests/test_subcall_input_capacity.py +++ b/tests/test_subcall_input_capacity.py @@ -349,7 +349,7 @@ def test_runner_preflight_records_declared_capacity() -> None: } -def test_runner_v5_is_refused_before_trace_v7_can_be_ignored() -> None: +def test_runner_v5_is_refused_before_trace_v8_can_be_ignored() -> None: response = run_worker( { "protocol_version": 5, diff --git a/tests/test_trace_abi.py b/tests/test_trace_abi.py index 4e85920..ce67d27 100644 --- a/tests/test_trace_abi.py +++ b/tests/test_trace_abi.py @@ -33,10 +33,10 @@ MockResponse, MockSubcallClient, runner_v10_refusal_ndjson, - trace_v7_execution_ndjson, - trace_v7_lifecycle_ndjson, + trace_v8_execution_ndjson, + trace_v8_lifecycle_ndjson, ) -from droste.testing._trace_fixtures import build_trace_v7_execution_ndjson +from droste.testing._trace_fixtures import build_trace_v8_execution_ndjson from droste_runner.run import run as run_worker @@ -233,7 +233,7 @@ def test_usage_progress_emits_cumulative_role_boundaries_without_estimating() -> assert progress[1]["root"]["total_tokens"] == 10 assert progress[1]["subcall"]["total_tokens"] == 7 assert progress[1]["persistence_class"] == "transient" - assert progress[1]["version"] == 7 + assert progress[1]["version"] == 8 def test_concurrent_subcall_usage_progress_is_serialized_and_monotonic() -> None: @@ -582,7 +582,7 @@ def test_run_record_allows_repeated_durable_budget_mutations() -> None: ] -def test_parser_requires_v7_envelope_and_rejects_false_classification() -> None: +def test_parser_requires_v8_envelope_and_rejects_false_classification() -> None: with pytest.raises(ValueError, match="missing envelope fields"): parse_event({"type": "code", "iteration": 1, "code": "print(1)"}) @@ -592,7 +592,7 @@ def test_parser_requires_v7_envelope_and_rejects_false_classification() -> None: "run_id": "run", "seq": 1, "timestamp": "2026-07-14T00:00:00Z", - "version": 7, + "version": 8, "persistence_class": "configurable", "depth": 0, "iteration": 1, @@ -607,7 +607,7 @@ def test_parser_requires_v7_envelope_and_rejects_false_classification() -> None: "run_id": "run", "seq": 2, "timestamp": "2026-07-14T00:00:00Z", - "version": 7, + "version": 8, "persistence_class": "transient", "depth": 0, "engine_version": "0.10.6", @@ -624,7 +624,7 @@ def test_parser_requires_v7_envelope_and_rejects_false_classification() -> None: "run_id": "run", "seq": 1, "timestamp": "2026-07-14T00:00:00Z", - "version": 7, + "version": 8, "persistence_class": "durable", "depth": 0, "code": "print(1)", @@ -638,7 +638,7 @@ def test_parser_requires_v7_envelope_and_rejects_false_classification() -> None: "run_id": "run", "seq": 1, "timestamp": "2026-07-14T01:00:00+01:00", - "version": 7, + "version": 8, "persistence_class": "transient", "depth": 0, "status": "working", @@ -673,7 +673,7 @@ def test_event_bodies_reject_missing_unknown_and_wrong_primitive_fields() -> Non recorder.finish(terminal) -def test_trace_v7_budget_snapshot_requires_max_iterations() -> None: +def test_trace_v8_budget_snapshot_requires_max_iterations() -> None: recorder = TraceRecorder(run_id="strict-budget") budget = json.loads(json.dumps(_terminal()["budget"])) del budget["configured"]["max_iterations"] @@ -844,11 +844,11 @@ def test_trace_abi_v3_is_rejected_instead_of_dropping_cache_usage() -> None: ) -def _trace_v7_golden_runs() -> dict[str, list[RunEvent]]: +def _trace_v8_golden_runs() -> dict[str, list[RunEvent]]: runs: dict[str, list[RunEvent]] = {} previous_run_id: str | None = None closed: set[str] = set() - for line in trace_v7_lifecycle_ndjson().decode("utf-8").splitlines(): + for line in trace_v8_lifecycle_ndjson().decode("utf-8").splitlines(): event = parse_event(json.loads(line)) if event.run_id != previous_run_id: if event.run_id in closed: @@ -860,9 +860,9 @@ def _trace_v7_golden_runs() -> dict[str, list[RunEvent]]: return runs -def test_trace_v7_execution_fixture_is_canonical_and_exact() -> None: - fixture = trace_v7_execution_ndjson() - assert fixture == build_trace_v7_execution_ndjson() +def test_trace_v8_execution_fixture_is_canonical_and_exact() -> None: + fixture = trace_v8_execution_ndjson() + assert fixture == build_trace_v8_execution_ndjson() events = [parse_event(json.loads(line)) for line in fixture.decode("utf-8").splitlines()] root = events[:6] @@ -894,8 +894,8 @@ def _error_type(value: object) -> object: return value.get("type") if isinstance(value, Mapping) else None -def test_trace_v7_lifecycle_golden_ndjson_is_strict_ordered_and_terminal() -> None: - runs = _trace_v7_golden_runs() +def test_trace_v8_lifecycle_golden_ndjson_is_strict_ordered_and_terminal() -> None: + runs = _trace_v8_golden_runs() assert set(runs) == { "golden-success", "golden-recovered", @@ -991,8 +991,8 @@ def test_trace_v7_lifecycle_golden_ndjson_is_strict_ordered_and_terminal() -> No assert terminal["usage"]["subcall"]["cache_creation_tokens"] == 1 -def test_trace_v7_golden_corpus_covers_each_discriminated_lifecycle() -> None: - events = [event for run in _trace_v7_golden_runs().values() for event in run] +def test_trace_v8_golden_corpus_covers_each_discriminated_lifecycle() -> None: + events = [event for run in _trace_v8_golden_runs().values() for event in run] subcalls = [event for event in events if event.type == "subcall"] repairs = [event for event in events if event.type == "repair"] extracts = [event for event in events if event.type == "extract"] @@ -1019,7 +1019,7 @@ def test_trace_v7_golden_corpus_covers_each_discriminated_lifecycle() -> None: assert {event.body["boundary"] for event in usage_progress} == {"root", "subcall"} assert all(event.persistence_class is PersistenceClass.TRANSIENT for event in usage_progress) - output_limit = _trace_v7_golden_runs()["golden-output-limit"] + output_limit = _trace_v8_golden_runs()["golden-output-limit"] assert not any(event.type == "output" for event in output_limit) assert any( event.type == "execution_error" and event.body["error_type"] == "SandboxError" @@ -1043,7 +1043,7 @@ def test_trace_v7_golden_corpus_covers_each_discriminated_lifecycle() -> None: event.body["message"] for event in output_limit if event.type == "execution_error" ) assert f"exceeded {output_manifest['sandbox']['output_chars']} characters" in output_error - cancelled = _trace_v7_golden_runs()["golden-cancelled"] + cancelled = _trace_v8_golden_runs()["golden-cancelled"] assert cancelled[-1].body["status"] == "error" assert any( event.type == "execution_error" and event.body["error_type"] == "CapabilityCallError" @@ -1057,7 +1057,7 @@ def test_trace_v7_golden_corpus_covers_each_discriminated_lifecycle() -> None: assert cancelled[-1].body["usage"]["root"]["complete"] is False assert cancelled[-1].body["usage"]["subcall"]["complete"] is False - extract_failed = _trace_v7_golden_runs()["golden-extract-failed"] + extract_failed = _trace_v8_golden_runs()["golden-extract-failed"] result = next(event.body["result"] for event in extract_failed if event.type == "result") assert result["answer"] == f"Error: {result['error']['message']}" assert result["error"]["details"]["withheld_content"] == "retained evidence" From 910f4ff947a76713bcc8817d97b8c45091070442 Mon Sep 17 00:00:00 2001 From: Shane Vitarana Date: Mon, 3 Aug 2026 17:52:14 -0400 Subject: [PATCH 2/2] Span the whole provider call, not just the fetch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A streamed response resolves `fetch` as soon as headers arrive and then spends its minutes reading the body in streamResponses, so stopping the heartbeat at the fetch reported nothing for exactly the wait it exists to cover. Caught only by running it: a live query produced 4428 reasoning deltas and zero heartbeats. The unit test passed throughout, because it proved the timer mechanism worked rather than that it spanned the right window — a distinction worth remembering. Now started before the request and stopped in a finally, so it covers headers, body, streaming, and every error path. Verified against a live 75-second subcall: 15003, 30004, 45005, 60006, 75008 ms. The frame that run actually emitted is pinned as a test, including its depth-1 subcall shape. Co-Authored-By: Claude Opus 5 (1M context) --- pyodide/heartbeat_test.ts | 31 +++++- src/droste/substrates/_relay/relay.ts | 149 +++++++++++++------------- 2 files changed, 107 insertions(+), 73 deletions(-) diff --git a/pyodide/heartbeat_test.ts b/pyodide/heartbeat_test.ts index 5bff2f5..59c5f2a 100644 --- a/pyodide/heartbeat_test.ts +++ b/pyodide/heartbeat_test.ts @@ -60,7 +60,10 @@ Deno.test("the timer only ticks while the event loop is free", async () => { try { // Awaiting yields, so the timer runs — a healthy provider wait. await new Promise((resolve) => setTimeout(resolve, 120)); - assert(ticks.length >= 3, `expected ticks while awaiting, got ${ticks.length}`); + assert( + ticks.length >= 3, + `expected ticks while awaiting, got ${ticks.length}`, + ); // Blocking the thread is what a wedged Pyodide execution looks like from // here. No tick may land during it, which is what lets a watchdog still @@ -77,3 +80,29 @@ Deno.test("the timer only ticks while the event loop is free", async () => { clearInterval(timer); } }); + +// The shape a real subcall actually produced, captured from a live 75-second +// provider call. Pinned verbatim because the first implementation wrapped only +// `fetch` — which a streamed response resolves as soon as headers arrive — and +// so reported nothing for exactly the wait it exists to cover. The mechanism +// test above passed anyway, because it proved the timer worked rather than that +// it spanned the right window. Zero heartbeats in a 4428-delta live run is what +// actually caught it. +Deno.test("a heartbeat a live subcall produced is forwarded", () => { + const observed = { + type: "heartbeat", + elapsed_ms: 15003, + run_id: "ca4fd03d-5532-4255-9669-86165c4bb0a3", + parent_run_id: "f6708912-b58d-4e3d-b0e9-a2c28d608635", + depth: 1, + seq: 2, + timestamp: "2026-08-03T21:46:54.805Z", + version: 8, + persistence_class: "transient", + }; + + assert(isRlmEvent(JSON.stringify(observed))); + // depth 1 is a subcall — the calls that run long and, when batched, stream + // nothing at all. That is the case this whole change exists for. + assertEquals(observed.depth, 1); +}); diff --git a/src/droste/substrates/_relay/relay.ts b/src/droste/substrates/_relay/relay.ts index 35cf5c8..042bc9c 100644 --- a/src/droste/substrates/_relay/relay.ts +++ b/src/droste/substrates/_relay/relay.ts @@ -564,14 +564,14 @@ function finishHTTPFailureAssociation(adapterRaised: boolean): number { // while the event loop is free, which is exactly when the process is healthy. const HEARTBEAT_INTERVAL_MS = 15_000; -function withProviderHeartbeat(work: () => Promise): Promise { +function startProviderHeartbeat(): () => void { const startedAt = Date.now(); const timer = setInterval(() => { emitEvent({ type: "heartbeat", elapsed_ms: Date.now() - startedAt }); }, HEARTBEAT_INTERVAL_MS); // Never let liveness reporting hold the process open past its work. if (typeof Deno !== "undefined" && Deno.unrefTimer) Deno.unrefTimer(timer); - return work().finally(() => clearInterval(timer)); + return () => clearInterval(timer); } py.globals.set( @@ -607,80 +607,85 @@ py.globals.set( if (wantsStream) { headers["Accept"] = 'application/x-ndjson; profile="responses-stream/v2"'; } - // The wait that matters: for a non-streamed call the server finishes - // before headers arrive, so this await IS the whole provider latency. - const r = await withProviderHeartbeat(() => - fetch(u, { method: m, headers, body: b }) - ); - // Exact runner callback JSON failures are protocol values for Python. - // Every other HTTP error stays a thrown, bounded transport failure. - if (!r.ok) { - // Set provenance before touching the body: read/decode/cancellation - // failures are still this HTTP failure and must retain its status. - associateHTTPFailure(fetchID, r.status, "transport-exception"); - const contentType = r.headers.get("content-type") || ""; - const typedCallback = shouldReturnRunnerCallbackFailureBody( - m, - u, - contentType, - [ - request.root_endpoint, - request.subcall_endpoint, - request.subcall_batch_endpoint, - ], - ); - if (typedCallback) { - try { - const failureBody = await readBoundedResponseText(r); - if (!failureBody.complete) { - throw new Error("incomplete callback body"); + // Spans the WHOLE call, not just the fetch. A streamed response resolves + // `fetch` as soon as headers arrive and then spends its minutes in + // streamResponses below, so stopping at the fetch reported nothing for + // exactly the wait this exists to cover. + const stopHeartbeat = startProviderHeartbeat(); + try { + const r = await fetch(u, { method: m, headers, body: b }); + // Exact runner callback JSON failures are protocol values for Python. + // Every other HTTP error stays a thrown, bounded transport failure. + if (!r.ok) { + // Set provenance before touching the body: read/decode/cancellation + // failures are still this HTTP failure and must retain its status. + associateHTTPFailure(fetchID, r.status, "transport-exception"); + const contentType = r.headers.get("content-type") || ""; + const typedCallback = shouldReturnRunnerCallbackFailureBody( + m, + u, + contentType, + [ + request.root_endpoint, + request.subcall_endpoint, + request.subcall_batch_endpoint, + ], + ); + if (typedCallback) { + try { + const failureBody = await readBoundedResponseText(r); + if (!failureBody.complete) { + throw new Error("incomplete callback body"); + } + // Keep exact number lexemes raw; only decoded JSON string tokens may + // be rewritten. The returned value keeps a fetch-scoped status + // association until the adapter invocation surfaces or handles it. + const safeBody = validateAndRedactRunnerCallbackFailureBody( + failureBody.text, + [creds.apiKey, creds.customerToken, creds.runnerToken], + ); + associateHTTPFailure(fetchID, r.status, "typed-callback-value"); + return safeBody; + } catch { + // Fall through to a body-free transport error. Invalid UTF-8, + // malformed JSON, short reads, and oversize bodies never cross into + // the untrusted interpreter. + } + } else { + try { + await r.body?.cancel(); + } catch { + // The status was captured before cancellation and remains the only + // diagnostic allowed to cross this boundary. } - // Keep exact number lexemes raw; only decoded JSON string tokens may - // be rewritten. The returned value keeps a fetch-scoped status - // association until the adapter invocation surfaces or handles it. - const safeBody = validateAndRedactRunnerCallbackFailureBody( - failureBody.text, - [creds.apiKey, creds.customerToken, creds.runnerToken], - ); - associateHTTPFailure(fetchID, r.status, "typed-callback-value"); - return safeBody; - } catch { - // Fall through to a body-free transport error. Invalid UTF-8, - // malformed JSON, short reads, and oversize bodies never cross into - // the untrusted interpreter. - } - } else { - try { - await r.body?.cancel(); - } catch { - // The status was captured before cancellation and remains the only - // diagnostic allowed to cross this boundary. } + const redactedStatusText = redactRelayErrorText(r.statusText, [ + creds.apiKey, + creds.customerToken, + creds.runnerToken, + ]).replace(/\s+/g, " ").trim().slice(0, 120); + const statusText = /^[A-Za-z .'-]{1,120}$/.test(redactedStatusText) + ? redactedStatusText + : ""; + throw new Error( + `ModelRelay HTTP ${r.status}${statusText ? ` ${statusText}` : ""}`, + ); } - const redactedStatusText = redactRelayErrorText(r.statusText, [ - creds.apiKey, - creds.customerToken, - creds.runnerToken, - ]).replace(/\s+/g, " ").trim().slice(0, 120); - const statusText = /^[A-Za-z .'-]{1,120}$/.test(redactedStatusText) - ? redactedStatusText - : ""; - throw new Error( - `ModelRelay HTTP ${r.status}${statusText ? ` ${statusText}` : ""}`, - ); - } - // Stream only when we asked for it AND the server actually returned ndjson; - // otherwise fall back to the unary path — behavior identical to before. - const contentType = r.headers.get("content-type") || ""; - const isNdjson = contentType.includes("ndjson") || - contentType.includes("event-stream"); - if (wantsStream && isNdjson) { - return await streamResponses( - r, - (chunk) => emitEvent({ type: "reasoning_delta", text: chunk }), - ); + // Stream only when we asked for it AND the server actually returned ndjson; + // otherwise fall back to the unary path — behavior identical to before. + const contentType = r.headers.get("content-type") || ""; + const isNdjson = contentType.includes("ndjson") || + contentType.includes("event-stream"); + if (wantsStream && isNdjson) { + return await streamResponses( + r, + (chunk) => emitEvent({ type: "reasoning_delta", text: chunk }), + ); + } + return await r.text(); + } finally { + stopHeartbeat(); } - return await r.text(); }, ); // A′: the sandbox receives the credential-stripped request; legacy keeps the