From 67d06fb39efade6116a5e8880baaff71b83b8951 Mon Sep 17 00:00:00 2001 From: Shane Vitarana Date: Mon, 3 Aug 2026 20:23:51 -0400 Subject: [PATCH 1/2] Let a host gate on what a run did, not just what it claims `ready_metadata_validator` receives only model-written metadata, so a host can verify the model's claims about its work but never the work itself. That is enough for "assert nothing you did not support" and not enough for "do not answer without consulting the data" -- a behavioural rule needs what the engine observed, not what the answer says about itself. Add `ready_answer_validator`, called with a `ReadyAnswerState` carrying the metadata plus answer content, iteration, and call counts. Both hooks run when both are supplied and violations from either revoke readiness the same way, so the older hook keeps working unchanged. Trace ABI v8 -> v9: `startup` now reports `ready_gates`, the gates the run actually armed. Enforcement is opt-in and defaults to off, so a host that never passes policy_hints runs with ready_violations and contract_violations permanently inert -- and until now emitted a trace indistinguishable from a fully gated run. One embedder shipped for months in that state while its benchmarks passed hints and measured the enforced configuration; nothing could fail, because nothing recorded which system was running. Co-Authored-By: Claude Opus 5 (1M context) --- UPGRADING.md | 32 +++++ docs/trace-abi.md | 8 +- pyproject.toml | 2 +- src/droste/__init__.py | 4 + src/droste/execution/trace.py | 3 +- src/droste/loop/__init__.py | 4 + src/droste/loop/rlm.py | 20 +++ src/droste/loop/step.py | 77 +++++++--- src/droste/testing/__init__.py | 12 +- src/droste/testing/_trace_fixtures.py | 2 +- ...ution.ndjson => trace-v9-execution.ndjson} | 18 +-- ...cycle.ndjson => trace-v9-lifecycle.ndjson} | 134 +++++++++--------- tests/test_answer_checkpoints.py | 6 +- tests/test_runner_subcall_reporting.py | 4 +- tests/test_subcall_input_capacity.py | 2 +- tests/test_trace_abi.py | 63 +++++--- uv.lock | 2 +- 17 files changed, 258 insertions(+), 135 deletions(-) rename src/droste/testing/fixtures/{trace-v8-execution.ndjson => trace-v9-execution.ndjson} (74%) rename src/droste/testing/fixtures/{trace-v8-lifecycle.ndjson => trace-v9-lifecycle.ndjson} (89%) diff --git a/UPGRADING.md b/UPGRADING.md index c75a839..7417016 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -11,6 +11,38 @@ Ordered newest first. "Embedder" means anything that builds on the engine beyond the `droste` CLI: hosts calling `run_rlm` in-process, `droste_runner` consumers, and Pyodide-substrate integrations staging the Deno relay. +## 0.24.0 + +### Trace ABI v9 reports which ready-time gates a run armed + +The `startup` event gains an optional `ready_gates` array naming the gates the +run actually enabled: any of `policy_hints`, `ready_metadata_validator`, and +`ready_answer_validator`. An empty array means the run enforced nothing. + +It exists because enforcement here is opt-in and defaults to off, so a host that +never passes `policy_hints` runs with `ready_violations` and +`contract_violations` permanently inert -- and until now emitted a trace +identical to a fully gated run. That is the silent degradation this file is for. +One embedder shipped for months in exactly that state while its benchmark suite +passed hints and measured the enforced configuration; no test could fail, +because nothing recorded which system was running. + +**Embedders should assert on `ready_gates` in whatever checks their production +configuration**, and treat an unexpectedly empty array as a misconfiguration +rather than a default. + +### `ready_answer_validator` gates on observed run state + +`run_rlm` accepts a new optional `ready_answer_validator`, called with a +`ReadyAnswerState` (metadata, answer content, iteration, calls made, successful +calls) instead of metadata alone. + +`ready_metadata_validator` sees only model-written metadata, so it can verify +the model's *claims* about its work but not the work. Behavioural rules -- "do +not answer without consulting the data" -- need what the engine observed. The +older hook is unchanged and still supported; both run when both are supplied, +and violations from either revoke readiness identically. + ## 0.23.0 ### Trace ABI v8 reports liveness during provider calls diff --git a/docs/trace-abi.md b/docs/trace-abi.md index 4861758..0f1f8d1 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_v8_execution_ndjson, - trace_v8_lifecycle_ndjson, + trace_v9_execution_ndjson, + trace_v9_lifecycle_ndjson, ) -execution_lines = trace_v8_execution_ndjson().splitlines() -event_lines = trace_v8_lifecycle_ndjson().splitlines() +execution_lines = trace_v9_execution_ndjson().splitlines() +event_lines = trace_v9_lifecycle_ndjson().splitlines() pre_admission_refusal = runner_v10_refusal_ndjson() ``` diff --git a/pyproject.toml b/pyproject.toml index dea791a..968de70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "droste" -version = "0.23.0" +version = "0.24.0" description = "Recursive analysis engine for data too large for a context window, built with Recursive Language Models (RLMs)" readme = "README.md" requires-python = ">=3.11" diff --git a/src/droste/__init__.py b/src/droste/__init__.py index 0bf68aa..6e9862c 100644 --- a/src/droste/__init__.py +++ b/src/droste/__init__.py @@ -109,6 +109,8 @@ CheckpointPayloadProvider, ExtractableWorkProbe, ExtractContextProvider, + ReadyAnswerState, + ReadyAnswerValidator, ReadyMetadataValidator, ReadyMetadataValidatorError, ) @@ -172,6 +174,8 @@ "CheckpointPayloadProvider", "ExtractableWorkProbe", "ExtractContextProvider", + "ReadyAnswerState", + "ReadyAnswerValidator", "ReadyMetadataValidator", "ReadyMetadataValidatorError", "extract_code_block", diff --git a/src/droste/execution/trace.py b/src/droste/execution/trace.py index 0855c25..185fca9 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 = 8 +TRACE_ABI_VERSION = 9 class PersistenceClass(str, Enum): @@ -71,6 +71,7 @@ class PersistenceClass(str, Enum): "provider_protocol": (int, _NONE_TYPE), "scaffold_manifest_id": str, "scaffold_manifest_version": int, + "ready_gates": (list, tuple), }, ), "progress": ({"status": str}, {}), diff --git a/src/droste/loop/__init__.py b/src/droste/loop/__init__.py index 6f6c9ed..c452f19 100644 --- a/src/droste/loop/__init__.py +++ b/src/droste/loop/__init__.py @@ -4,6 +4,8 @@ CheckpointPayloadProvider, ExtractableWorkProbe, ExtractContextProvider, + ReadyAnswerState, + ReadyAnswerValidator, ReadyMetadataValidator, ReadyMetadataValidatorError, ) @@ -20,6 +22,8 @@ "CheckpointPayloadProvider", "ExtractableWorkProbe", "ExtractContextProvider", + "ReadyAnswerState", + "ReadyAnswerValidator", "ReadyMetadataValidator", "ReadyMetadataValidatorError", ] diff --git a/src/droste/loop/rlm.py b/src/droste/loop/rlm.py index 45df043..b8d08af 100644 --- a/src/droste/loop/rlm.py +++ b/src/droste/loop/rlm.py @@ -57,6 +57,7 @@ from .code_extractor import extract_code_block from .step import ( EMPTY_OUTPUT_NUDGE, + ReadyAnswerValidator, ReadyMetadataValidator, RLMConfig, RLMResult, @@ -767,6 +768,7 @@ def run_rlm( prompt_pack: PromptPack | None = None, consumer_prompt_catalog: PromptPackCatalog | None = None, ready_metadata_validator: ReadyMetadataValidator | None = None, + ready_answer_validator: ReadyAnswerValidator | None = None, ) -> RLMResult: try: cfg = config or RLMConfig() @@ -927,6 +929,7 @@ def step_kwargs() -> dict[str, Any]: namespaced_accessor_pairs=namespaced_accessor_pairs, semantic_evidence=semantic_evidence, ready_metadata_validator=ready_metadata_validator, + ready_answer_validator=ready_answer_validator, ) def emit_checkpoint() -> None: @@ -995,6 +998,23 @@ def call_live_root(live_messages: list[dict[str, str]]) -> tuple[str, Any, RLMEr "provider_protocol": scaffold_manifest.body["abis"]["provider"], "scaffold_manifest_id": scaffold_manifest.manifest_id, "scaffold_manifest_version": scaffold_manifest.schema_version, + # Which ready-time gates this run actually armed. Enforcement + # that defaults to off is indistinguishable from a caller who + # meant to disable it, so a run that gates nothing has to say + # so rather than look identical to a fully gated one. Cozy + # shipped for months with policy_hints unset -- every + # ready_violations/contract_violations check inert -- while its + # benchmarks passed hints and measured an enforced system. + # Nothing in either trace recorded the difference. + "ready_gates": sorted( + name + for name, active in ( + ("policy_hints", cfg.policy_hints is not None), + ("ready_metadata_validator", ready_metadata_validator is not None), + ("ready_answer_validator", ready_answer_validator is not None), + ) + if active + ), } ) while not answer.get("ready"): diff --git a/src/droste/loop/step.py b/src/droste/loop/step.py index e24d067..c3e01cf 100644 --- a/src/droste/loop/step.py +++ b/src/droste/loop/step.py @@ -79,6 +79,33 @@ Sequence[str], ] + +@dataclass(frozen=True) +class ReadyAnswerState: + """What the engine observed about a run at the moment it went ready. + + ``metadata`` is written by the model, so a validator reading it alone can + only check the model's *claims* about its own work. Everything else here the + engine observed, so a validator reading this can check what the run actually + *did*. That distinction is the point: "assert nothing you did not support" + is a claim-level rule, but "do not answer without consulting the data" is a + behaviour-level one, and a metadata-only hook cannot express it. + """ + + metadata: Mapping[str, Any] + content: str + iteration: int + calls_made: int + successful_calls: int + + +# Gates a ready answer against observed run state. Prefer this over +# ReadyMetadataValidator, which sees only model-written metadata. +ReadyAnswerValidator: TypeAlias = Callable[ + [ReadyAnswerState], + Sequence[str], +] + # Resolves the opaque value carried by each answer-state checkpoint. The engine # never inspects what this returns and never schema-checks it: hosts use it to # ferry their own answer-critical state (whatever that is) alongside the draft. @@ -671,6 +698,7 @@ def execute_step( namespaced_accessor_pairs: set[tuple[str, str]], semantic_evidence: _StructuredBatchEvidence | None = None, ready_metadata_validator: ReadyMetadataValidator | None = None, + ready_answer_validator: ReadyAnswerValidator | None = None, ) -> StepOutcome: """Execute one code block: the identical path for a first attempt and for repaired code. Policy pre-check, execute, output budget, event emit, @@ -718,25 +746,40 @@ def execute_step( answer_metadata = copy_answer_metadata(answer) except ValueError as exc: violations.append(str(exc)) - if answer.get("ready") and not violations and ready_metadata_validator is not None: - try: - validator_violations = ready_metadata_validator(deepcopy(answer_metadata)) - if isinstance(validator_violations, str) or not isinstance( - validator_violations, Sequence - ): - raise TypeError( - "ready_metadata_validator must return a sequence of violation strings" - ) - for violation in validator_violations: - if not isinstance(violation, str) or not violation.strip(): + if answer.get("ready") and not violations: + host_gates: list[tuple[str, Any]] = [] + if ready_metadata_validator is not None: + host_gates.append( + ("ready_metadata_validator", lambda: ready_metadata_validator(deepcopy(answer_metadata))) + ) + if ready_answer_validator is not None: + state = ReadyAnswerState( + metadata=deepcopy(answer_metadata), + content=str(answer.get("content") or ""), + iteration=iteration, + calls_made=context.stats.calls_made, + successful_calls=context.stats.successful_calls, + ) + host_gates.append(("ready_answer_validator", lambda: ready_answer_validator(state))) + for gate_name, invoke in host_gates: + try: + validator_violations = invoke() + if isinstance(validator_violations, str) or not isinstance( + validator_violations, Sequence + ): raise TypeError( - "ready_metadata_validator violations must be non-empty strings" + f"{gate_name} must return a sequence of violation strings" ) - violations.append(violation.strip()) - except Exception as exc: - raise ReadyMetadataValidatorError( - "ready_metadata_validator failed; inspect the chained host exception" - ) from exc + for violation in validator_violations: + if not isinstance(violation, str) or not violation.strip(): + raise TypeError( + f"{gate_name} violations must be non-empty strings" + ) + violations.append(violation.strip()) + except Exception as exc: + raise ReadyMetadataValidatorError( + f"{gate_name} failed; inspect the chained host exception" + ) from exc if violations: # Revoke readiness BEFORE emitting the output event, so the # published answer_ready is the post-gate truth — never a state diff --git a/src/droste/testing/__init__.py b/src/droste/testing/__init__.py index 367babc..f1b5f26 100644 --- a/src/droste/testing/__init__.py +++ b/src/droste/testing/__init__.py @@ -16,16 +16,16 @@ from .subcall_client import MockSubcallClient -def trace_v8_lifecycle_ndjson() -> bytes: +def trace_v9_lifecycle_ndjson() -> bytes: """Return the shared Trace ABI v7 lifecycle conformance corpus.""" - return files(__package__).joinpath("fixtures/trace-v8-lifecycle.ndjson").read_bytes() + return files(__package__).joinpath("fixtures/trace-v9-lifecycle.ndjson").read_bytes() -def trace_v8_execution_ndjson() -> bytes: +def trace_v9_execution_ndjson() -> bytes: """Return the shared Trace ABI v7 response/code/output/error conformance corpus.""" - return files(__package__).joinpath("fixtures/trace-v8-execution.ndjson").read_bytes() + return files(__package__).joinpath("fixtures/trace-v9-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_v8_execution_ndjson", - "trace_v8_lifecycle_ndjson", + "trace_v9_execution_ndjson", + "trace_v9_lifecycle_ndjson", ] diff --git a/src/droste/testing/_trace_fixtures.py b/src/droste/testing/_trace_fixtures.py index db5c1b5..8fb2137 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_v8_execution_ndjson() -> bytes: +def build_trace_v9_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-v8-execution.ndjson b/src/droste/testing/fixtures/trace-v9-execution.ndjson similarity index 74% rename from src/droste/testing/fixtures/trace-v8-execution.ndjson rename to src/droste/testing/fixtures/trace-v9-execution.ndjson index d002c7b..470905f 100644 --- a/src/droste/testing/fixtures/trace-v8-execution.ndjson +++ b/src/droste/testing/fixtures/trace-v9-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":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} +{"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"persistence_class":"configurable","parent_run_id":"golden-execution-root","depth":1} diff --git a/src/droste/testing/fixtures/trace-v8-lifecycle.ndjson b/src/droste/testing/fixtures/trace-v9-lifecycle.ndjson similarity index 89% rename from src/droste/testing/fixtures/trace-v8-lifecycle.ndjson rename to src/droste/testing/fixtures/trace-v9-lifecycle.ndjson index c278443..29f28e8 100644 --- a/src/droste/testing/fixtures/trace-v8-lifecycle.ndjson +++ b/src/droste/testing/fixtures/trace-v9-lifecycle.ndjson @@ -1,67 +1,67 @@ -{"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} +{"run_id":"golden-success","seq":1,"timestamp":"2026-07-15T00:00:00Z","type":"startup","version":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"persistence_class":"configurable","depth":0,"phase":"start","iteration":1} +{"run_id":"golden-recovered","seq":7,"timestamp":"2026-07-15T00:01:06Z","type":"extract","version":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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":9,"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 6006b0e..f89e312 100644 --- a/tests/test_answer_checkpoints.py +++ b/tests/test_answer_checkpoints.py @@ -72,8 +72,8 @@ def _valid_body(**overrides: object) -> dict[str, object]: # --- Layer 1: the wire contract ---------------------------------------------- -def test_trace_abi_is_version_eight_and_knows_checkpoint() -> None: - assert TRACE_ABI_VERSION == 8 +def test_trace_abi_is_version_nine_and_knows_checkpoint() -> None: + assert TRACE_ABI_VERSION == 9 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"] == 8 for event in checkpoints) + assert all(event["version"] == 9 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 a26974f..38680bf 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"] == 8 + assert manifest["abis"]["trace"] == 9 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"] == 8 for event in live_subcalls) + assert all(event["iteration"] == 1 and event["version"] == 9 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 7a41cae..6ed160d 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_v8_can_be_ignored() -> None: +def test_runner_v5_is_refused_before_trace_v9_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 ce67d27..a4e9720 100644 --- a/tests/test_trace_abi.py +++ b/tests/test_trace_abi.py @@ -33,10 +33,10 @@ MockResponse, MockSubcallClient, runner_v10_refusal_ndjson, - trace_v8_execution_ndjson, - trace_v8_lifecycle_ndjson, + trace_v9_execution_ndjson, + trace_v9_lifecycle_ndjson, ) -from droste.testing._trace_fixtures import build_trace_v8_execution_ndjson +from droste.testing._trace_fixtures import build_trace_v9_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"] == 8 + assert progress[1]["version"] == 9 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_v8_envelope_and_rejects_false_classification() -> None: +def test_parser_requires_v9_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_v8_envelope_and_rejects_false_classification() -> None: "run_id": "run", "seq": 1, "timestamp": "2026-07-14T00:00:00Z", - "version": 8, + "version": 9, "persistence_class": "configurable", "depth": 0, "iteration": 1, @@ -607,7 +607,7 @@ def test_parser_requires_v8_envelope_and_rejects_false_classification() -> None: "run_id": "run", "seq": 2, "timestamp": "2026-07-14T00:00:00Z", - "version": 8, + "version": 9, "persistence_class": "transient", "depth": 0, "engine_version": "0.10.6", @@ -624,7 +624,7 @@ def test_parser_requires_v8_envelope_and_rejects_false_classification() -> None: "run_id": "run", "seq": 1, "timestamp": "2026-07-14T00:00:00Z", - "version": 8, + "version": 9, "persistence_class": "durable", "depth": 0, "code": "print(1)", @@ -638,7 +638,7 @@ def test_parser_requires_v8_envelope_and_rejects_false_classification() -> None: "run_id": "run", "seq": 1, "timestamp": "2026-07-14T01:00:00+01:00", - "version": 8, + "version": 9, "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_v8_budget_snapshot_requires_max_iterations() -> None: +def test_trace_v9_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_v8_golden_runs() -> dict[str, list[RunEvent]]: +def _trace_v9_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_v8_lifecycle_ndjson().decode("utf-8").splitlines(): + for line in trace_v9_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_v8_golden_runs() -> dict[str, list[RunEvent]]: return runs -def test_trace_v8_execution_fixture_is_canonical_and_exact() -> None: - fixture = trace_v8_execution_ndjson() - assert fixture == build_trace_v8_execution_ndjson() +def test_trace_v9_execution_fixture_is_canonical_and_exact() -> None: + fixture = trace_v9_execution_ndjson() + assert fixture == build_trace_v9_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_v8_lifecycle_golden_ndjson_is_strict_ordered_and_terminal() -> None: - runs = _trace_v8_golden_runs() +def test_trace_v9_lifecycle_golden_ndjson_is_strict_ordered_and_terminal() -> None: + runs = _trace_v9_golden_runs() assert set(runs) == { "golden-success", "golden-recovered", @@ -991,8 +991,8 @@ def test_trace_v8_lifecycle_golden_ndjson_is_strict_ordered_and_terminal() -> No assert terminal["usage"]["subcall"]["cache_creation_tokens"] == 1 -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] +def test_trace_v9_golden_corpus_covers_each_discriminated_lifecycle() -> None: + events = [event for run in _trace_v9_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_v8_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_v8_golden_runs()["golden-output-limit"] + output_limit = _trace_v9_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_v8_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_v8_golden_runs()["golden-cancelled"] + cancelled = _trace_v9_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_v8_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_v8_golden_runs()["golden-extract-failed"] + extract_failed = _trace_v9_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" @@ -1329,3 +1329,22 @@ def test_injected_context_owns_trace_settings_and_conflicts_fail() -> None: ), context=context, ) + + +def test_startup_reports_the_ready_gates_a_run_armed() -> None: + """An ungated run must be distinguishable from a gated one in the trace. + + Enforcement is opt-in and defaults to off, so silence here used to mean + both "the caller declined to gate" and "the caller forgot". + """ + + from droste.execution.trace import validate_event_body + + validate_event_body("startup", {"engine_version": "0.24.0", "ready_gates": []}) + validate_event_body( + "startup", + { + "engine_version": "0.24.0", + "ready_gates": ["policy_hints", "ready_answer_validator"], + }, + ) diff --git a/uv.lock b/uv.lock index 4d9ec43..80b4dcd 100644 --- a/uv.lock +++ b/uv.lock @@ -562,7 +562,7 @@ wheels = [ [[package]] name = "droste" -version = "0.23.0" +version = "0.24.0" source = { editable = "." } [package.optional-dependencies] From 347de0723449ab3b1ada4b01986a29ea9e47e76c Mon Sep 17 00:00:00 2001 From: Shane Vitarana Date: Mon, 3 Aug 2026 20:30:50 -0400 Subject: [PATCH 2/2] Carry Trace ABI v9 across the relay and the packaged corpus The ABI is cross-language and the fixture corpus is a shipped artifact, so bumping the Python constant alone left three consumers on v8: the TypeScript relay's envelope check and startup schema, the golden NDJSON the Deno tests compare byte for byte, and the CI step asserting distributions bundle the exact fixture filenames. Teach the relay's startup schema about ready_gates, move every v8 envelope literal and fixture path to v9, and reformat step.py. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 36 +++++++++++++------------- examples/pyodide-host/e2e_test.ts | 2 +- pyodide/event_channel_probe.ts | 2 +- pyodide/event_channel_test.ts | 2 +- pyodide/events_test.ts | 6 ++--- pyodide/heartbeat_test.ts | 4 +-- src/droste/loop/step.py | 13 +++++----- src/droste/substrates/_relay/events.ts | 5 ++-- src/droste/substrates/_relay/relay.ts | 2 +- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4a8f77..67f7d8d 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-v8-execution.ndjson trace-v8-lifecycle.ndjson runner-v10-refusal.ndjson; do + for f in trace-v9-execution.ndjson trace-v9-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_v8_execution_ndjson, - trace_v8_lifecycle_ndjson, + trace_v9_execution_ndjson, + trace_v9_lifecycle_ndjson, ) source = Path(sys.argv[1]) - 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 trace_v9_execution_ndjson() == (source / "trace-v9-execution.ndjson").read_bytes() + assert trace_v9_lifecycle_ndjson() == (source / "trace-v9-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-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/trace-v9-lifecycle.ndjson \ + "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v9-lifecycle.ndjson" + cmp src/droste/testing/fixtures/trace-v9-execution.ndjson \ + "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v9-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-v8-execution.ndjson trace-v8-lifecycle.ndjson runner-v10-refusal.ndjson; do + for f in trace-v9-execution.ndjson trace-v9-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_v8_execution_ndjson, - trace_v8_lifecycle_ndjson, + trace_v9_execution_ndjson, + trace_v9_lifecycle_ndjson, ) source = Path(sys.argv[1]) - 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 trace_v9_execution_ndjson() == (source / "trace-v9-execution.ndjson").read_bytes() + assert trace_v9_lifecycle_ndjson() == (source / "trace-v9-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-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/trace-v9-lifecycle.ndjson \ + "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v9-lifecycle.ndjson" + cmp src/droste/testing/fixtures/trace-v9-execution.ndjson \ + "$tmp/$sdist_root/src/droste/testing/fixtures/trace-v9-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/examples/pyodide-host/e2e_test.ts b/examples/pyodide-host/e2e_test.ts index e2f0981..c8c0843 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-v8-lifecycle.ndjson", + "../../src/droste/testing/fixtures/trace-v9-lifecycle.ndjson", import.meta.url, ); const TEST_BUDGET = { diff --git a/pyodide/event_channel_probe.ts b/pyodide/event_channel_probe.ts index 353b001..e820574 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-v8-lifecycle.ndjson", + "../src/droste/testing/fixtures/trace-v9-lifecycle.ndjson", import.meta.url, ), ); diff --git a/pyodide/event_channel_test.ts b/pyodide/event_channel_test.ts index 2e0c8fc..769911d 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-v8-lifecycle.ndjson", + "../src/droste/testing/fixtures/trace-v9-lifecycle.ndjson", import.meta.url, ); diff --git a/pyodide/events_test.ts b/pyodide/events_test.ts index 5feaa87..aa1d328 100644 --- a/pyodide/events_test.ts +++ b/pyodide/events_test.ts @@ -170,7 +170,7 @@ function wire( run_id: "run-1", seq: 1, timestamp: "2026-07-14T00:00:00Z", - version: 8, + version: 9, persistence_class: persistence ?? PERSISTENCE_BY_TYPE[type], depth: 0, ...body, @@ -384,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-v8-execution.ndjson", + "../src/droste/testing/fixtures/trace-v9-execution.ndjson", import.meta.url, ); const lines = (await Deno.readTextFile(fixture)).trim().split("\n"); @@ -428,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-v8-lifecycle.ndjson", + "../src/droste/testing/fixtures/trace-v9-lifecycle.ndjson", import.meta.url, ); const lines = (await Deno.readTextFile(fixture)).trim().split("\n"); diff --git a/pyodide/heartbeat_test.ts b/pyodide/heartbeat_test.ts index 59c5f2a..056f9d4 100644 --- a/pyodide/heartbeat_test.ts +++ b/pyodide/heartbeat_test.ts @@ -22,7 +22,7 @@ const { isRlmEvent, PERSISTENCE_BY_TYPE, RLM_EVENT_TYPES } = await import( function wire(body: Record): string { return JSON.stringify({ type: "heartbeat", - version: 8, + version: 9, run_id: "run-1", seq: 4, timestamp: "2026-08-03T00:00:00Z", @@ -97,7 +97,7 @@ Deno.test("a heartbeat a live subcall produced is forwarded", () => { depth: 1, seq: 2, timestamp: "2026-08-03T21:46:54.805Z", - version: 8, + version: 9, persistence_class: "transient", }; diff --git a/src/droste/loop/step.py b/src/droste/loop/step.py index c3e01cf..c776f45 100644 --- a/src/droste/loop/step.py +++ b/src/droste/loop/step.py @@ -750,7 +750,10 @@ def execute_step( host_gates: list[tuple[str, Any]] = [] if ready_metadata_validator is not None: host_gates.append( - ("ready_metadata_validator", lambda: ready_metadata_validator(deepcopy(answer_metadata))) + ( + "ready_metadata_validator", + lambda: ready_metadata_validator(deepcopy(answer_metadata)), + ) ) if ready_answer_validator is not None: state = ReadyAnswerState( @@ -767,14 +770,10 @@ def execute_step( if isinstance(validator_violations, str) or not isinstance( validator_violations, Sequence ): - raise TypeError( - f"{gate_name} must return a sequence of violation strings" - ) + raise TypeError(f"{gate_name} must return a sequence of violation strings") for violation in validator_violations: if not isinstance(violation, str) or not violation.strip(): - raise TypeError( - f"{gate_name} violations must be non-empty strings" - ) + raise TypeError(f"{gate_name} violations must be non-empty strings") violations.append(violation.strip()) except Exception as exc: raise ReadyMetadataValidatorError( diff --git a/src/droste/substrates/_relay/events.ts b/src/droste/substrates/_relay/events.ts index c93671f..6f9f0a9 100644 --- a/src/droste/substrates/_relay/events.ts +++ b/src/droste/substrates/_relay/events.ts @@ -7,7 +7,7 @@ // The events the engine + relay emit. The native subprocess runner uses the same // set on stdout NDJSON — one vocabulary across substrates. export const RLM_EVENT_TYPES = new Set([ - "startup", // {engine_version, runner_protocol, provider_protocol} — contract handshake (#33) + "startup", // {engine_version, runner_protocol, provider_protocol, ready_gates} — contract handshake (#33) "progress", // coarse human-readable status "iteration_start", // {iteration, remaining_tokens} "llm_response", // {iteration, response} — the root model's full reply (#35) @@ -246,6 +246,7 @@ function validBody(type: string, body: Record): boolean { "provider_protocol", "scaffold_manifest_id", "scaffold_manifest_version", + "ready_gates", ], ) && stringField("engine_version") && ["runner_protocol", "provider_protocol"].every((key) => @@ -438,7 +439,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 === 8 && + o.version === 9 && 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 042bc9c..69e9d9e 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: 8, + version: 9, persistence_class: "transient", }; eventChannel.writeFrame(JSON.stringify(event));