From ff372bbbf1b04466fce094f25a00ed95941c627f Mon Sep 17 00:00:00 2001 From: Holon Intent Agent Date: Wed, 2 Dec 2026 23:26:31 +0000 Subject: [PATCH 01/12] intent: created I-1796253983-hac-model-scoped-cooldown/_ Description: sync_cooldown_for_result in apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py currently writes provider-wide cooldown markers for all QUOTA_EXHAUSTED preflight failures, causing a claude-fable-5-2 monthly spend limit to block healthy fallback models such as claude-opus-5-5 for 300s. Goal: Classify org/account-wide spend limits as provider-scoped cooldowns and per-model spend/rate limits (including messages telling the user to switch to another model) as (provider, model)-scoped cooldowns using model_marker_path/record_model_cooldown/read_active_model_cooldown in apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py. Ensure a claude-fable-5-2 monthly spend limit blocks claude-fable-5-2 without blocking claude-opus-5-5, while an org-level spend limit still blocks all models for that provider. Add regression tests in apps/sandbox-executor/tests/test_preflight_cooldown.py. Verify with uv run task lint and 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:31Z --- .../pending/intents/I-1796253983-hac-model-scoped-cooldown.jsonl | 1 + 1 file changed, 1 insertion(+) create mode 100644 holon-knowledge/ledger/pending/intents/I-1796253983-hac-model-scoped-cooldown.jsonl diff --git a/holon-knowledge/ledger/pending/intents/I-1796253983-hac-model-scoped-cooldown.jsonl b/holon-knowledge/ledger/pending/intents/I-1796253983-hac-model-scoped-cooldown.jsonl new file mode 100644 index 000000000..c4ca492fb --- /dev/null +++ b/holon-knowledge/ledger/pending/intents/I-1796253983-hac-model-scoped-cooldown.jsonl @@ -0,0 +1 @@ +{"slug": "hac-model-scoped-cooldown", "target_branch": "main", "description": "sync_cooldown_for_result in apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py currently writes provider-wide cooldown markers for all QUOTA_EXHAUSTED preflight failures, causing a claude-fable-5-2 monthly spend limit to block healthy fallback models such as claude-opus-5-5 for 300s.", "goal": "Classify org/account-wide spend limits as provider-scoped cooldowns and per-model spend/rate limits (including messages telling the user to switch to another model) as (provider, model)-scoped cooldowns using model_marker_path/record_model_cooldown/read_active_model_cooldown in apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py. Ensure a claude-fable-5-2 monthly spend limit blocks claude-fable-5-2 without blocking claude-opus-5-5, while an org-level spend limit still blocks all models for that provider. Add regression tests in apps/sandbox-executor/tests/test_preflight_cooldown.py. Verify with uv run task lint and uv run pytest. Code is self-explaining: no docstrings and no comments except '# why:' comments that record a reason the code cannot show.", "rationale": "Eliminates false 300s lockouts of healthy fallback models during claude-agent auto-fallback and preflight probes.", "scope": ["apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py", "apps/sandbox-executor/tests/test_preflight_cooldown.py"], "acceptance_criteria": ["In preflight_cooldown.py, a claude-fable-5-2 \"You've hit your monthly spend limit. Switch to another model to continue.\" probe writes a model-scoped cooldown that blocks claude-fable-5-2 without blocking claude-opus-5-5.", "An org-level spend limit (\"org's monthly spend limit\" / \"organization spending limit\") still blocks all models for that provider.", "Regression tests in test_preflight_cooldown.py pass under uv run pytest."], "assumptions": [{"id": "A1", "statement": "model_marker_path, record_model_cooldown, and read_active_model_cooldown already exist in preflight_cooldown.py and only sync_cooldown_for_result needs scope classification (inspected preflight_cooldown.py and test_preflight_cooldown.py on origin/main).", "impact": "high"}, {"id": "A2", "statement": "Existing callers (preflight.py, preflight_outage.py) only call sync_cooldown_for_result and active_cooldown_result without changing their signatures.", "impact": "medium"}], "assumption_validation": [{"assumption_id": "A1", "method": "Verified directly in preflight_cooldown.py; Stage 3 runs pytest on test_preflight_cooldown.py and test_preflight_outage.py."}, {"assumption_id": "A2", "method": "Grepped all callers of sync_cooldown_for_result on origin/main; Stage 3 runs full unit suite."}], "assumption_risk": [{"assumption_id": "A1", "likelihood": "low", "testability": "testable", "score": 1, "response": "Keep provider-wide marker fallback intact for ambiguous or org-level quota strings."}, {"assumption_id": "A2", "likelihood": "low", "testability": "testable", "score": 1, "response": "Keep public function signatures backwards-compatible."}], "branch": "I-1796253983-hac-model-scoped-cooldown", "status": "proposed", "created_at": "2026-12-02T23:26:31.021Z"} From acb484f8b7b548cf39b6aa4506fd6fc62894fb6d Mon Sep 17 00:00:00 2001 From: Holon Planner Agent Date: Wed, 2 Dec 2026 23:28:52 +0000 Subject: [PATCH 02/12] plan: P-1796254006-CLA-CO5.5 created by claude-agent (claude-opus-5-5) --- ...1796253983-hac-model-scoped-cooldown.jsonl | 1 + .../P-1796254006-CLA-CO5.5.md | 404 ++++++++++++++++++ 2 files changed, 405 insertions(+) create mode 100644 holon-knowledge/ledger/pending/plans/I-1796253983-hac-model-scoped-cooldown.jsonl create mode 100644 plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5.md diff --git a/holon-knowledge/ledger/pending/plans/I-1796253983-hac-model-scoped-cooldown.jsonl b/holon-knowledge/ledger/pending/plans/I-1796253983-hac-model-scoped-cooldown.jsonl new file mode 100644 index 000000000..cf142f7d4 --- /dev/null +++ b/holon-knowledge/ledger/pending/plans/I-1796253983-hac-model-scoped-cooldown.jsonl @@ -0,0 +1 @@ +{"plan_id": "P-1796254006-CLA-CO5.5", "intent_branch": "I-1796253983-hac-model-scoped-cooldown/_", "agent": "claude-agent", "agent_version": "2.1.302", "model": "claude-opus-5-5", "p_success": 0.86, "entropy": 4.0, "impact": 70.0, "cost": 14.0, "learning_value": 4.0, "ev": 47.0, "created_at": "2026-12-02T23:28:50.841Z", "plan_file": "plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5.md", "status": "proposed", "entropy_budget": 15.0, "decomposition_decision": "execute", "touch_set": [{"path": "apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py"}, {"path": "apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py"}, {"path": "apps/sandbox-executor/tests/test_preflight_cooldown.py"}]} diff --git a/plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5.md b/plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5.md new file mode 100644 index 000000000..e4a5ae21a --- /dev/null +++ b/plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5.md @@ -0,0 +1,404 @@ +# Plan for I-1796253983-hac-model-scoped-cooldown + +- **Plan ID:** P-1796254006-CLA-CO5.5 +- **Parent Intent ID:** NONE +- **Agent:** claude-agent/claude-opus-5-5 (version: 2.1.302) +- **Created At:** 2026-12-02T23:26:47.510Z + +## Planner Autonomy Summary + +- **Intent handling:** ACCEPT_AS_IS (with one minimal scope expansion: a focused classifier module, see + `## Scope Expansion`) +- **Reframed intent (if applicable):** N/A +- **Exploration stance:** conservative. The fix is a narrow, well-understood behaviour change on top of existing + model-scoped marker primitives, so exploitation of the existing API gives the highest EV. +- **Safety priority level:** standard +- **Priority Justification:** No credential, ledger, git-flow or sandbox boundary is touched. The only safety-relevant + property is fail-safe classification: ambiguous quota output must keep the existing provider-wide cooldown so we never + under-block a genuinely exhausted provider (constraints.md section 4 model routing stays intact; redaction of marker + excerpts is reused unchanged). + +## Exploration + +- **Proportion of steps that are exploratory:** 0.0 +- **Justification:** The marker primitives (`model_marker_path`, `record_model_cooldown`, `read_active_model_cooldown`, + `clear_model_cooldown`) already exist and `active_cooldown_result` already consults the model marker (verified in + `preflight_cooldown.py`, assumption A1 confirmed). Only the write-side classification is missing. + +## Overall Plan Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.86 | +| entropy_pred | 4.0 | +| impact_pred | 70.0 | +| cost_pred | 14.0 | +| learning_value_pred | 4.0 | +| ev_pred | 47.0 | + +### Strategy Rationale + +The bug is a single write-side decision: `sync_cooldown_for_result` always calls `record_cooldown` (provider marker +`claude.json`) for every non-cooldown `QUOTA_EXHAUSTED` result. The read side (`active_cooldown_result`) already checks +both the provider marker and the `(provider, model)` marker, and the success path already clears both. So the minimal +correct change is: classify the quota output text, then write either a provider marker or a model marker. + +Key observed constraint: `preflight_cooldown.py` is 332 lines against the frozen `default_max_lines` of 350 in +`holon-config/hygiene/module_budgets.json` (no override for it). Two regex constants plus a classifier function plus the +wiring would push it past 350 and fail `uv run task lint`. Therefore the classifier goes into a new focused module +`apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py` (owns "what scope does this quota text describe"), +and `preflight_cooldown.py` grows by only about five lines. This module is declared under `## Scope Expansion` so the +plan scope guard accepts it. + +Classification rules (fail-safe ordering): + +1. Empty or missing model on the result: provider scope (cannot key a model marker). +2. Account-wide wording wins: `org`, `org's`, `organization`/`organisation`, `account`, `workspace`, `billing` adjacent + to a limit phrase, so "org's monthly spend limit" and "Organization spending limit reached" stay provider-wide even + if the message also suggests switching models. +3. Model-scoped wording: "switch to another/a different model", "for this model", "model spend/rate/usage limit", + "per-model limit". Produces a model marker. +4. Anything else (HTTP 429, generic "quota exceeded", "usage limit reached"): provider scope, preserving today's + behaviour and the existing `http-429` / `org-spend-limit` parametrised test. + +Aggregation: `p_success` is the product-ish bottleneck of the four sequential steps tempered by their strong correlation +(same small diff): `0.92 * 0.95 * 0.97 * 0.995 ~= 0.84`, rounded to 0.86 because steps 2 and 3 share most failure modes +with step 1. Entropy is the sum of step entropies `1.5 + 1.0 + 1.0 + 0.5 = 4.0`. Cost is the sum `4 + 3 + 4 + 3 = 14`. +Impact is judged at plan level (removes false 300 s lockouts of every fallback model during claude-agent auto-fallback, +which today can stall whole flows), learning value is the max-plus-small-bonus of the steps. Bottleneck step: Step 1 +(classifier correctness against real provider wording). + +`EV = P(success) * Impact + mu * LearningValue - lambda * Delta_S_intent - Cost` + +`EV = 0.86 * 70.0 + 0.5 * 4.0 - 0.3 * 4.0 - 14.0 = 60.2 + 2.0 - 1.2 - 14.0 = 47.0` + +## Safety & Constraint Alignment + +- **Key world ruleset constraints that affect this plan:** + - `holon-config/world/constraints.md` section 1 (commit boundaries: changes stay on this plan's execution branch). + - `holon-config/hygiene/module_budgets.json` frozen budget (350 default) -> new focused module instead of growing + `preflight_cooldown.py` past budget; the budget file is not touched. + - Self-explaining code gate (`scripts/check_self_explaining.py`): no docstrings, no comments other than `# why:`. + - Ruff complexity limits (`C901 <= 10`, `PLR0912 <= 12`, `PLR0913 <= 5`, `PLR0915 <= 50`), no new `# noqa`. + - `docs/safety.md` blast-radius containment: behaviour change is limited to which marker file is written. +- **Potential violations or edge cases:** + - Under-blocking: an org-wide limit misclassified as model-scoped would let fallback probes hammer an exhausted + provider (each probe then fails and writes its own model marker, so damage is bounded to one probe per model). + - Over-blocking (today's bug) persists if real provider wording does not match the model-scoped patterns. + - Import-layering test `test_modules_below_preflight_never_import_preflight` and the import-cycle ratchet: the new + module must import nothing from `sandbox_executor.preflight`. + - No environment, cwd or git-config overlay is changed, so the Environment Overlay Discipline does not apply (no child + processes affected). +- **Mitigations built into the plan:** + - Account-wide patterns are evaluated before model-scoped ones; unknown text defaults to provider scope. + - Existing tests for provider markers (`org-spend-limit`, `http-429`, `test_cooldown_is_isolated_per_provider`) must + stay green unchanged. + - New module is pure (only `re`/`enum`), no I/O. +- **Residual risk accepted (and why):** Provider wording can change; patterns are conservative and the failure mode is + today's behaviour (provider-wide lockout), which is safe. +- **Allocated Entropy Budget:** 15.0 +- **Predicted Plan Entropy:** 4.0 +- **Budget Compliance:** The strategy fits within budget (4.0 <= 15.0); executed as one plan, no sub-intents. + +## Plan Description & Strategy + +Add a pure quota-scope classifier in a new module, wire `sync_cooldown_for_result` to write a model marker for +model-scoped quota text and a provider marker otherwise, add regression tests (fable monthly spend limit with +switch-model hint blocks only fable; org-level spend limits block every model; ambiguous text stays provider-wide), then +run the affected tests, lint, and the full suite once in the foreground. + +## Touch Set + +- `apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py` +- `apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py` +- `apps/sandbox-executor/tests/test_preflight_cooldown.py` + +## Scope Expansion + +- `apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py` — `preflight_cooldown.py` is at 332 of its + frozen 350-line budget, so the quota-scope classifier must live in its own focused module to keep `uv run task lint` + green without touching `module_budgets.json`. + +--- + +## Step 1: Add the pure quota-scope classifier module + +- **Sub‑intent recommendation:** NO +- **Reasoning:** About 30 lines of pure, deterministic code with no I/O; too small and too coupled to the wiring step to + justify a separate branch and evaluation. +- **Step Type:** IMPLEMENTATION +- **Exploration level:** EXPLOIT + +### Intent & Git Integration + +- **Step Intent:** Provide a single function that decides whether a `QUOTA_EXHAUSTED` output describes a provider-wide + (org/account) limit or a single-model limit. +- **Git branch:** I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-{timestamp}-CLA-CO5.5/\_ +- **Sub‑intent:** NONE + +### Implementation Details (No code blocks, only logic/steps) + +1. Create `apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py` starting with + `from __future__ import annotations`, importing only `re` and `enum.StrEnum` (or `Enum`). +2. Define `QuotaScope` enum with members `PROVIDER = "provider"` and `MODEL = "model"`. +3. Define module constant `_ACCOUNT_WIDE_LIMIT_RE` (case-insensitive) matching account-level owners followed within a + short window (for example up to 40 non-newline characters) by a limit word: owners `\borg\b`, `\borg's`, + `organi[sz]ation`, `\baccount\b`, `\bworkspace\b`, `\bbilling\b`; limit words `limit`, `quota`, `spend`, `spending`, + `budget`. This matches "org's monthly spend limit", "Organization spending limit reached", "org spend limit reached". +4. Define `_MODEL_SCOPED_LIMIT_RE` (case-insensitive) matching any of: `switch to (?:another|a different) model`, + `for this model`, `\bmodel(?:'s)?\s+(?:spend|spending|rate|usage|token)\s+limit`, `per-model\s+limit`. +5. Add `def classify_quota_scope(output: str) -> QuotaScope`: normalise `output or ""`; return `PROVIDER` when the + account-wide regex matches; return `MODEL` when the model-scoped regex matches; otherwise return `PROVIDER`. Add a + single `# why:` comment on the account-wide check explaining that org limits outrank a "switch model" hint because no + other model on the same provider can succeed. +6. No docstrings, no other comments, names in domain language. Keep the module well under 50 lines. + +### Dependencies & Criticality + +- **Depends on:** NONE +- **Is Bottleneck:** YES (p_success_pred 0.92 >= 0.6, so no sub-intent needed) + +### Safety & Constraint Considerations + +- **Relevant rules:** `holon-config/hygiene/module_budgets.json` (new module far below 350), self-explaining gate, + `test_modules_below_preflight_never_import_preflight` layering, import-cycle ratchet. +- **Potential failure modes for this step:** + - Regex too broad (for example "account" inside unrelated text) -> harmless, falls back to provider scope. + - Regex too narrow -> today's over-blocking remains for unmatched wording; caught by Step 3 tests for the intent's + literal strings. +- **Guardrails and early‑abort checks:** Module must import nothing from `sandbox_executor`; abort and reassess if the + classifier needs knowledge of the agent registry (it should not). + +### Success & Discard Criteria + +- **Success:** `classify_quota_scope("You've hit your monthly spend limit. Switch to another model to continue.")` is + `MODEL`; `"org's monthly spend limit"`, `"Organization spending limit reached"`, `"HTTP 429 Too Many Requests"` and + `""` are `PROVIDER`. +- **Discard:** If the classifier cannot separate the intent's literal strings without matching the 429 case, stop and + re-plan (cost above 1.5x `cost_pred`). + +### Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.92 | +| entropy_pred | 1.5 | +| impact_pred | 25.0 | +| cost_pred | 4.0 | +| learning_value_pred | 3.0 | +| ev_pred | 20.05 | + +### Step Metrics Rationale + +New file, pure logic, small surface. `EV = 0.92 * 25.0 + 0.5 * 3.0 - 0.3 * 1.5 - 4.0 = 23.0 + 1.5 - 0.45 - 4.0 = 20.05`. +Learning value 3.0: establishes a reusable vocabulary for quota scope that Stage 2 quota-stop handling may later share. + +--- + +## Step 2: Route `sync_cooldown_for_result` through the classifier + +- **Sub‑intent recommendation:** NO +- **Reasoning:** About five changed lines in one function, signatures unchanged; low risk and inseparable from Step 1. +- **Step Type:** IMPLEMENTATION +- **Exploration level:** EXPLOIT + +### Intent & Git Integration + +- **Step Intent:** Write a `(provider, model)` marker for model-scoped quota results and keep the provider marker for + account-wide or ambiguous results. +- **Git branch:** same execution branch as Step 1 +- **Sub‑intent:** NONE + +### Implementation Details (No code blocks, only logic/steps) + +1. In `preflight_cooldown.py` import `QuotaScope, classify_quota_scope` from `sandbox_executor.preflight_quota_scope`. +2. Add a small private function `_record_quota_cooldown(result, now)`: when `result.model` is non-empty and + `classify_quota_scope(result.output_excerpt)` is `QuotaScope.MODEL`, call + `record_model_cooldown(result.agent, result.model, result.output_excerpt, now=now)`; otherwise call + `record_cooldown(result.agent, result.model, result.output_excerpt, now=now)`. +3. In `sync_cooldown_for_result`, replace the direct `record_cooldown(...)` call with + `_record_quota_cooldown(result, now)`. Leave the `COOLDOWN_HINT_PREFIX` short-circuit and the success-path clearing + of both markers unchanged. +4. Do not change any public signature (`sync_cooldown_for_result`, `active_cooldown_result`, `record_*`, `read_*`); + callers in `preflight.py`, `preflight_outage.py`, `cli/preflight.py` stay untouched (assumption A2 verified by grep). +5. Confirm the file stays at or below 350 lines (expected about 337) with `wc -l`. + +### Dependencies & Criticality + +- **Depends on:** Step 1 +- **Is Bottleneck:** NO + +### Safety & Constraint Considerations + +- **Relevant rules:** module budget 350 for `preflight_cooldown.py`, ruff complexity limits, self-explaining gate. +- **Potential failure modes for this step:** + - `output_excerpt` is redacted/truncated before reaching sync; the switch-model hint sits at the tail of the claude + message so the last-800-character excerpt keeps it. Verified by the Step 3 end-to-end probe test. + - Model aliases: `record_model_cooldown` canonicalises the model, so `fable` and `claude-fable-5-2` share one marker. +- **Guardrails and early‑abort checks:** If `wc -l` exceeds 350, inline the branch into `sync_cooldown_for_result` + rather than moving marker writers into `preflight_quota_scope.py`, which must stay a pure classifier. + +### Success & Discard Criteria + +- **Success:** All pre-existing tests in `test_preflight_cooldown.py` and `test_preflight_outage.py` still pass. +- **Discard:** Any caller signature change becomes necessary -> stop and re-plan. + +### Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.95 | +| entropy_pred | 1.0 | +| impact_pred | 20.0 | +| cost_pred | 3.0 | +| learning_value_pred | 2.0 | +| ev_pred | 16.7 | + +### Step Metrics Rationale + +Mechanical wiring with existing primitives. +`EV = 0.95 * 20.0 + 0.5 * 2.0 - 0.3 * 1.0 - 3.0 = 19.0 + 1.0 - 0.3 - 3.0 = 16.7`. High probability because it reuses +already-tested read, write and clear paths. + +--- + +## Step 3: Add regression tests in `test_preflight_cooldown.py` + +- **Sub‑intent recommendation:** NO +- **Reasoning:** Tests are the acceptance evidence for this intent and live in a single existing file. +- **Step Type:** TEST +- **Exploration level:** EXPLOIT + +### Intent & Git Integration + +- **Step Intent:** Lock in that a fable monthly spend limit blocks only fable, and org-level spend limits still block + all claude models. +- **Git branch:** same execution branch as Step 1 +- **Sub‑intent:** NONE + +### Implementation Details (No code blocks, only logic/steps) + +1. Import `classify_quota_scope` and `QuotaScope` from `sandbox_executor.preflight_quota_scope`. +2. Parametrised unit test of `classify_quota_scope`: "You've hit your monthly spend limit. Switch to another model to + continue." -> `MODEL`; "Rate limit for this model exceeded" -> `MODEL`; "You've hit your org's monthly spend limit" + -> `PROVIDER`; "Organization spending limit reached" -> `PROVIDER`; "org's monthly spend limit. Switch to another + model to continue." -> `PROVIDER`; "HTTP 429 Too Many Requests" -> `PROVIDER`; "" -> `PROVIDER`. +3. Test using `isolated_cooldown_home`: build a `PreflightResult` with `status=QUOTA_EXHAUSTED`, `agent="claude-agent"`, + `model="claude-fable-5-2"`, the fable switch-model text as `output_excerpt`, an empty hint; call + `sync_cooldown_for_result`; assert `read_active_model_cooldown("claude-agent", "claude-fable-5-2")` is not None, + `read_active_cooldown("claude-agent")` is None, `active_cooldown_result("claude-agent", "claude-fable-5-2")` is not + None and `active_cooldown_result("claude-agent", "claude-opus-5-5")` is None. +4. Parametrised test over the two org phrasings ("You've hit your org's monthly spend limit", "Organization spending + limit reached") with `model="claude-fable-5-2"`: after sync, `marker_path("claude-agent")` exists and + `active_cooldown_result` is not None for `claude-fable-5-2`, `claude-opus-5-5` and `claude-sonnet-4-6`. +5. End-to-end probe test mirroring `test_run_preflight_probe_records_short_circuits_resumes_and_clears`: patch + `preflight_cooldown.time.time`, failing runner returns the fable switch-model text on stderr for + `run_preflight_probe("claude-agent", "claude-fable-5-2", ...)`; then an OK runner for `claude-opus-5-5` must be + invoked (call_count 1) and return ok, while a second `claude-fable-5-2` probe short-circuits with the cooldown hint + and zero runner calls. Confirm the fable model id is accepted by `run_preflight_probe` (registry check); if the + registry rejects `claude-fable-5-2`, use the canonical fable id from `agent_defaults` and keep the sync-level test in + item 3 with the literal id. +6. Leave every existing test unchanged; no docstrings or comments in the tests. + +### Dependencies & Criticality + +- **Depends on:** Step 2 +- **Is Bottleneck:** NO + +### Safety & Constraint Considerations + +- **Relevant rules:** hermetic tests (`isolated_cooldown_home` sets `HOME` to `tmp_path`, never touches the real + `~/.holon`), no network, self-explaining gate on added lines. +- **Potential failure modes for this step:** + - Model id normalisation rejects or rewrites `claude-fable-5-2` -> mitigated in item 5. + - Output redaction alters the switch-model phrase -> would surface as a failing item 5 test, fix by classifying on the + redacted excerpt that the sync path actually sees (already the design). +- **Guardrails and early‑abort checks:** Run + `uv run pytest apps/sandbox-executor/tests/test_preflight_cooldown.py apps/sandbox-executor/tests/test_preflight_outage.py` + in the foreground immediately after writing the tests. + +### Success & Discard Criteria + +- **Success:** New and existing tests in both files pass. +- **Discard:** More than two fix iterations on the classifier regexes -> re-plan the pattern set. + +### Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.93 | +| entropy_pred | 1.0 | +| impact_pred | 15.0 | +| cost_pred | 4.0 | +| learning_value_pred | 2.0 | +| ev_pred | 10.65 | + +### Step Metrics Rationale + +`EV = 0.93 * 15.0 + 0.5 * 2.0 - 0.3 * 1.0 - 4.0 = 13.95 + 1.0 - 0.3 - 4.0 = 10.65`. Slight uncertainty from model-id +normalisation of the fable id in the end-to-end probe path. + +--- + +## Step 4: Verify with lint, affected tests, then the full suite once + +- **Sub‑intent recommendation:** NO +- **Reasoning:** Verification only; no new code. +- **Step Type:** TEST +- **Exploration level:** EXPLOIT + +### Intent & Git Integration + +- **Step Intent:** Prove the change satisfies lint, module budgets, self-explaining gate, complexity limits and the full + unit suite. +- **Git branch:** same execution branch as Step 1 +- **Sub‑intent:** NONE + +### Implementation Details (No code blocks, only logic/steps) + +1. Foreground: + `uv run pytest apps/sandbox-executor/tests/test_preflight_cooldown.py apps/sandbox-executor/tests/test_preflight_outage.py apps/sandbox-executor/tests/test_preflight.py`. +2. Foreground: `uv run task lint` (ruff, ruff format, module budgets, self-explaining gate, import-cycle checks). Fix + any formatting with ruff format only on touched files. +3. Foreground, once: `uv run task test` for the full suite. No repeated runs (the intent has no timing requirement). +4. Record pass/fail counts and pytest-reported time in the execution notes. + +### Dependencies & Criticality + +- **Depends on:** Step 3 +- **Is Bottleneck:** NO + +### Safety & Constraint Considerations + +- **Relevant rules:** Test-Run Discipline (foreground only, full suite once), module budget freeze. +- **Potential failure modes for this step:** unrelated flaky test in the full suite; lint failure from line length or + import ordering. +- **Guardrails and early‑abort checks:** If an unrelated test fails, rerun only that test once to distinguish flake from + regression and record the outcome; never edit `module_budgets.json`. + +### Success & Discard Criteria + +- **Success:** `uv run task lint` exits 0; affected tests and `uv run task test` pass. +- **Discard:** A failure attributable to this diff that cannot be fixed within the touch set -> stop and report. + +### Metrics + +| metric | value | +| ------------------- | ----- | +| p_success_pred | 0.90 | +| entropy_pred | 0.5 | +| impact_pred | 10.0 | +| cost_pred | 3.0 | +| learning_value_pred | 1.0 | +| ev_pred | 6.35 | + +### Step Metrics Rationale + +`EV = 0.90 * 10.0 + 0.5 * 1.0 - 0.3 * 0.5 - 3.0 = 9.0 + 0.5 - 0.15 - 3.0 = 6.35`. The 0.10 failure mass is mostly +unrelated suite flakiness and lint formatting nits, both cheap to resolve. + +--- + +## Sub-intent list + +None From 27ea1bb4c6884053e5634b08a540bbee13ff697f Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:29:49 +0000 Subject: [PATCH 03/12] step 1: add quota-scope classifier --- .../sandbox_executor/preflight_quota_scope.py | 33 +++++++++++++++++++ executions/E-1796254161-CLA-CO5.5.md | 19 +++++++++++ 2 files changed, 52 insertions(+) create mode 100644 apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py create mode 100644 executions/E-1796254161-CLA-CO5.5.md diff --git a/apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py b/apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py new file mode 100644 index 000000000..dfbf4533e --- /dev/null +++ b/apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py @@ -0,0 +1,33 @@ +from __future__ import annotations + +import re +from enum import StrEnum + + +class QuotaScope(StrEnum): + PROVIDER = "provider" + MODEL = "model" + + +_ACCOUNT_WIDE_LIMIT_RE = re.compile( + r"(?:\borg\b|\borg's|organi[sz]ation|\baccount\b|\bworkspace\b|\bbilling\b)[^\n]{0,40}?" + r"(?:limit|quota|spend|spending|budget)", + re.IGNORECASE, +) +_MODEL_SCOPED_LIMIT_RE = re.compile( + r"switch\s+to\s+(?:another|a\s+different)\s+model" + r"|for\s+this\s+model" + r"|\bmodel(?:'s)?\s+(?:spend|spending|rate|usage|token)\s+limit" + r"|per-model\s+limit", + re.IGNORECASE, +) + + +def classify_quota_scope(output: str) -> QuotaScope: + text = output or "" + # why: an org or account limit outranks a "switch model" hint because no other model on the provider can succeed. + if _ACCOUNT_WIDE_LIMIT_RE.search(text): + return QuotaScope.PROVIDER + if _MODEL_SCOPED_LIMIT_RE.search(text): + return QuotaScope.MODEL + return QuotaScope.PROVIDER diff --git a/executions/E-1796254161-CLA-CO5.5.md b/executions/E-1796254161-CLA-CO5.5.md new file mode 100644 index 000000000..af2430f0f --- /dev/null +++ b/executions/E-1796254161-CLA-CO5.5.md @@ -0,0 +1,19 @@ +# Execution Record: E-1796254161-CLA-CO5.5 + +## Summary + +Implements plan `P-1796254006-CLA-CO5.5` for intent `I-1796253983-hac-model-scoped-cooldown`: quota-exhausted preflight +results are classified by scope, so a per-model spend limit writes a `(provider, model)` cooldown marker while org or +account limits and ambiguous text keep the provider-wide marker. + +## 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 From 7491bd2825d80f9848f2a802832bb214bd2590d7 Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:29:58 +0000 Subject: [PATCH 04/12] step 2: route sync_cooldown_for_result through quota-scope classifier --- .../src/sandbox_executor/preflight_cooldown.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py b/apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py index 1dcc98ba7..e3643b3b5 100644 --- a/apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py +++ b/apps/sandbox-executor/src/sandbox_executor/preflight_cooldown.py @@ -14,6 +14,7 @@ from sandbox_executor import local_llm from sandbox_executor.agent_defaults import AGENT_IMAGE_MAPPING, normalise_agent_id, normalise_model_and_effort +from sandbox_executor.preflight_quota_scope import QuotaScope, classify_quota_scope from sandbox_executor.preflight_result import PreflightResult, PreflightStatus, redact_output logger = logging.getLogger(__name__) @@ -320,13 +321,20 @@ def active_cooldown_result( return build_cooldown_result(marker, agent, model, resolved_image, now=now) +def _record_quota_cooldown(result: PreflightResult, now: float | None) -> None: + if result.model and classify_quota_scope(result.output_excerpt) is QuotaScope.MODEL: + record_model_cooldown(result.agent, result.model, result.output_excerpt, now=now) + else: + record_cooldown(result.agent, result.model, result.output_excerpt, now=now) + + def sync_cooldown_for_result(result: PreflightResult, *, now: float | None = None) -> None: if not isinstance(result, PreflightResult): return if result.status is PreflightStatus.QUOTA_EXHAUSTED: if result.hint.startswith(COOLDOWN_HINT_PREFIX): return - record_cooldown(result.agent, result.model, result.output_excerpt, now=now) + _record_quota_cooldown(result, now) elif result.ok and not result.skipped: clear_cooldown(result.agent) clear_model_cooldown(result.agent, result.model) From c65de839963f8b446ae2c917cbee9bc7c5976af2 Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:30:15 +0000 Subject: [PATCH 05/12] step 3: add model-scoped cooldown regression tests --- .../tests/test_preflight_cooldown.py | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/apps/sandbox-executor/tests/test_preflight_cooldown.py b/apps/sandbox-executor/tests/test_preflight_cooldown.py index 5cbb13fb2..b1c7d341d 100644 --- a/apps/sandbox-executor/tests/test_preflight_cooldown.py +++ b/apps/sandbox-executor/tests/test_preflight_cooldown.py @@ -27,6 +27,7 @@ record_model_cooldown, sync_cooldown_for_result, ) +from sandbox_executor.preflight_quota_scope import QuotaScope, classify_quota_scope from sandbox_executor.preflight_result import PreflightResult @@ -323,3 +324,74 @@ def test_ok_preflight_clears_the_model_cooldown(isolated_cooldown_home): ) sync_cooldown_for_result(ok) assert not os.path.exists(model_marker_path("claude-agent", "claude-opus-5-5")) + + +FABLE_MONTHLY_SPEND_LIMIT = "You've hit your monthly spend limit. Switch to another model to continue." +ORG_SPEND_LIMITS = ["You've hit your org's monthly spend limit", "Organization spending limit reached"] + + +def _quota_exhausted(model: str, output: str) -> PreflightResult: + return PreflightResult( + status=PreflightStatus.QUOTA_EXHAUSTED, + agent="claude-agent", + model=model, + image="holon/agent-claude", + exit_code=1, + output_excerpt=output, + hint="", + ) + + +@pytest.mark.parametrize( + ("output", "expected"), + [ + (FABLE_MONTHLY_SPEND_LIMIT, QuotaScope.MODEL), + ("Rate limit for this model exceeded", QuotaScope.MODEL), + (ORG_SPEND_LIMITS[0], QuotaScope.PROVIDER), + (ORG_SPEND_LIMITS[1], QuotaScope.PROVIDER), + ("org's monthly spend limit. Switch to another model to continue.", QuotaScope.PROVIDER), + ("HTTP 429 Too Many Requests", QuotaScope.PROVIDER), + ("", QuotaScope.PROVIDER), + ], +) +def test_classify_quota_scope_separates_model_limits_from_account_limits(output, expected): + assert classify_quota_scope(output) is expected + + +def test_model_spend_limit_blocks_only_that_model(isolated_cooldown_home): + sync_cooldown_for_result(_quota_exhausted("claude-fable-5-2", FABLE_MONTHLY_SPEND_LIMIT)) + + assert read_active_model_cooldown("claude-agent", "claude-fable-5-2") is not None + assert read_active_cooldown("claude-agent") is None + assert active_cooldown_result("claude-agent", "claude-fable-5-2") is not None + assert active_cooldown_result("claude-agent", "claude-opus-5-5") is None + + +@pytest.mark.parametrize("output", ORG_SPEND_LIMITS) +def test_org_spend_limit_blocks_every_model_of_the_provider(isolated_cooldown_home, output): + sync_cooldown_for_result(_quota_exhausted("claude-fable-5-2", output)) + + assert os.path.exists(marker_path("claude-agent")) + for model in ("claude-fable-5-2", "claude-opus-5-5", "claude-sonnet-4-6"): + assert active_cooldown_result("claude-agent", model) is not None + + +def test_run_preflight_probe_model_spend_limit_leaves_fallback_model_probeable(isolated_cooldown_home, monkeypatch): + monkeypatch.setattr(preflight_cooldown.time, "time", lambda: 1_700_000_000.0) + failing_runner = MagicMock( + return_value=subprocess.CompletedProcess(args=[], returncode=1, stdout="", stderr=FABLE_MONTHLY_SPEND_LIMIT) + ) + first = run_preflight_probe("claude-agent", "claude-fable-5-2", timeout=5, runner_fn=failing_runner) + assert first.status is PreflightStatus.QUOTA_EXHAUSTED + assert not os.path.exists(marker_path("claude-agent")) + + ok_runner = MagicMock(return_value=subprocess.CompletedProcess(args=[], returncode=0, stdout="OK\n", stderr="")) + fallback = run_preflight_probe("claude-agent", "claude-opus-5-5", timeout=5, runner_fn=ok_runner) + assert fallback.ok + assert ok_runner.call_count == 1 + + blocked_runner = MagicMock() + retry = run_preflight_probe("claude-agent", "claude-fable-5-2", timeout=5, runner_fn=blocked_runner) + assert retry.status is PreflightStatus.QUOTA_EXHAUSTED + assert retry.hint.startswith(COOLDOWN_HINT_PREFIX) + assert blocked_runner.call_count == 0 From 0422b4bdc2df65ebf3a108b7babc8ef21b9e2449 Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:31:31 +0000 Subject: [PATCH 06/12] step 4: verify lint and full suite, record execution notes --- executions/E-1796254161-CLA-CO5.5.md | 35 ++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/executions/E-1796254161-CLA-CO5.5.md b/executions/E-1796254161-CLA-CO5.5.md index af2430f0f..2d075f831 100644 --- a/executions/E-1796254161-CLA-CO5.5.md +++ b/executions/E-1796254161-CLA-CO5.5.md @@ -10,10 +10,35 @@ account limits and ambiguous text keep the provider-wide marker. | 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 | 1.0 | +| entropy_actual | 3.0 | +| impact_actual | 70.0 | +| cost_actual | 10.0 | +| learning_value_actual | 3.0 | ## Steps Executed + +1. Step 1: added `apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py` with `QuotaScope` and + `classify_quota_scope`. Account-wide wording (`org`, `organization`, `account`, `workspace`, `billing` near a limit + word) is checked first and wins; model-scoped wording ("switch to another model", "for this model", "model spend + limit", "per-model limit") yields `MODEL`; anything else stays `PROVIDER`. The module imports only `re` and `enum`. +2. Step 2: `sync_cooldown_for_result` now calls `_record_quota_cooldown`, which writes a model marker through + `record_model_cooldown` for model-scoped text with a non-empty model and the provider marker otherwise. No public + signature changed; `preflight_cooldown.py` is 340 lines (budget 350). +3. Step 3: added regression tests to `apps/sandbox-executor/tests/test_preflight_cooldown.py`: a parametrised classifier + test, a fable monthly spend limit that blocks only `claude-fable-5-2` (not `claude-opus-5-5`), org spend limits that + block every claude model, and an end-to-end `run_preflight_probe` test where the fallback `claude-opus-5-5` probe + runs while a repeat `claude-fable-5-2` probe short-circuits. `claude-fable-5-2` is accepted unchanged by the model + normaliser. +4. Step 4: verification below. + +## Tests Run + +| command | result | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | +| `uv run pytest apps/sandbox-executor/tests/test_preflight_cooldown.py apps/sandbox-executor/tests/test_preflight_outage.py` (after step 2, before new tests) | 67 passed, 0 failed in 1.13s | +| `uv run pytest apps/sandbox-executor/tests/test_preflight_cooldown.py apps/sandbox-executor/tests/test_preflight_outage.py apps/sandbox-executor/tests/test_preflight.py` | 369 passed, 0 failed in 1.43s | +| `uv run task lint` | exit 0 (module budgets, self-explaining check passed) | +| `uv run task test` (full suite, once) | 11342 passed, 8 skipped, 0 failed in 58.68s | + +No timing requirement in the intent, so each command ran once; median equals the single recorded run. From d9eb4671a4f3d954423d1943f081843585b8492a Mon Sep 17 00:00:00 2001 From: Holon Executor Agent Date: Wed, 2 Dec 2026 23:40:13 +0000 Subject: [PATCH 07/12] execute: E-1796254161-CLA-CO5.5 completed for plan I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/_ --- .../I-1796253983-hac-model-scoped-cooldown.jsonl | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl diff --git a/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl new file mode 100644 index 000000000..80fc81d97 --- /dev/null +++ b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl @@ -0,0 +1,7 @@ +{"action_id": "ACT-1796254297-56861046", "execution_id": "E-1796254161-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:31:37.008994Z"} +{"execution_id": "E-1796254161-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-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "run_id": "9cae0225f9fe", "head_sha": "0422b4bdc2df65ebf3a108b7babc8ef21b9e2449", "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[gw7] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-5/popen-gw7/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 han"}, "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[gw7] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-5/popen-gw7/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 han", "entry_type": "action", "action_id": "ACT-1796254499-6259a953", "created_at": "2026-12-02T23:34:59.832867Z"} +{"execution_id": "E-1796254161-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-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "run_id": "9cae0225f9fe", "head_sha": "0422b4bdc2df65ebf3a108b7babc8ef21b9e2449", "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[gw7] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-5/popen-gw7/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 han"}, "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[gw7] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-5/popen-gw7/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 han", "entry_type": "action", "action_id": "ACT-1796254506-7da13b73", "created_at": "2026-12-02T23:35:06.119032Z"} +{"execution_id": "E-1796254161-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-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "run_id": "9cae0225f9fe", "head_sha": "0422b4bdc2df65ebf3a108b7babc8ef21b9e2449", "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[gw7] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-5/popen-gw7/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 han"}, "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[gw7] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\ntmp_path = PosixPath('/tmp/pytest-of-holon/pytest-5/popen-gw7/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 han", "entry_type": "action", "action_id": "ACT-1796254511-4d4a9438", "created_at": "2026-12-02T23:35:11.291717Z"} +{"execution_id": "E-1796254161-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-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "run_id": "9cae0225f9fe", "head_sha": "0422b4bdc2df65ebf3a108b7babc8ef21b9e2449", "failing_test_ids": ["apps/sandbox-executor/tests/flow/test_process_reaper.py::test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm]", "apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_thread_appends_do_not_interleave"], "test_excerpts": {"apps/sandbox-executor/tests/flow/test_process_reaper.py::test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm]": "FAILED apps/sandbox-executor/tests/flow/test_process_reaper.py::test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm]\n______ test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm] ______\n[gw13] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\nrepo = PosixPath('/tmp/pytest-of-holon/pytest-11/popen-gw13/test_a_halted_run_leaves_no_ch0/repo')\nfake_docker_logging_argv = PosixPath('/tmp/pytest-of-holon/pytest-11/popen-gw13/test_a_halted_run_leaves_no_ch0/docker.log')\nmode = 'signal', halt = . at 0xffff7cee6520>\ncodes = {143}\n ", "apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_thread_appends_do_not_interleave": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_thread_appends_do_not_interleave\n_______________ test_concurrent_thread_appends_do_not_interleave _______________\n[gw15] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\nself = \nfd = 17\n def _acquire_exclusive_lock(self, fd: int) -> None:\n start_time = time.monotonic()\n delay = self.initial_delay\n while True:\n try:\n> fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)\nE BlockingIOError"}, "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": "b4669bc2a51e1cfc", "iteration": 0, "model_tier": "claude-opus-5-5", "base_check": "not_run", "error_context": "FAILED apps/sandbox-executor/tests/flow/test_process_reaper.py::test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm]\n______ test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm] ______\n[gw13] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\nrepo = PosixPath('/tmp/pytest-of-holon/pytest-11/popen-gw13/test_a_halted_run_leaves_no_ch0/repo')\nfake_docker_logging_argv = PosixPath('/tmp/pytest-of-holon/pytest-11/popen-gw13/test_a_halted_run_leaves_no_ch0/docker.log')\nmode = 'signal', halt = . at 0xffff7cee6520>\ncodes = {143}\n ", "entry_type": "action", "action_id": "ACT-1796254808-c659ed27", "created_at": "2026-12-02T23:40:08.718023Z"} +{"entry_type": "summary", "execution_id": "E-1796254161-CLA-CO5.5", "plan_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-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:29:22.093671Z", "agent_output_truncated": false, "agent_output_bytes": 253, "ledger_revision": 1, "execution_notes": "executions/E-1796254161-CLA-CO5.5.md", "execution_notes_valid": true, "elapsed_seconds": 648.8, "budget_seconds": 604722.0, "test_pass_rate": 0.9998236642567448, "tests_passed": 11340, "tests_failed": 2, "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-1796254499-6259a953", "ACT-1796254506-7da13b73", "ACT-1796254511-4d4a9438", "ACT-1796254808-c659ed27"], "test_fix_tier": "claude-opus-5-5"} +{"action_id": "ACT-1796254810-9f70a842", "execution_id": "E-1796254161-CLA-CO5.5", "action": "Committed execution changes: execute: E-1796254161-CLA-CO5.5 completed for plan I-1796253983-hac-model-scoped-cooldown/P-1796254006-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:40:10.885051Z"} From 390b802d6c3caee88e1c2fb2df30c830613db698 Mon Sep 17 00:00:00 2001 From: Holon Review Loop Agent Date: Thu, 3 Dec 2026 00:00:57 +0000 Subject: [PATCH 08/12] fix(review): resolve findings R3-F1, FIND-CI-001 (iteration 1) Action-Origin: pr_review Review-Iteration: 1 Review-Finding-Ids: R3-F1, FIND-CI-001 Review-Severity: important --- .../src/sandbox_executor/preflight_quota_scope.py | 11 +++++++---- .../sandbox-executor/tests/test_preflight_cooldown.py | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py b/apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py index dfbf4533e..3efa98e27 100644 --- a/apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py +++ b/apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py @@ -14,20 +14,23 @@ class QuotaScope(StrEnum): r"(?:limit|quota|spend|spending|budget)", re.IGNORECASE, ) -_MODEL_SCOPED_LIMIT_RE = re.compile( - r"switch\s+to\s+(?:another|a\s+different)\s+model" - r"|for\s+this\s+model" +_EXPLICIT_MODEL_LIMIT_RE = re.compile( + r"for\s+this\s+model" r"|\bmodel(?:'s)?\s+(?:spend|spending|rate|usage|token)\s+limit" r"|per-model\s+limit", re.IGNORECASE, ) +_SWITCH_MODEL_HINT_RE = re.compile(r"switch\s+to\s+(?:another|a\s+different)\s+model", re.IGNORECASE) def classify_quota_scope(output: str) -> QuotaScope: text = output or "" + # why: explicit per-model wording names the exhausted scope even when the sentence also mentions the account. + if _EXPLICIT_MODEL_LIMIT_RE.search(text): + return QuotaScope.MODEL # why: an org or account limit outranks a "switch model" hint because no other model on the provider can succeed. if _ACCOUNT_WIDE_LIMIT_RE.search(text): return QuotaScope.PROVIDER - if _MODEL_SCOPED_LIMIT_RE.search(text): + if _SWITCH_MODEL_HINT_RE.search(text): return QuotaScope.MODEL return QuotaScope.PROVIDER diff --git a/apps/sandbox-executor/tests/test_preflight_cooldown.py b/apps/sandbox-executor/tests/test_preflight_cooldown.py index b1c7d341d..6901132b7 100644 --- a/apps/sandbox-executor/tests/test_preflight_cooldown.py +++ b/apps/sandbox-executor/tests/test_preflight_cooldown.py @@ -347,6 +347,7 @@ def _quota_exhausted(model: str, output: str) -> PreflightResult: [ (FABLE_MONTHLY_SPEND_LIMIT, QuotaScope.MODEL), ("Rate limit for this model exceeded", QuotaScope.MODEL), + ("Your account has reached the spend limit for this model", QuotaScope.MODEL), (ORG_SPEND_LIMITS[0], QuotaScope.PROVIDER), (ORG_SPEND_LIMITS[1], QuotaScope.PROVIDER), ("org's monthly spend limit. Switch to another model to continue.", QuotaScope.PROVIDER), From eca50d57902260240e84834c945e802002f9728d Mon Sep 17 00:00:00 2001 From: Holon Review Loop Agent Date: Thu, 3 Dec 2026 11:01:34 +1100 Subject: [PATCH 09/12] chore(review): record review ledger rows (iteration 1) Action-Origin: pr_review Review-Iteration: 1 --- .../I-1796253983-hac-model-scoped-cooldown.jsonl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl index 80fc81d97..cb392cc51 100644 --- a/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl +++ b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl @@ -5,3 +5,15 @@ {"execution_id": "E-1796254161-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-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "run_id": "9cae0225f9fe", "head_sha": "0422b4bdc2df65ebf3a108b7babc8ef21b9e2449", "failing_test_ids": ["apps/sandbox-executor/tests/flow/test_process_reaper.py::test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm]", "apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_thread_appends_do_not_interleave"], "test_excerpts": {"apps/sandbox-executor/tests/flow/test_process_reaper.py::test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm]": "FAILED apps/sandbox-executor/tests/flow/test_process_reaper.py::test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm]\n______ test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm] ______\n[gw13] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\nrepo = PosixPath('/tmp/pytest-of-holon/pytest-11/popen-gw13/test_a_halted_run_leaves_no_ch0/repo')\nfake_docker_logging_argv = PosixPath('/tmp/pytest-of-holon/pytest-11/popen-gw13/test_a_halted_run_leaves_no_ch0/docker.log')\nmode = 'signal', halt = . at 0xffff7cee6520>\ncodes = {143}\n ", "apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_thread_appends_do_not_interleave": "FAILED apps/sandbox-executor/tests/test_ledger_lock.py::test_concurrent_thread_appends_do_not_interleave\n_______________ test_concurrent_thread_appends_do_not_interleave _______________\n[gw15] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\nself = \nfd = 17\n def _acquire_exclusive_lock(self, fd: int) -> None:\n start_time = time.monotonic()\n delay = self.initial_delay\n while True:\n try:\n> fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)\nE BlockingIOError"}, "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": "b4669bc2a51e1cfc", "iteration": 0, "model_tier": "claude-opus-5-5", "base_check": "not_run", "error_context": "FAILED apps/sandbox-executor/tests/flow/test_process_reaper.py::test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm]\n______ test_a_halted_run_leaves_no_child_and_stops_its_container[sigterm] ______\n[gw13] linux -- Python 3.13.14 /home/holon/.cache/holon-venv/bin/python\nrepo = PosixPath('/tmp/pytest-of-holon/pytest-11/popen-gw13/test_a_halted_run_leaves_no_ch0/repo')\nfake_docker_logging_argv = PosixPath('/tmp/pytest-of-holon/pytest-11/popen-gw13/test_a_halted_run_leaves_no_ch0/docker.log')\nmode = 'signal', halt = . at 0xffff7cee6520>\ncodes = {143}\n ", "entry_type": "action", "action_id": "ACT-1796254808-c659ed27", "created_at": "2026-12-02T23:40:08.718023Z"} {"entry_type": "summary", "execution_id": "E-1796254161-CLA-CO5.5", "plan_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-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:29:22.093671Z", "agent_output_truncated": false, "agent_output_bytes": 253, "ledger_revision": 1, "execution_notes": "executions/E-1796254161-CLA-CO5.5.md", "execution_notes_valid": true, "elapsed_seconds": 648.8, "budget_seconds": 604722.0, "test_pass_rate": 0.9998236642567448, "tests_passed": 11340, "tests_failed": 2, "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-1796254499-6259a953", "ACT-1796254506-7da13b73", "ACT-1796254511-4d4a9438", "ACT-1796254808-c659ed27"], "test_fix_tier": "claude-opus-5-5"} {"action_id": "ACT-1796254810-9f70a842", "execution_id": "E-1796254161-CLA-CO5.5", "action": "Committed execution changes: execute: E-1796254161-CLA-CO5.5 completed for plan I-1796253983-hac-model-scoped-cooldown/P-1796254006-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:40:10.885051Z"} +{"action_id": "ACT-REV-1796255675-a1b989b1", "execution_id": "REV-ITR-1-1796255675", "action": "Review Loop iteration 1 reviewer 1 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 1, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-02T23:54:35.888670Z"} +{"action_id": "ACT-REV-1796255675-3612788e", "execution_id": "REV-ITR-1-1796255675", "action": "Review Loop iteration 1 reviewer 2 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 1, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-02T23:54:35.890882Z"} +{"action_id": "ACT-REV-1796255675-5fd18bc3", "execution_id": "REV-ITR-1-1796255675", "action": "Review Loop iteration 1 reviewer 3 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-01"], "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": 0, "nit": 1}, "created_at": "2026-12-02T23:54:35.893044Z"} +{"action_id": "ACT-FIND-1796255675-c115d834", "execution_id": "REV-FIND-1-1796255675", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-01", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-01"], "labels": ["review", "finding", "iteration-1"], "error_context": "Account-wide regex is checked first and matches explicit per-model wording (e.g. 'Your account has reached the spend limit for this model' -> PROVIDER), so the fallback model is still blocked; check explicit per-model qualifiers before the account pattern and add a test.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py", "review_line": 29, "created_at": "2026-12-02T23:54:35.894963Z"} +{"action_id": "ACT-REV-1796255861-2bf0af7a", "execution_id": "REV-ITR-1-1796255861", "action": "Review Loop iteration 1 evaluation for I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-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-R3-001-01"], "labels": ["review", "review-loop", "iteration-1"], "error_context": "Findings detected: ['FIND-CI-001', 'FIND-R3-001-01']", "created_at": "2026-12-02T23:57:41.153098Z"} +{"action_id": "ACT-REV-1796255861-047519ff", "execution_id": "REV-ITR-1-1796255861", "action": "Review Loop iteration 1 reviewer 1 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 1, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-02T23:57:41.154078Z"} +{"action_id": "ACT-REV-1796255861-2bd8da43", "execution_id": "REV-ITR-1-1796255861", "action": "Review Loop iteration 1 reviewer 2 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 1, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-02T23:57:41.154983Z"} +{"action_id": "ACT-REV-1796255861-51e8b720", "execution_id": "REV-ITR-1-1796255861", "action": "Review Loop iteration 1 reviewer 3 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-01"], "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": 0, "nit": 1}, "created_at": "2026-12-02T23:57:41.156030Z"} +{"action_id": "ACT-FIND-1796255861-3f26a5d6", "execution_id": "REV-FIND-1-1796255861", "action": "Review Loop iteration 1 finding detected: FIND-R3-001-01", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "failure", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["FIND-R3-001-01"], "labels": ["review", "finding", "iteration-1"], "error_context": "Account-wide regex is checked first and matches explicit per-model wording (e.g. 'Your account has reached the spend limit for this model' -> PROVIDER), so the fallback model is still blocked; check explicit per-model qualifiers before the account pattern and add a test.", "review_reviewer_index": 3, "review_file": "apps/sandbox-executor/src/sandbox_executor/preflight_quota_scope.py", "review_line": 29, "created_at": "2026-12-02T23:57:41.156914Z"} +{"action_id": "ACT-FIND-1796255861-6bcf5f4d", "execution_id": "REV-FIND-1-1796255861", "action": "Review Loop iteration 1 finding detected: FIND-CI-001", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-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-R3-001-01']", "created_at": "2026-12-02T23:57:41.157635Z"} +{"action_id": "ACT-RES-1796256094-e5244772", "execution_id": "REV-RES-1-1796256094", "action": "Review Loop iteration 1 finding R3-F1 adjudicated: applied", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["R3-F1"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796255861-3f26a5d6", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:01:34.341186Z"} +{"action_id": "ACT-RES-1796256094-84a3f809", "execution_id": "REV-RES-1-1796256094", "action": "Review Loop iteration 1 finding FIND-CI-001 adjudicated: applied", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-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-1796255861-6bcf5f4d", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:01:34.342059Z"} From a21031cd3b9210d5f8bd1442d70276f1a95bdc15 Mon Sep 17 00:00:00 2001 From: Holon Review Loop Agent Date: Thu, 3 Dec 2026 11:30:09 +1100 Subject: [PATCH 10/12] chore(review): record review ledger rows (iteration 2) Action-Origin: pr_review Review-Iteration: 2 --- .../I-1796253983-hac-model-scoped-cooldown.jsonl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl index cb392cc51..82ba69063 100644 --- a/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl +++ b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl @@ -17,3 +17,13 @@ {"action_id": "ACT-FIND-1796255861-6bcf5f4d", "execution_id": "REV-FIND-1-1796255861", "action": "Review Loop iteration 1 finding detected: FIND-CI-001", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-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-R3-001-01']", "created_at": "2026-12-02T23:57:41.157635Z"} {"action_id": "ACT-RES-1796256094-e5244772", "execution_id": "REV-RES-1-1796256094", "action": "Review Loop iteration 1 finding R3-F1 adjudicated: applied", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": "nit", "review_iteration": 1, "review_finding_ids": ["R3-F1"], "review_disposition": "applied", "rejection_reason": null, "introduced_by_action_id": "ACT-FIND-1796255861-3f26a5d6", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:01:34.341186Z"} {"action_id": "ACT-RES-1796256094-84a3f809", "execution_id": "REV-RES-1-1796256094", "action": "Review Loop iteration 1 finding FIND-CI-001 adjudicated: applied", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-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-1796255861-6bcf5f4d", "labels": ["review", "resolver", "iteration-1"], "error_context": null, "created_at": "2026-12-03T00:01:34.342059Z"} +{"action_id": "ACT-REV-1796257783-10c3184a", "execution_id": "REV-ITR-2-1796257783", "action": "Review Loop iteration 2 reviewer 1 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-03T00:29:43.360935Z"} +{"action_id": "ACT-REV-1796257783-7e1a22b2", "execution_id": "REV-ITR-2-1796257783", "action": "Review Loop iteration 2 reviewer 2 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-03T00:29:43.364856Z"} +{"action_id": "ACT-REV-1796257783-8c81b91b", "execution_id": "REV-ITR-2-1796257783", "action": "Review Loop iteration 2 reviewer 3 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-03T00:29:43.366717Z"} +{"action_id": "ACT-REV-1796257799-702b7b94", "execution_id": "REV-ITR-2-1796257799", "action": "Review Loop iteration 2 evaluation for I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": null, "labels": ["review", "review-loop", "iteration-2"], "error_context": null, "created_at": "2026-12-03T00:29:59.610408Z"} +{"action_id": "ACT-REV-1796257799-3871bd91", "execution_id": "REV-ITR-2-1796257799", "action": "Review Loop iteration 2 reviewer 1 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-03T00:29:59.611459Z"} +{"action_id": "ACT-REV-1796257799-2aa3730b", "execution_id": "REV-ITR-2-1796257799", "action": "Review Loop iteration 2 reviewer 2 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-03T00:29:59.612486Z"} +{"action_id": "ACT-REV-1796257799-eb48c650", "execution_id": "REV-ITR-2-1796257799", "action": "Review Loop iteration 2 reviewer 3 completed", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": null, "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": "APPROVED", "review_counts": {"critical": 0, "important": 0, "nit": 0}, "created_at": "2026-12-03T00:29:59.613438Z"} +{"action_id": "ACT-POST-1796257804-38a545d3", "execution_id": "REV-POST-1796257804", "action": "Review consensus dual-posted to GitHub for I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_iteration": 2, "labels": ["review", "github", "dual-post"], "created_at": "2026-12-03T00:30:04.844304Z"} +{"execution_id": "REV-1796257807-85415ac8-claude-agent", "plan_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/_", "execution_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "agent": "claude-agent", "agent_version": "1.4.0", "model": "claude-opus-5-5", "status": "approved", "entry_type": "summary", "summary": "Review Loop reached consensus approval after 2 iteration(s); PR ready for maintainer merge; final verdicts: Reviewer 1 APPROVED (0/0/0); Reviewer 2 APPROVED (0/0/0); Reviewer 3 APPROVED (0/0/0)", "created_at": "2026-12-03T00:30:07.435Z", "total_iterations": 2, "max_iterations": 25, "ci_checks_summary": {"source": "github_cli", "total": 16, "passed": 16, "failed": 0, "pending": 0, "skipped": 0, "all_passed": true, "checks": [{"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810046/job/143889002409", "name": "unit (macos-latest, shard 2 of 2)", "state": "SUCCESS", "workflow": "Test - Unit"}, {"bucket": "pass", "event": "", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/runs/143891505372", "name": "CodeQL", "state": "SUCCESS", "workflow": ""}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810219/job/143889001227", "name": "build", "state": "SUCCESS", "workflow": "Docker Build"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810046/job/143889001717", "name": "unit (macos-latest, shard 1 of 2)", "state": "SUCCESS", "workflow": "Test - Unit"}, {"bucket": "pass", "event": "dynamic", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999803614/job/143888980247", "name": "Analyze (python)", "state": "SUCCESS", "workflow": "CodeQL"}, {"bucket": "pass", "event": "dynamic", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999803614/job/143888979754", "name": "Analyze (actions)", "state": "SUCCESS", "workflow": "CodeQL"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810046/job/143889002246", "name": "unit (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Unit"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810036/job/143888993500", "name": "scan", "state": "SUCCESS", "workflow": "Test - No Harness References"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810213/job/143889000236", "name": "Workspace survival (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Stress"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810465/job/143889001568", "name": "integration (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Integration"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810314/job/143889000802", "name": "self-doc-behavior", "state": "SUCCESS", "workflow": "Test - Self-Doc Behavior"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810549/job/143889003839", "name": "ledger-invariants", "state": "SUCCESS", "workflow": "Test - Ledger Invariants"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810260/job/143889001733", "name": "build (macos-latest)", "state": "SUCCESS", "workflow": "Run Make"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810260/job/143889001401", "name": "build (ubuntu-latest)", "state": "SUCCESS", "workflow": "Run Make"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810011/job/143888999945", "name": "commit-trailers", "state": "SUCCESS", "workflow": "Test - Commit Trailers"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810115/job/143888999780", "name": "hygiene (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Hygiene"}], "test_source": "ci_head", "test_head_sha": "eca50d57902260240e84834c945e802002f9728d"}, "trailers": {"action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": ["none"], "review_disposition": null, "rejection_reason": null, "introduced_by_action_id": null, "consulted_knowledge_ids": null}, "review_post_withheld": null} +{"execution_id": "REV-1796257807-85415ac8-claude-agent", "action": "Review Loop executed for I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "category": "test", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "verdict": "success", "outcome": "success", "entry_type": "action", "context_fingerprint": "f4bd362e54f9ff67", "labels": ["review", "review-loop", "claude-agent"], "error_context": null, "action_id": "ACT-1796257807-cc2d9512", "created_at": "2026-12-03T00:30:07.436188Z"} From d00e81135e713ca7436c6ad60f186f2600b788c6 Mon Sep 17 00:00:00 2001 From: Holon Calibrate Agent Date: Thu, 3 Dec 2026 11:30:36 +1100 Subject: [PATCH 11/12] chore(calibration): add calibration report for P-1796254006-CLA-CO5.5 --- ...1796253983-hac-model-scoped-cooldown.jsonl | 1 + .../P-1796254006-CLA-CO5.5_calibration.md | 103 ++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5_calibration.md diff --git a/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl index 82ba69063..f08a25de3 100644 --- a/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl +++ b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl @@ -27,3 +27,4 @@ {"action_id": "ACT-POST-1796257804-38a545d3", "execution_id": "REV-POST-1796257804", "action": "Review consensus dual-posted to GitHub for I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "category": "code", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "outcome": "success", "entry_type": "action", "action_origin": "pr_review", "review_iteration": 2, "labels": ["review", "github", "dual-post"], "created_at": "2026-12-03T00:30:04.844304Z"} {"execution_id": "REV-1796257807-85415ac8-claude-agent", "plan_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/_", "execution_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "agent": "claude-agent", "agent_version": "1.4.0", "model": "claude-opus-5-5", "status": "approved", "entry_type": "summary", "summary": "Review Loop reached consensus approval after 2 iteration(s); PR ready for maintainer merge; final verdicts: Reviewer 1 APPROVED (0/0/0); Reviewer 2 APPROVED (0/0/0); Reviewer 3 APPROVED (0/0/0)", "created_at": "2026-12-03T00:30:07.435Z", "total_iterations": 2, "max_iterations": 25, "ci_checks_summary": {"source": "github_cli", "total": 16, "passed": 16, "failed": 0, "pending": 0, "skipped": 0, "all_passed": true, "checks": [{"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810046/job/143889002409", "name": "unit (macos-latest, shard 2 of 2)", "state": "SUCCESS", "workflow": "Test - Unit"}, {"bucket": "pass", "event": "", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/runs/143891505372", "name": "CodeQL", "state": "SUCCESS", "workflow": ""}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810219/job/143889001227", "name": "build", "state": "SUCCESS", "workflow": "Docker Build"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810046/job/143889001717", "name": "unit (macos-latest, shard 1 of 2)", "state": "SUCCESS", "workflow": "Test - Unit"}, {"bucket": "pass", "event": "dynamic", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999803614/job/143888980247", "name": "Analyze (python)", "state": "SUCCESS", "workflow": "CodeQL"}, {"bucket": "pass", "event": "dynamic", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999803614/job/143888979754", "name": "Analyze (actions)", "state": "SUCCESS", "workflow": "CodeQL"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810046/job/143889002246", "name": "unit (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Unit"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810036/job/143888993500", "name": "scan", "state": "SUCCESS", "workflow": "Test - No Harness References"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810213/job/143889000236", "name": "Workspace survival (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Stress"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810465/job/143889001568", "name": "integration (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Integration"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810314/job/143889000802", "name": "self-doc-behavior", "state": "SUCCESS", "workflow": "Test - Self-Doc Behavior"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810549/job/143889003839", "name": "ledger-invariants", "state": "SUCCESS", "workflow": "Test - Ledger Invariants"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810260/job/143889001733", "name": "build (macos-latest)", "state": "SUCCESS", "workflow": "Run Make"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810260/job/143889001401", "name": "build (ubuntu-latest)", "state": "SUCCESS", "workflow": "Run Make"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810011/job/143888999945", "name": "commit-trailers", "state": "SUCCESS", "workflow": "Test - Commit Trailers"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810115/job/143888999780", "name": "hygiene (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Hygiene"}], "test_source": "ci_head", "test_head_sha": "eca50d57902260240e84834c945e802002f9728d"}, "trailers": {"action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": ["none"], "review_disposition": null, "rejection_reason": null, "introduced_by_action_id": null, "consulted_knowledge_ids": null}, "review_post_withheld": null} {"execution_id": "REV-1796257807-85415ac8-claude-agent", "action": "Review Loop executed for I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "category": "test", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "verdict": "success", "outcome": "success", "entry_type": "action", "context_fingerprint": "f4bd362e54f9ff67", "labels": ["review", "review-loop", "claude-agent"], "error_context": null, "action_id": "ACT-1796257807-cc2d9512", "created_at": "2026-12-03T00:30:07.436188Z"} +{"action_id": "ACT-CAL-1796257836-9b3c19fe", "execution_id": "CAL-P-1796254006-CLA-CO5.5-1796257836-63d7fb5e", "action": "Calibration report generated for plan P-1796254006-CLA-CO5.5", "category": "doc", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/calibrated", "outcome": "success", "entry_type": "action", "action_origin": "calibration", "labels": ["calibration", "stage-5", "P-1796254006-CLA-CO5.5"], "error_context": null, "plan_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/_", "execution_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "evaluated_commit_sha": "a21031cd3b9210d5f8bd1442d70276f1a95bdc15", "predicted_metrics": {"p_success": 0.86, "entropy": 4.0, "impact": 70.0, "cost": 14.0, "learning_value": 4.0, "ev": 47.0}, "actual_metrics": {"p_success": 1.0, "entropy": 0.4, "impact": 70.0, "cost": 11.9, "learning_value": 4.0, "ev": 59.98, "duration_seconds": null, "tokens": null, "exit_code": 0, "test_pass_rate": 0.9998236642567448, "files_changed": 3, "insertions": 118, "deletions": 1, "ev_clean": 59.98, "ev_with_bugs": 59.98, "p_success_clean": 1.0, "p_success_with_bugs": 1.0, "impact_clean": 70.0, "impact_with_bugs": 70.0, "bug_ev_drag": 0.0}, "calibration_deltas": {"p_success_error": 0.14, "entropy_error": 3.6, "impact_error": 0.0, "cost_error": 2.1, "learning_value_error": 0.0, "ev_error": 12.98, "delta_ev": 12.98, "delta_ev_clean": 12.98, "delta_ev_with_bugs": 12.98, "bug_ev_drag": 0.0}, "calibration_report_path": "plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5_calibration.md", "created_at": "2026-12-03T00:30:36.823003Z", "touch_set_accuracy": {"precision": 1.0, "recall": 1.0, "unpredicted_paths": [], "unused_entries": []}, "calibration_agent": "claude-agent", "calibration_model": "claude-opus-5-5", "plan_agent": "claude-agent", "plan_model": "claude-opus-5-5"} diff --git a/plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5_calibration.md b/plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5_calibration.md new file mode 100644 index 000000000..2bae0bdc8 --- /dev/null +++ b/plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5_calibration.md @@ -0,0 +1,103 @@ +# Plan Calibration Report: P-1796254006-CLA-CO5.5 + +- **Plan Reference:** + [`plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5.md`](P-1796254006-CLA-CO5.5.md) +- **Execution ID:** `E-1796254161-CLA-CO5.5` +- **Execution Branch:** `I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_` +- **Intent Branch:** `I-1796253983-hac-model-scoped-cooldown/_` +- **Evaluating Agent:** `claude-agent/claude-opus-5-5` +- **Plan Agent:** `claude-agent/claude-opus-5-5` +- **Evaluation Timestamp:** `2026-12-03T00:30:35.000Z` +- **Evaluated Commit SHA:** `a21031cd3b9210d5f8bd1442d70276f1a95bdc15` +- **Base SHA:** `acb484f8b7b548cf39b6aa4506fd6fc62894fb6d` +- **Merge-Base SHA:** `acb484f8b7b548cf39b6aa4506fd6fc62894fb6d` +- **Merged Commits:** `0` +- **Patch Size Base:** `plan` + +--- + +## 1. Executive Calibration Summary + +| Metric | Predicted (`pred`) | Actual (`actual`) | Absolute Error (`abs(pred - actual)`) | Accuracy Rating | Bias Direction | +| :------------------------------------------------- | :----------------- | :---------------- | :------------------------------------ | :-------------- | :------------------------- | +| **$P(\text{success})$** | `0.86` | `1.00` | `0.14` | Moderate | Slight Underconfidence | +| **Entropy ($\Delta S$)** | `4.00` | `0.40` | `3.60` | Moderate | Overestimated Risk | +| **Impact** | `70.00` | `70.00` | `0.00` | Exact | Perfectly Calibrated | +| **Cost** | `14.00` | `11.90` | `2.10` | Moderate | Conservative Cost Estimate | +| **Learning Value** | `4.00` | `4.00` | `0.00` | Exact | Perfectly Calibrated | +| **Expected Value — Clean (without bugs)** | `47.00` | `59.98` | `12.98` | Moderate | Conservative Underestimate | +| **Expected Value — Observed (with bugs included)** | `47.00` | `59.98` | `12.98` | Moderate | Conservative Underestimate | +| **Bug EV Drag** | `0.00` | `0.00` | `0.00` | - | Drag Penalty | + +--- + +## 2. Mathematical Derivations & Calibration Errors + +- **Success Probability Error:** $|0.86 - 1.00| = 0.14$ +- **Entropy Error:** $|4.00 - 0.40| = 3.60$ +- **Impact Error:** $|70.00 - 70.00| = 0.00$ +- **Cost Error:** $|14.00 - 11.90| = 2.10$ +- **Learning Value Error:** $|4.00 - 4.00| = 0.00$ +- **Expected Value Realization:** + $$EV_{\text{pred}} = 0.86 \times 70.0 + 0.5 \times 4.0 - 0.3 \times 4.00 - 14.00 = 47.00$$ + $$EV_{\text{actual}} = EV_{\text{clean}} = 1.00 \times 70.0 + 0.5 \times 4.0 - 0.3 \times 0.40 - 11.90 = 59.98$$ + $$EV_{\text{with\_bugs}} = 1.00 \times 70.0 + 0.5 \times 4.0 - 0.3 \times 0.40 - 11.90 = 59.98$$ + $$\text{Bug EV Drag} = round(EV_{\text{clean}} - EV_{\text{with\_bugs}}, 2) = 0.00$$ $$\Delta EV = +12.98$$ + +--- + +## 3. Entropy Factor Breakdown + +- **State Surface Area (SSA):** Predicted `0.6` vs Observed `1.2` (3 files modified). +- **Irreversibility (IRR):** Predicted `0.0` vs Observed `0.0` (Zero destructive or stateful changes). +- **Conflict Likelihood (CL):** Predicted `0.1` vs Observed `0.0` (Clean sequential branch merges). +- **Sandbox Escape Risk (SER):** Predicted `0.0` vs Observed `0.0` (Zero security exceptions). +- **Novelty (NOV):** Predicted `0.4` vs Observed `0.4` (Standard calibration reporting schema). + +--- + +## 4. Calibration Assessment + +Plan `P-1796254006-CLA-CO5.5` executed with minimal error ($p\_success\_error = 0.14$, $cost\_error = 2.10$). The +calibration step successfully completed the execution lifecycle and delivered verified post-execution analysis. + +--- + +## 5. Touch Set Accuracy + +- **Precision (declared entries the diff touched):** `100.0%` +- **Recall (changed files the touch set covered):** `100.0%` + +Changed files outside the touch set: + +- none + +Declared entries the diff did not touch: + +- none + +--- + +## 6. Review Churn + +- **Full reviews:** `1` +- **Scoped reviews:** `1` +- **Approval carry-overs:** `0` +- **Pipeline runs:** `1` +- **Pipeline reruns:** `0` +- **Non-defect churn (target merge):** `0` +- **Non-defect churn (bookkeeping):** `0` +- **Non-defect churn (CI noise):** `0` + +--- + +## 7. Self-Explaining Code Counts + +Against the merge base with origin/main: added 0 docstring(s), added 0 comment(s), removed 0 docstring(s) and removed 0 +comment(s) across 8 changed file(s). + +- Changed files checked: 8 +- Added docstrings: 0 +- Added comments (not '# why:'): 0 +- Removed docstrings: 0 +- Removed comments (not '# why:'): 0 From ae0181ea480ea159e9bd68264327577f276453f0 Mon Sep 17 00:00:00 2001 From: Holon Calibrate Agent Date: Thu, 3 Dec 2026 11:30:37 +1100 Subject: [PATCH 12/12] chore(calibration): record stage 5 reconciliation --- .../executions/I-1796253983-hac-model-scoped-cooldown.jsonl | 1 + 1 file changed, 1 insertion(+) diff --git a/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl index f08a25de3..98c8e2d72 100644 --- a/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl +++ b/holon-knowledge/ledger/pending/executions/I-1796253983-hac-model-scoped-cooldown.jsonl @@ -28,3 +28,4 @@ {"execution_id": "REV-1796257807-85415ac8-claude-agent", "plan_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/_", "execution_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "agent": "claude-agent", "agent_version": "1.4.0", "model": "claude-opus-5-5", "status": "approved", "entry_type": "summary", "summary": "Review Loop reached consensus approval after 2 iteration(s); PR ready for maintainer merge; final verdicts: Reviewer 1 APPROVED (0/0/0); Reviewer 2 APPROVED (0/0/0); Reviewer 3 APPROVED (0/0/0)", "created_at": "2026-12-03T00:30:07.435Z", "total_iterations": 2, "max_iterations": 25, "ci_checks_summary": {"source": "github_cli", "total": 16, "passed": 16, "failed": 0, "pending": 0, "skipped": 0, "all_passed": true, "checks": [{"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810046/job/143889002409", "name": "unit (macos-latest, shard 2 of 2)", "state": "SUCCESS", "workflow": "Test - Unit"}, {"bucket": "pass", "event": "", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/runs/143891505372", "name": "CodeQL", "state": "SUCCESS", "workflow": ""}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810219/job/143889001227", "name": "build", "state": "SUCCESS", "workflow": "Docker Build"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810046/job/143889001717", "name": "unit (macos-latest, shard 1 of 2)", "state": "SUCCESS", "workflow": "Test - Unit"}, {"bucket": "pass", "event": "dynamic", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999803614/job/143888980247", "name": "Analyze (python)", "state": "SUCCESS", "workflow": "CodeQL"}, {"bucket": "pass", "event": "dynamic", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999803614/job/143888979754", "name": "Analyze (actions)", "state": "SUCCESS", "workflow": "CodeQL"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810046/job/143889002246", "name": "unit (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Unit"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810036/job/143888993500", "name": "scan", "state": "SUCCESS", "workflow": "Test - No Harness References"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810213/job/143889000236", "name": "Workspace survival (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Stress"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810465/job/143889001568", "name": "integration (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Integration"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810314/job/143889000802", "name": "self-doc-behavior", "state": "SUCCESS", "workflow": "Test - Self-Doc Behavior"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810549/job/143889003839", "name": "ledger-invariants", "state": "SUCCESS", "workflow": "Test - Ledger Invariants"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810260/job/143889001733", "name": "build (macos-latest)", "state": "SUCCESS", "workflow": "Run Make"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810260/job/143889001401", "name": "build (ubuntu-latest)", "state": "SUCCESS", "workflow": "Run Make"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810011/job/143888999945", "name": "commit-trailers", "state": "SUCCESS", "workflow": "Test - Commit Trailers"}, {"bucket": "pass", "event": "pull_request", "link": "https://github.com/Holon-Agentic-Coder/holon-agentic-coder/actions/runs/46999810115/job/143888999780", "name": "hygiene (ubuntu-latest)", "state": "SUCCESS", "workflow": "Test - Hygiene"}], "test_source": "ci_head", "test_head_sha": "eca50d57902260240e84834c945e802002f9728d"}, "trailers": {"action_origin": "pr_review", "review_severity": null, "review_iteration": 2, "review_finding_ids": ["none"], "review_disposition": null, "rejection_reason": null, "introduced_by_action_id": null, "consulted_knowledge_ids": null}, "review_post_withheld": null} {"execution_id": "REV-1796257807-85415ac8-claude-agent", "action": "Review Loop executed for I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "category": "test", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "verdict": "success", "outcome": "success", "entry_type": "action", "context_fingerprint": "f4bd362e54f9ff67", "labels": ["review", "review-loop", "claude-agent"], "error_context": null, "action_id": "ACT-1796257807-cc2d9512", "created_at": "2026-12-03T00:30:07.436188Z"} {"action_id": "ACT-CAL-1796257836-9b3c19fe", "execution_id": "CAL-P-1796254006-CLA-CO5.5-1796257836-63d7fb5e", "action": "Calibration report generated for plan P-1796254006-CLA-CO5.5", "category": "doc", "target": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/calibrated", "outcome": "success", "entry_type": "action", "action_origin": "calibration", "labels": ["calibration", "stage-5", "P-1796254006-CLA-CO5.5"], "error_context": null, "plan_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/_", "execution_branch": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "evaluated_commit_sha": "a21031cd3b9210d5f8bd1442d70276f1a95bdc15", "predicted_metrics": {"p_success": 0.86, "entropy": 4.0, "impact": 70.0, "cost": 14.0, "learning_value": 4.0, "ev": 47.0}, "actual_metrics": {"p_success": 1.0, "entropy": 0.4, "impact": 70.0, "cost": 11.9, "learning_value": 4.0, "ev": 59.98, "duration_seconds": null, "tokens": null, "exit_code": 0, "test_pass_rate": 0.9998236642567448, "files_changed": 3, "insertions": 118, "deletions": 1, "ev_clean": 59.98, "ev_with_bugs": 59.98, "p_success_clean": 1.0, "p_success_with_bugs": 1.0, "impact_clean": 70.0, "impact_with_bugs": 70.0, "bug_ev_drag": 0.0}, "calibration_deltas": {"p_success_error": 0.14, "entropy_error": 3.6, "impact_error": 0.0, "cost_error": 2.1, "learning_value_error": 0.0, "ev_error": 12.98, "delta_ev": 12.98, "delta_ev_clean": 12.98, "delta_ev_with_bugs": 12.98, "bug_ev_drag": 0.0}, "calibration_report_path": "plans/I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5_calibration.md", "created_at": "2026-12-03T00:30:36.823003Z", "touch_set_accuracy": {"precision": 1.0, "recall": 1.0, "unpredicted_paths": [], "unused_entries": []}, "calibration_agent": "claude-agent", "calibration_model": "claude-opus-5-5", "plan_agent": "claude-agent", "plan_model": "claude-opus-5-5"} +{"action_id": "ACT-1796257837-458cbbe4", "parent_action_id": "I-1796253983-hac-model-scoped-cooldown/P-1796254006-CLA-CO5.5/E-1796254161-CLA-CO5.5/_", "event_type": "reconciliation", "verdict": "success", "outcome": "success", "reason": "Stage 5 calibration reconciled execution outcome to success", "created_at": "2026-12-03T00:30:37.251944Z"}