|
| 1 | +--- |
| 2 | +id: js6maenxqbn2c2wf78wad3r4 |
| 3 | +title: Execution lock contract for runtime, image, and plugin provenance |
| 4 | +status: backlog |
| 5 | +source: 2026-05-25 full ADE gpt-5.4-mini audit - frozen provenance recorded dab-agent while run used ADE task images and mutable Codex install; captain directive for a unified contract covering Claude Code, Codex, Spacedock, images, and harness realization |
| 6 | +started: |
| 7 | +completed: |
| 8 | +verdict: |
| 9 | +score: 0.97 |
| 10 | +auto-approve: false |
| 11 | +worktree: |
| 12 | +issue: |
| 13 | +pr: |
| 14 | +mod-block: |
| 15 | +--- |
| 16 | + |
| 17 | +## Problem |
| 18 | + |
| 19 | +Razorback's current freeze/run provenance contract is fragmented. The full |
| 20 | +ADE-Bench `gpt-5.4-mini` run surfaced the concrete failure: the frozen spec |
| 21 | +recorded `image_digest` for local `dab-agent:latest`, while Harbor actually |
| 22 | +built and ran generated ADE task images from `python:3.11-slim`. Codex was not |
| 23 | +baked into those task images; Harbor installed `@openai/codex@latest` at trial |
| 24 | +setup time. Spacedock provenance recorded a placeholder skill version rather |
| 25 | +than the actual staged plugin identity. |
| 26 | + |
| 27 | +That means the score can be reproduced from local run artifacts, but the |
| 28 | +provenance does not truthfully describe the execution substrate. Future scored |
| 29 | +runs need a single execution-lock contract that distinguishes: |
| 30 | + |
| 31 | +- frozen intent: what razorback intended to run; |
| 32 | +- observed realization: what Harbor actually built, installed, staged, and |
| 33 | + executed; |
| 34 | +- enforcement: whether `rk run`, `rk score`, and `rk audit` refuse or mark |
| 35 | + non-canonical when observed realization differs from the lock. |
| 36 | + |
| 37 | +This must cover benchmark task images, DAB compose images, Claude Code, Codex, |
| 38 | +Spacedock plugin/skills, solver workflow content, Harbor/Razorback versions, |
| 39 | +and benchmark task-view identity without inventing separate ad hoc contracts |
| 40 | +per runtime. |
| 41 | + |
| 42 | +## Acceptance criteria |
| 43 | + |
| 44 | +**AC-1 - Unified execution-lock schema exists.** |
| 45 | +Frozen specs and run artifacts expose one documented `execution_lock` shape |
| 46 | +covering `benchmark_image`, `agent_runtime`, `orchestration`, `harness`, and |
| 47 | +`policy` sections. The schema explicitly models both frozen intent and observed |
| 48 | +realization without overloading legacy `provenance.image_digest` or |
| 49 | +`agent_cli_hash`. |
| 50 | +Verified by: schema/model tests parse a frozen spec containing the full lock |
| 51 | +and reject unknown lock fields. |
| 52 | + |
| 53 | +**AC-2 - Benchmark image locking matches the actual run path.** |
| 54 | +ADE/Spider task-view runs lock Dockerfile/build-context identity and record the |
| 55 | +actual built task-image digest per task. DAB/generic Harbor compose runs lock |
| 56 | +the compose image refs actually used by services such as `main`, postgres, and |
| 57 | +mongo. No benchmark may fall back to an unrelated default image for provenance. |
| 58 | +Verified by: a fixture ADE run no longer records `dab-agent` when task views |
| 59 | +are built from `python:3.11-slim`; a DAB fixture records the digest-pinned |
| 60 | +`main` service image. |
| 61 | + |
| 62 | +**AC-3 - Agent CLI/runtime locking is explicit and enforceable.** |
| 63 | +Claude Code and Codex runtimes record install mode (`prebaked`, `npm`, or |
| 64 | +`binary`), package/ref, resolved version, binary hash, and install-plan hash. |
| 65 | +Runtime installs may not use mutable `latest` unless the run is explicitly |
| 66 | +marked non-canonical or allowed by a named development policy. |
| 67 | +Verified by: tests fail a frozen scored run that would install |
| 68 | +`@openai/codex@latest` or `@anthropic-ai/claude-code@latest`, and pass a run |
| 69 | +with a pinned package version or prebaked binary hash. |
| 70 | + |
| 71 | +**AC-4 - Spacedock and solver workflow identity are locked as first-class inputs.** |
| 72 | +The lock records the staged Spacedock plugin manifest version, plugin content |
| 73 | +hash, first-officer skill hash, ensign skill hash, agent asset hashes, and |
| 74 | +solver workflow hash. Placeholder values such as `spacedock_skill_version: |
| 75 | +1.0.0` are not sufficient for canonical scored runs. |
| 76 | +Verified by: changing a staged Spacedock skill or solver workflow causes |
| 77 | +`rk run` to detect lock drift before agent execution unless an explicit |
| 78 | +`--allow-...-drift` option is used. |
| 79 | + |
| 80 | +**AC-5 - `rk run` enforces lock/observed consistency and writes realization artifacts.** |
| 81 | +`rk run` writes an `observed_execution.yaml` (or equivalently named artifact) |
| 82 | +after image build, agent install/setup, plugin staging, and Harbor dispatch. It |
| 83 | +compares observed values to the frozen lock and refuses canonical runs on |
| 84 | +mismatch. Existing drift flags remain narrow and explicit. |
| 85 | +Verified by: integration fixtures cover both a matching run and a deliberate |
| 86 | +image/runtime/plugin mismatch; the mismatch exits with a documented |
| 87 | +provenance/drift error before scoring. |
| 88 | + |
| 89 | +**AC-6 - `rk score` and `rk audit` surface canonicality.** |
| 90 | +Score and audit outputs include a canonicality status derived from the |
| 91 | +execution lock. A run with reproducible local artifacts but mismatched or |
| 92 | +missing execution-lock evidence is reported as non-canonical instead of cleanly |
| 93 | +publishable. |
| 94 | +Verified by: a fixture modeled after the ADE `gpt-5.4-mini` run reports the |
| 95 | +numeric score but also reports non-canonical provenance because the frozen |
| 96 | +image/agent/plugin lock does not match observed execution. |
| 97 | + |
| 98 | +## Test plan |
| 99 | + |
| 100 | +- Start with a failing fixture that mirrors the discovered ADE run shape: |
| 101 | + frozen `image_digest` points at `dab-agent`, task views are generated from |
| 102 | + `python:3.11-slim`, Codex is runtime-installed with `@latest`, and Spacedock |
| 103 | + identity is placeholder-only. |
| 104 | +- Add schema/model tests for the unified lock shape before changing run logic. |
| 105 | +- Add lock builders per benchmark/runtime, then wire `rk freeze` to emit only |
| 106 | + values it can honestly enforce or observe at run time. |
| 107 | +- Add `rk run` observed-realization fixtures for ADE task images, DAB compose, |
| 108 | + Codex, Claude Code, and Spacedock plugin staging. |
| 109 | +- Add `rk score` / `rk audit` fixture coverage for canonical and |
| 110 | + non-canonical outputs. |
| 111 | + |
| 112 | +## Out of scope |
| 113 | + |
| 114 | +- Re-scoring the existing ADE `gpt-5.4-mini` run. This task defines future |
| 115 | + provenance and canonicality behavior; historical runs can be reclassified but |
| 116 | + not made canonical retroactively. |
| 117 | +- Choosing whether Claude/Codex should be prebaked or installed at setup time. |
| 118 | + This contract supports both, as long as the choice is pinned and enforced. |
| 119 | +- Renaming or rebuilding the DAB agent image. Existing image-specific backlog |
| 120 | + items own that work. |
| 121 | +- Retiring legacy provenance fields immediately. Compatibility shims may remain |
| 122 | + as long as the new lock is the canonical source for new scored runs. |
| 123 | + |
| 124 | +## Depends on |
| 125 | + |
| 126 | +- Coordinate with `hm` generic Harbor surface work before implementation so the |
| 127 | + lock schema lands on the post-HM benchmark abstraction rather than the |
| 128 | + soon-to-be-reworked ADE/DAB-specific paths. |
| 129 | +- Related but not blocked by: |
| 130 | + - `canonical-sealed-hash-runtime-freeze-key` |
| 131 | + - `pkg24-vendor-dab-agent-dockerfile` |
| 132 | + - `ade-bench-task-image-claude-cli-layer` |
| 133 | + - `dab-agent-image-duckdb-extension-preinstall` |
| 134 | + |
| 135 | +## Resume hook |
| 136 | + |
| 137 | +When this lands, future scored runs can answer "what exact image, agent CLI, |
| 138 | +Spacedock plugin, solver workflow, and harness did this score use?" from a |
| 139 | +single lock/observed-realization pair, and `rk score` / `rk audit` can separate |
| 140 | +"locally reproducible" from "canonical publishable." |
0 commit comments