From ee98ad2d90e3b22c025578972b75692376136fc4 Mon Sep 17 00:00:00 2001 From: Holon Intent Agent Date: Wed, 2 Dec 2026 23:26:35 +0000 Subject: [PATCH 01/10] intent: created I-1796253987-hac-image-source-commit-label/_ Description: Built Docker role images currently carry no org.holon.source-commit label, so merged engine fixes can remain undeployed in stale container images while host preflight runs unseen. Goal: Stamp org.holon.source-commit on every Holon image via build args/labels in apps/sandbox-executor/Dockerfile, apps/sandbox-executor/docker-bake.hcl, and apps/sandbox-executor/build_all_images.sh, and update apps/sandbox-executor/src/sandbox_executor/preflight.py to read the runner image's org.holon.source-commit label, report any mismatch against the host commit in preflight results, and fail launch unless an explicit override is set. Add hermetic unit tests in apps/sandbox-executor/tests/test_preflight.py under uv run pytest. Code is self-explaining: no docstrings and no comments except '# why:' comments that record a reason the code cannot show. Generated by Holon Intent Agent at 2026-12-02T23:26:35Z --- .../intents/I-1796253987-hac-image-source-commit-label.jsonl | 1 + 1 file changed, 1 insertion(+) create mode 100644 holon-knowledge/ledger/pending/intents/I-1796253987-hac-image-source-commit-label.jsonl diff --git a/holon-knowledge/ledger/pending/intents/I-1796253987-hac-image-source-commit-label.jsonl b/holon-knowledge/ledger/pending/intents/I-1796253987-hac-image-source-commit-label.jsonl new file mode 100644 index 000000000..db2192ae8 --- /dev/null +++ b/holon-knowledge/ledger/pending/intents/I-1796253987-hac-image-source-commit-label.jsonl @@ -0,0 +1 @@ +{"slug": "hac-image-source-commit-label", "target_branch": "main", "description": "Built Docker role images currently carry no org.holon.source-commit label, so merged engine fixes can remain undeployed in stale container images while host preflight runs unseen.", "goal": "Stamp org.holon.source-commit on every Holon image via build args/labels in apps/sandbox-executor/Dockerfile, apps/sandbox-executor/docker-bake.hcl, and apps/sandbox-executor/build_all_images.sh, and update apps/sandbox-executor/src/sandbox_executor/preflight.py to read the runner image's org.holon.source-commit label, report any mismatch against the host commit in preflight results, and fail launch unless an explicit override is set. Add hermetic unit tests in apps/sandbox-executor/tests/test_preflight.py under uv run pytest. Code is self-explaining: no docstrings and no comments except '# why:' comments that record a reason the code cannot show.", "rationale": "Prevents split-version silent failures between host CLI code and containerised role images.", "scope": ["apps/sandbox-executor/Dockerfile", "apps/sandbox-executor/docker-bake.hcl", "apps/sandbox-executor/build_all_images.sh", "apps/sandbox-executor/src/sandbox_executor/preflight.py", "apps/sandbox-executor/tests/test_preflight.py"], "acceptance_criteria": ["Every holon image carries an org.holon.source-commit label in apps/sandbox-executor/Dockerfile, docker-bake.hcl, and build_all_images.sh with the commit it was built from, and a unit test reads it back.", "preflight.py (tested in test_preflight.py) reports and records a host/image commit mismatch in holon flow pre-flight and refuses to launch without an explicit override."], "assumptions": [{"id": "A1", "statement": "Dockerfile currently has no LABEL org.holon.source-commit and preflight.py currently performs no docker image inspect commit check (verified in Dockerfile and preflight.py on origin/main).", "impact": "high"}, {"id": "A2", "statement": "Hermetic tests in test_preflight.py can mock docker image inspect output cleanly without requiring a live Docker daemon or network access.", "impact": "high"}], "assumption_validation": [{"assumption_id": "A1", "method": "Grepped org.holon.source-commit in Dockerfile, docker-bake.hcl, build_all_images.sh, and preflight.py."}, {"assumption_id": "A2", "method": "Stage 3 runs test_preflight.py, test_environment_reference.py, and test_runner_specs.py."}], "assumption_risk": [{"assumption_id": "A1", "likelihood": "low", "testability": "testable", "score": 1, "response": "Default build arg to unknown so local builds without git context still succeed, and skip host check gracefully when HOLON_SKIP_PREFLIGHT or stubbed runner_fn is used in existing tests."}, {"assumption_id": "A2", "likelihood": "medium", "testability": "testable", "score": 2, "response": "Only enforce image commit match when image inspect returns a concrete commit SHA and host git HEAD resolves."}], "branch": "I-1796253987-hac-image-source-commit-label", "status": "proposed", "created_at": "2026-12-02T23:26:35.351Z"} From 0c6bae9cc61a5509d5d4260f7a395233ee4d0111 Mon Sep 17 00:00:00 2001 From: Holon Planner Agent Date: Wed, 2 Dec 2026 23:31:41 +0000 Subject: [PATCH 02/10] plan: P-1796254010-CLA-CO5.5 created by claude-agent (claude-opus-5-5) --- ...253987-hac-image-source-commit-label.jsonl | 1 + .../P-1796254010-CLA-CO5.5.md | 557 ++++++++++++++++++ 2 files changed, 558 insertions(+) create mode 100644 holon-knowledge/ledger/pending/plans/I-1796253987-hac-image-source-commit-label.jsonl create mode 100644 plans/I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5.md diff --git a/holon-knowledge/ledger/pending/plans/I-1796253987-hac-image-source-commit-label.jsonl b/holon-knowledge/ledger/pending/plans/I-1796253987-hac-image-source-commit-label.jsonl new file mode 100644 index 000000000..310aebe42 --- /dev/null +++ b/holon-knowledge/ledger/pending/plans/I-1796253987-hac-image-source-commit-label.jsonl @@ -0,0 +1 @@ +{"plan_id": "P-1796254010-CLA-CO5.5", "intent_branch": "I-1796253987-hac-image-source-commit-label/_", "agent": "claude-agent", "agent_version": "2.1.302", "model": "claude-opus-5-5", "p_success": 0.82, "entropy": 5.5, "impact": 70.0, "cost": 10.0, "learning_value": 4.0, "ev": 47.75, "created_at": "2026-12-02T23:31:38.077Z", "plan_file": "plans/I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5.md", "status": "proposed", "entropy_budget": 15.0, "decomposition_decision": "execute", "touch_set": [{"path": "apps/sandbox-executor/Dockerfile"}, {"path": "apps/sandbox-executor/docker-bake.hcl"}, {"path": "apps/sandbox-executor/build_all_images.sh"}, {"path": "apps/sandbox-executor/src/sandbox_executor/preflight.py"}, {"path": "apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py"}, {"path": "apps/sandbox-executor/tests/test_preflight.py"}]} diff --git a/plans/I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5.md b/plans/I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5.md new file mode 100644 index 000000000..a41f80ffb --- /dev/null +++ b/plans/I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5.md @@ -0,0 +1,557 @@ +# Plan for I-1796253987-hac-image-source-commit-label + +- **Plan ID:** P-1796254010-CLA-CO5.5 +- **Parent Intent ID:** NONE +- **Agent:** claude-agent/claude-opus-5-5 (version: 2.1.302) +- **Created At:** 2026-12-02T23:26:52.540Z + +## Planner Autonomy Summary + +- **Intent handling:** REFRAME +- **Reframed intent (if applicable):** Stamp `org.holon.source-commit` on every image exactly as asked, but define the + blocking "mismatch" as "the host's image build inputs (`apps/sandbox-executor/src`, `entrypoint`, `Dockerfile`) differ + from the ones at the image's commit", not as a raw SHA difference. Preflight still reports and records both SHAs every + time. Reuse the existing explicit override (`--skip-preflight` or `HOLON_SKIP_PREFLIGHT`) rather than adding a new + `HOLON_*` variable. Put the label logic in a focused sibling module `preflight_image_commit.py`, recorded as a scope + expansion, because `preflight.py` is already at 477 of its frozen 548 lines. +- **Exploration stance:** balanced. The code is mostly exploit work. One assumption gets a cheap explicit probe: that + BuildKit leaves the npm layer caches intact when the label is the last instruction of each stage, so that a label on + every commit does not force a rebuild of every agent layer. +- **Safety priority level:** elevated +- **Priority Justification:** This change adds a gate that can refuse every `holon flow`, `plan`, `execute` and `doctor` + launch. A wrong positive would block all work on main, where bookkeeping-only ledger commits land all the time. That + is why a raw SHA check is reframed into a check of the build inputs. `constraints.md` §1 (commit boundaries) and the + frozen module budget rule also apply: the budget is not touched, and a new module is added instead. + +## Exploration + +- **Proportion of steps that are exploratory:** 0.25 +- **Justification:** One of four steps (Step 1) carries a BALANCED learning target about BuildKit cache behaviour of a + per-commit label. The rest is well-understood Python, shell and test work with a known pattern (hermetic fakes for + `docker` and real `git` in `tmp_path`). + +## Overall Plan Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.82 | +| entropy_pred | 5.5 | +| impact_pred | 70.0 | +| cost_pred | 10.0 | +| learning_value_pred | 4.0 | +| ev_pred | 47.75 | + +### Strategy Rationale + +The intent is valuable: a merged engine fix that never reaches the role images is a silent split-version failure, and +the label is cheap to add. A literal reading has one high-cost flaw, though. Comparing the image label SHA with host +`HEAD` would fail on almost every launch from `main`. Ledger promotion, calibration and plan commits move `HEAD` without +touching anything copied into the image (the image only copies `src/` and `entrypoint/role_dispatcher.sh`, and is built +from `Dockerfile`). Users would learn to always pass `--skip-preflight`, and that would also disable the credential and +quota probe. That is a negative-EV outcome. The plan therefore: + +1. stamps the exact commit (meeting the first acceptance criterion literally); +2. resolves the host commit and records both SHAs in the preflight result and log every time (meeting the "reports and + records" part); +3. refuses launch only when `git diff --quiet -- src entrypoint Dockerfile` in the engine checkout + reports a difference, or the image commit is unknown to the host repository. Either case means the image cannot be + shown to match the host; +4. honours the existing explicit override (`--skip-preflight`, `HOLON_SKIP_PREFLIGHT`). This keeps the change inside + scope with no new `HOLON_*` name. A new name would force edits to `env_registry.py` and + `docs/environment_variables.md` (the two-way drift guard in `test_environment_reference.py`). + +The check is unverifiable (skipped with a logged warning, not blocking) when any of these holds: the label is missing or +not a 40-hex SHA (for example `unknown`), `docker image inspect` fails (missing image or daemon down, which the probe +itself reports), or the engine is not a git checkout. This follows the intent's own A1/A2 risk responses. + +Aggregation: overall `p_success` is close to the product of the per-step values, because Steps 2 and 3 are the +bottleneck (Step 1's build-file edits are simple; Step 4 is verification). The product is +`0.92 * 0.88 * 0.90 * 0.97 = 0.707`. It is raised to 0.82 because failures in Steps 2 and 3 are mostly recoverable +within the same execution (lint or complexity fixes), not terminal. Entropy is the sum of step entropies +(`1.5 + 2.0 + 1.5 + 0.5 = 5.5`). Cost is the sum (`2.5 + 3.5 + 3.0 + 1.0 = 10.0`). Impact is the plan-level qualitative +value. `EV = 0.82 * 70.0 + 0.5 * 4.0 - 0.3 * 5.5 - 10.0 = 57.40 + 2.00 - 1.65 - 10.0 = 47.75`. + +## Safety & Constraint Alignment + +- **Key world ruleset constraints that affect this plan:** + - `holon-config/world/constraints.md` §1: commits stay on the plan/execution branch; no direct work on `main`. + - `holon-config/world/constraints.md` §2: the work needs only the process sandbox (entropy well below 10). + - `holon-config/world/ruleset.md` §3: test changes are declared here (Step 3), with `pytest` as the runner. + - `docs/safety.md` "Entropy budgets": the plan sits at 5.5 against a budget of 15.0. + - Repository hygiene: the module budget file is frozen and must not change. C901 / PLR0912 / PLR0913 / PLR0915 limits + apply. The self-explaining rule allows no docstrings or comments except `# why:`, and that applies to the + Dockerfile, HCL and shell files too. + - `test_environment_reference.py` scans `Dockerfile`, `docker-bake.hcl` and `build_all_images.sh` for `HOLON_*` names, + so the build argument is named `SOURCE_COMMIT` (no `HOLON_` prefix). + - Environment overlay discipline: `build_all_images.sh` exports `SOURCE_COMMIT` to its `docker buildx bake` child. +- **Potential violations or edge cases:** + - The gate blocks launches on main for commits that do not touch image inputs (avoided by comparing build inputs). + - The label busts the layer cache, so every agent layer is rebuilt on every commit. + - `preflight.py` grows past its frozen 548-line budget. + - `run_preflight_probe` gains a sixth parameter (PLR0913). + - Existing tests inject `runner_fn` and count or inspect every call. An extra `docker image inspect` through + `runner_fn` would break about 50 tests in five out-of-scope test modules. + - A stale-image result is mistaken for a connectivity outage by `preflight_outage.wait_out_outage` and waited on for + minutes, or matched by a quota or login pattern and given a cooldown. + - Tests reach a real Docker daemon. +- **Mitigations built into the plan:** + - Build-input diff instead of a raw SHA comparison. + - `ARG`/`LABEL` placed as the final instructions of each stage, after every `RUN`. + - New sibling module `preflight_image_commit.py` (scope expansion recorded below), with a hook of about 10 lines in + `preflight.py`. + - No new parameter. The real-image check runs only on the real-docker path (`runner_fn is None`), next to the existing + `shutil.which("docker")` check, because an injected runner has no real image to inspect. + - The stale result carries a non-empty `output_excerpt` and wording free of quota, login or daemon terms. A test + asserts that `preflight_outage.connectivity_reason` returns `None` for it and that `matching_statuses` is empty. + - Every test uses a fake `run` callable for `docker` and a real `git` only inside `tmp_path`. +- **Residual risk accepted (and why):** Builds made without the script (a bare `docker build`) get the label value + `unknown`. Preflight logs a warning and does not block them. This is an accepted trade-off so that a local ad-hoc + build still works (intent A1 response). A narrower override that skips only the image check is deferred to a follow-up + intent to keep this one within scope. +- **Allocated Entropy Budget:** 15.0 +- **Predicted Plan Entropy:** 5.5 +- **Budget Compliance:** The strategy fits within budget. + +## Plan Description & Strategy + +The plan has four sequential steps on one execution branch (no sub-intents). + +1. **Build files:** stamp `org.holon.source-commit` on every image target. The commit flows from `build_all_images.sh` + through the environment variable `SOURCE_COMMIT`, then the bake variable, then a per-target build arg plus label, and + finally a per-stage `ARG` and `LABEL` in the `Dockerfile`. +2. **New module `preflight_image_commit.py`:** reads the label with `docker image inspect`, resolves the host engine + commit and build-input drift with `git`, and returns a small immutable verdict. A hook in `preflight.py` turns a + stale verdict into a failing `PreflightResult` that names both commits and the override. +3. **Hermetic tests** in `tests/test_preflight.py` cover the label in the build files, the script handing + `SOURCE_COMMIT` to a fake `docker`, the label being read back from fake inspect output, and the stale, matching and + unverifiable verdicts. The verdicts run against real `git` repositories in `tmp_path`. A further test covers the + refusal path of `run_preflight_probe` and `preflight_gate`. +4. **Verification:** affected tests, then lint, then the full suite once, all in the foreground. + +## Scope Expansion + +- `apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py`: a new focused module. `preflight.py` is at 477 + of its frozen 548-line budget, and the repository rule prefers a focused module to growing a file past about 400 + lines. It follows the existing `preflight_cooldown.py` / `preflight_outage.py` / `preflight_result.py` sibling + pattern. + +## Touch Set + +- `apps/sandbox-executor/Dockerfile` +- `apps/sandbox-executor/docker-bake.hcl` +- `apps/sandbox-executor/build_all_images.sh` +- `apps/sandbox-executor/src/sandbox_executor/preflight.py` +- `apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py` +- `apps/sandbox-executor/tests/test_preflight.py` + +--- + +## Step 1: Stamp org.holon.source-commit on every image through the build files + +- **Sub‑intent recommendation:** NO +- **Reasoning:** This is three small edits to declarative build files. They are low risk and quickly verified by text + and script tests, so a separate branch or evaluation would add only overhead. +- **Step Type:** CONFIG +- **Exploration level:** BALANCED + +- **Hypothesis being tested:** If `ARG SOURCE_COMMIT` and `LABEL` are the last instructions of each stage, no `RUN` + layer depends on the commit. The npm and apt layers then stay cached across commits, so labelling every build costs + about nothing at build time. +- **Learning target:** Whether a per-commit label can be added without cache regressions. This is reusable knowledge for + any future build-provenance labels (for example a build time or a dirty flag). It is recorded in the execution notes. +- **Maximum acceptable cost for this learning:** No extra builds in Stage 3. The evidence is the `Dockerfile` order, + checked by a text test. A real `docker buildx bake --print` is only done if `docker buildx` is available and takes + under a minute; it is never required. + +### Intent & Git Integration + +- **Step Intent:** Every image built by `build_all_images.sh` (and therefore by `make build` and the three CI workflows + that call it) carries `org.holon.source-commit=<40-hex HEAD>`. A build made without the script carries `unknown`. +- **Git branch:** `I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-{timestamp}-CLA-CO5.5/_` +- **Sub‑intent:** NONE + +### Implementation Details (No code blocks, only logic/steps) + +1. `Dockerfile`: at the end of every build-target stage (`holon-base`, `agent-claude`, `agent-opencode`, `agent-pi`, + `agent-codex`, `agent-antigravity`, `holon-orchestrator`), after that stage's last `RUN`, add + `ARG SOURCE_COMMIT=unknown` followed by `LABEL org.holon.source-commit="${SOURCE_COMMIT}"`. In `holon-base`, put both + after the `RUN uv --version` smoke check. The `uv-bin` source stage is not a build target and is left untouched. Add + no comments, and do not touch the existing comments or TODO lines (unrelated work). +2. `docker-bake.hcl`: add `variable "SOURCE_COMMIT" { default = "unknown" }`. In `target "common"`, add + `args = { SOURCE_COMMIT = SOURCE_COMMIT }` and `labels = { "org.holon.source-commit" = SOURCE_COMMIT }`. Every target + inherits `common`, so all seven targets carry the label, and the bake-level label also covers any stage a future edit + adds without a `LABEL`. Keep each `tags = ["..."]` line unchanged, because `test_runner_specs.py` parses those lines + with a regex. +3. `build_all_images.sh`: add a sourceable function `resolve_source_commit`. It prints + `git -C "$REPO_ROOT" rev-parse HEAD` when that succeeds and prints `unknown` otherwise. In the `BASH_SOURCE == $0` + main block, before calling bake, run `export SOURCE_COMMIT="${SOURCE_COMMIT:-$(resolve_source_commit)}"` so that a CI + caller can pin the value, and echo one line naming the commit being stamped. Do not change the existing option + parsing or the timestamp helpers. +4. Environment overlay declaration: the script exports `SOURCE_COMMIT` into its environment. The affected child process + is `docker buildx bake`, which reads `SOURCE_COMMIT` as a bake variable. `git rev-parse` runs before the export and + is not affected. Step 3's test `test_build_all_images_hands_the_source_commit_to_bake` runs the real script with a + fake `docker` first on `PATH` and asserts that the child saw `SOURCE_COMMIT` and was invoked with the bake file. + +### Dependencies & Criticality + +- **Depends on:** NONE +- **Is Bottleneck:** NO + +### Safety & Constraint Considerations + +- **Relevant rules:** `constraints.md` §1; the self-explaining rule (no comments in the `Dockerfile`, HCL or shell); the + `test_environment_reference.py` `HOLON_*` scan of these three files; the environment overlay discipline. +- **Potential failure modes for this step:** + - The label is placed before a `RUN`, which busts the npm and apt caches on every commit. + - An HCL syntax error in `args` or `labels` maps breaks every build. + - The `HOLON_` prefix is used by mistake, which trips the environment drift guard. + - `set -u` aborts on an unset `SOURCE_COMMIT` if `${SOURCE_COMMIT:-...}` is written without the default form. +- **Guardrails and early‑abort checks:** + - `bash -n build_all_images.sh`. + - If available, `shellcheck build_all_images.sh` (`shellcheck` is installed in `holon-base`). + - If `docker buildx` exists, `docker buildx bake -f apps/sandbox-executor/docker-bake.hcl --print` must parse and show + the label on all seven targets. It is optional and never blocks. + +### Success & Discard Criteria + +- **Success:** All seven targets show the label in the text checks and in the optional bake `--print`. The script passes + `bash -n` and exports the resolved SHA to its bake child. Existing tests in `test_build_all_images.py`, + `test_container_images.py` and `test_runner_specs.py` still pass. +- **Discard:** HCL `args`/`labels` cannot be expressed without breaking `test_runner_specs.py`'s tag regex, or cost + exceeds 1.5x `cost_pred`. In that case, fall back to the `Dockerfile` `ARG`/`LABEL` plus bake `args` only, and record + the reason in the execution notes. + +### Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.92 | +| entropy_pred | 1.5 | +| impact_pred | 25.0 | +| cost_pred | 2.5 | +| learning_value_pred | 3.0 | +| ev_pred | 21.55 | + +### Step Metrics Rationale + +These are declarative edits with well-known Docker and Bake semantics, so `p_success` is high. The residual risk is HCL +syntax and `set -u` edge cases. Entropy is low (three files with small hunks). The learning value comes from confirming +the cache-safe label placement. `EV = 0.92 * 25.0 + 0.5 * 3.0 - 0.3 * 1.5 - 2.5 = 23.00 + 1.50 - 0.45 - 2.5 = 21.55`. + +--- + +## Step 2: Read the runner image label in preflight and refuse launch on build-input drift + +- **Sub‑intent recommendation:** NO +- **Reasoning:** This is the core behaviour, but it is small (one new module of about 90 lines and a hook of about 10 + lines) and tightly coupled to Step 3's tests. Splitting it would duplicate context with no reduction in risk. +- **Step Type:** IMPLEMENTATION +- **Exploration level:** EXPLOIT + +### Intent & Git Integration + +- **Step Intent:** `run_preflight_probe` (used by `holon flow`, `plan`, `execute`, role commands and `doctor`) reads the + runner image's `org.holon.source-commit`. It compares the image's build inputs with the host engine checkout, records + both SHAs, and returns a failing result naming the override when they differ. Because the result fails, + `preflight_gate` aborts the launch before any branch, checkpoint or ledger write. +- **Git branch:** same execution branch as Step 1. +- **Sub‑intent:** NONE + +### Implementation Details (No code blocks, only logic/steps) + +1. Create `apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py` (no module docstring, no comments + except `# why:`). It contains: + - Constants: `IMAGE_SOURCE_COMMIT_LABEL = "org.holon.source-commit"`; a compiled full-SHA regex (40 lowercase hex + characters, anchored); `ENGINE_SOURCE_DIR`, the `apps/sandbox-executor` directory resolved from `__file__` + (`parents[2]`); `IMAGE_BUILD_INPUTS = ("src", "entrypoint", "Dockerfile")`, kept as relative pathspecs because + `git -C ENGINE_SOURCE_DIR` resolves them against that directory; and `GIT_TIMEOUT_SECONDS` and + `INSPECT_TIMEOUT_SECONDS` of 10 seconds each. + - A frozen dataclass `ImageCommitCheck` with fields `image`, `image_commit`, `host_commit` (`str | None`) and + `build_inputs_changed` (`bool`). It has a property `stale` (equal to `build_inputs_changed`) and a method + `describe()`. `describe()` returns a one-line record such as + `image built from ; host engine at ; build inputs (src, entrypoint, Dockerfile) differ` + (or `match`). + - `read_image_source_commit(image, run)`. It runs `docker image inspect --format {{json .Config.Labels}} ` + with `capture_output`, `text`, a timeout and `check=False`. It returns the label value only when the return code is + 0, the output parses as a JSON object, and the value matches the SHA regex. On `OSError`, + `subprocess.TimeoutExpired` or `json.JSONDecodeError` it returns `None`. A JSON `null` (no labels) returns `None`. + - `host_source_commit(run, source_dir)`. It runs `git -C rev-parse HEAD` and returns the SHA when it + matches the regex, otherwise `None`. It also returns `None` on `OSError` or `TimeoutExpired`, for example when the + engine was installed outside a git checkout. + - `build_inputs_changed_since(run, source_dir, image_commit)`. It runs + `git -C diff --quiet -- src entrypoint Dockerfile`, which compares the image commit + with the working tree, so uncommitted host edits count as drift. Return code 0 means `False`. Any other return + code, including 128 for a commit unknown to the host, means `True`, since a match cannot be shown. An `OSError` or + timeout also means `True`. Add one `# why:` comment noting that comparing the working tree, rather than `HEAD`, + catches uncommitted engine edits that the image cannot contain. That reason is not visible from the call. + - `check_image_source_commit(image, run=subprocess.run, source_dir=ENGINE_SOURCE_DIR)`, returning + `ImageCommitCheck | None`. It returns `None`, and logs a warning naming the image, when the label is unreadable or + not a SHA. It returns `None` with a warning when the host commit is unresolved, because the engine is not in a git + checkout, so nothing can be compared. Otherwise it returns the check. When the commits differ but the inputs match, + it logs at info level that the image is from an older commit but its build inputs are unchanged. Each function + stays well under C901 10 and PLR0913 5. +2. `preflight.py` hook (keep the file at or below 548 lines; the target is about 490): + - Import `preflight_image_commit` alongside the existing sibling imports. + - Add a `_STALE_IMAGE_HINT` template: "Rebuild the Holon images from this checkout (make build) so the runner image + matches the host engine, or pass --skip-preflight (HOLON_SKIP_PREFLIGHT=1) to launch anyway." Avoid the words + login, expired, quota, rate, limit, invalid, 401, 429 and daemon, so that the classifier and the outage waiter + never misread the result. + - Add `_real_docker_blocker(agent, model, image) -> PreflightResult | None`. It returns the existing "'docker' CLI + command not found" result when `shutil.which("docker")` is falsy. Otherwise it calls + `preflight_image_commit.check_image_source_commit(image)`. When the check is stale, it returns + `_result(PreflightStatus.UNKNOWN, agent, model, image, output=check.describe(), hint=_STALE_IMAGE_HINT)`, so the + excerpt records both SHAs. Otherwise it returns `None`. + - In `run_preflight_probe`, replace the existing + `if runner_fn is None and not shutil.which("docker"): return _result(...)` block with + `if runner_fn is None and (blocked := _real_docker_blocker(agent, model, image)): return blocked`. This keeps the + branch count and the parameter count unchanged (still five, PLR0913). Add one `# why:` comment noting that an + injected runner has no real image to inspect. That is the non-obvious reason the image check is limited to the + real-docker path. + - Do not change `PreflightStatus` or `PreflightResult` (`preflight_result.py` is out of scope). The record is carried + by `output_excerpt` and `hint`, which `to_dict()` (doctor `--json`) and `format_report()` (flow stderr) already + emit. +3. No environment, cwd or git-config overlay is introduced. `git` is pointed at the engine directory with the `-C` + argument on a fresh child that inherits the caller's environment unchanged. The affected children are + `docker image inspect`, `git rev-parse` and `git diff`. They are exercised by Step 3's tests + `test_host_source_commit_reads_a_real_git_head` and `test_build_inputs_changed_since_detects_a_src_edit`, which run + real `git` in `tmp_path`. + +### Dependencies & Criticality + +- **Depends on:** Step 1 (label name and `unknown` default semantics). +- **Is Bottleneck:** YES (p_success 0.88 ≥ 0.6, so no sub-intent). + +### Safety & Constraint Considerations + +- **Relevant rules:** the frozen module budget (`preflight.py` ≤ 548, new module ≤ 350); the ruff complexity limits; the + self-explaining rule; "no new imports from entrypoints into the host flow engine" (the new module imports only the + standard library and `logging`); `safety.md` failure containment (a launch blocked before any write). +- **Potential failure modes for this step:** + - `run_preflight_probe` gains a branch and exceeds C901. + - The stale result triggers the outage waiter (`connectivity_reason`), or its text matches a `_PATTERNS` status. + - The engine checkout path is resolved wrongly in an installed layout. + - A real `docker image inspect` adds latency to every launch (bounded by a 10 s timeout; normally under 100 ms). +- **Guardrails and early‑abort checks:** + - Check `wc -l` on `preflight.py` after the edit. + - Run `uv run ruff check` on both modules before Step 3. + - If `preflight.py` would exceed 548 lines, move `_STALE_IMAGE_HINT` and `_real_docker_blocker`'s result construction + into the new module. Never edit `module_budgets.json`. + +### Success & Discard Criteria + +- **Success:** A stale image yields a non-OK `PreflightResult` whose excerpt names both SHAs and whose hint names + `--skip-preflight`. Matching inputs or an unverifiable label yield the normal probe. Ruff and the module budget checks + are clean. +- **Discard:** The check cannot be wired without changing `run_preflight_probe`'s signature or touching the + `preflight_result.py`, `cli/preflight.py` or `env_registry.py` modules, or cost exceeds 1.5x `cost_pred`. Then stop + and record the blocker for re-planning. + +### Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.88 | +| entropy_pred | 2.0 | +| impact_pred | 35.0 | +| cost_pred | 3.5 | +| learning_value_pred | 2.0 | +| ev_pred | 27.70 | + +### Step Metrics Rationale + +The behaviour is straightforward, but it touches a gate that every launch passes through, and it must coexist with the +outage waiter, cooldown and classifier semantics, so `p_success` is lower than Step 1's. Entropy is 2.0: one new module +and a small hook in a hot path. `EV = 0.88 * 35.0 + 0.5 * 2.0 - 0.3 * 2.0 - 3.5 = 30.80 + 1.00 - 0.60 - 3.5 = 27.70`. + +--- + +## Step 3: Add hermetic tests in tests/test_preflight.py + +- **Sub‑intent recommendation:** NO +- **Reasoning:** These tests prove both acceptance criteria and belong with Step 2's code. They need no Docker daemon or + network: `docker` is faked by a `run` callable or a `PATH` shim, and `git` runs for real only in `tmp_path`. +- **Step Type:** TEST +- **Exploration level:** EXPLOIT + +### Intent & Git Integration + +- **Step Intent:** Pin the label stamping, the read-back, the stale, matching and unverifiable verdicts, the launch + refusal, and the script's environment hand-off, all under `uv run pytest`. +- **Git branch:** same execution branch. +- **Sub‑intent:** NONE + +### Implementation Details (No code blocks, only logic/steps) + +Append to `apps/sandbox-executor/tests/test_preflight.py`. The new tests use intention-revealing names and no docstrings +or comments except `# why:`. Reuse the existing `probe_env` fixture where the CLI or probe is involved. Add a small +local helper `_git_repo_with_image_inputs(tmp_path)`. It runs `git init -q`, sets `user.email` and `user.name` through +`git -c` arguments (not global config), writes `src/x.py`, `entrypoint/e.sh` and `Dockerfile`, commits, and returns the +SHA. + +1. `test_every_image_stage_stamps_the_source_commit_label`: parse the `Dockerfile` into stages by their + `FROM ... AS ` lines. For each of the seven build targets, assert that the stage contains `ARG SOURCE_COMMIT` + and a `LABEL org.holon.source-commit` that references `SOURCE_COMMIT`, and that no `RUN` follows the `LABEL` within + the stage. That last assertion keeps the cache-safety hypothesis from Step 1. +2. `test_bake_passes_the_source_commit_as_arg_and_label_to_every_target`: assert that `docker-bake.hcl` declares + `variable "SOURCE_COMMIT"` defaulting to `unknown`, and that `target "common"` carries both the `args` and `labels` + entries. Assert that every non-common target inherits `common`, by counting `inherits = ["common"]` against the + number of targets. +3. `test_build_all_images_hands_the_source_commit_to_bake` (the environment overlay test named in Step 1). Write a fake + executable `docker` into `tmp_path/bin` that appends `SOURCE_COMMIT=$SOURCE_COMMIT` and its arguments to a capture + file and exits 0. Run the real `build_all_images.sh` with `PATH` set to `tmp_path/bin` followed by the original + `PATH` and with `SOURCE_COMMIT` unset. Assert that the capture holds a 40-hex SHA equal to + `git -C rev-parse HEAD`, or `unknown` when the checkout is not a git repository, and that the captured + arguments include `buildx bake` and the bake file. Add a parametrised case with `SOURCE_COMMIT=` preset, + asserting it passes through unchanged. +4. `test_resolve_source_commit_falls_back_to_unknown_outside_git`: source the script with `REPO_ROOT` overridden after + sourcing to an empty `tmp_path` directory, call `resolve_source_commit`, and assert that the output is `unknown`. +5. `test_read_image_source_commit_reads_the_label_back`: use a fake `run` returning return code 0 and the JSON labels + `{"org.holon.source-commit": ""}`. Assert that the SHA is returned and that the command was + `docker image inspect --format {{json .Config.Labels}} holon/agent-claude`. Parametrised `None` cases cover the label + `unknown`, no labels (`null`), a missing label key, a nonzero return code, invalid JSON, an `OSError` and a + `TimeoutExpired` raised by `run`. +6. `test_host_source_commit_reads_a_real_git_head` and `test_build_inputs_changed_since_detects_a_src_edit`: use the + real `git` in the `tmp_path` repo. The first asserts that the resolved head equals the commit. The second asserts + `False` right after the commit, `True` after editing `src/x.py` without committing, `False` again after only a + non-input file (`README.md`) is edited and committed, and `True` for an unknown 40-hex commit (return code 128). +7. `test_check_image_source_commit_verdicts`, parametrised: + - The label equals HEAD: not stale. + - The label is an older commit and only a non-input file changed since: not stale, with an info log naming both SHAs. + - The label is an older commit and `src` changed since: stale, and `describe()` contains both SHAs and "differ". + - The label is `unknown`: `None`, with a warning log. + - The source directory is not a git checkout: `None`. + + Docker is faked through `run` dispatch: a `docker` argv returns the canned labels, and a `git` argv is delegated to + the real `subprocess.run`. + +8. `test_probe_refuses_a_stale_image_before_running_the_runner`: patch `preflight.shutil.which` to return a fake path. + Patch `preflight_image_commit.check_image_source_commit` to return a stale `ImageCommitCheck`. Patch + `preflight.subprocess.run` with a mock that fails the test if called. Call + `run_preflight_probe("claude-agent", "claude-opus-5-5")`. Assert that the result is not ok, that `output_excerpt` + contains both SHAs, and that `hint` contains `--skip-preflight`. Assert that + `preflight_outage.connectivity_reason(result) is None` and that + `preflight.matching_statuses(result.output_excerpt + result.hint)` is empty, so the result is neither waited on nor + put on cooldown. +9. `test_flow_preflight_gate_aborts_and_reports_a_stale_image`: call `sandbox_executor.cli.preflight.preflight_gate` + with the same patches and a no-op `sleep`. Assert that it returns a non-ok result, that stderr (`capsys`) contains + the image record with both SHAs and the "Aborting before any branch" line, and that the fake runner's container was + never started. +10. `test_skip_preflight_is_the_explicit_override_for_a_stale_image`: with `HOLON_SKIP_PREFLIGHT=1` (and separately + `skip=True`), `preflight_gate` returns `None` and `check_image_source_commit` is never called. +11. `test_probe_with_matching_or_unverifiable_image_runs_the_runner`: with a non-stale check and with `None`, the + patched `subprocess.run` receives the `docker run` probe and an `OK` reply yields an ok result. + +### Dependencies & Criticality + +- **Depends on:** Step 1, Step 2 +- **Is Bottleneck:** YES + +### Safety & Constraint Considerations + +- **Relevant rules:** `ruleset.md` §3 (test changes declared in the plan); `KB-pattern-hermetic-pytest-conftest` and the + `network_guard` / `sandbox_hermetic_guard` fixtures (no network, no real Docker, writes only under `tmp_path`); the + self-explaining rule on added test lines; the environment overlay discipline (test 3 runs the bake child under the new + environment). +- **Potential failure modes for this step:** + - The real-repo `git rev-parse` in test 3 runs in a shallow or non-git CI checkout (handled by accepting `unknown` + when `git rev-parse` fails). + - The `PATH` shim is ignored because the script calls `docker` through an absolute path (it does not). + - xdist parallelism collides on shared paths (each test uses its own `tmp_path`). + - Commits in the `tmp_path` git repository fail without an identity (pass `-c user.name`/`-c user.email`). +- **Guardrails and early‑abort checks:** Run + `uv run pytest apps/sandbox-executor/tests/test_preflight.py -n auto --dist worksteal` in the foreground right after + writing the tests. Fix any failure before Step 4. + +### Success & Discard Criteria + +- **Success:** All new tests pass and the 870 existing lines of tests still pass. No test touches a Docker daemon, the + network or the real checkout's working tree. +- **Discard:** Any new test requires a live Docker daemon or network to pass, or flakes under xdist across two + foreground runs. Then rework it into a pure fake before proceeding. + +### Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.90 | +| entropy_pred | 1.5 | +| impact_pred | 25.0 | +| cost_pred | 3.0 | +| learning_value_pred | 2.0 | +| ev_pred | 20.05 | + +### Step Metrics Rationale + +The test patterns (fake `run`, a `PATH` shim, `tmp_path` git) are established in `test_build_all_images.py`, +`test_preflight*.py` and `worktree_fixtures.py`. The main risk is test 3's dependence on the real checkout's git state, +which is mitigated. `EV = 0.90 * 25.0 + 0.5 * 2.0 - 0.3 * 1.5 - 3.0 = 22.50 + 1.00 - 0.45 - 3.0 = 20.05`. + +--- + +## Step 4: Verify affected tests, lint and the full suite once + +- **Sub‑intent recommendation:** NO +- **Reasoning:** This is a mandatory verification gate with no new code. It is cheap, and it catches cross-module + regressions in the environment reference, runner specs and the other preflight suites. +- **Step Type:** TEST +- **Exploration level:** EXPLOIT + +### Intent & Git Integration + +- **Step Intent:** Prove that nothing outside the touch set regressed and that the repository gates (ruff complexity, + module budgets, self-explaining, Prettier) pass. +- **Git branch:** same execution branch. +- **Sub‑intent:** NONE + +### Implementation Details (No code blocks, only logic/steps) + +1. Run in the foreground, once: + `uv run pytest apps/sandbox-executor/tests/test_preflight.py apps/sandbox-executor/tests/test_preflight_retries.py apps/sandbox-executor/tests/test_preflight_outage.py apps/sandbox-executor/tests/test_preflight_cooldown.py apps/sandbox-executor/tests/test_preflight_claude_keychain.py apps/sandbox-executor/tests/test_environment_reference.py apps/sandbox-executor/tests/test_runner_specs.py apps/sandbox-executor/tests/test_build_all_images.py apps/sandbox-executor/tests/test_container_images.py -n auto --dist worksteal`. +2. `uv run task lint` (in the foreground): ruff, including the C901, PLR0912, PLR0913 and PLR0915 limits; + `check_module_budgets` (`preflight.py` ≤ 548, the new module ≤ 350); `check_self_explaining` on added lines in + Python, `Dockerfile`, HCL and shell; and Prettier on the execution notes. +3. `uv run task test` (in the foreground), once. There is no repetition: the intent sets no timing or performance + target. +4. Record in the execution notes: + - the pass/fail counts and the pytest-reported time of each run; + - the final line counts of `preflight.py` and `preflight_image_commit.py`; + - the outcome of Step 1's cache-placement hypothesis (text evidence, plus the bake `--print` output if it was + available). + +### Dependencies & Criticality + +- **Depends on:** Step 3 +- **Is Bottleneck:** NO + +### Safety & Constraint Considerations + +- **Relevant rules:** test-run discipline (no repetition, foreground only, no backgrounding); `safety.md` failure + containment. +- **Potential failure modes for this step:** An unrelated flaky test in the full suite; a lint finding on an existing + `Dockerfile` comment that was not touched (it should not fire, because the gate checks added lines only). +- **Guardrails and early‑abort checks:** On a failure outside the touch set, rerun only that test id once to tell a + flake from a regression, and record both results. Never edit out-of-scope files to make the suite pass. + +### Success & Discard Criteria + +- **Success:** The affected tests, lint and the full suite are all green, and the notes are recorded. +- **Discard:** A regression traces to an out-of-scope module that would need editing. Then stop and hand back for + re-planning with the evidence. + +### Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.97 | +| entropy_pred | 0.5 | +| impact_pred | 10.0 | +| cost_pred | 1.0 | +| learning_value_pred | 1.0 | +| ev_pred | 9.05 | + +### Step Metrics Rationale + +This step only verifies, so success is almost certain unless an earlier step regressed something. +`EV = 0.97 * 10.0 + 0.5 * 1.0 - 0.3 * 0.5 - 1.0 = 9.70 + 0.50 - 0.15 - 1.0 = 9.05`. + +--- From ee1f95febde876cb0b1721115b1067ae789a786b Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:33:30 +0000 Subject: [PATCH 03/10] step 1: stamp org.holon.source-commit on every image --- apps/sandbox-executor/Dockerfile | 14 +++++++++ apps/sandbox-executor/build_all_images.sh | 6 ++++ apps/sandbox-executor/docker-bake.hcl | 10 +++++++ executions/E-1796254347-CLA-CO5.5.md | 35 +++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 executions/E-1796254347-CLA-CO5.5.md diff --git a/apps/sandbox-executor/Dockerfile b/apps/sandbox-executor/Dockerfile index 0a58b5cf7..6572a60eb 100644 --- a/apps/sandbox-executor/Dockerfile +++ b/apps/sandbox-executor/Dockerfile @@ -62,35 +62,49 @@ ENV PATH="/home/holon/.local/bin:/home/holon/.local/node_modules/.bin:${PATH}" RUN mkdir -p /home/holon/.cache # Build-time smoke check as the holon user: an image without a working uv fails to build RUN uv --version +ARG SOURCE_COMMIT=unknown +LABEL org.holon.source-commit="${SOURCE_COMMIT}" # --- Claude Agent Layer --- FROM holon-base AS agent-claude RUN --mount=type=cache,id=npm-claude,uid=1000,gid=1000,target=/home/holon/.npm \ echo "allow-scripts=@anthropic-ai/claude-code" > /home/holon/.npmrc && \ npm install --prefix /home/holon/.local --prefer-offline --no-audit --no-fund @anthropic-ai/claude-code@2.1.302 +ARG SOURCE_COMMIT=unknown +LABEL org.holon.source-commit="${SOURCE_COMMIT}" # --- OpenCode Agent Layer (opencode) --- FROM holon-base AS agent-opencode RUN --mount=type=cache,id=npm-opencode,uid=1000,gid=1000,target=/home/holon/.npm \ echo "allow-scripts=opencode-ai" > /home/holon/.npmrc && \ npm install --prefix /home/holon/.local --prefer-offline --no-audit --no-fund opencode-ai@1.19.3 +ARG SOURCE_COMMIT=unknown +LABEL org.holon.source-commit="${SOURCE_COMMIT}" # --- Pi Agent Layer --- FROM holon-base AS agent-pi RUN --mount=type=cache,id=npm-pi,uid=1000,gid=1000,target=/home/holon/.npm \ echo "allow-scripts=@google/genai,protobufjs" > /home/holon/.npmrc && \ npm install --prefix /home/holon/.local --prefer-offline --no-audit --no-fund @earendil-works/pi-coding-agent@1.3.0 +ARG SOURCE_COMMIT=unknown +LABEL org.holon.source-commit="${SOURCE_COMMIT}" # --- Codex Agent Layer --- FROM holon-base AS agent-codex RUN --mount=type=cache,id=npm-codex,uid=1000,gid=1000,target=/home/holon/.npm \ npm install --prefix /home/holon/.local --prefer-offline --no-audit --no-fund @openai/codex@0.163.0 +ARG SOURCE_COMMIT=unknown +LABEL org.holon.source-commit="${SOURCE_COMMIT}" # --- Antigravity Agent Layer --- FROM holon-base AS agent-antigravity RUN --mount=type=cache,id=uv-antigravity,uid=1000,gid=1000,target=/home/holon/.cache/uv \ --mount=type=cache,id=npm-antigravity,uid=1000,gid=1000,target=/home/holon/.npm \ curl --proto '=https' --tlsv1.2 -fsSL --compressed https://antigravity.google/cli/install.sh -o /tmp/install.sh && bash /tmp/install.sh && rm -f /tmp/install.sh +ARG SOURCE_COMMIT=unknown +LABEL org.holon.source-commit="${SOURCE_COMMIT}" # --- Final Orchestrator Image --- FROM holon-base AS holon-orchestrator +ARG SOURCE_COMMIT=unknown +LABEL org.holon.source-commit="${SOURCE_COMMIT}" diff --git a/apps/sandbox-executor/build_all_images.sh b/apps/sandbox-executor/build_all_images.sh index e8be30445..f261ceffd 100755 --- a/apps/sandbox-executor/build_all_images.sh +++ b/apps/sandbox-executor/build_all_images.sh @@ -79,8 +79,14 @@ print_log_with_timestamps() { done } +resolve_source_commit() { + git -C "$REPO_ROOT" rev-parse --verify --quiet HEAD 2>/dev/null || echo "unknown" +} + if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then echo "Starting Docker Buildx Bake build for all Holon images..." + export SOURCE_COMMIT="${SOURCE_COMMIT:-$(resolve_source_commit)}" + echo "Stamping org.holon.source-commit=${SOURCE_COMMIT} on every image" # Build the bake arguments BAKE_ARGS=("-f" "$SCRIPT_DIR/docker-bake.hcl" "--load") diff --git a/apps/sandbox-executor/docker-bake.hcl b/apps/sandbox-executor/docker-bake.hcl index 23fd13f41..19267601e 100644 --- a/apps/sandbox-executor/docker-bake.hcl +++ b/apps/sandbox-executor/docker-bake.hcl @@ -2,11 +2,21 @@ variable "CI" { default = "false" } +variable "SOURCE_COMMIT" { + default = "unknown" +} + target "common" { context = "apps/sandbox-executor" dockerfile = "Dockerfile" cache-from = CI == "true" ? ["type=gha,scope=holon-sandbox-executor"] : [] cache-to = CI == "true" ? ["type=gha,mode=max,scope=holon-sandbox-executor"] : [] + args = { + SOURCE_COMMIT = SOURCE_COMMIT + } + labels = { + "org.holon.source-commit" = SOURCE_COMMIT + } } target "base" { diff --git a/executions/E-1796254347-CLA-CO5.5.md b/executions/E-1796254347-CLA-CO5.5.md new file mode 100644 index 000000000..bfeab3afe --- /dev/null +++ b/executions/E-1796254347-CLA-CO5.5.md @@ -0,0 +1,35 @@ +# Execution Record: E-1796254347-CLA-CO5.5 + +## Summary + +Implements plan `P-1796254010-CLA-CO5.5` for intent `I-1796253987-hac-image-source-commit-label`: every Holon image is +stamped with `org.holon.source-commit`, and preflight refuses a launch when the runner image's build inputs differ from +the host engine checkout, unless `--skip-preflight` / `HOLON_SKIP_PREFLIGHT` is set. + +## Actual Metrics + +| metric | value | +| --------------------- | ----- | +| success_actual | 0.0 | +| entropy_actual | 0.0 | +| impact_actual | 0.0 | +| cost_actual | 0.0 | +| learning_value_actual | 0.0 | + +## Steps Executed + +### Step 1: Stamp org.holon.source-commit on every image through the build files + +- `Dockerfile`: `ARG SOURCE_COMMIT=unknown` and `LABEL org.holon.source-commit="${SOURCE_COMMIT}"` are the last two + instructions of all seven build-target stages (`holon-base` after `RUN uv --version`); `uv-bin` is untouched. +- `docker-bake.hcl`: `variable "SOURCE_COMMIT"` (default `unknown`); `target "common"` carries + `args = { SOURCE_COMMIT = SOURCE_COMMIT }` and `labels = { "org.holon.source-commit" = SOURCE_COMMIT }`, inherited + by every target. `tags = [...]` lines unchanged. +- `build_all_images.sh`: `resolve_source_commit` prints `git rev-parse --verify --quiet HEAD` or `unknown` + (`--verify` avoids the plain `rev-parse` printing a literal `HEAD` in a repository with no commits); the main block + exports `SOURCE_COMMIT="${SOURCE_COMMIT:-$(resolve_source_commit)}"` to the `docker buildx bake` child. +- Cache hypothesis: no `RUN` follows the label in any stage, so no filesystem layer depends on the commit. A child + stage's `RUN` cache key is the parent's rootfs plus its exec metadata (env, cwd, user), not image labels, so the + `holon-base` label does not invalidate the agent npm layers. `docker` is not installed in the execution sandbox, so + `docker buildx bake --print` was not run; the evidence is the text test on stage order (Step 3). +- `bash -n` and `shellcheck build_all_images.sh`: clean. From dcc53bc3ecf2aac941e176b374191c23d58acf06 Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:34:41 +0000 Subject: [PATCH 04/10] step 2: preflight refuses a runner image with drifted build inputs --- .../src/sandbox_executor/preflight.py | 24 +++- .../preflight_image_commit.py | 103 ++++++++++++++++++ executions/E-1796254347-CLA-CO5.5.md | 12 ++ 3 files changed, 134 insertions(+), 5 deletions(-) create mode 100644 apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py diff --git a/apps/sandbox-executor/src/sandbox_executor/preflight.py b/apps/sandbox-executor/src/sandbox_executor/preflight.py index f54ea4b8d..e735afcc5 100644 --- a/apps/sandbox-executor/src/sandbox_executor/preflight.py +++ b/apps/sandbox-executor/src/sandbox_executor/preflight.py @@ -13,7 +13,7 @@ from dataclasses import dataclass from typing import Any -from sandbox_executor import claude_token_migration, local_llm, preflight_cooldown +from sandbox_executor import claude_token_migration, local_llm, preflight_cooldown, preflight_image_commit from sandbox_executor.agent_defaults import AGENT_IMAGE_MAPPING, normalise_agent_id from sandbox_executor.claude_credential import pin_claude_credential, resolve_claude_credential_with_lookup from sandbox_executor.preflight_model_error import is_model_error @@ -36,6 +36,10 @@ _DOCKER_RUN_ENV_FILE_INSERT_INDEX = 2 _PROBE_CONTAINER_PREFIX = "holon-preflight-" _PROBE_CONTAINER_ID_LENGTH = 12 +_STALE_IMAGE_HINT = ( + "Rebuild the Holon images from this checkout (make build) so the runner image matches the host engine, " + "or pass --skip-preflight (HOLON_SKIP_PREFLIGHT=1) to launch anyway." +) _DECISIVE_TIMEOUT_STATUSES = ( @@ -251,6 +255,17 @@ def _early_probe_result(agent: str, agent_id: str, model: str, image: str) -> Pr return preflight_cooldown.active_cooldown_result(agent, model, image) +def _real_docker_blocker(agent: str, model: str, image: str) -> PreflightResult | None: + if not shutil.which("docker"): + return _result( + PreflightStatus.UNKNOWN, agent, model, image, hint="'docker' CLI command not found. Please install Docker." + ) + check = preflight_image_commit.check_image_source_commit(image) + if check is not None and check.stale: + return _result(PreflightStatus.UNKNOWN, agent, model, image, output=check.describe(), hint=_STALE_IMAGE_HINT) + return None + + def run_preflight_probe( agent: str, model: str, @@ -266,10 +281,9 @@ def run_preflight_probe( if early := _early_probe_result(agent, agent_id, model, image): return early - if runner_fn is None and not shutil.which("docker"): - return _result( - PreflightStatus.UNKNOWN, agent, model, image, hint="'docker' CLI command not found. Please install Docker." - ) + # why: an injected runner has no real image to inspect, so the image commit check runs only against real docker + if runner_fn is None and (blocked := _real_docker_blocker(agent, model, image)): + return blocked from sandbox_executor.launcher import env_files, mounts diff --git a/apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py b/apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py new file mode 100644 index 000000000..bc8751497 --- /dev/null +++ b/apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +import json +import logging +import re +import subprocess +from collections.abc import Callable +from dataclasses import dataclass +from pathlib import Path + +logger = logging.getLogger(__name__) + +IMAGE_SOURCE_COMMIT_LABEL = "org.holon.source-commit" +FULL_COMMIT_SHA_RE = re.compile(r"^[0-9a-f]{40}$") +ENGINE_SOURCE_DIR = Path(__file__).resolve().parents[2] +IMAGE_BUILD_INPUTS = ("src", "entrypoint", "Dockerfile") +GIT_TIMEOUT_SECONDS = 10.0 +INSPECT_TIMEOUT_SECONDS = 10.0 + +CommandRunner = Callable[..., subprocess.CompletedProcess[str]] + + +@dataclass(frozen=True) +class ImageCommitCheck: + image: str + image_commit: str + host_commit: str | None + build_inputs_changed: bool + + @property + def stale(self) -> bool: + return self.build_inputs_changed + + def describe(self) -> str: + inputs = ", ".join(IMAGE_BUILD_INPUTS) + verdict = "differ" if self.build_inputs_changed else "match" + return ( + f"image {self.image} built from {self.image_commit}; " + f"host engine at {self.host_commit or 'unresolved'}; build inputs ({inputs}) {verdict}" + ) + + +def _run_quietly(run: CommandRunner, cmd: list[str], timeout: float) -> subprocess.CompletedProcess[str] | None: + try: + return run(cmd, capture_output=True, text=True, timeout=timeout, check=False) + except (OSError, subprocess.TimeoutExpired): + return None + + +def _full_sha_or_none(value: object) -> str | None: + if isinstance(value, str) and FULL_COMMIT_SHA_RE.match(value.strip()): + return value.strip() + return None + + +def read_image_source_commit(image: str, run: CommandRunner) -> str | None: + cmd = ["docker", "image", "inspect", "--format", "{{json .Config.Labels}}", image] + completed = _run_quietly(run, cmd, INSPECT_TIMEOUT_SECONDS) + if completed is None or completed.returncode != 0: + return None + try: + labels = json.loads(completed.stdout or "") + except json.JSONDecodeError: + return None + if not isinstance(labels, dict): + return None + return _full_sha_or_none(labels.get(IMAGE_SOURCE_COMMIT_LABEL)) + + +def host_source_commit(run: CommandRunner, source_dir: Path) -> str | None: + completed = _run_quietly(run, ["git", "-C", str(source_dir), "rev-parse", "HEAD"], GIT_TIMEOUT_SECONDS) + if completed is None or completed.returncode != 0: + return None + return _full_sha_or_none(completed.stdout) + + +def build_inputs_changed_since(run: CommandRunner, source_dir: Path, image_commit: str) -> bool: + # why: diffing against the working tree, not HEAD, also catches uncommitted engine edits the image cannot contain + cmd = ["git", "-C", str(source_dir), "diff", "--quiet", image_commit, "--", *IMAGE_BUILD_INPUTS] + completed = _run_quietly(run, cmd, GIT_TIMEOUT_SECONDS) + return completed is None or completed.returncode != 0 + + +def check_image_source_commit( + image: str, run: CommandRunner = subprocess.run, source_dir: Path = ENGINE_SOURCE_DIR +) -> ImageCommitCheck | None: + image_commit = read_image_source_commit(image, run) + if image_commit is None: + logger.warning("Image %s has no readable %s label; skipping the commit check", image, IMAGE_SOURCE_COMMIT_LABEL) + return None + host_commit = host_source_commit(run, source_dir) + if host_commit is None: + logger.warning("Host engine at %s is not a git checkout; skipping the image commit check.", source_dir) + return None + check = ImageCommitCheck( + image=image, + image_commit=image_commit, + host_commit=host_commit, + build_inputs_changed=build_inputs_changed_since(run, source_dir, image_commit), + ) + if image_commit != host_commit and not check.stale: + logger.info("Image %s is from an older commit but its build inputs are unchanged: %s", image, check.describe()) + return check diff --git a/executions/E-1796254347-CLA-CO5.5.md b/executions/E-1796254347-CLA-CO5.5.md index bfeab3afe..af37c46bd 100644 --- a/executions/E-1796254347-CLA-CO5.5.md +++ b/executions/E-1796254347-CLA-CO5.5.md @@ -33,3 +33,15 @@ the host engine checkout, unless `--skip-preflight` / `HOLON_SKIP_PREFLIGHT` is `holon-base` label does not invalidate the agent npm layers. `docker` is not installed in the execution sandbox, so `docker buildx bake --print` was not run; the evidence is the text test on stage order (Step 3). - `bash -n` and `shellcheck build_all_images.sh`: clean. + +### Step 2: Read the runner image label in preflight and refuse launch on build-input drift + +- New module `preflight_image_commit.py` (scope expansion recorded in the plan): `read_image_source_commit` + (`docker image inspect --format {{json .Config.Labels}}`), `host_source_commit` (`git -C rev-parse HEAD`), + `build_inputs_changed_since` (`git diff --quiet -- src entrypoint Dockerfile` against the working tree), + `check_image_source_commit` and the frozen `ImageCommitCheck` with `stale` and `describe()`. +- `preflight.py`: `_real_docker_blocker` folds the existing missing-`docker` result and the stale-image result; the + `run_preflight_probe` branch count and five-parameter signature are unchanged. A stale image yields an `UNKNOWN` + result whose excerpt names both commits and whose hint names `--skip-preflight` / `HOLON_SKIP_PREFLIGHT=1`. +- `preflight.py` is 491 lines (budget 548). `uv run ruff check` and `ruff format --check`: clean. Existing + `test_preflight*.py`: 402 passed in 8.18s. From 3c57d408337938e3cbb5c2cd319f316db041ca20 Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:36:57 +0000 Subject: [PATCH 05/10] step 3: hermetic tests for the image source-commit label and preflight gate --- apps/sandbox-executor/tests/test_preflight.py | 332 +++++++++++++++++- executions/E-1796254347-CLA-CO5.5.md | 19 + 2 files changed, 350 insertions(+), 1 deletion(-) diff --git a/apps/sandbox-executor/tests/test_preflight.py b/apps/sandbox-executor/tests/test_preflight.py index 7ada15fc0..95aa92bbd 100644 --- a/apps/sandbox-executor/tests/test_preflight.py +++ b/apps/sandbox-executor/tests/test_preflight.py @@ -1,13 +1,16 @@ import json import logging import os +import pathlib +import re import subprocess import sys from unittest.mock import MagicMock, patch import pytest -from sandbox_executor import claude_keychain, preflight +from sandbox_executor import claude_keychain, preflight, preflight_image_commit, preflight_outage from sandbox_executor.cli import PACKAGE_LOGGER_NAME, _CurrentStderrHandler, configure_cli_logging, main +from sandbox_executor.cli.preflight import preflight_gate from sandbox_executor.flow import get_default_checkpoint_path from sandbox_executor.launcher.coherence import FlowProxyChoice from sandbox_executor.preflight import ( @@ -868,3 +871,330 @@ def test_probe_remaps_a_mis_named_explicit_token_and_drops_the_wrong_variable( assert f"CLAUDE_CODE_OAUTH_TOKEN={value}" in seen["lines"] assert not any(line.startswith("ANTHROPIC_API_KEY=") for line in seen["lines"]) + + +APP_ROOT = pathlib.Path(__file__).resolve().parents[1] +IMAGE_BUILD_TARGETS = ( + "holon-base", + "agent-claude", + "agent-opencode", + "agent-pi", + "agent-codex", + "agent-antigravity", + "holon-orchestrator", +) +_REAL_RUN = subprocess.run +_OLD_SHA = "a" * 40 +_NEW_SHA = "b" * 40 + + +def _dockerfile_stages() -> dict[str, str]: + text = (APP_ROOT / "Dockerfile").read_text(encoding="utf-8") + parts = re.split(r"^FROM \S+ AS (\S+)$", text, flags=re.MULTILINE) + return dict(zip(parts[1::2], parts[2::2], strict=True)) + + +@pytest.mark.parametrize("stage_name", IMAGE_BUILD_TARGETS) +def test_every_image_stage_stamps_the_source_commit_label(stage_name): + stage = _dockerfile_stages()[stage_name] + assert re.search(r"^ARG SOURCE_COMMIT=unknown$", stage, flags=re.MULTILINE) + label = re.search(r'^LABEL org\.holon\.source-commit="\$\{SOURCE_COMMIT\}"$', stage, flags=re.MULTILINE) + assert label, f"{stage_name} must label the image with SOURCE_COMMIT" + assert not re.search(r"^RUN ", stage[label.end() :], flags=re.MULTILINE), "no RUN may depend on the commit" + + +def test_bake_passes_the_source_commit_as_arg_and_label_to_every_target(): + bake = (APP_ROOT / "docker-bake.hcl").read_text(encoding="utf-8") + assert re.search(r'variable "SOURCE_COMMIT" \{\s*default = "unknown"\s*\}', bake) + common = re.search(r'target "common" \{(.*?)\n\}', bake, flags=re.DOTALL) + assert common + assert re.search(r"args = \{\s*SOURCE_COMMIT = SOURCE_COMMIT\s*\}", common.group(1)) + assert re.search(r'labels = \{\s*"org\.holon\.source-commit" = SOURCE_COMMIT\s*\}', common.group(1)) + targets = re.findall(r'^target "([^"]+)"', bake, flags=re.MULTILINE) + assert len(targets) - 1 == bake.count('inherits = ["common"]') == len(IMAGE_BUILD_TARGETS) + + +def _repo_head_or_unknown() -> str: + completed = _REAL_RUN( + ["git", "-C", str(APP_ROOT.parents[1]), "rev-parse", "--verify", "--quiet", "HEAD"], + capture_output=True, + text=True, + check=False, + ) + return completed.stdout.strip() if completed.returncode == 0 else "unknown" + + +def _fake_docker_bin(tmp_path: pathlib.Path) -> tuple[pathlib.Path, pathlib.Path]: + bin_dir = tmp_path / "bin" + bin_dir.mkdir() + capture = tmp_path / "docker-capture.txt" + fake = bin_dir / "docker" + fake.write_text( + f'#!/usr/bin/env bash\nprintf "SOURCE_COMMIT=%s\\n%s\\n" "$SOURCE_COMMIT" "$*" >> "{capture}"\n', + encoding="utf-8", + ) + fake.chmod(0o755) + return bin_dir, capture + + +@pytest.mark.parametrize("preset", [None, "c" * 40]) +def test_build_all_images_hands_the_source_commit_to_bake(tmp_path, preset): + bin_dir, capture = _fake_docker_bin(tmp_path) + env = {key: value for key, value in os.environ.items() if key != "SOURCE_COMMIT"} + env["PATH"] = f"{bin_dir}{os.pathsep}{env.get('PATH', '')}" + if preset: + env["SOURCE_COMMIT"] = preset + + completed = _REAL_RUN( + ["bash", str(APP_ROOT / "build_all_images.sh")], env=env, capture_output=True, text=True, check=False + ) + + assert completed.returncode == 0, completed.stdout + completed.stderr + commit_line, args_line = capture.read_text(encoding="utf-8").splitlines() + expected = preset or _repo_head_or_unknown() + assert commit_line == f"SOURCE_COMMIT={expected}" + assert args_line.startswith("buildx bake") + assert str(APP_ROOT / "docker-bake.hcl") in args_line + assert f"org.holon.source-commit={expected}" in completed.stdout + + +def test_resolve_source_commit_falls_back_to_unknown_outside_git(tmp_path): + outside = tmp_path / "not-a-repo" + outside.mkdir() + script = APP_ROOT / "build_all_images.sh" + env = {**os.environ, "GIT_CEILING_DIRECTORIES": str(tmp_path), "OUTSIDE": str(outside), "SCRIPT": str(script)} + completed = _REAL_RUN( + ["bash", "-c", 'source "$SCRIPT"; REPO_ROOT="$OUTSIDE"; resolve_source_commit'], + env=env, + capture_output=True, + text=True, + check=False, + ) + assert completed.returncode == 0, completed.stderr + assert completed.stdout == "unknown\n" + + +def _inspect_reply(stdout: str, returncode: int = 0): + def run(cmd, **_kwargs): + run.calls.append(cmd) + return subprocess.CompletedProcess(cmd, returncode, stdout=stdout, stderr="") + + run.calls = [] + return run + + +def _raising(exc: BaseException): + def run(cmd, **_kwargs): + raise exc + + return run + + +def test_read_image_source_commit_reads_the_label_back(): + run = _inspect_reply(json.dumps({preflight_image_commit.IMAGE_SOURCE_COMMIT_LABEL: _NEW_SHA})) + assert preflight_image_commit.read_image_source_commit("holon/agent-claude", run) == _NEW_SHA + assert run.calls == [["docker", "image", "inspect", "--format", "{{json .Config.Labels}}", "holon/agent-claude"]] + + +@pytest.mark.parametrize( + "run", + [ + _inspect_reply(json.dumps({"org.holon.source-commit": "unknown"})), + _inspect_reply("null"), + _inspect_reply(json.dumps({"other": _NEW_SHA})), + _inspect_reply(json.dumps({"org.holon.source-commit": _NEW_SHA}), returncode=1), + _inspect_reply("{not json"), + _raising(OSError("docker missing")), + _raising(subprocess.TimeoutExpired(["docker"], 10)), + ], + ids=["unknown-label", "no-labels", "missing-key", "nonzero-exit", "invalid-json", "os-error", "timeout"], +) +def test_read_image_source_commit_is_none_when_unreadable(run): + assert preflight_image_commit.read_image_source_commit("holon/agent-claude", run) is None + + +def _git(repo: pathlib.Path, *args: str) -> str: + identity = ["-c", "user.email=test@example.invalid", "-c", "user.name=Test"] + completed = _REAL_RUN(["git", *identity, "-C", str(repo), *args], capture_output=True, text=True, check=True) + return completed.stdout.strip() + + +def _commit_all(repo: pathlib.Path, message: str) -> str: + _git(repo, "add", "-A") + _git(repo, "commit", "-q", "-m", message) + return _git(repo, "rev-parse", "HEAD") + + +def _git_repo_with_image_inputs(tmp_path: pathlib.Path) -> tuple[pathlib.Path, str]: + repo = tmp_path / "engine" + (repo / "src").mkdir(parents=True) + (repo / "entrypoint").mkdir() + (repo / "src" / "x.py").write_text("x = 1\n", encoding="utf-8") + (repo / "entrypoint" / "e.sh").write_text("echo e\n", encoding="utf-8") + (repo / "Dockerfile").write_text("FROM scratch\n", encoding="utf-8") + (repo / "README.md").write_text("engine\n", encoding="utf-8") + _git(repo, "init", "-q") + return repo, _commit_all(repo, "image inputs") + + +def test_host_source_commit_reads_a_real_git_head(tmp_path): + repo, commit = _git_repo_with_image_inputs(tmp_path) + assert preflight_image_commit.host_source_commit(subprocess.run, repo) == commit + assert preflight_image_commit.host_source_commit(subprocess.run, tmp_path / "missing") is None + + +def test_build_inputs_changed_since_detects_a_src_edit(tmp_path): + repo, commit = _git_repo_with_image_inputs(tmp_path) + changed_since = preflight_image_commit.build_inputs_changed_since + assert changed_since(subprocess.run, repo, commit) is False + + (repo / "src" / "x.py").write_text("x = 2\n", encoding="utf-8") + assert changed_since(subprocess.run, repo, commit) is True + + _git(repo, "checkout", "--", "src/x.py") + (repo / "README.md").write_text("engine docs\n", encoding="utf-8") + _commit_all(repo, "docs only") + assert changed_since(subprocess.run, repo, commit) is False + assert changed_since(subprocess.run, repo, "f" * 40) is True + + +def _docker_labels_then_real_git(image_commit: str): + def run(cmd, **kwargs): + if cmd[0] == "docker": + labels = {preflight_image_commit.IMAGE_SOURCE_COMMIT_LABEL: image_commit} + return subprocess.CompletedProcess(cmd, 0, stdout=json.dumps(labels), stderr="") + return _REAL_RUN(cmd, **kwargs) + + return run + + +def test_check_image_source_commit_matches_an_image_built_at_head(tmp_path): + repo, commit = _git_repo_with_image_inputs(tmp_path) + check = preflight_image_commit.check_image_source_commit( + "holon/agent-claude", _docker_labels_then_real_git(commit), repo + ) + assert check is not None + assert not check.stale + assert (check.image_commit, check.host_commit) == (commit, commit) + assert check.describe().endswith("match") + + +def test_check_image_source_commit_accepts_an_older_image_with_unchanged_inputs(tmp_path, caplog): + repo, image_commit = _git_repo_with_image_inputs(tmp_path) + (repo / "README.md").write_text("ledger bookkeeping\n", encoding="utf-8") + host_commit = _commit_all(repo, "bookkeeping") + + with caplog.at_level(logging.INFO, logger=preflight_image_commit.__name__): + check = preflight_image_commit.check_image_source_commit( + "holon/agent-claude", _docker_labels_then_real_git(image_commit), repo + ) + + assert check is not None + assert not check.stale + assert image_commit in caplog.text and host_commit in caplog.text + + +def test_check_image_source_commit_flags_an_image_whose_src_changed_since(tmp_path): + repo, image_commit = _git_repo_with_image_inputs(tmp_path) + (repo / "src" / "x.py").write_text("x = 3\n", encoding="utf-8") + host_commit = _commit_all(repo, "engine fix") + + check = preflight_image_commit.check_image_source_commit( + "holon/agent-claude", _docker_labels_then_real_git(image_commit), repo + ) + + assert check is not None + assert check.stale + assert image_commit in check.describe() and host_commit in check.describe() + assert "differ" in check.describe() + + +def test_check_image_source_commit_skips_an_unknown_label(tmp_path, caplog): + repo, _commit = _git_repo_with_image_inputs(tmp_path) + with caplog.at_level(logging.WARNING, logger=preflight_image_commit.__name__): + check = preflight_image_commit.check_image_source_commit( + "holon/agent-claude", _docker_labels_then_real_git("unknown"), repo + ) + assert check is None + assert "holon/agent-claude" in caplog.text + + +def test_check_image_source_commit_skips_an_engine_outside_git(tmp_path): + outside = tmp_path / "installed" + outside.mkdir() + run = _docker_labels_then_real_git(_OLD_SHA) + with patch.dict(os.environ, {"GIT_CEILING_DIRECTORIES": str(tmp_path)}): + assert preflight_image_commit.check_image_source_commit("holon/agent-claude", run, outside) is None + + +_STALE_CHECK = preflight_image_commit.ImageCommitCheck( + image="holon/agent-claude", image_commit=_OLD_SHA, host_commit=_NEW_SHA, build_inputs_changed=True +) +_CHECK_PATCH = "sandbox_executor.preflight_image_commit.check_image_source_commit" + + +def _fail_if_called(*_args, **_kwargs): + pytest.fail("the runner container must not start for a stale image") + + +def test_probe_refuses_a_stale_image_before_running_the_runner(probe_env): + with ( + patch("sandbox_executor.preflight.shutil.which", return_value="/usr/bin/docker"), + patch(_CHECK_PATCH, return_value=_STALE_CHECK), + patch("sandbox_executor.preflight.subprocess.run", side_effect=_fail_if_called), + ): + result = run_preflight_probe("claude-agent", "claude-opus-5-5") + + assert not result.ok + assert _OLD_SHA in result.output_excerpt and _NEW_SHA in result.output_excerpt + assert "--skip-preflight" in result.hint + assert preflight_outage.connectivity_reason(result) is None + assert not preflight.matching_statuses(result.output_excerpt + result.hint) + + +def test_flow_preflight_gate_aborts_and_reports_a_stale_image(probe_env, capsys): + run = MagicMock(side_effect=_fail_if_called) + with ( + patch("sandbox_executor.preflight.shutil.which", return_value="/usr/bin/docker"), + patch(_CHECK_PATCH, return_value=_STALE_CHECK), + patch("sandbox_executor.preflight.subprocess.run", run), + ): + result = preflight_gate("claude-agent", "claude-opus-5-5", sleep=lambda _seconds: None) + + assert result is not None and not result.ok + stderr = capsys.readouterr().err + assert _OLD_SHA in stderr and _NEW_SHA in stderr + assert "Aborting before any branch" in stderr + run.assert_not_called() + + +@pytest.mark.parametrize("override", ["flag", "env"]) +def test_skip_preflight_is_the_explicit_override_for_a_stale_image(probe_env, monkeypatch, override): + if override == "env": + monkeypatch.setenv("HOLON_SKIP_PREFLIGHT", "1") + with patch(_CHECK_PATCH, return_value=_STALE_CHECK) as check: + assert preflight_gate("claude-agent", "claude-opus-5-5", skip=override == "flag") is None + check.assert_not_called() + + +@pytest.mark.parametrize( + "check", + [ + preflight_image_commit.ImageCommitCheck( + image="holon/agent-claude", image_commit=_OLD_SHA, host_commit=_NEW_SHA, build_inputs_changed=False + ), + None, + ], + ids=["matching-inputs", "unverifiable"], +) +def test_probe_with_matching_or_unverifiable_image_runs_the_runner(probe_env, isolated_env_file_dir, check): + run = MagicMock(side_effect=lambda cmd, **_kwargs: subprocess.CompletedProcess(cmd, 0, stdout="OK", stderr="")) + with ( + patch("sandbox_executor.preflight.shutil.which", return_value="/usr/bin/docker"), + patch(_CHECK_PATCH, return_value=check), + patch("sandbox_executor.preflight.subprocess.run", run), + ): + result = run_preflight_probe("claude-agent", "claude-opus-5-5") + + assert result.ok + assert run.call_args.args[0][:2] == ["docker", "run"] diff --git a/executions/E-1796254347-CLA-CO5.5.md b/executions/E-1796254347-CLA-CO5.5.md index af37c46bd..940cbcec7 100644 --- a/executions/E-1796254347-CLA-CO5.5.md +++ b/executions/E-1796254347-CLA-CO5.5.md @@ -45,3 +45,22 @@ the host engine checkout, unless `--skip-preflight` / `HOLON_SKIP_PREFLIGHT` is result whose excerpt names both commits and whose hint names `--skip-preflight` / `HOLON_SKIP_PREFLIGHT=1`. - `preflight.py` is 491 lines (budget 548). `uv run ruff check` and `ruff format --check`: clean. Existing `test_preflight*.py`: 402 passed in 8.18s. + +### Step 3: Add hermetic tests in tests/test_preflight.py + +- Build files: per-stage `ARG`/`LABEL` with no `RUN` after the label (all seven targets, parametrised); bake variable, + `common` `args`/`labels` and every target inheriting `common`. +- `build_all_images.sh` with a fake `docker` first on `PATH`: the bake child sees `SOURCE_COMMIT` equal to the checkout + `HEAD` (or `unknown`), or the preset value unchanged; `resolve_source_commit` prints `unknown` outside git. +- `read_image_source_commit` reads the label back from fake inspect output; `None` for `unknown`, `null`, missing key, + nonzero exit, invalid JSON, `OSError` and `TimeoutExpired`. +- Real `git` in `tmp_path`: head resolution, `src` edit detection, docs-only commit not counted, unknown commit counted; + verdicts for match, older commit with unchanged inputs (info log naming both SHAs), stale `src`, `unknown` label and + an engine outside git. +- Probe and gate: stale image refused before `docker run` with both SHAs and `--skip-preflight` in the result, not a + connectivity outage and no quota/login status; `preflight_gate` prints the record and the abort line; the flag and + `HOLON_SKIP_PREFLIGHT=1` skip the check; matching or unverifiable images run the normal probe. +- Deviation: the plan's single parametrised `test_check_image_source_commit_verdicts` is split into five named tests, + because the cases need different fixtures (`caplog`, ceiling directories) and assertions. +- Two foreground runs of `test_preflight.py` with `-n auto --dist worksteal`: 323 passed in 10.20s, 323 passed in + 13.91s (no flake). From df737c140c05ae51c08bbb125c4b4bb3a2cf0dbe Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:40:54 +0000 Subject: [PATCH 06/10] step 4: verification and execution record --- executions/E-1796254347-CLA-CO5.5.md | 48 ++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/executions/E-1796254347-CLA-CO5.5.md b/executions/E-1796254347-CLA-CO5.5.md index 940cbcec7..46647bf8e 100644 --- a/executions/E-1796254347-CLA-CO5.5.md +++ b/executions/E-1796254347-CLA-CO5.5.md @@ -10,11 +10,11 @@ the host engine checkout, unless `--skip-preflight` / `HOLON_SKIP_PREFLIGHT` is | metric | value | | --------------------- | ----- | -| success_actual | 0.0 | -| entropy_actual | 0.0 | -| impact_actual | 0.0 | -| cost_actual | 0.0 | -| learning_value_actual | 0.0 | +| success_actual | 0.95 | +| entropy_actual | 5.0 | +| impact_actual | 70.0 | +| cost_actual | 9.0 | +| learning_value_actual | 3.0 | ## Steps Executed @@ -23,11 +23,11 @@ the host engine checkout, unless `--skip-preflight` / `HOLON_SKIP_PREFLIGHT` is - `Dockerfile`: `ARG SOURCE_COMMIT=unknown` and `LABEL org.holon.source-commit="${SOURCE_COMMIT}"` are the last two instructions of all seven build-target stages (`holon-base` after `RUN uv --version`); `uv-bin` is untouched. - `docker-bake.hcl`: `variable "SOURCE_COMMIT"` (default `unknown`); `target "common"` carries - `args = { SOURCE_COMMIT = SOURCE_COMMIT }` and `labels = { "org.holon.source-commit" = SOURCE_COMMIT }`, inherited - by every target. `tags = [...]` lines unchanged. -- `build_all_images.sh`: `resolve_source_commit` prints `git rev-parse --verify --quiet HEAD` or `unknown` - (`--verify` avoids the plain `rev-parse` printing a literal `HEAD` in a repository with no commits); the main block - exports `SOURCE_COMMIT="${SOURCE_COMMIT:-$(resolve_source_commit)}"` to the `docker buildx bake` child. + `args = { SOURCE_COMMIT = SOURCE_COMMIT }` and `labels = { "org.holon.source-commit" = SOURCE_COMMIT }`, inherited by + every target. `tags = [...]` lines unchanged. +- `build_all_images.sh`: `resolve_source_commit` prints `git rev-parse --verify --quiet HEAD` or `unknown` (`--verify` + avoids the plain `rev-parse` printing a literal `HEAD` in a repository with no commits); the main block exports + `SOURCE_COMMIT="${SOURCE_COMMIT:-$(resolve_source_commit)}"` to the `docker buildx bake` child. - Cache hypothesis: no `RUN` follows the label in any stage, so no filesystem layer depends on the commit. A child stage's `RUN` cache key is the parent's rootfs plus its exec metadata (env, cwd, user), not image labels, so the `holon-base` label does not invalidate the agent npm layers. `docker` is not installed in the execution sandbox, so @@ -38,8 +38,8 @@ the host engine checkout, unless `--skip-preflight` / `HOLON_SKIP_PREFLIGHT` is - New module `preflight_image_commit.py` (scope expansion recorded in the plan): `read_image_source_commit` (`docker image inspect --format {{json .Config.Labels}}`), `host_source_commit` (`git -C rev-parse HEAD`), - `build_inputs_changed_since` (`git diff --quiet -- src entrypoint Dockerfile` against the working tree), - `check_image_source_commit` and the frozen `ImageCommitCheck` with `stale` and `describe()`. + `build_inputs_changed_since` (`git diff --quiet -- src entrypoint Dockerfile` against the working + tree), `check_image_source_commit` and the frozen `ImageCommitCheck` with `stale` and `describe()`. - `preflight.py`: `_real_docker_blocker` folds the existing missing-`docker` result and the stale-image result; the `run_preflight_probe` branch count and five-parameter signature are unchanged. A stale image yields an `UNKNOWN` result whose excerpt names both commits and whose hint names `--skip-preflight` / `HOLON_SKIP_PREFLIGHT=1`. @@ -62,5 +62,25 @@ the host engine checkout, unless `--skip-preflight` / `HOLON_SKIP_PREFLIGHT` is `HOLON_SKIP_PREFLIGHT=1` skip the check; matching or unverifiable images run the normal probe. - Deviation: the plan's single parametrised `test_check_image_source_commit_verdicts` is split into five named tests, because the cases need different fixtures (`caplog`, ceiling directories) and assertions. -- Two foreground runs of `test_preflight.py` with `-n auto --dist worksteal`: 323 passed in 10.20s, 323 passed in - 13.91s (no flake). +- Two foreground runs of `test_preflight.py` with `-n auto --dist worksteal`: 323 passed in 10.20s, 323 passed in 13.91s + (no flake). + +### Step 4: Verify affected tests, lint and the full suite once + +- Final line counts: `preflight.py` 491 (budget 548), `preflight_image_commit.py` 103 (default budget 350). +- Cache-placement hypothesis: confirmed by text evidence only (no `RUN` after the label in any stage, pinned by + `test_every_image_stage_stamps_the_source_commit_label`); `docker buildx bake --print` unavailable in the sandbox. + +## Tests Run + +| command | result | time | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ------- | +| `uv run pytest test_build_all_images.py test_container_images.py test_runner_specs.py test_environment_reference.py` (Step 1) | 132 passed, 12 skipped | 10.93s | +| `uv run pytest apps/sandbox-executor/tests/test_preflight*.py` (Step 2) | 402 passed | 8.18s | +| `uv run pytest apps/sandbox-executor/tests/test_preflight.py -n auto --dist worksteal` (run 1) | 323 passed | 10.20s | +| `uv run pytest apps/sandbox-executor/tests/test_preflight.py -n auto --dist worksteal` (run 2) | 323 passed | 13.91s | +| Step 4 affected set (nine preflight, environment, runner-spec and image test modules) | 566 passed, 12 skipped | 20.71s | +| `uv run task lint` | passed | n/a | +| `uv run task test` (full suite, once) | 11363 passed, 8 skipped | 194.37s | + +The two `test_preflight.py` runs have a median of `(10.20 + 13.91) / 2 = 12.06s`; every other command ran once. From 34ae5e44120d64ffc9af4242096b342af18467f7 Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:49:29 +0000 Subject: [PATCH 07/10] execute: E-1796254347-CLA-CO5.5 completed for plan I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/_ --- .../I-1796253987-hac-image-source-commit-label.jsonl | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl diff --git a/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl b/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl new file mode 100644 index 000000000..d04ac1b0d --- /dev/null +++ b/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl @@ -0,0 +1,7 @@ +{"action_id": "ACT-1796254860-36e760aa", "execution_id": "E-1796254347-CLA-CO5.5", "action": "Executed agent claude-agent with model claude-opus-5-5", "category": "code", "target": "claude-agent:claude-opus-5-5", "outcome": "success", "entry_type": "action", "parent_action_id": null, "event_type": "command_execution", "labels": ["agent", "claude-agent", "execution"], "error_context": null, "mistake_category": null, "action_origin": "initial_implementation", "review_severity": null, "review_iteration": null, "review_finding_ids": null, "review_disposition": null, "rejection_reason": null, "introduced_by_action_id": null, "created_at": "2026-12-02T23:41:00.533494Z"} +{"execution_id": "E-1796254347-CLA-CO5.5", "action": "test_failure", "category": "test", "target": "stage_3", "outcome": "failure", "action_origin": "initial_implementation", "event_type": "test_run", "stage": "stage_3", "branch": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "run_id": "def7fe18602c", "head_sha": "df737c140c05ae51c08bbb125c4b4bb3a2cf0dbe", "failing_test_ids": ["apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave"], "test_excerpts": {"apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-10/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha"}, "environment": {"variables": ["HOLON_AGENT_ID", "HOLON_AGENT_SETTINGS", "HOLON_CONFIG_RESOLVED", "HOLON_ROLE", "HOLON_SKIP_PREFLIGHT", "HOLON_STAGE_BUDGET_EXECUTE_MINUTES", "HOLON_STAGE_BUDGET_SECONDS", "HOLON_TARGET_WORKTREE", "HOLON_TOKEN_REDUCE", "PYTHONPATH", "PYTHON_SHA256", "PYTHON_VERSION", "UV_FROZEN", "UV_PROJECT_ENVIRONMENT"], "values": {"UV_FROZEN": "1"}, "identity_overrides": [], "HOME_set": true, "TMPDIR_set": false}, "classification": "flaky", "failure_signature": "d67238f28c64325b", "iteration": 0, "model_tier": "claude-opus-5-5", "base_check": "not_run", "error_context": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-10/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha", "entry_type": "action", "action_id": "ACT-1796255192-327bd930", "created_at": "2026-12-02T23:46:32.540718Z"} +{"execution_id": "E-1796254347-CLA-CO5.5", "action": "test_failure", "category": "test", "target": "stage_3", "outcome": "success", "action_origin": "initial_implementation", "event_type": "test_run", "stage": "stage_3", "branch": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "run_id": "def7fe18602c", "head_sha": "df737c140c05ae51c08bbb125c4b4bb3a2cf0dbe", "failing_test_ids": ["apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave"], "test_excerpts": {"apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-10/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha"}, "environment": {"variables": ["HOLON_AGENT_ID", "HOLON_AGENT_SETTINGS", "HOLON_CONFIG_RESOLVED", "HOLON_ROLE", "HOLON_SKIP_PREFLIGHT", "HOLON_STAGE_BUDGET_EXECUTE_MINUTES", "HOLON_STAGE_BUDGET_SECONDS", "HOLON_TARGET_WORKTREE", "HOLON_TOKEN_REDUCE", "PYTHONPATH", "PYTHON_SHA256", "PYTHON_VERSION", "UV_FROZEN", "UV_PROJECT_ENVIRONMENT"], "values": {"UV_FROZEN": "1"}, "identity_overrides": [], "HOME_set": true, "TMPDIR_set": false}, "classification": "flaky", "failure_signature": "d67238f28c64325b", "iteration": 0, "model_tier": "claude-opus-5-5", "base_check": "not_run", "error_context": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-10/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha", "entry_type": "action", "action_id": "ACT-1796255196-88b4aa06", "created_at": "2026-12-02T23:46:36.569610Z"} +{"execution_id": "E-1796254347-CLA-CO5.5", "action": "test_failure", "category": "test", "target": "stage_3", "outcome": "success", "action_origin": "initial_implementation", "event_type": "test_run", "stage": "stage_3", "branch": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "run_id": "def7fe18602c", "head_sha": "df737c140c05ae51c08bbb125c4b4bb3a2cf0dbe", "failing_test_ids": ["apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave"], "test_excerpts": {"apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-10/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha"}, "environment": {"variables": ["HOLON_AGENT_ID", "HOLON_AGENT_SETTINGS", "HOLON_CONFIG_RESOLVED", "HOLON_ROLE", "HOLON_SKIP_PREFLIGHT", "HOLON_STAGE_BUDGET_EXECUTE_MINUTES", "HOLON_STAGE_BUDGET_SECONDS", "HOLON_TARGET_WORKTREE", "HOLON_TOKEN_REDUCE", "PYTHONPATH", "PYTHON_SHA256", "PYTHON_VERSION", "UV_FROZEN", "UV_PROJECT_ENVIRONMENT"], "values": {"UV_FROZEN": "1"}, "identity_overrides": [], "HOME_set": true, "TMPDIR_set": false}, "classification": "flaky", "failure_signature": "d67238f28c64325b", "iteration": 0, "model_tier": "claude-opus-5-5", "base_check": "not_run", "error_context": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-10/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha", "entry_type": "action", "action_id": "ACT-1796255201-e764d099", "created_at": "2026-12-02T23:46:41.085856Z"} +{"execution_id": "E-1796254347-CLA-CO5.5", "action": "test_failure", "category": "test", "target": "stage_3", "outcome": "failure", "action_origin": "initial_implementation", "event_type": "test_run", "stage": "stage_3", "branch": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "run_id": "def7fe18602c", "head_sha": "df737c140c05ae51c08bbb125c4b4bb3a2cf0dbe", "failing_test_ids": ["apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave"], "test_excerpts": {"apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-16/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha"}, "environment": {"variables": ["HOLON_AGENT_ID", "HOLON_AGENT_SETTINGS", "HOLON_CONFIG_RESOLVED", "HOLON_ROLE", "HOLON_SKIP_PREFLIGHT", "HOLON_STAGE_BUDGET_EXECUTE_MINUTES", "HOLON_STAGE_BUDGET_SECONDS", "HOLON_TARGET_WORKTREE", "HOLON_TOKEN_REDUCE", "PYTHONPATH", "PYTHON_SHA256", "PYTHON_VERSION", "UV_FROZEN", "UV_PROJECT_ENVIRONMENT"], "values": {"UV_FROZEN": "1"}, "identity_overrides": [], "HOME_set": true, "TMPDIR_set": false}, "classification": "flaky", "failure_signature": "d67238f28c64325b", "iteration": 0, "model_tier": "claude-opus-5-5", "base_check": "not_run", "error_context": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-16/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha", "entry_type": "action", "action_id": "ACT-1796255368-b4756ca3", "created_at": "2026-12-02T23:49:28.996831Z"} +{"entry_type": "summary", "execution_id": "E-1796254347-CLA-CO5.5", "plan_branch": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/_", "agent": "claude-agent", "agent_version": "2.1.302", "model": "claude-opus-5-5", "status": "success", "summary": "Plan executed successfully", "created_at": "2026-12-02T23:32:30.344914Z", "agent_output_truncated": false, "agent_output_bytes": 537, "ledger_revision": 1, "execution_notes": "executions/E-1796254347-CLA-CO5.5.md", "execution_notes_valid": true, "elapsed_seconds": 1019.2, "budget_seconds": 604711.0, "test_pass_rate": 0.999911995071724, "tests_passed": 11362, "tests_failed": 1, "tests_errored": 0, "test_exit_code": 1, "test_source": "stage_3", "test_failure_classification": "flaky", "test_failure_status": "blocked", "test_failure_blocked_reason": "persistent flakiness", "test_failure_rows": ["ACT-1796255192-327bd930", "ACT-1796255196-88b4aa06", "ACT-1796255201-e764d099", "ACT-1796255368-b4756ca3"], "test_fix_tier": "claude-opus-5-5"} +{"action_id": "ACT-1796255369-0124eaa5", "execution_id": "E-1796254347-CLA-CO5.5", "action": "Committed execution changes: execute: E-1796254347-CLA-CO5.5 completed for plan I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/_", "category": "code", "target": "HEAD", "outcome": "success", "entry_type": "action", "parent_action_id": null, "event_type": "git_mutation", "labels": ["commit", "git"], "error_context": null, "mistake_category": null, "action_origin": "initial_implementation", "review_severity": null, "review_iteration": null, "review_finding_ids": null, "review_disposition": null, "rejection_reason": null, "introduced_by_action_id": null, "created_at": "2026-12-02T23:49:29.598635Z"} From af279aeac32ea52172bc1c4b512ced0a353d56b2 Mon Sep 17 00:00:00 2001 From: Holon Review Loop Agent Date: Thu, 3 Dec 2026 00:11:46 +0000 Subject: [PATCH 08/10] fix(review): resolve findings R1-F2, R1-F3, R2-F2, R2-F3, R3-F2, R3-F3, R3-F4, FIND-CI-001 (iteration 1) Action-Origin: pr_review Review-Iteration: 1 Review-Finding-Ids: R1-F2, R1-F3, R2-F2, R2-F3, R3-F2, R3-F3, R3-F4, FIND-CI-001 Review-Severity: important --- apps/sandbox-executor/build_all_images.sh | 1 + .../src/sandbox_executor/preflight.py | 2 +- .../preflight_image_commit.py | 23 +++++++++++++++++-- apps/sandbox-executor/tests/test_preflight.py | 15 ++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/apps/sandbox-executor/build_all_images.sh b/apps/sandbox-executor/build_all_images.sh index f261ceffd..4099f2c02 100755 --- a/apps/sandbox-executor/build_all_images.sh +++ b/apps/sandbox-executor/build_all_images.sh @@ -85,6 +85,7 @@ resolve_source_commit() { if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then echo "Starting Docker Buildx Bake build for all Holon images..." + # why: the export overlays only the docker buildx bake child, whose SOURCE_COMMIT variable feeds each target's arg and label export SOURCE_COMMIT="${SOURCE_COMMIT:-$(resolve_source_commit)}" echo "Stamping org.holon.source-commit=${SOURCE_COMMIT} on every image" diff --git a/apps/sandbox-executor/src/sandbox_executor/preflight.py b/apps/sandbox-executor/src/sandbox_executor/preflight.py index e735afcc5..d015196cb 100644 --- a/apps/sandbox-executor/src/sandbox_executor/preflight.py +++ b/apps/sandbox-executor/src/sandbox_executor/preflight.py @@ -37,7 +37,7 @@ _PROBE_CONTAINER_PREFIX = "holon-preflight-" _PROBE_CONTAINER_ID_LENGTH = 12 _STALE_IMAGE_HINT = ( - "Rebuild the Holon images from this checkout (make build) so the runner image matches the host engine, " + "Rebuild the Holon images from this checkout (make build-images) so the runner image matches the host engine, " "or pass --skip-preflight (HOLON_SKIP_PREFLIGHT=1) to launch anyway." ) diff --git a/apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py b/apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py index bc8751497..cd5f19b00 100644 --- a/apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py +++ b/apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py @@ -26,14 +26,19 @@ class ImageCommitCheck: image_commit: str host_commit: str | None build_inputs_changed: bool + image_commit_found: bool = True @property def stale(self) -> bool: - return self.build_inputs_changed + # why: inputs that cannot be compared are not known to match, so an unresolvable image commit still blocks + return self.build_inputs_changed or not self.image_commit_found def describe(self) -> str: inputs = ", ".join(IMAGE_BUILD_INPUTS) - verdict = "differ" if self.build_inputs_changed else "match" + if not self.image_commit_found: + verdict = "cannot be compared: the image commit is not in the host checkout's history" + else: + verdict = "differ" if self.build_inputs_changed else "match" return ( f"image {self.image} built from {self.image_commit}; " f"host engine at {self.host_commit or 'unresolved'}; build inputs ({inputs}) {verdict}" @@ -74,6 +79,12 @@ def host_source_commit(run: CommandRunner, source_dir: Path) -> str | None: return _full_sha_or_none(completed.stdout) +def commit_exists(run: CommandRunner, source_dir: Path, commit: str) -> bool: + cmd = ["git", "-C", str(source_dir), "cat-file", "-e", f"{commit}^{{commit}}"] + completed = _run_quietly(run, cmd, GIT_TIMEOUT_SECONDS) + return completed is not None and completed.returncode == 0 + + def build_inputs_changed_since(run: CommandRunner, source_dir: Path, image_commit: str) -> bool: # why: diffing against the working tree, not HEAD, also catches uncommitted engine edits the image cannot contain cmd = ["git", "-C", str(source_dir), "diff", "--quiet", image_commit, "--", *IMAGE_BUILD_INPUTS] @@ -92,6 +103,14 @@ def check_image_source_commit( if host_commit is None: logger.warning("Host engine at %s is not a git checkout; skipping the image commit check.", source_dir) return None + if not commit_exists(run, source_dir, image_commit): + return ImageCommitCheck( + image=image, + image_commit=image_commit, + host_commit=host_commit, + build_inputs_changed=False, + image_commit_found=False, + ) check = ImageCommitCheck( image=image, image_commit=image_commit, diff --git a/apps/sandbox-executor/tests/test_preflight.py b/apps/sandbox-executor/tests/test_preflight.py index 95aa92bbd..33e79b5c2 100644 --- a/apps/sandbox-executor/tests/test_preflight.py +++ b/apps/sandbox-executor/tests/test_preflight.py @@ -1109,6 +1109,21 @@ def test_check_image_source_commit_flags_an_image_whose_src_changed_since(tmp_pa assert "differ" in check.describe() +def test_check_image_source_commit_blocks_an_image_commit_missing_from_host_history(tmp_path): + repo, host_commit = _git_repo_with_image_inputs(tmp_path) + + check = preflight_image_commit.check_image_source_commit( + "holon/agent-claude", _docker_labels_then_real_git(_OLD_SHA), repo + ) + + assert check is not None + assert check.stale + assert not check.image_commit_found + assert _OLD_SHA in check.describe() and host_commit in check.describe() + assert "not in the host checkout's history" in check.describe() + assert "differ" not in check.describe() + + def test_check_image_source_commit_skips_an_unknown_label(tmp_path, caplog): repo, _commit = _git_repo_with_image_inputs(tmp_path) with caplog.at_level(logging.WARNING, logger=preflight_image_commit.__name__): From 967981becff3cfe9f05015ee1b1bfd89a9509c57 Mon Sep 17 00:00:00 2001 From: Holon Review Loop Agent Date: Thu, 3 Dec 2026 11:21:57 +1100 Subject: [PATCH 09/10] chore(review): record review ledger rows (iteration 1) Action-Origin: pr_review Review-Iteration: 1 --- ...253987-hac-image-source-commit-label.jsonl | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl b/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl index d04ac1b0d..b5d2b4ff8 100644 --- a/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl +++ b/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl @@ -5,3 +5,39 @@ {"execution_id": "E-1796254347-CLA-CO5.5", "action": "test_failure", "category": "test", "target": "stage_3", "outcome": "failure", "action_origin": "initial_implementation", "event_type": "test_run", "stage": "stage_3", "branch": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "run_id": "def7fe18602c", "head_sha": "df737c140c05ae51c08bbb125c4b4bb3a2cf0dbe", "failing_test_ids": ["apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave"], "test_excerpts": {"apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-16/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha"}, "environment": {"variables": ["HOLON_AGENT_ID", "HOLON_AGENT_SETTINGS", "HOLON_CONFIG_RESOLVED", "HOLON_ROLE", "HOLON_SKIP_PREFLIGHT", "HOLON_STAGE_BUDGET_EXECUTE_MINUTES", "HOLON_STAGE_BUDGET_SECONDS", "HOLON_TARGET_WORKTREE", "HOLON_TOKEN_REDUCE", "PYTHONPATH", "PYTHON_SHA256", "PYTHON_VERSION", "UV_FROZEN", "UV_PROJECT_ENVIRONMENT"], "values": {"UV_FROZEN": "1"}, "identity_overrides": [], "HOME_set": true, "TMPDIR_set": false}, "classification": "flaky", "failure_signature": "d67238f28c64325b", "iteration": 0, "model_tier": "claude-opus-5-5", "base_check": "not_run", "error_context": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_process_appends_do_not_interleave\n______________ test_concurrent_process_appends_do_not_interleave _______________\n[gw0] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-16/popen-gw0/test_concurrent_process_append0')\n def test_concurrent_process_appends_do_not_interleave(tmp_path: Path) -> None:\n ledger_file = str(tmp_path / \"executions.jsonl\")\n # why: fresh interpreters importing only sandbox_executor; forking a threaded xdist worker can ha", "entry_type": "action", "action_id": "ACT-1796255368-b4756ca3", "created_at": "2026-12-02T23:49:28.996831Z"} {"entry_type": "summary", "execution_id": "E-1796254347-CLA-CO5.5", "plan_branch": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/_", "agent": "claude-agent", "agent_version": "2.1.302", "model": "claude-opus-5-5", "status": "success", "summary": "Plan executed successfully", "created_at": "2026-12-02T23:32:30.344914Z", "agent_output_truncated": false, "agent_output_bytes": 537, "ledger_revision": 1, "execution_notes": "executions/E-1796254347-CLA-CO5.5.md", "execution_notes_valid": true, "elapsed_seconds": 1019.2, "budget_seconds": 604711.0, "test_pass_rate": 0.999911995071724, "tests_passed": 11362, "tests_failed": 1, "tests_errored": 0, "test_exit_code": 1, "test_source": "stage_3", "test_failure_classification": "flaky", "test_failure_status": "blocked", "test_failure_blocked_reason": "persistent flakiness", "test_failure_rows": ["ACT-1796255192-327bd930", "ACT-1796255196-88b4aa06", "ACT-1796255201-e764d099", "ACT-1796255368-b4756ca3"], "test_fix_tier": "claude-opus-5-5"} {"action_id": "ACT-1796255369-0124eaa5", "execution_id": "E-1796254347-CLA-CO5.5", "action": "Committed execution changes: execute: E-1796254347-CLA-CO5.5 completed for plan I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/_", "category": "code", "target": "HEAD", "outcome": "success", "entry_type": "action", "parent_action_id": null, "event_type": "git_mutation", "labels": ["commit", "git"], "error_context": null, "mistake_category": null, "action_origin": "initial_implementation", "review_severity": null, "review_iteration": null, "review_finding_ids": null, "review_disposition": null, "rejection_reason": null, "introduced_by_action_id": null, "created_at": "2026-12-02T23:49:29.598635Z"} +{"action_id": "ACT-REV-1796256194-534687cd", "execution_id": "REV-ITR-1-1796256194", "action": "Review Loop iteration 1 reviewer 1 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R1-001-01", "FIND-R1-001-02", "FIND-R1-001-03"], "labels": ["review", "reviewer", "iteration-1"], "error_context": null, "review_reviewer_index": 1, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 2, "nit": 1}, "created_at": "2026-12-03T00:03:14.085043Z"} +{"action_id": "ACT-FIND-1796256194-cf2b0483", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R1-001-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R1-001-01"], "labels": ["review", "finding", "iteration-1"], "error_context": "test_preflight.py grows from 873 to 1,200 lines, past the 1,000-line limit; move the new image-commit tests into tests/test_preflight_image_commit.py.", "review_reviewer_index": 1, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 876, "created_at": "2026-12-03T00:03:14.089681Z"} +{"action_id": "ACT-FIND-1796256194-43dc0b04", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R1-001-02", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R1-001-02"], "labels": ["review", "finding", "iteration-1"], "error_context": "Exported SOURCE_COMMIT overlays the environment of docker buildx bake, but the change does not list the affected child processes as the environment-overlay rule requires.", "review_reviewer_index": 1, "review_file": "apps/sandbox-executor/build_all_images.sh", "review_line": 88, "created_at": "2026-12-03T00:03:14.092891Z"} +{"action_id": "ACT-FIND-1796256194-5b3688c6", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R1-001-03", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R1-001-03"], "labels": ["review", "finding", "iteration-1"], "error_context": "Any git diff failure, including an image commit missing from the local clone, is reported as build inputs that 'differ'; report it as unresolved instead.", "review_reviewer_index": 1, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py", "review_line": 79, "created_at": "2026-12-03T00:03:14.096084Z"} +{"action_id": "ACT-REV-1796256194-b6060142", "execution_id": "REV-ITR-1-1796256194", "action": "Review Loop iteration 1 reviewer 2 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R2-001-01", "FIND-R2-001-02", "FIND-R2-001-03"], "labels": ["review", "reviewer", "iteration-1"], "error_context": null, "review_reviewer_index": 2, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 2, "nit": 1}, "created_at": "2026-12-03T00:03:14.103021Z"} +{"action_id": "ACT-FIND-1796256194-51b29ddb", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R2-001-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R2-001-01"], "labels": ["review", "finding", "iteration-1"], "error_context": "test_preflight.py grows from 870 to 1,200 lines, past the 1,000-line limit; move the image-commit tests into tests/test_preflight_image_commit.py.", "review_reviewer_index": 2, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 876, "created_at": "2026-12-03T00:03:14.105765Z"} +{"action_id": "ACT-FIND-1796256194-f3afb7b5", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R2-001-02", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R2-001-02"], "labels": ["review", "finding", "iteration-1"], "error_context": "The exported SOURCE_COMMIT env overlay is inherited by docker buildx bake, but the change does not list the affected child processes.", "review_reviewer_index": 2, "review_file": "apps/sandbox-executor/build_all_images.sh", "review_line": 88, "created_at": "2026-12-03T00:03:14.107794Z"} +{"action_id": "ACT-FIND-1796256194-3abe9dea", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R2-001-03", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R2-001-03"], "labels": ["review", "finding", "iteration-1"], "error_context": "Any git diff failure, including an image commit absent from host history, is reported as build inputs that 'differ'; report the unknown commit separately.", "review_reviewer_index": 2, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py", "review_line": 78, "created_at": "2026-12-03T00:03:14.109587Z"} +{"action_id": "ACT-REV-1796256194-0aab4cbe", "execution_id": "REV-ITR-1-1796256194", "action": "Review Loop iteration 1 reviewer 3 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-01", "FIND-R3-001-02", "FIND-R3-001-03", "FIND-R3-001-04"], "labels": ["review", "reviewer", "iteration-1"], "error_context": null, "review_reviewer_index": 3, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 2, "nit": 2}, "created_at": "2026-12-03T00:03:14.111973Z"} +{"action_id": "ACT-FIND-1796256194-fde61bb1", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-01"], "labels": ["review", "finding", "iteration-1"], "error_context": "test_preflight.py grows from 870 to 1,200 lines, crossing 1,000; move the new image-commit tests into their own test module.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 876, "created_at": "2026-12-03T00:03:14.115039Z"} +{"action_id": "ACT-FIND-1796256194-11ac8d41", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-02", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-02"], "labels": ["review", "finding", "iteration-1"], "error_context": "The exported SOURCE_COMMIT reaches the docker buildx bake child, but the change does not list the affected child processes (a test exists).", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/build_all_images.sh", "review_line": 88, "created_at": "2026-12-03T00:03:14.118472Z"} +{"action_id": "ACT-FIND-1796256194-0acbc9ce", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-03", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-03"], "labels": ["review", "finding", "iteration-1"], "error_context": "The stale-image hint says 'make build', but the Makefile target is 'build-images'.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight.py", "review_line": 40, "created_at": "2026-12-03T00:03:14.123005Z"} +{"action_id": "ACT-FIND-1796256194-9e8a775d", "execution_id": "REV-FIND-1-1796256194", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-04", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-04"], "labels": ["review", "finding", "iteration-1"], "error_context": "A git diff failure (for example, an image commit missing locally) is reported as 'build inputs differ'; describe the unresolvable-commit case accurately.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py", "review_line": 81, "created_at": "2026-12-03T00:03:14.126031Z"} +{"action_id": "ACT-REV-1796256205-8d014608", "execution_id": "REV-ITR-1-1796256205", "action": "Review Loop iteration 1 evaluation for I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-CI-001", "FIND-R1-001-01", "FIND-R1-001-02", "FIND-R1-001-03", "FIND-R2-001-01", "FIND-R2-001-02", "FIND-R2-001-03", "FIND-R3-001-01", "FIND-R3-001-02", "FIND-R3-001-03", "FIND-R3-001-04"], "labels": ["review", "review-loop", "iteration-1"], "error_context": "Findings detected: ['FIND-CI-001', 'FIND-R1-001-01', 'FIND-R1-001-02', 'FIND-R1-001-03', 'FIND-R2-001-01', 'FIND-R2-001-02', 'FIND-R2-001-03', 'FIND-R3-001-01', 'FIND-R3-001-02', 'FIND-R3-001-03', 'FIND-R3-001-04']", "created_at": "2026-12-03T00:03:25.725070Z"} +{"action_id": "ACT-REV-1796256205-13cf0dec", "execution_id": "REV-ITR-1-1796256205", "action": "Review Loop iteration 1 reviewer 1 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R1-001-01", "FIND-R1-001-02", "FIND-R1-001-03"], "labels": ["review", "reviewer", "iteration-1"], "error_context": null, "review_reviewer_index": 1, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 2, "nit": 1}, "created_at": "2026-12-03T00:03:25.726758Z"} +{"action_id": "ACT-FIND-1796256205-cd834abf", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R1-001-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R1-001-01"], "labels": ["review", "finding", "iteration-1"], "error_context": "test_preflight.py grows from 873 to 1,200 lines, past the 1,000-line limit; move the new image-commit tests into tests/test_preflight_image_commit.py.", "review_reviewer_index": 1, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 876, "created_at": "2026-12-03T00:03:25.728077Z"} +{"action_id": "ACT-FIND-1796256205-3134b8ae", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R1-001-02", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R1-001-02"], "labels": ["review", "finding", "iteration-1"], "error_context": "Exported SOURCE_COMMIT overlays the environment of docker buildx bake, but the change does not list the affected child processes as the environment-overlay rule requires.", "review_reviewer_index": 1, "review_file": "apps/sandbox-executor/build_all_images.sh", "review_line": 88, "created_at": "2026-12-03T00:03:25.728848Z"} +{"action_id": "ACT-FIND-1796256205-e3a5e8b4", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R1-001-03", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R1-001-03"], "labels": ["review", "finding", "iteration-1"], "error_context": "Any git diff failure, including an image commit missing from the local clone, is reported as build inputs that 'differ'; report it as unresolved instead.", "review_reviewer_index": 1, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py", "review_line": 79, "created_at": "2026-12-03T00:03:25.729843Z"} +{"action_id": "ACT-REV-1796256205-a96f0190", "execution_id": "REV-ITR-1-1796256205", "action": "Review Loop iteration 1 reviewer 2 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R2-001-01", "FIND-R2-001-02", "FIND-R2-001-03"], "labels": ["review", "reviewer", "iteration-1"], "error_context": null, "review_reviewer_index": 2, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 2, "nit": 1}, "created_at": "2026-12-03T00:03:25.731396Z"} +{"action_id": "ACT-FIND-1796256205-db8ca987", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R2-001-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R2-001-01"], "labels": ["review", "finding", "iteration-1"], "error_context": "test_preflight.py grows from 870 to 1,200 lines, past the 1,000-line limit; move the image-commit tests into tests/test_preflight_image_commit.py.", "review_reviewer_index": 2, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 876, "created_at": "2026-12-03T00:03:25.732567Z"} +{"action_id": "ACT-FIND-1796256205-ecab55b4", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R2-001-02", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R2-001-02"], "labels": ["review", "finding", "iteration-1"], "error_context": "The exported SOURCE_COMMIT env overlay is inherited by docker buildx bake, but the change does not list the affected child processes.", "review_reviewer_index": 2, "review_file": "apps/sandbox-executor/build_all_images.sh", "review_line": 88, "created_at": "2026-12-03T00:03:25.733353Z"} +{"action_id": "ACT-FIND-1796256205-35d76086", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R2-001-03", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R2-001-03"], "labels": ["review", "finding", "iteration-1"], "error_context": "Any git diff failure, including an image commit absent from host history, is reported as build inputs that 'differ'; report the unknown commit separately.", "review_reviewer_index": 2, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py", "review_line": 78, "created_at": "2026-12-03T00:03:25.733985Z"} +{"action_id": "ACT-REV-1796256205-949d82e3", "execution_id": "REV-ITR-1-1796256205", "action": "Review Loop iteration 1 reviewer 3 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-01", "FIND-R3-001-02", "FIND-R3-001-03", "FIND-R3-001-04"], "labels": ["review", "reviewer", "iteration-1"], "error_context": null, "review_reviewer_index": 3, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 2, "nit": 2}, "created_at": "2026-12-03T00:03:25.735385Z"} +{"action_id": "ACT-FIND-1796256205-c54fe058", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-01"], "labels": ["review", "finding", "iteration-1"], "error_context": "test_preflight.py grows from 870 to 1,200 lines, crossing 1,000; move the new image-commit tests into their own test module.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 876, "created_at": "2026-12-03T00:03:25.737076Z"} +{"action_id": "ACT-FIND-1796256205-73c9d076", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-02", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-02"], "labels": ["review", "finding", "iteration-1"], "error_context": "The exported SOURCE_COMMIT reaches the docker buildx bake child, but the change does not list the affected child processes (a test exists).", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/build_all_images.sh", "review_line": 88, "created_at": "2026-12-03T00:03:25.737850Z"} +{"action_id": "ACT-FIND-1796256205-e9b1ae14", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-03", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-03"], "labels": ["review", "finding", "iteration-1"], "error_context": "The stale-image hint says 'make build', but the Makefile target is 'build-images'.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight.py", "review_line": 40, "created_at": "2026-12-03T00:03:25.738637Z"} +{"action_id": "ACT-FIND-1796256205-dfaa418c", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-04", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-04"], "labels": ["review", "finding", "iteration-1"], "error_context": "A git diff failure (for example, an image commit missing locally) is reported as 'build inputs differ'; describe the unresolvable-commit case accurately.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight_image_commit.py", "review_line": 81, "created_at": "2026-12-03T00:03:25.739446Z"} +{"action_id": "ACT-FIND-1796256205-701570c9", "execution_id": "REV-FIND-1-1796256205", "action": "Review Loop iteration 1 finding detected: FIND-CI-001", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-CI-001"], "labels": ["review", "finding", "iteration-1"], "error_context": "Findings detected: ['FIND-CI-001', 'FIND-R1-001-01', 'FIND-R1-001-02', 'FIND-R1-001-03', 'FIND-R2-001-01', 'FIND-R2-001-02', 'FIND-R2-001-03', 'FIND-R3-001-01', 'FIND-R3-001-02', 'FIND-R3-001-03', 'FIND-R3-001-04']", "created_at": "2026-12-03T00:03:25.740225Z"} +{"action_id": "ACT-RES-1796257317-b8459eb1", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding R1-F2 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["R1-F2"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-3134b8ae", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.008420Z"} +{"action_id": "ACT-RES-1796257317-3b59f75c", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding R1-F3 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["R1-F3"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-e3a5e8b4", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.009215Z"} +{"action_id": "ACT-RES-1796257317-94323119", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding R2-F2 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["R2-F2"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-ecab55b4", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.009648Z"} +{"action_id": "ACT-RES-1796257317-475520b1", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding R2-F3 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["R2-F3"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-35d76086", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.010020Z"} +{"action_id": "ACT-RES-1796257317-3e17f25c", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding R3-F2 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["R3-F2"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-73c9d076", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.010395Z"} +{"action_id": "ACT-RES-1796257317-60f377a9", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding R3-F3 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["R3-F3"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-e9b1ae14", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.010758Z"} +{"action_id": "ACT-RES-1796257317-5bf2b102", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding R3-F4 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["R3-F4"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-dfaa418c", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.011123Z"} +{"action_id": "ACT-RES-1796257317-0edb3015", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding FIND-CI-001 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-CI-001"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-701570c9", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.011425Z"} From a1d76cea57d9dcaf8de1acbedd9ac826045f130a Mon Sep 17 00:00:00 2001 From: Holon Review Loop Agent Date: Thu, 3 Dec 2026 11:27:35 +1100 Subject: [PATCH 10/10] chore(review): record review ledger rows (iteration 2) Action-Origin: pr_review Review-Iteration: 2 --- ...I-1796253987-hac-image-source-commit-label.jsonl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl b/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl index b5d2b4ff8..a5661c649 100644 --- a/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl +++ b/holon-knowledge/ledger/pending/executions/I-1796253987-hac-image-source-commit-label.jsonl @@ -41,3 +41,16 @@ {"action_id": "ACT-RES-1796257317-60f377a9", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding R3-F3 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["R3-F3"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-e9b1ae14", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.010758Z"} {"action_id": "ACT-RES-1796257317-5bf2b102", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding R3-F4 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["R3-F4"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-dfaa418c", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.011123Z"} {"action_id": "ACT-RES-1796257317-0edb3015", "execution_id": "REV-RES-1-1796257317", "action": "Review Loop iteration 1 finding FIND-CI-001 adjudicated: applied", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 1, "review_finding_ids": ["FIND-CI-001"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796256205-701570c9", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:21:57.011425Z"} +{"action_id": "ACT-REV-1796257506-a2055b8e", "execution_id": "REV-ITR-2-1796257506", "action": "Review Loop iteration 2 reviewer 1 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R1-002-01"], "labels": ["review", "reviewer", "iteration-2"], "error_context": null, "review_reviewer_index": 1, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 1, "nit": 0}, "created_at": "2026-12-03T00:25:06.139627Z"} +{"action_id": "ACT-FIND-1796257506-0197c1b8", "execution_id": "REV-FIND-2-1796257506", "action": "Review Loop iteration 2 finding detected: FIND-R1-002-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R1-002-01"], "labels": ["review", "finding", "iteration-2"], "error_context": "R1-F1/R2-F1/R3-F1 not fixed: test_preflight.py grows further to 1,215 lines (870 before the change), past the 1,000-line limit; move the image-commit tests into tests/test_preflight_image_commit.py.", "review_reviewer_index": 1, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 1112, "created_at": "2026-12-03T00:25:06.150726Z"} +{"action_id": "ACT-REV-1796257506-2d348e0b", "execution_id": "REV-ITR-2-1796257506", "action": "Review Loop iteration 2 reviewer 2 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R2-002-01"], "labels": ["review", "reviewer", "iteration-2"], "error_context": null, "review_reviewer_index": 2, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 1, "nit": 0}, "created_at": "2026-12-03T00:25:06.158508Z"} +{"action_id": "ACT-FIND-1796257506-7f67ea00", "execution_id": "REV-FIND-2-1796257506", "action": "Review Loop iteration 2 finding detected: FIND-R2-002-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R2-002-01"], "labels": ["review", "finding", "iteration-2"], "error_context": "test_preflight.py grows again (1,200 to 1,215 lines), past the 1,000-line limit, so R1-F1/R2-F1/R3-F1 are unresolved; move the image-commit tests into tests/test_preflight_image_commit.py.", "review_reviewer_index": 2, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 1112, "created_at": "2026-12-03T00:25:06.166913Z"} +{"action_id": "ACT-REV-1796257506-30df950c", "execution_id": "REV-ITR-2-1796257506", "action": "Review Loop iteration 2 reviewer 3 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R3-002-01"], "labels": ["review", "reviewer", "iteration-2"], "error_context": null, "review_reviewer_index": 3, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 1, "nit": 0}, "created_at": "2026-12-03T00:25:06.172327Z"} +{"action_id": "ACT-FIND-1796257506-739bd0e5", "execution_id": "REV-FIND-2-1796257506", "action": "Review Loop iteration 2 finding detected: FIND-R3-002-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R3-002-01"], "labels": ["review", "finding", "iteration-2"], "error_context": "test_preflight.py grows from 1,200 to 1,215 lines, past the 1,000-line limit; the requested move of the image-commit tests to tests/test_preflight_image_commit.py was not done.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 1112, "created_at": "2026-12-03T00:25:06.181040Z"} +{"action_id": "ACT-REV-1796257629-d7472720", "execution_id": "REV-ITR-2-1796257629", "action": "Review Loop iteration 2 evaluation for I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R1-002-01", "FIND-R2-002-01", "FIND-R3-002-01"], "labels": ["review", "review-loop", "iteration-2"], "error_context": "Findings detected: ['FIND-R1-002-01', 'FIND-R2-002-01', 'FIND-R3-002-01']", "created_at": "2026-12-03T00:27:09.190683Z"} +{"action_id": "ACT-REV-1796257629-b53316e5", "execution_id": "REV-ITR-2-1796257629", "action": "Review Loop iteration 2 reviewer 1 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R1-002-01"], "labels": ["review", "reviewer", "iteration-2"], "error_context": null, "review_reviewer_index": 1, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 1, "nit": 0}, "created_at": "2026-12-03T00:27:09.191696Z"} +{"action_id": "ACT-FIND-1796257629-ce86dc8a", "execution_id": "REV-FIND-2-1796257629", "action": "Review Loop iteration 2 finding detected: FIND-R1-002-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R1-002-01"], "labels": ["review", "finding", "iteration-2"], "error_context": "R1-F1/R2-F1/R3-F1 not fixed: test_preflight.py grows further to 1,215 lines (870 before the change), past the 1,000-line limit; move the image-commit tests into tests/test_preflight_image_commit.py.", "review_reviewer_index": 1, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 1112, "created_at": "2026-12-03T00:27:09.192433Z"} +{"action_id": "ACT-REV-1796257629-aadaaa0c", "execution_id": "REV-ITR-2-1796257629", "action": "Review Loop iteration 2 reviewer 2 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R2-002-01"], "labels": ["review", "reviewer", "iteration-2"], "error_context": null, "review_reviewer_index": 2, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 1, "nit": 0}, "created_at": "2026-12-03T00:27:09.193350Z"} +{"action_id": "ACT-FIND-1796257629-562f506f", "execution_id": "REV-FIND-2-1796257629", "action": "Review Loop iteration 2 finding detected: FIND-R2-002-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R2-002-01"], "labels": ["review", "finding", "iteration-2"], "error_context": "test_preflight.py grows again (1,200 to 1,215 lines), past the 1,000-line limit, so R1-F1/R2-F1/R3-F1 are unresolved; move the image-commit tests into tests/test_preflight_image_commit.py.", "review_reviewer_index": 2, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 1112, "created_at": "2026-12-03T00:27:09.194190Z"} +{"action_id": "ACT-REV-1796257629-19eb25b7", "execution_id": "REV-ITR-2-1796257629", "action": "Review Loop iteration 2 reviewer 3 completed", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R3-002-01"], "labels": ["review", "reviewer", "iteration-2"], "error_context": null, "review_reviewer_index": 3, "review_agent": "claude-agent", "review_model": "claude-opus-5-5", "review_status": "COMPLETED", "review_verdict": "CHANGES_REQUESTED", "review_counts": {"critical": 0, "important": 1, "nit": 0}, "created_at": "2026-12-03T00:27:09.195094Z"} +{"action_id": "ACT-FIND-1796257629-7cccc276", "execution_id": "REV-FIND-2-1796257629", "action": "Review Loop iteration 2 finding detected: FIND-R3-002-01", "category": "code", "target": "I-1796253987-hac-image-source-commit-label/P-1796254010-CLA-CO5.5/E-1796254347-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "important", "review_iteration": 2, "review_finding_ids": ["FIND-R3-002-01"], "labels": ["review", "finding", "iteration-2"], "error_context": "test_preflight.py grows from 1,200 to 1,215 lines, past the 1,000-line limit; the requested move of the image-commit tests to tests/test_preflight_image_commit.py was not done.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/tests/test_preflight.py", "review_line": 1112, "created_at": "2026-12-03T00:27:09.195837Z"}