capture_bundle_from_code_hash
Capture a new trial bundle from a code_hash content address instead of a file path, reusing archived code without filesystem access.
Instructions
Capture a bundle using a content address (code_hash) instead of a file path.
This is the rerun-from-archive path: the LLM reads an archived programme, gets the code_hash from the bundle, and captures a new bundle for a new trial using the same code content. No filesystem access is required — the code is loaded from code_snippets by hash, materialized as a real file next to the execution wrapper, and imported at run_trial time.
NOTE: code_hash is a "sha256:..." content address returned by a prior capture_bundle — it is NOT a bundle_id. To re-use an existing bundle's code, pass its code_hash field.
The code_hash must already exist in code_snippets (captured by a prior capture_bundle or prepare_data call). If it doesn't, the tool returns an error.
The bundle's code_ref is set to "code://{code_hash}" — a content address, not a file path. This is the carrier/content separation (Rule 5.4) made explicit: the bundle references the ICE directly.
code_hash_extra is an optional list of additional content
addresses for locally-imported or subprocess-dispatched modules
captured alongside the primary. Each must already exist in
code_snippets. At run_trial time, these are materialized as real
files under a _deps/ dir on sys.path, reconstructing each
file's path suffix — so from src.mod import x resolves through
the real import machinery (commitment 2 + 5).
All other parameters are identical to capture_bundle.
Structured params (seeds, splits, data_refs, code_hash_extra) may be sent as JSON-encoded strings; seeds also accepts a bare int.
Returns: {"bundle_id": "bundle-...", "status": "captured", "code_hash": ...}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seeds | Yes | Seed set sealed into the bundle (pre-registration); list or JSON-encoded. | |
| splits | Yes | Split spec sealed into the bundle; object or JSON-encoded. | |
| env_ref | Yes | Environment reference sealed into the bundle (pre-registration). Accepts a venv/conda directory (mounted read-only; its bin/python runs the trial) or a Python executable path (its venv root is mounted). Non-path values like 'python:3.12' are recorded as provenance but do not change the interpreter — the executor default runs. | |
| trial_id | Yes | ID of the target trial. | |
| code_hash | Yes | 'sha256:...' content address from a prior capture_bundle — NOT a bundle_id; must already exist in code_snippets. | |
| data_refs | No | DataRef IDs from prepare_data — structured data provenance; list or JSON-encoded. | |
| baseline_ref | No | Reference to the baseline the trial compares against. | |
| code_hash_extra | No | Content hashes of additional code files to seal; list or JSON-encoded. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | ||
| code_ref | No | ||
| warnings | No | ||
| bundle_id | No | ||
| code_hash | No | ||
| code_hash_extra | No |