diff --git a/.agents/coordination.md b/.agents/coordination.md index f83330b..edf304a 100644 --- a/.agents/coordination.md +++ b/.agents/coordination.md @@ -38,9 +38,9 @@ so that long-running multi-iteration review loops never hijack the user's primar - **Tier 1 (Main Interactive Agent -> Background Loop Orchestrator)**: The main interactive agent MUST NOT run the review loop inline. Instead, it immediately spawns 1 background **PR Review Loop Orchestrator** subagent via - `invoke_subagent` (`TypeName: "self"`, `Model: "inherit"`, `Role: "PR Review Loop Orchestrator ( PR #)"`) and - returns control to the user immediately. Multiple PR review loops across different PRs can run concurrently in - isolated Tier 1 orchestrator subagents without blocking the main agent. + `invoke_subagent` (`TypeName: "self"`, `Model: "inherit"`, `Role: "# - review loop orchestrator"`) and returns + control to the user immediately. Multiple PR review loops across different PRs can run concurrently in isolated Tier 1 + orchestrator subagents without blocking the main agent. - **Tier 2 (`PR Review Loop Orchestrator` Subagent -> Per-Pass Reviewer & Resolver Subagents)**: The background `PR Review Loop Orchestrator` subagent owns the entire loop lifecycle across all iterations (up to `max_iterations: 25`). Per iteration, it spawns the isolated dry-run reviewer, the 3 parallel `pr-reviewer` ensemble @@ -61,7 +61,7 @@ interactive session remains responsive: - **Interactive Agent Delegation**: The main interactive agent MUST NOT execute `holon flow` inline. Instead, it immediately spawns 1 background **Holon Flow Subagent** via `invoke_subagent` (`TypeName: "self"`, - `Role: "Holon Flow Subagent ()"`, `Model: "inherit"`) and returns control to the user immediately (see + `Role: "bean - holon flow "`, `Model: "inherit"`) and returns control to the user immediately (see [holon-flow Step 0](skills/holon_flow/SKILL.md#step-0-entrypoint-delegation--spawn-the-background-flow-subagent)). - **Subagent Flow Ownership**: The background subagent executes `holon flow` directly, watches checkpoints (`.holon/flow/checkpoint-.json`), applies the automatic model fallback ladder on quota/session exhaustion, @@ -99,10 +99,10 @@ When executing within the **Antigravity (AGY)** environment: child sessions. If credit, quota, or session allowance runs out on the higher-level model (for either **Claude** or **Antigravity**), automatically fall back to the next lower tier that has available credit (`Model: "inherit"` / `"pro"` $\rightarrow$ `"flash"` $\rightarrow$ `"flash_lite"` in AGY `invoke_subagent`; `claude-opus-5-5` $\rightarrow$ - `claude-sonnet-4-6` $\rightarrow$ `claude-haiku-4-5` in `claude-agent`; `gemini-3.8-pro-high` $\rightarrow$ - `gemini-3.8-flash-medium` $\rightarrow$ `gemini-3.8-flash` in `antigravity-agent`, or switch `--agent` across - `claude-agent` $\leftrightarrow$ `antigravity-agent` if an account-wide session limit is reached) and continue the - in-progress flow or review loop from its current stage/iteration without losing completed work. + `claude-sonnet-4-6` $\rightarrow$ `claude-haiku-4-5` in `claude-agent`; `gemini-4-argon` $\rightarrow$ + `gemini-4-hydrogen` $\rightarrow$ `gemini-3.8-flash` in `antigravity-agent`, or switch `--agent` across `claude-agent` + $\leftrightarrow$ `antigravity-agent` if an account-wide session limit is reached) and continue the in-progress flow + or review loop from its current stage/iteration without losing completed work. - **Reactive Wakeup (Zero Polling)**: AGY resumes parent execution automatically upon child message arrival or task completion. **Never poll, sleep, or loop on task status.** diff --git a/.agents/holon-flow.md b/.agents/holon-flow.md index 75926b3..f86b4e4 100644 --- a/.agents/holon-flow.md +++ b/.agents/holon-flow.md @@ -51,8 +51,9 @@ stepping down model tiers, always resume through `holon flow --fro the harness** -- they are not a change-authoring surface. Editing `holon-agentic-coder` or `holon-coherence` source in a worktree outside the flow bypasses intent provenance, plan metrics, EV accounting, and the execution ledger, and is therefore prohibited. -- Skipping a stage is not permitted. If a stage cannot run (missing image, failed agent, unreachable remote), the change - is **blocked**: report the blocker instead of hand-applying the diff as a workaround. +- Skipping a stage is not permitted: **never pass `--skip-review`**; no case needs it (maintainer, 2026-11-21). If Stage + 4 or any other stage fails or stalls (missing image, failed agent, unreachable remote), the change is **blocked**: + halt and report the blocker instead of bypassing the stage or hand-applying the diff as a workaround. - **Automatic Model & Runner Fallback on Credit / Quota Exhaustion**: If a stage or subagent fails due to model credit exhaustion, session quota limits, or rate-limit caps (e.g. `You've hit your session limit`, `insufficient_quota`, `RESOURCE_EXHAUSTED`, or HTTP 429/quota errors), **do not stop or block** as long as a lower-tier model or alternate @@ -62,8 +63,10 @@ stepping down model tiers, always resume through `holon flow --fro `opus`) $\rightarrow$ `claude-sonnet-4-6` (or `sonnet`) $\rightarrow$ `claude-haiku-4-5` (or `haiku`). Fable is the preferred top tier for flow stages (maintainer, 2026-11-05); `holon` passes `--model` through to the runner verbatim, so no engine change is needed. - - **Antigravity (`antigravity-agent` in `holon` CLI) fallback ladder**: `gemini-3.8-pro-high` (or `gemini-3.8-pro`) - $\rightarrow$ `gemini-3.8-flash-medium` $\rightarrow$ `gemini-3.8-flash`. + - **Antigravity (`antigravity-agent` in `holon` CLI) fallback ladder** (maintainer, 2026-11-22): use + `antigravity-agent` with `gemini-4-argon` for all Holon coding tasks until tokens run out, then fall back along + `gemini-4-argon` $\rightarrow$ `gemini-4-hydrogen` $\rightarrow$ `gemini-3.8-flash` (use bare model IDs without + `-high` because `AntigravityRunner` passes `--effort ${HOLON_AGENT_EFFORT:-medium}`). - **Antigravity (`invoke_subagent` in AGY runtime) fallback ladder**: `Model: "inherit"` / `"pro"` $\rightarrow$ `"flash"` $\rightarrow$ `"flash_lite"`. - **Cross-Runner Fallback**: If all model tiers on the active runner (`claude-agent` or `antigravity-agent`) share an diff --git a/.agents/instructions.md b/.agents/instructions.md index 90ad0ac..b97cc02 100644 --- a/.agents/instructions.md +++ b/.agents/instructions.md @@ -74,8 +74,8 @@ system safety, and clean documentation. Follow these core guidelines in every se restarting completed stages: - **Claude (`claude-agent` / Claude Code)**: `claude-opus-5-5` $\rightarrow$ `claude-sonnet-4-6` $\rightarrow$ `claude-haiku-4-5`. - - **Antigravity (`antigravity-agent` in `holon` CLI)**: `gemini-3.8-pro-high` $\rightarrow$ - `gemini-3.8-flash-medium` $\rightarrow$ `gemini-3.8-flash`. + - **Antigravity (`antigravity-agent` in `holon` CLI)**: `gemini-4-argon` $\rightarrow$ `gemini-4-hydrogen` + $\rightarrow$ `gemini-3.8-flash` (default to `gemini-4-argon` for all Holon coding tasks until tokens run out). - **Antigravity (`invoke_subagent` in AGY runtime)**: `Model: "inherit"` / `"pro"` $\rightarrow$ `"flash"` $\rightarrow$ `"flash_lite"`. - **Cross-Runner Continuation**: If an entire runner's session quota is exhausted across all its model tiers (e.g. diff --git a/.agents/scripts/validate-links.js b/.agents/scripts/validate-links.js index 5e1b9e2..5c0a5d4 100644 --- a/.agents/scripts/validate-links.js +++ b/.agents/scripts/validate-links.js @@ -24,6 +24,7 @@ const filesToCheck = [ path.join(rootDir, '.agents/skills/install_coherence/SKILL.md'), path.join(rootDir, '.agents/skills/post_pr_merge/SKILL.md'), path.join(rootDir, '.agents/skills/prioritise_beans/SKILL.md'), + path.join(rootDir, '.agents/skills/bean_progress/SKILL.md'), path.join(rootDir, '.agents/skills/holon_flow/SKILL.md'), path.join(rootDir, '.agents/watcher/README.md'), ]; diff --git a/.agents/skills/bean_progress/SKILL.md b/.agents/skills/bean_progress/SKILL.md new file mode 100644 index 0000000..3105e3b --- /dev/null +++ b/.agents/skills/bean_progress/SKILL.md @@ -0,0 +1,93 @@ +--- +name: bean-progress +description: >- + Reports live status and progress of all in-flight beans across the Holon ecosystem (holon-agentic-coder, + holon-coherence, dev-env, and harness), correlating .beans/, todo/ intents, flow worktree checkpoints, open GitHub + PRs, and active host/Docker processes across sessions (Antigravity, Claude Code, Codex, terminal) into a concise + Markdown table while strictly excluding completed and scrapped beans. Activate whenever the user asks for bean + progress, in-flight beans, active flows across sessions, or an in-flight bean status table. +--- + +# Bean Progress Skill (`bean-progress`) + +> [!NOTE] **Model tier: lowest.** This skill is mechanical and read-only, so run it directly via its script (or in a +> dedicated subagent on the lowest tier from [`.agents/model-tiers.md`](../../model-tiers.md)). Do not hard-code a model +> name here. + +Provides an instant, read-only Markdown table of every bean currently in flight across all local worktrees, open Pull +Requests, and active runner sessions. + +--- + +## Core Invariants & Rules + +1. **Strict Exclusion of Completed & Scrapped Beans**: + - Any bean with `status: completed` or `status: scrapped` MUST NEVER appear in the output table, even if leftover + `todo/intent-*.json` files or unpruned flow worktrees still exist on disk. +2. **Strictly Read-Only**: + - Never modify `.beans/`, commit changes, kill processes, or mutate git branches or PRs. +3. **Cross-Session Visibility**: + - Inspects live `run_holon_flow.py`, `holon flow`, Docker role containers, and quota/merge waiters across all + sessions (Antigravity, Claude Code, Codex, and standalone terminal processes) using strict ancestor inspection. +4. **Clean 4-Digit Bean Numbers**: + - Render bean IDs as clean 4-digit numbers (`0193`, `0347, 0354`), never file paths or `file://` links inside table + cells. +5. **Authentic State Only**: + - Every stage, PR link, CI summary, PID, and runner model comes directly from disk state, `gh`, and `ps` output. + +--- + +## Execution Workflow + +Run [bean_progress.py](./scripts/bean_progress.py) from the harness root: + +```bash +uv run python .agents/skills/bean_progress/scripts/bean_progress.py +``` + +Return the resulting Markdown table directly to the user verbatim (with a brief one-line summary of totals if helpful). + +### CLI Flags + +| Flag | Description | Default | +| :------------ | :----------------------------------------------------- | :---------------------- | +| `--repo-root` | Harness repository root path | Auto-detected repo root | +| `--beans-dir` | Explicit directory containing bean markdown files | `/.beans` | +| `--json` | Emit structured JSON array instead of a Markdown table | `false` | +| `--no-gh` | Skip querying open Pull Requests via `gh pr list` | `false` | +| `--no-ps` | Skip inspecting running host/Docker processes via `ps` | `false` | + +### Output Table Schema + +| Column | Meaning | +| :-------------- | :------------------------------------------------------------------------------------------------------------------- | +| `Bean #` | Clean 4-digit bean ID(s) (`0347, 0354`), or `—` for unmapped active flows/PRs | +| `Target` | Repository target (`HAC`, `Coherence`, `dev-env`, or `harness`) | +| `Title` | Concise bean or flow title | +| `Stage` | Active Holon stage (preferring live Docker role / admission wait over stale disk) | +| `Time in Stage` | How long the bean has been in its current stage (compact: `45s`, `12m`, `1h05m`, `2d3h`; `—` if unknown) | +| `PR & CI` | Open PR link, CI rollup (`pass`/`fail`/`running`), review count, mergeability flags | +| `Total Time` | How long the bean has been in flight overall (same format; `—` if unknown) | +| `Notes` | Runner first (`opus-5-5 · 31m (PID, session)` live, `idle (opus-5-5)` idle), then blockers, warnings, stale attempts | + +Rows are merged per bean: when several attempts exist (for example a stale first-attempt worktree plus a live `-v2` +flow), the live or most-advanced attempt is shown and the others are listed in Notes as `stale attempt ...`. + +### Mapping rules + +- Child intents/PRs of a split flow (branches `I--/P-...--1-/...`) map to the parent intent + slug, which is matched to `todo/intent--*.json` (by the JSON `slug` or the file-name slug, ignoring a trailing + `-vN`). Flows therefore receive their bean number even with no other link. +- A PR is only matched by branch (execution branch, then `I--/`) or by a whole-number bean reference in its + branch or title; digits inside timestamps never match. + +### Time sources (real data only) + +- **Time in Stage**: in the newest `.holon/flow/checkpoint-*.json` of the flow worktree, the current stage's + `context.stage_results..start_time`; if absent, the latest `end_time` of the stages already recorded (the + previous stage ended when this one began); else the checkpoint `timestamp`; else the checkpoint file mtime. A live + Stage 4 iteration still reports time since the stage began, not the iteration. +- **Total Time**: now minus the earliest of the `I-` epoch in the flow's intent/plan/execution branch and the first + `holon-knowledge/ledger/intents.jsonl` row `created_at` for that intent (including its split children) in the flow + worktree. Only open PRs are inspected, so the end point is always now. The bean's status change is not used (beans + record no status history). PR-only rows use the `I-` epoch of the PR head branch. diff --git a/.agents/skills/bean_progress/scripts/bean_progress.py b/.agents/skills/bean_progress/scripts/bean_progress.py new file mode 100644 index 0000000..55a1835 --- /dev/null +++ b/.agents/skills/bean_progress/scripts/bean_progress.py @@ -0,0 +1,1440 @@ +#!/usr/bin/env python3 +"""bean_progress.py - Live read-only dashboard of in-flight Holon beans. + +Correlates `.beans/`, `todo/intent-*.json`, git flow worktrees (`.holon/flow/checkpoint-*.json`), +open GitHub pull requests (`gh pr list`), and running host/Docker flow processes (`ps`) +to print a single Markdown table of all beans currently in flight, strictly excluding +completed and scrapped beans. +""" + +from __future__ import annotations + +import argparse +import contextlib +import json +import os +import re +import shlex +import subprocess +import sys +from dataclasses import dataclass, field +from datetime import UTC, datetime +from pathlib import Path +from typing import Any + +EXCLUDED_STATUSES = frozenset({"completed", "scrapped"}) +BEAN_FILE_RE = re.compile(r"^holon-agentic-coder-ref-metadata-(\d{4})--(.+)\.md$") +INTENT_FILE_RE = re.compile(r"^intent-((?:\d{4}-)+)(.+)\.json$") +WORKTREE_BEAN_RE = re.compile(r"(?:^|-)bean-(\d{4})(?:-|$)") +BRANCH_SLUG_RE = re.compile(r"^I-\d+-([^/]+)/") +BRANCH_TS_RE = re.compile(r"^I-(\d+)-") +VERSION_SUFFIX_RE = re.compile(r"-v\d+$") +STAGE_ORDER = ["intent", "plan", "execute", "review", "calibrate", "completed"] +LEDGER_REL = Path("holon-knowledge") / "ledger" / "intents.jsonl" +GITHUB_REMOTE_RE = re.compile(r"github\.com[:/]([^/]+/[^/]+?)(?:\.git)?$") + +STAGE_LABELS = { + "intent": "Stage 1 (Intent)", + "plan": "Stage 2 (Plan)", + "execute": "Stage 3 (Execute)", + "review": "Stage 4 (Review)", + "calibrate": "Stage 5 (Calibrate)", +} + + +@dataclass +class BeanRecord: + """Metadata parsed from a `.beans/` Markdown file.""" + + bean_num: str + slug: str + title: str + status: str + priority: str + bean_type: str + tags: list[str] + blocked_by: list[str] + path: Path + + +@dataclass +class IntentMapping: + """Mapping from `todo/intent-*.json` to bean IDs and flow slug.""" + + path: Path + slug: str + bean_nums: list[str] + file_slug: str = "" + + +@dataclass +class RepoTarget: + """Managed repository inspected for flow worktrees and open PRs.""" + + name: str + root: Path + multi_worktree: bool + github_repo: str | None = None + + +@dataclass +class WorktreeFlow: + """Flow checkpoint and git status for a single feature/flow worktree.""" + + repo_name: str + path: Path + dir_name: str + slug: str + current_stage: str | None + completed_stages: list[str] + timestamp: str | None + agent: str | None + model: str | None + execution_branch: str | None + plan_branch: str | None + intent_branch: str | None + review_iterations_done: int + admission: dict[str, Any] + stage_results: dict[str, Any] + dirty_count: int = 0 + has_calibration_file: bool = False + checkpoint_path: Path | None = None + embedded_bean_nums: list[str] = field(default_factory=list) + stage_started: datetime | None = None + flow_started: datetime | None = None + + +@dataclass +class PullRequestInfo: + """Open pull request metadata and rolled-up CI/review state.""" + + repo_name: str + number: int + title: str + url: str + head_ref_name: str + mergeable: str + is_draft: bool + reviews_count: int + comments_count: int + ci_summary: str + + +@dataclass +class ProcessInfo: + """Single row from `ps -eo`.""" + + pid: int + ppid: int + etime: str + stat: str + command: str + + +@dataclass +class LiveFlowTree: + """Consolidated host + Docker live process tree targeting one flow worktree.""" + + root_pid: int + etime: str + kind: str # "running" | "polling" | "waiter" + session_owner: str + worktree_path: str | None + slug: str | None + bean_nums: list[str] + agent: str | None + model: str | None + docker_role: str | None + docker_resolve: bool + docker_iteration: int | None + duplicate_trees: int = 1 + + +@dataclass +class InFlightRow: + """Rendered table row and machine-readable JSON fields.""" + + bean_nums: list[str] + target: str + title: str + stage: str + pr_ci: str + live_runner: str + notes: str + sort_bucket: int + time_in_stage: str = "—" + total_time: str = "—" + source: str = "" + rank: tuple[float, ...] = () + + def notes_cell(self) -> str: + """Notes column: runner/model/PID/session info first, then the former status notes.""" + parts = [p for p in (self.live_runner, self.notes if self.notes != "—" else "") if p] + return "; ".join(parts) if parts else "—" + + def as_dict(self) -> dict[str, Any]: + """Serialize row fields cleanly for `--json` output.""" + return { + "bean_nums": self.bean_nums, + "target": self.target, + "title": self.title, + "stage": self.stage, + "time_in_stage": self.time_in_stage, + "pr_ci": self.pr_ci, + "total_time": self.total_time, + "live_runner": self.live_runner, + "notes": self.notes_cell(), + } + + +def parse_iso(text: Any) -> datetime | None: + """Parse an ISO-8601 timestamp (`Z` or offset) into an aware UTC datetime.""" + if not isinstance(text, str) or not text: + return None + try: + dt = datetime.fromisoformat(text.replace("Z", "+00:00")) + except ValueError: + return None + return dt if dt.tzinfo else dt.replace(tzinfo=UTC) + + +def branch_started(branch: str | None) -> datetime | None: + """Epoch seconds embedded in an `I--/...` branch name.""" + m = BRANCH_TS_RE.match(branch or "") + if not m: + return None + try: + return datetime.fromtimestamp(int(m.group(1)), tz=UTC) + except (ValueError, OverflowError, OSError): + return None + + +def root_slug_of(*branches: str | None) -> str | None: + """Parent (root) intent slug from the first flow branch name that carries one.""" + for branch in branches: + m = BRANCH_SLUG_RE.match(branch or "") + if m: + return m.group(1) + return None + + +def derive_stage_started( + current_stage: str | None, stage_results: dict[str, Any], timestamp: str | None, mtime: datetime | None +) -> datetime | None: + """When the current stage began: its recorded start_time, else the previous stage's latest end_time, + else the checkpoint timestamp, else the checkpoint file mtime.""" + cur = stage_results.get(current_stage) if current_stage else None + if isinstance(cur, dict): + started = parse_iso(cur.get("start_time")) + if started: + return started + ends = [parse_iso(v.get("end_time")) for v in stage_results.values() if isinstance(v, dict)] + ends_ok = [t for t in ends if t] + if ends_ok: + return max(ends_ok) + return parse_iso(timestamp) or mtime + + +def ledger_first_created(ledger: Path, root_slug: str | None) -> datetime | None: + """Earliest `created_at` among intents.jsonl rows whose branch belongs to the root intent.""" + if not root_slug or not ledger.is_file(): + return None + pattern = re.compile(rf"^I-\d+-{re.escape(root_slug)}/") + earliest: datetime | None = None + try: + lines = ledger.read_text(encoding="utf-8").splitlines() + except OSError: + return None + for line in lines: + try: + row = json.loads(line) + except ValueError: + continue + if not isinstance(row, dict) or not pattern.match(str(row.get("branch") or "")): + continue + created = parse_iso(row.get("created_at")) + if created and (earliest is None or created < earliest): + earliest = created + return earliest + + +def earliest_of(*candidates: datetime | None) -> datetime | None: + present = [c for c in candidates if c] + return min(present) if present else None + + +def format_duration(start: datetime | None, now: datetime) -> str: + """Compact elapsed time (`45s`, `12m`, `1h05m`, `2d3h`); `—` when unknown.""" + if start is None: + return "—" + secs = max(0, int((now - start).total_seconds())) + if secs < 60: + return f"{secs}s" + if secs < 3600: + return f"{secs // 60}m" + if secs < 86400: + return f"{secs // 3600}h{(secs % 3600) // 60:02d}m" + return f"{secs // 86400}d{(secs % 86400) // 3600}h" + + +def _strip_paired_quotes(text: str) -> str: + if len(text) >= 2 and ( + (text.startswith('"') and text.endswith('"')) or (text.startswith("'") and text.endswith("'")) + ): + return text[1:-1] + return text + + +def parse_frontmatter(content: str) -> dict[str, Any]: + """Parse YAML frontmatter scalars, folded multiline scalars, and sequence lists.""" + lines = content.splitlines() + if not lines or lines[0].strip() != "---": + return {} + + fm_lines: list[str] = [] + for line in lines[1:]: + if line.strip() == "---": + break + fm_lines.append(line) + + result: dict[str, Any] = {} + i = 0 + while i < len(fm_lines): + raw = fm_lines[i] + stripped = raw.strip() + if not stripped or stripped.startswith("#"): + i += 1 + continue + + key_match = re.match(r"^([A-Za-z0-9_]+):\s*(.*)$", raw) + if not key_match: + i += 1 + continue + + key = key_match.group(1) + rest = key_match.group(2).strip() + if rest: + result[key] = _strip_paired_quotes(rest) + i += 1 + continue + + j = i + 1 + list_items: list[str] = [] + folded_parts: list[str] = [] + is_list = False + while j < len(fm_lines): + nxt = fm_lines[j] + if not nxt.strip() or not nxt[0].isspace(): + break + item_match = re.match(r"^\s+-\s*(.*)$", nxt) + if item_match: + is_list = True + item_val = _strip_paired_quotes(item_match.group(1).strip()) + if item_val: + list_items.append(item_val) + elif not is_list: + folded_parts.append(nxt.strip()) + j += 1 + + if is_list: + result[key] = list_items + elif folded_parts: + result[key] = _strip_paired_quotes(" ".join(folded_parts)) + else: + result[key] = "" + i = j + + return result + + +def scan_beans(beans_dir: Path) -> dict[str, BeanRecord]: + """Load all sequential 4-digit beans from `.beans/`.""" + beans: dict[str, BeanRecord] = {} + if not beans_dir.is_dir(): + return beans + + for entry in sorted(beans_dir.iterdir()): + match = BEAN_FILE_RE.match(entry.name) + if not match or not entry.is_file(): + continue + bean_num, slug = match.group(1), match.group(2) + try: + content = entry.read_text(encoding="utf-8") + except OSError: + continue + + fm = parse_frontmatter(content) + raw_tags = fm.get("tags") + tags = raw_tags if isinstance(raw_tags, list) else [] + raw_blocked = fm.get("blocked_by") + blocked_by = raw_blocked if isinstance(raw_blocked, list) else [] + + beans[bean_num] = BeanRecord( + bean_num=bean_num, + slug=slug, + title=str(fm.get("title") or slug.replace("-", " ")), + status=str(fm.get("status") or "todo").strip().lower(), + priority=str(fm.get("priority") or "normal").strip().lower(), + bean_type=str(fm.get("type") or "task").strip().lower(), + tags=tags, + blocked_by=blocked_by, + path=entry, + ) + return beans + + +def scan_intents(todo_dir: Path) -> list[IntentMapping]: + """Discover `todo/intent--.json` mappings.""" + intents: list[IntentMapping] = [] + if not todo_dir.is_dir(): + return intents + + for entry in sorted(todo_dir.iterdir()): + match = INTENT_FILE_RE.match(entry.name) + if not match or not entry.is_file(): + continue + bean_nums = re.findall(r"\d{4}", match.group(1)) + slug = match.group(2) + try: + data = json.loads(entry.read_text(encoding="utf-8")) + if isinstance(data, dict) and isinstance(data.get("slug"), str) and data["slug"]: + slug = data["slug"] + except (OSError, ValueError): + # Unreadable or malformed intent JSON: keep the slug parsed from the file name. + pass + intents.append(IntentMapping(path=entry, slug=slug, bean_nums=bean_nums, file_slug=match.group(2))) + return intents + + +def _read_github_repo(git_dir: Path) -> str | None: + if not git_dir.exists(): + return None + try: + proc = subprocess.run( + ["git", "-C", str(git_dir), "remote", "get-url", "origin"], + capture_output=True, + text=True, + timeout=5, + ) + except (OSError, subprocess.SubprocessError): + return None + if proc.returncode != 0: + return None + match = GITHUB_REMOTE_RE.search(proc.stdout.strip()) + return match.group(1) if match else None + + +def discover_repos(repo_root: Path) -> list[RepoTarget]: + """Discover managed Holon repositories and their GitHub `owner/repo` slugs.""" + candidates = [ + ("HAC", repo_root / "apps" / "holon-agentic-coder", True), + ("Coherence", repo_root / "apps" / "holon-coherence", True), + ("dev-env", repo_root.parent / "dev-env", True), + ("harness", repo_root, False), + ] + repos: list[RepoTarget] = [] + for name, root, multi in candidates: + if not root.is_dir(): + continue + remote_probe = (root / "main") if (multi and (root / "main").is_dir()) else root + if multi and not remote_probe.exists() and (root / ".git").exists(): + remote_probe = root / ".git" + repos.append( + RepoTarget( + name=name, + root=root, + multi_worktree=multi, + github_repo=_read_github_repo(remote_probe), + ) + ) + return repos + + +def _git_dirty_count(worktree_dir: Path) -> int: + try: + proc = subprocess.run( + ["git", "-C", str(worktree_dir), "status", "--porcelain"], + capture_output=True, + text=True, + timeout=5, + ) + except (OSError, subprocess.SubprocessError): + return 0 + if proc.returncode != 0: + return 0 + return sum(1 for line in proc.stdout.splitlines() if line.strip()) + + +def scan_worktrees(repos: list[RepoTarget]) -> list[WorktreeFlow]: + """Inspect non-`main` worktrees and their Holon flow checkpoints.""" + worktrees: list[WorktreeFlow] = [] + for repo in repos: + if not repo.multi_worktree or not repo.root.is_dir(): + continue + for entry in sorted(repo.root.iterdir()): + if not entry.is_dir() or entry.name in {"main", ".git"}: + continue + + flow_dir = entry / ".holon" / "flow" + checkpoints = ( + sorted( + flow_dir.glob("checkpoint-*.json"), + key=lambda p: p.stat().st_mtime, + reverse=True, + ) + if flow_dir.is_dir() + else [] + ) + + data: dict[str, Any] = {} + ckpt_path: Path | None = checkpoints[0] if checkpoints else None + if ckpt_path is not None: + try: + loaded = json.loads(ckpt_path.read_text(encoding="utf-8")) + if isinstance(loaded, dict): + data = loaded + except (OSError, ValueError): + data = {} + + ctx = data.get("context") if isinstance(data.get("context"), dict) else {} + slug = str( + data.get("intent_slug") + or (ctx.get("intent_data") or {}).get("slug") + or (entry.name.removeprefix("flow-") if entry.name.startswith("flow-") else entry.name) + ) + admission = data.get("admission") if isinstance(data.get("admission"), dict) else ctx.get("admission") + if not isinstance(admission, dict): + admission = {} + stage_results = ctx.get("stage_results") if isinstance(ctx.get("stage_results"), dict) else {} + completed_raw = data.get("completed_stages") + completed = [str(s) for s in completed_raw] if isinstance(completed_raw, list) else [] + + cal_glob = ( + list((entry / "plans").glob(f"I-*-{slug}/*_calibration.md")) if (entry / "plans").is_dir() else [] + ) + intent_branch = ctx.get("intent_branch") + plan_branch = ctx.get("plan_branch") + exec_branch = ctx.get("execution_branch") + root_slug = root_slug_of(intent_branch, plan_branch, exec_branch) + if root_slug: + slug = root_slug + mtime = datetime.fromtimestamp(ckpt_path.stat().st_mtime, tz=UTC) if ckpt_path else None + stage_started = ( + derive_stage_started(data.get("current_stage"), stage_results, data.get("timestamp"), mtime) + if ckpt_path + else None + ) + flow_started = earliest_of( + branch_started(intent_branch or plan_branch or exec_branch), + ledger_first_created(entry / LEDGER_REL, slug), + ) + embedded_beans = WORKTREE_BEAN_RE.findall(entry.name) + if ckpt_path is not None: + embedded_beans.extend(re.findall(r"(?:^|-)(\d{4})(?:-|$)", ckpt_path.stem)) + + worktrees.append( + WorktreeFlow( + repo_name=repo.name, + path=entry.resolve(), + dir_name=entry.name, + slug=slug, + current_stage=data.get("current_stage"), + completed_stages=completed, + timestamp=data.get("timestamp"), + agent=ctx.get("agent"), + model=ctx.get("model"), + execution_branch=ctx.get("execution_branch"), + plan_branch=ctx.get("plan_branch"), + intent_branch=ctx.get("intent_branch"), + review_iterations_done=int(ctx.get("review_iterations_done") or 0), + admission=admission, + stage_results=stage_results, + dirty_count=_git_dirty_count(entry), + has_calibration_file=bool(cal_glob), + checkpoint_path=ckpt_path, + embedded_bean_nums=sorted(set(embedded_beans)), + stage_started=stage_started, + flow_started=flow_started, + ) + ) + return worktrees + + +def summarize_checks(rollup: Any) -> str: + """Aggregate GitHub `statusCheckRollup` entries into a compact status string.""" + if not isinstance(rollup, list) or not rollup: + return "no checks" + + passed = 0 + failed = 0 + pending = 0 + for item in rollup: + if not isinstance(item, dict): + continue + if "status" in item or "conclusion" in item: + status = str(item.get("status") or "").upper() + conclusion = str(item.get("conclusion") or "").upper() + if status != "COMPLETED": + pending += 1 + elif conclusion in {"SUCCESS", "NEUTRAL", "SKIPPED"}: + passed += 1 + else: + failed += 1 + else: + state = str(item.get("state") or "").upper() + if state == "SUCCESS": + passed += 1 + elif state in {"", "PENDING", "EXPECTED"}: + pending += 1 + else: + failed += 1 + + total = passed + failed + pending + if total == 0: + return "no checks" + if failed == 0 and pending == 0: + return f"{passed}/{total} pass" + + parts = [f"{passed}/{total} pass"] + if failed: + parts.append(f"{failed} fail") + if pending: + parts.append(f"{pending} running") + return ", ".join(parts) + + +def fetch_open_prs(repos: list[RepoTarget], *, no_gh: bool = False) -> list[PullRequestInfo]: + """Fetch open PRs via `gh pr list` across all managed GitHub repositories.""" + if no_gh: + return [] + + prs: list[PullRequestInfo] = [] + seen_gh: set[str] = set() + for repo in repos: + if not repo.github_repo or repo.github_repo in seen_gh: + continue + seen_gh.add(repo.github_repo) + try: + proc = subprocess.run( + [ + "gh", + "pr", + "list", + "--repo", + repo.github_repo, + "--state", + "open", + "--json", + "number,title,url,headRefName,mergeable,isDraft,reviews,comments,statusCheckRollup", + ], + capture_output=True, + text=True, + timeout=15, + ) + except (OSError, subprocess.SubprocessError): + continue + if proc.returncode != 0 or not proc.stdout.strip(): + continue + + try: + raw_list = json.loads(proc.stdout) + except ValueError: + continue + if not isinstance(raw_list, list): + continue + + for item in raw_list: + if not isinstance(item, dict): + continue + prs.append( + PullRequestInfo( + repo_name=repo.name, + number=int(item["number"]), + title=str(item.get("title") or ""), + url=str(item.get("url") or ""), + head_ref_name=str(item.get("headRefName") or ""), + mergeable=str(item.get("mergeable") or ""), + is_draft=bool(item.get("isDraft")), + reviews_count=len(item.get("reviews") or []), + comments_count=len(item.get("comments") or []), + ci_summary=summarize_checks(item.get("statusCheckRollup")), + ) + ) + return prs + + +def scan_processes(*, no_ps: bool = False) -> list[ProcessInfo]: + """Read running host processes via `ps -eo pid=,ppid=,etime=,stat=,command=`.""" + if no_ps: + return [] + try: + proc = subprocess.run( + ["ps", "-eo", "pid=,ppid=,etime=,stat=,command="], + capture_output=True, + text=True, + timeout=5, + ) + except (OSError, subprocess.SubprocessError): + return [] + if proc.returncode != 0: + return [] + + items: list[ProcessInfo] = [] + for line in proc.stdout.splitlines(): + m = re.match(r"^\s*(\d+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(.*)$", line) + if not m: + continue + items.append( + ProcessInfo( + pid=int(m.group(1)), + ppid=int(m.group(2)), + etime=m.group(3), + stat=m.group(4), + command=m.group(5), + ) + ) + return items + + +def detect_session_owner(pid: int, by_pid: dict[int, ProcessInfo]) -> str: + """Walk strictly ancestor processes (never `pid` itself) to identify the harness session.""" + current = by_pid.get(pid) + visited: set[int] = set() + hops = 0 + while current and hops < 12: + ppid = current.ppid + if ppid <= 1 or ppid in visited: + break + visited.add(ppid) + ancestor = by_pid.get(ppid) + if ancestor is None: + break + cmd_lower = ancestor.command.lower() + first_token = Path(cmd_lower.split()[0]).name if cmd_lower.split() else "" + if "antigravity" in cmd_lower or first_token == "agy": + return "Antigravity" + if first_token == "claude" or "/claude" in cmd_lower: + return "Claude Code" + if first_token == "codex" or "/codex" in cmd_lower: + return "Codex" + current = ancestor + hops += 1 + return "terminal" + + +def _extract_flag_value(tokens: list[str], flag: str) -> str | None: + for idx, tok in enumerate(tokens): + if tok == flag and idx + 1 < len(tokens): + return tokens[idx + 1] + if tok.startswith(f"{flag}="): + return tok.split("=", 1)[1] + return None + + +def _parse_docker_flow_info(tokens: list[str]) -> tuple[str | None, str | None, bool, int | None]: + worktree: str | None = None + role: str | None = None + resolve = False + iteration: int | None = None + + for idx, tok in enumerate(tokens): + if tok in {"-v", "--volume"} and idx + 1 < len(tokens): + mount = tokens[idx + 1] + if ":/home/holon/.holon-sandbox/workspace" in mount: + host_path = mount.split(":", 1)[0] + worktree = os.path.realpath(host_path) + elif tok == "-e" and idx + 1 < len(tokens) and tokens[idx + 1].startswith("HOLON_ROLE="): + role = tokens[idx + 1].split("=", 1)[1] + elif tok == "--resolve": + resolve = True + elif tok.startswith("--iteration="): + with contextlib.suppress(ValueError): + iteration = int(tok.split("=", 1)[1]) + return worktree, role, resolve, iteration + + +def _is_flow_process(cmd: str) -> str | None: + if "run_holon_flow.py" in cmd or re.search(r"(?:^|/|\s)holon\s+flow(?:\s|$)", cmd): + return "flow" + if "docker run" in cmd and ("HOLON_ROLE=" in cmd or "holon/agent-" in cmd): + return "docker" + if ("sleep " in cmd or "wait_for.py" in cmd) and ("flow-" in cmd or "holon-agentic-coder/pull" in cmd): + return "waiter" + return None + + +def match_live_flows( + processes: list[ProcessInfo], + worktrees: list[WorktreeFlow], + intents: list[IntentMapping], +) -> dict[str, LiveFlowTree]: + """Group live host/Docker flow processes per target worktree path (fallback: slug).""" + by_pid = {p.pid: p for p in processes} + wt_by_path = {str(w.path): w for w in worktrees} + wt_by_slug = {w.slug: w for w in worktrees} + intent_by_name = {i.path.name: i for i in intents} + + flow_procs: dict[int, tuple[ProcessInfo, str]] = {} + for proc in processes: + kind = _is_flow_process(proc.command) + if kind: + flow_procs[proc.pid] = (proc, kind) + + def find_root_pid(pid: int) -> int: + cur = pid + seen: set[int] = set() + while cur in by_pid and cur not in seen: + seen.add(cur) + ppid = by_pid[cur].ppid + if ppid in flow_procs: + cur = ppid + continue + parent = by_pid.get(ppid) + if ( + parent + and ppid > 1 + and ("/bin/sh" in parent.command or "zsh" in parent.command or "bash" in parent.command) + ): + if ppid in flow_procs: + cur = ppid + continue + grand = parent.ppid + if grand in flow_procs: + cur = grand + continue + break + return cur + + trees_by_root: dict[int, list[tuple[ProcessInfo, str]]] = {} + for pid, entry in flow_procs.items(): + root = find_root_pid(pid) + trees_by_root.setdefault(root, []).append(entry) + + result: dict[str, LiveFlowTree] = {} + for root_pid, members in trees_by_root.items(): + root_proc = by_pid[root_pid] + session_owner = detect_session_owner(root_pid, by_pid) + + wt_path: str | None = None + slug: str | None = None + bean_nums: list[str] = [] + agent: str | None = None + model: str | None = None + docker_role: str | None = None + docker_resolve = False + docker_iteration: int | None = None + has_docker = False + has_waiter_only = all(k == "waiter" for _, k in members) + + for proc, kind in sorted(members, key=lambda m: m[0].pid): + try: + tokens = shlex.split(proc.command) + except ValueError: + tokens = proc.command.split() + + if kind == "flow": + raw_wt = _extract_flag_value(tokens, "--target-worktree") + if raw_wt: + wt_path = os.path.realpath(raw_wt) + agent = _extract_flag_value(tokens, "--agent") or agent + model = _extract_flag_value(tokens, "--model") or model + for tok in tokens: + base = Path(tok).name + if base in intent_by_name: + slug = intent_by_name[base].slug + bean_nums.extend(intent_by_name[base].bean_nums) + elif INTENT_FILE_RE.match(base): + im = INTENT_FILE_RE.match(base) + if im: + bean_nums.extend(re.findall(r"\d{4}", im.group(1))) + slug = slug or im.group(2) + elif kind == "docker": + has_docker = True + d_wt, d_role, d_res, d_iter = _parse_docker_flow_info(tokens) + wt_path = wt_path or d_wt + docker_role = d_role or docker_role + docker_resolve = docker_resolve or d_res + docker_iteration = d_iter if d_iter is not None else docker_iteration + # Runner and model appear as trailing positional args after image name. + for tok in tokens: + if tok in {"claude-agent", "antigravity-agent", "codex-agent"} and not agent: + agent = tok + elif kind == "waiter": + m_slug = re.search(r"(?:flow-|intent-(?:\d{4}-)+)([a-z0-9-]+)", proc.command) + if m_slug: + slug = slug or m_slug.group(1) + + if wt_path and wt_path in wt_by_path: + slug = slug or wt_by_path[wt_path].slug + elif not wt_path and slug and slug in wt_by_slug: + wt_path = str(wt_by_slug[slug].path) + + key = wt_path or (f"slug:{slug}" if slug else f"pid:{root_pid}") + if has_docker: + flow_kind = "running" + elif has_waiter_only: + flow_kind = "waiter" + else: + # Determine if the flow process itself is blocked polling admission or running a host step. + wt_obj = wt_by_path.get(wt_path) if wt_path else None + flow_kind = "polling" if wt_obj and wt_obj.admission.get("state") == "blocked" else "running" + + new_tree = LiveFlowTree( + root_pid=root_pid, + etime=root_proc.etime, + kind=flow_kind, + session_owner=session_owner, + worktree_path=wt_path, + slug=slug, + bean_nums=sorted(set(bean_nums)), + agent=agent, + model=model, + docker_role=docker_role, + docker_resolve=docker_resolve, + docker_iteration=docker_iteration, + duplicate_trees=1, + ) + + if key in result: + existing = result[key] + existing.duplicate_trees += 1 + if new_tree.kind == "running" and existing.kind != "running": + new_tree.duplicate_trees = existing.duplicate_trees + result[key] = new_tree + else: + result[key] = new_tree + + return result + + +def format_etime(etime: str) -> str: + """Format `ps` elapsed time (`DD-HH:MM:SS`, `HH:MM:SS`, `MM:SS`) compactly.""" + days = 0 + rest = etime.strip() + if "-" in rest: + d_str, rest = rest.split("-", 1) + try: + days = int(d_str) + except ValueError: + days = 0 + parts = rest.split(":") + try: + nums = [int(p) for p in parts] + except ValueError: + return etime + if len(nums) == 3: + hours, mins, secs = nums + elif len(nums) == 2: + hours, mins, secs = 0, nums[0], nums[1] + else: + return etime + + total_hours = days * 24 + hours + if total_hours > 0: + return f"{total_hours}h{mins:02d}m" + if mins > 0: + return f"{mins}m" + return f"{secs}s" + + +def _truncate(text: str, limit: int = 64) -> str: + collapsed = " ".join(text.split()) + if len(collapsed) <= limit: + return collapsed + return collapsed[: limit - 1].rstrip() + "…" + + +def _escape_cell(text: str) -> str: + return " ".join(text.split()).replace("|", "\\|") + + +def _infer_target_from_bean(bean: BeanRecord) -> str: + tags = set(bean.tags) + if "dev-env" in tags: + return "dev-env" + if "holon-coherence" in tags or "coherence" in tags: + return "Coherence" + if "holon-agentic-coder" in tags: + return "HAC" + if "harness" in tags or "beans" in tags or "skill" in tags: + return "harness" + return "HAC" + + +def _clean_halt_error(error: str) -> str: + if not error: + return "" + msg = error.replace("Autonomous review halted: ", "").replace("Autonomous review failed: ", "") + msg = msg.replace("Stage 4 failed: ", "").replace("Stage 3 refused: ", "") + return _truncate(msg, 72) + + +def _match_pr_for_unit( + wt: WorktreeFlow | None, + slug: str | None, + bean_nums: list[str], + prs: list[PullRequestInfo], +) -> PullRequestInfo | None: + if wt and wt.execution_branch: + for pr in prs: + if pr.head_ref_name == wt.execution_branch: + return pr + if slug: + slug_re = re.compile(rf"^I-\d+-{re.escape(slug)}/") + for pr in prs: + if slug_re.match(pr.head_ref_name): + return pr + for bnum in bean_nums: + num_re = re.compile(rf"(? str: + if live and live.docker_role == "review-loop": + mode = "Resolve" if live.docker_resolve else "Review" + iter_part = f" iter {live.docker_iteration}" if live.docker_iteration is not None else "" + return f"Stage 4 ({mode}{iter_part})" + if live and live.docker_role == "executor": + return "Stage 3 (Executing)" + if live and wt and wt.admission.get("state") == "blocked": + blockers = wt.admission.get("blocked_by") or [] + nums = [f"#{b['number']}" for b in blockers if isinstance(b, dict) and b.get("number") is not None] + blocker_str = ", ".join(nums) if nums else "overlap" + return f"Stage 3 (Blocked: {blocker_str})" + + if wt is None: + return "Stage 4 (Review)" if has_pr else "Not started" + + sr = wt.stage_results + cal_status = (sr.get("calibrate") or {}).get("status") if isinstance(sr.get("calibrate"), dict) else None + rev_status = (sr.get("review") or {}).get("status") if isinstance(sr.get("review"), dict) else None + exec_status = (sr.get("execute") or {}).get("status") if isinstance(sr.get("execute"), dict) else None + + if cal_status == "success": + if rev_status == "skipped": + return "Stage 5 (Calibrated; review skipped)" + return "Stage 5 (Calibrated)" + + if wt.admission.get("state") == "blocked" and exec_status != "success": + blockers = wt.admission.get("blocked_by") or [] + nums = [f"#{b['number']}" for b in blockers if isinstance(b, dict) and b.get("number") is not None] + blocker_str = ", ".join(nums) if nums else "overlap" + return f"Stage 3 (Blocked: {blocker_str})" + + if wt.current_stage == "review" and rev_status == "failed": + iter_part = f" iter {wt.review_iterations_done}" if wt.review_iterations_done else "" + return f"Stage 4 (Halted{iter_part})" + + if wt.current_stage: + return STAGE_LABELS.get(wt.current_stage, f"Stage ({wt.current_stage})") + return "Not started" + + +def _compact_model(model: str) -> str: + return model.removeprefix("claude-") + + +def _attempt_rank(wt: WorktreeFlow | None, live: LiveFlowTree | None, pr: PullRequestInfo | None) -> tuple[float, ...]: + live_score = 2.0 if live and live.kind == "running" else 1.0 if live else 0.0 + stage_score = float(STAGE_ORDER.index(wt.current_stage)) if wt and wt.current_stage in STAGE_ORDER else -1.0 + recency = wt.stage_started.timestamp() if wt and wt.stage_started else 0.0 + return (live_score, 1.0 if pr else 0.0, stage_score, recency) + + +def _derive_live_runner(wt: WorktreeFlow | None, live: LiveFlowTree | None) -> str: + if live: + model = _compact_model( + live.model or (wt.model if wt else None) or live.agent or (wt.agent if wt else None) or "unknown" + ) + elapsed = format_etime(live.etime) + if live.kind == "polling": + blockers = (wt.admission.get("blocked_by") or []) if wt else [] + nums = [f"#{b['number']}" for b in blockers if isinstance(b, dict) and b.get("number") is not None] + target_pr = ", ".join(nums) if nums else "PR" + return f"polling {target_pr}: {model} · {elapsed} (PID {live.root_pid}, {live.session_owner})" + if live.kind == "waiter": + return f"waiter · {elapsed} (PID {live.root_pid}, {live.session_owner})" + return f"{model} · {elapsed} (PID {live.root_pid}, {live.session_owner})" + + if wt and (wt.model or wt.agent): + return f"idle ({_compact_model(wt.model or wt.agent or '')})" + return "idle" + + +def _derive_pr_ci(pr: PullRequestInfo | None) -> str: + if pr is None: + return "—" + parts = [f"[#{pr.number}]({pr.url})", pr.ci_summary, f"{pr.reviews_count} rev"] + if pr.mergeable == "CONFLICTING": + parts.append("CONFLICTING") + if pr.is_draft: + parts.append("DRAFT") + return " · ".join(parts) + + +def _derive_notes( + group_beans: list[BeanRecord], + wt: WorktreeFlow | None, + pr: PullRequestInfo | None, + live: LiveFlowTree | None, +) -> str: + notes: list[str] = [] + if live and live.duplicate_trees > 1: + notes.append(f"⚠️ {live.duplicate_trees} processes on worktree") + + todo_statuses = [b.status for b in group_beans if b.status != "in-progress"] + if todo_statuses and (wt is not None or pr is not None or live is not None): + notes.append(f"bean status: {todo_statuses[0]}") + + if wt: + sr = wt.stage_results + rev_stage = sr.get("review") if isinstance(sr.get("review"), dict) else {} + cal_stage = sr.get("calibrate") if isinstance(sr.get("calibrate"), dict) else {} + rev_status = rev_stage.get("status") + cal_status = cal_stage.get("status") + + if cal_status == "success" and rev_status == "skipped": + notes.append("Ready for review (Stage 4 skipped via --skip-review)") + elif cal_status == "success": + notes.append("Ready for maintainer merge") + elif wt.admission.get("state") == "blocked" and (sr.get("execute") or {}).get("status") != "success": + blockers = wt.admission.get("blocked_by") or [] + files: list[str] = [] + for blk in blockers: + if isinstance(blk, dict): + for f in blk.get("files") or []: + files.append(Path(str(f)).name) + if files: + notes.append(f"Overlap on {', '.join(files[:3])}") + elif live and live.kind == "running": + if live.docker_role == "review-loop": + notes.append("Resolving review findings" if live.docker_resolve else "Ensemble reviewing PR") + elif live.docker_role == "executor": + notes.append("Executing plan in Docker") + else: + notes.append("Flow active") + elif rev_status == "failed": + err = _clean_halt_error(str(rev_stage.get("error") or "")) + if err: + notes.append(err) + + if wt.dirty_count and not (live and live.kind == "running"): + notes.append(f"dirty: {wt.dirty_count} file(s)") + + if not notes and group_beans: + blocked = [b.removeprefix("holon-agentic-coder-ref-metadata-") for g in group_beans for b in g.blocked_by] + if blocked: + notes.append(f"blocked by {', '.join(blocked)}") + else: + notes.append(f"status: {group_beans[0].status}") + + if pr and pr.reviews_count == 0 and wt is None: + notes.append("PR open; no local flow worktree") + + return "; ".join(notes) if notes else "—" + + +def build_in_flight_rows( + beans: dict[str, BeanRecord], + intents: list[IntentMapping], + worktrees: list[WorktreeFlow], + prs: list[PullRequestInfo], + live_by_key: dict[str, LiveFlowTree], + now: datetime | None = None, +) -> list[InFlightRow]: + """Correlate beans, intents, worktrees, open PRs, and live PIDs into active rows.""" + wt_by_slug = {w.slug: w for w in worktrees} + now = now or datetime.now(UTC) + + # Index active intents by parent intent slug (json slug and file slug), filtering out completed/scrapped beans. + active_by_slug: dict[str, list[str]] = {} + all_by_slug: dict[str, list[str]] = {} + for intent in intents: + active_nums = [n for n in intent.bean_nums if n not in beans or beans[n].status not in EXCLUDED_STATUSES] + for key in {intent.slug, intent.file_slug} - {""}: + all_by_slug.setdefault(key, []).extend(intent.bean_nums) + if active_nums: + active_by_slug.setdefault(key, []).extend(active_nums) + + def _lookup(index: dict[str, list[str]], slug: str) -> list[str]: + if slug in index: + return index[slug] + return index.get(VERSION_SUFFIX_RE.sub("", slug), []) + + class _SlugIndex: + def get(self, slug: str, default: Any = None) -> list[str]: + return list(_lookup(active_by_slug, slug)) + + slug_to_intent_beans = _SlugIndex() + + def is_slug_completed_only(slug: str) -> bool: + nums = _lookup(all_by_slug, slug) + return bool(nums) and all(n in beans and beans[n].status in EXCLUDED_STATUSES for n in nums) + + used_beans: set[str] = set() + used_worktrees: set[str] = set() + used_prs: set[tuple[str, int]] = set() + rows: list[InFlightRow] = [] + + def resolve_live(wt: WorktreeFlow | None, slug: str | None) -> LiveFlowTree | None: + if wt and str(wt.path) in live_by_key: + return live_by_key[str(wt.path)] + if slug and f"slug:{slug}" in live_by_key: + return live_by_key[f"slug:{slug}"] + return None + + # 1. Start from every flow worktree (unless mapped exclusively to completed/scrapped beans). + for wt in worktrees: + cand_beans = list(slug_to_intent_beans.get(wt.slug) or []) + for emb in wt.embedded_bean_nums: + if emb not in cand_beans and (emb not in beans or beans[emb].status not in EXCLUDED_STATUSES): + cand_beans.append(emb) + + # Skip worktrees whose only associated beans are completed or scrapped. + all_embedded_done = bool(wt.embedded_bean_nums) and all( + n in beans and beans[n].status in EXCLUDED_STATUSES for n in wt.embedded_bean_nums + ) + if is_slug_completed_only(wt.slug) or (not cand_beans and all_embedded_done): + continue + + cand_beans = sorted(set(cand_beans)) + pr = _match_pr_for_unit(wt, wt.slug, cand_beans, prs) + live = resolve_live(wt, wt.slug) + + group_beans = [beans[n] for n in cand_beans if n in beans] + # Skip idle, un-PR'd todo/draft worktrees? Wait: a local worktree with checkpoint means flow started! + if pr: + used_prs.add((pr.repo_name, pr.number)) + used_worktrees.add(str(wt.path)) + used_beans.update(cand_beans) + + if group_beans: + title = " + ".join(b.title for b in group_beans) if len(group_beans) > 1 else group_beans[0].title + else: + title = wt.slug.replace("-", " ") + + stage = _derive_stage(wt, live, pr is not None) + live_runner = _derive_live_runner(wt, live) + pr_ci = _derive_pr_ci(pr) + notes = _derive_notes(group_beans, wt, pr, live) + bucket = 0 if (live and live.kind == "running") else 1 if live else 2 + rows.append( + InFlightRow( + bean_nums=cand_beans, + target=wt.repo_name, + title=_truncate(title), + stage=stage, + pr_ci=pr_ci, + live_runner=live_runner, + notes=notes, + sort_bucket=bucket, + time_in_stage=format_duration(wt.stage_started, now) if stage != "Not started" else "—", + total_time=format_duration(wt.flow_started, now), + source=wt.dir_name, + rank=_attempt_rank(wt, live, pr), + ) + ) + + # 2. Live flows or open PRs without a matching local worktree (e.g., from another checkout). + for _key, live in live_by_key.items(): + if live.worktree_path and live.worktree_path in used_worktrees: + continue + if live.slug and live.slug in wt_by_slug and str(wt_by_slug[live.slug].path) in used_worktrees: + continue + if live.slug and is_slug_completed_only(live.slug): + continue + cand_beans = sorted( + { + n + for n in (live.bean_nums + (slug_to_intent_beans.get(live.slug or "", []))) + if n not in beans or beans[n].status not in EXCLUDED_STATUSES + } + ) + if live.bean_nums and not cand_beans: + continue + pr = _match_pr_for_unit( + None, live.slug, cand_beans, [p for p in prs if (p.repo_name, p.number) not in used_prs] + ) + if pr: + used_prs.add((pr.repo_name, pr.number)) + used_beans.update(cand_beans) + group_beans = [beans[n] for n in cand_beans if n in beans] + target = pr.repo_name if pr else (_infer_target_from_bean(group_beans[0]) if group_beans else "HAC") + title = group_beans[0].title if group_beans else (live.slug or "active flow") + rows.append( + InFlightRow( + bean_nums=cand_beans, + target=target, + title=_truncate(title), + stage=_derive_stage(None, live, pr is not None), + pr_ci=_derive_pr_ci(pr), + live_runner=_derive_live_runner(None, live), + notes=_derive_notes(group_beans, None, pr, live), + sort_bucket=0 if live.kind == "running" else 1, + total_time=format_duration(branch_started(pr.head_ref_name) if pr else None, now), + source=f"live PID {live.root_pid}", + rank=_attempt_rank(None, live, pr), + ) + ) + + # 3. Remaining open PRs not yet matched to a worktree or live flow. + for pr in prs: + if (pr.repo_name, pr.number) in used_prs: + continue + m_slug = BRANCH_SLUG_RE.match(pr.head_ref_name) + pr_slug = m_slug.group(1) if m_slug else None + if pr_slug and is_slug_completed_only(pr_slug): + continue + cand_beans = sorted(set(slug_to_intent_beans.get(pr_slug or "", []))) + used_beans.update(cand_beans) + group_beans = [beans[n] for n in cand_beans if n in beans] + title = group_beans[0].title if group_beans else pr.title + rows.append( + InFlightRow( + bean_nums=cand_beans, + target=pr.repo_name, + title=_truncate(title), + stage=_derive_stage(None, None, True), + pr_ci=_derive_pr_ci(pr), + live_runner="idle", + notes=_derive_notes(group_beans, None, pr, None), + sort_bucket=2, + total_time=format_duration(branch_started(pr.head_ref_name), now), + source=f"PR #{pr.number}", + rank=_attempt_rank(None, None, pr), + ) + ) + + # 4. Any remaining `in-progress` beans that have no flow worktree, open PR, or live PID yet. + for bnum, bean in sorted(beans.items()): + if bnum in used_beans or bean.status != "in-progress": + continue + rows.append( + InFlightRow( + bean_nums=[bnum], + target=_infer_target_from_bean(bean), + title=_truncate(bean.title), + stage="Not started", + pr_ci="—", + live_runner="idle", + notes=_derive_notes([bean], None, None, None), + sort_bucket=3, + source="bean", + ) + ) + + def sort_key(r: InFlightRow) -> tuple[int, str, str]: + first_bean = r.bean_nums[0] if r.bean_nums else "9999" + return (r.sort_bucket, first_bean, r.title) + + rows = merge_rows_per_bean(rows) + rows.sort(key=sort_key) + return rows + + +def merge_rows_per_bean(rows: list[InFlightRow]) -> list[InFlightRow]: + """Collapse rows sharing a bean into one: keep the live/most-advanced attempt, note the stale ones.""" + kept: list[InFlightRow] = [] + for row in sorted(rows, key=lambda r: r.rank, reverse=True): + host = next((k for k in kept if row.bean_nums and set(k.bean_nums) & set(row.bean_nums)), None) + if host is None: + kept.append(row) + continue + host.bean_nums = sorted(set(host.bean_nums) | set(row.bean_nums)) + note = f"stale attempt {row.source} ({row.stage}; {row.live_runner})" + host.notes = note if host.notes == "—" else f"{host.notes}; {note}" + return kept + + +def render_markdown_table(rows: list[InFlightRow]) -> str: + """Render in-flight bean rows as a single GitHub-Flavored Markdown table.""" + if not rows: + return "No beans are currently in flight." + + lines = [ + "| Bean # | Target | Title | Stage | Time in Stage | PR & CI | Total Time | Notes |", + "| :----- | :----- | :---- | :---- | :------------ | :------ | :--------- | :---- |", + ] + for row in rows: + bean_cell = ", ".join(row.bean_nums) if row.bean_nums else "—" + cells = [ + bean_cell, + row.target, + row.title, + row.stage, + row.time_in_stage, + row.pr_ci, + row.total_time, + row.notes_cell(), + ] + lines.append("| " + " | ".join(_escape_cell(c) for c in cells) + " |") + return "\n".join(lines) + + +def collect_progress( + repo_root: Path, + beans_dir: Path | None = None, + *, + no_gh: bool = False, + no_ps: bool = False, +) -> list[InFlightRow]: + """Collect live in-flight bean progress across all repos and active sessions.""" + resolved_root = repo_root.resolve() + resolved_beans = (beans_dir or (resolved_root / ".beans")).resolve() + + beans = scan_beans(resolved_beans) + intents = scan_intents(resolved_root / "todo") + repos = discover_repos(resolved_root) + worktrees = scan_worktrees(repos) + prs = fetch_open_prs(repos, no_gh=no_gh) + processes = scan_processes(no_ps=no_ps) + live_by_key = match_live_flows(processes, worktrees, intents) + return build_in_flight_rows(beans, intents, worktrees, prs, live_by_key) + + +def main(argv: list[str] | None = None) -> int: + """CLI entrypoint for `bean-progress`.""" + parser = argparse.ArgumentParser(description="Show live progress of all in-flight Holon beans.") + parser.add_argument( + "--repo-root", + default=str(Path(__file__).resolve().parents[4]), + help="Path to the harness repository root.", + ) + parser.add_argument( + "--beans-dir", + default=None, + help="Explicit directory containing bean markdown files (default: /.beans).", + ) + parser.add_argument( + "--json", + action="store_true", + help="Emit structured JSON array instead of a Markdown table.", + ) + parser.add_argument( + "--no-gh", + action="store_true", + help="Skip querying GitHub PRs via gh CLI.", + ) + parser.add_argument( + "--no-ps", + action="store_true", + help="Skip inspecting live host processes via ps.", + ) + args = parser.parse_args(argv) + + repo_root = Path(args.repo_root) + beans_dir = Path(args.beans_dir) if args.beans_dir else None + rows = collect_progress(repo_root, beans_dir, no_gh=args.no_gh, no_ps=args.no_ps) + + if args.json: + print(json.dumps([r.as_dict() for r in rows], indent=2)) + else: + print(render_markdown_table(rows)) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/.agents/skills/holon_flow/SKILL.md b/.agents/skills/holon_flow/SKILL.md index 09e0a20..1d4ac14 100644 --- a/.agents/skills/holon_flow/SKILL.md +++ b/.agents/skills/holon_flow/SKILL.md @@ -24,7 +24,8 @@ multi-hour containerised lifecycle, **the flow is executed inside a dedicated ba 1. **Background Subagent Execution (Bean 0212 & Flow Delegation)**: Running `holon flow` across all 5 stages takes between 15 minutes and several hours depending on plan complexity and review iterations. The main interactive agent **MUST NOT execute the flow inline**. Instead, it delegates to a background `Holon Flow Subagent` (`invoke_subagent` - with `TypeName: "self"`, `Role: "Holon Flow Subagent ()"`, `Model` = the lowest tier per + with `TypeName: "self"`, `Role: "bean - holon flow "` (named per + [subagents.md, "Subagent names"](../../subagents.md#subagent-names)), `Model` = the lowest tier per `.agents/model-tiers.md`) and immediately returns control to the user. 2. **Sole Change Path Invariant**: Every target codebase change (`holon-agentic-coder` or `holon-coherence`) MUST traverse the 5 containerised stages: @@ -59,12 +60,14 @@ multi-hour containerised lifecycle, **the flow is executed inside a dedicated ba the current stage or checkpoint: - **Claude (`claude-agent`)**: `claude-fable-5` $\rightarrow$ `claude-opus-5-5` $\rightarrow$ `claude-sonnet-4-6` $\rightarrow$ `claude-haiku-4-5`. - - **Antigravity (`antigravity-agent`)**: `gemini-3.8-pro-high` $\rightarrow$ `gemini-3.8-pro` $\rightarrow$ - `gemini-3.8-flash-medium` $\rightarrow$ `gemini-3.8-flash`. + - **Antigravity (`antigravity-agent`)**: `gemini-4-argon` $\rightarrow$ `gemini-4-hydrogen` $\rightarrow$ + `gemini-3.8-flash` (use `gemini-4-argon` for all Holon coding tasks until tokens run out). - **Antigravity AGY Subagent Runtime**: `Model: "inherit"` / `"pro"` $\rightarrow$ `"flash"` $\rightarrow$ `"flash_lite"`. - - **Cross-Runner Fallback**: If an account-wide limit is hit on the active runner, switch `--agent` between - `antigravity-agent` $\leftrightarrow$ `claude-agent` and resume execution on the existing flow branch. + - **No Cross-Runner Switch**: never switch `--agent` between `claude-agent` and `antigravity-agent` on your own. When + the active runner's ladder is exhausted, `scripts/run_holon_flow.py` stops and reports. The maintainer decides + whether to switch runner. A reset written without minutes (`resets 10am (UTC)`) counts as a named reset, so the + flow waits for it. 6. **PR Creation & Calibration Report Inclusion**: - Once Stage 3 pushes the `E-.../_` execution branch, the PR is opened via `gh pr create` targeting `main`. - Stage 5 Calibration creates the `/calibrated` audit branch. The calibration report (`plans/P-*_calibration.md`) @@ -86,8 +89,8 @@ multi-hour containerised lifecycle, **the flow is executed inside a dedicated ba Before executing any flow commands, evaluate the **Re-Entrancy Guard**: -- **Re-Entrancy Guard**: If the currently executing agent is _already_ the spawned `Holon Flow Subagent ()`, **DO - NOT spawn another nested subagent**. Proceed directly to +- **Re-Entrancy Guard**: If the currently executing agent is _already_ the spawned `bean - holon flow ` + subagent, **DO NOT spawn another nested subagent**. Proceed directly to [Step 1: Validate Prerequisites & Parameters](#step-1-validate-prerequisites--parameters). - **Main Interactive Agent Delegation**: When the user (or parent session) requests running a flow (e.g. `/holon-flow `): @@ -98,7 +101,7 @@ Before executing any flow commands, evaluate the **Re-Entrancy Guard**: ```json { "TypeName": "self", - "Role": "Holon Flow Subagent ()", + "Role": "bean - holon flow ", "Model": "", "Prompt": "You are the background Holon Flow Subagent for intent `` (target_worktree: ``, agent: ``, model: ``). Execute `.agents/skills/holon_flow/SKILL.md`. Because you are already the spawned Holon Flow Subagent, pass the Step 0 re-entrancy guard and proceed directly to Step 1. Drive the entire 5-stage Holon flow lifecycle (Intent -> Plan -> Execute -> Review Loop -> Calibration). Ensure PR creation, handle model fallback ladders on quota errors, verify that the calibration report is committed and pushed into the PR diff, check mergeability against target branch, and record state in `.subagent/flow__state.json`. Do NOT send intermediate messages; call `send_message` to the parent agent ONLY ONCE upon terminal completion (PR approved, calibrated, and awaiting human merge) or an unresolvable blocker." } @@ -121,7 +124,8 @@ Inside the background subagent, perform pre-flight verification: worktree itself) that exists and is a clean git repository. Create it from `origin/main` first if it does not exist. 5. **Determine Runner & Model**: - Default agent: `antigravity-agent` (or `claude-agent`) - - Default model: `gemini-3.8-flash-medium` (or `claude-fable-5` / `claude-opus-5-5`) + - Default model: `gemini-4-argon` (fallback: `gemini-4-hydrogen` $\rightarrow$ `gemini-3.8-flash`, or + `claude-fable-5` / `claude-opus-5-5`) --- @@ -173,9 +177,9 @@ If `holon flow` exits with an error: 1. **Quota / Credit / Session Limit Errors**: If the log contains `session limit`, `insufficient_quota`, `RESOURCE_EXHAUSTED`, or HTTP 429: - - Identify the next tier down on the fallback ladder (e.g. `gemini-3.8-pro` $\rightarrow$ `gemini-3.8-flash-medium` + - Identify the next tier down on the fallback ladder (e.g. `gemini-4-argon` $\rightarrow$ `gemini-4-hydrogen` $\rightarrow$ `gemini-3.8-flash`, or `claude-opus-5-5` $\rightarrow$ `claude-sonnet-4-6`). - - Switch `--agent` across runners if all tiers on the active runner share an exhausted account quota. + - Never switch `--agent` across runners without the maintainer's go-ahead; report the exhausted ladder instead. - Resume the flow using the saved checkpoint: ```bash @@ -247,9 +251,9 @@ Once the flow finishes: When Stage 3 admission refuses a plan because its touch set overlaps another flow in flight, `scripts/run_holon_flow.py` does not stop and never adds `--allow-overlap` itself. It polls each overlapping pull request named in the refusal -(`gh pr view --json state`, every `--overlap-poll-seconds`, default 300) until each is merged or closed, then -resumes the flow from its checkpoint, which runs admission again. An overlap with a local flow that has no pull request -is re-checked by re-running admission after the same interval. Any other refusal (no touch set declared, discovery +(`gh pr view --json state`, every `--overlap-poll-seconds`, default 60) until each is merged or closed, then resumes +the flow from its checkpoint, which runs admission again. An overlap with a local flow that has no pull request is +re-checked by re-running admission after the same interval. Any other refusal (no touch set declared, discovery unavailable) still stops. Pass `--no-wait-on-overlap` to stop on an overlap as before. ### Push notifications (ntfy.sh) @@ -259,7 +263,7 @@ and its checkpoint records Stage 5 as completed (`white_check_mark`, through `sc stops, fails or waits on a usage limit sends nothing, and neither does the limit watcher. The topic is read from `HOLON_NTFY_TOPIC` or `~/.holon/secrets/ntfy-topic` (mode 600, never committed or printed in reports; anyone who knows it can read the messages). With no topic configured it silently does nothing. Messages stay on the ntfy server for a -while, so they carry only the intent slug. Send a manual one with +while, so they carry only the intent slug and the PR number (no URL or repository name). Send a manual one with `python3 .agents/skills/holon_flow/scripts/notify_ntfy.py "Title" "Message" --priority high`; use it after any hand-run `holon calibrate` that the maintainer is waiting on, and only once calibration has finished. diff --git a/.agents/skills/holon_flow/scripts/run_holon_flow.py b/.agents/skills/holon_flow/scripts/run_holon_flow.py index 2c2b0e0..6710986 100755 --- a/.agents/skills/holon_flow/scripts/run_holon_flow.py +++ b/.agents/skills/holon_flow/scripts/run_holon_flow.py @@ -37,14 +37,13 @@ ] FALLBACK_LADDER_ANTIGRAVITY = [ - "gemini-3.8-pro-high", - "gemini-3.8-pro", - "gemini-3.8-flash-medium", + "gemini-4-argon", + "gemini-4-hydrogen", "gemini-3.8-flash", ] # How often an overlap wait re-checks the overlapping pull requests (or, for a local flow with none, re-runs admission). -OVERLAP_POLL_SECONDS = 300 +OVERLAP_POLL_SECONDS = 60 OVERLAP_REFUSAL = "Stage 3 refused: the touch set overlaps" QUOTA_ERROR_PATTERNS = [ @@ -52,6 +51,10 @@ "session limit reached", "insufficient_quota", "resource_exhausted", + "quota exceeded", + "quota exhausted", + "quota_exhausted", + "usage limit", "rate_limit_exceeded", "too many requests", "http 429", @@ -101,22 +104,24 @@ def resolve_next_model(agent: str, current_model: str) -> tuple[str, str] | None # Current model not in ladder, fall back to second tier return agent, ladder[1] - # Cross-runner fallback to antigravity - log_warn("Claude ladder exhausted; switching runner to antigravity-agent.") - return "antigravity-agent", FALLBACK_LADDER_ANTIGRAVITY[0] + # Never switch runner on our own: the maintainer decides (no auto-switch to antigravity/gemini). + log_warn("Claude ladder exhausted; not switching runner without the maintainer's go-ahead.") + return None elif "antigravity" in agent.lower() or "gemini" in agent.lower(): ladder = FALLBACK_LADDER_ANTIGRAVITY + base_model = re.sub(r"-(?:xhigh|high|medium|low)$", "", current_model) + lookup = current_model if current_model in ladder else base_model try: - idx = ladder.index(current_model) + idx = ladder.index(lookup) if idx + 1 < len(ladder): return agent, ladder[idx + 1] except ValueError: return agent, ladder[1] - # Cross-runner fallback to claude - log_warn("Antigravity ladder exhausted; switching runner to claude-agent.") - return "claude-agent", FALLBACK_LADDER_CLAUDE[0] + # Never switch runner on our own: the maintainer decides. + log_warn("Antigravity ladder exhausted; not switching runner without the maintainer's go-ahead.") + return None return None @@ -186,6 +191,19 @@ def parse_intent_file(intent_path: Path) -> dict[str, str]: return data +def find_flow_pr(target_worktree: Path, slug: str) -> dict | None: + """Return the open pull request (number, headRefName, title, url) whose head branch or title names the slug.""" + res = subprocess.run( + ["gh", "pr", "list", "--state", "open", "--json", "number,headRefName,title,url"], + cwd=target_worktree, + capture_output=True, + text=True, + check=True, + ) + prs = json.loads(res.stdout) + return next((pr for pr in prs if slug in pr["headRefName"] or slug in pr["title"].lower()), None) + + def verify_pr_and_calibration( target_worktree: Path, slug: str, @@ -198,26 +216,15 @@ def verify_pr_and_calibration( log_stage("Verifying Pull Request & Calibration Integrity") - # Locate PR using gh CLI try: - res = subprocess.run( - ["gh", "pr", "list", "--state", "open", "--json", "number,headRefName,title,url"], - cwd=target_worktree, - capture_output=True, - text=True, - check=True, - ) - prs = json.loads(res.stdout) + pr = find_flow_pr(target_worktree, slug) except Exception as exc: log_warn(f"Could not query GitHub PRs: {exc}") return - - matching_prs = [pr for pr in prs if slug in pr["headRefName"] or slug in pr["title"].lower()] - if not matching_prs: + if pr is None: log_warn(f"No open PR found matching slug '{slug}'.") return - pr = matching_prs[0] pr_number = pr["number"] pr_url = pr["url"] head_branch = pr["headRefName"] @@ -297,13 +304,19 @@ def execute_flow_process( def resolve_flow_worktree(target_worktree: Path, slug: str, dry_run: bool = False) -> Path: """Return the worktree the flow runs in; a ``main`` target becomes a dedicated ``flow-`` worktree. + A ``flow-`` target that does not exist yet, beside a ``main`` worktree, is created the same way. + The ``main`` worktree must stay on ``main`` and identical to ``origin/main``, but stages 4 and 5 check out the execution branch and commit in the target worktree. A sibling ``flow-`` worktree is cut from ``origin/main`` (the name and branch ``holon flow`` derives itself) and used instead; it is reused when it already exists. """ target_worktree = target_worktree.resolve() if target_worktree.name != "main": - return target_worktree + main_worktree = target_worktree.parent / "main" + if target_worktree.exists() or not target_worktree.name.startswith("flow-") or not main_worktree.exists(): + return target_worktree + # A missing flow- worktree next to the main worktree is cut from origin/main, like a main target. + target_worktree, slug = main_worktree, target_worktree.name.removeprefix("flow-") clean_slug = re.sub(r"[^a-zA-Z0-9_\-]+", "-", slug.strip()).strip("-") or "flow" flow_worktree = target_worktree.parent / f"flow-{clean_slug}" if flow_worktree.exists(): @@ -344,10 +357,10 @@ def parse_limit_reset(output: str): from datetime import datetime, timedelta from zoneinfo import ZoneInfo - m = re.search(r"resets\s+(\d{1,2}):(\d{2})\s*(am|pm)(?:\s*\(([^)]+)\))?", output, re.I) + m = re.search(r"resets\s+(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s*\(([^)]+)\))?", output, re.I) if not m: return None - hour, minute, ampm, tz_name = int(m.group(1)), int(m.group(2)), m.group(3).lower(), m.group(4) + hour, minute, ampm, tz_name = int(m.group(1)), int(m.group(2) or 0), m.group(3).lower(), m.group(4) hour = hour % 12 + (12 if ampm == "pm" else 0) try: tz = ZoneInfo(tz_name) if tz_name else None @@ -586,9 +599,14 @@ def _notify_outcome(intent_path: Path, exit_code: int, target_worktree: Path) -> slug = parse_intent_file(intent_path)["slug"] if exit_code == 0 and _calibration_done(target_worktree, slug): + try: + pr = find_flow_pr(target_worktree, slug) + except Exception: # noqa: BLE001 - the PR number is a nicety; still notify without it + pr = None + ref = f"PR #{pr['number']}" if pr else "the PR" notify( - f"Holon flow calibrated: {slug}", - "Calibration is done and in the PR. Review and merge it when you are ready.", + f"Holon flow calibrated: {ref} ({slug})" if pr else f"Holon flow calibrated: {slug}", + f"Calibration is done and in {ref}. Review and merge it when you are ready.", tags="white_check_mark", ) except Exception: # noqa: BLE001 - a notification must never break a flow @@ -621,8 +639,8 @@ def main() -> None: parser.add_argument( "--model", type=str, - default="gemini-3.8-flash-medium", - help="Model tier for the agent runner (default: gemini-3.8-flash-medium).", + default=FALLBACK_LADDER_ANTIGRAVITY[0], + help="Model tier for the agent runner (default: gemini-4-argon).", ) parser.add_argument( "--from-stage", diff --git a/.agents/skills/post_pr_merge/SKILL.md b/.agents/skills/post_pr_merge/SKILL.md index 536ea78..20a8ba3 100644 --- a/.agents/skills/post_pr_merge/SKILL.md +++ b/.agents/skills/post_pr_merge/SKILL.md @@ -11,7 +11,8 @@ description: > [!NOTE] **Model tier: lowest.** This skill is mechanical, so run it in a dedicated subagent on the lowest-tier model, > found by probing the harness as described in [`.agents/model-tiers.md`](../../model-tiers.md). Do not hard-code a -> model name here. +> model name here. Name the subagent `# - post-merge` (see +> [subagents.md, "Subagent names"](../../subagents.md#subagent-names)). This skill orchestrates the end-to-end post-merge lifecycle across the Holon ecosystem (`holon-agentic-coder`, `holon-coherence`, and `holon-agentic-coder-ref-metadata`) once a Pull Request is merged into `main`. diff --git a/.agents/skills/pr_review_loop/SKILL.md b/.agents/skills/pr_review_loop/SKILL.md index 5544ac0..96d3040 100644 --- a/.agents/skills/pr_review_loop/SKILL.md +++ b/.agents/skills/pr_review_loop/SKILL.md @@ -343,9 +343,9 @@ resolution step is executed in a dedicated, fresh subagent**. interactive session, the main agent MUST NOT execute the loop inline. Running the multi-iteration loop directly in the main interactive thread hijacks the user's conversation across dozens of subagent wakeups. Instead, the main agent immediately delegates the entire loop lifecycle to a dedicated background **PR Review Loop Orchestrator** - subagent (`invoke_subagent` with `TypeName: "self"`, `Model: "inherit"`, - `Role: "PR Review Loop Orchestrator ( PR #)"`) and immediately returns control to the user (see - [Step 0](#step-0-entrypoint-delegation--spawn-the-background-loop-orchestrator-subagent) and + subagent (`invoke_subagent` with `TypeName: "self"`, `Model: "inherit"`, `Role: "# - review loop orchestrator"`, + named per [subagents.md, "Subagent names"](../../subagents.md#subagent-names)) and immediately returns control to + the user (see [Step 0](#step-0-entrypoint-delegation--spawn-the-background-loop-orchestrator-subagent) and [`.agents/coordination.md`](../../coordination.md)). --- @@ -358,10 +358,9 @@ Follow these steps when executing the `pr-review-loop` skill: Before executing any loop setup or iteration steps, evaluate the **Re-Entrancy Guard**: -- **Re-Entrancy Guard**: If the currently executing agent is _already_ the spawned - `PR Review Loop Orchestrator ( PR #)` subagent (or a background flow orchestrator subagent executing Stage 4 - of the Holon flow), **DO NOT spawn another nested loop orchestrator**. Proceed directly to - [Step 1: Parse Parameters](#step-1-parse-parameters). +- **Re-Entrancy Guard**: If the currently executing agent is _already_ the spawned `# - review loop orchestrator` + subagent (or a background flow orchestrator subagent executing Stage 4 of the Holon flow), **DO NOT spawn another + nested loop orchestrator**. Proceed directly to [Step 1: Parse Parameters](#step-1-parse-parameters). - **Main Interactive Agent Delegation**: When the user (or a parent interactive session) invokes `/pr-review-loop `, the main interactive agent **MUST NOT execute the loop inline**. Instead: 1. Resolve ``, PR number ``, the target worktree path, and `` (default `25`). @@ -372,14 +371,14 @@ Before executing any loop setup or iteration steps, evaluate the **Re-Entrancy G ```json { "TypeName": "self", - "Role": "PR Review Loop Orchestrator ( PR #)", + "Role": "# - review loop orchestrator", "Model": "inherit", - "Prompt": "You are the background PR Review Loop Orchestrator ( PR #). Execute `.agents/skills/pr_review_loop/SKILL.md` for `` (worktree: ``, max_iterations: ``). Because you are already the spawned PR Review Loop Orchestrator subagent, pass the Step 0 re-entrancy guard and proceed directly to Step 1. Own the entire loop lifecycle (state tracking in `.subagent/`, Phase A dry-run review, Phase B 3-agent `pr-reviewer` ensemble consensus review, CI check verification, Phase C `pr-review-resolver` when `CHANGES_REQUESTED`, posting the final consensus review to GitHub upon `APPROVED`, and running Stage 5 `holon calibrate` for Holon flow PRs). Do NOT message the parent agent on intermediate iterations; call `send_message` to the parent agent ONLY ONCE upon terminal completion (`APPROVED` + calibrated) or an unresolvable terminal stop (`MAX_ITERATIONS_REACHED` / `DIVERGING`)." + "Prompt": "You are the background PR Review Loop Orchestrator (`# - review loop orchestrator`). Execute `.agents/skills/pr_review_loop/SKILL.md` for `` (worktree: ``, max_iterations: ``). Because you are already the spawned PR Review Loop Orchestrator subagent, pass the Step 0 re-entrancy guard and proceed directly to Step 1. Own the entire loop lifecycle (state tracking in `.subagent/`, Phase A dry-run review, Phase B 3-agent `pr-reviewer` ensemble consensus review, CI check verification, Phase C `pr-review-resolver` when `CHANGES_REQUESTED`, posting the final consensus review to GitHub upon `APPROVED`, and running Stage 5 `holon calibrate` for Holon flow PRs). Do NOT message the parent agent on intermediate iterations; call `send_message` to the parent agent ONLY ONCE upon terminal completion (`APPROVED` + calibrated) or an unresolvable terminal stop (`MAX_ITERATIONS_REACHED` / `DIVERGING`)." } ``` - 3. The spawned `PR Review Loop Orchestrator ( PR #)` subagent owns the entire loop lifecycle across all - phases and iterations: + 3. The spawned `# - review loop orchestrator` subagent owns the entire loop lifecycle across all phases and + iterations: - Maintaining `.subagent/_pr_state.json`, `_pr_coordination.json`, and `_pr_loop_history.md` in the harness `.subagent/` directory. - Spawning the per-iteration dry-run reviewer and the 3 `pr-reviewer` ensemble subagents, and synthesising the @@ -486,7 +485,7 @@ Execute the review pass in a clean, isolated subagent context. ##### 📋 Generic Subagent Contract (Any Coding Agent): -- **Role**: `PR Reviewer (Iteration )` +- **Role**: `# - iter dry-run reviewer` - **Context Isolation**: Spin off a dedicated child context using your agent's native subagent tool, child task runner, or child process to keep parent context clean and prevent prompt degradation. - **Capabilities**: Child agent MUST possess file-writing tools (`write_to_file`, `replace_file_content`, or child @@ -498,8 +497,8 @@ Execute the review pass in a clean, isolated subagent context. - **Model**: Inherit the parent agent's model (`inherit`). If credit or quota runs out on `"inherit"` / `"pro"`, automatically fall back along `Model: "inherit"` / `"pro"` $\rightarrow$ `"flash"` $\rightarrow$ `"flash_lite"` (and similarly step down `claude-opus-5-5` $\rightarrow$ `claude-sonnet-4-6` $\rightarrow$ `claude-haiku-4-5` or - `gemini-3.8-pro-high` $\rightarrow$ `gemini-3.8-flash-medium` $\rightarrow$ `gemini-3.8-flash`) and continue the loop - from the current iteration without losing completed work. + `gemini-4-argon` $\rightarrow$ `gemini-4-hydrogen` $\rightarrow$ `gemini-3.8-flash`) and continue the loop from the + current iteration without losing completed work. - **Prompt Instructions**: > Load and execute the `pr-reviewer` skill for `` in **Dry-Run Mode (`--dry-run`)** with > **Single-Agent Mode** enabled. @@ -535,7 +534,7 @@ In the AGY runtime, call `invoke_subagent`: "Subagents": [ { "TypeName": "self", - "Role": "PR Reviewer (Iteration )", + "Role": "# - iter dry-run reviewer", "Model": "inherit", "Prompt": "" } @@ -567,7 +566,7 @@ Wait for the subagent to complete and inspect its report. or strictly one-at-a-time on a local model runtime** (principle 11); independence, fresh context and blind voting are identical in both modes: - **Generic Subagent Contract (Any Coding Agent)**: - - **Role**: `PR Ensemble Reviewer (Iteration )` + - **Role**: `# - iter ensemble reviewer ` - **Capabilities**: All 3 ensemble reviewer children and the consensus synthesizer child MUST possess file-writing tools (`write_to_file`, `replace_file_content`, or child equivalent). In AGY, use `TypeName: "self"`. Any pass that returns a verdict without writing its report artifact to disk is recorded @@ -617,7 +616,7 @@ Wait for the subagent to complete and inspect its report. "Subagents": [ { "TypeName": "self", - "Role": "PR Ensemble Reviewer (Iteration )", + "Role": "# - iter ensemble reviewer ", "Model": "inherit", "Prompt": "" } @@ -741,7 +740,7 @@ Execute the resolution pass in a clean, isolated subagent context. ##### 📋 Generic Subagent Contract (Any Coding Agent): -- **Role**: `PR Review Resolver (Iteration )` +- **Role**: `# - iter resolver` - **Context Isolation**: Spin off a dedicated child context using your agent's native subagent tool, child task runner, or child process to keep parent context clean and apply code fixes safely. - **Capabilities**: Child agent MUST possess file-writing and command execution tools (`write_to_file`, @@ -749,8 +748,8 @@ Execute the resolution pass in a clean, isolated subagent context. - **Model**: Inherit the parent agent's model (`inherit`). If credit or quota runs out on `"inherit"` / `"pro"`, automatically fall back along `Model: "inherit"` / `"pro"` $\rightarrow$ `"flash"` $\rightarrow$ `"flash_lite"` (and similarly step down `claude-opus-5-5` $\rightarrow$ `claude-sonnet-4-6` $\rightarrow$ `claude-haiku-4-5` or - `gemini-3.8-pro-high` $\rightarrow$ `gemini-3.8-flash-medium` $\rightarrow$ `gemini-3.8-flash`) and continue the loop - from the current iteration without losing completed work. + `gemini-4-argon` $\rightarrow$ `gemini-4-hydrogen` $\rightarrow$ `gemini-3.8-flash`) and continue the loop from the + current iteration without losing completed work. - **Target Worktree**: Locate the target repository worktree under `apps/holon-agentic-coder/{branch}`, `apps/holon-coherence/{branch}`, or repository root. - **Prompt Instructions**: @@ -796,7 +795,7 @@ In the AGY runtime, call `invoke_subagent`: "Subagents": [ { "TypeName": "self", - "Role": "PR Review Resolver (Iteration )", + "Role": "# - iter resolver", "Model": "inherit", "Prompt": "" } diff --git a/.agents/skills/prioritise_beans/scripts/prioritise_beans.py b/.agents/skills/prioritise_beans/scripts/prioritise_beans.py index 4a4df1a..d869c7a 100755 --- a/.agents/skills/prioritise_beans/scripts/prioritise_beans.py +++ b/.agents/skills/prioritise_beans/scripts/prioritise_beans.py @@ -30,19 +30,18 @@ # built from the previous checkpoint date is used instead. EXECUTIVE_SUMMARY_NARRATIVE: list[str] = [ ( - "The harness now drives every `holon-agentic-coder` change through the 5-stage Holon flow and the " - "`pr-review-loop`, and the maintainer merges each pull request into `main`. The most recent stretch " - "(2026-11-10 to 2026-11-11) was dominated by one incident and its repair, described in the last paragraph " - "below: a sandbox escape reached `main` behind a review that said `APPROVED (3/3)` while a reviewer still " - "held an open critical finding. It was reverted, the review loop's consensus decision was fixed, and the " - "change was re-landed with the escape closed." + "The harness drives every `holon-agentic-coder` change through the 5-stage Holon flow and the `pr-review-loop`, " + "and the maintainer merges each pull request into `main`. On 2026-11-23 every active bean was audited against " + "current `main` (`holon-agentic-coder` `0f0089d`, `holon-coherence` `baf5c65`, `dev-env` `68ddec9`) and merged " + "PRs #221–#241 plus `dev-env` PRs #31–#33 and #36–#38: duplicate Bean 0353 was scrapped in favour of Bean 0354, " + "stale `blocked_by` links and outdated 'in flight in another session' markers (`0322` and `0346` completed; " + "`0265`, `0270` idle) were cleared, and new beans `0350`–`0352` and `0354`–`0361` were triaged. HAC PRs #243 " + "(`0155`, `CLEAN`), #244 (`0175`, `UNSTABLE`), and #245 (`0191`, `UNSTABLE`) are open, while `dev-env` " + "**Bean 0361** (`PR #33`), **Bean 0351** (`PR #36`), **Bean 0364** (`PR #37`), and **Bean 0365** (`PR #38`) " + "have all merged into `main` (zero open `dev-env` PRs)." ), "", - ( - "Concurrent flows on overlapping files forced repeated syncs and re-reviews earlier on (141 review-loop " - "passes, about 10M+ tokens), so flows that touch the same files still run one after another; only flows " - "with disjoint touch sets run together." - ), + "Concurrent flows on overlapping files forced repeated syncs and re-reviews earlier on (141 review-loop passes, about 10M+ tokens), so flows that touch the same files still run one after another; only flows with disjoint touch sets run together.", ] # Closing paragraph(s) of the Executive Summary (after the statistics bullets). @@ -376,57 +375,83 @@ "a resolver turn that fails writes no adjudication rows and leaves its findings open, a rejection needs a reason, " "and a review resume sends open findings to the resolver first. Review approved 3/3 at iteration 3; calibration " "predicted 61.85 against an actual 77.72 (delta +15.87). **Bean 0337** is new (a flow refused at Stage 3 admission " - "still counts as in flight), and Beans 0331 and 0335 run in the live `resumetip` flow." + "still counts as in flight). Beans 0331 and 0335 merged as PR #208 (`00fa535`) and are completed. **Bean 0337** merged as PR #209 (`7dc0342`) and is completed. **Bean 0283** merged as PR #210 (`30d7c77`) and is completed." + ), + "", + "**2026-11-21:** every active bean was audited against `origin/main`. Locations moved by the `flow/` and `cli/` package splits were corrected in Beans 0157, 0175, 0181, 0191-0194, 0200, 0231, 0255 and 0269; Bean 0146 and Bean 0197 were narrowed to what remains after PR #213; the blocked-by links to completed or scrapped Beans 0168, 0185, 0187 and 0195 were cleared. New: **Bean 0347** (Stage 4 says halted for human review although consensus approval was reached and the flow carries on to Stage 5). The audit found no bean already done by PRs #209 to #220 beyond those already completed.", + "", + ( + "**2026-11-22 to 2026-11-23:** twenty target PRs merged across `holon-agentic-coder` and `dev-env`: " + "**Bean 0322** (HAC #222, `e2ba3c2`: complete removal of `gemini-agent`), **Bean 0172** (HAC #225, `4811599`: " + "`unlimited` stage and turn budgets), **Bean 0348** (HAC #226, `3ee9c4e`: admission uses actual PR files), " + "**Bean 0199** (HAC #227, `43d278c`: ledger query and knowledge index decomposed), **Bean 0193** (HAC #228, " + "`5fbd2d0`: intent and plan stages decomposed), **Bean 0349** (HAC #229, `ccb7a6f`: Antigravity writable " + "`brain`/`conversations` tmpfs and `empty_diff` excerpt), **Bean 0196** (HAC #234, `2ec094e`, plus children " + "#231–#233: `ExecutionRun`), **Bean 0194** (HAC #236, `b22258d`: `ExecuteStage`), **Bean 0358** (HAC #235 " + "`134e333` and #237 `032d9d44`: resolver honours turn budgets, foreground test prompts, and supervisor " + "live-child-process stall guard), **Bean 0357** (HAC #238, `8afc215a`: `--skip-review` removed), **Bean 0355** " + "(HAC #240, `192c6e8`: `holon calibrate` runs full Stage 5), **Bean 0356** (HAC #239, `4e1e761`: resume flags " + "override checkpoint), **Beans 0347 & 0354** (HAC #230, `f17f4b8`: Stage 4 `review: approved` status & fresh " + "local test gate), **Bean 0189** (HAC #241, `0f0089d`: `launcher/` package breaks `flow` -> `cli` cycle), plus " + "`dev-env` PRs #31 (**Bean 0344**, `0ba3e94`), #32 (**Bean 0346**, `d6b07de`), #33 (**Bean 0361**, " + "`425ff6fe`: Fish Conda/Homebrew hooks & clean-env multi-shell tests), #36 (**Bean 0351**, `a9dacf46`: " + "Ansible `deb822_repository` & task hygiene, unconditional WSL exclusion of Ghostty/Warp, and `tmux` " + "`set -g mouse on`), #37 (**Bean 0364**, `4b1391c3`: define `devenv_user`, skip WSL GUI terminal wizard " + "prompt, and audit Ansible Jinja2 variables in tests), and #38 (**Bean 0365**, `68ddec98`: disable " + "`expand_argument_vars` on Conda clean-shell command tasks, enforce static `$VAR` command hygiene, and add " + "hermetic `ansible-playbook` verification test). Open **HAC PRs #243** (`0155`), **#244** (`0175`), and " + "**#245** (`0191`) remain in progress, and new **Bean 0360** logs duplicate `P-` branch creation after an " + "interrupted Stage 2. Pre-triage audit (2026-11-23): **Bean 0353** scrapped as a duplicate of `0354`; stale " + "blockers cleared on `0189`, `0197`, `0198`, `0265`, `0270`, `0333`; `0176` re-measured at 144 files; `0181` " + "re-pointed to `entrypoint/executor/run.py`; new beans `0350`–`0352` and `0354`–`0361` triaged." ), ] -MILESTONES_HEADING = "## Key Milestones Completed (Beans 0080 – 0334)" +MILESTONES_HEADING = "## Key Milestones Completed (Beans 0080 – 0365)" # Hand-authored replacement for the generated "Recommended Next Execution # Sequence" section, used whenever active beans exist. Inline data: keep it in # step with the matrix at every checkpoint. NEXT_EXECUTION_SEQUENCE: list[str] = [ - "**Start here (2026-11-20):** Bean 0323 merged as HAC PR #207 (`d0b3e23`) and is completed; the harness installs were rebuilt from `main` at `d0b3e23` the same day. The next flow is Beans 0331 (target half) and 0335 (P1 and P2), which run in the live `resumetip` flow now that PR #207 has cleared its overlap. Run one flow at a time, because the next lanes share the Stage 3 resume path and the flow package. Keep `HOLON_TOKEN_REDUCE=0` until Bean 0283 lands.", - "", - "**Rule (2026-10-25):** never run concurrent flows whose touched files overlap. The engine enforces this from Bean 0151: a flow whose touch set overlaps an in-flight flow is refused before Stage 3 unless `--allow-overlap` is given. Items inside one lane below run one at a time. Lanes run together only when their touch sets are disjoint.", - "", - "**Rule (2026-10-26):** no stage before the merge may halt for human review. The PR merge is the only human step, after consensus review and Stage 5 calibration.", - "", - "**Rule (2026-10-28) and worktree rule (2026-11-09):** the target suites rely solely on pytest. A flow never runs in the `main` worktree; it runs in a `flow-` worktree off `origin/main`.", - "", - "**Tooling:** `holon 0.1.0` and `holon-coherence 0.1.0` were reinstalled from `main` (`d0b3e23`) on 2026-11-20. `holon --version` prints no commit, so the editable install is the check. Set `HOLON_STAGE_BUDGET_EXECUTE_MINUTES=10080` until Bean 0172 lands.", - "", - "**Serial chain, `holon-agentic-coder` (one flow at a time; these touch the ledgers, `agent_defaults.py`, the planner and the flow package):**", - "1. **Beans 0331 (target half) and 0335** as one flow, running as the live `resumetip` flow: both change the Stage 3 resume path (`entrypoint/execution_workspace.py`), and 0335 resumes from the execution branch tip instead of the ledger `partial_head`. PR #207 has merged, so its Stage 3 can start.", - "2. **Bean 0337** (P1; a flow refused at Stage 3 admission must not count as in flight; `flow/in_flight.py`) after 0331 and 0335, since it changes the same admission and resume path.", - "3. **Bean 0336** (Stage 4 review container leaves the worktree detached), in the review-loop lane; unblocked by Bean 0323's merge.", - "4. **Bean 0283** (P1; planner entrypoint, `payload_cleaner`), unblocked by the 0321 merge.", - "5. **Bean 0322** (P3; `agent_defaults.py`, `agent_runner.py`, `Dockerfile`, `docker-bake.hcl`), then **Bean 0270** after 0322 (model discovery; also blocked on a usable runner).", - "6. **Bean 0146**, then **Bean 0197** (`calibration.py`), and **Bean 0181** (`/_` only on branch refs). The 0321 naming change they waited for has landed.", - "**Review loop and calibration lane (`entrypoint/review_loop.py`, `flow/review/`, `review_report.py`):** unblocked now that 0297 has merged, one item at a time.", - "- **Bean 0255** (streaming per-issue resolvers, one consolidated commit per iteration), then **Bean 0234** (CI check progress logging; pairs with the completed 0160).", - "- **Bean 0261** (`review_report.py`: one clean evaluation line), then **Bean 0269** (deferred nits from PR #158).", - "- **Bean 0213** (reflect review-loop skill rules into the native review-loop agent template).", + ( + "**Start here (2026-11-23):** every active bean was audited against current `main` (`holon-agentic-coder` " + "`0f0089d`, `holon-coherence` `baf5c65`, `dev-env` `68ddec9`) and open HAC PRs #243 (`0155`), #244 (`0175`), " + "#245 (`0191`). PR #222 (0322), PR #225 (0172), PR #226 (0348), PR #227 " + "(0199), PR #228 (0193), PR #229 (0349), PR #230 (0347, 0354), PR #234 (0196), PRs #235 & #237 (0358), PR #236 " + "(0194), PR #238 (0357), PR #239 (0356), PR #240 (0355), PR #241 (0189), and `dev-env` PRs #31–#33 (0344, " + "0346, 0361), #36 (0351), #37 (0364), and #38 (0365) have merged. Run one flow at a time within a lane; lanes " + "run together only when their touch sets are disjoint." + ), "", - "**Flow package and decomposition lane (`flow/` submodules, one flow at a time per submodule):**", - "- **Bean 0264** (module budgets move to `holon-config/hygiene/module_budgets.json`), then **Bean 0265** (move-only split of `cli/__init__.py`). 0265 unblocks 0189.", - "- **Bean 0189** (launcher module; breaks the `flow` to `cli` cycle), then **Bean 0190** (checkpoint and ledger reconciliation), then **Bean 0200** (remove the diverged `token_reduction` copy; after 0189) and **Bean 0199** (ledger query and knowledge index; after 0190).", - "- **Bean 0191** (one GitHub adapter), then **Bean 0192** (`ReviewLoop` object). **Bean 0196** (`ExecutionRun`; after 0190, with 0195 completed).", - "- **Beans 0193 and 0194** (intent, plan and execute stage modules; after 0187, completed). **Bean 0198** (runner registry; after 0322 because both touch runner registration). **Bean 0153** (remove comments per package, last in each package after its split). **Bean 0152** is the umbrella that tracks this lane.", - "- **Bean 0231** (P3; error-string fix in the flow package, no bundle partner left).", + ( + "**In-flight (active flows / open PRs):** **HAC PR #243** (`0155`, `CLEAN`), **HAC PR #244** (`0175`, " + "`UNSTABLE`), and **HAC PR #245** (`0191`, `UNSTABLE`)." + ), "", - "**Config, security and CLI lane (`cli/`, credentials, ledger redaction):**", - "- **Bean 0155** (route `HOLON_*` values through the 0600 env file), then **Bean 0148** (redact before truncating `error_context`).", - "- **Bean 0172** (explicit unlimited budgets), then **Bean 0174** (environment variable reference), then **Bean 0173** (layered `.env`; touches `cli/`, after 0155, 0148 and 0174). **Bean 0223** (CLI flag and env audit).", - "- **Bean 0225** (OS keychain-only Claude token; follows the completed 0224).", - "- **Bean 0175** (token-scope pre-flight) and **Bean 0157** (mitmproxy sidecar reachability; pairs with the completed 0227).", - "- **Bean 0176** (pytest-only conversion of every test file) runs alone, because it touches most test files.", + ( + "**Ready now in parallel (disjoint from PRs #243/#244/#245 and each other):**\n" + "- **HAC beads removal:** **Bean 0333** (P1, M — removes `.beads/` pilot, unblocks GitHub Issues migration `0215`–`0218` and `0317`).\n" + "- **HAC runner/model lane (one at a time):** **Bean 0270** (P1, M — dynamic model discovery), **Bean 0350** (P1, M — `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1`), **Bean 0198** (P2, M — `RunnerSpec` registry), or **Bean 0225** (P2, M — OS keychain Claude token).\n" + "- **HAC calibration lane:** **Bean 0197** (P2, M — `calibration/` package; `0355` merged in PR #240).\n" + "- **HAC documentation / cleanup (unblocked now that PR #230/#241 merged):** **Bean 0174** (P1, M — env var reference), **Bean 0359** (P3, XS — PR #230 deferred nit D-1), and **Bean 0200** (P2, M — remove `token_reduction` copy, now unblocked by `0189`), **Bean 0269** (P3, XS — PR #158 nits, sequence with `0197`).\n" + "- **HAC Stage 2 / ledger / config:** **Bean 0360** (P1, S — interrupted Stage 2 duplicate `P-` branch), **Bean 0181** (P2, M — `/_` only on branch refs).\n" + "- **Independent / host / `holon-coherence`:** **Bean 0226** (P2, L — operator-run sub-1B e2e), **Bean 0141** (P3, M — host vMLX tuning), **Bean 0142** (P2, L — benchmark), and the `holon-coherence` slice of **Bean 0153** (P2 — all coherence decompositions are merged)." + ), "", - "**Beads adoption and harness work (harness-only or disjoint; can run beside any lane):**", - "- **Bean 0215** (beans-to-beads converter) and **Bean 0246** (harness skill wording) touch no target repository and can run beside any flow.", - "- **Bean 0216** (flow drives beads work items) touches the flow, so it waits for the serial chain. Then **Bean 0217** (adopt beads in holon-coherence), **Bean 0218** (port harness skills; retire the harness) and **Bean 0317** (GitHub Projects board; after 0215 and 0216).", + ( + "**Queued behind PRs #243 / #244 / #245 (file overlap):**\n" + "- **CLI split & config lane (after PR #243/#244):** **Bean 0265** (`cli/__init__.py` split) -> **Bean 0173** (layered `.env`, after `0155` & `0174`), **Bean 0157** (sidecar opt-in), **Bean 0223** (CLI flag/env audit).\n" + "- **Review-loop lane (after PR #245 `0191`):** **Bean 0192** (`ReviewLoop` object), **Bean 0255** (streaming resolvers), **Bean 0352** (`gh webhook forward` + cheap polling), **Bean 0231** (raw count nit).\n" + "- **Solo repo-wide sweep:** **Bean 0176** (144 test files, runs alone with zero other HAC PRs in flight).\n" + "- **GitHub Issues migration chain:** **Bean 0333** -> **Bean 0215** (harness importer) + **Bean 0216** (flow `work_item`) -> **Bean 0217** (`holon-coherence`) + **Bean 0317** (Projects board) -> **Bean 0218** (port skills & retire harness).\n" + "- **Umbrella / per-package / draft:** **Bean 0152** (umbrella), **Bean 0153** (remove comments/docstrings per package after split), **Bean 0340** (draft module-budget revisit; awaits maintainer authorisation)." + ), "", - "**Independent or benchmarking (run alone when they start real flows):** **Bean 0226** (end-to-end test on a sub-1B local model; operator-run, never opens a PR), **Bean 0166** (CI pipeline duration dashboard), **Bean 0142** (real-workload benchmark, Qwen3.8 dense vs Flash-Next MoE) and **Bean 0141** (vmlx tuning, pairs with 0142).", + ( + "**Rules:** never run concurrent flows whose touched files overlap; no stage before merge halts for human review; " + "target suites use `uv run pytest` only; flows run in dedicated `flow-` worktrees off `origin/main`. " + "`HOLON_STAGE_BUDGET_*` accepts `unlimited` (Bean 0172)." + ), ] # Manual triage overrides for every active bean: display title, priority, @@ -434,83 +459,21 @@ # judgement rather than a truncated first paragraph. Insertion order is the # matrix row order (priority blocks, hand-curated within each block). OVERRIDES: dict[str, dict[str, str]] = { - "0335": { - "title": "A Stage 3 resume restarts from the ledger partial_head and ignores commits added to the execution branch tip", - "priority": "**P2**", - "impact": "Medium", - "sizing": "S", - "domain": "Holon Flow / Stage 3 / Resume", - "notes": "In progress in the live `resumetip` flow. Seen on the shortref flow: a hand-merged origin/main on the execution branch was ignored on resume, because the executor resumes from the ledger partial_head. Resume from the branch tip when it descends from the recorded partial head. Same resume path as Bean 0331, so one flow. Do not push an execution branch before its ledger row exists.", - }, - "0336": { - "title": "A Stage 4 review container left the shared flow worktree on a detached HEAD, so the resolver refused to run", - "priority": "**P2**", - "impact": "Medium", - "sizing": "S", - "domain": "Holon Flow / Stage 4 / Worktree", - "notes": "Todo. Seen on PR #206 (2026-11-19): the review container left the flow worktree on a detached HEAD while the host worktree was mounted, and the resolver refused to run until it was re-attached by hand. Re-attach or refuse on container exit. Unblocked by Bean 0323's merge (PR #207); same review-loop lane.", - }, - "0337": { - "title": "A flow refused at Stage 3 admission still counts as in flight, so two waiting flows block each other", + "0360": { + "title": "Resume after an interrupted plan stage creates a duplicate P- branch", "priority": "**P1**", "impact": "High", - "sizing": "M", - "domain": "Holon Flow / Stage 3 / Admission", - "notes": "Decided 2026-11-20: a refused flow gets an explicit blocked state with its blockers, and only admitted flows count as in flight (`local_in_flight_flows`, `flow/in_flight.py`). Admission runs under a per-repository lock. Same admission and resume path as Beans 0331 and 0335, so it follows them.", - }, - "0280": { - "title": "The flow does not re-check CI after the calibration push; the macOS timing gate is flaky near 300 s", - "priority": "**P2**", - "impact": "Medium", - "sizing": "M", - "domain": "Calibration / CI", - "notes": ( - "Wait for CI on the final head after Stage 5 and name failed checks. The 300 s gate headroom is a " - "maintainer decision. Touches `flow/stages/calibrate.py`." - ), - }, - "0160": { - "title": "Review loop burns its iteration budget polling pending CI, then reports test failures", - "priority": "**P0**", - "impact": "High", "sizing": "S", - "domain": "Review Loop / CI", - "notes": ( - "PR #101 added bounded CI waiting within the iteration budget; remaining: separate " - "`HOLON_REVIEW_CI_WAIT_SECONDS` budget and pending-vs-failed error reporting. Pair with 0234." - ), - }, - "0151": { - "title": "Planner estimates the touch set; overlapping concurrent flows are blocked", - "priority": "**P0**", - "impact": "High", - "sizing": "L", - "domain": "Holon Flow / Concurrency", - "notes": ( - "Unblocked by 0159 (#97 merged), 0201 (#142 merged), and 0149 (#146 merged). Sequence after 0254 " - "(`flow/` package split). Must handle `{parent}--{n}-{slug}` child branches." - ), + "domain": "Flow / Stage 2 / Checkpoint", + "notes": "Ready in Stage 2 plan/checkpoint lane (`PR #239` merged). Record pushed `P-` branch atomically with push or adopt existing pushed `P-` branch on resume.", }, - "0331": { - "title": "Each --allow-overlap resume moves the plan tip, so Stage 3 partial work is never continued", + "0333": { + "title": "GitHub Issues replace beads as the target tracker; remove the beads pilot from holon-agentic-coder", "priority": "**P1**", "impact": "High", "sizing": "M", - "domain": "Holon Flow / Stage 3 / Resume", - "notes": ( - "In progress. Harness half done: `run_holon_flow.py` no longer adds `--allow-overlap` after an admission " - "refusal, and `flow_env.py` sets the execute budget. Target half: a Stage 3 partial head that descends " - "from an older plan tip is accepted on resume, with a hermetic test. It touches the Stage 3 resume code " - "(`entrypoint/execution_workspace.py`), which Bean 0321 changed. 0321 merged on 2026-11-20, so this is unblocked; it shares the resume path with Bean 0335, so both go in one flow, which runs as the live `resumetip` flow." - ), - }, - "0283": { - "title": "An agent's API error output is written as the plan and reported as a metrics failure", - "priority": "**P1**", - "impact": "High", - "sizing": "M", - "domain": "Planner / Token Reduction", - "notes": "Todo. The planner writes an Anthropic API 400 as the plan and then hides it behind a metrics failure, and a failed attempt leaves an untracked plan file. Fix: fail the stage on API error output, leave no plan file behind, and keep `cache_control` blocks consistent in `payload_cleaner`. Touches the planner entrypoint that 0321 also touched; 0321 has merged, so it is unblocked. Workaround until it lands: `HOLON_TOKEN_REDUCE=0`.", + "domain": "Issue Tracking / Decision", + "notes": "Ready now (disjoint from PR #230; 0321 and 0322 merged). Removes `.beads/config.yaml`, `bd` install in Dockerfile/bake, `test_beads_integration.py`, and beads docs. Unblocks `0215`–`0218` and `0317`.", }, "0270": { "title": "Discover runner models dynamically through each harness instead of the hardcoded model table", @@ -518,233 +481,47 @@ "impact": "High", "sizing": "M", "domain": "Flow / Architecture", - "notes": "Todo, and blocked for now: the flow needs a usable runner (Antigravity quota and `claude-agent` login at the time of the bean). Replaces the hardcoded `RUNNER_CAPABILITIES` table with per-harness discovery. Shares `agent_defaults.py` with 0322 (0321 has merged), so it runs after 0322. Sizing is a triage estimate.", + "notes": "Ready now (runner/quota block cleared; 0262 and 0322 merged; disjoint from PR #230). Replaces hardcoded `RUNNER_CAPABILITIES` in `agent_defaults.py` with per-harness discovery. Sequence with `0198` and `0350` on `agent_defaults.py`.", }, - "0299": { - "title": "Stage 5 calibrate no longer fails with git diff 'ambiguous argument' on nested sub-intent branch names", + "0350": { + "title": "Enable Claude Code code mode (CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1) for every Claude run", "priority": "**P1**", "impact": "High", - "sizing": "S", - "domain": "Stage 5 / Calibration", - "notes": ( - "Open as PR #197 (`calbrnch`). Blocks Bean 0151, which needs the decomposed flow's calibration to run. " - "Disjoint from Bean 0298 (merged as `721cd36`)." - ), - }, - "0300": { - "title": "CI runs once per change, on the pull request only, not also on push", - "priority": "**P2**", - "impact": "Medium", "sizing": "M", - "domain": "CI / Token cost", - "notes": ( - "Drop the `push` trigger from every workflow. The timing baselines on `main` must move to a " - "`pull_request: closed` (merged) job or a schedule, so the timing gate keeps updating." - ), + "domain": "Claude / Config", + "notes": "Ready now (disjoint from PR #230). Direct harness edit (`flow_env.py`, `.claude/settings.json`) plus HAC flow on `agent_runner.py` / `agent_defaults.py` / `role_dispatcher.sh` / `doctor`. Sequence with `0270` and `0198`.", }, - "0265": { - "title": "Split `cli/__init__.py` into focused modules (move only), like the `flow/` package", + "0155": { + "title": "General `HOLON_*` forwarding puts credential-shaped values on the docker argv", "priority": "**P1**", "impact": "High", - "sizing": "L", - "domain": "Refactor / Architecture", - "notes": ( - "Splits the 2,026-line `cli/__init__.py` (80 definitions, 96 `mock.patch` targets, 63 importers) into " - "`cli/{log,constants,network,credentials,repo_resolution,mounts,proxy_sidecar,env_files,containers,doctor," - "role_dispatch,parser}.py` with re-exports and a throwaway AST verification, no committed snapshot. Hold " - "until PR #152 (Bean 0262) and Beans 0263 and 0264 merge. Unblocks Bean 0189." - ), - }, - "0264": { - "title": "Read module size budgets from configuration instead of hardcoding paths and numbers in the check", - "priority": "**P2**", - "impact": "Medium", "sizing": "M", - "domain": "Lint / Configuration", - "notes": ( - "Moves the `flow/` size budgets into `holon-config/hygiene/module_budgets.json` (packages, default " - "ceiling, overrides with reasons) read by a generic `check_module_budgets.py`, deleting " - "`flow_module_budgets.json`. Agents may change the configuration; raised limits warn instead of failing. " - "Hold until Bean 0263 merges." - ), - }, - "0263": { - "title": ( - "Retire the `flow.py` move-proof snapshot and its test: it now blocks every change to a moved function" - ), - "priority": "**P2**", - "impact": "Medium", - "sizing": "S", - "domain": "Tests / Flow Package", - "notes": ( - "Touches `tests/flow/` and `docs/architecture.md` only. Deletes `flow_py_definitions.json`, " - "`move_proof.py` and `test_move_proof.py`, and reworks `test_package_exports.py` to read the package " - "itself. Ready now that Bean 0262 has merged." - ), + "domain": "Security", + "notes": "In progress in HAC PR #243 (`CLEAN`). Send every `HOLON_*` value through the 0600 env-file and widen fuzz assertions to all forwarded names.", }, - "0256": { - "title": ( - "Resolver agent committing locally causes `_commit_and_push_resolution` to skip verification and " - "`git push`, losing all fixes" - ), + "0175": { + "title": "Check GitHub token scopes before Stage 3 when the plan touches workflow files", "priority": "**P1**", "impact": "High", "sizing": "S", - "domain": "Review Loop / Resolver", - "notes": ( - "Disjoint from `flow/` (touches `entrypoint/review_loop.py` and `test_review_loop.py`). Capture " - "`pre_resolver_head` before `_run_resolver_agent` and `git reset --soft ` if `HEAD` " - "moved, so `_commit_and_push_resolution` always verifies, attaches trailers, commits, and pushes." - ), + "domain": "Holon Flow / GitHub", + "notes": "In progress in HAC PR #244 (`UNSTABLE`). Pre-flight `workflow` scope when touch set hits `.github/workflows/**` and warn in `holon doctor`.", }, - "0260": { - "title": "Never post intermediate review iterations or aborted review passes to GitHub PR", + "0174": { + "title": "Document every environment variable holon reads, in one generated and CI-checked reference", "priority": "**P1**", - "impact": "High", - "sizing": "S", - "domain": "Review Loop / Observability", - "notes": ( - "Only post consensus review comments when `consensus_reached` is True or the 25-iteration budget is " - "fully exhausted. Aborted, timed-out, or failed review passes remain local in `.subagent/` and are never " - "posted to GitHub. Prevents intermediate spam on GitHub PRs." - ), - }, - "0261": { - "title": "Deduplicate and streamline PR review evaluation line in consensus report", - "priority": "**P2**", "impact": "Medium", - "sizing": "XS", - "domain": "Review Loop / Report", - "notes": ( - "Streamline redundant evaluation header text in `review_report.py` to print a single clean summary line " - "matching canonical skill output and avoiding duplicated PR/iteration metadata." - ), - }, - "0262": { - "title": ( - "Mount host-provisioned worktree into sandbox containers to eliminate in-container git cloning and " - "mid-crash state loss" - ), - "priority": "**P1**", - "impact": "High", "sizing": "M", - "domain": "Flow / Sandbox / Worktree", - "notes": ( - "Bind-mount host worktree (`flow-`) directly to `/home/holon/.holon-sandbox/workspace`. Completely " - "purge in-container git cloning and volume resets (`_clone_or_fetch`, `_reset_reused_checkout`), named " - "volume machinery, and associated mock tests. Unify intermediate review artifacts under " - "`/.subagent/`." - ), - }, - "0255": { - "title": "Streaming per-issue resolvers during Stage 4 CI & review with single consolidated commit", - "priority": "**P1**", - "impact": "High", - "sizing": "L", - "domain": "Review Loop / Concurrency", - "notes": ( - "Spin up isolated resolvers immediately as each CI pipeline fails (e.g. `Test - Hygiene` at 10 s) while " - "continuing to wait for remaining pipelines, then merge all resolver fixes and push a single commit per " - "iteration. Sequence after 0254 and 0256; pairs with 0234." - ), - }, - "0246": { - "title": "Eliminate duplicate review comments in harness `pr-review-loop` skill", - "priority": "**P2**", - "impact": "Low", - "sizing": "XS", - "domain": "Skills / Harness", - "notes": "Target-side fix landed in PR #139 (Bean 0236); verify/close remaining harness skill doc wording.", - }, - "0239": { - "title": ( - "Stage 5 calibration commits and pushes promoted knowledge and wisdom artifacts to /calibrated and PR" - ), - "priority": "**P1**", - "impact": "High", - "sizing": "S", - "domain": "Stage 5 / Calibration", - "notes": ( - "Stage and commit `holon-knowledge/kb/` and `holon-knowledge/wisdom/` in `run_calibration_stage()` so " - "promoted failure modes, patterns, and heuristics are included on `/calibrated` and in the PR. Intent " - "in `todo/`." - ), - }, - "0236": { - "title": ( - "Post consensus review once per PR exit instead of duplicating via both gh pr comment and gh pr review" - ), - "priority": "**P1**", - "impact": "High", - "sizing": "S", - "domain": "Review Loop / GitHub", - "notes": ( - "`post_pr_review_consensus()` currently calls both `gh pr comment` and `gh pr review` (which falls back " - "to `gh pr review --comment` on HTTP 422), producing 2 identical posts on PR #126. Submit once via `gh " - "pr review`. Intent in `todo/`." - ), - }, - "0233": { - "title": "Validate that `--repo-dir` is an attached git worktree", - "priority": "**P1**", - "impact": "High", - "sizing": "S", - "domain": "CLI / Flow Validation", - "notes": ( - "Fail fast before Stage 1 or checkpoint resume if `--repo-dir` is a bare repo or non-worktree directory " - "(`git rev-parse --is-inside-work-tree`), preventing hours-in Stage 4/5 host checkout crashes. Intent in " - "`todo/`." - ), - }, - "0234": { - "title": "Event-driven CI check progress reporting during Stage 4 review", - "priority": "**P1**", - "impact": "Medium", - "sizing": "S", - "domain": "Review Loop / Logging", - "notes": ( - "Log total CI pipelines once at start (`Tracking N GitHub CI check(s)...`) and emit a log line only " - "when a check completes or changes state, suppressing 15 s polling noise. Intent in `todo/`; pair with " - "0160." - ), - }, - "0227": { - "title": "Sidecar readiness probe false positive (docker-proxy accepts before mitmproxy binds)", - "priority": "**P1**", - "impact": "High", - "sizing": "S", - "domain": "Token Reduce / Proxy", - "notes": ( - "Fix complete on `fix/0227-proxy-readiness-http-probe` (`36c9765`), suite green; hand-authored under " - "the explicit-instruction exception. Awaiting maintainer call on PR creation." - ), + "domain": "Documentation / Config", + "notes": "Ready now (`0172` in PR #225 and `0347`/`0354` in PR #230 merged). Precursor to `0173` (layered `.env`).", }, - "0187": { - "title": "Split `flow.py` into a `flow/` package, one module per stage and concern (move only)", + "0265": { + "title": "Split `cli/__init__.py` into focused modules (move only), like the `flow/` package", "priority": "**P1**", "impact": "High", "sizing": "L", "domain": "Refactor / Architecture", - "notes": ( - "After 0185 (#115 merged) and 0188 (#117 merged). >5,500 lines; AST-verified move only. Runs alone among " - "`flow.py` PRs; unblocks 0189, 0190, 0191, 0193, 0194, 0197." - ), - }, - "0189": { - "title": "Launcher module owns container launch and role dispatch; break the `flow` -> `cli` cycle", - "priority": "**P1**", - "impact": "High", - "sizing": "M", - "domain": "Refactor / Architecture", - "notes": "After 0187 (0188 is merged as #117); unblocks 0200. Runs with 0190 and precedes 0183.", - }, - "0190": { - "title": "`FlowCheckpoint` and ledger reconciliation own their behaviour; entrypoints stop importing flow", - "priority": "**P1**", - "impact": "High", - "sizing": "M", - "domain": "Ledger / Holon Flow", - "notes": "After 0187; 0158 (PR #111, same code) has merged. Precedes 0183. Unblocks 0196, 0199.", + "notes": "Sequence after PR #243 (`0155`) / #244 (`0175`) which touch `cli/__init__.py`.", }, "0191": { "title": "One GitHub adapter owns every `gh` call (PR, CI probe, mergeability, review posting)", @@ -752,15 +529,7 @@ "impact": "High", "sizing": "M", "domain": "GitHub / Architecture", - "notes": "After 0187. Unblocks 0192.", - }, - "0195": { - "title": "Executor entrypoint's raw `git` subprocess calls go through a `GitRepository` adapter", - "priority": "**P1**", - "impact": "High", - "sizing": "M", - "domain": "Executor / Git", - "notes": "After 0185 (#115 merged). 81 raw `git` calls; disjoint from `flow.py`. With 0190, unblocks 0196.", + "notes": "In progress in HAC PR #245 (`UNSTABLE`). Unblocks `0192`.", }, "0192": { "title": "`run_review_loop` and `run_review_stage` become a `ReviewLoop` object with named steps", @@ -768,26 +537,15 @@ "impact": "High", "sizing": "L", "domain": "Review Loop / Refactor", - "notes": "After 0191. 528 lines, CC 131. Sequence after 0160/0234 (same touch set).", + "notes": "Blocked by `0191`. `flow/review/loop.py` is 936 lines. Sequence one at a time in the review-loop lane with PR #230, `0255`, and `0231`.", }, - "0196": { - "title": "Executor entrypoint `main` becomes an `ExecutionRun` with named steps; module becomes a package", + "0255": { + "title": "Streaming per-issue resolvers during Stage 4 CI & review with single consolidated commit", "priority": "**P1**", "impact": "High", "sizing": "L", - "domain": "Executor / Refactor", - "notes": "After 0195 and 0190. 798 lines, CC 178 (worst in the repository).", - }, - "0175": { - "title": "Check GitHub token scopes before Stage 3 when the plan touches workflow files", - "priority": "**P1**", - "impact": "High", - "sizing": "S", - "domain": "Holon Flow / GitHub", - "notes": ( - "A 55-minute Stage 3 for Bean 0168 was lost to a push rejected for the missing `workflow` scope. " - "Complements 0171 (#108 merged, refused-push patch salvage)." - ), + "domain": "Review Loop / Concurrency", + "notes": "Queued behind PR #230 (overlaps `flow/review/loop.py`, `entrypoint/review_loop.py`). One at a time with `0191`, `0192`, `0231`.", }, "0157": { "title": "`holon flow` auto-enables the mitmproxy sidecar; role containers cannot reach it", @@ -795,85 +553,15 @@ "impact": "High", "sizing": "S", "domain": "Holon Flow / Proxy", - "notes": "Workaround: `HOLON_TOKEN_REDUCE=0`. Pairs with 0227 (`fix/0227-proxy-readiness-http-probe`).", - }, - "0161": { - "title": "Decomposed sub-intents have no flow path to `main` and do not build on each other", - "priority": "**P0**", - "impact": "High", - "sizing": "L", - "domain": "Holon Flow", - "notes": ( - "Blocks Bean 0262 (PRs #152 and #155). Corrected design 2026-11-09: Stage 2 records the split decision on " - "the plan; Stage 3 only executes the children; children are cut from and target the plan branch; a " - "combined PR carrying the parent plan and every child reaches `main`; resume continues an existing child " - "instead of re-running it. Open decision: who merges a child PR into the plan branch. " - "Docs: PRs #103, #110 and #113 (all merged)." - ), - }, - "0149": { - "title": "Plan and execution IDs collide across concurrently planned intents", - "priority": "**P1**", - "impact": "High", - "sizing": "M", - "domain": "Provenance / Planner", - "notes": "#91 and #92 shared `P-1792765112`. Prerequisite for 0151.", - }, - "0155": { - "title": "General `HOLON_*` forwarding puts credential-shaped values on the docker argv", - "priority": "**P1**", - "impact": "High", - "sizing": "M", - "domain": "Security", - "notes": "Already on main. Default fix: send every `HOLON_*` value through the 0600 env-file.", - }, - "0148": { - "title": "Redact before truncating ledger `error_context`; close `CredentialRedactor` gaps", - "priority": "**P1**", - "impact": "High", - "sizing": "M", - "domain": "Security / Ledger", - "notes": "Route those rows through `redact_agent_secrets`.", - }, - "0146": { - "title": "Plans-ledger correction rows; calibration picks the right predicted metrics", - "priority": "**P1**", - "impact": "Medium", - "sizing": "M", - "domain": "Calibration / Ledger", - "notes": ( - "Every calibration in the 2026-10-26 batch needed a manual annotation. Runs before 0197 (same parser)." - ), - }, - "0213": { - "title": "Reflect review-loop skill rules into native Review Loop Holon Agent", - "priority": "**P1**", - "impact": "High", - "sizing": "M", - "domain": "Review Loop / Prompts", - "notes": ( - "Target: `holon-agentic-coder`. Unblocked now that 0221/0228/0229 are merged: reflects target-branch " - "conflict checks, ledger-only fast resolution, and model fallback into `review_loop.template.md`." - ), + "notes": "Queued behind PR #230 (overlaps `flow/context.py`) and sequenced with `0265` (`cli/__init__.py`). Workaround: `HOLON_TOKEN_REDUCE=0`.", }, "0215": { - "title": "Deterministic beans-to-beads JSONL converter and real-data dry run", + "title": "Deterministic beans-to-GitHub-Issues importer and real-data dry run", "priority": "**P1**", "impact": "High", "sizing": "S", "domain": "Issue Tracking / Migration", - "notes": ( - "Harness work. Converts bean frontmatter + body to beads JSONL for `bd import`; verified on all open " - "beans per rule 10. Unblocks 0217." - ), - }, - "0172": { - "title": "Stage and turn budgets accept an explicit 'unlimited' value, distinct from unset (default)", - "priority": "**P1**", - "impact": "Medium", - "sizing": "S", - "domain": "Holon Flow / Config", - "notes": "Workaround today: `HOLON_STAGE_BUDGET_EXECUTE_MINUTES=10080`. Pair with or follow 0232.", + "notes": "Harness work. Blocked by `0333` (remove beads pilot & finalise decision). Converts open beans to GitHub Issues with real-corpus dry run; unblocks `0217`, `0218`, and `0317`.", }, "0173": { "title": "holon loads layered .env files (specific overrides broad) that every sandbox stage inherits", @@ -881,17 +569,7 @@ "impact": "High", "sizing": "M", "domain": "Holon Flow / Config", - "notes": "Project `.env` overrides the broader `.env`. Touches `cli/`; sequence after 0155/0148 and 0174.", - }, - "0174": { - "title": "Document every environment variable holon reads, in one generated and CI-checked reference", - "priority": "**P1**", - "impact": "Medium", - "sizing": "M", - "domain": "Documentation / Config", - "notes": ( - "After 0172; precursor to 0173, whose layered `.env` needs this reference's allow-list and secret flags." - ), + "notes": "Sequence after `0155`, `0174`, and `0265` (touches `cli/` and `role_dispatcher.sh`).", }, "0176": { "title": "Remove every unittest reference from holon-agentic-coder; the suite is pytest only", @@ -899,18 +577,7 @@ "impact": "High", "sizing": "L", "domain": "Tests", - "notes": ( - "Unblocked by 0168 (#99 merged). 59 `TestCase` classes and about 60 `unittest.mock` imports in 29 files. " - "Runs alone: it touches most test files." - ), - }, - "0166": { - "title": "Pipeline duration dashboard for CI builds", - "priority": "**P1**", - "impact": "High", - "sizing": "M", - "domain": "CI / Observability", - "notes": "Check org Actions performance metrics first. Shares data and baseline with 0163 (#109, #30).", + "notes": "Re-measured 2026-11-23 on `main` (`b22258d`): **144** tracked files mention `unittest`. Runs alone with zero other HAC PRs in flight (after PR #230 merges).", }, "0152": { "title": "Audit long files; decompose oversized functions (flow.py, cli.py first)", @@ -918,22 +585,23 @@ "impact": "High", "sizing": "XL", "domain": "Refactor / Concurrency", - "notes": ( - "Umbrella for the Bean 0177 action beans 0185-0200 and 0203-0208; 0185, 0186, 0188, and 0203-0207 are " - "merged. Remaining: `flow.py` split (0187) and per-module lanes." - ), + "notes": "Umbrella. Coherence (`0186`, `0203`–`0208`) and HAC (`0185`, `0188`, `0190`, `0193`, `0194`, `0195`, `0196`, `0199`, `0254`) children merged. Remaining: `0265`, `0189`, `0191`, `0192`, `0197`, `0198`, `0200`, `planner.py`, and re-audit.", }, - "0208": { - "title": "holon-coherence: a `ProxyLifecycle` class owns proxy start-up, readiness and teardown", + "0197": { + "title": "Split `calibration.py` into a package; decompose metrics parsing and report generation", "priority": "**P2**", "impact": "Medium", "sizing": "M", - "domain": "Proxy / holon-coherence", - "notes": ( - "In progress as coherence PR #41 (`2f30d6e`): Stage 3 pushed, but both unit jobs are red (9 failures in " - "`test_start.py`, `test_web_token.py`, `test_cli.py`), so Stage 4 has not started. Resume from the " - "existing execution branch; 0203-0207 are merged." - ), + "domain": "Calibration / Refactor", + "notes": "Ready now (0146 merged in PR #221; disjoint from PR #230 which edits `calibration_outcome.py`). `calibration.py` is 1,637 lines. Sequence with `0355` on `flow/stages/calibrate.py`.", + }, + "0198": { + "title": "Agent runner registry: one `RunnerSpec` module per agent", + "priority": "**P2**", + "impact": "Medium", + "sizing": "M", + "domain": "Runners / Refactor", + "notes": "Ready now (`0322` merged in PR #222, dropping `gemini` from scope; disjoint from PR #230). Must carry `AGENT_TICKERS`. Sequence with `0270` and `0350` on `agent_defaults.py` / `agent_runner.py`.", }, "0225": { "title": "Claude token lives only in the OS keychain; retire the plaintext secrets file", @@ -941,18 +609,15 @@ "impact": "Medium", "sizing": "M", "domain": "Agent Runner / Credentials", - "notes": "After 0224 (extends its discovery seam). Keychain-only; one-time migration deletes the file.", + "notes": "Ready now (0224 merged in PR #170; disjoint from PR #230). Extends `claude_credential.py` discovery seam to OS keychain only with one-time file migration. Sequence with `0350` if touching runner config.", }, - "0223": { - "title": "Audit CLI flags vs HOLON_* env vars: four-kind decision rule, flag>env precedence", + "0352": { + "title": "Push GitHub PR events through `gh webhook forward`, with cheap polling as the fallback", "priority": "**P2**", "impact": "Medium", - "sizing": "L", - "domain": "CLI / Config", - "notes": ( - "Exhaustive inventory of every add_argument and os.getenv; boundary-crossing=both, " - "per-invocation=flag, ambient=env-primary, secrets=env-only." - ), + "sizing": "M", + "domain": "GitHub / Efficiency", + "notes": "Queued behind PR #230 (overlaps review-loop CI/conflict polling and `run_holon_flow.py` / skills). Needs `cli/gh-webhook` + `admin:repo_hook` scope on maintainer `gh`; stopgap until `gh event listen` is enabled.", }, "0226": { "title": "End-to-end test for the holon flow commands with full teardown", @@ -960,19 +625,7 @@ "impact": "High", "sizing": "L", "domain": "Testing / E2E", - "notes": ( - "Runs on a sub-1B local model via the `local_llm` envelope (no cloud secrets); never opens a PR; " - "unconditional teardown of worktrees and remote `I-…` trees; invariant assertions + bounded whole-run " - "retries. Operator-run `test-e2e` task, excluded from CI." - ), - }, - "0230": { - "title": "Purge residual harness bean ids from target sources", - "priority": "**P2**", - "impact": "Medium", - "sizing": "S", - "domain": "Hygiene / Rule 12", - "notes": "PR #123 loop deferral (out-of-increment). Touches `flow.py` - unblocked now that 0229 is merged.", + "notes": "Ready (operator-run local sub-1B model via `local_llm`, never opens a PR, excluded from CI). Reconcile test mode with `0357` (removes `--skip-review`).", }, "0181": { "title": "Use the `/_` leaf only when referencing a git branch, never on ids", @@ -980,80 +633,15 @@ "impact": "Medium", "sizing": "M", "domain": "Holon Flow / Ledger", - "notes": ( - "`intents.jsonl` `branch` and `parent_intent_id` hold refs; migrate with readers accepting both shapes. " - "After 0161 (overlaps `flow.py`; 0179 is merged)." - ), - }, - "0296": { - "title": "Stage 5 rebuilds a stale calibrated branch itself instead of stopping after a conflict merge", - "priority": "**P1**", - "impact": "High", - "sizing": "S", - "domain": "Stage 5 / Calibration", - "notes": "Found on PR #190: the flow ended with a failed Stage 5 after a conflict merge. Touches calibrate_sync.py and calibrate.py.", - }, - "0153": { - "title": "Remove comments and docstrings from all code; make it self-documenting", - "priority": "**P2**", - "impact": "Medium", - "sizing": "XL", - "domain": "Readability", - "notes": ( - "Per package, with or right after that package's decomposition (which follows its split: 0187, 0188, " - "0204), not as one repository-wide flow." - ), - }, - "0147": { - "title": "Remove harness paths tracked in the target repositories", - "priority": "**P2**", - "impact": "Medium", - "sizing": "S", - "domain": "Hygiene", - "notes": ( - "`holon-coherence` half merged (PR #29, `68fdf67`; follow-up PR #31, `b52c7e1`). `holon-agentic-coder` " - "half pending (fold into 0214 when beads lands)." - ), - }, - "0193": { - "title": "Decompose the intent and plan stage modules", - "priority": "**P2**", - "impact": "Medium", - "sizing": "M", - "domain": "Holon Flow / Refactor", - "notes": "After 0187; parallel decomposition lane.", - }, - "0194": { - "title": "`run_execute_stage` becomes an `ExecuteStage` with named steps", - "priority": "**P2**", - "impact": "Medium", - "sizing": "M", - "domain": "Holon Flow / Refactor", - "notes": "After 0187; parallel decomposition lane. 306 lines, CC 40.", + "notes": "Queued behind PR #230 (overlaps `docs/git_flow.md` and `docs/ledger_schema.md`). `entrypoint/executor/run.py` (94, 242), `calibration.py`, `cli/commands/`, and `entrypoint/` still strip/re-add `/_`; sequence with `0197`.", }, - "0197": { - "title": "Split `calibration.py` into a package; decompose metrics parsing and report generation", - "priority": "**P2**", - "impact": "Medium", - "sizing": "M", - "domain": "Calibration / Refactor", - "notes": "After 0187 and 0146 (0162 is merged as #112); parallel lane otherwise.", - }, - "0198": { - "title": "Agent runner registry: one `RunnerSpec` module per agent", - "priority": "**P2**", - "impact": "Medium", - "sizing": "M", - "domain": "Runners / Refactor", - "notes": "After 0185 (#115 merged); parallel lane.", - }, - "0201": { - "title": "Planner, executor and reviewer prompts carry the module-layout, complexity and naming rules", + "0223": { + "title": "Audit CLI flags vs `HOLON_*` env vars: four-kind decision rule, flag>env precedence", "priority": "**P2**", "impact": "Medium", - "sizing": "S", - "domain": "Prompts / Standards", - "notes": "After 0185 (#115 merged). Plans declare touch sets at module granularity (feeds 0151).", + "sizing": "L", + "domain": "CLI / Config", + "notes": "Wait for `0265` (`cli/` split) and `0357` (drops `--skip-review`). Exhaustive inventory of every `add_argument` and `os.getenv`, unified resolution helper, logged source, auto-derived `--help`.", }, "0200": { "title": "Remove holon-agentic-coder's diverged `token_reduction` copy; holon-coherence is the owner", @@ -1061,59 +649,47 @@ "impact": "Medium", "sizing": "M", "domain": "Token Reduction", - "notes": "After 0189. Ownership already ruled: holon-coherence owns token reduction.", - }, - "0199": { - "title": "Decompose ledger query and the knowledge index", - "priority": "**P2**", - "impact": "Medium", - "sizing": "M", - "domain": "Ledger / Knowledge", - "notes": "After 0190; parallel lane. Low bean priority.", + "notes": "Unblocked (`0189` merged in PR #241). Remove duplicated `sandbox_executor.token_reduction` code in favour of `holon-coherence`.", }, "0216": { - "title": "Holon flow references and drives beads work items (claim on intent, close on merge)", + "title": "Holon flow references and drives GitHub Issues (assign on intent, close on merge)", "priority": "**P2**", "impact": "Medium", "sizing": "M", - "domain": "Holon Flow / Beads", - "notes": ( - "Holon flow against holon-agentic-coder. Intent `work_item` field, `holon intent` claims issue, " - "calibration/merge closes with PR URL. Sequence after 0214." - ), + "domain": "Holon Flow / Issue Tracking", + "notes": "Blocked by `0333`. Adds optional `work_item` to intent schema, marks issue in progress, adds `Closes #N` to PR body; sequence with `0191` (`flow/github/`).", }, "0217": { - "title": "Adopt beads (bd) issue tracking inside holon-coherence", + "title": "GitHub Issues tracking for holon-coherence: labels, guidance and import", "priority": "**P2**", "impact": "Medium", "sizing": "S", "domain": "Issue Tracking / Coherence", - "notes": ( - "Holon flow against holon-coherence. `bd init` prefix `hcoh-`, import open coherence beans from 0215 " - "converter. Sequence after 0214 and 0215." - ), + "notes": "Blocked by `0215`. Creates labels and imports coherence beans after `0215`; guidance change runs via Holon flow on `holon-coherence`.", }, "0218": { - "title": "Port harness skills and guidance to bd and sequence the harness retirement", + "title": "Port harness skills and guidance to GitHub Issues and sequence the harness retirement", "priority": "**P2**", "impact": "Medium", "sizing": "M", "domain": "Harness Deprecation", - "notes": ( - "Harness work. Retire triage matrix / `prioritise-beans` for `bd ready --json`; port guidance; archive " - "harness read-only after pilots succeed." - ), + "notes": "Harness work. Blocked by `0215`, `0216`, and `0217`. Replaces triage matrix and bean-closing steps, then archives harness read-only.", }, "0317": { - "title": "GitHub Projects kanban board for holon-agentic-coder, fed by beads issues", + "title": "GitHub Projects kanban board over the target repositories' issues", "priority": "**P2**", "impact": "Medium", "sizing": "M", "domain": "Issue Tracking / Projects", - "notes": ( - "Blocked by 0214 (now completed, so unblocked). Board fed from `bd` issues on `refs/dolt/data`; " - "a read-only view for the maintainer. Sequence after 0215 and 0216." - ), + "notes": "Blocked by `0215` (and maintainer `gh auth refresh -s project`). Organisation Project v2 over `holon-agentic-coder` and `holon-coherence`.", + }, + "0153": { + "title": "Remove comments and docstrings from all code; make it self-documenting", + "priority": "**P2**", + "impact": "Medium", + "sizing": "XL", + "domain": "Readability", + "notes": "Per package after its decomposition (`holon-coherence` decompositions are complete and ready; on HAC, run only on settled packages).", }, "0142": { "title": "Real-workload benchmark: Qwen3.8-27B dense vs Flash-Next MoE", @@ -1121,7 +697,23 @@ "impact": "High", "sizing": "L", "domain": "Model Selection", - "notes": "Real data only (AGENTS.md item 10).", + "notes": "Ready (operator/host-run; real data only). Blocked beans `0129`, `0132`, `0133` are completed; benchmark itself has not run.", + }, + "0340": { + "title": "Revisit the module budget: implications of a strict 200-line default with no overrides", + "priority": "**P2**", + "impact": "High", + "sizing": "S (analysis) + L (splits)", + "domain": "Lint / Refactoring", + "notes": "Draft (unblocked since PR #214 froze `module_budgets.json`, awaits maintainer decision). Decide ceiling, line counting, covered packages, and split order; each override removal needs explicit authorisation.", + }, + "0359": { + "title": "PR #230 deferred findings", + "priority": "**P3**", + "impact": "Low", + "sizing": "XS", + "domain": "Review Loop / Housekeeping", + "notes": "Queued behind PR #230 (overlaps `cli/commands/flow.py`). Finding D-1: align `_report_review_outcome` legacy `StageStatus.HALTED_FOR_HUMAN` branch consistency (line 345 vs 352) and add test.", }, "0231": { "title": "Exhausted-budget error string interpolates raw count while payload reports clamped 0", @@ -1129,7 +721,7 @@ "impact": "Low", "sizing": "XS", "domain": "Flow Engine / Cosmetic", - "notes": "PR #124 loop deferral (cosmetic, out-of-increment). Touches `flow.py` - bundle with 0230.", + "notes": "Queued behind PR #230 (overlaps `flow/review/loop.py` lines 917–918). Cosmetic; bundle with a review-loop flow.", }, "0269": { "title": "Deferred nits from the holon-agentic-coder PR 158 review loop", @@ -1137,18 +729,7 @@ "impact": "Low", "sizing": "XS", "domain": "Review Loop / Housekeeping", - "notes": ( - "Three deferred nits from PR #158: fold `parse_actual_metrics` onto `_record_exit_code`, " - "removed-definitions test proof, and `docs/git_flow.md` checkpoint wording." - ), - }, - "0322": { - "title": "Remove the gemini-agent runner, made redundant by antigravity-agent", - "priority": "**P3**", - "impact": "Low", - "sizing": "S", - "domain": "Runners / Cleanup", - "notes": "Todo; unblocked by the 0321 merge (2026-11-20). It touches `agent_defaults.py` (and also `agent_runner.py`, the `Dockerfile` and `docker-bake.hcl`). Removes the `gemini-agent` runner, image target and registry entries. Keeps Gemini models, the `gemini` URL detection in the token-reduction addon and historical ledger rows. Decide whether the `local-model` placeholder stays.", + "notes": "Wait for PR #230 (overlaps `docs/git_flow.md`) and `0197` (`calibration.py`). Item 2 obsolete; remaining: fold `parse_actual_metrics` exit-code logic onto `record_exit_code` and fix `docs/git_flow.md` checkpoint wording.", }, "0141": { "title": "Tune vmlx prefill/decode levers for both Qwen3.8 models, crash-safe", @@ -1156,7 +737,7 @@ "impact": "Medium", "sizing": "M", "domain": "vmlx / Performance", - "notes": "Pairs with 0142.", + "notes": "Ready (host-level vMLX tuning on Mac; not a target-repo change). Pairs with `0142`.", }, } @@ -2160,6 +1741,234 @@ def generate_triage_document( ( " - New: `0337` (todo, P1): a flow refused at Stage 3 admission counts as in flight, so two waiting flows can block each other." ), + ( + "39. **Stage 3 resume keeps partial work and the branch tip (Beans 0331 and 0335 / HAC PR #208, 2026-11-20)**:" + ), + ( + " - `0331` (PR #208, `00fa535`, merged 2026-11-20): the `--allow-overlap` override is recorded once per plan, and a partial head that descends from any earlier plan tip is accepted, so Stage 3 partial work is continued. Review approved 3/3 at iteration 2. Calibration: expected value predicted 39.61, actual -19.01 (delta -58.62)." + ), + ( + " - `0335` (PR #208): a resume continues from the execution branch tip when it descends from the recorded `partial_head`, keeping commits added after the failure, and an execution branch is not pushed before its ledger row exists." + ), + ("40. **Blocked admission state (Bean 0337 / HAC PR #209, 2026-11-20)**:"), + ( + " - `0337` (PR #209, `7dc0342`, merged 2026-11-20): a Stage 3 admission refusal for a touch-set overlap records a `blocked` admission state with `blocked_by` and `blocked_since`. Blocked flows are not in flight for anyone else's admission, and admission runs under a per-repository lock, oldest `blocked_since` first." + ), + ("41. **Planner API-error handling (Bean 0283 / HAC PR #210, 2026-11-20)**:"), + ( + " - `0283` (PR #210, `30d7c77`, merged 2026-11-20): the planner fails the stage on agent API error output instead of writing it as the plan, a failed plan attempt leaves no untracked plan file, and `payload_cleaner` leaves existing `cache_control` blocks alone and injects only consistent ones. Review approved 3/3 at iteration 1. Calibration: expected value predicted 53.40, actual 73.52 (delta +20.12)." + ), + ("42. **Plan refresh after an overlap wait (Bean 0338 / HAC PR #211, 2026-11-20)**:"), + ( + " - `0338` (PR #211, `1610809`, merged 2026-11-20): a flow admitted after a blocked overlap wait merges `origin/main` into its plan branch before Stage 3 executes. Ledger-only conflicts are interleaved by `created_at`; any other conflict stops Stage 3 before dispatch with a resumable checkpoint, and the refreshed commit is recorded. Review approved 3/3 at iteration 2. Its calibration EV (44.16 predicted, -18.21 actual) is wrong because of Bean 0339." + ), + ("43. **Review keeps the execution branch (Bean 0336 / HAC PR #212, 2026-11-20)**:"), + ( + " - `0336` (PR #212, `b6e46e0b`, merged 2026-11-20): new `worktree_head.py` with `reattach_branch`/`restore_branch`, wired into the review stage and the review loop. The review restores the execution branch on exit and re-attaches a HEAD detached at the branch tip, instead of refusing the resolver. Review approved 3/3 at iteration 3. Calibration: expected value predicted 55.50, actual 71.68 (delta +16.18). First flow whose plan branch was refreshed onto `main` after an overlap wait, with no merge conflict." + ), + ("44. **Calibration final outcome by time (Bean 0339 / HAC PR #213, 2026-11-20)**:"), + ( + " - `0339` (PR #213, `a450005`, merged 2026-11-20): calibration orders a flow's summary rows by parsed `created_at`, with `ledger_revision` only as a tie-break, so a Stage 4 consensus row after a Stage 3 `sync_conflict` row is the final outcome. A `sync_conflict` that a later row supersedes is not a failure for the observed EV. The logic lives in a new `calibration_outcome.py` outside the flow package. Review approved 3/3 at iteration 2. Calibration: expected value predicted 52.10, actual 63.28 (delta +11.18)." + ), + ("45. **Module budgets frozen (Bean 0264 / HAC PR #214, 2026-11-20)**:"), + ( + " - `0264` (PR #214, `bea601e`, merged 2026-11-20): the budgets move to `holon-config/hygiene/module_budgets.json` (default ceiling 200 lines; the 22 existing overrides copied unchanged). The budget configuration is frozen: any change fails `scripts/check_module_budgets.py` unless authorised by the intent's `module_budget_change` field or the maintainer-only `module-budget-change` PR label. Over-budget modules are split. Review approved 3/3 on re-review. Calibration: expected value predicted 36.32, actual 70.68 (delta +34.36). Bean 0340 is new: it revisits the default and overrides." + ), + ("46. **Tests never write to the real worktree (Bean 0343 / HAC PR #215, 2026-11-20)**:"), + ( + " - `0343` (PR #215, `c3c0471`, merged 2026-11-20): decomposition tests write under `tmp_path` through `tests/flow/decomposition_fakes.py`. `tests/holon_dir_guard.py`, hooked in `conftest.py`, fails the session on any write under `.holon/`. Rules in `docs/hermetic_testing.md`. Review approved 3/3 at iteration 2. Calibration: expected value predicted 46.57, actual 62.39 (delta +15.82)." + ), + ("47. **Promoted count is this run only (Bean 0342 / HAC PR #216, 2026-11-20)**:"), + ( + " - `0342` (PR #216, `eaaabaa`, merged 2026-11-20): Stage 5 logs only the candidates this run newly promoted. Promotion skips already promoted candidates instead of re-evaluating them on every run. The new `flow/calibrate_promotion.py` keeps the promotion budgets unchanged. Review approved 3/3 at iteration 6. Calibration: expected value predicted 40.70, actual 53.52 (delta +12.82)." + ), + ( + "48. **Review report, review-loop rules, CI progress and ledger redaction (Beans 0261, 0213, 0234 and 0148 / HAC PR #220, 2026-11-20)**:" + ), + ( + " - `0261`: the evaluation line takes its subject from intent `title`, then `slug`, then the target, and no longer repeats the branch ref. `0213`: the native review-loop template carries the CONFLICTING/DIRTY gate, ledger-only fast resolution, increment-scoped reviews and pre-merge Stage 5 calibration. `0234`: CI wait logs check transitions and one final summary, with no heartbeat. `0148`: executor `error_context` redacts before truncation, with the wider secret classes. Merged as `9a5454bf`; calibration predicted EV 39.45, actual 59.09." + ), + ( + "49. **Plans-ledger correction rows and predicted-metric selection (Bean 0146 / HAC PR #221, 2026-11-20)**:" + ), + ( + " - `0146` (PR #221, `68ec164`, merged 2026-11-20): new `calibration_predicted.py` selects the predicted metrics for calibration (the highest-revision plans row, cross-checked against the plan's Overall table and the execution's `predicted_metrics`, with a warning on mismatch). `docs/ledger_schema.md` defines the plans correction row. Review approved 3/3 at iteration 1. Calibration: expected value predicted 41.85, actual 53.76 (delta +11.91)." + ), + ("50. **CI pipeline duration dashboard (Bean 0166 / HAC PR #223, 2026-11-21)**:"), + ( + " - `0166` (PR #223, `6e93f5e`, merged 2026-11-21): `scripts/ci_durations.py` with the helper modules `ci_durations_api`, `_collect`, `_stats`, `_html` and `_svg`, and `.github/workflows/ci-durations.yml` (daily and `workflow_dispatch`) publish a self-contained HTML dashboard and JSON as an artifact plus a job summary. Covers `holon-agentic-coder` only; `holon-coherence` is not covered. Predicted EV 46.65, actual 62.09 (delta +15.44)." + ), + ("51. **Review ledger rows committed per iteration (Bean 0345 / HAC PR #224, 2026-11-21)**:"), + ( + " - `0345` (PR #224, `c38a883`, merged 2026-11-21): new `review/ledger_commit.py` and `review/git_identity.py`. The review loop commits its executions ledger rows each iteration and before the conflict merge and Stage 5, so no ledger row is left uncommitted in the flow worktree. Review approved 3/3 at iteration 5. Calibration (predicted EV 63.70, reported actual -7.11) is known wrong: it read the ledger at `95a45bc`, which held the earlier 'failed' review summary row but not the final approved row, still uncommitted; this PR closes that gap." + ), + ("52. **Checkpoint and ledger ownership (Bean 0190 / HAC PR #219, 2026-11-21)**:"), + ( + " - `0190` (PR #219, `df3b0d1`, merged 2026-11-21): `FlowCheckpoint` owns save, load, migrate and its path policy behind a `CheckpointStore` port; ledger reconciliation moves into the `ledger/` package as `LedgerReconciler`; container entrypoints stop importing the host flow engine for these. Plan and execution ran on `antigravity-agent` / `gemini-3.8-flash`. The review was resumed on `claude-agent` / `claude-opus-5-5` at the maintainer's request after an antigravity resolver defect. Consensus 3/3 APPROVED in iterations 13-19, never auto-posted because of the stale local test gate (Bean 0354); the approval was posted by hand as a PR comment. Stage 5 was run by hand with `holon calibrate` (report only): predicted EV 66.11, reported actual -9.11, which is misleading because it reflects the stalled review. The Stage 5 reconciliation and knowledge promotion did not run; follow-up Bean 0355." + ), + ("53. **Unlimited stage and turn budgets (Bean 0172 / HAC PR #225, 2026-11-21)**:"), + ( + " - `0172` (PR #225, `4811599`, merged 2026-11-21): an explicit `unlimited` sentinel for the stage budget variables and `HOLON_TURN_TIMEOUT_SECONDS`, distinct from unset (default). Internally `None`, never `inf`; the container env round-trips it; `holon doctor` and the flow summary show `unlimited`. Review approved 3/3 at iteration 2. Calibration: expected value predicted 41.00, actual 59.32 (delta +18.32)." + ), + ("54. **Admission uses actual PR files (Bean 0348 / HAC PR #226, 2026-11-21)**:"), + ( + " - `0348` (PR #226, `3ee9c4e2`, merged 2026-11-21): Stage 3 admission compares an open PR by its actual changed files, not its declared touch set. A path absent on the base branch never overlaps a folder or wildcard entry, and the refusal lists the concrete overlapping files. Review approved 3/3 at iteration 3. Calibration: expected value predicted 43.32, actual 61.30 (delta +17.98)." + ), + ("55. **Ledger query and knowledge index decomposed (Bean 0199 / HAC PR #227, 2026-11-21)**:"), + ( + " - `0199` (PR #227, `43d278cb`, merged 2026-11-21): `LedgerQuery` is built from composable filters in `ledger/query.py`, and `sync_ledger_incremental` splits into read, index and persist steps with the promotion rules as a table. Review approved 3/3 at iteration 1. Calibration: expected value predicted 37.20, actual 57.92 (delta +20.72)." + ), + ("56. **Intent and plan stages decomposed (Bean 0193 / HAC PR #228, 2026-11-21)**:"), + ( + " - `0193` (PR #228, `5fbd2d06`, merged 2026-11-21): the intent and plan stages split into per-stage modules (`flow/stages/intent.py`, `plan.py`, `decomposition.py`, `plan_decision.py`, `plan_support.py`, `stage_support.py`, `decomposition_summary.py`) and `flow/stage_conflict_resolution.py`; `validate_intent_questions` is a table of named checks; behaviour and messages unchanged. The first run skipped Stage 4: an antigravity run had saved `skip_review` into the checkpoint, so a resume went straight to Stage 5. The review was rerun on claude-opus-5-5 (3/3 approved at iteration 4) and recalibrated. Predicted EV 33.19, actual 58.66 (delta +25.47). Bean 0356 fixes the checkpoint inheritance." + ), + ("57. **Antigravity writable tmpfs and empty_diff excerpt (Bean 0349 / HAC PR #229, 2026-11-21)**:"), + ( + " - `0349` (PR #229, `ccb7a6f`, merged 2026-11-21): `brain` and `conversations` are writable tmpfs overlays on the read-only Antigravity mount (shared helper `cli/antigravity_mounts.py`), so background-task wakeups survive; exit-0 `empty_diff` failures print a bounded, redacted excerpt of the agent output to stderr. Review and calibration were resumed on claude-agent / claude-opus-5-5 after the antigravity resolver failed. Calibration: expected value predicted 46.80, actual 54.94 (delta +8.14)." + ), + ("58. **Executor entrypoint `main` becomes an `ExecutionRun` (Bean 0196 / HAC PR #234, 2026-11-22)**:"), + ( + " - `0196` (PR #234, `2ec094e`, merged 2026-11-21): `entrypoint/executor.py` (798-line `main`, CC 178) becomes the `entrypoint/executor/` package. `ExecutionRun` in `run.py` runs the named steps, and `main` parses arguments and calls `ExecutionRun(...).run()`. Child PRs #231, #232 and #233 landed first. Calibration: expected value predicted 7.55, actual 47.72 (delta +40.17)." + ), + ("59. **ExecuteStage (Bean 0194 / HAC PR #236, 2026-11-22)**:"), + ( + " - `0194` (PR #236, `b22258d`, merged 2026-11-22): `run_execute_stage` becomes `ExecuteStage` in `flow/stages/execute.py` with named steps (resume point, executor dispatch, empty-diff guard, partial salvage, execution record); `run_execute_stage` stays as a thin wrapper and behaviour is unchanged. Review approved 3/3. Calibration: expected value predicted 52.85, actual 67.22 (delta +14.37)." + ), + ( + "60. **Coherence ProxyLifecycle, checkpoint resume guard, gemini-agent removal, and dev-env " + "Ghostty/Stow upgrades (Beans 0208, 0341, 0322, 0344, 0346 / Coherence PR #42, HAC PRs #217 & " + "#222, dev-env PRs #31 & #32, 2026-11-14 to 2026-11-21)**:" + ), + ( + " - `0208` (Coherence PR #42, `baf5c65`, merged 2026-11-14): `ProxyLifecycle` owns start-up, " + "readiness and teardown (`container/lifecycle.py`), superseding closed PR #41. Consensus 3/3 at " + "iter 5; EV predicted 8.05 / actual 8.45." + ), + ( + " - `0341` (HAC PR #217, `e80b00c`, merged 2026-11-20): `--from-stage` without `--checkpoint` " + "discovers the slug's checkpoint (`checkpoint_discovery.py`), failed pre-stage runs never clobber " + "an existing checkpoint (`resume_guard.py`), and resumed runs keep completed stages. Consensus 3/3 " + "at iter 1; EV predicted 43.47 / actual 59.47 (+16.00)." + ), + ( + " - `0322` (HAC PR #222, `e2ba3c2`, merged 2026-11-21): completely removed `gemini-agent` runner, " + "`agent-gemini` Docker target, and all `gemini` runner special-cases. Consensus 3/3; clean EV " + "predicted 72.94 / actual 78.21 (+5.27; observed -6.79 due to the stale Stage 4 local test gate, " + "tracked in Bean 0354)." + ), + ( + " - `0344` (dev-env PR #31, `0ba3e94`, merged 2026-11-20) and `0346` (dev-env PR #32, `d6b07de`, " + "merged 2026-11-21): Ghostty and Warp casks / Linux APT tasks, Stow-managed Ghostty config, Zsh " + "word-jump bindings (EV predicted 89.36 / actual 91.04), and unioning repo `devenv_stow_packages` " + "with stale `~/.config/dev-env/choices.yml` plus Ansible/Stow upgrade regression tests." + ), + ( + "61. **Resolver turn budgets, foreground test prompts, and supervisor stall guard (Bean 0358 / HAC PRs " + "#235 & #237, 2026-11-22 to 2026-11-23)**:" + ), + ( + " - `0358` Part 1 (HAC PR #235, `134e333`, merged 2026-11-22): `_run_resolver_agent` in " + "`entrypoint/review_loop.py` loads `load_budgets(os.environ).turn` and passes `turn_budgets` to " + "`run_turn(...)`, matching executor, planner and reviewer turns, with hermetic tests " + "(`test_review_resolver_turn_budgets.py`). Consensus 3/3 at iter 3; calibration EV predicted 46.78 / " + "actual 54.55 (delta +7.77)." + ), + ( + " - `0358` Part 2 (HAC PR #237, `032d9d44`, merged 2026-11-23): resolver and executor prompt " + "templates require running tests and lint in the foreground within the same turn, the turn supervisor " + "suppresses the stall budget while a child test/lint process is live, and turns ending with live " + "background work log the command clearly, backed by hermetic tests. Consensus 3/3 APPROVED at " + "iteration 2 with 0 findings, closing Bean `0358`." + ), + ("62. **Remove `--skip-review` flag from `holon flow` (Bean 0357 / HAC PR #238, 2026-11-23)**:"), + ( + " - `0357` (HAC PR #238, `8afc215a`, merged 2026-11-23): removed `--skip-review` from `holon flow` " + "(`cli/commands/flow.py`), dropped `skip_review` from flow context and checkpoint while loading " + "legacy checkpoints cleanly, removed skip branches from `flow/pipeline.py`, `flow/resume_guard.py`, " + "`flow/stages/children.py` and `flow/stages/review.py`, updated `docs/git_flow.md`, with hermetic " + "tests and calibration included in the PR." + ), + ("63. **`holon calibrate` runs full Stage 5 (Bean 0355 / HAC PR #240, 2026-11-23)**:"), + ( + " - `0355` (HAC PR #240, `192c6e8`, merged 2026-11-23): unified Stage 5 in `flow/stage5.py` so " + "`holon calibrate` runs report generation, ledger reconciliation, and knowledge promotion by default " + "(`--report-only`, `--no-commit`, `--json`, idempotent reruns), backed by hermetic " + "`tests/test_calibrate_full_stage5.py`; consensus 3/3 APPROVED and calibrated." + ), + ("64. **Resume flags override checkpoint (Bean 0356 / HAC PR #239, 2026-11-23)**:"), + ( + " - `0356` (HAC PR #239, `4e1e761`, merged 2026-11-23): per-run switches (`skip_review`, " + "`skip_calibrate`, `skip_push`, `dry_run`) apply only to the run that passes them and are no longer " + "inherited from the checkpoint; `--agent` and `--model` on resume override checkpoint values; Stage 4 " + "approved at iter 4 and Stage 5 calibrated." + ), + ( + "65. **Fish Conda/Homebrew shell hooks and clean-env multi-shell runtime tests (Bean 0361 / dev-env " + "PR #33, 2026-11-23)**:" + ), + ( + " - `0361` (dev-env PR #33, `425ff6fe`, merged 2026-11-23): restored OS-guarded Homebrew `brew " + "shellenv` and Conda/Miniforge `conda shell.fish hook | source` (with guarded `micromamba` fallback) " + "in `00-devenv.fish`, enforced NVM-over-Conda PATH ordering across Fish/Bash/Zsh, added `env -i` " + "Ansible Conda shell probes, added `tests/test_shell_hooks.py` (3-shell static parity + hermetic " + "`env -i` runtime tests reproducing the Homebrew symlink masking bug + CI fail-closed guard), and " + "updated `.github/workflows/test-unit.yml` to install `fish` and `zsh`. Consensus 3/3 APPROVED; " + "calibration EV predicted 92.88 / actual 94.53 (delta +1.65)." + ), + ( + "66. **Stage 4 approved status and fresh local test gate (Beans 0347 & 0354 / HAC PR #230, " + "2026-11-23)**:" + ), + ( + " - `0347` & `0354` (HAC PR #230, `f17f4b8`, merged 2026-11-23): consensus approval reports " + "`review: approved` instead of `halted_for_human` while preserving legacy checkpoint/ledger " + "compatibility, and the review-loop local test gate evaluates the current head instead of reusing " + "stale Stage 3 failures; hermetic tests added and Stage 5 calibration included." + ), + ("67. **Launcher package breaks `flow` -> `cli` import cycle (Bean 0189 / HAC PR #241, 2026-11-23)**:"), + ( + " - `0189` (HAC PR #241, `0f0089d`, merged 2026-11-23): new `launcher/` package owns container " + "launch, role dispatch, and proxy/sidecar plumbing, removing all four lazy `flow` -> `cli` imports, " + "enforced by AST import-cycle test `tests/test_import_cycle.py`; consensus approved at iter 5 and " + "calibrated." + ), + ( + "68. **dev-env Ansible cleanup, `deb822_repository`, WSL Ghostty/Warp exclusion, and `tmux` mouse " + "(Bean 0351 / dev-env PR #36, 2026-11-23)**:" + ), + ( + " - `0351` (dev-env PR #36, `a9dacf46`, merged 2026-11-23): replaced deprecated `apt_repository` " + "with `deb822_repository`, standardised Ansible `command` `cmd:` / `changed_when` / `check_mode: false` " + "hygiene across roles and `unlink.yml`, added `devenv_is_wsl` detection to unconditionally exclude " + "all 12 Linux Ghostty and Warp tasks on WSL, enabled `set -g mouse on` in `.tmux.conf`, and added " + "hygiene, WSL templating, and zero-deprecation `--syntax-check` tests. Consensus 3/3 APPROVED at " + "iter 2; calibration EV predicted 92.83 / actual 94.64 (delta +1.81); 6/6 CI green." + ), + ( + "69. **dev-env `devenv_user`, WSL wizard prompt skip, and Ansible Jinja2 variable audit " + "(Bean 0364 / dev-env PR #37, 2026-11-23)**:" + ), + ( + " - `0364` (dev-env PR #37, `4b1391c3`, merged 2026-11-23): defined `devenv_user` in " + "`ansible/group_vars/all.yml`, added `is_wsl()` in `scripts/devenv_wizard.py` to skip the Ghostty/Warp " + "prompt and persist `devenv_install_gui_casks: false` on WSL, and added Conda command templating plus " + "repo-wide Jinja2 AST variable-audit tests in `tests/test_templating.py` and WSL wizard tests in " + "`tests/test_wizard.py`. Consensus 3/3 APPROVED; calibration EV predicted 95.02 / actual 95.95 " + "(delta +0.93); 6/6 CI green." + ), + ( + "70. **dev-env disable `expand_argument_vars` on Conda clean-shell checks and `ansible-playbook` test " + "(Bean 0365 / dev-env PR #38, 2026-11-23)**:" + ), + ( + " - `0365` (dev-env PR #38, `68ddec98`, merged 2026-11-23): set `expand_argument_vars: false` on " + "all three clean-shell Conda verification `ansible.builtin.command` tasks in " + "`ansible/roles/conda/tasks/main.yml` and switched Fish to `string join : -- $PATH`, enforced static " + "`expand_argument_vars: false` hygiene for shell `$VAR` command tasks in `tests/test_toolchain.py`, " + "and added a real hermetic `ansible-playbook` verification test under polluted parent `PATH` / " + "`CONDA_DEFAULT_ENV` in `tests/test_shell_hooks.py`. Consensus 3/3 APPROVED; calibration EV predicted " + "96.27 / actual 97.28 (delta +1.01); 6/6 CI green." + ), "", "---", "", diff --git a/.agents/skills/resolve_conflict/SKILL.md b/.agents/skills/resolve_conflict/SKILL.md index 41ccd44..d88a75e 100644 --- a/.agents/skills/resolve_conflict/SKILL.md +++ b/.agents/skills/resolve_conflict/SKILL.md @@ -22,7 +22,8 @@ list. This skill handles those cheaply and hands back anything that needs a deci 1. **Always a dedicated subagent.** Conflict resolution runs in its own subagent so the merge output and file diffs never enter the parent's context. The parent passes only the target (PR number or worktree path) and this file, and - gets back a short report. + gets back a short report. Name it `# - resolve conflicts` (see + [subagents.md, "Subagent names"](../../subagents.md#subagent-names)). 2. **Lowest tier.** The subagent runs on the lowest model tier of the harness, as defined in [`.agents/model-tiers.md`](../../model-tiers.md). This skill names a tier, never a model. 3. **Escalate, never improvise.** The subagent resolves only the cases below. On anything else it aborts that file's diff --git a/.agents/subagents.md b/.agents/subagents.md index c5d901b..cad30ed 100644 --- a/.agents/subagents.md +++ b/.agents/subagents.md @@ -16,14 +16,28 @@ Subagent delegation in this ecosystem is primarily targeted towards the **Antigr - **Model Selection & Automatic Credit Fallback**: Set `Model: "inherit"` by default to inherit the parent agent's active model configuration. If credit or quota runs out on the higher-level model (`"inherit"` / `"pro"`), automatically fall back to `"flash"` and then `"flash_lite"` (and similarly step down `claude-fable-5` $\rightarrow$ - `claude-opus-5-5` $\rightarrow$ `claude-sonnet-4-6` $\rightarrow$ `claude-haiku-4-5` or `gemini-3.8-pro-high` - $\rightarrow$ `gemini-3.8-flash-medium` $\rightarrow$ `gemini-3.8-flash` in `holon` CLI invocations) and continue the - flow or review loop from the current stage without discarding completed work. + `claude-opus-5-5` $\rightarrow$ `claude-sonnet-4-6` $\rightarrow$ `claude-haiku-4-5` or `gemini-4-argon` $\rightarrow$ + `gemini-4-hydrogen` $\rightarrow$ `gemini-3.8-flash` in `holon` CLI invocations) and continue the flow or review loop + from the current stage without discarding completed work. - **Reactive Wakeup (Zero Polling)**: The AGY runtime automatically wakes up the parent agent upon subagent completion or message delivery. Never poll or loop on subagent status. - **Generic Coding Agent Compatibility**: Skill workflows (such as `pr-review-loop`) define generic subagent task contracts so any coding agent (Claude Code, Codex, Pi, OpenCodeInterpreter) can spin off subagents using its native delegation mechanism (child process, task tool, or isolated session), while retaining explicit AGY invocation parameters for seamless native execution. +- **Subagent names**: see [Subagent names](#subagent-names). + +## Subagent names + +Every subagent a skill spawns is named `# - `. This applies to the AGY `Role`, Claude Code's Agent +`description`, or whatever your runtime uses. The operator can then tell at a glance which pull request each running +subagent belongs to (maintainer, 2026-11-23). + +- **With a PR:** `#244 - resolve conflicts`, `#244 - review loop orchestrator`, `#244 - iter 15 dry-run reviewer`, + `#244 - iter 15 ensemble reviewer 2`, `#244 - iter 15 resolver`, `#244 - post-merge`. +- **Before a PR exists** (a flow in Stages 1–3): `bean - `, for example + `bean 0363 - holon flow ci-gate-after-main-merge`. Use the PR number once the PR opens. +- The PR number comes from the target repository. When the repository is not obvious from context, add it after the + number: `#38 dev-env - review loop orchestrator`. --- diff --git a/.agents/workflows.md b/.agents/workflows.md index 04dff6f..f113590 100644 --- a/.agents/workflows.md +++ b/.agents/workflows.md @@ -102,13 +102,13 @@ across model tiers, use `holon flow --from-stage ` or `--ch **continue the flow from the current stage** (reusing the already-created `I-.../_`, `P-.../_`, or `E-.../_` branch rather than starting over): - **Claude (`claude-agent`)**: `claude-opus-5-5` $\rightarrow$ `claude-sonnet-4-6` $\rightarrow$ `claude-haiku-4-5`. - - **Antigravity (`antigravity-agent` CLI)**: `gemini-3.8-pro-high` $\rightarrow$ `gemini-3.8-flash-medium` - $\rightarrow$ `gemini-3.8-flash`. + - **Antigravity (`antigravity-agent` CLI)**: `gemini-4-argon` $\rightarrow$ `gemini-4-hydrogen` $\rightarrow$ + `gemini-3.8-flash` (default to `gemini-4-argon` for all Holon coding tasks until tokens run out). - **Antigravity (`invoke_subagent`)**: `Model: "inherit"` / `"pro"` $\rightarrow$ `"flash"` $\rightarrow$ `"flash_lite"`. - **Cross-Runner Continuation**: If all model tiers under the current runner share an exhausted account/session quota, switch `--agent` to the alternate runner (`antigravity-agent` or `claude-agent`) and resume from the failed stage - (e.g. `holon plan --agent antigravity-agent --model gemini-3.8-flash-medium`, followed by + (e.g. `holon plan --agent antigravity-agent --model gemini-4-argon`, followed by `holon execute `, `holon review `, and `holon calibrate `). - **Ledger-Only Conflicts Do Not Require Test Runs**: When merging or rebasing `origin/main` into a Holon flow branch and the conflict is confined entirely to `holon-knowledge/ledger/*.jsonl`, running test suites is not required. diff --git a/.beans/bean-triage-prioritisation.md b/.beans/bean-triage-prioritisation.md index 6684a61..ed41262 100644 --- a/.beans/bean-triage-prioritisation.md +++ b/.beans/bean-triage-prioritisation.md @@ -1,23 +1,26 @@ # Holon Ecosystem Bean Triage and Prioritisation Matrix -**Last Updated:** 2026-11-20 01:56:32 UTC +**Last Updated:** 2026-11-23 04:58:48 UTC ## Executive Summary -The harness now drives every `holon-agentic-coder` change through the 5-stage Holon flow and the `pr-review-loop`, and -the maintainer merges each pull request into `main`. The most recent stretch (2026-11-10 to 2026-11-11) was dominated by -one incident and its repair, described in the last paragraph below: a sandbox escape reached `main` behind a review that -said `APPROVED (3/3)` while a reviewer still held an open critical finding. It was reverted, the review loop's consensus -decision was fixed, and the change was re-landed with the escape closed. +The harness drives every `holon-agentic-coder` change through the 5-stage Holon flow and the `pr-review-loop`, and the +maintainer merges each pull request into `main`. On 2026-11-23 every active bean was audited against current `main` +(`holon-agentic-coder` `0f0089d`, `holon-coherence` `baf5c65`, `dev-env` `68ddec9`) and merged PRs #221–#241 plus +`dev-env` PRs #31–#33 and #36–#38: duplicate Bean 0353 was scrapped in favour of Bean 0354, stale `blocked_by` links and +outdated 'in flight in another session' markers (`0322` and `0346` completed; `0265`, `0270` idle) were cleared, and new +beans `0350`–`0352` and `0354`–`0361` were triaged. HAC PRs #243 (`0155`, `CLEAN`), #244 (`0175`, `UNSTABLE`), and #245 +(`0191`, `UNSTABLE`) are open, while `dev-env` **Bean 0361** (`PR #33`), **Bean 0351** (`PR #36`), **Bean 0364** +(`PR #37`), and **Bean 0365** (`PR #38`) have all merged into `main` (zero open `dev-env` PRs). Concurrent flows on overlapping files forced repeated syncs and re-reviews earlier on (141 review-loop passes, about 10M+ tokens), so flows that touch the same files still run one after another; only flows with disjoint touch sets run together. -- **Total Tracked Beans**: 337 (excluding template) -- **Completed**: 279 (82.8%) -- **Scrapped / Superseded**: 8 (2.4%) -- **Active**: 50 (14.8%), of which 3 are in progress and 47 are todo +- **Total Tracked Beans**: 365 (excluding template) +- **Completed**: 322 (88.2%) +- **Scrapped / Superseded**: 9 (2.5%) +- **Active**: 34 (9.3%), of which 15 are in progress, 18 are todo and 1 are draft Dates below are UTC, as in `gh`, the bean timestamps and the milestones. @@ -288,11 +291,40 @@ execution branch `E-1795130302-4856d0ac` was deleted. resolver turn that fails writes no adjudication rows and leaves its findings open, a rejection needs a reason, and a review resume sends open findings to the resolver first. Review approved 3/3 at iteration 3; calibration predicted 61.85 against an actual 77.72 (delta +15.87). **Bean 0337** is new (a flow refused at Stage 3 admission still counts as in -flight), and Beans 0331 and 0335 run in the live `resumetip` flow. +flight). Beans 0331 and 0335 merged as PR #208 (`00fa535`) and are completed. **Bean 0337** merged as PR #209 +(`7dc0342`) and is completed. **Bean 0283** merged as PR #210 (`30d7c77`) and is completed. + +**2026-11-21:** every active bean was audited against `origin/main`. Locations moved by the `flow/` and `cli/` package +splits were corrected in Beans 0157, 0175, 0181, 0191-0194, 0200, 0231, 0255 and 0269; Bean 0146 and Bean 0197 were +narrowed to what remains after PR #213; the blocked-by links to completed or scrapped Beans 0168, 0185, 0187 and 0195 +were cleared. New: **Bean 0347** (Stage 4 says halted for human review although consensus approval was reached and the +flow carries on to Stage 5). The audit found no bean already done by PRs #209 to #220 beyond those already completed. + +**2026-11-22 to 2026-11-23:** twenty target PRs merged across `holon-agentic-coder` and `dev-env`: **Bean 0322** (HAC +#222, `e2ba3c2`: complete removal of `gemini-agent`), **Bean 0172** (HAC #225, `4811599`: `unlimited` stage and turn +budgets), **Bean 0348** (HAC #226, `3ee9c4e`: admission uses actual PR files), **Bean 0199** (HAC #227, `43d278c`: +ledger query and knowledge index decomposed), **Bean 0193** (HAC #228, `5fbd2d0`: intent and plan stages decomposed), +**Bean 0349** (HAC #229, `ccb7a6f`: Antigravity writable `brain`/`conversations` tmpfs and `empty_diff` excerpt), **Bean +0196** (HAC #234, `2ec094e`, plus children #231–#233: `ExecutionRun`), **Bean 0194** (HAC #236, `b22258d`: +`ExecuteStage`), **Bean 0358** (HAC #235 `134e333` and #237 `032d9d44`: resolver honours turn budgets, foreground test +prompts, and supervisor live-child-process stall guard), **Bean 0357** (HAC #238, `8afc215a`: `--skip-review` removed), +**Bean 0355** (HAC #240, `192c6e8`: `holon calibrate` runs full Stage 5), **Bean 0356** (HAC #239, `4e1e761`: resume +flags override checkpoint), **Beans 0347 & 0354** (HAC #230, `f17f4b8`: Stage 4 `review: approved` status & fresh local +test gate), **Bean 0189** (HAC #241, `0f0089d`: `launcher/` package breaks `flow` -> `cli` cycle), plus `dev-env` PRs +#31 (**Bean 0344**, `0ba3e94`), #32 (**Bean 0346**, `d6b07de`), #33 (**Bean 0361**, `425ff6fe`: Fish Conda/Homebrew +hooks & clean-env multi-shell tests), #36 (**Bean 0351**, `a9dacf46`: Ansible `deb822_repository` & task hygiene, +unconditional WSL exclusion of Ghostty/Warp, and `tmux` `set -g mouse on`), #37 (**Bean 0364**, `4b1391c3`: define +`devenv_user`, skip WSL GUI terminal wizard prompt, and audit Ansible Jinja2 variables in tests), and #38 (**Bean +0365**, `68ddec98`: disable `expand_argument_vars` on Conda clean-shell command tasks, enforce static `$VAR` command +hygiene, and add hermetic `ansible-playbook` verification test). Open **HAC PRs #243** (`0155`), **#244** (`0175`), and +**#245** (`0191`) remain in progress, and new **Bean 0360** logs duplicate `P-` branch creation after an interrupted +Stage 2. Pre-triage audit (2026-11-23): **Bean 0353** scrapped as a duplicate of `0354`; stale blockers cleared on +`0189`, `0197`, `0198`, `0265`, `0270`, `0333`; `0176` re-measured at 144 files; `0181` re-pointed to +`entrypoint/executor/run.py`; new beans `0350`–`0352` and `0354`–`0361` triaged. --- -## Key Milestones Completed (Beans 0080 – 0334) +## Key Milestones Completed (Beans 0080 – 0365) 1. **Holon Flow and Automation Engine**: - `0084`: Fixed CI check name collisions in review gates. @@ -693,142 +725,293 @@ flight), and Beans 0331 and 0335 run in the live `resumetip` flow. by a macOS timing-gate miss and resumed green after a job rerun. - New: `0337` (todo, P1): a flow refused at Stage 3 admission counts as in flight, so two waiting flows can block each other. +39. **Stage 3 resume keeps partial work and the branch tip (Beans 0331 and 0335 / HAC PR #208, 2026-11-20)**: + - `0331` (PR #208, `00fa535`, merged 2026-11-20): the `--allow-overlap` override is recorded once per plan, and a + partial head that descends from any earlier plan tip is accepted, so Stage 3 partial work is continued. Review + approved 3/3 at iteration 2. Calibration: expected value predicted 39.61, actual -19.01 (delta -58.62). + - `0335` (PR #208): a resume continues from the execution branch tip when it descends from the recorded + `partial_head`, keeping commits added after the failure, and an execution branch is not pushed before its ledger + row exists. +40. **Blocked admission state (Bean 0337 / HAC PR #209, 2026-11-20)**: + - `0337` (PR #209, `7dc0342`, merged 2026-11-20): a Stage 3 admission refusal for a touch-set overlap records a + `blocked` admission state with `blocked_by` and `blocked_since`. Blocked flows are not in flight for anyone else's + admission, and admission runs under a per-repository lock, oldest `blocked_since` first. +41. **Planner API-error handling (Bean 0283 / HAC PR #210, 2026-11-20)**: + - `0283` (PR #210, `30d7c77`, merged 2026-11-20): the planner fails the stage on agent API error output instead of + writing it as the plan, a failed plan attempt leaves no untracked plan file, and `payload_cleaner` leaves existing + `cache_control` blocks alone and injects only consistent ones. Review approved 3/3 at iteration 1. Calibration: + expected value predicted 53.40, actual 73.52 (delta +20.12). +42. **Plan refresh after an overlap wait (Bean 0338 / HAC PR #211, 2026-11-20)**: + - `0338` (PR #211, `1610809`, merged 2026-11-20): a flow admitted after a blocked overlap wait merges `origin/main` + into its plan branch before Stage 3 executes. Ledger-only conflicts are interleaved by `created_at`; any other + conflict stops Stage 3 before dispatch with a resumable checkpoint, and the refreshed commit is recorded. Review + approved 3/3 at iteration 2. Its calibration EV (44.16 predicted, -18.21 actual) is wrong because of Bean 0339. +43. **Review keeps the execution branch (Bean 0336 / HAC PR #212, 2026-11-20)**: + - `0336` (PR #212, `b6e46e0b`, merged 2026-11-20): new `worktree_head.py` with `reattach_branch`/`restore_branch`, + wired into the review stage and the review loop. The review restores the execution branch on exit and re-attaches + a HEAD detached at the branch tip, instead of refusing the resolver. Review approved 3/3 at iteration 3. + Calibration: expected value predicted 55.50, actual 71.68 (delta +16.18). First flow whose plan branch was + refreshed onto `main` after an overlap wait, with no merge conflict. +44. **Calibration final outcome by time (Bean 0339 / HAC PR #213, 2026-11-20)**: + - `0339` (PR #213, `a450005`, merged 2026-11-20): calibration orders a flow's summary rows by parsed `created_at`, + with `ledger_revision` only as a tie-break, so a Stage 4 consensus row after a Stage 3 `sync_conflict` row is the + final outcome. A `sync_conflict` that a later row supersedes is not a failure for the observed EV. The logic lives + in a new `calibration_outcome.py` outside the flow package. Review approved 3/3 at iteration 2. Calibration: + expected value predicted 52.10, actual 63.28 (delta +11.18). +45. **Module budgets frozen (Bean 0264 / HAC PR #214, 2026-11-20)**: + - `0264` (PR #214, `bea601e`, merged 2026-11-20): the budgets move to `holon-config/hygiene/module_budgets.json` + (default ceiling 200 lines; the 22 existing overrides copied unchanged). The budget configuration is frozen: any + change fails `scripts/check_module_budgets.py` unless authorised by the intent's `module_budget_change` field or + the maintainer-only `module-budget-change` PR label. Over-budget modules are split. Review approved 3/3 on + re-review. Calibration: expected value predicted 36.32, actual 70.68 (delta +34.36). Bean 0340 is new: it revisits + the default and overrides. +46. **Tests never write to the real worktree (Bean 0343 / HAC PR #215, 2026-11-20)**: + - `0343` (PR #215, `c3c0471`, merged 2026-11-20): decomposition tests write under `tmp_path` through + `tests/flow/decomposition_fakes.py`. `tests/holon_dir_guard.py`, hooked in `conftest.py`, fails the session on any + write under `.holon/`. Rules in `docs/hermetic_testing.md`. Review approved 3/3 at iteration 2. Calibration: + expected value predicted 46.57, actual 62.39 (delta +15.82). +47. **Promoted count is this run only (Bean 0342 / HAC PR #216, 2026-11-20)**: + - `0342` (PR #216, `eaaabaa`, merged 2026-11-20): Stage 5 logs only the candidates this run newly promoted. + Promotion skips already promoted candidates instead of re-evaluating them on every run. The new + `flow/calibrate_promotion.py` keeps the promotion budgets unchanged. Review approved 3/3 at iteration 6. + Calibration: expected value predicted 40.70, actual 53.52 (delta +12.82). +48. **Review report, review-loop rules, CI progress and ledger redaction (Beans 0261, 0213, 0234 and 0148 / HAC PR #220, + 2026-11-20)**: + - `0261`: the evaluation line takes its subject from intent `title`, then `slug`, then the target, and no longer + repeats the branch ref. `0213`: the native review-loop template carries the CONFLICTING/DIRTY gate, ledger-only + fast resolution, increment-scoped reviews and pre-merge Stage 5 calibration. `0234`: CI wait logs check + transitions and one final summary, with no heartbeat. `0148`: executor `error_context` redacts before truncation, + with the wider secret classes. Merged as `9a5454bf`; calibration predicted EV 39.45, actual 59.09. +49. **Plans-ledger correction rows and predicted-metric selection (Bean 0146 / HAC PR #221, 2026-11-20)**: + - `0146` (PR #221, `68ec164`, merged 2026-11-20): new `calibration_predicted.py` selects the predicted metrics for + calibration (the highest-revision plans row, cross-checked against the plan's Overall table and the execution's + `predicted_metrics`, with a warning on mismatch). `docs/ledger_schema.md` defines the plans correction row. Review + approved 3/3 at iteration 1. Calibration: expected value predicted 41.85, actual 53.76 (delta +11.91). +50. **CI pipeline duration dashboard (Bean 0166 / HAC PR #223, 2026-11-21)**: + - `0166` (PR #223, `6e93f5e`, merged 2026-11-21): `scripts/ci_durations.py` with the helper modules + `ci_durations_api`, `_collect`, `_stats`, `_html` and `_svg`, and `.github/workflows/ci-durations.yml` (daily and + `workflow_dispatch`) publish a self-contained HTML dashboard and JSON as an artifact plus a job summary. Covers + `holon-agentic-coder` only; `holon-coherence` is not covered. Predicted EV 46.65, actual 62.09 (delta +15.44). +51. **Review ledger rows committed per iteration (Bean 0345 / HAC PR #224, 2026-11-21)**: + - `0345` (PR #224, `c38a883`, merged 2026-11-21): new `review/ledger_commit.py` and `review/git_identity.py`. The + review loop commits its executions ledger rows each iteration and before the conflict merge and Stage 5, so no + ledger row is left uncommitted in the flow worktree. Review approved 3/3 at iteration 5. Calibration (predicted EV + 63.70, reported actual -7.11) is known wrong: it read the ledger at `95a45bc`, which held the earlier 'failed' + review summary row but not the final approved row, still uncommitted; this PR closes that gap. +52. **Checkpoint and ledger ownership (Bean 0190 / HAC PR #219, 2026-11-21)**: + - `0190` (PR #219, `df3b0d1`, merged 2026-11-21): `FlowCheckpoint` owns save, load, migrate and its path policy + behind a `CheckpointStore` port; ledger reconciliation moves into the `ledger/` package as `LedgerReconciler`; + container entrypoints stop importing the host flow engine for these. Plan and execution ran on `antigravity-agent` + / `gemini-3.8-flash`. The review was resumed on `claude-agent` / `claude-opus-5-5` at the maintainer's request + after an antigravity resolver defect. Consensus 3/3 APPROVED in iterations 13-19, never auto-posted because of the + stale local test gate (Bean 0354); the approval was posted by hand as a PR comment. Stage 5 was run by hand with + `holon calibrate` (report only): predicted EV 66.11, reported actual -9.11, which is misleading because it + reflects the stalled review. The Stage 5 reconciliation and knowledge promotion did not run; follow-up Bean 0355. +53. **Unlimited stage and turn budgets (Bean 0172 / HAC PR #225, 2026-11-21)**: + - `0172` (PR #225, `4811599`, merged 2026-11-21): an explicit `unlimited` sentinel for the stage budget variables + and `HOLON_TURN_TIMEOUT_SECONDS`, distinct from unset (default). Internally `None`, never `inf`; the container env + round-trips it; `holon doctor` and the flow summary show `unlimited`. Review approved 3/3 at iteration 2. + Calibration: expected value predicted 41.00, actual 59.32 (delta +18.32). +54. **Admission uses actual PR files (Bean 0348 / HAC PR #226, 2026-11-21)**: + - `0348` (PR #226, `3ee9c4e2`, merged 2026-11-21): Stage 3 admission compares an open PR by its actual changed + files, not its declared touch set. A path absent on the base branch never overlaps a folder or wildcard entry, and + the refusal lists the concrete overlapping files. Review approved 3/3 at iteration 3. Calibration: expected value + predicted 43.32, actual 61.30 (delta +17.98). +55. **Ledger query and knowledge index decomposed (Bean 0199 / HAC PR #227, 2026-11-21)**: + - `0199` (PR #227, `43d278cb`, merged 2026-11-21): `LedgerQuery` is built from composable filters in + `ledger/query.py`, and `sync_ledger_incremental` splits into read, index and persist steps with the promotion + rules as a table. Review approved 3/3 at iteration 1. Calibration: expected value predicted 37.20, actual 57.92 + (delta +20.72). +56. **Intent and plan stages decomposed (Bean 0193 / HAC PR #228, 2026-11-21)**: + - `0193` (PR #228, `5fbd2d06`, merged 2026-11-21): the intent and plan stages split into per-stage modules + (`flow/stages/intent.py`, `plan.py`, `decomposition.py`, `plan_decision.py`, `plan_support.py`, + `stage_support.py`, `decomposition_summary.py`) and `flow/stage_conflict_resolution.py`; + `validate_intent_questions` is a table of named checks; behaviour and messages unchanged. The first run skipped + Stage 4: an antigravity run had saved `skip_review` into the checkpoint, so a resume went straight to Stage 5. The + review was rerun on claude-opus-5-5 (3/3 approved at iteration 4) and recalibrated. Predicted EV 33.19, actual + 58.66 (delta +25.47). Bean 0356 fixes the checkpoint inheritance. +57. **Antigravity writable tmpfs and empty_diff excerpt (Bean 0349 / HAC PR #229, 2026-11-21)**: + - `0349` (PR #229, `ccb7a6f`, merged 2026-11-21): `brain` and `conversations` are writable tmpfs overlays on the + read-only Antigravity mount (shared helper `cli/antigravity_mounts.py`), so background-task wakeups survive; + exit-0 `empty_diff` failures print a bounded, redacted excerpt of the agent output to stderr. Review and + calibration were resumed on claude-agent / claude-opus-5-5 after the antigravity resolver failed. Calibration: + expected value predicted 46.80, actual 54.94 (delta +8.14). +58. **Executor entrypoint `main` becomes an `ExecutionRun` (Bean 0196 / HAC PR #234, 2026-11-22)**: + - `0196` (PR #234, `2ec094e`, merged 2026-11-21): `entrypoint/executor.py` (798-line `main`, CC 178) becomes the + `entrypoint/executor/` package. `ExecutionRun` in `run.py` runs the named steps, and `main` parses arguments and + calls `ExecutionRun(...).run()`. Child PRs #231, #232 and #233 landed first. Calibration: expected value predicted + 7.55, actual 47.72 (delta +40.17). +59. **ExecuteStage (Bean 0194 / HAC PR #236, 2026-11-22)**: + - `0194` (PR #236, `b22258d`, merged 2026-11-22): `run_execute_stage` becomes `ExecuteStage` in + `flow/stages/execute.py` with named steps (resume point, executor dispatch, empty-diff guard, partial salvage, + execution record); `run_execute_stage` stays as a thin wrapper and behaviour is unchanged. Review approved 3/3. + Calibration: expected value predicted 52.85, actual 67.22 (delta +14.37). +60. **Coherence ProxyLifecycle, checkpoint resume guard, gemini-agent removal, and dev-env Ghostty/Stow upgrades (Beans + 0208, 0341, 0322, 0344, 0346 / Coherence PR #42, HAC PRs #217 & #222, dev-env PRs #31 & #32, 2026-11-14 to + 2026-11-21)**: + - `0208` (Coherence PR #42, `baf5c65`, merged 2026-11-14): `ProxyLifecycle` owns start-up, readiness and teardown + (`container/lifecycle.py`), superseding closed PR #41. Consensus 3/3 at iter 5; EV predicted 8.05 / actual 8.45. + - `0341` (HAC PR #217, `e80b00c`, merged 2026-11-20): `--from-stage` without `--checkpoint` discovers the slug's + checkpoint (`checkpoint_discovery.py`), failed pre-stage runs never clobber an existing checkpoint + (`resume_guard.py`), and resumed runs keep completed stages. Consensus 3/3 at iter 1; EV predicted 43.47 / actual + 59.47 (+16.00). + - `0322` (HAC PR #222, `e2ba3c2`, merged 2026-11-21): completely removed `gemini-agent` runner, `agent-gemini` + Docker target, and all `gemini` runner special-cases. Consensus 3/3; clean EV predicted 72.94 / actual 78.21 + (+5.27; observed -6.79 due to the stale Stage 4 local test gate, tracked in Bean 0354). + - `0344` (dev-env PR #31, `0ba3e94`, merged 2026-11-20) and `0346` (dev-env PR #32, `d6b07de`, merged 2026-11-21): + Ghostty and Warp casks / Linux APT tasks, Stow-managed Ghostty config, Zsh word-jump bindings (EV predicted 89.36 + / actual 91.04), and unioning repo `devenv_stow_packages` with stale `~/.config/dev-env/choices.yml` plus + Ansible/Stow upgrade regression tests. +61. **Resolver turn budgets, foreground test prompts, and supervisor stall guard (Bean 0358 / HAC PRs #235 & #237, + 2026-11-22 to 2026-11-23)**: + - `0358` Part 1 (HAC PR #235, `134e333`, merged 2026-11-22): `_run_resolver_agent` in `entrypoint/review_loop.py` + loads `load_budgets(os.environ).turn` and passes `turn_budgets` to `run_turn(...)`, matching executor, planner and + reviewer turns, with hermetic tests (`test_review_resolver_turn_budgets.py`). Consensus 3/3 at iter 3; calibration + EV predicted 46.78 / actual 54.55 (delta +7.77). + - `0358` Part 2 (HAC PR #237, `032d9d44`, merged 2026-11-23): resolver and executor prompt templates require running + tests and lint in the foreground within the same turn, the turn supervisor suppresses the stall budget while a + child test/lint process is live, and turns ending with live background work log the command clearly, backed by + hermetic tests. Consensus 3/3 APPROVED at iteration 2 with 0 findings, closing Bean `0358`. +62. **Remove `--skip-review` flag from `holon flow` (Bean 0357 / HAC PR #238, 2026-11-23)**: + - `0357` (HAC PR #238, `8afc215a`, merged 2026-11-23): removed `--skip-review` from `holon flow` + (`cli/commands/flow.py`), dropped `skip_review` from flow context and checkpoint while loading legacy checkpoints + cleanly, removed skip branches from `flow/pipeline.py`, `flow/resume_guard.py`, `flow/stages/children.py` and + `flow/stages/review.py`, updated `docs/git_flow.md`, with hermetic tests and calibration included in the PR. +63. **`holon calibrate` runs full Stage 5 (Bean 0355 / HAC PR #240, 2026-11-23)**: + - `0355` (HAC PR #240, `192c6e8`, merged 2026-11-23): unified Stage 5 in `flow/stage5.py` so `holon calibrate` runs + report generation, ledger reconciliation, and knowledge promotion by default (`--report-only`, `--no-commit`, + `--json`, idempotent reruns), backed by hermetic `tests/test_calibrate_full_stage5.py`; consensus 3/3 APPROVED and + calibrated. +64. **Resume flags override checkpoint (Bean 0356 / HAC PR #239, 2026-11-23)**: + - `0356` (HAC PR #239, `4e1e761`, merged 2026-11-23): per-run switches (`skip_review`, `skip_calibrate`, + `skip_push`, `dry_run`) apply only to the run that passes them and are no longer inherited from the checkpoint; + `--agent` and `--model` on resume override checkpoint values; Stage 4 approved at iter 4 and Stage 5 calibrated. +65. **Fish Conda/Homebrew shell hooks and clean-env multi-shell runtime tests (Bean 0361 / dev-env PR #33, + 2026-11-23)**: + - `0361` (dev-env PR #33, `425ff6fe`, merged 2026-11-23): restored OS-guarded Homebrew `brew shellenv` and + Conda/Miniforge `conda shell.fish hook | source` (with guarded `micromamba` fallback) in `00-devenv.fish`, + enforced NVM-over-Conda PATH ordering across Fish/Bash/Zsh, added `env -i` Ansible Conda shell probes, added + `tests/test_shell_hooks.py` (3-shell static parity + hermetic `env -i` runtime tests reproducing the Homebrew + symlink masking bug + CI fail-closed guard), and updated `.github/workflows/test-unit.yml` to install `fish` and + `zsh`. Consensus 3/3 APPROVED; calibration EV predicted 92.88 / actual 94.53 (delta +1.65). +66. **Stage 4 approved status and fresh local test gate (Beans 0347 & 0354 / HAC PR #230, 2026-11-23)**: + - `0347` & `0354` (HAC PR #230, `f17f4b8`, merged 2026-11-23): consensus approval reports `review: approved` instead + of `halted_for_human` while preserving legacy checkpoint/ledger compatibility, and the review-loop local test gate + evaluates the current head instead of reusing stale Stage 3 failures; hermetic tests added and Stage 5 calibration + included. +67. **Launcher package breaks `flow` -> `cli` import cycle (Bean 0189 / HAC PR #241, 2026-11-23)**: + - `0189` (HAC PR #241, `0f0089d`, merged 2026-11-23): new `launcher/` package owns container launch, role dispatch, + and proxy/sidecar plumbing, removing all four lazy `flow` -> `cli` imports, enforced by AST import-cycle test + `tests/test_import_cycle.py`; consensus approved at iter 5 and calibrated. +68. **dev-env Ansible cleanup, `deb822_repository`, WSL Ghostty/Warp exclusion, and `tmux` mouse (Bean 0351 / dev-env PR + #36, 2026-11-23)**: + - `0351` (dev-env PR #36, `a9dacf46`, merged 2026-11-23): replaced deprecated `apt_repository` with + `deb822_repository`, standardised Ansible `command` `cmd:` / `changed_when` / `check_mode: false` hygiene across + roles and `unlink.yml`, added `devenv_is_wsl` detection to unconditionally exclude all 12 Linux Ghostty and Warp + tasks on WSL, enabled `set -g mouse on` in `.tmux.conf`, and added hygiene, WSL templating, and zero-deprecation + `--syntax-check` tests. Consensus 3/3 APPROVED at iter 2; calibration EV predicted 92.83 / actual 94.64 (delta + +1.81); 6/6 CI green. +69. **dev-env `devenv_user`, WSL wizard prompt skip, and Ansible Jinja2 variable audit (Bean 0364 / dev-env PR #37, + 2026-11-23)**: + - `0364` (dev-env PR #37, `4b1391c3`, merged 2026-11-23): defined `devenv_user` in `ansible/group_vars/all.yml`, + added `is_wsl()` in `scripts/devenv_wizard.py` to skip the Ghostty/Warp prompt and persist + `devenv_install_gui_casks: false` on WSL, and added Conda command templating plus repo-wide Jinja2 AST + variable-audit tests in `tests/test_templating.py` and WSL wizard tests in `tests/test_wizard.py`. Consensus 3/3 + APPROVED; calibration EV predicted 95.02 / actual 95.95 (delta +0.93); 6/6 CI green. +70. **dev-env disable `expand_argument_vars` on Conda clean-shell checks and `ansible-playbook` test (Bean 0365 / + dev-env PR #38, 2026-11-23)**: + - `0365` (dev-env PR #38, `68ddec98`, merged 2026-11-23): set `expand_argument_vars: false` on all three clean-shell + Conda verification `ansible.builtin.command` tasks in `ansible/roles/conda/tasks/main.yml` and switched Fish to + `string join : -- $PATH`, enforced static `expand_argument_vars: false` hygiene for shell `$VAR` command tasks in + `tests/test_toolchain.py`, and added a real hermetic `ansible-playbook` verification test under polluted parent + `PATH` / `CONDA_DEFAULT_ENV` in `tests/test_shell_hooks.py`. Consensus 3/3 APPROVED; calibration EV predicted + 96.27 / actual 97.28 (delta +1.01); 6/6 CI green. --- ## Active Beans Triage and Prioritisation Matrix -| Priority | Status | Impact | Sizing | Bean # | Title | Domain | Dependencies / Notes | -| :------- | :---------- | :----: | :----: | :----- | :----------------------------------------------------------------------------------------------------------- | :------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **P2** | in-progress | Medium | S | 0335 | A Stage 3 resume restarts from the ledger partial_head and ignores commits added to the execution branch tip | Holon Flow / Stage 3 / Resume | In progress in the live `resumetip` flow. Seen on the shortref flow: a hand-merged origin/main on the execution branch was ignored on resume, because the executor resumes from the ledger partial_head. Resume from the branch tip when it descends from the recorded partial head. Same resume path as Bean 0331, so one flow. Do not push an execution branch before its ledger row exists. | -| **P2** | todo | Medium | S | 0336 | A Stage 4 review container left the shared flow worktree on a detached HEAD, so the resolver refused to run | Holon Flow / Stage 4 / Worktree | Todo. Seen on PR #206 (2026-11-19): the review container left the flow worktree on a detached HEAD while the host worktree was mounted, and the resolver refused to run until it was re-attached by hand. Re-attach or refuse on container exit. Unblocked by Bean 0323's merge (PR #207); same review-loop lane. | -| **P1** | in-progress | High | M | 0337 | A flow refused at Stage 3 admission still counts as in flight, so two waiting flows block each other | Holon Flow / Stage 3 / Admission | Decided 2026-11-20: a refused flow gets an explicit blocked state with its blockers, and only admitted flows count as in flight (`local_in_flight_flows`, `flow/in_flight.py`). Admission runs under a per-repository lock. Same admission and resume path as Beans 0331 and 0335, so it follows them. | -| **P1** | in-progress | High | M | 0331 | Each --allow-overlap resume moves the plan tip, so Stage 3 partial work is never continued | Holon Flow / Stage 3 / Resume | In progress. Harness half done: `run_holon_flow.py` no longer adds `--allow-overlap` after an admission refusal, and `flow_env.py` sets the execute budget. Target half: a Stage 3 partial head that descends from an older plan tip is accepted on resume, with a hermetic test. It touches the Stage 3 resume code (`entrypoint/execution_workspace.py`), which Bean 0321 changed. 0321 merged on 2026-11-20, so this is unblocked; it shares the resume path with Bean 0335, so both go in one flow, which runs as the live `resumetip` flow. | -| **P1** | todo | High | M | 0283 | An agent's API error output is written as the plan and reported as a metrics failure | Planner / Token Reduction | Todo. The planner writes an Anthropic API 400 as the plan and then hides it behind a metrics failure, and a failed attempt leaves an untracked plan file. Fix: fail the stage on API error output, leave no plan file behind, and keep `cache_control` blocks consistent in `payload_cleaner`. Touches the planner entrypoint that 0321 also touched; 0321 has merged, so it is unblocked. Workaround until it lands: `HOLON_TOKEN_REDUCE=0`. | -| **P1** | todo | High | M | 0270 | Discover runner models dynamically through each harness instead of the hardcoded model table | Flow / Architecture | Todo, and blocked for now: the flow needs a usable runner (Antigravity quota and `claude-agent` login at the time of the bean). Replaces the hardcoded `RUNNER_CAPABILITIES` table with per-harness discovery. Shares `agent_defaults.py` with 0322 (0321 has merged), so it runs after 0322. Sizing is a triage estimate. | -| **P1** | todo | High | L | 0265 | Split `cli/__init__.py` into focused modules (move only), like the `flow/` package | Refactor / Architecture | Splits the 2,026-line `cli/__init__.py` (80 definitions, 96 `mock.patch` targets, 63 importers) into `cli/{log,constants,network,credentials,repo_resolution,mounts,proxy_sidecar,env_files,containers,doctor,role_dispatch,parser}.py` with re-exports and a throwaway AST verification, no committed snapshot. Hold until PR #152 (Bean 0262) and Beans 0263 and 0264 merge. Unblocks Bean 0189. | -| **P2** | todo | Medium | M | 0264 | Read module size budgets from configuration instead of hardcoding paths and numbers in the check | Lint / Configuration | Moves the `flow/` size budgets into `holon-config/hygiene/module_budgets.json` (packages, default ceiling, overrides with reasons) read by a generic `check_module_budgets.py`, deleting `flow_module_budgets.json`. Agents may change the configuration; raised limits warn instead of failing. Hold until Bean 0263 merges. | -| **P2** | todo | Medium | XS | 0261 | Deduplicate and streamline PR review evaluation line in consensus report | Review Loop / Report | Streamline redundant evaluation header text in `review_report.py` to print a single clean summary line matching canonical skill output and avoiding duplicated PR/iteration metadata. | -| **P1** | todo | High | L | 0255 | Streaming per-issue resolvers during Stage 4 CI & review with single consolidated commit | Review Loop / Concurrency | Spin up isolated resolvers immediately as each CI pipeline fails (e.g. `Test - Hygiene` at 10 s) while continuing to wait for remaining pipelines, then merge all resolver fixes and push a single commit per iteration. Sequence after 0254 and 0256; pairs with 0234. | -| **P1** | todo | Medium | S | 0234 | Event-driven CI check progress reporting during Stage 4 review | Review Loop / Logging | Log total CI pipelines once at start (`Tracking N GitHub CI check(s)...`) and emit a log line only when a check completes or changes state, suppressing 15 s polling noise. Intent in `todo/`; pair with 0160. | -| **P1** | todo | High | M | 0189 | Launcher module owns container launch and role dispatch; break the `flow` -> `cli` cycle | Refactor / Architecture | After 0187 (0188 is merged as #117); unblocks 0200. Runs with 0190 and precedes 0183. | -| **P1** | todo | High | M | 0190 | `FlowCheckpoint` and ledger reconciliation own their behaviour; entrypoints stop importing flow | Ledger / Holon Flow | After 0187; 0158 (PR #111, same code) has merged. Precedes 0183. Unblocks 0196, 0199. | -| **P1** | todo | High | M | 0191 | One GitHub adapter owns every `gh` call (PR, CI probe, mergeability, review posting) | GitHub / Architecture | After 0187. Unblocks 0192. | -| **P1** | todo | High | L | 0192 | `run_review_loop` and `run_review_stage` become a `ReviewLoop` object with named steps | Review Loop / Refactor | After 0191. 528 lines, CC 131. Sequence after 0160/0234 (same touch set). | -| **P1** | todo | High | L | 0196 | Executor entrypoint `main` becomes an `ExecutionRun` with named steps; module becomes a package | Executor / Refactor | After 0195 and 0190. 798 lines, CC 178 (worst in the repository). | -| **P1** | todo | High | S | 0175 | Check GitHub token scopes before Stage 3 when the plan touches workflow files | Holon Flow / GitHub | A 55-minute Stage 3 for Bean 0168 was lost to a push rejected for the missing `workflow` scope. Complements 0171 (#108 merged, refused-push patch salvage). | -| **P1** | todo | High | S | 0157 | `holon flow` auto-enables the mitmproxy sidecar; role containers cannot reach it | Holon Flow / Proxy | Workaround: `HOLON_TOKEN_REDUCE=0`. Pairs with 0227 (`fix/0227-proxy-readiness-http-probe`). | -| **P1** | todo | High | M | 0155 | General `HOLON_*` forwarding puts credential-shaped values on the docker argv | Security | Already on main. Default fix: send every `HOLON_*` value through the 0600 env-file. | -| **P1** | todo | High | M | 0148 | Redact before truncating ledger `error_context`; close `CredentialRedactor` gaps | Security / Ledger | Route those rows through `redact_agent_secrets`. | -| **P1** | todo | Medium | M | 0146 | Plans-ledger correction rows; calibration picks the right predicted metrics | Calibration / Ledger | Every calibration in the 2026-10-26 batch needed a manual annotation. Runs before 0197 (same parser). | -| **P1** | todo | High | M | 0213 | Reflect review-loop skill rules into native Review Loop Holon Agent | Review Loop / Prompts | Target: `holon-agentic-coder`. Unblocked now that 0221/0228/0229 are merged: reflects target-branch conflict checks, ledger-only fast resolution, and model fallback into `review_loop.template.md`. | -| **P1** | todo | High | S | 0215 | Deterministic beans-to-beads JSONL converter and real-data dry run | Issue Tracking / Migration | Harness work. Converts bean frontmatter + body to beads JSONL for `bd import`; verified on all open beans per rule 10. Unblocks 0217. | -| **P1** | todo | Medium | S | 0172 | Stage and turn budgets accept an explicit 'unlimited' value, distinct from unset (default) | Holon Flow / Config | Workaround today: `HOLON_STAGE_BUDGET_EXECUTE_MINUTES=10080`. Pair with or follow 0232. | -| **P1** | todo | High | M | 0173 | holon loads layered .env files (specific overrides broad) that every sandbox stage inherits | Holon Flow / Config | Project `.env` overrides the broader `.env`. Touches `cli/`; sequence after 0155/0148 and 0174. | -| **P1** | todo | Medium | M | 0174 | Document every environment variable holon reads, in one generated and CI-checked reference | Documentation / Config | After 0172; precursor to 0173, whose layered `.env` needs this reference's allow-list and secret flags. | -| **P1** | todo | High | L | 0176 | Remove every unittest reference from holon-agentic-coder; the suite is pytest only | Tests | Unblocked by 0168 (#99 merged). 59 `TestCase` classes and about 60 `unittest.mock` imports in 29 files. Runs alone: it touches most test files. | -| **P1** | todo | High | M | 0166 | Pipeline duration dashboard for CI builds | CI / Observability | Check org Actions performance metrics first. Shares data and baseline with 0163 (#109, #30). | -| **P1** | todo | High | XL | 0152 | Audit long files; decompose oversized functions (flow.py, cli.py first) | Refactor / Concurrency | Umbrella for the Bean 0177 action beans 0185-0200 and 0203-0208; 0185, 0186, 0188, and 0203-0207 are merged. Remaining: `flow.py` split (0187) and per-module lanes. | -| **P2** | todo | Medium | M | 0225 | Claude token lives only in the OS keychain; retire the plaintext secrets file | Agent Runner / Credentials | After 0224 (extends its discovery seam). Keychain-only; one-time migration deletes the file. | -| **P2** | todo | Medium | L | 0223 | Audit CLI flags vs HOLON_* env vars: four-kind decision rule, flag>env precedence | CLI / Config | Exhaustive inventory of every add_argument and os.getenv; boundary-crossing=both, per-invocation=flag, ambient=env-primary, secrets=env-only. | -| **P2** | todo | High | L | 0226 | End-to-end test for the holon flow commands with full teardown | Testing / E2E | Runs on a sub-1B local model via the `local_llm` envelope (no cloud secrets); never opens a PR; unconditional teardown of worktrees and remote `I-…` trees; invariant assertions + bounded whole-run retries. Operator-run `test-e2e` task, excluded from CI. | -| **P2** | todo | Medium | M | 0181 | Use the `/_` leaf only when referencing a git branch, never on ids | Holon Flow / Ledger | `intents.jsonl` `branch` and `parent_intent_id` hold refs; migrate with readers accepting both shapes. After 0161 (overlaps `flow.py`; 0179 is merged). | -| **P2** | todo | Medium | XL | 0153 | Remove comments and docstrings from all code; make it self-documenting | Readability | Per package, with or right after that package's decomposition (which follows its split: 0187, 0188, 0204), not as one repository-wide flow. | -| **P2** | todo | Medium | M | 0193 | Decompose the intent and plan stage modules | Holon Flow / Refactor | After 0187; parallel decomposition lane. | -| **P2** | todo | Medium | M | 0194 | `run_execute_stage` becomes an `ExecuteStage` with named steps | Holon Flow / Refactor | After 0187; parallel decomposition lane. 306 lines, CC 40. | -| **P2** | todo | Medium | M | 0197 | Split `calibration.py` into a package; decompose metrics parsing and report generation | Calibration / Refactor | After 0187 and 0146 (0162 is merged as #112); parallel lane otherwise. | -| **P2** | todo | Medium | M | 0198 | Agent runner registry: one `RunnerSpec` module per agent | Runners / Refactor | After 0185 (#115 merged); parallel lane. | -| **P2** | todo | Medium | M | 0200 | Remove holon-agentic-coder's diverged `token_reduction` copy; holon-coherence is the owner | Token Reduction | After 0189. Ownership already ruled: holon-coherence owns token reduction. | -| **P2** | todo | Medium | M | 0199 | Decompose ledger query and the knowledge index | Ledger / Knowledge | After 0190; parallel lane. Low bean priority. | -| **P2** | todo | Medium | M | 0216 | Holon flow references and drives beads work items (claim on intent, close on merge) | Holon Flow / Beads | Holon flow against holon-agentic-coder. Intent `work_item` field, `holon intent` claims issue, calibration/merge closes with PR URL. Sequence after 0214. | -| **P2** | todo | Medium | S | 0217 | Adopt beads (bd) issue tracking inside holon-coherence | Issue Tracking / Coherence | Holon flow against holon-coherence. `bd init` prefix `hcoh-`, import open coherence beans from 0215 converter. Sequence after 0214 and 0215. | -| **P2** | todo | Medium | M | 0218 | Port harness skills and guidance to bd and sequence the harness retirement | Harness Deprecation | Harness work. Retire triage matrix / `prioritise-beans` for `bd ready --json`; port guidance; archive harness read-only after pilots succeed. | -| **P2** | todo | Medium | M | 0317 | GitHub Projects kanban board for holon-agentic-coder, fed by beads issues | Issue Tracking / Projects | Blocked by 0214 (now completed, so unblocked). Board fed from `bd` issues on `refs/dolt/data`; a read-only view for the maintainer. Sequence after 0215 and 0216. | -| **P2** | todo | High | L | 0142 | Real-workload benchmark: Qwen3.8-27B dense vs Flash-Next MoE | Model Selection | Real data only (AGENTS.md item 10). | -| **P3** | todo | Low | XS | 0231 | Exhausted-budget error string interpolates raw count while payload reports clamped 0 | Flow Engine / Cosmetic | PR #124 loop deferral (cosmetic, out-of-increment). Touches `flow.py` - bundle with 0230. | -| **P3** | todo | Low | XS | 0269 | Deferred nits from the holon-agentic-coder PR 158 review loop | Review Loop / Housekeeping | Three deferred nits from PR #158: fold `parse_actual_metrics` onto `_record_exit_code`, removed-definitions test proof, and `docs/git_flow.md` checkpoint wording. | -| **P3** | todo | Low | S | 0322 | Remove the gemini-agent runner, made redundant by antigravity-agent | Runners / Cleanup | Todo; unblocked by the 0321 merge (2026-11-20). It touches `agent_defaults.py` (and also `agent_runner.py`, the `Dockerfile` and `docker-bake.hcl`). Removes the `gemini-agent` runner, image target and registry entries. Keeps Gemini models, the `gemini` URL detection in the token-reduction addon and historical ledger rows. Decide whether the `local-model` placeholder stays. | -| **P3** | todo | Medium | M | 0141 | Tune vmlx prefill/decode levers for both Qwen3.8 models, crash-safe | vmlx / Performance | Pairs with 0142. | -| **P1** | todo | Medium | M | 0333 | GitHub Issues replace beads as the target tracker; remove the beads pilot from holon-agentic-coder | Build / DevEx | | +| Priority | Status | Impact | Sizing | Bean # | Title | Domain | Dependencies / Notes | +| :------- | :---------- | :----: | :-----------------------: | :----- | :------------------------------------------------------------------------------------------------- | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **P1** | todo | High | S | 0360 | Resume after an interrupted plan stage creates a duplicate P- branch | Flow / Stage 2 / Checkpoint | Ready in Stage 2 plan/checkpoint lane (`PR #239` merged). Record pushed `P-` branch atomically with push or adopt existing pushed `P-` branch on resume. | +| **P1** | todo | High | M | 0333 | GitHub Issues replace beads as the target tracker; remove the beads pilot from holon-agentic-coder | Issue Tracking / Decision | Ready now (disjoint from PR #230; 0321 and 0322 merged). Removes `.beads/config.yaml`, `bd` install in Dockerfile/bake, `test_beads_integration.py`, and beads docs. Unblocks `0215`–`0218` and `0317`. | +| **P1** | todo | High | M | 0270 | Discover runner models dynamically through each harness instead of the hardcoded model table | Flow / Architecture | Ready now (runner/quota block cleared; 0262 and 0322 merged; disjoint from PR #230). Replaces hardcoded `RUNNER_CAPABILITIES` in `agent_defaults.py` with per-harness discovery. Sequence with `0198` and `0350` on `agent_defaults.py`. | +| **P1** | todo | High | M | 0350 | Enable Claude Code code mode (CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1) for every Claude run | Claude / Config | Ready now (disjoint from PR #230). Direct harness edit (`flow_env.py`, `.claude/settings.json`) plus HAC flow on `agent_runner.py` / `agent_defaults.py` / `role_dispatcher.sh` / `doctor`. Sequence with `0270` and `0198`. | +| **P1** | in-progress | High | S | 0175 | Check GitHub token scopes before Stage 3 when the plan touches workflow files | Holon Flow / GitHub | In progress in HAC PR #244 (`UNSTABLE`). Pre-flight `workflow` scope when touch set hits `.github/workflows/**` and warn in `holon doctor`. | +| **P1** | in-progress | Medium | M | 0174 | Document every environment variable holon reads, in one generated and CI-checked reference | Documentation / Config | Ready now (`0172` in PR #225 and `0347`/`0354` in PR #230 merged). Precursor to `0173` (layered `.env`). | +| **P1** | todo | High | L | 0265 | Split `cli/__init__.py` into focused modules (move only), like the `flow/` package | Refactor / Architecture | Sequence after PR #243 (`0155`) / #244 (`0175`) which touch `cli/__init__.py`. | +| **P1** | in-progress | High | M | 0191 | One GitHub adapter owns every `gh` call (PR, CI probe, mergeability, review posting) | GitHub / Architecture | In progress in HAC PR #245 (`UNSTABLE`). Unblocks `0192`. | +| **P1** | in-progress | High | L | 0192 | `run_review_loop` and `run_review_stage` become a `ReviewLoop` object with named steps | Review Loop / Refactor | Blocked by `0191`. `flow/review/loop.py` is 936 lines. Sequence one at a time in the review-loop lane with PR #230, `0255`, and `0231`. | +| **P1** | todo | High | L | 0255 | Streaming per-issue resolvers during Stage 4 CI & review with single consolidated commit | Review Loop / Concurrency | Queued behind PR #230 (overlaps `flow/review/loop.py`, `entrypoint/review_loop.py`). One at a time with `0191`, `0192`, `0231`. | +| **P1** | in-progress | High | S | 0157 | `holon flow` auto-enables the mitmproxy sidecar; role containers cannot reach it | Holon Flow / Proxy | Queued behind PR #230 (overlaps `flow/context.py`) and sequenced with `0265` (`cli/__init__.py`). Workaround: `HOLON_TOKEN_REDUCE=0`. | +| **P1** | todo | High | S | 0215 | Deterministic beans-to-GitHub-Issues importer and real-data dry run | Issue Tracking / Migration | Harness work. Blocked by `0333` (remove beads pilot & finalise decision). Converts open beans to GitHub Issues with real-corpus dry run; unblocks `0217`, `0218`, and `0317`. | +| **P1** | in-progress | High | M | 0173 | holon loads layered .env files (specific overrides broad) that every sandbox stage inherits | Holon Flow / Config | Sequence after `0155`, `0174`, and `0265` (touches `cli/` and `role_dispatcher.sh`). | +| **P1** | in-progress | High | L | 0176 | Remove every unittest reference from holon-agentic-coder; the suite is pytest only | Tests | Re-measured 2026-11-23 on `main` (`b22258d`): **144** tracked files mention `unittest`. Runs alone with zero other HAC PRs in flight (after PR #230 merges). | +| **P1** | in-progress | High | XL | 0152 | Audit long files; decompose oversized functions (flow.py, cli.py first) | Refactor / Concurrency | Umbrella. Coherence (`0186`, `0203`–`0208`) and HAC (`0185`, `0188`, `0190`, `0193`, `0194`, `0195`, `0196`, `0199`, `0254`) children merged. Remaining: `0265`, `0189`, `0191`, `0192`, `0197`, `0198`, `0200`, `planner.py`, and re-audit. | +| **P2** | in-progress | Medium | M | 0197 | Split `calibration.py` into a package; decompose metrics parsing and report generation | Calibration / Refactor | Ready now (0146 merged in PR #221; disjoint from PR #230 which edits `calibration_outcome.py`). `calibration.py` is 1,637 lines. Sequence with `0355` on `flow/stages/calibrate.py`. | +| **P2** | in-progress | Medium | M | 0198 | Agent runner registry: one `RunnerSpec` module per agent | Runners / Refactor | Ready now (`0322` merged in PR #222, dropping `gemini` from scope; disjoint from PR #230). Must carry `AGENT_TICKERS`. Sequence with `0270` and `0350` on `agent_defaults.py` / `agent_runner.py`. | +| **P2** | todo | Medium | M | 0225 | Claude token lives only in the OS keychain; retire the plaintext secrets file | Agent Runner / Credentials | Ready now (0224 merged in PR #170; disjoint from PR #230). Extends `claude_credential.py` discovery seam to OS keychain only with one-time file migration. Sequence with `0350` if touching runner config. | +| **P2** | todo | Medium | M | 0352 | Push GitHub PR events through `gh webhook forward`, with cheap polling as the fallback | GitHub / Efficiency | Queued behind PR #230 (overlaps review-loop CI/conflict polling and `run_holon_flow.py` / skills). Needs `cli/gh-webhook` + `admin:repo_hook` scope on maintainer `gh`; stopgap until `gh event listen` is enabled. | +| **P2** | todo | High | L | 0226 | End-to-end test for the holon flow commands with full teardown | Testing / E2E | Ready (operator-run local sub-1B model via `local_llm`, never opens a PR, excluded from CI). Reconcile test mode with `0357` (removes `--skip-review`). | +| **P2** | in-progress | Medium | M | 0181 | Use the `/_` leaf only when referencing a git branch, never on ids | Holon Flow / Ledger | Queued behind PR #230 (overlaps `docs/git_flow.md` and `docs/ledger_schema.md`). `entrypoint/executor/run.py` (94, 242), `calibration.py`, `cli/commands/`, and `entrypoint/` still strip/re-add `/_`; sequence with `0197`. | +| **P2** | todo | Medium | L | 0223 | Audit CLI flags vs `HOLON_*` env vars: four-kind decision rule, flag>env precedence | CLI / Config | Wait for `0265` (`cli/` split) and `0357` (drops `--skip-review`). Exhaustive inventory of every `add_argument` and `os.getenv`, unified resolution helper, logged source, auto-derived `--help`. | +| **P2** | in-progress | Medium | M | 0200 | Remove holon-agentic-coder's diverged `token_reduction` copy; holon-coherence is the owner | Token Reduction | Unblocked (`0189` merged in PR #241). Remove duplicated `sandbox_executor.token_reduction` code in favour of `holon-coherence`. | +| **P2** | in-progress | Medium | M | 0216 | Holon flow references and drives GitHub Issues (assign on intent, close on merge) | Holon Flow / Issue Tracking | Blocked by `0333`. Adds optional `work_item` to intent schema, marks issue in progress, adds `Closes #N` to PR body; sequence with `0191` (`flow/github/`). | +| **P2** | todo | Medium | S | 0217 | GitHub Issues tracking for holon-coherence: labels, guidance and import | Issue Tracking / Coherence | Blocked by `0215`. Creates labels and imports coherence beans after `0215`; guidance change runs via Holon flow on `holon-coherence`. | +| **P2** | todo | Medium | M | 0218 | Port harness skills and guidance to GitHub Issues and sequence the harness retirement | Harness Deprecation | Harness work. Blocked by `0215`, `0216`, and `0217`. Replaces triage matrix and bean-closing steps, then archives harness read-only. | +| **P2** | todo | Medium | M | 0317 | GitHub Projects kanban board over the target repositories' issues | Issue Tracking / Projects | Blocked by `0215` (and maintainer `gh auth refresh -s project`). Organisation Project v2 over `holon-agentic-coder` and `holon-coherence`. | +| **P2** | in-progress | Medium | XL | 0153 | Remove comments and docstrings from all code; make it self-documenting | Readability | Per package after its decomposition (`holon-coherence` decompositions are complete and ready; on HAC, run only on settled packages). | +| **P2** | todo | High | L | 0142 | Real-workload benchmark: Qwen3.8-27B dense vs Flash-Next MoE | Model Selection | Ready (operator/host-run; real data only). Blocked beans `0129`, `0132`, `0133` are completed; benchmark itself has not run. | +| **P2** | draft | High | S (analysis) + L (splits) | 0340 | Revisit the module budget: implications of a strict 200-line default with no overrides | Lint / Refactoring | Draft (unblocked since PR #214 froze `module_budgets.json`, awaits maintainer decision). Decide ceiling, line counting, covered packages, and split order; each override removal needs explicit authorisation. | +| **P3** | todo | Low | XS | 0231 | Exhausted-budget error string interpolates raw count while payload reports clamped 0 | Flow Engine / Cosmetic | Queued behind PR #230 (overlaps `flow/review/loop.py` lines 917–918). Cosmetic; bundle with a review-loop flow. | +| **P3** | todo | Low | XS | 0269 | Deferred nits from the holon-agentic-coder PR 158 review loop | Review Loop / Housekeeping | Wait for PR #230 (overlaps `docs/git_flow.md`) and `0197` (`calibration.py`). Item 2 obsolete; remaining: fold `parse_actual_metrics` exit-code logic onto `record_exit_code` and fix `docs/git_flow.md` checkpoint wording. | +| **P3** | todo | Medium | M | 0141 | Tune vmlx prefill/decode levers for both Qwen3.8 models, crash-safe | vmlx / Performance | Ready (host-level vMLX tuning on Mac; not a target-repo change). Pairs with `0142`. | +| **P1** | in-progress | High | M | 0363 | After merging main, wait for CI before calibrating; restart PR review from the start if CI breaks | Ledger / Observability | | --- ## Recommended Next Execution Sequence -**Start here (2026-11-20):** Bean 0323 merged as HAC PR #207 (`d0b3e23`) and is completed; the harness installs were -rebuilt from `main` at `d0b3e23` the same day. The next flow is Beans 0331 (target half) and 0335 (P1 and P2), which run -in the live `resumetip` flow now that PR #207 has cleared its overlap. Run one flow at a time, because the next lanes -share the Stage 3 resume path and the flow package. Keep `HOLON_TOKEN_REDUCE=0` until Bean 0283 lands. - -**Rule (2026-10-25):** never run concurrent flows whose touched files overlap. The engine enforces this from Bean 0151: -a flow whose touch set overlaps an in-flight flow is refused before Stage 3 unless `--allow-overlap` is given. Items -inside one lane below run one at a time. Lanes run together only when their touch sets are disjoint. - -**Rule (2026-10-26):** no stage before the merge may halt for human review. The PR merge is the only human step, after -consensus review and Stage 5 calibration. - -**Rule (2026-10-28) and worktree rule (2026-11-09):** the target suites rely solely on pytest. A flow never runs in the -`main` worktree; it runs in a `flow-` worktree off `origin/main`. - -**Tooling:** `holon 0.1.0` and `holon-coherence 0.1.0` were reinstalled from `main` (`d0b3e23`) on 2026-11-20. -`holon --version` prints no commit, so the editable install is the check. Set `HOLON_STAGE_BUDGET_EXECUTE_MINUTES=10080` -until Bean 0172 lands. - -**Serial chain, `holon-agentic-coder` (one flow at a time; these touch the ledgers, `agent_defaults.py`, the planner and -the flow package):** - -1. **Beans 0331 (target half) and 0335** as one flow, running as the live `resumetip` flow: both change the Stage 3 - resume path (`entrypoint/execution_workspace.py`), and 0335 resumes from the execution branch tip instead of the - ledger `partial_head`. PR #207 has merged, so its Stage 3 can start. -2. **Bean 0337** (P1; a flow refused at Stage 3 admission must not count as in flight; `flow/in_flight.py`) after 0331 - and 0335, since it changes the same admission and resume path. -3. **Bean 0336** (Stage 4 review container leaves the worktree detached), in the review-loop lane; unblocked by Bean - 0323's merge. -4. **Bean 0283** (P1; planner entrypoint, `payload_cleaner`), unblocked by the 0321 merge. -5. **Bean 0322** (P3; `agent_defaults.py`, `agent_runner.py`, `Dockerfile`, `docker-bake.hcl`), then **Bean 0270** after - 0322 (model discovery; also blocked on a usable runner). -6. **Bean 0146**, then **Bean 0197** (`calibration.py`), and **Bean 0181** (`/_` only on branch refs). The 0321 naming - change they waited for has landed. **Review loop and calibration lane (`entrypoint/review_loop.py`, `flow/review/`, - `review_report.py`):** unblocked now that 0297 has merged, one item at a time. - -- **Bean 0255** (streaming per-issue resolvers, one consolidated commit per iteration), then **Bean 0234** (CI check - progress logging; pairs with the completed 0160). -- **Bean 0261** (`review_report.py`: one clean evaluation line), then **Bean 0269** (deferred nits from PR #158). -- **Bean 0213** (reflect review-loop skill rules into the native review-loop agent template). - -**Flow package and decomposition lane (`flow/` submodules, one flow at a time per submodule):** - -- **Bean 0264** (module budgets move to `holon-config/hygiene/module_budgets.json`), then **Bean 0265** (move-only split - of `cli/__init__.py`). 0265 unblocks 0189. -- **Bean 0189** (launcher module; breaks the `flow` to `cli` cycle), then **Bean 0190** (checkpoint and ledger - reconciliation), then **Bean 0200** (remove the diverged `token_reduction` copy; after 0189) and **Bean 0199** (ledger - query and knowledge index; after 0190). -- **Bean 0191** (one GitHub adapter), then **Bean 0192** (`ReviewLoop` object). **Bean 0196** (`ExecutionRun`; after - 0190, with 0195 completed). -- **Beans 0193 and 0194** (intent, plan and execute stage modules; after 0187, completed). **Bean 0198** (runner - registry; after 0322 because both touch runner registration). **Bean 0153** (remove comments per package, last in each - package after its split). **Bean 0152** is the umbrella that tracks this lane. -- **Bean 0231** (P3; error-string fix in the flow package, no bundle partner left). - -**Config, security and CLI lane (`cli/`, credentials, ledger redaction):** - -- **Bean 0155** (route `HOLON_*` values through the 0600 env file), then **Bean 0148** (redact before truncating - `error_context`). -- **Bean 0172** (explicit unlimited budgets), then **Bean 0174** (environment variable reference), then **Bean 0173** - (layered `.env`; touches `cli/`, after 0155, 0148 and 0174). **Bean 0223** (CLI flag and env audit). -- **Bean 0225** (OS keychain-only Claude token; follows the completed 0224). -- **Bean 0175** (token-scope pre-flight) and **Bean 0157** (mitmproxy sidecar reachability; pairs with the completed - 0227). -- **Bean 0176** (pytest-only conversion of every test file) runs alone, because it touches most test files. - -**Beads adoption and harness work (harness-only or disjoint; can run beside any lane):** - -- **Bean 0215** (beans-to-beads converter) and **Bean 0246** (harness skill wording) touch no target repository and can - run beside any flow. -- **Bean 0216** (flow drives beads work items) touches the flow, so it waits for the serial chain. Then **Bean 0217** - (adopt beads in holon-coherence), **Bean 0218** (port harness skills; retire the harness) and **Bean 0317** (GitHub - Projects board; after 0215 and 0216). - -**Independent or benchmarking (run alone when they start real flows):** **Bean 0226** (end-to-end test on a sub-1B local -model; operator-run, never opens a PR), **Bean 0166** (CI pipeline duration dashboard), **Bean 0142** (real-workload -benchmark, Qwen3.8 dense vs Flash-Next MoE) and **Bean 0141** (vmlx tuning, pairs with 0142). +**Start here (2026-11-23):** every active bean was audited against current `main` (`holon-agentic-coder` `0f0089d`, +`holon-coherence` `baf5c65`, `dev-env` `68ddec9`) and open HAC PRs #243 (`0155`), #244 (`0175`), #245 (`0191`). PR #222 +(0322), PR #225 (0172), PR #226 (0348), PR #227 (0199), PR #228 (0193), PR #229 (0349), PR #230 (0347, 0354), PR #234 +(0196), PRs #235 & #237 (0358), PR #236 (0194), PR #238 (0357), PR #239 (0356), PR #240 (0355), PR #241 (0189), and +`dev-env` PRs #31–#33 (0344, 0346, 0361), #36 (0351), #37 (0364), and #38 (0365) have merged. Run one flow at a time +within a lane; lanes run together only when their touch sets are disjoint. + +**In-flight (active flows / open PRs):** **HAC PR #243** (`0155`, `CLEAN`), **HAC PR #244** (`0175`, `UNSTABLE`), and +**HAC PR #245** (`0191`, `UNSTABLE`). + +**Ready now in parallel (disjoint from PRs #243/#244/#245 and each other):** + +- **HAC beads removal:** **Bean 0333** (P1, M — removes `.beads/` pilot, unblocks GitHub Issues migration `0215`–`0218` + and `0317`). +- **HAC runner/model lane (one at a time):** **Bean 0270** (P1, M — dynamic model discovery), **Bean 0350** (P1, M — + `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1`), **Bean 0198** (P2, M — `RunnerSpec` registry), or **Bean 0225** (P2, M — OS + keychain Claude token). +- **HAC calibration lane:** **Bean 0197** (P2, M — `calibration/` package; `0355` merged in PR #240). +- **HAC documentation / cleanup (unblocked now that PR #230/#241 merged):** **Bean 0174** (P1, M — env var reference), + **Bean 0359** (P3, XS — PR #230 deferred nit D-1), and **Bean 0200** (P2, M — remove `token_reduction` copy, now + unblocked by `0189`), **Bean 0269** (P3, XS — PR #158 nits, sequence with `0197`). +- **HAC Stage 2 / ledger / config:** **Bean 0360** (P1, S — interrupted Stage 2 duplicate `P-` branch), **Bean 0181** + (P2, M — `/_` only on branch refs). +- **Independent / host / `holon-coherence`:** **Bean 0226** (P2, L — operator-run sub-1B e2e), **Bean 0141** (P3, M — + host vMLX tuning), **Bean 0142** (P2, L — benchmark), and the `holon-coherence` slice of **Bean 0153** (P2 — all + coherence decompositions are merged). + +**Queued behind PRs #243 / #244 / #245 (file overlap):** + +- **CLI split & config lane (after PR #243/#244):** **Bean 0265** (`cli/__init__.py` split) -> **Bean 0173** (layered + `.env`, after `0155` & `0174`), **Bean 0157** (sidecar opt-in), **Bean 0223** (CLI flag/env audit). +- **Review-loop lane (after PR #245 `0191`):** **Bean 0192** (`ReviewLoop` object), **Bean 0255** (streaming resolvers), + **Bean 0352** (`gh webhook forward` + cheap polling), **Bean 0231** (raw count nit). +- **Solo repo-wide sweep:** **Bean 0176** (144 test files, runs alone with zero other HAC PRs in flight). +- **GitHub Issues migration chain:** **Bean 0333** -> **Bean 0215** (harness importer) + **Bean 0216** (flow + `work_item`) -> **Bean 0217** (`holon-coherence`) + **Bean 0317** (Projects board) -> **Bean 0218** (port skills & + retire harness). +- **Umbrella / per-package / draft:** **Bean 0152** (umbrella), **Bean 0153** (remove comments/docstrings per package + after split), **Bean 0340** (draft module-budget revisit; awaits maintainer authorisation). + +**Rules:** never run concurrent flows whose touched files overlap; no stage before merge halts for human review; target +suites use `uv run pytest` only; flows run in dedicated `flow-` worktrees off `origin/main`. +`HOLON_STAGE_BUDGET_*` accepts `unlimited` (Bean 0172). diff --git a/.beans/holon-agentic-coder-ref-metadata-0141--tune-vmlx-prefill-and-decode-levers-safely.md b/.beans/holon-agentic-coder-ref-metadata-0141--tune-vmlx-prefill-and-decode-levers-safely.md index d076514..c249df6 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0141--tune-vmlx-prefill-and-decode-levers-safely.md +++ b/.beans/holon-agentic-coder-ref-metadata-0141--tune-vmlx-prefill-and-decode-levers-safely.md @@ -13,7 +13,7 @@ tags: - kv-cache - qwen3.8 created_at: 2026-10-22T14:29:12Z -updated_at: 2026-10-22T14:29:12Z +updated_at: 2026-11-21T01:20:00+11:00 --- Tune the prompt-processing (prefill) and token-generation (decode) levers of the local vMLX stack for **both** @@ -132,3 +132,8 @@ already-staged config has not been applied yet.** output, launch recipes in harness docs) is harness/target work and routes through the flow or its own bean. - Bean 0140 (output ceiling must be explicit — caps are cross-checkable via `:8081/health` + backend `/health`), Bean 0138 (why single-response caps are fatal), Bean 0139 (turn budgets), Bean 0049 (why `local_llm.py` exists). + +## Audit (2026-11-21) + +Not checkable against the repository (a host-level vMLX tuning bean); still valid as written. Beans 0129, 0132 and 0133 +that it relates to are completed. diff --git a/.beans/holon-agentic-coder-ref-metadata-0142--benchmark-27b-dense-vs-flash-next-moe-real-agentic-workloads.md b/.beans/holon-agentic-coder-ref-metadata-0142--benchmark-27b-dense-vs-flash-next-moe-real-agentic-workloads.md index a4bff10..f368bb9 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0142--benchmark-27b-dense-vs-flash-next-moe-real-agentic-workloads.md +++ b/.beans/holon-agentic-coder-ref-metadata-0142--benchmark-27b-dense-vs-flash-next-moe-real-agentic-workloads.md @@ -14,7 +14,7 @@ tags: - performance - quality created_at: 2026-10-22T15:10:00Z -updated_at: 2026-10-22T15:10:00Z +updated_at: 2026-11-23T00:00:00+11:00 --- ## Problem @@ -138,3 +138,21 @@ Bean 0132 / 0129 / 0133 (waiting on a usable runner — this picks the model), B must hold constant or vary deliberately), Bean 0140 (the envelope the runs run under), Bean 0137 (runner selection), Bean 0138 / 0139 (the failure modes the quality and wall-time metrics capture), and AGENTS.md checklist item 10 (the zero-synthetic-data rule this whole design exists to satisfy). + +## Audit (2026-11-21) + +Still valid. The "three beans blocked waiting for a usable agent runner" premise is stale: Beans 0129, 0132 and 0133 are +completed. The benchmark itself (27B dense against Flash-Next MoE on real workloads) has not been run. + +## Run attempt (2026-11-23) + +Not a holon-flow bean: the deliverable is a host-run local hardware benchmark plus a maintainer decision, so it was not +forced through `holon flow`. Nothing was run and no benchmark data was produced. + +Blocker (confirmed): neither backend is serving on this host. `GET http://127.0.0.1:8000/v1/models` returns no HTTP +response (only an sshd listener is bound to :8000), and nothing listens on :8004 (27B dense). The benchmark needs both +backends resident, one at a time (`single_model_mode`), so it cannot start until the vMLX gateway (:8000) and the 27B +backend (:8004) are up. + +Next step (operator): start the vMLX gateway and the 27B backend, confirm both answer `/v1/models`, then re-run this +bean. Status stays `todo`; no PR was opened. diff --git a/.beans/holon-agentic-coder-ref-metadata-0146--plans-ledger-correction-rows-and-calibration-metric-source.md b/.beans/holon-agentic-coder-ref-metadata-0146--plans-ledger-correction-rows-and-calibration-metric-source.md index c113e1a..9a863c5 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0146--plans-ledger-correction-rows-and-calibration-metric-source.md +++ b/.beans/holon-agentic-coder-ref-metadata-0146--plans-ledger-correction-rows-and-calibration-metric-source.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0146 title: "Define plans-ledger correction rows and make calibration pick the right predicted metrics" -status: todo +status: completed type: bug priority: medium tags: @@ -10,7 +10,7 @@ tags: - planner - provenance created_at: 2026-10-23T16:10:00Z -updated_at: 2026-10-26T02:33:21Z +updated_at: 2026-11-21T02:21:00+11:00 --- ## Problem @@ -62,3 +62,31 @@ Overall values: | holon-agentic-coder #95 | `cdc6639` | `5a5e766` | 4.22 | 25.60 | 4.39 | | holon-agentic-coder #94 | `7e84078` | `8496227` | 4.75 | 39.84 | 5.07 | | holon-coherence #27 | `aec5f7d` | `ed2cf2f` | 5.84 | 6.48 | 5.18 | + +## Audit (2026-11-21) + +Still valid. `calibration.py` `_parse_predicted_from_plans_ledger` (around line 675) still returns the first matching +`plans.jsonl` row, and no plans-row correction type is documented. Partly done: the "two contradictory terminal summary +rows" nit is handled by [PR #213](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/213), where +`calibration_outcome.py` picks the final row in flow order (created_at, then `ledger_revision`). Remaining scope is +items 1-2 only (correction row definition, and predicted-metric selection). + +## Progress + +- 2026-11-20 14:16 UTC: flow `plans-correction-row-selection` started (claude-agent, claude-opus-5-5). +- 2026-11-20 14:44 UTC: flow done; [PR #221](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/221) + approved 3/3 at iteration 1, calibrated (EV 41.85 -> 53.76), CI green, CLEAN; awaiting human merge. + +## Resolution + +Delivered via [PR #221](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/221) and merged into `main` +(`68ec164`): + +- **Key Architectural Deliverables**: new `calibration_predicted.py` selects the predicted metrics for calibration (plan + Overall table cross-checked against the plans-ledger row and execution `predicted_metrics`, with a warning on + mismatch); `docs/ledger_schema.md` defines the plans-row correction type (`ledger_revision` / `ledger_correction`); + `calibration.py` uses the new selection in place of first-match-wins. +- **Verification & Tests**: `tests/test_calibration_plan_keys.py` covers the selection and correction paths; flow + calibration reported predicted EV 41.85 against actual 53.76. +- **Holon Flow Traversal**: all 5 stages (Intent -> Plan -> Execute -> Review Loop -> Calibration) completed; review + approved 3/3 at iteration 1. diff --git a/.beans/holon-agentic-coder-ref-metadata-0148--redact-before-truncating-ledger-error-context.md b/.beans/holon-agentic-coder-ref-metadata-0148--redact-before-truncating-ledger-error-context.md index eb323d9..242671d 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0148--redact-before-truncating-ledger-error-context.md +++ b/.beans/holon-agentic-coder-ref-metadata-0148--redact-before-truncating-ledger-error-context.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0148 title: "Redact before truncating executor ledger error_context and remaining stderr logs" -status: todo +status: completed type: bug priority: high tags: @@ -9,7 +9,7 @@ tags: - redaction - ledger created_at: 2026-10-24T01:41:18Z -updated_at: 2026-10-24T01:41:18Z +updated_at: 2026-11-20T14:05:06Z --- ## Problem @@ -48,3 +48,32 @@ wire-log redaction behaviour to stay unchanged. ## Notes - PRs #90 and #96 have merged, so this can now run through the Holon flow on holon-agentic-coder. + +## Audit (2026-11-20) + +Still open on `main` (`bea601e`): `entrypoint/executor.py` (about line 1332) still cuts agent stderr to 500 characters +before `redact_text`. The `calibration.py` "Git commit output" log line no longer exists, so that item is done. +Remaining Action: redact first, then truncate, for every executor `error_context` writer; sweep other ledger writers and +log lines; regression tests across the truncation boundary. + +## Progress + +- 2026-11-20: Started holon flow `review-report-ci-log-redaction` (claude-agent, claude-opus-5-5), combined with beans + 0261, 0213, 0234 and 0148. +- 2026-11-20: Flow `review-report-ci-log-redaction` finished all 5 stages: 3/3 consensus approval at review iteration 3, + calibration report in the diff (EV predicted 39.45, actual 59.09, delta +19.64), final-head CI green. PR + [#220](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/220) was merged by the maintainer at 14:03Z. + +## Resolution + +Delivered via [PR #220](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/220) and merged into `main` +(`9a5454bf`), as part of the combined flow `review-report-ci-log-redaction`: + +- **Key Deliverables**: executor `error_context` writers redact with `redact_agent_secrets` before truncation, including + the 500-character agent stderr cut in `entrypoint/executor.py`. The `CredentialRedactor` gaps + (`gho_`/`ghu_`/`ghs_`/`ghr_` tokens, short `ghp_`, short `sk-ant-` keys, URL userinfo, literal + `GITHUB_TOKEN`/`HOLON_AGENT_SETTINGS` values) are routed through the same redactor. Redaction lives in `redaction.py`. +- **Verification & Tests**: `tests/test_redaction.py`, `tests/test_ledger_secret_classes.py` (one class per regression), + `tests/test_executor_error_context.py` (token across the truncation boundary). +- **Holon Flow Traversal**: Intent -> Plan -> Execute -> Review Loop -> Calibration completed (predicted EV 39.45, + actual 59.09). diff --git a/.beans/holon-agentic-coder-ref-metadata-0152--audit-long-files-and-decompose-oversized-functions.md b/.beans/holon-agentic-coder-ref-metadata-0152--audit-long-files-and-decompose-oversized-functions.md index 45f8a7c..c25cae0 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0152--audit-long-files-and-decompose-oversized-functions.md +++ b/.beans/holon-agentic-coder-ref-metadata-0152--audit-long-files-and-decompose-oversized-functions.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0152 title: "Audit long files and decompose oversized functions (flow.py and cli.py first)" -status: todo +status: in-progress type: task priority: high tags: @@ -11,7 +11,7 @@ tags: - holon-agentic-coder - holon-coherence created_at: 2026-10-25T07:35:41Z -updated_at: 2026-11-20T12:00:00+11:00 +updated_at: 2026-11-23T00:00:00Z --- ## Problem @@ -107,3 +107,25 @@ Done: the `flow.py` split (#147, #163), the `cli.py` split into commands (#117), noqa baseline (#115). Remaining: the long functions (`executor.main`, `planner.main`, `setup_token_reduction_proxy`, `run_docker_container`, `extract_sse_token_counts`), the committed audit script and re-audit numbers. The token-reduction duplication is Bean 0200. The "4434/2757 lines" figures are stale: both files are now packages. + +## Audit (2026-11-23) + +All `holon-coherence` decomposition children (`0186`, `0203`–`0208`) and HAC children `0185`, `0188`, `0190` (#219), +`0193` (#228), `0194` (#236), `0195` (#144), `0196` (#234), `0199` (#227), and `0254` (#147) are completed. Remaining +HAC children: `0265` (`cli/__init__.py` 1,732 lines), `0189` (`launcher/`), `0191` (GitHub adapter), `0192` +(`ReviewLoop`, `flow/review/loop.py` 936 lines), `0197` (`calibration/` package, `calibration.py` 1,637 lines), `0198` +(`RunnerSpec` registry), `0200` (remove `token_reduction` copy), plus `entrypoint/planner.py` (649 lines) and the +committed audit script / re-audit numbers. + +## Re-audit (2026-11-23, origin/main) + +Measured by an AST pass over `origin/main` (holon-agentic-coder `baf5c65`, holon-coherence `origin/main`). Scope: `src/` +only. + +- holon-agentic-coder: 205 files, 1,797 functions. 77 over 50 lines, 23 over 100, 5 over 200. Longest: `run_review_loop` + (768, `flow/review/loop.py`), `planner.main` (318), `entrypoint/review_loop.main` (240), `run_docker_container` (235), + `_run_review_stage_body` (226). +- holon-coherence: 52 files, 501 functions. 15 over 50 lines, 1 over 100, 1 over 200 (`render_dashboard_html`, 379). + +Child beans still open: 0189, 0191, 0192, 0197, 0198, 0200, 0265, plus `entrypoint/planner.py` `main`. The committed +audit script is flow intent 0152 (`audit-function-length-script`). diff --git a/.beans/holon-agentic-coder-ref-metadata-0153--remove-comments-and-docstrings-from-all-code.md b/.beans/holon-agentic-coder-ref-metadata-0153--remove-comments-and-docstrings-from-all-code.md index c006333..eb6ffde 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0153--remove-comments-and-docstrings-from-all-code.md +++ b/.beans/holon-agentic-coder-ref-metadata-0153--remove-comments-and-docstrings-from-all-code.md @@ -3,7 +3,7 @@ title: "Remove comments and docstrings from all code (Python, shell, JavaScript, build and CI files); make code self-documenting" -status: todo +status: in-progress type: task priority: normal tags: diff --git a/.beans/holon-agentic-coder-ref-metadata-0155--holon-env-forwarding-puts-credential-shaped-values-on-docker-argv.md b/.beans/holon-agentic-coder-ref-metadata-0155--holon-env-forwarding-puts-credential-shaped-values-on-docker-argv.md index b5d5b0f..0d991af 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0155--holon-env-forwarding-puts-credential-shaped-values-on-docker-argv.md +++ b/.beans/holon-agentic-coder-ref-metadata-0155--holon-env-forwarding-puts-credential-shaped-values-on-docker-argv.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0155 title: "General HOLON_* env forwarding puts credential-shaped non-URL values on the docker argv" -status: todo +status: completed type: bug priority: high tags: @@ -9,7 +9,7 @@ tags: - redaction - holon-agentic-coder created_at: 2026-10-25T12:06:22Z -updated_at: 2026-11-20T12:00:00+11:00 +updated_at: 2026-11-23T03:19:37Z --- ## Problem @@ -44,3 +44,35 @@ Done: `add_env()` (`cli/__init__.py`) sends anything `is_secret_env_item()` flag password) to the 0600 env-file. Remaining: a bare non-URL secret under an arbitrary `HOLON_*` name is not flagged, and the fuzz test still skips the `TIMEOUT`/`BUDGET` names instead of running every forwarded name against argv, probe and echo. + +## Run (2026-11-23) + +- Earlier attempt (intent `holon-env-all-via-env-file`, flow branch `flow-holon-env-all-via-env-file`) stopped at Stage + 2 with no PR; not resumed because main has moved (PRs #235-#240). Its P- branch and worktree are left for cleanup. +- Fresh intent: `todo/intent-0155-holon-env-all-via-env-file-v2.json`, run via `holon flow` on holon-agentic-coder with + claude-agent / claude-opus-5-5 and `--allow-overlap`. +- Fresh flow (`holon-env-all-via-env-file-v2`): PR https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/243. + Plan, execute and calibrate ok; Stage 4 review approved 3/3 (iterations 2 and 3) on the pre-merge head. +- Blocked: main moved (#241 moved the env routing to `launcher/env_files.py` and `launcher/containers.py`). PR #243 is + now CONFLICTING on code in `cli/__init__.py`, `preflight.py` and three tests. The resolve-conflict skill escalates + logic conflicts, so the change needs re-planning on current main; the review gate refuses to post consensus while the + branch conflicts. Not hand-ported (sole change path). +- Cleanup: earlier worktree `flow-holon-env-all-via-env-file` and branch `I-1795388466-holon-env-all-via-env-file/*` are + left over. +- Update: PR #243 head merged with current main by the coordinator's resolver (0411fd01); flow fast-forwarded and + resumed from review. Review approved 3/3 (iteration 5), calibration ok, final head CI success. Ready for maintainer + merge. + +## Resolution + +Delivered via [PR #243](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/243) and merged into `main` +(`2cf1869`): + +- **Key Architectural Deliverables**: every `HOLON_*` variable the host forwards to a role container now travels in a + 0600 `--env-file` (`launcher/env_files.py`), so no forwarded value reaches the docker argv or the `Executing:` echo; + applied to the main run and the pre-flight probe (`launcher/containers.py`, `preflight.py`). +- **Verification & Tests**: fuzz matrix runs every forwarded `HOLON_*` name against argv, probe and echo + (`tests/test_url_message_fuzz.py`, `tests/test_preflight.py`, `tests/test_container_launch_characterisation.py`). +- **Holon Flow Traversal**: Intent -> Plan -> Execute -> Review Loop (approved 3/3, iteration 5) -> Calibration + completed; final head CI green. Superseded earlier attempt (`holon-env-all-via-env-file`) and its worktree/branches + removed. diff --git a/.beans/holon-agentic-coder-ref-metadata-0157--holon-flow-auto-enables-the-mitmproxy-sidecar-whe.md b/.beans/holon-agentic-coder-ref-metadata-0157--holon-flow-auto-enables-the-mitmproxy-sidecar-whe.md index 231b28f..2311c4a 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0157--holon-flow-auto-enables-the-mitmproxy-sidecar-whe.md +++ b/.beans/holon-agentic-coder-ref-metadata-0157--holon-flow-auto-enables-the-mitmproxy-sidecar-whe.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0157 title: "holon flow auto-enables the mitmproxy sidecar when the image exists, and role containers cannot reach it" -status: todo +status: in-progress type: bug priority: high tags: @@ -10,7 +10,7 @@ tags: - proxy - holon-agentic-coder created_at: 2026-10-26T04:23:42Z -updated_at: 2026-10-26T04:23:42Z +updated_at: 2026-11-23T09:00:00+11:00 --- ## Problem @@ -39,3 +39,10 @@ Workaround: `HOLON_TOKEN_REDUCE=0`. ## Notes - Run through the Holon flow on holon-agentic-coder. + +## Audit (2026-11-21) + +Still valid on `origin/main`, with new locations: `FlowContext.__post_init__` in `flow/context.py` (around line 199) +calls `detect_holon_coherence()` from `cli/__init__.py` (around line 545), whose tiers 4 (docker image probe) and 5 (CLI +binary probe) still return true without an explicit opt-in, so `holon flow` can still spawn the sidecar. `cli.py` is now +the `cli/` package. diff --git a/.beans/holon-agentic-coder-ref-metadata-0166--pipeline-duration-dashboard-for-ci-builds.md b/.beans/holon-agentic-coder-ref-metadata-0166--pipeline-duration-dashboard-for-ci-builds.md index 2a32a42..daa8916 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0166--pipeline-duration-dashboard-for-ci-builds.md +++ b/.beans/holon-agentic-coder-ref-metadata-0166--pipeline-duration-dashboard-for-ci-builds.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0166 title: "Pipeline duration dashboard for CI builds" -status: todo +status: completed type: feature priority: high tags: @@ -11,7 +11,7 @@ tags: - holon-agentic-coder - holon-coherence created_at: 2026-10-27T07:57:13Z -updated_at: 2026-10-27T07:57:13Z +updated_at: 2026-11-21T11:46:14+11:00 --- ## Problem @@ -59,3 +59,29 @@ baseline, or a link from a slowdown to the commit that caused it. - Related flakes: Beans 0154 and 0167 (turn-supervisor reader join). Re-runs should be visible on the dashboard. - If it lives in a target repository, build it through the Holon flow, one flow per repository. A harness-side or artifact-hosted dashboard can be built directly. + +## Audit (2026-11-21) + +Still valid. [PR #205](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/205) added the CI Timing Gate +(`scripts/check_ci_runtime_budget.py`, `.github/actions/ci-timing-gate`), which fails a slow job but records no trend or +dashboard, so nothing here is delivered. + +## Progress + +- 2026-11-21: Holon flow `ci-duration-dashboard` started (claude-agent, claude-opus-5-5). +- 2026-11-21: Flow completed. [PR #223](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/223) has 3/3 + consensus approval and calibration in the diff (EV 46.65 predicted, 62.09 actual), is CLEAN and mergeable, and awaits + human merge. + +## Resolution + +Delivered via [PR #223](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/223) and merged into `main` +(`6e93f5e`): + +- **Key Architectural Deliverables**: `scripts/ci_durations.py` with helper modules `ci_durations_api.py`, + `ci_durations_collect.py`, `ci_durations_stats.py`, `ci_durations_html.py` and `ci_durations_svg.py`; + `.github/workflows/ci-durations.yml` runs daily and on `workflow_dispatch`, publishing a self-contained HTML dashboard + and JSON as an artifact plus a job summary. +- **Scope**: covers `holon-agentic-coder` only; `holon-coherence` is not covered. +- **Holon Flow Traversal**: flow `ci-duration-dashboard` (claude-agent, claude-opus-5-5) completed all 5 stages with 3/3 + consensus approval and calibration (predicted EV 46.65, actual 62.09). diff --git a/.beans/holon-agentic-coder-ref-metadata-0172--stage-budgets-accept-an-explicit-unlimited-value.md b/.beans/holon-agentic-coder-ref-metadata-0172--stage-budgets-accept-an-explicit-unlimited-value.md index b3f4559..1cc51cc 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0172--stage-budgets-accept-an-explicit-unlimited-value.md +++ b/.beans/holon-agentic-coder-ref-metadata-0172--stage-budgets-accept-an-explicit-unlimited-value.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0172 title: "Stage and turn budgets accept an explicit 'unlimited' value, distinct from unset (default)" -status: todo +status: completed type: feature priority: normal tags: @@ -9,7 +9,7 @@ tags: - holon-flow - holon-agentic-coder created_at: 2026-10-27T14:04:58Z -updated_at: 2026-10-27T14:04:58Z +updated_at: 2026-11-21T08:55:00Z --- ## Problem @@ -66,3 +66,32 @@ The turn budgets are inconsistent with this: `HOLON_TURN_STALL_SECONDS=0` alread - Run through the Holon flow on holon-agentic-coder. It touches `budgets.py`, `turns.py`/`flow.py` budget plumbing and the doctor output, so check for overlap with open flows. - Related: Bean 0171 (salvage on a budget breach drops the code changes), Bean 0139 (the original budgets work). + +## Audit (2026-11-21) + +Still valid. `budgets.py` `_read_positive` (around lines 106-152) still rejects `inf`, zero and values above +`MAX_BUDGET_SECONDS` (7 days) with the default; no `unlimited` sentinel exists. + +## Progress + +- 2026-11-21: started via `holon flow` (claude-agent, claude-opus-5-5) in worktree `flow-unlimited-stage-budgets`. +- 2026-11-21: flow complete; PR #225 approved 3/3 at review iteration 2, calibrated (EV 41.0 predicted, 59.32 actual), + CI green, CLEAN/MERGEABLE; awaiting human merge. + +## Resolution + +- **Delivered via PR #225:** Merged into `main` (`4811599793a0604d175e5b1561178f55e5e29537`) on 2026-11-21T08:54:15Z. +- **Key Deliverables:** + - Explicit `unlimited` sentinel support across stage (`HOLON_STAGE_BUDGET_*`) and turn timeout + (`HOLON_TURN_TIMEOUT_SECONDS`) variables. + - Internal `None` representation with clean container environment propagation and round-tripping. + - `holon doctor` and flow summary reporting showing `unlimited` instead of magic numbers. + - Full test suite additions (`test_pipeline_unlimited.py`, `test_cli_unlimited_budgets.py`, etc.) and updated + documentation (`docs/budgets.md`). +- **Flow & Quality Metrics:** + - Traversed all 5 Holon flow stages + (`I-1795184210-unlimited-stage-budgets/P-1795184233-CLA-CO5.5/E-1795246867-CLA-CO5.5/_`). + - Achieved 3/3 reviewer consensus approval at iteration 2. + - All 11/11 CI checks passing. + - Calibration report (`plans/I-1795184210-unlimited-stage-budgets/P-1795184233-CLA-CO5.5_calibration.md`): EV 41.0 + predicted vs. 59.32 actual. diff --git a/.beans/holon-agentic-coder-ref-metadata-0173--holon-loads-a-layered-env-file-that-every-sandbox.md b/.beans/holon-agentic-coder-ref-metadata-0173--holon-loads-a-layered-env-file-that-every-sandbox.md index f435764..041d495 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0173--holon-loads-a-layered-env-file-that-every-sandbox.md +++ b/.beans/holon-agentic-coder-ref-metadata-0173--holon-loads-a-layered-env-file-that-every-sandbox.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0173 title: "holon loads layered .env files (specific overrides broad) that every sandbox stage inherits" -status: todo +status: in-progress type: feature priority: high tags: @@ -10,7 +10,7 @@ tags: - security - holon-agentic-coder created_at: 2026-10-27T14:07:56Z -updated_at: 2026-10-27T14:10:09Z +updated_at: 2026-11-22T23:01:00Z --- ## Problem diff --git a/.beans/holon-agentic-coder-ref-metadata-0174--document-every-environment-variable-holon-reads.md b/.beans/holon-agentic-coder-ref-metadata-0174--document-every-environment-variable-holon-reads.md index b1a14d7..d1c323c 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0174--document-every-environment-variable-holon-reads.md +++ b/.beans/holon-agentic-coder-ref-metadata-0174--document-every-environment-variable-holon-reads.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0174 title: "Document every environment variable holon reads, in one generated and CI-checked reference" -status: todo +status: in-progress type: task priority: high tags: @@ -9,7 +9,7 @@ tags: - configuration - holon-agentic-coder created_at: 2026-10-27T14:08:31Z -updated_at: 2026-10-27T14:08:31Z +updated_at: 2026-11-22T23:05:00Z --- ## Problem diff --git a/.beans/holon-agentic-coder-ref-metadata-0175--pre-flight-github-token-scopes-before-stage-3-w.md b/.beans/holon-agentic-coder-ref-metadata-0175--pre-flight-github-token-scopes-before-stage-3-w.md index f347f5f..1766a4e 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0175--pre-flight-github-token-scopes-before-stage-3-w.md +++ b/.beans/holon-agentic-coder-ref-metadata-0175--pre-flight-github-token-scopes-before-stage-3-w.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0175 title: "Check GitHub token scopes before Stage 3 when the plan touches workflow files" -status: todo +status: in-progress type: bug priority: high tags: @@ -10,7 +10,7 @@ tags: - preflight - holon-agentic-coder created_at: 2026-10-27T14:59:39Z -updated_at: 2026-10-27T14:59:39Z +updated_at: 2026-11-23T15:20:00+11:00 --- ## Problem @@ -46,3 +46,34 @@ exited, and the failure path saves nothing (Bean 0171). - Run through the Holon flow on holon-agentic-coder. It overlaps Bean 0171 (the executor failure path) and `preflight.py` and `cli.py`. - The immediate fix for Bean 0168 is a maintainer action: `gh auth refresh -h github.com -s workflow`. + +## Audit (2026-11-21) + +Still valid; no scope check exists. The `gh auth token` handoff now lives under `cli/__init__.py` (the `cli.py` +references above are stale), and the flow-level touch set (`touch_set.py`, +[PR #194](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/194)) now gives the pre-flight a plan file +list to inspect for `.github/workflows/**`. + +## Flow run (2026-11-23) + +- Intent: `todo/intent-0175-preflight-github-token-scopes-v2.json` (fresh from current main; the earlier attempt + `I-1795388456-preflight-github-token-scopes` never opened a PR and is stale, its `flow-preflight-github-token-scopes` + worktree and branches are for cleanup). +- PR: https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/244 +- Stage 3 first attempt exited with SIGKILL (exit -9) after 2.5 min, probably the Docker VM's 8 GB limit under + concurrent flows (not confirmed); resumed from the execute checkpoint. Stage 4 halted on a DIRTY PR (ledger-only + conflict), merged origin/main and resumed from review. + +## Manual review and calibration (2026-11-23) + +- The flow driver had stopped. On head 575655bb the Workspace survival job failed in 2/2480 cases of + `test_invalid_envelope_value_never_echoed_by_doctor_or_run_path` (a re-run passed). This was a false positive in the + test, not a leak: `run_docker_container` argv holds the random `$HOME/.holon/tmp/holon-pi-agent-<8>` mkdtemp folder, + and the test masked only the `--env-file` path. A random suffix could share a 4-letter run with the random credential + (it fails about 1-2% of runs; reproduced deterministically). Fixed in f6feb1fc by masking exactly the fixture-owned + paths (the check is no looser), with deterministic collision tests; review Nits (surviving mutants) applied in + 7420e5af, and the calibration-base Nit was rejected. +- Coordinator merged origin/main (#246) as f65e82bf. Iteration 13: dry run clean, CI 11/11 green, ensemble 3/3 APPROVED + 0/0/0 at 7420e5af; consensus posted as a comment (approve returns 422 on own PR). +- Stage 5 `holon calibrate`: report evaluated 7420e5af, committed 705ca34f on the PR branch (calibrated branch + fast-forwarded to it). Calibrator still measures the touch set from the pre-merge base 64e0f0f1 (recall 0.15). diff --git a/.beans/holon-agentic-coder-ref-metadata-0176--remove-every-unittest-reference-pytest-only.md b/.beans/holon-agentic-coder-ref-metadata-0176--remove-every-unittest-reference-pytest-only.md index 05a3c22..c21fd7c 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0176--remove-every-unittest-reference-pytest-only.md +++ b/.beans/holon-agentic-coder-ref-metadata-0176--remove-every-unittest-reference-pytest-only.md @@ -1,17 +1,15 @@ --- # holon-agentic-coder-ref-metadata-0176 title: "Remove every unittest reference from holon-agentic-coder; the suite is pytest only" -status: todo +status: in-progress type: task priority: high tags: - tests - pytest - holon-agentic-coder -blocked_by: - - holon-agentic-coder-ref-metadata-0168 created_at: 2026-10-28T09:38:48Z -updated_at: 2026-10-29T23:34:36Z +updated_at: 2026-11-22T22:55:00Z --- ## Problem @@ -48,3 +46,14 @@ flow can start. - Historical flow records (`holon-knowledge/ledger/*.jsonl`, `plans/P-*.md`, `executions/E-*.md`) are audited and append-only; they keep their existing text. The check in step 4 must exclude them. - PR #99 itself only rewords the one `hermetic_testing.md` sentence it already touches. + +## Audit (2026-11-21) + +Blocker Bean 0168 completed (PR #99 merged), so this is unblocked. Re-measured on `origin/main`: 119 tracked files +mention `unittest` (almost all under `apps/sandbox-executor/tests/`, plus `docs/hermetic_testing.md`, +`tests/hermetic_fixtures.py`). It touches nearly every test file, so run it alone with no other flow in flight. + +## Audit (2026-11-23) + +Re-measured on `main` (`b22258d`): **144** tracked files mention `unittest` (up from 119 on 2026-11-21). Must run alone +after PR #230 merges. diff --git a/.beans/holon-agentic-coder-ref-metadata-0181--use-the-branch-leaf-only-when-referencing-a-git-branch.md b/.beans/holon-agentic-coder-ref-metadata-0181--use-the-branch-leaf-only-when-referencing-a-git-branch.md index 529dbf7..0f66f56 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0181--use-the-branch-leaf-only-when-referencing-a-git-branch.md +++ b/.beans/holon-agentic-coder-ref-metadata-0181--use-the-branch-leaf-only-when-referencing-a-git-branch.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0181 title: "Use the /_ leaf only when referencing a git branch, never on intent, plan or execution ids" -status: todo +status: in-progress type: bug priority: normal tags: @@ -11,7 +11,7 @@ tags: - documentation - holon-agentic-coder created_at: 2026-10-29T01:01:35Z -updated_at: 2026-10-29T01:01:35Z +updated_at: 2026-11-23T00:00:00Z --- ## Principle (maintainer, 2026-10-29) @@ -72,3 +72,17 @@ Through the Holon flow on `holon-agentic-coder` (code change), after Bean 0161 / - Raised while reviewing PR #103 (Bean 0180, documentation only). PR #103 may adopt the documented rule early; the code and ledger changes are this bean's. - Related: Bean 0161 (sub-intent implementation), Bean 0180 (nested sub-intent docs). + +## Audit (2026-11-21) + +Still valid. `/_` is still stripped and re-added ad hoc (`calibration.py` around lines 607 and 1161, +`cli/commands/execute.py`, `cli/commands/intent.py`, `entrypoint/executor.py` around lines 1049-1135, +`entrypoint/planner.py`, `entrypoint/taken_ids.py`, `entrypoint/execution_workspace.py`). Any `flow.py` reference above +now means the `flow/` package. + +## Audit (2026-11-23) + +`entrypoint/executor.py` became the `entrypoint/executor/` package in PR #234 (`0196`); `/_` stripping/re-adding now +lives in `entrypoint/executor/run.py` (lines 94 and 242) alongside `calibration.py`, `cli/commands/`, +`entrypoint/planner.py`, `entrypoint/taken_ids.py`, and `entrypoint/execution_workspace.py`. Overlaps PR #230 on +`docs/git_flow.md` and `docs/ledger_schema.md`. diff --git a/.beans/holon-agentic-coder-ref-metadata-0189--move-container-launch-out-of-cli-and-break-the-flow-cli-cycle.md b/.beans/holon-agentic-coder-ref-metadata-0189--move-container-launch-out-of-cli-and-break-the-flow-cli-cycle.md index 9e24066..a610c3b 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0189--move-container-launch-out-of-cli-and-break-the-flow-cli-cycle.md +++ b/.beans/holon-agentic-coder-ref-metadata-0189--move-container-launch-out-of-cli-and-break-the-flow-cli-cycle.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0189 title: "Move container launch and role dispatch out of the CLI into a launcher module; break the flow-cli import cycle" -status: todo +status: completed type: task priority: high tags: @@ -10,10 +10,8 @@ tags: - sandbox - holon-agentic-coder blocked_by: - - holon-agentic-coder-ref-metadata-0187 - - holon-agentic-coder-ref-metadata-0188 created_at: 2026-10-29T12:20:00Z -updated_at: 2026-10-29T12:20:00Z +updated_at: 2026-11-23T02:48:56Z --- ## Problem @@ -45,3 +43,35 @@ Sequence with 0155 and 0157, which change the same functions. ## Notes - Run through the Holon flow on holon-agentic-coder. + +## Audit (2026-11-23) + +Blockers `0187` (scrapped, replaced by `0254`/PR #147) and `0188` (PR #117) are closed; `0190` merged (PR #219). Still +valid on `main` (`b22258d`): `cli/__init__.py` is 1,732 lines and four lazy `flow` -> `cli` imports remain +(`flow/context.py:199`, `flow/dispatch.py:34`, `flow/pipeline.py:422`, `flow/review/loop.py:197`). Sequence after `0265` +(`cli/__init__.py` split) and open PR #230 (which touches `flow/context.py`, `flow/pipeline.py`, `flow/review/loop.py`). + +## Flow run (2026-11-23) + +Intent `todo/intent-0189-launcher-breaks-flow-cli-cycle.json`, flow branch +`I-1795388455-launcher-breaks-flow-cli-cycle`. Plan, execute, review (consensus at iteration 5) and calibrate completed; +PR: https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/241 (open, awaiting human merge). Resumed twice from +checkpoint; ledger rows reconciled with origin/main at the merge. + +## Resolution + +Delivered via [PR #241](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/241) and merged into `main` +(`0f0089d`): + +- **Key Architectural Deliverables**: new `launcher/` package (`role_dispatch`, `containers`, `sidecar`, `sidecar_plan`, + `coherence`, `mounts`, `env_files`, `container_env`, `proxy_paths`, `proxy_attach`, `messages`, `pi_mounts`, + `antigravity_mounts`) now owns container launch, role dispatch and proxy/sidecar plumbing; `cli/__init__.py` shrinks + accordingly and `flow/` imports `launcher` instead of `cli`, so the four lazy `flow` -> `cli` imports are gone. +- **Verification & Tests**: AST import-cycle test (`tests/test_import_cycle.py`) fails on any `sandbox_executor.flow` -> + `sandbox_executor.cli` edge; launch characterisation tests (`tests/test_container_launch_characterisation.py`) and a + fake Docker harness (`tests/fake_docker.py`) pin the moved behaviour; existing credential redaction and URL fuzz tests + stay green. +- **Holon Flow Traversal**: all 5 stages (Intent -> Plan -> Execute -> Review Loop -> Calibration) completed; review + reached consensus at iteration 5. +- **Post-merge**: `main` fast-forwarded to the merge commit; `install-holon` rebuilt all images and reinstalled `holon` + and `holon-coherence`; flow worktree and remote flow branches removed. diff --git a/.beans/holon-agentic-coder-ref-metadata-0190--checkpoint-and-ledger-reconciliation-own-their-behaviour.md b/.beans/holon-agentic-coder-ref-metadata-0190--checkpoint-and-ledger-reconciliation-own-their-behaviour.md index 80cad27..dc0b87b 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0190--checkpoint-and-ledger-reconciliation-own-their-behaviour.md +++ b/.beans/holon-agentic-coder-ref-metadata-0190--checkpoint-and-ledger-reconciliation-own-their-behaviour.md @@ -2,7 +2,7 @@ # holon-agentic-coder-ref-metadata-0190 title: "FlowCheckpoint and ledger reconciliation own their behaviour; container entrypoints stop importing the flow engine" -status: todo +status: completed type: task priority: high tags: @@ -12,7 +12,7 @@ tags: - holon-agentic-coder blocked_by: created_at: 2026-10-29T12:20:00Z -updated_at: 2026-11-20T12:00:00+11:00 +updated_at: 2026-11-21T18:40:07+11:00 --- ## Problem @@ -58,3 +58,19 @@ precede 0183 (checkpoint storage) and 0196, 0199. Blocker Bean 0187 was scrapped; the `flow/` package split it covered landed through PR #147/#163, so this bean is not blocked by it. Still open: no `CheckpointStore`/`LedgerReconciler`, and the entrypoints still import `sandbox_executor.flow`. + +## Resolution + +Delivered via [PR #219](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/219) and merged into `main` +(`df3b0d1`): + +- **Key Architectural Deliverables**: `FlowCheckpoint` owns save, load, migrate and its path policy behind a + `CheckpointStore` port; ledger reconciliation moves into the `ledger/` package as `LedgerReconciler`; container + entrypoints stop importing the host flow engine for these. +- **Verification & Tests**: consensus 3/3 APPROVED in iterations 13-19. The loop never auto-posted consensus because of + the stale local test gate (Bean 0354); the approval was posted by hand as a PR comment. +- **Holon Flow Traversal**: Stages 1-4 ran. Plan and execution ran on `antigravity-agent` / `gemini-3.8-flash`. The + review was resumed on `claude-agent` / `claude-opus-5-5` at the maintainer's request after an antigravity resolver + defect. Stage 5 was run by hand with `holon calibrate` (report only): predicted EV 66.11, reported actual -9.11. That + actual is misleading because it reflects the stalled review. +- **Not run**: the Stage 5 reconciliation and knowledge promotion did not run. They are a follow-up under Bean 0355. diff --git a/.beans/holon-agentic-coder-ref-metadata-0191--github-adapter-for-pr-ci-and-review-posting.md b/.beans/holon-agentic-coder-ref-metadata-0191--github-adapter-for-pr-ci-and-review-posting.md index f122b44..627e63e 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0191--github-adapter-for-pr-ci-and-review-posting.md +++ b/.beans/holon-agentic-coder-ref-metadata-0191--github-adapter-for-pr-ci-and-review-posting.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0191 title: "One GitHub adapter owns every gh call (PR create/update, CI probe, mergeability, review posting)" -status: todo +status: in-progress type: task priority: high tags: @@ -11,7 +11,7 @@ tags: - holon-agentic-coder blocked_by: created_at: 2026-10-29T12:20:00Z -updated_at: 2026-11-20T12:00:00+11:00 +updated_at: 2026-11-23T12:50:00+11:00 --- ## Problem @@ -50,3 +50,23 @@ Blocked by 0187. Blocks 0192. Sequence with 0160 (CI polling) and 0179. Blocker Bean 0187 was scrapped (the `flow/` split landed via #147/#163); the `flow.py` references above are stale. The `gh` calls now sit under `flow/github/` plus `review_target.py`, `calibration.py` and `flow/review/loop.py`; there is still no single adapter. + +## Audit (2026-11-21) + +Touch set refreshed against `origin/main`: the `gh` calls live in +`flow/github/{pr,ci,ci_wait,ci_final_head,ci_reverify,merge,merge_method,review_post}.py`, `flow/in_flight.py` +(`gh pr list`/`pr diff`), `review_target.py` and `calibration.py`; call sites in `flow/review/loop.py` and +`flow/stages/review.py`. Tests mirror under `tests/flow/github/` and `tests/flow/review/`. `flow/github/pr.py` is 515 +lines, so the module budget (Beans 0264, 0340) applies to any new adapter module. + +## Flow progress (2026-11-23) + +- Intent `todo/intent-0191-github-adapter-pr-ci-review.json` ran through Stage 2 (plan, resumed after a Stage 2 + ambiguous-P-branch stop; the stale empty P- branch from the earlier attempt was bypassed by checkpoint edit to execute + on the newest pushed P- branch). +- Planner decomposed the bean into 3 sub-intents. Child 1 (`extract-the-pure-ci-verdict`) executed and opened PR #242 + (https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/242). Children 2 and 3 have not run. +- Blocked at Stage 4 (review) on child 1: the review container raised `ConflictResolutionError` because the execution + branch conflicts with `origin/main` in `flow/__init__.py` (plus ledger rows) after main moved (#235-#240). Stage 4 + does not resolve code conflicts; a hand-merge would bypass the flow, so the run is halted pending a maintainer + decision. diff --git a/.beans/holon-agentic-coder-ref-metadata-0192--review-loop-becomes-a-reviewloop-object.md b/.beans/holon-agentic-coder-ref-metadata-0192--review-loop-becomes-a-reviewloop-object.md index 0029055..faaebed 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0192--review-loop-becomes-a-reviewloop-object.md +++ b/.beans/holon-agentic-coder-ref-metadata-0192--review-loop-becomes-a-reviewloop-object.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0192 title: "Decompose run_review_loop and run_review_stage into a ReviewLoop object with named steps" -status: todo +status: in-progress type: task priority: high tags: @@ -12,7 +12,7 @@ tags: blocked_by: - holon-agentic-coder-ref-metadata-0191 created_at: 2026-10-29T12:20:00Z -updated_at: 2026-10-29T12:20:00Z +updated_at: 2026-11-21T01:20:00+11:00 --- ## Problem @@ -43,3 +43,25 @@ Blocked by 0191. Sequence with 0160 and 0179, which change the same loop. ## Notes - Run through the Holon flow on holon-agentic-coder. + +## Audit (2026-11-21) + +Touch set refreshed: the loop is `flow/review/loop.py` (952 lines, module budget applies), +`flow/review/{cli,ensemble,resolver,records,verdict}.py` and `flow/stages/review.py`; tests are +`tests/flow/review/test_loop.py` and `tests/flow/stages/test_review.py`. The `flow/review_loop.py` path above does not +exist. Still blocked by 0191 (shared call sites). + +## Run log (2026-11-23) + +- Intent `todo/intent-0192-review-loop-object.json` (slug `review-loop-object`), intent branch + `I-1795388459-review-loop-object/_`, pushed. No PR opened. +- Plan stage ok: `P-1795395413-CLA-CO5.5/_`. +- Execute stage blocked (two attempts: E-1795395756 exists on origin at c6cf760 as an unmerged execution branch, + E-1795397253 is local only). Confirmed cause: the executor's pre-push sync merges `origin/main` (which has moved past + the intent base `b22258dc`, including #239 and #240) and hits a non-ledger conflict in + `apps/sandbox-executor/src/sandbox_executor/flow/__init__.py`. The reconcile step raises `ConflictResolutionError` and + refuses to push. A checkpoint resume cannot change this base; the fix needs a fresh intent cut from current `main` (or + a maintainer decision), not a hand patch. +- Checkpoint: `apps/holon-agentic-coder/flow-review-loop-object/.holon/flow/checkpoint-review-loop-object.json` at stage + execute. Earlier checkpoint backed up under the scratchpad. +- Status stays `in-progress`; blocked_by 0191 is also still in progress and shares call sites. diff --git a/.beans/holon-agentic-coder-ref-metadata-0193--decompose-intent-and-plan-stage-functions.md b/.beans/holon-agentic-coder-ref-metadata-0193--decompose-intent-and-plan-stage-functions.md index 5dd3a73..c294273 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0193--decompose-intent-and-plan-stage-functions.md +++ b/.beans/holon-agentic-coder-ref-metadata-0193--decompose-intent-and-plan-stage-functions.md @@ -3,17 +3,15 @@ title: "Decompose the intent and plan stage modules (validate_intent_questions, run_plan_stage, decomposition, stage conflicts)" -status: todo +status: completed type: task priority: normal tags: - refactor - complexity - holon-agentic-coder -blocked_by: - - holon-agentic-coder-ref-metadata-0187 created_at: 2026-10-29T12:20:00Z -updated_at: 2026-10-29T12:20:00Z +updated_at: 2026-11-21T12:52:05Z --- ## Problem @@ -43,3 +41,32 @@ Blocked by 0187; if 0190 moves `stage_conflicts`, run after 0190. Parallel-safe ## Notes - Run through the Holon flow on holon-agentic-coder. + +## Audit (2026-11-21) + +Blocker Bean 0187 was scrapped (the `flow/` split landed), so it is unblocked. Files now: `flow/intent_questions.py`, +`flow/stage_conflicts.py`, `flow/stages/{intent,plan,decomposition,plan_decision,sync_conflict}.py`. Open PR #219 +(Bean 0190) rewrites `flow/intent_questions.py` and `flow/stage_conflicts.py`, so start only after it merges. + +## Progress + +- 2026-11-21: Holon flow `intent-plan-stage-decomposition` started (claude-agent, claude-opus-5-5). +- 2026-11-21: Flow finished. PR #228 is calibrated (EV predicted 33.19, actual -21.46), CI is green and the PR is + MERGEABLE/CLEAN. There is NO consensus approval: Stage 4 was skipped because `skip_review` was set in the checkpoint. +- 2026-11-21: Resumed from Stage 4 with `skip_review` cleared. The review reached 3/3 APPROVED consensus at iteration 4 + and was recalibrated (EV predicted 33.19, actual 58.66). PR #228 is MERGEABLE/CLEAN with CI green and is awaiting the + human merge. + +## Resolution + +Delivered via [PR #228](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/228) and merged into `main` +(`5fbd2d06`): + +- **Key Architectural Deliverables**: intent and plan stage code split into + `flow/stages/{intent,plan,decomposition,plan_decision,plan_support,stage_support,decomposition_summary}.py` and + `flow/stage_conflict_resolution.py`; `validate_intent_questions` rewritten as a table of named checks; touched + functions within the 0185 limits; behaviour and messages unchanged. +- **Final calibration**: Predicted EV 33.19 | Actual EV 58.66 (ΔEV +25.47). +- **Process note**: an earlier antigravity run saved `skip_review` into the checkpoint, so a resume skipped Stage 4 and + the PR had no consensus approval. The review was rerun on claude-opus-5-5 (3/3 APPROVED at iteration 4) and + recalibrated. The fix for resumes inheriting `skip_review` and the agent is bean 0356. diff --git a/.beans/holon-agentic-coder-ref-metadata-0194--decompose-the-execute-stage.md b/.beans/holon-agentic-coder-ref-metadata-0194--decompose-the-execute-stage.md index e8a7e24..c513172 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0194--decompose-the-execute-stage.md +++ b/.beans/holon-agentic-coder-ref-metadata-0194--decompose-the-execute-stage.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0194 title: "Decompose run_execute_stage into an ExecuteStage with named steps" -status: todo +status: completed type: task priority: normal tags: @@ -10,7 +10,7 @@ tags: - holon-agentic-coder blocked_by: created_at: 2026-10-29T12:20:00Z -updated_at: 2026-11-20T12:00:00+11:00 +updated_at: 2026-11-22T19:40:00+11:00 --- ## Problem @@ -44,3 +44,24 @@ empty-diff guard) and 0183. Blocker Bean 0187 was scrapped (the `flow/` split landed via #147/#163). `run_execute_stage` now lives in `flow/stages/execute.py` and is still one function under noqa; there is no `ExecuteStage`. + +## Audit (2026-11-21) + +Touch set refreshed: `flow/stages/execute.py` (still one `run_execute_stage` under noqa), `flow/partial_salvage.py`, +`flow/execution_publish.py`, `tests/flow/stages/test_execute.py`, `test_execute_touch_set.py`, +`test_execute_budget_guard.py`. Open PR #219 edits `flow/stages/execute.py`, so start after it merges. + +## Progress + +- 2026-11-21: Holon flow `execute-stage-object` started (claude-agent, claude-opus-5-5). +- 2026-11-22 06:05: Stage 3 completed (E-1795327309, 6 paths, 5466 tests passing); Stage 4 review loop started. +- 2026-11-22 06:10: Review iteration 1 resolved (head f3771f0); iteration 2 running. +- 2026-11-22 06:19: Review consensus APPROVED 3/3 at iteration 2; Stage 5 calibration included in PR #236 (predicted EV + 52.85, actual 67.22). All CI checks SUCCESS; PR MERGEABLE/CLEAN, awaiting human merge. + +## Resolution + +Delivered via [PR #236](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/236) and merged into `main` +(`b22258d`). `run_execute_stage` is now an `ExecuteStage` in `flow/stages/execute.py` with named steps (resume point, +executor dispatch, empty-diff guard, partial salvage, execution record); `run_execute_stage` remains a thin wrapper. +Empty-diff guard, partial salvage and resume behaviour are unchanged. Calibration EV: predicted 52.85, actual 67.22. diff --git a/.beans/holon-agentic-coder-ref-metadata-0196--decompose-executor-main-into-an-executionrun.md b/.beans/holon-agentic-coder-ref-metadata-0196--decompose-executor-main-into-an-executionrun.md index c1ecc89..b69c285 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0196--decompose-executor-main-into-an-executionrun.md +++ b/.beans/holon-agentic-coder-ref-metadata-0196--decompose-executor-main-into-an-executionrun.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0196 title: "Decompose entrypoint executor main into an ExecutionRun with named steps; split the module into a package" -status: todo +status: completed type: task priority: high tags: @@ -9,10 +9,9 @@ tags: - complexity - holon-agentic-coder blocked_by: - - holon-agentic-coder-ref-metadata-0195 - holon-agentic-coder-ref-metadata-0190 created_at: 2026-10-29T12:20:00Z -updated_at: 2026-10-29T12:20:00Z +updated_at: 2026-11-22T09:48:30+11:00 --- ## Problem @@ -42,3 +41,26 @@ Blocked by 0195 (git adapter) and 0190 (entrypoint stops importing the engine). ## Notes - Run through the Holon flow on holon-agentic-coder, alone on `executor.py`. + +## Audit (2026-11-21) + +Blocker Bean 0195 is completed; only Bean 0190 (open PR #219, which also edits `entrypoint/executor.py`) still blocks. +The module is still the single `entrypoint/executor.py` (CC under noqa), with several helpers already extracted +(`executor_test_run.py`, `execution_workspace.py`, `partial_resume.py`, `sync_conflict.py`, `taken_ids.py`, +`test_measurement.py`). + +## Progress + +- 2026-11-21: Holon flow `executor-execution-run` started (claude-agent, claude-opus-5-5). +- 2026-11-21: Flow completed. PR #234 approved 3/3, calibrated (EV predicted 7.55, actual 47.72), CI green, CLEAN and + MERGEABLE; awaiting human merge. + +## Resolution + +Delivered via [PR #234](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/234) and merged into `main` +(`2ec094e`). Child PRs #231, #232 and #233 landed first. + +- `entrypoint/executor.py` (798-line `main`, CC 178) is now the `entrypoint/executor/` package. `ExecutionRun` in + `run.py` runs the named steps, and `main` parses arguments and calls `ExecutionRun(...).run()`. +- Full 5-stage Holon flow (`executor-execution-run`), calibrated. Expected value: predicted 7.55, actual 47.72 (delta + +40.17). diff --git a/.beans/holon-agentic-coder-ref-metadata-0197--split-calibration-into-a-package-and-decompose-metrics-parsing.md b/.beans/holon-agentic-coder-ref-metadata-0197--split-calibration-into-a-package-and-decompose-metrics-parsing.md index 80eb1de..0cb505f 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0197--split-calibration-into-a-package-and-decompose-metrics-parsing.md +++ b/.beans/holon-agentic-coder-ref-metadata-0197--split-calibration-into-a-package-and-decompose-metrics-parsing.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0197 title: "Split calibration.py into a calibration package and decompose metrics parsing and report generation" -status: todo +status: in-progress type: task priority: normal tags: @@ -11,7 +11,7 @@ tags: - holon-agentic-coder blocked_by: created_at: 2026-10-29T12:20:00Z -updated_at: 2026-11-20T12:00:00+11:00 +updated_at: 2026-11-23T00:00:00Z --- ## Problem @@ -46,3 +46,17 @@ Blocked by 0187. Sequence **after 0146** (picks the predicted metrics in the sam ## Audit (2026-11-20) Calibration is still one `calibration.py` module (1642 lines); the Bean 0187 blocker is scrapped and no longer applies. + +## Audit (2026-11-21) + +Partly done: helpers were extracted into `calibration_diff.py`, `calibration_ev.py`, `calibration_execution_owner.py`, +`calibration_outcome.py` and `calibration_touch_set.py` +([PR #213](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/213) and earlier), but `calibration.py` is +still one large module with `parse_actual_metrics` under noqa. Remaining scope: the package split and decomposing the +metrics parsers. Do not run concurrently with Bean 0146 (same parser). + +## Audit (2026-11-23) + +Bean `0146` merged in PR #221 (extracting `calibration_predicted.py`). `calibration.py` is 1,637 lines with +`parse_actual_metrics` still under noqa. Unblocked and disjoint from PR #230 (which edits `calibration_outcome.py`, not +`calibration.py` or `flow/stages/calibrate.py`); sequence with `0355` on `flow/stages/calibrate.py`. diff --git a/.beans/holon-agentic-coder-ref-metadata-0198--agent-runner-registry-one-spec-module-per-agent.md b/.beans/holon-agentic-coder-ref-metadata-0198--agent-runner-registry-one-spec-module-per-agent.md index 617c4f9..31c91d6 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0198--agent-runner-registry-one-spec-module-per-agent.md +++ b/.beans/holon-agentic-coder-ref-metadata-0198--agent-runner-registry-one-spec-module-per-agent.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0198 title: "Agent runner registry: one RunnerSpec module per agent instead of shared dicts and an if-chain" -status: todo +status: in-progress type: task priority: normal tags: @@ -9,10 +9,8 @@ tags: - open-closed - agent-runner - holon-agentic-coder -blocked_by: - - holon-agentic-coder-ref-metadata-0185 created_at: 2026-10-29T12:20:00Z -updated_at: 2026-10-29T12:20:00Z +updated_at: 2026-11-22T22:55:00Z --- ## Problem @@ -43,3 +41,15 @@ Blocked by 0185. Parallel-safe with 0187, 0188, 0195. ## Notes - Run through the Holon flow on holon-agentic-coder. + +## Audit (2026-11-21) + +Blocker Bean 0185 is completed, so this is unblocked. `agent_defaults.py` now also holds `AGENT_TICKERS` +(claude/antigravity/pi), which the `RunnerSpec` must carry. It edits the same files as Bean 0322 (gemini removal, in +another session), so start after 0322 lands. + +## Audit (2026-11-23) + +Bean `0322` merged in PR #222 (`e2ba3c2`), removing `gemini-agent` completely; drop `gemini` from scope (`antigravity`, +`claude`, `pi`, `codex`, `opencode`). Unblocked and disjoint from PR #230; sequence with `0270` and `0350` on +`agent_defaults.py` / `agent_runner.py`. diff --git a/.beans/holon-agentic-coder-ref-metadata-0199--decompose-ledger-query-and-knowledge-index.md b/.beans/holon-agentic-coder-ref-metadata-0199--decompose-ledger-query-and-knowledge-index.md index b8a4725..6fb2ded 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0199--decompose-ledger-query-and-knowledge-index.md +++ b/.beans/holon-agentic-coder-ref-metadata-0199--decompose-ledger-query-and-knowledge-index.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0199 title: "Decompose ledger query and the knowledge index (query_ledger, sync_ledger_incremental, action promotion)" -status: todo +status: completed type: task priority: low tags: @@ -12,7 +12,7 @@ tags: blocked_by: - holon-agentic-coder-ref-metadata-0190 created_at: 2026-10-29T12:20:00Z -updated_at: 2026-10-29T12:20:00Z +updated_at: 2026-11-21T09:19:00Z --- ## Problem @@ -41,3 +41,26 @@ Blocked by 0190. Sequence with 0150 (knowledge index tests). ## Notes - Run through the Holon flow on holon-agentic-coder. + +## Audit (2026-11-21) + +Still blocked by Bean 0190. Open PR #219 turns `ledger.py` into a `ledger/` package (`lock`, `query`, `reconcile`, +`rows`), so `ledger/query.py` is the target once it merges; `knowledge/{index,promotion,consult}.py` are unchanged. + +## Progress + +- 2026-11-21: Holon flow `ledger-query-knowledge-index` started (claude-agent, claude-opus-5-5). +- 2026-11-21: Flow completed; PR #227 approved 3/3 at iteration 1, calibrated (EV 37.20 -> 57.92), CI green, + CLEAN/MERGEABLE; awaiting human merge. + +## Resolution + +- Delivered via [PR #227](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/227) and merged into `main` + (`43d278cb`). +- Key deliverables: decomposition of `LedgerQuery` (`ledger/query.py`) and knowledge index/promotion/consult + (`knowledge/{index,promotion,consult}.py`). +- Full 5-stage Holon flow traversal + (`I-1795246929-ledger-query-knowledge-index/P-1795246947-CLA-CO5.5/E-1795247254-CLA-CO5.5/_`), 3/3 reviewer consensus + approval at iteration 1, `11/11` passing CI checks, and calibration report + (`plans/I-1795246929-ledger-query-knowledge-index/P-1795246947-CLA-CO5.5_calibration.md`; EV 37.20 predicted vs. 57.92 + actual). diff --git a/.beans/holon-agentic-coder-ref-metadata-0200--remove-the-duplicated-token-reduction-package.md b/.beans/holon-agentic-coder-ref-metadata-0200--remove-the-duplicated-token-reduction-package.md index 2d632d0..35514d5 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0200--remove-the-duplicated-token-reduction-package.md +++ b/.beans/holon-agentic-coder-ref-metadata-0200--remove-the-duplicated-token-reduction-package.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0200 title: "Remove holon-agentic-coder's diverged token_reduction copy; holon-coherence is the single owner" -status: todo +status: in-progress type: task priority: normal tags: @@ -12,7 +12,7 @@ tags: blocked_by: - holon-agentic-coder-ref-metadata-0189 created_at: 2026-10-29T12:20:00Z -updated_at: 2026-10-29T12:45:00Z +updated_at: 2026-11-23T14:30:00+11:00 --- ## Problem @@ -49,3 +49,49 @@ deletes its own copy. Related to 0157 (sidecar auto-enable). - Run through the Holon flow on holon-agentic-coder. - A tracked `todo/ab_measure_all_methods.py` imports this package; it is a harness-path leak handled by Bean 0147. + +## Audit (2026-11-21) + +Still valid and still blocked by Bean 0189. Production code still imports `generate_root_ca`, `proxy_readiness` and +`PROXY_READY_TIMEOUT_SECONDS` from `sandbox_executor.token_reduction`, now in `cli/__init__.py` (the `cli.py` reference +above is stale); `token_reduction/` still holds the full diverged copy. + +## Flow attempt (2026-11-23): not dispatched + +Blocked by Bean 0189, which is still `todo` with no open PR. Scope item 2 and the touch set name `launcher/sidecar.py`, +a file 0189 creates; on `main` the CA import sits in `cli/__init__.py`. Token reduction is also imported beyond CA +generation (`flow/pipeline.py`, `cli/commands/*`, `cli/options.py`, and about 20 tests), so the Stage 2 plan would +collide with 0189's move. The bean stays `todo` until 0189 is completed, or the maintainer explicitly sequences this +ahead of it. No intent JSON was dispatched. + +## Re-audit (2026-11-23, after Bean 0189 merged): blocked, not dispatched + +Blocker 0189 is `completed` (PR #241 merged), so the dependency is cleared. The scope premise is not: origin/main still +runs the local addon at runtime. + +- `launcher/sidecar_plan.py` (`_mitm_addon_path`) mounts `token_reduction/mitm_addon.py` into a + `mitmproxy/mitmproxy:12.2.3` sidecar (`mitmdump -s /tmp/mitm_addon.py`). Deleting `token_reduction/` removes the addon + that `--token-reduce` runs today. +- `launcher/sidecar.py` imports `proxy_readiness` and `PROXY_READY_TIMEOUT_SECONDS` from the package; `cli/__init__.py` + re-exports them. These need re-homing, not deletion. +- Code outside CA generation imports the package in about 25 places (`cli/options.py`, + `cli/commands/{execute,intent,plan}.py`, `flow/pipeline.py`, `launcher/{containers,proxy_attach}.py`, + `scripts/ab_measure_all_methods.py`, and tests). +- holon-coherence already ships its own addon (`src/holon_coherence/proxy/addon.py`, `mitm_addon.py`) and a proxy + `Dockerfile`. The bean's "holon-coherence owns token reduction" decision therefore implies repointing the sidecar to + that image and addon. The bean does not specify this, and it is a design change. + +Decision needed from the maintainer before a flow can be scoped: + +1. Repoint the sidecar to the holon-coherence image and addon (contract, image name, mounts, and whether + holon-agentic-coder requires it to be present), then delete `token_reduction/`; or +2. Keep the local addon for now, and narrow this bean to deleting the unused modules and tests (`rag_indexer`, + `ringer_orchestrator`, `openbrain_memory`) with their tests. + +Status stays `todo`: no flow was started, no intent was written to `todo/`, and no worktree or PR exists for this bean. + +## Maintainer decision (2026-11-23) + +Full removal. Repoint the token-reduce sidecar to holon-coherence's own proxy addon and image +(`src/holon_coherence/proxy/addon.py` and its proxy `Dockerfile`), re-home `proxy_readiness` and every other remaining +reference, then delete `token_reduction/` and its tests entirely. diff --git a/.beans/holon-agentic-coder-ref-metadata-0213--reflect-review-loop-skill-rules-into-native-holon-agent.md b/.beans/holon-agentic-coder-ref-metadata-0213--reflect-review-loop-skill-rules-into-native-holon-agent.md index 14f8871..7c40993 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0213--reflect-review-loop-skill-rules-into-native-holon-agent.md +++ b/.beans/holon-agentic-coder-ref-metadata-0213--reflect-review-loop-skill-rules-into-native-holon-agent.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0213 title: "Reflect review-loop skill rules into native Review Loop Holon Agent" -status: todo +status: completed type: task priority: high tags: @@ -10,7 +10,7 @@ tags: - conflict-resolution - holon-agentic-coder created_at: 2026-10-30T03:02:00Z -updated_at: 2026-11-20T12:00:00+11:00 +updated_at: 2026-11-20T14:05:06Z --- ## Problem @@ -80,3 +80,26 @@ ledger-only conflict interleaving in code (`flow/github/merge.py`, `flow/ledger_ `task/0213-reflect-review-loop-skill-template` never merged. Remaining: the explicit CONFLICTING/DIRTY gate before consensus posting and Stage 5, the ledger-only fast-path procedure, the model fallback ladder, the zero-synthetic rule and the `uv run pytest`-only rule in the template. + +## Progress + +- 2026-11-20: Started holon flow `review-report-ci-log-redaction` (claude-agent, claude-opus-5-5), combined with beans + 0261, 0213, 0234 and 0148. +- 2026-11-20: Flow `review-report-ci-log-redaction` finished all 5 stages: 3/3 consensus approval at review iteration 3, + calibration report in the diff (EV predicted 39.45, actual 59.09, delta +19.64), final-head CI green. PR + [#220](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/220) was merged by the maintainer at 14:03Z. + +## Resolution + +Delivered via [PR #220](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/220) and merged into `main` +(`9a5454bf`), as part of the combined flow `review-report-ci-log-redaction`: + +- **Key Deliverables**: `holon-config/prompts/review_loop.template.md` now carries the review-loop skill rules: the + mandatory target-branch conflict gate (`CONFLICTING`/`DIRTY`) before consensus posting and Stage 5, the ledger-only + fast conflict path, increment-scoped reviews, pre-merge Stage 5 calibration, and the `uv run pytest`-only and + zero-synthetic-data rules. Conflict gate wiring lands in `flow/review/conflict_gate.py` and + `flow/review/conflict_merge.py`. +- **Verification & Tests**: `tests/test_prompt_templates.py`, `tests/flow/review/test_conflict_gate.py`, + `tests/test_ledger_fast_conflict.py`. +- **Holon Flow Traversal**: Intent -> Plan -> Execute -> Review Loop -> Calibration completed (predicted EV 39.45, + actual 59.09). diff --git a/.beans/holon-agentic-coder-ref-metadata-0215--beans-to-github-issues-importer-and-real-data-dry-run.md b/.beans/holon-agentic-coder-ref-metadata-0215--beans-to-github-issues-importer-and-real-data-dry-run.md index 9336fbe..0ebd096 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0215--beans-to-github-issues-importer-and-real-data-dry-run.md +++ b/.beans/holon-agentic-coder-ref-metadata-0215--beans-to-github-issues-importer-and-real-data-dry-run.md @@ -12,7 +12,7 @@ tags: blocked_by: - "0333" created_at: 2026-10-30T00:00:00Z -updated_at: 2026-11-19T11:30:00Z +updated_at: 2026-11-21T01:20:00+11:00 --- ## Problem @@ -34,7 +34,8 @@ a deterministic importer: bean frontmatter and Markdown body to an issue created issues) and citations stay traceable after the harness is archived. - Dry run on the **real** `.beans/` corpus (no synthetic data): render every issue payload, label set and dependency link to files without calling the API, and report per-field fidelity and anything that could not be mapped. -- Default scope migrates only open beans (about 50: todo and in-progress). Closed history stays frozen in the harness. +- Default scope migrates only open beans (about 40: todo, draft and in-progress). Closed history stays frozen in the + harness. ## Notes @@ -42,3 +43,7 @@ a deterministic importer: bean frontmatter and Markdown body to an issue created write to public repositories, so the real import runs only on the maintainer's word, after the dry-run report. - Creates the label set in each repository before the first import. - Related: Bean 0333 (decision and field defaults), Bean 0216 (the flow uses the issue numbers), Bean 0317 (board). + +## Audit (2026-11-21) + +Open-bean count refreshed: about 40 active beans, not 50 (after the recent completions). Still blocked by Bean 0333. diff --git a/.beans/holon-agentic-coder-ref-metadata-0216--holon-flow-references-and-drives-github-issues.md b/.beans/holon-agentic-coder-ref-metadata-0216--holon-flow-references-and-drives-github-issues.md index b169c3d..535a581 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0216--holon-flow-references-and-drives-github-issues.md +++ b/.beans/holon-agentic-coder-ref-metadata-0216--holon-flow-references-and-drives-github-issues.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0216 title: "Holon flow references and drives GitHub Issues (assign on intent, close on merge)" -status: todo +status: in-progress type: feature priority: normal tags: @@ -12,7 +12,7 @@ tags: blocked_by: - "0333" created_at: 2026-10-30T00:00:00Z -updated_at: 2026-11-19T11:30:00Z +updated_at: 2026-11-23T00:00:00Z --- ## Problem diff --git a/.beans/holon-agentic-coder-ref-metadata-0217--github-issues-tracking-in-holon-coherence.md b/.beans/holon-agentic-coder-ref-metadata-0217--github-issues-tracking-in-holon-coherence.md index 372c30f..ad05973 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0217--github-issues-tracking-in-holon-coherence.md +++ b/.beans/holon-agentic-coder-ref-metadata-0217--github-issues-tracking-in-holon-coherence.md @@ -34,3 +34,10 @@ are already enabled on the repository. What remains is the label set, the agent `holon-coherence`. - Much smaller than the beads version: no image change, no `.beads/`, no sync. - Blocked by Bean 0215 (importer). Related: Bean 0333, Bean 0317 (the organisation board takes this repository too). + +## Audit (2026-11-23) + +Not started: the bean is blocked upstream. Bean 0215 (the importer and its label step) is still `todo` and no importer +exists in the harness. Bean 0215 is blocked by Bean 0333, whose holon-agentic-coder change (removing the beads pilot and +writing the GitHub Issues guidance this bean mirrors) has not landed on `main`. No intent was written and no flow run; +the coherence guidance has no source to mirror yet, and the label/import step needs the maintainer's word. diff --git a/.beans/holon-agentic-coder-ref-metadata-0231--pr124-deferred-nit-raw-count-in-exhausted-budget-error-string.md b/.beans/holon-agentic-coder-ref-metadata-0231--pr124-deferred-nit-raw-count-in-exhausted-budget-error-string.md index b752441..c15697d 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0231--pr124-deferred-nit-raw-count-in-exhausted-budget-error-string.md +++ b/.beans/holon-agentic-coder-ref-metadata-0231--pr124-deferred-nit-raw-count-in-exhausted-budget-error-string.md @@ -10,7 +10,7 @@ tags: - deferred-findings - review-loop created_at: 2026-11-05T06:55:05Z -updated_at: 2026-11-05T06:55:05Z +updated_at: 2026-11-22T22:55:00Z --- Deferral bean for the PR #124 review loop (Bean 0170 convergence rule 1: nits on code the increment did not change are @@ -30,3 +30,13 @@ deferred, not fixed mid-loop). ## Notes - Target: holon-agentic-coder (via a future Holon flow intent, never hand-edited). + +## Audit (2026-11-21) + +Still valid, location moved: the message is built in `_run_engine_review_loop` in `flow/review/loop.py` (around +line 933) and still interpolates the raw `context.review_iterations_done`, while the payload uses the clamped +`first_label - 1`. The `flow.py` reference above is stale. + +## Audit (2026-11-23) + +Still valid in `flow/review/loop.py` lines 917–918; waits for PR #230 (touches `flow/review/loop.py`). diff --git a/.beans/holon-agentic-coder-ref-metadata-0234--event-driven-ci-check-progress-reporting.md b/.beans/holon-agentic-coder-ref-metadata-0234--event-driven-ci-check-progress-reporting.md index 27a4d74..17071b1 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0234--event-driven-ci-check-progress-reporting.md +++ b/.beans/holon-agentic-coder-ref-metadata-0234--event-driven-ci-check-progress-reporting.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0234 title: "Event-driven CI check progress reporting during Stage 4 review" -status: todo +status: completed type: feature priority: normal tags: @@ -11,7 +11,7 @@ tags: - logging - holon-agentic-coder created_at: 2026-11-05T14:25:00Z -updated_at: 2026-11-20T12:00:00+11:00 +updated_at: 2026-11-20T14:05:06Z --- ## Problem @@ -70,3 +70,24 @@ Transform CI check waiting into clean, event-driven progress reporting: The code moved: the poll loop is now `flow/github/ci_wait.py:wait_for_pending_ci` and the tests are in `tests/test_review_ci_wait.py`. Still logs "Waiting for N pending..." on every poll with no transitions or summary. + +## Progress + +- 2026-11-20: Started holon flow `review-report-ci-log-redaction` (claude-agent, claude-opus-5-5), combined with beans + 0261, 0213, 0234 and 0148. +- 2026-11-20: Flow `review-report-ci-log-redaction` finished all 5 stages: 3/3 consensus approval at review iteration 3, + calibration report in the diff (EV predicted 39.45, actual 59.09, delta +19.64), final-head CI green. PR + [#220](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/220) was merged by the maintainer at 14:03Z. + +## Resolution + +Delivered via [PR #220](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/220) and merged into `main` +(`9a5454bf`), as part of the combined flow `review-report-ci-log-redaction`: + +- **Key Deliverables**: `flow/github/ci_wait.py:wait_for_pending_ci` tracks per-check state and logs only transitions + (`CI check '' completed () — N pending`), with one initial tracking announcement and one final summary. + Quiet poll intervals emit nothing. +- **Verification & Tests**: `apps/sandbox-executor/tests/test_review_ci_wait.py` asserts transition log lines and no + duplicate heartbeats on unchanged state. +- **Holon Flow Traversal**: Intent -> Plan -> Execute -> Review Loop -> Calibration completed (predicted EV 39.45, + actual 59.09). diff --git a/.beans/holon-agentic-coder-ref-metadata-0255--streaming-per-issue-resolvers-single-consolidated-commit.md b/.beans/holon-agentic-coder-ref-metadata-0255--streaming-per-issue-resolvers-single-consolidated-commit.md index 489e2db..4a9df84 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0255--streaming-per-issue-resolvers-single-consolidated-commit.md +++ b/.beans/holon-agentic-coder-ref-metadata-0255--streaming-per-issue-resolvers-single-consolidated-commit.md @@ -13,7 +13,7 @@ tags: - concurrency - holon-agentic-coder created_at: 2026-11-09T12:17:00Z -updated_at: 2026-11-09T12:20:00Z +updated_at: 2026-11-21T01:20:00+11:00 --- ## Problem @@ -82,3 +82,9 @@ resolver fixes into a single commit**: - Must be executed through the 5-stage Holon flow (`holon flow`). - Supersedes the naive single-failure abort approach and pairs directly with Bean 0234 (event-driven CI check progress reporting) and Bean 0241 (persistent review loop workspace volume). + +## Audit (2026-11-21) + +Still valid. Locations moved: the loop is `run_review_loop` in `flow/review/loop.py` and CI waiting is +`wait_for_pending_ci` in `flow/github/ci_wait.py` (the `sandbox_executor.flow` module reference above means the `flow/` +package). Overlaps Beans 0192 and 0345 on `flow/review/loop.py`. diff --git a/.beans/holon-agentic-coder-ref-metadata-0261--deduplicate-and-streamline-pr-review-evaluation-line.md b/.beans/holon-agentic-coder-ref-metadata-0261--deduplicate-and-streamline-pr-review-evaluation-line.md index 06867b4..98b317e 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0261--deduplicate-and-streamline-pr-review-evaluation-line.md +++ b/.beans/holon-agentic-coder-ref-metadata-0261--deduplicate-and-streamline-pr-review-evaluation-line.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0261 title: "Deduplicate and streamline PR review evaluation line in consensus report" -status: todo +status: completed type: bug priority: normal tags: @@ -11,7 +11,7 @@ tags: - token-reduction - holon-agentic-coder created_at: 2026-11-09T07:42:00Z -updated_at: 2026-11-09T07:42:00Z +updated_at: 2026-11-20T14:05:06Z --- ## Problem @@ -71,3 +71,24 @@ def _evaluation(repo_dir: str, target: str, consensus_data: Mapping[str, Any], d - `apps/sandbox-executor/src/sandbox_executor/review_report.py` - `apps/sandbox-executor/tests/test_review_report.py` + +## Progress + +- 2026-11-20: Started holon flow `review-report-ci-log-redaction` (claude-agent, claude-opus-5-5), combined with beans + 0261, 0213, 0234 and 0148. +- 2026-11-20: Flow `review-report-ci-log-redaction` finished all 5 stages: 3/3 consensus approval at review iteration 3, + calibration report in the diff (EV predicted 39.45, actual 59.09, delta +19.64), final-head CI green. PR + [#220](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/220) was merged by the maintainer at 14:03Z. + +## Resolution + +Delivered via [PR #220](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/220) and merged into `main` +(`9a5454bf`), as part of the combined flow `review-report-ci-log-redaction`: + +- **Key Deliverables**: `resolve_report_title()` now falls back to intent `title`, then `slug`, then the target title + before the raw branch ref. `_evaluation()` no longer repeats the branch ref as `{title} ({link})`, and the evaluation + sentence is streamlined with an 8-character commit SHA. +- **Verification & Tests**: `apps/sandbox-executor/tests/test_review_report.py` covers the deduplicated subject, slug + fallback and concise evaluation line. +- **Holon Flow Traversal**: Intent -> Plan -> Execute -> Review Loop -> Calibration completed (predicted EV 39.45, + actual 59.09). diff --git a/.beans/holon-agentic-coder-ref-metadata-0264--read-module-size-budgets-from-configuration-not-code.md b/.beans/holon-agentic-coder-ref-metadata-0264--read-module-size-budgets-from-configuration-not-code.md index 6770b79..bfd1793 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0264--read-module-size-budgets-from-configuration-not-code.md +++ b/.beans/holon-agentic-coder-ref-metadata-0264--read-module-size-budgets-from-configuration-not-code.md @@ -1,109 +1,130 @@ --- # holon-agentic-coder-ref-metadata-0264 -title: "Read module size budgets from configuration instead of hardcoding paths and numbers in the check" -status: todo +title: + "Module size budgets force a split: forbid raising a budget, default ceiling for new modules, no shared edit per flow" +status: completed type: task -priority: normal +priority: high tags: - flow - lint - configuration - - tests + - admission - holon-agentic-coder created_at: 2026-11-09T10:00:00Z -updated_at: 2026-11-09T10:00:00Z +updated_at: 2026-11-20T09:32:35Z --- -## Problem - -The per-module size ratchet from Bean 0254 (PR #147) has its settings baked into code and into a one-off data file: +## Intent of the budget (maintainer, 2026-11-20) -- `scripts/check_flow_module_budgets.py` hardcodes both paths (`DEFAULT_PACKAGE_DIR` is - `apps/sandbox-executor/src/sandbox_executor/flow` and `DEFAULT_BUDGETS` is - `apps/sandbox-executor/flow_module_budgets.json`), the JSON shape (`["budgets"]`), and its rules (a module with no - entry is a violation, an entry with no module is a violation). -- The script and its message strings are named for the `flow` package, so applying the same ratchet to another package - (`cli/commands/`, `proxy/`, `executor/`, as `AGENTS.md` rule 15 suggests) means copying the script. -- The 200-line guideline from `AGENTS.md` rule 15 appears nowhere in the check. Every module needs a budget entry at its - creation size, so the file holds 28 numbers, 18 of them above 200 lines (the largest, `review/loop.py`, is 962). -- `tests/flow/test_module_budgets.py` builds temporary packages against the same hardcoded layout. +A module budget is a ceiling that forces a big module to be **divided**. It is not a number to raise whenever a file +gets bigger. When a change would push a module past its budget, the module is split; the budget is never raised to fit. -Settings that people tune belong in the repository's Holon configuration directory, which tools read like the metrics -and prompt files, not in script constants or a bespoke JSON file that sits beside the source. +**The budget is strictly off-limits.** No agent or flow touches the budget configuration in any way (raise, lower, add, +delete) unless the maintainer has given an explicit instruction for that change. -## Goal +## Problem -1. **Define the settings in `holon-config/`**, the repository's existing configuration directory (next to - `holon-config/metrics/*.json`, `prompts/` and `world/`, which the code already reads by path). They do not go in - `pyproject.toml`. Add `holon-config/hygiene/module_budgets.json`, read with the standard library `json` module (no - new dependency), for example: - - ```json - { - "default_max_lines": 200, - "packages": ["apps/sandbox-executor/src/sandbox_executor/flow"], - "overrides": { - "apps/sandbox-executor/src/sandbox_executor/flow/review/loop.py": { - "max_lines": 962, - "reason": "Review loop engine; to be decomposed by the ReviewLoop extraction" - } - } - } - ``` - - The exact key names may differ, but the shape must give three things: which packages are checked, one default - ceiling, and per-module overrides keyed by repository-relative path, recorded at the modules' current sizes, each - with a reason. Keys are sorted, one entry per module. - -2. **Make the check generic and free of hardcoded values.** Rename it to `scripts/check_module_budgets.py`. It reads - `holon-config/hygiene/module_budgets.json` (with an optional `--config` path used by tests), checks every `.py` file - under each configured package, and reports one message per violation: - - a module above its override, or above the default ceiling when it has no override; - - an override naming a missing module (remove it); - - an override above the default ceiling is allowed (that is what an override is for), but an override at or below the - default ceiling is redundant and reported. - - No path, package name or line count appears in the script. - -3. **Agents can change the configuration, with changes made visible.** The settings are ordinary configuration that flow - agents and people edit in a PR like any other file: nothing blocks lowering, raising, adding or removing an override, - or changing the default ceiling. What the check adds is visibility, not a veto: it compares the configuration with - the merge base's copy (`git show :holon-config/hygiene/module_budgets.json`, skipped quietly when there is no - base) and prints a `::warning::` line for every effective limit that went up, naming the module, the old and new - limit and the number of lines it now allows. Each override carries a short `reason` (a table with `max-lines` and - `reason`, or an adjacent comment convention the check can read), and the check reports an override with no reason as - a violation so a raise is never silent. Reviewers see the warnings in CI output and the reason in the diff, and - decide. - -4. **Remove the old pieces.** Delete `apps/sandbox-executor/flow_module_budgets.json` and - `scripts/check_flow_module_budgets.py`, update the `lint` task and any CI hygiene step that calls the script, and - delete every reference to the old names (code, docs, CI configuration). No fallback to the JSON file. - -5. **Tests and docs.** Rework `tests/flow/test_module_budgets.py` (move it to `tests/test_module_budgets.py`, since the - check is no longer flow-specific) to cover: the default ceiling, an override, a missing module, a redundant override, - an override without a reason, multiple packages, a raised limit producing a warning (and still passing) against a - base copy, a lowered limit producing none, and reading a custom `--config`. Update `docs/architecture.md` and the - contributing notes to describe where the settings live and how to lower a budget. - -6. **Constraints**: `uv run pytest`, `uv run task lint` and `uv run task lint-docs` pass; no new dependencies. +The per-module size ratchet from Bean 0254 (PR #147) stops a module from growing past its budget, but nothing stops a +pull request from raising the budget, so flows take the cheapest path to a green lint and edit the JSON: -## Sequencing +- `apps/sandbox-executor/flow_module_budgets.json` has changed in 34 commits. It went from 28 modules and 6,937 budgeted + lines to 70 modules and 12,091. Some of that is splitting, as intended, but the number of modules over 200 lines still + rose from 18 to 22, and the largest is 952. +- Its `description` string has become a running log of raises ("raised by 1, 1 and 3 lines for …"), which every flow + appends to. +- Every module needs an entry, so a split must also add rows to the file. -- **Do not start yet.** PR #152 (Bean 0262) lowers entries in `flow_module_budgets.json`, and Bean 0263 edits - `tests/flow/` and `docs/architecture.md`. Run this after both have merged, to avoid conflicts on the same files. -- It touches `holon-config/hygiene/`, `scripts/`, `tests/`, the CI hygiene configuration and `docs/`, and no source - modules, so it can run alongside beans that change `src/`. +Because almost every flow on `flow/` code edits this one file, Stage 3 admission sees it in every touch set and refuses +or serialises flows that otherwise share nothing (2026-11-20: `review-keeps-worktree-on-branch` waited on PR #210 only +for this file), and the shared `description` line makes the merges conflict textually (PRs #206, #208, #209). -## Trade-offs to note +## Goal -- The overrides still live in one shared file, so two PRs that change different modules can touch adjacent lines of the - same table. Configuration was chosen deliberately over per-module header comments. Sorted keys and one entry per line - keep any such conflict trivial, and the default ceiling means most new modules need no entry at all. -- Letting agents raise limits means the ratchet no longer forbids growth: it records it. Earlier flow intents told - agents never to raise a budget; that instruction was a choice made for those runs, not part of this design, and - intents written after this bean lands should not repeat it. +Through the Holon flow on `holon-agentic-coder`: + +1. **The budget configuration is frozen: nothing may change it without the maintainer's explicit instruction.** No + agent, flow stage, resolver or reviewer may raise, lower, add, delete or reformat any budget, override or the default + ceiling on its own judgement, not even to lower a limit after a split. Any difference between the budget + configuration and the merge base's copy (`git merge-base HEAD origin/main`) fails the check, unless the change is + explicitly authorised: + - **In the flow:** the intent carries a `module_budget_change` field quoting the maintainer's instruction. Only then + does the flow set `HOLON_ALLOW_MODULE_BUDGET_CHANGE=1` for the check. Without the field, Stage 3 and the Stage 4 + resolver refuse to commit any change to the budget configuration, and the planner must not list it in the touch + set. + - **In CI:** the check fails on any change to the budget configuration unless the pull request carries the + `module-budget-change` label, which only the maintainer applies (agents never add or remove it). + - The one authorised change is this flow itself, which creates the new configuration from the existing budgets at + their current values (maintainer instruction, 2026-11-20). Every value is copied unchanged. +2. **New modules need no entry.** A default ceiling of 200 lines (the guideline in the repository's agent rules) applies + to every module without an override, so a split adds no entries. An override that names a missing module, or sits at + or below the default, is reported as a `::warning::` for the maintainer, never as a failure, because fixing it would + mean touching the configuration. +3. **Over budget means split.** The check's failure message says to split the module and that the budget may not be + changed. The planner, executor and Stage 4 resolver prompts (`holon-config/prompts/`) say the same: when a planned + change would push a module past its limit, plan and perform the extraction into new modules as part of the change. + Reviewers treat any change to the budget configuration without the authorisation above as a Critical finding. +4. **Settings in configuration, no history prose.** Move the settings to `holon-config/hygiene/module_budgets.json` + (`default_max_lines`, `packages`, `overrides` keyed by repository-relative path, sorted, one per line, plain + integers). No free-text history: reasons for changes belong in commit messages and the ledgers. Rename the check to + `scripts/check_module_budgets.py`, make it generic over the configured packages with no hardcoded path, package or + line count (optional `--config` and `--base` for tests), and delete `apps/sandbox-executor/flow_module_budgets.json` + and `scripts/check_flow_module_budgets.py` with every reference to them (lint task, CI, docs). No fallback. +5. **Tests and docs.** Move the test to `tests/test_module_budgets.py` and cover: the default ceiling for a module with + no entry; an override; a new module under 200 lines passing with no entry; any change to the configuration against a + base copy failing (a raise, a lower, an added or deleted override, a changed default); the same change passing when + explicitly authorised; an override naming a missing module and a redundant override producing warnings, not failures; + multiple packages; a custom `--config`. Hermetic flow tests: without the intent field, Stage 3 and the resolver + refuse to commit a budget change and the planner leaves the configuration out of the touch set. Update + `docs/architecture.md` to state the rule (split; the budget is frozen and changes only on the maintainer's explicit + instruction) and where the settings live. +6. **Constraints:** `uv run pytest`, `uv run task lint` and `uv run task lint-docs` pass; no new dependencies; exactly + the three ledgers. + +## Expected effect + +No flow touches the budget configuration unless the maintainer has asked for that change, so it drops out of touch sets +and stops causing Stage 3 overlap waits and Stage 4 merge conflicts. -## Notes +## Sequencing -- Target repository changes in `holon-agentic-coder` must be delivered through the 5-stage Holon flow. +- Start after the in-flight flows that edit `flow_module_budgets.json` (Beans 0336 and 0338) have merged; this flow + deletes that file. - The intent JSON must not mention bean IDs or harness paths, because it is copied into `intents.jsonl`. + +## Progress + +- 2026-11-20 18:52 AEDT: flow `freeze-module-budgets-split` started (claude-agent, claude-opus-5-5) in worktree + `flow-freeze-module-budgets-split`. +- 2026-11-20 20:05 AEDT: flow complete. PR #214 approved 3/3 (re-review after merging origin/main for #213 ledger + conflicts), calibration in PR diff (EV predicted 36.32, actual 70.68, +34.36), MERGEABLE/CLEAN, checks green. The 22 + budgets over 200 lines were copied unchanged; the other 49 fall under the 200-line default. Awaiting human merge. + +## History + +- 2026-11-09: first written as "read module size budgets from configuration", which let agents raise limits with a + warning. Rewritten 2026-11-20 after the maintainer restated the intent: budgets force a split and are never raised. + Tightened the same day: the budget configuration is frozen, and any change at all needs the maintainer's explicit + instruction. + +## Resolution + +Delivered via [PR #214](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/214) and merged into `main` +(`bea601e`): + +- **Budgets frozen and moved to configuration**: the settings now live in `holon-config/hygiene/module_budgets.json` + (`default_max_lines` 200, `packages`, `overrides` sorted, plain integers). The 22 existing overrides were copied + unchanged. Free-text history removed. `apps/sandbox-executor/flow_module_budgets.json` and + `scripts/check_flow_module_budgets.py` are deleted. +- **Generic check**: `scripts/check_module_budgets.py` is generic over the configured packages (optional `--config` and + `--base`). Any difference from the merge base's configuration fails unless authorised, through the intent's + `module_budget_change` field (flow) or the maintainer-only `module-budget-change` PR label (CI). Overrides naming a + missing module, or at or below the default, warn only. +- **Flow wiring**: `module_budget_guard.py` is wired into Stage 3 admission, the Stage 4 resolver and the review loop. + Without the intent field, those stages refuse budget-configuration changes and the planner leaves the file out of the + touch set. +- **Prompts**: planner, executor and review-loop templates say to split an over-budget module, never raise the budget. +- **Tests and docs**: `tests/test_module_budgets.py` and hermetic flow tests; `docs/architecture.md` states the rule. +- **Calibration**: EV predicted 36.32, actual 70.68 (+34.36). +- **Flow**: `freeze-module-budgets-split` (claude-agent, `I-1795161177`), approved 3/3 on re-review after merging + `origin/main` for ledger conflicts; all 5 stages completed. diff --git a/.beans/holon-agentic-coder-ref-metadata-0265--split-cli-init-into-focused-modules-move-only.md b/.beans/holon-agentic-coder-ref-metadata-0265--split-cli-init-into-focused-modules-move-only.md index a4ac2cf..271daeb 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0265--split-cli-init-into-focused-modules-move-only.md +++ b/.beans/holon-agentic-coder-ref-metadata-0265--split-cli-init-into-focused-modules-move-only.md @@ -11,7 +11,7 @@ tags: - concurrency - holon-agentic-coder created_at: 2026-11-09T10:30:00Z -updated_at: 2026-11-09T10:30:00Z +updated_at: 2026-11-22T22:55:00Z --- ## Problem @@ -126,3 +126,10 @@ module map and a one-line responsibility per module. - Target repository changes in `holon-agentic-coder` must be delivered through the 5-stage Holon flow. - Stage 3 output is large. Set `HOLON_STAGE_BUDGET_EXECUTE_MINUTES` generously. - The intent JSON must not mention bean IDs or harness paths, because it is copied into `intents.jsonl`. + +## Audit (2026-11-23) + +`cli/__init__.py` is 1,732 lines on `main` (`b22258d`). All earlier sequencing dependencies (`0262`, `0263`, `0264`) +have merged, and no other session has `0265` in flight. Disjoint from PR #230 on code (`cli/__init__.py`, +`tests/test_cli.py`), but Scope item 5 edits `docs/architecture.md` which PR #230 also touches — run immediately after +PR #230 merges (or defer the `docs/architecture.md` edit). diff --git a/.beans/holon-agentic-coder-ref-metadata-0269--deferred-nits-from-the-pr-158-review-loop.md b/.beans/holon-agentic-coder-ref-metadata-0269--deferred-nits-from-the-pr-158-review-loop.md index 8c22ab1..c189b2a 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0269--deferred-nits-from-the-pr-158-review-loop.md +++ b/.beans/holon-agentic-coder-ref-metadata-0269--deferred-nits-from-the-pr-158-review-loop.md @@ -9,7 +9,7 @@ tags: - calibration - holon-agentic-coder created_at: 2026-11-10T00:00:00Z -updated_at: 2026-11-10T00:00:00Z +updated_at: 2026-11-21T01:20:00+11:00 --- ## Deferred findings @@ -23,3 +23,10 @@ Collected by the PR 158 review loop (principle 12 deferral bean). Each was a Nit (iteration 5 ensemble, out of increment). - `docs/git_flow.md:295` says an exception 'keeps the recorded progress', which no longer holds when the checkpoint save itself fails (iteration 6, out of increment). + +## Audit (2026-11-21) + +Re-checked. Item 1 still valid (`calibration.py` around line 772 keeps its own exit-code logic while +`calibration_outcome.record_exit_code` exists; fold them together). Item 2 is obsolete: `flow.py` is gone and no +removed-definitions consistency test exists. Item 3 still valid: `docs/git_flow.md` around line 384 still says Stage 3 +keeps the recorded progress. The `flow.py` references above are stale. diff --git a/.beans/holon-agentic-coder-ref-metadata-0270--add-claude-sonnet-5-5-to-the-antigravity-agent-model-table.md b/.beans/holon-agentic-coder-ref-metadata-0270--add-claude-sonnet-5-5-to-the-antigravity-agent-model-table.md index d4a4190..89236ea 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0270--add-claude-sonnet-5-5-to-the-antigravity-agent-model-table.md +++ b/.beans/holon-agentic-coder-ref-metadata-0270--add-claude-sonnet-5-5-to-the-antigravity-agent-model-table.md @@ -10,7 +10,7 @@ tags: - antigravity - holon-agentic-coder created_at: 2026-11-10T03:08:00Z -updated_at: 2026-11-10T03:12:00Z +updated_at: 2026-11-22T22:55:00Z --- ## Problem @@ -49,3 +49,8 @@ Do not add Sonnet 5.5 to the table. Remove the hardcoded catalogue and resolve m - Must be produced by `holon flow`. The flow is blocked (Antigravity quota ~92h, `claude-agent` `NOT_LOGGED_IN`), so it needs a Claude login or an explicit maintainer instruction to hand-author it. - Bean 0262 resumes once a runner is usable. + +## Audit (2026-11-23) + +The 2026-11-10 runner/quota block is cleared (both runners operational), and `0262` and `0322` (PR #222) have merged. +Unblocked and disjoint from PR #230; sequence with `0198` and `0350` on `agent_defaults.py`. diff --git a/.beans/holon-agentic-coder-ref-metadata-0283--agent-api-error-output-is-written-as-the-plan-and-reported-as-a-metrics-failure.md b/.beans/holon-agentic-coder-ref-metadata-0283--agent-api-error-output-is-written-as-the-plan-and-reported-as-a-metrics-failure.md index 5187941..fb3701f 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0283--agent-api-error-output-is-written-as-the-plan-and-reported-as-a-metrics-failure.md +++ b/.beans/holon-agentic-coder-ref-metadata-0283--agent-api-error-output-is-written-as-the-plan-and-reported-as-a-metrics-failure.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0283 title: "An agent's API error output is written as the plan and reported as a metrics failure" -status: todo +status: completed type: bug priority: high tags: @@ -10,7 +10,7 @@ tags: - token-reduction - holon-agentic-coder created_at: 2026-11-12T03:00:00Z -updated_at: 2026-11-12T03:00:00Z +updated_at: 2026-11-20T06:21:19Z --- ## Problem @@ -28,3 +28,23 @@ Run through the Holon flow. (1) The planner entrypoint detects an API error in t or 5xx status line) and fails the stage with that text, never writing it to the plan path. (2) A failed plan attempt leaves no untracked plan file behind. (3) Make `payload_cleaner` leave existing `cache_control` blocks alone and inject only consistent ones (a `1h` block never after a `5m` block), with a hermetic test. Keep exactly the three ledgers. + +## Progress + +- 2026-11-20: Holon flow `planner-api-error-not-a-plan` started (claude-agent, claude-opus-5-5) in worktree + `flow-planner-api-error-not-a-plan`. +- 2026-11-20: Flow completed all 5 stages. PR Holon-Agentic-Coder/holon-agentic-coder#210 — consensus APPROVED 3/3 at + iteration 1 (0 findings), calibration report in PR diff, predicted EV 53.40 / actual 73.52, MERGEABLE/CLEAN, 11/11 + checks green; awaiting human merge. + +## Resolution + +Delivered via [PR #210](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/210) and merged into `main` +(`30d7c77`): + +- **Planner fails on agent API errors**: the planner entrypoint detects `API Error:` / 4xx-5xx status output and fails + the stage with that text instead of writing it to the plan path. +- **No stray plan file**: a failed plan attempt leaves no untracked plan file behind. +- **Consistent `cache_control`**: `payload_cleaner` leaves existing `cache_control` blocks alone and injects only + consistent ones (a `1h` block never follows a `5m` block), with hermetic tests. +- **Calibration**: predicted EV 53.40, actual 73.52. diff --git a/.beans/holon-agentic-coder-ref-metadata-0322--remove-the-redundant-gemini-agent-runner.md b/.beans/holon-agentic-coder-ref-metadata-0322--remove-the-redundant-gemini-agent-runner.md index be58084..20fcb69 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0322--remove-the-redundant-gemini-agent-runner.md +++ b/.beans/holon-agentic-coder-ref-metadata-0322--remove-the-redundant-gemini-agent-runner.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0322 -title: "Remove the gemini-agent runner, made redundant by antigravity-agent" -status: todo +title: "Completely remove the gemini-agent runner and all gemini runner special-cases" +status: completed type: task priority: low tags: @@ -9,35 +9,55 @@ tags: - cleanup - holon-agentic-coder created_at: 2026-11-17T14:40:00Z -updated_at: 2026-11-17T14:40:00Z +updated_at: 2026-11-21T05:24:00Z --- ## Problem `gemini-agent` has been superseded by `antigravity-agent` and has never run a flow: `plans.jsonl` and `executions.jsonl` -record only `claude-agent` and `antigravity-agent`. It is still fully wired into `holon-agentic-coder` (`origin/main`, -2026-11-18), so `--agent gemini-agent` is still accepted and its image is still built on every bake: - -- **Image**: the `agent-gemini` target in `apps/sandbox-executor/Dockerfile` and `docker-bake.hcl`, and its row in - `docs/docker_bake.md`. -- **Runner**: `GeminiAgentRunner` and its registry entry and `gemini` validator in `agent_runner.py`. -- **Registry**: the `gemini` entries in `AGENT_IMAGE_MAPPING`, `DEFAULT_MODELS` and `RUNNER_CAPABILITIES`, and the - `GEMINI_API_KEY`/`GOOGLE_API_KEY` and `~/.config/gcloud` auth detection, in `agent_defaults.py`; the `gemini` entry in - `cli/__init__.py`. +record only `claude-agent` and `antigravity-agent`. It is still wired into `holon-agentic-coder`: + +- **Image & docs**: the `agent-gemini` target in `apps/sandbox-executor/Dockerfile` and `docker-bake.hcl`, its row in + `apps/sandbox-executor/docs/docker_bake.md`, and `gemini-agent` entries in `docs/agents.md` and + `docs/planner/agent_credentials_requirements.md`. +- **Runner**: `GeminiAgentRunner`, its registry entry, and the `"gemini"` `custom_validator` branch in + `agent_runner.py`. +- **Registry & CLI**: the `gemini` entries and comments in `AGENT_IMAGE_MAPPING`, `DEFAULT_MODELS`, + `RUNNER_CAPABILITIES`, and `GEMINI_API_KEY`/`GOOGLE_API_KEY`/`~/.config/gcloud` runner auth detection in + `agent_defaults.py`; the `"gemini"` mount entry in `cli/__init__.py`; and `gemini` in `cli/commands/models.py` help + text. ## Action -Run through the Holon flow on `holon-agentic-coder`. Remove the runner, its image target and its registry entries, and -make `--agent gemini-agent` fail with a message pointing to `antigravity-agent`. - -Keep what is not the runner: Gemini **models** (`gemini-3.8-flash-medium` and others) stay, since antigravity runs them; -the provider detection for `gemini` URLs in `token_reduction/mitm_addon.py` stays; the places that treat `antigravity` -and `gemini` alike (`agent_defaults.py` lines 207 and 252) need checking, not blind deletion. Historical ledger rows are -untouched. +Run through the Holon flow on `holon-agentic-coder` (maintainer decision 2026-11-20: complete removal with **no** +special-case deprecation or migration branches for `gemini`): + +- Remove the runner, its image target, its registry/default/capability/auth/mount entries, its CLI help reference, and + its docs rows completely. +- Do **not** add `if agent_id == "gemini":` or `if norm == "gemini":` special-case checks anywhere — passing + `--agent gemini-agent` or `--agent gemini` must simply fail through the standard generic unsupported-runner error + path. +- Keep only what is not the `gemini-agent` runner: Gemini **models** (`gemini-3.8-flash`, `gemini-3.8-flash-medium`, + etc.) under `antigravity-agent`, `antigravity-agent`'s `~/.gemini/antigravity-cli` session mounts and effort + coordination, `local-model` in `RUNNER_CAPABILITIES`, `gemini` URL detection in `token_reduction/mitm_addon.py`, + Google/Gemini API key patterns in `knowledge/records.py`, and untouched historical ledger rows. +- Update tests and add hermetic assertions verifying `gemini` / `gemini-agent` is rejected as an unsupported runner with + no `gemini`-specific runner code remaining. ## Notes -- Touches `agent_defaults.py`, as does Bean 0321; run the two flows one after the other. After Bean 0321 a runner - without a ticker is rejected at intent time, so `gemini-agent` is already unusable for flows and this becomes pure - clean-up. -- `local-model` in `RUNNER_CAPABILITIES` is a placeholder with no image, not a runner; decide here whether it stays. +- PR #218 (`remove-gemini-agent-runner`) was closed on 2026-11-20 because it followed the earlier wording and added + `if agent_id == "gemini":` / `if norm == "gemini":` migration branches; replaced by fresh flow + `purge-gemini-agent-runner`. +- `local-model` in `RUNNER_CAPABILITIES` stays (maintainer decision 2026-11-20, used by Bean 0226). + +## Resolution + +- Delivered via [PR #222](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/222) and merged into `main` + (`e2ba3c2a`). +- Key deliverables: complete removal of the `gemini-agent` runner, `docker/agent-gemini` image/config, `GEMINI_*` runner + env/constants, and all `gemini` special-cases across `sandbox-executor` and its test suite. +- Traversal across all 5 Holon flow stages + (`I-1795178792-purge-gemini-agent-runner/P-1795184239-ANA-G3.8F/E-1795184522-ANA-G3.8F/_`), unanimous ensemble + approval, `11/11` passing CI checks, and included calibration report + (`plans/I-1795178792-purge-gemini-agent-runner/P-1795184239-ANA-G3.8F_calibration.md`). diff --git a/.beans/holon-agentic-coder-ref-metadata-0331--overlap-override-moves-the-plan-tip-and-discards-partial-work.md b/.beans/holon-agentic-coder-ref-metadata-0331--overlap-override-moves-the-plan-tip-and-discards-partial-work.md index c078da8..48aadf3 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0331--overlap-override-moves-the-plan-tip-and-discards-partial-work.md +++ b/.beans/holon-agentic-coder-ref-metadata-0331--overlap-override-moves-the-plan-tip-and-discards-partial-work.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0331 title: "Each --allow-overlap resume moves the plan tip, so Stage 3 partial work is never continued" -status: in-progress +status: completed type: bug priority: high tags: @@ -11,7 +11,7 @@ tags: - overlap - holon-agentic-coder created_at: 2026-11-18T12:45:00Z -updated_at: 2026-11-20T11:40:00+11:00 +updated_at: 2026-11-20T14:30:00+11:00 --- ## Problem @@ -63,6 +63,31 @@ executed three times from scratch, about 45 minutes each, and no attempt continu and `apps/sandbox-executor/tests/flow/stages/test_execute.py`. Not overridden; resume with `--from-stage execute` in `flow-resumetip` after PR #207 merges. +- **2026-11-20:** Flow `resumetip` resumed at Stage 3 with the maintainer-authorised one-time `--allow-overlap` (overlap + with the waiting `blockedflow` flow, recorded on the plan branch). Executor (claude-opus-5-5) finished in 13.5 min + (4441 tests passed) and pushed `E-1795139222-CLA-CO5.5/_`, but its pre-push sync hit non-ledger conflicts with + `origin/main` (PR #207) in `apps/sandbox-executor/flow_module_budgets.json` and + `apps/sandbox-executor/src/sandbox_executor/flow/__init__.py`, so Stage 4 stopped. A resolve-conflict subagent merged + `origin/main` (additive `__all__` union; budget for `flow/__init__.py` set to its real 514 lines; lint and 898 flow + tests pass), then the flow resumed from Stage 4 without the override. PR #208 + (https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/208) reached 3/3 approval at iteration 2 (iteration 1 + had one Important finding per reviewer, resolved). Calibration is in the PR: predicted EV 39.61, actual EV -19.01 (ΔEV + -58.62). CI is green on head `18c4e10`, and the PR is MERGEABLE/CLEAN and waiting for a human merge. + +## Resolution + +Delivered via [PR #208](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/208) and merged into `main` +(`00fa535`), in the same `resumetip` flow as Bean 0335: + +- **Override records no longer invalidate partial work**: the `--allow-overlap` admission override is recorded once per + plan, not on every resume, and `resolve_partial_head` accepts a partial head that descends from any earlier tip of the + same plan branch. +- **Harness half**: the runner no longer relaunches with `--allow-overlap` on its own (done before this flow). +- **Verification & Tests**: 4441 tests passed on the executor run; review approved 3/3 at iteration 2; CI green on head + `18c4e10`. Calibration: predicted EV 39.61, actual EV -19.01 (delta -58.62). +- **Holon Flow Traversal**: Stage 4 stopped on a pre-push sync conflict with `origin/main` (PR #207); a resolve-conflict + subagent merged `origin/main` and the flow resumed from Stage 4 without the override. All five stages then completed. + ## Notes - Related: Bean 0151 (touch-set admission), Bean 0171 (Stage 3 partial-work salvage), Bean 0172 (explicit unlimited diff --git a/.beans/holon-agentic-coder-ref-metadata-0333--github-issues-replace-beads-as-the-target-tracker.md b/.beans/holon-agentic-coder-ref-metadata-0333--github-issues-replace-beads-as-the-target-tracker.md index eae90f4..27f7de5 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0333--github-issues-replace-beads-as-the-target-tracker.md +++ b/.beans/holon-agentic-coder-ref-metadata-0333--github-issues-replace-beads-as-the-target-tracker.md @@ -10,7 +10,7 @@ tags: - beads - holon-agentic-coder created_at: 2026-11-19T11:30:00Z -updated_at: 2026-11-19T11:30:00Z +updated_at: 2026-11-22T22:55:00Z --- ## Decision (maintainer, 2026-11-19) @@ -62,3 +62,16 @@ The follow-up in `todo/beadspil-dockerfile-digest-pin.patch` was dropped on 2026 and not beside Bean 0322, which also edits the Dockerfile. - The intent JSON must not mention bean ids or harness paths. - Related: Bean 0156 (investigation, superseded on the tracker choice), Bean 0214 (pilot), Beans 0215-0218 and 0317. + +## Audit (2026-11-21) + +Still valid on `origin/main`: `.beads/config.yaml` and `tests/test_beads_integration.py` (the pilot from +[PR #204](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/204)) are still present, and Beans 0215-0218 +and 0317 remain blocked on this decision bean. + +## Audit (2026-11-23) + +`0321` (PR #206) and `0322` (PR #222) have both merged. Beads pilot files still on `main` (`b22258d`): +`.beads/config.yaml`, `.gitignore`, `apps/sandbox-executor/Dockerfile`, `apps/sandbox-executor/docker-bake.hcl`, +`apps/sandbox-executor/tests/test_beads_integration.py`, `docs/agents.md`, `docs/issue_tracking.md`. Unblocked and +completely disjoint from PR #230. diff --git a/.beans/holon-agentic-coder-ref-metadata-0335--stage-3-resume-ignores-commits-added-to-the-execution-branch-tip.md b/.beans/holon-agentic-coder-ref-metadata-0335--stage-3-resume-ignores-commits-added-to-the-execution-branch-tip.md index c461c34..2944dd9 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0335--stage-3-resume-ignores-commits-added-to-the-execution-branch-tip.md +++ b/.beans/holon-agentic-coder-ref-metadata-0335--stage-3-resume-ignores-commits-added-to-the-execution-branch-tip.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0335 title: "A Stage 3 resume restarts from the ledger partial_head and ignores commits added to the execution branch tip" -status: in-progress +status: completed type: bug priority: normal tags: @@ -10,7 +10,7 @@ tags: - resume - holon-agentic-coder created_at: 2026-11-20T11:30:00+11:00 -updated_at: 2026-11-20T12:05:00+11:00 +updated_at: 2026-11-20T14:30:00+11:00 --- ## Problem @@ -38,6 +38,31 @@ merge commit. and `apps/sandbox-executor/tests/flow/stages/test_execute.py`. Not overridden; resume with `--from-stage execute` in `flow-resumetip` after PR #207 merges. +- **2026-11-20:** Flow `resumetip` resumed at Stage 3 with the maintainer-authorised one-time `--allow-overlap` (overlap + with the waiting `blockedflow` flow, recorded on the plan branch). Executor (claude-opus-5-5) finished in 13.5 min + (4441 tests passed) and pushed `E-1795139222-CLA-CO5.5/_`, but its pre-push sync hit non-ledger conflicts with + `origin/main` (PR #207) in `apps/sandbox-executor/flow_module_budgets.json` and + `apps/sandbox-executor/src/sandbox_executor/flow/__init__.py`, so Stage 4 stopped. A resolve-conflict subagent merged + `origin/main` (additive `__all__` union; budget for `flow/__init__.py` set to its real 514 lines; lint and 898 flow + tests pass), then the flow resumed from Stage 4 without the override. PR #208 + (https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/208) reached 3/3 approval at iteration 2 (iteration 1 + had one Important finding per reviewer, resolved). Calibration is in the PR: predicted EV 39.61, actual EV -19.01 (ΔEV + -58.62). CI is green on head `18c4e10`, and the PR is MERGEABLE/CLEAN and waiting for a human merge. + +## Resolution + +Delivered via [PR #208](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/208) and merged into `main` +(`00fa535`), in the same `resumetip` flow as Bean 0331: + +- **Resume from the branch tip**: when the execution branch tip descends from the recorded `partial_head` and from a tip + of the plan branch, the executor continues from the tip, so commits added after the failure (such as an `origin/main` + merge) are kept. Otherwise the previous behaviour is kept and the log says why. +- **No push before the ledger row**: an execution branch is not pushed before its ledger row exists, so a failed attempt + leaves no pushed branch without a ledger row. +- **Verification & Tests**: same run and review as Bean 0331 (4441 tests passed; review approved 3/3 at iteration 2; CI + green on `18c4e10`). +- **Holon Flow Traversal**: all five stages completed after one Stage 4 resume, as described in Bean 0331. + ## Notes - Related: Bean 0171 (partial-work salvage), Bean 0331 (plan tip moved by override records). diff --git a/.beans/holon-agentic-coder-ref-metadata-0336--review-container-leaves-the-shared-worktree-on-a-detached-head.md b/.beans/holon-agentic-coder-ref-metadata-0336--review-container-leaves-the-shared-worktree-on-a-detached-head.md index 4f90c2c..9fb2127 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0336--review-container-leaves-the-shared-worktree-on-a-detached-head.md +++ b/.beans/holon-agentic-coder-ref-metadata-0336--review-container-leaves-the-shared-worktree-on-a-detached-head.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0336 title: "A Stage 4 review container left the shared flow worktree on a detached HEAD, so the resolver refused to run" -status: todo +status: completed type: bug priority: normal tags: @@ -11,7 +11,7 @@ tags: - worktree - holon-agentic-coder created_at: 2026-11-20T11:30:00+11:00 -updated_at: 2026-11-20T11:30:00+11:00 +updated_at: 2026-11-20T18:45:15+11:00 --- ## Problem @@ -32,3 +32,27 @@ asserts the worktree is on the execution branch afterwards. ## Notes - Log: `todo/flow-shortref-resume6.log`. + +## Progress + +- 2026-11-20: Holon flow `review-keeps-worktree-on-branch` started (claude-agent, claude-opus-5-5) in worktree + `flow-review-keeps-worktree-on-branch`; log `todo/flow-review-keeps-worktree-on-branch.log`. +- 2026-11-20: Flow completed all 5 stages. Stage 3 waited out overlaps (PR #210, then local flow + `refresh-plan-after-overlap-wait`) and was admitted on its own with a refreshed plan. Stage 4 reached 3/3 consensus at + iteration 3. PR #212 (https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/212) is OPEN, MERGEABLE/CLEAN, + all checks green, calibration report in the diff; EV predicted 55.50, actual 71.68 (+16.18). Awaiting human merge. + +## Resolution + +Delivered via [PR #212](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/212) and merged into `main` +(`b6e46e0b`): + +- **Key Architectural Deliverables**: new `worktree_head.py` with `reattach_branch`/`restore_branch`, wired into + `flow/stages/review.py` and `entrypoint/review_loop.py`. The review stage restores the execution branch on exit, and a + HEAD detached at the branch tip is re-attached instead of refused. +- **Verification & Tests**: hermetic tests `test_review_keeps_branch.py`, `test_review_loop_worktree_head.py` and + `test_worktree_head.py` assert the worktree is on the execution branch after a review iteration. +- **Holon Flow Traversal**: all 5 stages completed (flow `review-keeps-worktree-on-branch`). Stage 3 waited out overlaps + (PR #210, then `refresh-plan-after-overlap-wait`) and was admitted on a refreshed plan; Stage 4 reached 3/3 consensus + at iteration 3; calibration EV 55.50 -> 71.68. First flow whose plan branch was refreshed onto `main` after an overlap + wait, with no merge conflict. diff --git a/.beans/holon-agentic-coder-ref-metadata-0337--a-flow-refused-at-stage-3-admission-counts-as-in-flight.md b/.beans/holon-agentic-coder-ref-metadata-0337--a-flow-refused-at-stage-3-admission-counts-as-in-flight.md index 626f0ba..57dea80 100644 --- a/.beans/holon-agentic-coder-ref-metadata-0337--a-flow-refused-at-stage-3-admission-counts-as-in-flight.md +++ b/.beans/holon-agentic-coder-ref-metadata-0337--a-flow-refused-at-stage-3-admission-counts-as-in-flight.md @@ -1,7 +1,7 @@ --- # holon-agentic-coder-ref-metadata-0337 title: "A flow refused at Stage 3 admission still counts as in flight, so two waiting flows block each other forever" -status: in-progress +status: completed type: bug priority: high tags: @@ -11,7 +11,7 @@ tags: - concurrency - holon-agentic-coder created_at: 2026-11-20T11:30:00+11:00 -updated_at: 2026-11-20T12:45:00+11:00 +updated_at: 2026-11-20T15:37:23+11:00 --- ## Problem @@ -67,3 +67,33 @@ Through the Holon flow on `holon-agentic-coder`: each list the other as in flight, both checkpoints sit at `execute` with no executor run, and both runners re-check every 300 s forever. Deadlock; neither runner stopped. Breaking it needs a maintainer decision (e.g. admit `resumetip` with `--allow-overlap`, or stop `blockedflow` until `resumetip` opens its PR). Log: `todo/flow-blockedflow.log`. +- 2026-11-20 (14:44): The deadlock was broken outside this flow: `resumetip` opened PR #208, which merged, and + `blockedflow` was admitted at 14:28. Stage 3 finished in 15.7 min (4471 tests passed) and pushed + `I-1795138413-blockedflow/P-1795138429-CLA-CO5.5/E-1795145288-CLA-CO5.5/_` (e30ac9fe). The executor started from the + plan tip cabbebff, which was cut before #207 and #208 merged, so the branch conflicts with origin/main in + `flow_module_budgets.json`, `flow/__init__.py`, `flow/admission.py`, `tests/flow/stages/test_decomposition.py` and + `tests/flow/test_admission.py`. Stage 4 stopped at once ("Unresolvable merge conflicts detected in stage 'review'"). + No PR is open yet. Blocked: merge origin/main into the execution branch, deciding how the `admission.py` and + `__init__.py` changes from #208 combine with the new admission-state code, then resume with `--checkpoint`. + +## Resolution + +Delivered via [PR #209](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/209) and merged into `main` +(`7dc0342`) on 2026-11-20: + +- **Blocked admission state**: a Stage 3 admission refusal for a touch-set overlap records + `admission: {state: "blocked", blocked_by: [...], blocked_since: }`. Each `blocked_by` entry names its kind + and reference (pull request or local flow) and the overlapping files. An admitted flow records `state: "admitted"`. +- **Only admitted flows are in flight**: `local_in_flight_flows` skips checkpoints whose admission state is `blocked`, + so a blocked flow blocks no one and no admission cycle can form. A flow with an open pull request stays in flight. +- **Per-repository admission lock**: admission runs under a file lock in the shared git directory, held from the check + until the admitted state is recorded. When several blocked flows are clear, the oldest `blocked_since` is admitted + first. +- **Readable by tools**: blocked flows and their blockers are visible in the checkpoint and `holon flow status`, so the + harness runner polls the named references and re-checks when they change. +- **Verification & Tests**: hermetic tests for mutual overlap, simultaneous retries admitting exactly one flow, blocked + flows excluded from in-flight lists, and `blocked_by` write and clear. The flow's Stage 3 run passed 4471 tests (see + Progress). +- **Holon Flow Traversal**: the `blockedflow` flow ran Stage 1 to Stage 3 (admitted 2026-11-20 14:28 local time after + the overlapping flows merged), then its execution branch was merged with `origin/main` by hand and merged through PR + #209. diff --git a/.beans/holon-agentic-coder-ref-metadata-0338--admitted-flow-executes-from-stale-plan-branch.md b/.beans/holon-agentic-coder-ref-metadata-0338--admitted-flow-executes-from-stale-plan-branch.md new file mode 100644 index 0000000..f2b2942 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0338--admitted-flow-executes-from-stale-plan-branch.md @@ -0,0 +1,92 @@ +--- +# holon-agentic-coder-ref-metadata-0338 +title: + "A flow admitted after waiting out an overlap executes from a stale plan branch and conflicts with the PR it waited + for" +status: completed +type: bug +priority: high +tags: + - flow + - stage-3 + - admission + - concurrency + - holon-agentic-coder +created_at: 2026-11-20T16:55:00+11:00 +updated_at: 2026-11-20T18:08:00+11:00 +--- + +## Problem + +Seen on the `blockedflow` flow (Bean 0337, PR #209), 2026-11-20. The flow was refused at Stage 3 because its touch set +overlapped PR #207 and then PR #208, and the harness runner waited both out. When #208 merged, Stage 3 admitted the flow +and the executor started from the plan tip `cabbebff`, which was cut from `main` before #207 and #208 merged. Stage 3 +passed (4471 tests), but Stage 4 stopped at once with "Unresolvable merge conflicts detected in stage 'review'" on five +files (`flow_module_budgets.json`, `flow/__init__.py`, `flow/admission.py`, `tests/flow/stages/test_decomposition.py`, +`tests/flow/test_admission.py`), and a resolve-conflict pass had to merge `origin/main` by hand before the flow could +resume. + +This is not bad luck: a flow only waits on a pull request because it touches the same files, so executing from the old +plan base guarantees a conflict with exactly the change it waited for. The executor also writes code against a version +of those files that no longer exists on `main`. + +## Decision (maintainer, 2026-11-20) + +After waiting out an overlap, the flow updates its plan branch from `origin/main` before Stage 3 executes. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- **Refresh the plan branch on admission.** When Stage 3 admits a flow whose checkpoint records an earlier blocked state + (Bean 0337's `admission.state` went from `blocked` to `admitted`), fetch `origin` and merge `origin/main` into the + plan branch before the executor branch is cut. Merge, never rebase: plan branches are pushed and must not be + rewritten. Push the updated plan branch. +- **Ledgers merge mechanically.** Conflicts in the three append-only ledgers are resolved by interleaving rows by + `created_at`; the plan markdown and other plan files keep the plan side unless `main` changed them. +- **Stop cleanly on a real conflict.** A conflict outside the ledgers stops Stage 3 before dispatch with a message + naming the files, and the checkpoint stays resumable; nothing is executed against a half-merged tree. +- **Record it.** The executions ledger row (or the checkpoint) notes the `main` commit the plan branch was refreshed to, + so calibration can tell a refreshed base from the original one. +- **Hermetic tests:** a blocked-then-admitted flow gets `origin/main` merged into its plan branch before execution; a + flow admitted on the first try is not touched; a ledger-only conflict is resolved by `created_at`; a code conflict + stops before dispatch with a resumable checkpoint. + +## Notes + +- Related: Bean 0337 (blocked admission state, PR #209), Bean 0335 (resume from the execution branch tip, PR #208), Bean + 0264 (`flow_module_budgets.json` makes most flows overlap). The harness runner's overlap wait + (`.agents/skills/holon_flow/scripts/run_holon_flow.py`) needs no change: it resumes from the checkpoint, and Stage 3 + does the refresh. + +## Progress + +- 2026-11-20 16:55 (+11:00): Holon flow `refresh-plan-after-overlap-wait` started (claude-agent, claude-opus-5-5) in + worktree `apps/holon-agentic-coder/flow-refresh-plan-after-overlap-wait`, concurrently with the + `review-keeps-worktree-on-branch` and `planner-api-error-not-a-plan` flows. +- 2026-11-20 18:01 (+11:00): Flow completed all 5 stages; PR #211 + (https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/211) MERGEABLE/CLEAN, CI 11/11 green, consensus + APPROVED 3/3 at review iteration 2, calibration report in the PR diff. Stage 3 waited out PR #210 (blocked admission), + executed 12.4 min; Stage 4 first stopped on the expected stale-base conflict in `flow_module_budgets.json`, resolved + by merging `origin/main` (description texts combined, ledgers interleaved, lint and 4620 tests green, merge commit + 12ec758) and resumed from the checkpoint. EV predicted 44.16, actual -18.21 (calibration scored P(success) 0.00 and + impact 0 despite approval and green CI). Awaiting human merge. + +## Resolution + +Delivered via [PR #211](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/211) and merged into `main` +(`1610809`, squash commit `16108098`): + +- **Key Architectural Deliverables**: `flow/plan_refresh.py` merges `origin/main` into the plan branch on Stage 3 + admission after a blocked wait, before the execution branch is cut. Ledger-only conflicts are interleaved by + `created_at`; any other conflict aborts the merge and stops Stage 3 before dispatch, naming the files, with a + resumable checkpoint. The refreshed target commit is recorded as a `plan_refresh` row and as `refreshed_to` in the + checkpoint's admission object. A first-check admission is unchanged. +- **Verification & Tests**: hermetic tests for the blocked-then-admitted refresh, the first-try no-op, ledger-only + resolution by `created_at`, and the resumable code-conflict stop. CI 11/11 green; consensus APPROVED 3/3 at review + iteration 2. +- **Holon Flow Traversal**: all 5 stages completed. Stage 3 waited out PR #210. Stage 4 stopped on the expected + stale-base conflict in `flow_module_budgets.json`. That run predates the refresh code, so the conflict was resolved by + hand: `origin/main` (refreshed main commit `30d7c77c`, PR #210) merged at `12ec758`, then resumed from the checkpoint. +- **Calibration caveat**: the calibration EV (predicted 44.16, actual -18.21) is wrong because of the bug in Bean 0339 + (P(success) scored 0.00 and impact 0 despite approval and green CI). Do not use that EV as a signal. diff --git a/.beans/holon-agentic-coder-ref-metadata-0339--calibration-scores-approved-flow-failed-after-sync-conflict.md b/.beans/holon-agentic-coder-ref-metadata-0339--calibration-scores-approved-flow-failed-after-sync-conflict.md new file mode 100644 index 0000000..99bad82 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0339--calibration-scores-approved-flow-failed-after-sync-conflict.md @@ -0,0 +1,81 @@ +--- +# holon-agentic-coder-ref-metadata-0339 +title: "Calibration scores an approved flow as failed when Stage 3 recorded a sync conflict that was later resolved" +status: completed +type: bug +priority: high +tags: + - flow + - calibration + - ledger + - holon-agentic-coder +created_at: 2026-11-20T18:05:00+11:00 +updated_at: 2026-11-20T19:25:00+11:00 +--- + +## Problem + +PR #211 (`refresh-plan-after-overlap-wait`, 2026-11-20) has 3/3 approval and green CI, yet calibration recorded actual +P(success) 0.00 and impact 0.00, so actual EV -18.21 against 44.16 predicted. Confirmed cause, from the flow's +`executions.jsonl` summary rows for plan `…/P-1795154100-CLA-CO5.5/_`: + +| created_at | status | ledger_revision | +| ---------- | ------------------ | --------------- | +| 06:24:05 | `success` | 1 | +| 06:36:07 | `sync_conflict` | 2 | +| 06:52:16Z | `halted_for_human` | (absent → 1) | + +`evaluate_dual_ev_outcomes` (`calibration_ev.py`) sorts the matching rows by `(ledger_revision, created_at)` and takes +the last as the final outcome. Stage 3's `sync_conflict` row carries `ledger_revision: 2`; Stage 4's `halted_for_human` +consensus row carries none and defaults to 1, so the earlier conflict row outranks the later approval. It is not +converged, so `p_clean` and the impact drop to 0. `has_failure` also counts the resolved `sync_conflict` row as a +failure, zeroing the observed EV as well. + +The same pattern fits the other negative calibrations today: `resumetip` (PR #208, 39.61 → -19.01) and `blockedflow` (PR +#209, 35.30 → -22.11) both stopped on a sync conflict before review, while `planner-api-error-not-a-plan` (PR #210) had +none and scored 53.40 → 73.52. The calibration record has been systematically wrong for every flow that hit a merge +conflict, which also corrupts the planner's EV feedback. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- The final outcome is the latest summary row in flow order: every summary row the flow writes (Stage 3 and Stage 4 + alike) carries a consistent `ledger_revision`, or the selection orders by `created_at` when revisions are not + comparable. A Stage 4 consensus row after a Stage 3 `sync_conflict` row is the final outcome. +- A `sync_conflict` that a later row supersedes (the branch was merged and review converged) is not a failure for the + observed EV; an unresolved one still is. +- Normalise `created_at` to one format (`+00:00` vs `Z` are both written today). +- Hermetic tests: `success` → `sync_conflict` → `halted_for_human` scores as converged with full impact; an unresolved + `sync_conflict` as the last row scores as failed; the observed EV is not zeroed by a superseded conflict. +- Do not rewrite the append-only ledgers; past calibration reports stay as written. + +## Notes + +- Related: Bean 0338 (refreshing the plan branch removes most of these conflicts at the source), Bean 0264. + +## Progress + +- 2026-11-20 18:53 (+11:00): Holon flow started (`calibration-final-row-by-time`, claude-agent / claude-opus-5-5) in + worktree `flow-calibration-final-row-by-time`. +- 2026-11-20 19:22 (+11:00): All 5 stages done. PR #213 + (https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/213) 3/3 approved at review iteration 2 (iteration 1 + docs CHANGES resolved: `docs/ledger_schema.md`), EV predicted 52.10 / actual 63.28 (+11.18), calibration report in PR + diff, MERGEABLE/CLEAN, all checks green. New module `calibration_outcome.py` (outside the flow package; first + execution re-planned once to widen the touch set); `flow_module_budgets.json` untouched. Awaiting human merge. + +## Resolution + +Delivered via [PR #213](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/213) and merged into `main` +(`a450005`): + +- **Key Architectural Deliverables**: calibration orders a flow's summary rows by parsed `created_at` (`+00:00` and `Z` + both accepted), with `ledger_revision` only as a tie-break, so the Stage 4 consensus row after a Stage 3 + `sync_conflict` row is the final outcome. A `sync_conflict` that a later row supersedes no longer counts as a failure + for the observed EV; an unresolved one still does. The selection lives in a new `calibration_outcome.py` outside the + flow package. `flow_module_budgets.json` is untouched. Append-only ledgers were not rewritten. +- **Verification & Tests**: hermetic tests in `test_calibration_ev.py` cover `success` → `sync_conflict` → + `halted_for_human` scoring as converged with full impact, an unresolved `sync_conflict` as the last row scoring as + failed, and a superseded conflict not zeroing the observed EV. +- **Holon Flow Traversal**: all 5 stages completed (Intent → Plan → Execute → Review Loop → Calibration). Review + approved 3/3 at iteration 2. Calibration: expected value predicted 52.10, actual 63.28 (delta +11.18). diff --git a/.beans/holon-agentic-coder-ref-metadata-0340--revisit-module-budget-default-200-no-overrides.md b/.beans/holon-agentic-coder-ref-metadata-0340--revisit-module-budget-default-200-no-overrides.md new file mode 100644 index 0000000..2f7ff64 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0340--revisit-module-budget-default-200-no-overrides.md @@ -0,0 +1,95 @@ +--- +# holon-agentic-coder-ref-metadata-0340 +title: "Revisit the module budget: implications of a strict 200-line default with no overrides" +status: draft +type: task +priority: high +tags: + - flow + - lint + - configuration + - refactoring + - holon-agentic-coder +created_at: 2026-11-20T19:30:00+11:00 +updated_at: 2026-11-20T19:30:00+11:00 +--- + +## Context + +Bean 0264 (flow `freeze-module-budgets-split`) moves the module budgets to `holon-config/hygiene/module_budgets.json` +with a 200-line default and freezes them: every existing value becomes an override, copied unchanged, and nothing +changes without the maintainer's explicit instruction. The maintainer wants to revisit that end state: what it would +take, and what it would cost, to keep only the 200-line default and get rid of the overrides. + +This bean is an analysis and decision record first. Removing or changing any override is a budget change, so each step +that comes out of it needs the maintainer's explicit instruction (Bean 0264's `module_budget_change` authorisation). + +## Facts (measured 2026-11-20 on `main` `a450005`) + +- **Every override sits exactly at its module's current size.** None has headroom, so from Bean 0264 on, adding one line + to any of these 22 modules already forces a split. +- **Covered today: only `sandbox_executor/flow/`**, 71 modules, 22 of them over 200 lines (3,331 lines above the + ceiling). Bringing all 22 under 200 needs at least 30 new modules (each file split into ⌈lines / 200⌉ parts): + +| Module (under `flow/`) | Lines | Parts at ≤ 200 | +| ------------------------- | ----- | -------------- | +| `review/loop.py` | 952 | 5 | +| `__init__.py` | 562 | 3 | +| `github/pr.py` | 515 | 3 | +| `pipeline.py` | 431 | 3 | +| `stages/execute.py` | 431 | 3 | +| `git_refs.py` | 407 | 3 | +| `stages/calibrate.py` | 349 | 2 | +| `github/ci_final_head.py` | 344 | 2 | +| `github/merge.py` | 343 | 2 | +| `stages/children.py` | 330 | 2 | +| `review/resolver.py` | 319 | 2 | +| `review/records.py` | 316 | 2 | +| `stages/review.py` | 305 | 2 | +| `calibrate_rerun.py` | 287 | 2 | +| `context.py` | 280 | 2 | +| `in_flight.py` | 233 | 2 | +| `checkpoint.py` | 228 | 2 | +| `partial_salvage.py` | 226 | 2 | +| `ledger_reconcile.py` | 224 | 2 | +| `stages/intent.py` | 220 | 2 | +| `github/review_post.py` | 216 | 2 | +| `stages/plan.py` | 213 | 2 | + +- **Not covered: the rest of `sandbox_executor`**, 101 more modules, of which 39 are over 200 lines and unbudgeted. The + largest are `cli/__init__.py` (1,755), `calibration.py` (1,638), `entrypoint/executor.py` (1,584), + `token_reduction/mitm_addon.py` (1,358), `review_ensemble.py` (1,055), `local_llm.py` (1,049), `ledger.py` (1,035) and + `git_flow.py` (1,008). Extending the check to the whole package with no overrides would fail on 61 modules. + +## Questions to answer + +1. **One-shot or incremental?** Dropping all overrides at once fails lint on 22 modules, so it needs one very large + refactor whose touch set overlaps nearly every other flow (it would block or conflict with all concurrent work). The + alternative is one split per module (or per cluster), each removing its own override with explicit authorisation, run + sequentially and ordered by size or churn. +2. **Is 200 the right ceiling for every kind of module?** `flow/__init__.py` (562) is mostly re-exports; + `review/loop.py` (952) is one state machine. Decide whether package `__init__` files, re-export lists or generated + code are measured differently or excluded. +3. **What is counted?** Physical lines include docstrings, comments and blank lines, so a strict ceiling rewards + stripping documentation (compare Bean 0153). Consider counting logical lines (statements) or excluding docstrings and + comments, and decide before any split work. +4. **Which packages are in scope?** Only `flow/` today. Decide whether and when `cli/`, `entrypoint/`, + `token_reduction/` and the top-level modules join, and whether they start frozen at current size (as `flow/` does) or + must be split first. +5. **Cost to everyday work.** With zero headroom, small fixes in the 22 large modules now carry a split. Estimate the + effect on plan size, EV and review load; consider whether the planner should schedule pending splits explicitly + rather than fold them into unrelated fixes. +6. **Concurrency.** Each split moves code and touches every importer and its tests, so split flows overlap each other + and most feature flows at Stage 3. Decide an order and whether splits run as a dedicated, serial lane. +7. **Tests.** Test modules are not budgeted. Decide whether they should be. + +## Deliverable + +A short decision written into this bean (maintainer-approved): the ceiling, what is counted, the packages in scope, the +order of splits, and whether overrides go away entirely or remain as a frozen exception list. Then one follow-up bean +per split (or cluster) carrying the explicit authorisation to remove its override. + +## Notes + +- Depends on Bean 0264 merging (the configuration file and the freeze must exist first). +- Related: Bean 0153 (comments and docstrings), Bean 0264. diff --git a/.beans/holon-agentic-coder-ref-metadata-0341--failed-resume-clobbers-checkpoint.md b/.beans/holon-agentic-coder-ref-metadata-0341--failed-resume-clobbers-checkpoint.md new file mode 100644 index 0000000..04276f4 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0341--failed-resume-clobbers-checkpoint.md @@ -0,0 +1,59 @@ +--- +# holon-agentic-coder-ref-metadata-0341 +title: "A flow resumed with --from-stage and no context fails and overwrites the good checkpoint with empty branches" +status: completed +type: bug +priority: high +tags: + - flow + - checkpoint + - resume + - holon-agentic-coder +created_at: 2026-11-20T20:40:00+11:00 +updated_at: 2026-11-20T23:01:25+11:00 +--- + +## Problem + +Seen on the `freeze-module-budgets-split` flow (Bean 0264, PR #214), 2026-11-20. After a conflict resolution the flow +was rerun with `holon flow --from-stage review` and no `--checkpoint`. It failed at once with "Cannot run +Review stage without an active execution_branch" and saved a checkpoint with empty intent, plan, execution and +calibrated branch fields over the completed one. The subagent had to rebuild the branch names by hand (damaged copy kept +as `checkpoint-freeze-module-budgets-split.json.clobbered.bak`). After the resumed run the checkpoint also showed +`current_stage: intent` with only review and calibrate listed as completed. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- `--from-stage` without `--checkpoint` loads the existing checkpoint for the intent's slug in the target worktree when + there is one, instead of starting from an empty context. +- A run that fails before its first stage does any work never overwrites an existing checkpoint; it leaves it as it was. +- A resumed run keeps the earlier completed stages and the correct `current_stage` in the checkpoint. +- Hermetic tests for all three. + +## Notes + +- Harness side: `run_holon_flow.py` can also pass the existing checkpoint itself when only `--from-stage` is given. + +## Progress + +- 2026-11-20: Flow `resume-keeps-checkpoint-intact` started (claude-agent, claude-opus-5-5) in worktree + `apps/holon-agentic-coder/flow-resume-keeps-checkpoint-intact`. +- 2026-11-20: Flow completed all 5 stages. PR #217 (3/3 consensus at review iteration 1), calibration in the PR diff, + predicted EV 43.47, actual 59.47 (+16.00); MERGEABLE/CLEAN, checks green; awaiting human merge. +- 2026-11-20: PR #217 merged into `main` (`e80b00c`); flow branch and worktree pruned. + +## Resolution + +Delivered via [PR #217](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/217) and merged into `main` +(`e80b00c`): + +- **Key Architectural Deliverables**: + - `--from-stage` without `--checkpoint` loads the existing checkpoint for the intent's slug from the target worktree + (`checkpoint_discovery.py`) instead of starting from an empty context. + - `resume_guard.py` keeps a run that fails before any stage work from overwriting the existing checkpoint. + - `_flow_resume.py` keeps the earlier completed stages and the correct `current_stage` in a resumed run's checkpoint. +- **Verification & Tests**: Hermetic tests for all three behaviours; PR checks green. +- **Holon Flow Traversal**: All 5 stages completed (Intent -> Plan -> Execute -> Review Loop -> Calibration). Consensus + approval at review iteration 1; predicted EV 43.47, actual EV 59.47 (+16.00). diff --git a/.beans/holon-agentic-coder-ref-metadata-0342--calibration-promoted-count-is-cumulative.md b/.beans/holon-agentic-coder-ref-metadata-0342--calibration-promoted-count-is-cumulative.md new file mode 100644 index 0000000..2c8957d --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0342--calibration-promoted-count-is-cumulative.md @@ -0,0 +1,53 @@ +--- +# holon-agentic-coder-ref-metadata-0342 +title: "Stage 5 logs a running total of promoted knowledge candidates as if this flow promoted them" +status: completed +type: bug +priority: low +tags: + - flow + - calibration + - knowledge + - logging + - holon-agentic-coder +created_at: 2026-11-20T20:40:00+11:00 +updated_at: 2026-11-20T23:35:00+11:00 +--- + +## Problem + +Stage 5 logs "Stage 5 promoted N knowledge/wisdom candidate(s)" (`flow/stages/calibrate.py`, about line 297) using the +length of whatever `promote_pending_candidates` returns. That function goes through every qualifying candidate in +`holon-knowledge/.index/action_index.db` (at least 2 trials), so N is a running total: on 2026-11-20 it climbed across +flows (576, 587, 593, …, 632, 640) while one flow actually added about 11 failure-mode files. + +## Action + +Through the Holon flow on `holon-agentic-coder`: log only the candidates this run newly promoted (and, separately if +useful, the total), with a hermetic test. Check that promotion itself is not repeating work on already promoted +candidates on every flow. + +## Progress + +- 2026-11-20: Holon flow started (slug `promoted-count-this-run-only`, claude-agent / claude-opus-5-5, worktree + `apps/holon-agentic-coder/flow-promoted-count-this-run-only`). +- 2026-11-20: Flow complete. PR #216 (https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/216) APPROVED 3/3 + at review iteration 6, calibration report in the PR diff, EV predicted 40.70 / actual 53.52 (+12.82), MERGEABLE/CLEAN, + all checks green; awaiting human merge. Stage 3 waited about 1 h 45 min on the overlap with PR #215. Stage 4 stopped + once on a ledger-only conflict with main (plans/executions.jsonl), which was resolved by merging origin/main (lint and + 4801 tests pass) before resuming. Finding: promotion already wrote files idempotently but re-evaluated every promoted + candidate on every run; it now skips candidates whose artefacts exist, and Stage 5 logs only this run's new + promotions. + +## Resolution + +Delivered via [PR #216](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/216) and merged into `main` +(`eaaabaa`): + +- **Key Architectural Deliverables**: Stage 5 logs only the candidates this run newly promoted. Promotion skips + candidates whose artefacts already exist instead of re-evaluating every promoted candidate on each run. A new + `flow/calibrate_promotion.py` keeps the promotion budgets unchanged. +- **Verification & Tests**: hermetic tests `test_calibrate_promoted_count.py` and `test_promotion_idempotence.py`, plus + CLI coverage in `test_promote_cli.py`. +- **Holon Flow Traversal**: all 5 stages completed (Intent -> Plan -> Execute -> Review Loop -> Calibration), approved + 3/3 at review iteration 6. Calibration: expected value 40.70, actual 53.52. diff --git a/.beans/holon-agentic-coder-ref-metadata-0343--test-writes-checkpoint-into-real-worktree.md b/.beans/holon-agentic-coder-ref-metadata-0343--test-writes-checkpoint-into-real-worktree.md new file mode 100644 index 0000000..dff4c1f --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0343--test-writes-checkpoint-into-real-worktree.md @@ -0,0 +1,48 @@ +--- +# holon-agentic-coder-ref-metadata-0343 +title: "A test writes checkpoint-parent.json into the real flow worktree instead of a temporary directory" +status: completed +type: bug +priority: normal +tags: + - tests + - isolation + - checkpoint + - holon-agentic-coder +created_at: 2026-11-20T20:40:00+11:00 +updated_at: 2026-11-20T22:40:00+11:00 +--- + +## Problem + +On 2026-11-20 a `uv run pytest` run inside the `flow-freeze-module-budgets-split` worktree left a stray +`.holon/flow/checkpoint-parent.json` (`intent_slug: "parent"`) in the worktree. Some test saves a checkpoint relative to +the current directory or the real repository instead of `tmp_path`, so running the suite can leave or overwrite state +that a live flow reads. + +## Action + +Through the Holon flow on `holon-agentic-coder`: find the test(s) writing `checkpoint-parent.json` (likely the +decomposition or children tests), make them write under `tmp_path`, and add a guard (an autouse fixture or a session +check) that fails the run if any test creates files under the repository's `.holon/`. + +## Progress + +- 2026-11-20: Holon flow `tests-never-write-real-worktree` started (claude-agent, claude-opus-5-5) in worktree + `flow-tests-never-write-real-worktree`. +- 2026-11-20: Flow completed all 5 stages. PR #215 (https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/215) + approved 3/3 at review iteration 2; calibration report in PR diff; EV predicted 46.57, actual 62.39; MERGEABLE/CLEAN, + all checks green. Awaiting human merge. + +## Resolution + +Delivered via [PR #215](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/215) and merged into `main` +(`c3c0471`): + +- **Key Architectural Deliverables**: decomposition tests now write under `tmp_path` through + `tests/flow/decomposition_fakes.py`, so no test saves a checkpoint relative to the real worktree. + `tests/holon_dir_guard.py` is hooked in `conftest.py` and fails the session on any write under `.holon/`. +- **Verification & Tests**: guard covered by `tests/test_holon_dir_guard.py`; isolation rules documented in + `docs/hermetic_testing.md`. +- **Holon Flow Traversal**: all 5 stages completed (Intent -> Plan -> Execute -> Review Loop -> Calibration); approved + 3/3 at review iteration 2. Calibration: expected value 46.57, actual 62.39. diff --git a/.beans/holon-agentic-coder-ref-metadata-0344--add-ghostty-warp-casks-ghostty-config-and-zsh-word-jump.md b/.beans/holon-agentic-coder-ref-metadata-0344--add-ghostty-warp-casks-ghostty-config-and-zsh-word-jump.md new file mode 100644 index 0000000..3d11ea9 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0344--add-ghostty-warp-casks-ghostty-config-and-zsh-word-jump.md @@ -0,0 +1,69 @@ +--- +# holon-agentic-coder-ref-metadata-0344 +title: "Install Ghostty and Warp on macOS and Linux, add Stow-managed Ghostty config, and Zsh word-jump bindings" +status: completed +type: feature +priority: normal +tags: + - dev-env + - macos + - linux + - ghostty + - warp + - zsh + - tmux +created_at: 2026-11-20T23:17:00+11:00 +updated_at: 2026-11-20T23:50:00+11:00 +--- + +## Problem + +1. Ghostty and Warp are installed manually outside `dev-env`, even though `dev-env` already manages GUI tools via + `devenv_install_gui_casks` and `ansible/vars/os_Darwin.yml` (`devenv_casks`), and should install both terminals on + macOS and Linux (Ubuntu/Debian `apt`, amd64 and arm64). +2. Ghostty's macOS default keybinds map `alt+arrow_left=esc:b` and `alt+arrow_right=esc:f`, which intercepts + `Option+Left` / `Option+Right` before tmux sees `M-Left` / `M-Right` — breaking horizontal `prefix Option+Arrow` pane + resizing in Ghostty while Warp passes standard CSI `\e[1;3D` / `\e[1;3C`. +3. Unlike Fish and Bash (Readline), Zsh does not bind CSI `\e[1;3D` / `\e[1;3C` (`Alt+Left` / `Alt+Right`) or `\e[1;5D` + / `\e[1;5C` (`Ctrl+Left` / `Ctrl+Right`) to `backward-word` / `forward-word` by default, so word-jumping fails in Zsh + under Warp, unbundled Ghostty, Linux terminals, and tmux. + +## Action + +Through the Holon flow on `dev-env`: + +- **macOS**: add `ghostty` and `warp` to `devenv_casks` in `ansible/vars/os_Darwin.yml` (gated by + `devenv_install_gui_casks`). +- **Linux (Ubuntu/Debian, amd64 & arm64)**: keep `devenv_casks: []` in `ansible/vars/os_Linux.yml` and add + `devenv_linux_gui_apps: [ghostty, warp]` (default `[]` in `ansible/group_vars/all.yml`), installed in + `ansible/roles/packages/tasks/main.yml` when `devenv_pkg_backend == 'apt'` and `devenv_install_gui_casks | bool`: + - **Warp (`warp-terminal`)**: configure the official Warp APT keyring (`/etc/apt/keyrings/warpdotdev.gpg` from + `https://releases.warp.dev/linux/keys/warp.asc`) and source list + (`deb [arch= signed-by=/etc/apt/keyrings/warpdotdev.gpg] https://releases.warp.dev/linux/deb stable main`), + then install `warp-terminal` via `apt` if not already installed. + - **Ghostty (`ghostty`)**: if `ghostty` is missing, install via native `apt` when available (`apt-cache show ghostty`, + Ubuntu 26.04+), else via `snap install ghostty --classic` when `snap` is present, else on Ubuntu via + `ppa:mkasberg/ghostty-ubuntu` + `apt`. +- **Wizard & README**: prompt for `devenv_install_gui_casks` on both `brew` and `apt` backends in + `scripts/devenv_wizard.py` and document Ghostty & Warp on macOS and Linux in `README.md`. +- **Ghostty Stow package**: add `dotfiles/ghostty/.config/ghostty/config.ghostty` (registered in `devenv_stow_packages` + and `devenv_links` in `ansible/group_vars/all.yml`) containing `keybind = alt+arrow_left=unbind` and + `keybind = alt+arrow_right=unbind`. +- **Zsh word-jump parity**: add interactive-guarded (`[[ -o interactive ]]`) `bindkey` entries in `dotfiles/zsh/.zshrc` + for `^[[1;3D`/`^[[1;3C` (`Alt+Left/Right`) and `^[[1;5D`/`^[[1;5C` (`Ctrl+Left/Right`) to + `backward-word`/`forward-word`, preserving existing `^[b`/`^[f`. +- **Tests**: add hermetic pytest coverage for macOS casks, Linux GUI apps config and Ansible tasks, Ghostty Stow + manifest/config, wizard prompt on both `brew` and `apt`, and Zsh word-jump bindings. + +## Resolution + +Delivered via [PR #31](https://github.com/thomashan/dev-env/pull/31) and merged into `main` +(`0ba3e94a9213a8054759cdce337b7d554c6e06f5`): + +- **Key Architectural Deliverables**: Added macOS Homebrew casks for Ghostty and Warp, Linux APT installation tasks for + Warp terminal (with official GPG keyring and repository) and Ghostty (native apt, snap, or PPA fallback), Stow-managed + Ghostty configuration unbinding alt+arrow keys for tmux pane resizing compatibility, Zsh interactive word-jump key + bindings for Alt+Left/Right and Ctrl+Left/Right, and wizard/README updates. +- **Verification & Tests**: Hermetic pytest coverage successfully verified across all modules. +- **Holon Flow Traversal**: All 5 stages (Intent -> Plan -> Execution -> Review Loop -> Calibration with EV realization + actual 91.04 vs predicted 89.36) completed successfully. diff --git a/.beans/holon-agentic-coder-ref-metadata-0345--review-loop-leaves-ledger-rows-uncommitted.md b/.beans/holon-agentic-coder-ref-metadata-0345--review-loop-leaves-ledger-rows-uncommitted.md new file mode 100644 index 0000000..b215c4e --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0345--review-loop-leaves-ledger-rows-uncommitted.md @@ -0,0 +1,62 @@ +--- +# holon-agentic-coder-ref-metadata-0345 +title: "The review loop leaves executions ledger rows uncommitted in the flow worktree" +status: completed +type: bug +priority: normal +tags: + - flow + - stage-4 + - review-loop + - ledger + - holon-agentic-coder +created_at: 2026-11-20T20:40:00+11:00 +updated_at: 2026-11-21T11:58:32+11:00 +--- + +## Problem + +On 2026-11-20 the `promoted-count-this-run-only` flow (PR #216) reached a Stage 4 merge conflict with 56 review-loop +rows written to `holon-knowledge/ledger/executions.jsonl` in the flow worktree but never committed. The subagent had to +set them aside, merge `origin/main`, and append them back by hand. The same pattern appeared earlier on the `shortref` +flow (PR #206), where uncommitted review ledger rows had to be kept by hand while re-attaching the branch. Rows that are +not committed are lost if the worktree is reset or removed, block a clean merge, and only reach the PR when someone +handles them. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- The review loop commits the ledger rows it writes at the end of each iteration (one commit per iteration, ledger files + only, no co-author trailer) and pushes with the iteration's other changes, so the worktree is clean between + iterations. +- Before a merge with the target branch (the conflict gate) and before Stage 5, any pending ledger rows are committed + first. +- A stage exit (success, halt or failure) never leaves ledger files modified in the worktree. +- Hermetic tests: after a review iteration the worktree is clean and the rows are in the last commit; a conflict merge + starts from a clean tree; a failed iteration still commits its rows. + +## Notes + +- Keep exactly the three ledgers; rows are append-only. +- Related: Bean 0336 (review keeps the worktree on its branch), Bean 0213 (conflict gate in the review loop). + +## Progress + +- 2026-11-21: started; flow `review-commits-ledger-rows` launched (claude-agent, claude-opus-5-5). +- 2026-11-21: flow done; PR #224 approved 3/3 at iteration 5, calibrated (EV 63.70 predicted, -7.11 actual), CLEAN and + mergeable; awaiting human merge. + +## Resolution + +Delivered via [PR #224](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/224) and merged into `main` +(`c38a883`): + +- The review loop now commits its executions ledger rows each iteration, and again before the conflict merge and before + Stage 5, so no review ledger row stays uncommitted in the flow worktree. +- New modules `review/ledger_commit.py` (commits the pending ledger rows) and `review/git_identity.py` (commit identity + for those commits). +- The PR's own calibration (predicted EV 63.70, reported actual -7.11) is known wrong. Calibration read the ledger at + the reviewed commit `95a45bc`. That commit held the earlier 'failed' review summary row (committed by hand before a + conflict merge) but not the final approved row, which was still uncommitted. This PR's change closes that gap. +- Review approved 3/3 at iteration 5; hermetic tests cover the ledger commits, the conflict gate and the review loop. diff --git a/.beans/holon-agentic-coder-ref-metadata-0346--merge-repo-stow-packages-with-stale-choices-yml-and-test-upgrade.md b/.beans/holon-agentic-coder-ref-metadata-0346--merge-repo-stow-packages-with-stale-choices-yml-and-test-upgrade.md new file mode 100644 index 0000000..3c6ca1c --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0346--merge-repo-stow-packages-with-stale-choices-yml-and-test-upgrade.md @@ -0,0 +1,61 @@ +--- +# holon-agentic-coder-ref-metadata-0346 +title: "Merge repository devenv_stow_packages with stale choices.yml and add upgrade regression tests" +status: completed +type: bug +priority: high +tags: + - dev-env + - ansible + - dotfiles + - stow + - tests +created_at: 2026-11-20T23:52:00+11:00 +updated_at: 2026-11-21T12:35:00+11:00 +--- + +## Problem + +Running `make install` in `dev-env` after PR #31 added the new `ghostty` GNU Stow package failed at +`dotfiles : Assert the link manifest is fully satisfied`: + +- `ansible/roles/bootstrap/tasks/main.yml` loads `~/.config/dev-env/choices.yml` via `include_vars`, which overwrites + `devenv_stow_packages` with the stale list saved on an earlier run (`[bash, conda, fish, nvim-kickstart, tmux, zsh]` — + missing `ghostty`). +- Meanwhile `devenv_links` is not stored in `choices.yml` and comes fresh from `ansible/group_vars/all.yml` (which + includes `dotfiles/ghostty/.config/ghostty/config.ghostty`). +- As a result, `stow` never runs for newly added repository Stow packages on existing machines, and the post-stow + symlink assertion fails. +- CI and existing unit tests missed this because CI runs with no pre-existing `choices.yml` and only runs + `make check-mode` (which skips the post-stow symlink assertion), and no test simulated upgrading with a stale + `choices.yml`. + +## Action + +Through the Holon flow on `dev-env`: + +- In `ansible/roles/bootstrap/tasks/main.yml`, snapshot the repository's declared `devenv_stow_packages` (e.g. + `devenv_repo_stow_packages`) before `include_vars` loads `~/.config/dev-env/choices.yml`, and union it with the loaded + `devenv_stow_packages` when resolving active Stow packages (still subtracting `devenv_inactive_packages` for + non-selected Neovim variants and preserving `devenv_skip_links` omission in the `dotfiles` role). +- Add regression tests in `tests/` that run in `uv run --extra test pytest`: + 1. A real `ansible-playbook` test (using a temporary `HOME` pre-populated with a stale `~/.config/dev-env/choices.yml` + whose `devenv_stow_packages` omits newly added repo packages such as `ghostty` — and testing both default and + `nvim: minimal` variants plus `devenv_skip_links`) proving `bootstrap` resolves every package required by + `devenv_links` and, whenever `stow` is installed on `PATH`, proving a real non-check-mode `--tags dotfiles` + converge succeeds and creates every expected symlink (including `ghostty`). + 2. A verbatim Jinja `templar` test in `tests/test_templating.py` exercising the exact `Resolve active stow packages` + expression against a stale `choices.yml` package list. + +## Resolution + +Delivered via [dev-env PR #32](https://github.com/thomashan/dev-env/pull/32) and merged into `main` (`d6b07de`): + +- **Key Architectural Deliverables**: Snapshotting `devenv_repo_stow_packages` before loading + `~/.config/dev-env/choices.yml`, unioning active Stow packages while excluding inactive Neovim variants, asserting + active link manifest coverage in `bootstrap` and `dotfiles` roles, guarding `ansible/playbooks/unlink.yml`, and adding + Jinja templar + real `ansible-playbook` / GNU Stow upgrade regression tests in `tests/test_templating.py`. +- **Verification & Tests**: All unit, templating, and playbook upgrade tests passed successfully under + `uv run --extra test pytest`. +- **Holon Flow Traversal**: All 5 stages (Intent -> Plan -> Execute -> Review Loop -> Calibration) completed + successfully on `dev-env`. diff --git a/.beans/holon-agentic-coder-ref-metadata-0347--stage-4-reports-halted-for-human-after-consensus-approval.md b/.beans/holon-agentic-coder-ref-metadata-0347--stage-4-reports-halted-for-human-after-consensus-approval.md new file mode 100644 index 0000000..931419f --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0347--stage-4-reports-halted-for-human-after-consensus-approval.md @@ -0,0 +1,93 @@ +--- +# holon-agentic-coder-ref-metadata-0347 +title: + "Stage 4 reports 'halted for human review' after consensus approval although the flow continues and the PR is ready to + merge" +status: completed +type: bug +priority: normal +tags: + - flow + - stage-4 + - review-loop + - reporting + - holon-agentic-coder +created_at: 2026-11-21T01:20:00+11:00 +updated_at: 2026-11-23T02:37:31Z +--- + +## Problem + +When the Stage 4 ensemble reaches consensus approval, the flow carries on to Stage 5 (calibration) and ends with a pull +request that is approved and ready for the maintainer to merge. The output says the opposite: + +- the log prints `[SAFETY HALT] ... Pipeline halted for human review` (`flow/stages/review.py` around lines 282-295, + also `flow/review/cli.py` lines 77-78, `entrypoint/review_loop.py` lines 914-915 and `cli/commands/flow.py` lines + 336-337); +- the stage summary shows `review: halted` (`StageStatus.HALTED_FOR_HUMAN` and its label in `flow/context.py`), and the + review loop payload and ledger summary carry `status=halted_for_human` and `halted_for_human: true` + (`flow/review/loop.py` around lines 810 and 877). + +Nothing halts: the stage succeeded. The wording suggests the flow stopped for a human decision, which hides the real +state: approved, calibrated, waiting only for the maintainer's merge (a rule, not a halt). + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- Name the outcome for what it is: the log line and stage summary say approved and ready for maintainer merge (for + example `review: approved`), not halted. A real halt (a failed gate, a budget stop, no consensus) keeps the halt + wording. +- Use a status that says approved/ready for merge instead of `halted_for_human`. Readers of existing rows must keep + working: `calibration_outcome.py` and `flow/checkpoint.py` and `flow/stages/children.py` accept the old + `halted_for_human` value in historical ledger rows and checkpoints, and treat the new value as converged. +- Update the docstring in `flow/stages/review.py` ("halts unconditionally with status HALTED_FOR_HUMAN") and the flow + docs. +- Tests: a consensus approval logs the approved wording and shows no `SAFETY HALT`; a real halt still does; old + checkpoints and ledger rows with `halted_for_human` still resume and calibrate. + +## Notes + +- Keep exactly the three ledgers; rows stay append-only, so the old value is never rewritten. +- Touches `entrypoint/review_loop.py`, which open PR #219 edits slightly; start after it merges. Overlaps Bean 0345 and + 0192 on `flow/review/loop.py`. +- Related: Bean 0288 (posting only on a terminal exit), which this bean complements but does not reopen. + +## Progress + +- 2026-11-21: Started Holon flow `review-approved-and-fresh-tests` (claude-agent, claude-opus-5-5), shared with beans + 0347 and 0354. +- 2026-11-23: PR #230 (`flow-review-approved-and-fresh-tests`) is open, CI 11/11 pass, `CLEAN`, last commit `81525dfd` + (iteration 5 fix), halted at Stage 4 iter 7 on resolver stall timeout (idle). Unblocked to resume now that PR #235 + (`134e333`, Bean `0358` Part 1) merged and images were rebuilt. + +## Progress + +- PR: https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/230 (flow `review-approved-and-fresh-tests`, + resumed at Stage 4) +- 2026-11-23: Stage 4 resumed; run 1 halted at iteration 12 when the in-container resolver's merge commit `2467c0fb` + (origin/main merge) was on the remote but not in the host worktree, so the push was rejected (non-fast-forward). + Reconciled by merging the remote tip and pushing `97b06fba` (no rewrite). Resume then stopped before Stage 4 dispatch: + the branch conflicts with `origin/main` at `8afc215a` (#238) in `flow/pipeline.py`, `flow/stages/children.py`, + `.agents/holon_flow.md`, `docs/git_flow.md` (review-boundary logic, the same code as this bean) and + `holon-knowledge/ledger/executions.jsonl`. Stage 4 refuses unresolvable conflicts. Blocked on a conflict resolution + decision; the merge was aborted, worktree clean at `97b06fba`. + +- 2026-11-23: Resumed from `--from-stage review` after the conflict resolution (PR head `6a6f6e90`). Flow worktree + fast-forwarded from `97b06fba` to origin, then the Stage 4 review loop was restarted (checkpoint + `.holon/flow/checkpoint-review-approved-and-fresh-tests.json`). + +## Resolution + +Delivered via [PR #230](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/230) and squash-merged into +`main` (`f17f4b8`, 2026-11-23). Shipped in the same flow as bean 0354, which covers the other defect in the PR title. + +- **Key Architectural Deliverables**: Consensus approval logs the approved wording and stage status (`review: approved`) + instead of `halted_for_human`; real halts keep halt wording. Legacy `halted_for_human` ledger rows and checkpoints + still resume and calibrate. +- **Verification & Tests**: PR changes include hermetic tests (`test_review_loop_approved.py`, + `test_pipeline_approved.py`, `test_review.py`, `test_calibration_ev.py`). Consensus review + `PRR_kwDORMmd1c8AAAABZpBIQA`; Stage 5 calibration included in the squashed merge (its tree matches the calibrated + branch tip). +- **Holon Flow Traversal**: Intent -> Plan -> Execute -> Review Loop -> Calibration completed for flow + `review-approved-and-fresh-tests`. Remote flow branches were deleted after merge. diff --git a/.beans/holon-agentic-coder-ref-metadata-0348--admission-overlap-uses-actual-pr-files.md b/.beans/holon-agentic-coder-ref-metadata-0348--admission-overlap-uses-actual-pr-files.md new file mode 100644 index 0000000..723ab34 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0348--admission-overlap-uses-actual-pr-files.md @@ -0,0 +1,77 @@ +--- +# holon-agentic-coder-ref-metadata-0348 +title: "Stage 3 admission blocks on folder or wildcard touch-set entries and on planned rather than actual PR files" +status: completed +type: bug +priority: high +tags: + - flow + - stage-3 + - admission + - touch-set + - concurrency + - holon-agentic-coder +created_at: 2026-11-20T20:40:00+11:00 +updated_at: 2026-11-21T09:07:00Z +--- + +## Problem + +Stage 3 admission compares touch sets path by path, and a folder or wildcard entry matches every file under it. On +2026-11-20 this blocked flows that shared no code: + +- The `tests-never-write-real-worktree` flow (PR #215) planned entries like `apps/sandbox-executor/tests/test_*.py` and + `apps/sandbox-executor/tests/flow/**/test_*.py`. Three unrelated flows were refused for almost two hours because they + each **added new** test files (`test_resume_checkpoint.py`, `test_promotion_idempotence.py`, …) that matched those + wildcards. #215 itself changed about 8 files. +- The combined `review-report-ci-log-redaction` flow carried the folder entry `apps/sandbox-executor/tests/` and was + refused on the other session's PR #218 (remove the gemini runner), which edits many existing test files. The source + modules of the two changes were disjoint; the maintainer authorised a one-time `--allow-overlap`. + +Broad intent scopes cause the wide entries (the harness now writes intents with explicit files), but admission should +not turn them into false conflicts. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- **Open pull requests are compared by their actual changed files** (`gh pr diff --name-only` or the GitHub files API), + not by their planned touch set. A local flow that has not opened a PR keeps using its touch set. +- **New files never overlap.** A path that does not exist on the base branch only overlaps an exact same path in the + other set, never a folder or wildcard entry. +- **Folder and wildcard entries match only existing files**, and the refusal message lists the concrete files that + overlap, not just the pattern. +- Optionally warn at Stage 2 when a planned touch set contains a bare folder or a wildcard, so plans name files. +- Hermetic tests: a new test file does not overlap a wildcard entry; an open PR is compared by its diff; an existing + file under a folder entry still overlaps; the refusal lists concrete files. + +## Notes + +- Related: Bean 0151 (touch-set admission), Bean 0337 (blocked state), Bean 0338 (plan refresh after a wait). + +## Audit (2026-11-21) + +Still valid, with exact locations: `flow/admission_decision.py` still compares an open pull request by its declared +touch set (`overlapping_entries(own, flow.declared)`, around line 63) in addition to its real changed files from +`flow/in_flight.py` (`gh pr diff --name-only` is already fetched), and `touch_set.py` `entries_overlap` treats +directories and globs conservatively with no new-file rule. Remaining work: use the real files only for an open PR, and +never overlap a path that does not exist on the base branch with a wildcard or folder entry. + +## Progress + +- 2026-11-21: Holon flow `admission-uses-actual-pr-files` started (claude-agent, claude-opus-5-5). +- 2026-11-21: Flow complete: PR #226 approved 3/3 (iteration 3), calibrated (EV 43.32 predicted, 61.30 actual), CI + green, MERGEABLE/CLEAN; awaiting human merge. + +## Resolution + +- Delivered via [PR #226](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/226) and merged into `main` + (`3ee9c4e2`). +- Key deliverables: Stage 3 admission compares open pull requests by their actual changed files rather than declared + touch sets, new files absent on the base branch never overlap folder or wildcard entries, and refusal messages list + concrete overlapping files. +- Traversal across all 5 Holon flow stages + (`I-1795184210-admission-uses-actual-pr-files/P-1795184234-CLA-CO5.5/E-1795246866-CLA-CO5.5/_`), 3/3 reviewer + consensus approval at iteration 3, `11/11` passing CI checks, and calibration report + (`plans/I-1795184210-admission-uses-actual-pr-files/P-1795184234-CLA-CO5.5_calibration.md`; EV 43.32 predicted vs. + 61.30 actual). diff --git a/.beans/holon-agentic-coder-ref-metadata-0349--antigravity-tmpfs-brain-conversations-and-empty-diff-output.md b/.beans/holon-agentic-coder-ref-metadata-0349--antigravity-tmpfs-brain-conversations-and-empty-diff-output.md new file mode 100644 index 0000000..09b3b19 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0349--antigravity-tmpfs-brain-conversations-and-empty-diff-output.md @@ -0,0 +1,63 @@ +--- +# holon-agentic-coder-ref-metadata-0349 +title: "Mount writable tmpfs for Antigravity brain/conversations and surface agent output on empty_diff" +status: completed +type: bug +priority: high +tags: + - holon-agentic-coder + - antigravity + - sandbox + - docker + - observability +created_at: 2026-11-21T11:55:00+11:00 +updated_at: 2026-11-22T00:24:33+11:00 +--- + +## Problem + +1. **Antigravity background-task reactive wakeup drops when `brain/` and `conversations/` are read-only**: + `get_agent_session_mounts()` in `apps/sandbox-executor/src/sandbox_executor/cli/__init__.py` mounts + `/home/holon/.gemini/antigravity-cli:ro` and adds writable `--tmpfs` overlays only for `config`, `log`, and `cache` — + omitting `brain` and `conversations`. Whenever `agy` backgrounds a shell command exceeding `WaitMsBeforeAsync` (10s) + and the model ends its turn to wait, `agy`'s `OnTaskCompleted` handler fails to create its namespace directory under + `/home/holon/.gemini/antigravity-cli/brain/...` (`read-only file system`), dropping the reactive wakeup and causing + `agy -p` to shut down with exit code `0` and premature `"Waiting for background task..."` output. Empirically + verified via A/B probe on `holon/agent-antigravity` (`agy 1.5.13`): `:ro` drops the wakeup (`EXIT_A=0` without + output), while `--tmpfs` on `brain` and `conversations` restores wakeup cleanly (`EXIT_B=0` with `WAKEUP_OK_42`). +2. **Exit-0 `empty_diff` failures discard `agent_output_text`**: + `apps/sandbox-executor/src/sandbox_executor/entrypoint/executor.py` computes `agent_output_text` on exit `0` but only + writes `agent_output_bytes` to `holon-knowledge/ledger/executions.jsonl`, never printing a bounded, secret-redacted + excerpt to stderr on `empty_diff`, leaving operators blind to premature exits. + +## Goal & Acceptance Criteria + +1. In `apps/sandbox-executor/src/sandbox_executor/cli/__init__.py` (`get_agent_session_mounts()`), add + `--tmpfs /home/holon/.gemini/antigravity-cli/brain:uid=1000,gid=1000` and + `--tmpfs /home/holon/.gemini/antigravity-cli/conversations:uid=1000,gid=1000` across all three Antigravity mount + branches (macOS dedicated session dir, Linux dedicated session dir, and Linux host `~/.gemini/antigravity-cli` + fallback) via a shared constant/helper, keeping `/home/holon/.gemini/antigravity-cli:ro` read-only. +2. In `apps/sandbox-executor/src/sandbox_executor/entrypoint/executor.py`, when + `failure_reason == EMPTY_DIFF_FAILURE_REASON` and `agent_output_text` is non-empty, emit a bounded secret-redacted + excerpt (tail up to 500 characters of the already-redacted `agent_output_text`, noting `agent_output_bytes`) to + `sys.stderr` alongside `Error: {summary}`, without writing raw output into `holon-knowledge/ledger/executions.jsonl`. +3. Update/add unit tests in `apps/sandbox-executor/tests/test_cli.py`, `apps/sandbox-executor/tests/test_pi_mounts.py`, + and `apps/sandbox-executor/tests/test_executor.py`. +4. Do not modify `holon-config/hygiene/module_budgets.json`; `uv run task lint`, `uv run task check`, and targeted + pytest suites pass cleanly. + +## Resolution + +Delivered via [PR #229](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/229) and merged into `main` +(`ccb7a6f`): + +- **Key Architectural Deliverables**: `get_agent_session_mounts()` keeps `/home/holon/.gemini/antigravity-cli` read-only + and overlays writable `--tmpfs` mounts on `brain` and `conversations` via a shared helper + (`cli/antigravity_mounts.py`), so background-task wakeups survive. Exit-0 `empty_diff` failures now print a bounded, + secret-redacted excerpt of the agent output to stderr (`entrypoint/empty_diff_excerpt.py`) without writing raw output + to the ledger. +- **Verification & Tests**: `test_antigravity_mounts.py` and `test_executor_empty_diff.py` added; `test_cli.py` and + `test_pi_mounts.py` updated. +- **Review & Calibration**: the antigravity resolver failed, so review and calibration were resumed on `claude-agent` / + `claude-opus-5-5`. +- **Calibration (EV)**: predicted 46.80, actual 54.94 (delta +8.14). diff --git a/.beans/holon-agentic-coder-ref-metadata-0350--enable-claude-code-experimental-code-mode.md b/.beans/holon-agentic-coder-ref-metadata-0350--enable-claude-code-experimental-code-mode.md new file mode 100644 index 0000000..4d0fcde --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0350--enable-claude-code-experimental-code-mode.md @@ -0,0 +1,55 @@ +--- +# holon-agentic-coder-ref-metadata-0350 +title: "Enable Claude Code code mode (CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1) for every Claude run" +status: todo +type: feature +priority: high +tags: + - claude + - holon-flow + - subagents + - harness + - holon-agentic-coder +created_at: 2026-11-21T12:06:00+11:00 +updated_at: 2026-11-21T12:06:00+11:00 +--- + +## Problem + +Claude Code added an experimental code mode, switched on with the environment variable +`CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1`. The maintainer wants it enabled for every place that runs Claude: the Holon +flow, subagents, and anything else. Nothing sets the variable today. + +## Action + +1. **Harness flow runner (direct edit).** `.agents/skills/holon_flow/scripts/flow_env.py` builds the environment for + `holon flow` with `--agent claude-agent`. Add `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1` there, and keep a value the + caller already set. Add a test in `tests/test_flow_env.py`. Document it in `.agents/skills/holon_flow/SKILL.md`. +2. **Harness Claude sessions and subagents (direct edit).** Set the variable in the project's `.claude/settings.json` + `env` block, so interactive sessions and every subagent they spawn inherit it. Check that subagents and skills run + through the Agent tool pick it up. Never put credentials in that file. +3. **Target containers (through the Holon flow on `holon-agentic-coder`).** The claude runner inside the sandbox + containers must run with the variable set for every role: Stage 1-3 agents, the Stage 4 reviewers and resolver, and + Stage 5. Candidates on `main`: + - `agent_runner.py` + - `agent_defaults.py` + - `claude_credential.py` + - the env passed to role containers + - `entrypoint/role_dispatcher.sh` + + Make it a documented default that an operator can override (for example `HOLON_CLAUDE_CODE_MODE=0`), pass it through + to the container, and record it in `holon doctor`. Add hermetic tests showing that the claude runner's command + environment contains the variable and that the override turns it off. + +4. **Other Claude entry points.** Check the remaining places that start `claude`: the review-loop skills, post-merge, + resolve-conflict, holon-coherence if it runs Claude, and the dev-env shell profile if the maintainer wants it + globally. Set the variable in each, or record why one is excluded. +5. **Verification.** + - Run one real flow with the variable set and confirm it shows in the runner environment (never print secrets). + - Compare token use and duration against a recent flow of similar size, and record any regressions. + - Because the mode is experimental, note how to switch it off quickly if it misbehaves. + +## Notes + +- Keep it switchable, because the feature is experimental. +- Intent JSON must not name harness paths. The target-repo part goes through the Holon flow. diff --git a/.beans/holon-agentic-coder-ref-metadata-0351--clean-up-dev-env-ansible-tasks-and-fix-apt-repository-deprecation.md b/.beans/holon-agentic-coder-ref-metadata-0351--clean-up-dev-env-ansible-tasks-and-fix-apt-repository-deprecation.md new file mode 100644 index 0000000..294483e --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0351--clean-up-dev-env-ansible-tasks-and-fix-apt-repository-deprecation.md @@ -0,0 +1,192 @@ +--- +# holon-agentic-coder-ref-metadata-0351 +title: + "Clean up dev-env Ansible tasks, replace deprecated apt_repository, exclude Ghostty and Warp on WSL, and enable tmux + mouse scrolling" +status: completed +type: task +priority: high +tags: + - target:dev-env + - ansible + - wsl + - tmux + - packages +created_at: 2026-11-21T01:43:13Z +updated_at: 2026-11-23T03:20:00Z +pr: https://github.com/thomashan/dev-env/pull/36 +--- + +## Problem + +1. Running `make configure; make install` (as well as `make check-syntax` and `make check-mode`) in + `/Users/thomashan/git/dev-env/main` under `ansible-core 2.22.0` emits a deprecation warning on every invocation + (including macOS runs and WSL runs, because Ansible loads all role task definitions at playbook parse time): + +```text +[WARNING]: Deprecation warnings can be disabled by setting `deprecation_warnings=False` in ansible.cfg. +[DEPRECATION WARNING]: ansible.builtin.apt_repository has been deprecated. Use deb822_repository instead. This feature will be removed from ansible-core version 2.25. +Origin: /Users/thomashan/git/dev-env/main/ansible/roles/packages/tasks/main.yml:174:3 + +172 +173 - name: Add Ghostty PPA on Ubuntu +174 ansible.builtin.apt_repository: + ^ column 3 +``` + +2. `make check-syntax` currently checks only `ansible/site.yml` (omitting `ansible/playbooks/unlink.yml`) and exits `0` + even when `[DEPRECATION WARNING]` is printed to `stderr`. Furthermore, a full audit of all Ansible role task files + (`ansible/roles/*/tasks/main.yml`) and `ansible/playbooks/unlink.yml` revealed inconsistent `ansible.builtin.command` + invocation styles (free-form strings vs. structured `cmd:` dicts), missing `changed_when` declarations, and missing + `check_mode: false` declarations on read-only probes (`changed_when: false`) and GNU Stow dry-run tasks (`-n` when + `ansible_check_mode`). +3. **WSL Linux GUI terminal install failure**: `devenv_install_gui_casks` defaults to `true` across all platforms in + `ansible/group_vars/all.yml` without checking for WSL. Because WSL runs on top of a Windows host rather than a + bare-metal Linux desktop, Ghostty and Warp (`warp-terminal` Linux `apt` fails with `403 Forbidden` fetching Warp's + `/linux/deb/../../stable/...` `.deb`) cannot/should not be installed inside WSL, and abort `make install` before + `dotfiles`, `conda`, `node`, `neovim`, and `fish` run. Both Ghostty and Warp should simply be excluded on WSL (no + `winget.exe` automation needed). +4. **`tmux` mouse scrolling**: `dotfiles/tmux/.tmux.conf` leaves tmux `mouse` at factory default (`off`), so terminals + like Windows Terminal translate mouse wheel scrolling into arrow-key escape sequences (`^[[B`/`^[OB`/`^[[A`) in + alternate screen mode instead of scrolling tmux copy-mode. + +## Action + +Through the 5-stage Holon flow on `dev-env`: + +1. **`ansible/roles/bootstrap/tasks/main.yml` (WSL detection)** + - Compute `devenv_is_wsl` in `Classify host platform` (`devenv_system == 'Linux'` and either `'microsoft'` or `'wsl'` + in `ansible_facts.kernel | default('') | lower`, or + `(ansible_facts.env | default({})).WSL_DISTRO_NAME | default('') | length > 0`, or + `(ansible_facts.env | default({})).WSL_INTEROP | default('') | length > 0`) and include `wsl: {{ devenv_is_wsl }}` + in `Show resolved plan` (keep `devenv_install_gui_casks: true` and `scripts/devenv_wizard.py` unchanged; no + `devenv_install_gui_on_wsl` flag). +2. **`ansible/roles/packages/tasks/main.yml`** + - Replace deprecated `ansible.builtin.apt_repository` in `Add Ghostty PPA on Ubuntu` (line 173) with + `ansible.builtin.deb822_repository`: + - `name: ghostty-ubuntu` + - `types: [deb]` + - `uris: [https://ppa.launchpadcontent.net/mkasberg/ghostty-ubuntu/ubuntu]` + - `suites: ["{{ ansible_facts['distribution_release'] }}"]` + - `components: [main]` + - `signed_by: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x7981725F2B0C9E295E2C368B322003C4710E280B` + - `state: present` + - Unconditionally exclude Ghostty and Warp when inside WSL by adding `not (devenv_is_wsl | default(false) | bool)` to + the `when:` list of all 12 Linux `warp-terminal` and `ghostty` tasks (no `winget.exe` tasks and no + `devenv_install_gui_on_wsl` flag). + - Add `changed_when: true` to `Remove packages that duplicate a managed runtime` (line 23). + - Convert free-form `ansible.builtin.command: ` invocations to structured + `ansible.builtin.command:\n cmd: ` in: + - `Probe Warp terminal binary` (line 64) + - `Probe Ghostty binary` (line 118) + - `Probe native Ghostty apt package availability` (line 128) + - `Probe snap command` (line 150) + - `Install Ghostty via snap` (line 162) +3. **`ansible/roles/conda/tasks/main.yml`** + - Add `check_mode: false` to read-only probe tasks (`changed_when: false`): + - `Probe existing conda in PATH` (line 7) + - `Probe conda base prefix` (line 70) + - `Assert conda is runnable` (line 151) +4. **`ansible/roles/dotfiles/tasks/main.yml`** + - Add `check_mode: false` to: + - `Locate GNU Stow binary` (line 6) + - `Unstow inactive variant packages` (line 22, which already passes `{{ '-n' if ansible_check_mode else '' }}`) + - `Execute GNU Stow to link per-tool dotfiles packages` (line 167, which already passes + `{{ '-n' if ansible_check_mode else '' }}`) +5. **`ansible/roles/fish/tasks/main.yml`** + - Add `check_mode: false` to read-only probe tasks (`changed_when: false`): + - `Syntax-check every fish file now on disk` (line 15) + - `Report the fish version in use` (line 23) +6. **`ansible/roles/neovim/tasks/main.yml`** + - Add `check_mode: false` to read-only probe task `Count loaded packages` (line 55). +7. **`ansible/playbooks/unlink.yml`** + - Add `check_mode: false` to `Locate GNU Stow binary` (line 30). + - Add `{{ '-n' if ansible_check_mode else '' }}` and `check_mode: false` to + `Invoke stow to delete all declared variant packages` (line 77). +8. **`dotfiles/tmux/.tmux.conf`** + - Add `set -g mouse on` with a concise comment noting mouse wheel scrolling enters copy-mode instead of sending + arrow-key escape sequences in alternate screen mode (and holding `Shift` selects natively). +9. **`Makefile`** + - Update `check-syntax` (line 243) so it runs `--syntax-check` against both `$(SITE)` and + `$(SELF_DIR)/ansible/playbooks/unlink.yml`. +10. **`tests/test_toolchain.py` & `tests/test_templating.py`** (keep `tests/test_manifest.py` <= 1,000 lines; it is + currently at 990 lines) + - Update `test_linux_packages_gui_terminal_tasks` in `tests/test_toolchain.py` to expect structured + `ansible.builtin.command.cmd`, `ansible.builtin.deb822_repository` for `Add Ghostty PPA on Ubuntu`, the + unconditional `not (devenv_is_wsl | default(false) | bool)` guard on all 12 Linux Warp/Ghostty tasks, and no + `devenv_install_gui_on_wsl` flag. + - Add assertions in `tests/test_toolchain.py` verifying: + - `set -g mouse on` is present in `dotfiles/tmux/.tmux.conf`. + - `ansible/roles/bootstrap/tasks/main.yml` defines `devenv_is_wsl`. + - Zero `winget.exe` tasks and zero `devenv_install_gui_on_wsl` references exist in + `ansible/roles/packages/tasks/main.yml`. + - Add a static task hygiene test in `tests/test_toolchain.py` asserting across all `role_task_files()` and + `ansible/playbooks/unlink.yml`: + - No task uses deprecated modules (`ansible.builtin.apt_repository`, `ansible.builtin.apt_key`, `apt_repository`, + `apt_key`). + - Every `ansible.builtin.command` task uses a mapping with `cmd:` (never a free-form string) and declares + `changed_when` or `creates`. + - Every read-only probe task (`changed_when: false`) and every `stow` task using `ansible_check_mode` declares + `check_mode: false`. + - Add a regression test in `tests/test_templating.py` that runs `ansible-playbook --syntax-check` against + `ansible/site.yml` and `ansible/playbooks/unlink.yml` with `ANSIBLE_DEPRECATION_WARNINGS=True` and asserts return + code `0` and zero `[DEPRECATION WARNING]` output in `stderr`. + - Add Jinja2 templating tests in `tests/test_templating.py` verifying `devenv_is_wsl` evaluates `True` on WSL facts + (`microsoft-standard-WSL2` kernel or `WSL_DISTRO_NAME=Ubuntu`) and `False` on standard Linux and macOS facts. + +## Acceptance Criteria + +- `make check-syntax`, `make lint`, `make check-mode`, and `uv run --extra test pytest -m "not network"` pass with zero + `[DEPRECATION WARNING]` output. +- Ghostty and Warp Linux GUI terminal tasks are unconditionally excluded on WSL (`not devenv_is_wsl`; no `winget.exe` + tasks and no `devenv_install_gui_on_wsl` flag). +- `dotfiles/tmux/.tmux.conf` sets `set -g mouse on`. +- Every task file under `ansible/roles/*/tasks/main.yml` and `ansible/playbooks/unlink.yml` satisfies the static task + hygiene checks (no deprecated APT modules, structured `cmd:` + `changed_when`/`creates` on all + `ansible.builtin.command` tasks, `check_mode: false` on read-only probes and `ansible_check_mode` stow tasks). +- `tests/test_manifest.py` remains <= 1,000 lines. +- The Stage 2 plan in `dev-env` includes a `## Touch Set` section listing all modified/created repo-relative paths. + +## Notes + +- Target repository: `thomashan/dev-env` (`/Users/thomashan/git/dev-env/main`, at `425ff6fe`). +- Bundles all remaining unstarted `dev-env` work (Ansible cleanup/`deb822_repository`, unconditional WSL exclusion of + Ghostty and Warp, and `tmux` mouse scrolling) into this single bean. +- Note: PR #33's clean-shell Conda probes in `ansible/roles/conda/tasks/main.yml` already declare `changed_when: false` + and `check_mode: false`. +- Any `dev-env` Holon flow intent JSON MUST explicitly instruct the Stage 2 planner to include a `## Touch Set` section + listing all modified/created repo-relative file paths. + +## Progress + +- 2026-11-23: First run (`dev-env-ansible-wsl-tmux`) opened PR #34 (head `1afad1a`), and second run + (`dev-env-ansible-wsl-winget`) opened PR #35; both were closed unmerged per maintainer simplification: drop + `devenv_install_gui_on_wsl` and `winget.exe` automation and simply exclude Ghostty and Warp when running on WSL. +- 2026-11-23: Wrote `todo/intent-0351-dev-env-ansible-wsl-skip.json` and launched fresh Holon flow + `dev-env-ansible-wsl-skip` off `/Users/thomashan/git/dev-env/main` (`425ff6fe`) using `antigravity-agent` / + `gemini-4-argon`. +- 2026-11-23: Flow `dev-env-ansible-wsl-skip` (`antigravity-agent` / `gemini-4-argon`) completed all 5 stages and opened + [PR #36](https://github.com/thomashan/dev-env/pull/36) (head `cae95be`): Stage 4 consensus APPROVED 3/3 at iteration 2 + (0 critical, 0 important, 0 nit), Stage 5 calibration report included in PR diff (predicted EV 92.83, actual 94.64, + delta +1.81; touch-set precision/recall 100%), all 6 post-calibration CI checks green (`hygiene` 44s, `make-matrix` + `macos-latest` 2m29s / `ubuntu-latest` 59s, `test-network` 20s, `test-unit` `macos-latest` 2m55s / `ubuntu-latest` + 46s), `MERGEABLE`/`CLEAN`, awaiting human maintainer merge. + +## Resolution + +Completed via [dev-env PR #36](https://github.com/thomashan/dev-env/pull/36) (merged into `main` as `a9dacf46` on +2026-11-23; head `cae95be`, superseding closed PRs #34 and #35): + +- Replaced deprecated `ansible.builtin.apt_repository` in `ansible/roles/packages/tasks/main.yml` with + `ansible.builtin.deb822_repository` (`ghostty-ubuntu`), eliminating all `ansible-core 2.22.0` deprecation warnings. +- Added `devenv_is_wsl` detection in `ansible/roles/bootstrap/tasks/main.yml` and unconditionally excluded all 12 Linux + Ghostty and Warp tasks when `devenv_is_wsl` is true (`not (devenv_is_wsl | default(false) | bool)`). +- Cleaned up Ansible task hygiene across `packages`, `conda`, `dotfiles`, `fish`, `neovim`, and + `ansible/playbooks/unlink.yml` (structured `cmd:`, `changed_when`, `check_mode: false` on read-only probes and dry-run + stow tasks), expanded `Makefile` `check-syntax` to cover `unlink.yml`, and enabled `set -g mouse on` in + `dotfiles/tmux/.tmux.conf`. +- Added static task hygiene, `devenv_is_wsl` templating, and zero-deprecation `--syntax-check` regression tests in + `tests/test_toolchain.py` and `tests/test_templating.py` while keeping `tests/test_manifest.py` <= 1,000 lines. +- Traversed all 5 Holon flow stages (`antigravity-agent` / `gemini-4-argon`): Stage 4 consensus 3/3 APPROVED at + iteration 2 (0 critical, 0 important, 0 nit), Stage 5 calibration included in PR diff (predicted EV 92.83, actual + 94.64, delta +1.81; touch-set precision/recall 100%), all 6 CI checks green. diff --git a/.beans/holon-agentic-coder-ref-metadata-0352--push-pr-events-via-gh-webhook-forward.md b/.beans/holon-agentic-coder-ref-metadata-0352--push-pr-events-via-gh-webhook-forward.md new file mode 100644 index 0000000..f01c0f9 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0352--push-pr-events-via-gh-webhook-forward.md @@ -0,0 +1,96 @@ +--- +# holon-agentic-coder-ref-metadata-0352 +title: "Push GitHub PR events through gh webhook forward, with cheap polling as the fallback" +status: todo +type: feature +priority: normal +tags: + - github + - ci + - flow + - harness + - efficiency + - holon-agentic-coder +created_at: 2026-11-21T13:12:00+11:00 +updated_at: 2026-11-21T13:12:00+11:00 +--- + +## Problem + +The flow and the harness skills keep polling GitHub for PR state: + +- the CI wait (`flow/github/ci_wait.py`, every 15 s); +- the review loop's mergeability and conflict gate; +- Stage 3 admission and the runner's overlap wait (`run_holon_flow.py`, every 60 s); +- `gh pr checks --watch` in the holon_flow and resolve-conflict skills; +- detecting merges for post-merge. + +Every poll costs API rate limit and adds latency, and with several concurrent flows the calls multiply. + +`gh event listen` (GitHub Event Streams) would be the natural push channel. It is waitlist-only, though, and returns +HTTP 403 "Event subscriptions are not enabled for this account" until GitHub approves the account. The maintainer is +waitlisted. + +## Action + +1. **Push channel: `gh webhook forward`** (official extension `cli/gh-webhook`). + - One forwarder per repository (`holon-agentic-coder`, `holon-coherence`) streams these events to a local listener: + `pull_request`, `check_suite`, `check_run`, `status`, `pull_request_review` and `push`. + - Flows and skills subscribe to that listener by PR number or head SHA. There is a single forwarder per repo, and the + listener fans events out to every waiter. A small local broker owns the forwarder's lifecycle: it starts on demand + and stops when idle, and only one runs per repo at a time. + - Events are hints. After each relevant event the waiter reads the current state once (`gh pr view`, `gh pr checks`). + - Prerequisites (maintainer): + - install the extension with `gh extension install cli/gh-webhook`; + - add the `admin:repo_hook` scope with `gh auth refresh -s admin:repo_hook`; + - repo admin is already in place on both repos (checked 2026-11-21). +2. **Fallback: cheap polling.** It is used whenever the forwarder is unavailable (no extension, missing scope, the + forwarder dies, or no events arrive): + - conditional requests with ETag / `If-None-Match`, so an unchanged state costs a 304 that is not rate-limited; + - one batched GraphQL query covering every PR being watched (state, mergeable, mergeStateStatus, check rollup), + instead of one `gh` call per PR; + - backoff while nothing changes. + + Even with the forwarder up, a slow safety poll (every 5-10 min) covers dropped deliveries. + +3. **One interface.** A single "wait for PR condition" API (CI finished, mergeable/conflicting, merged/closed, head + changed, review submitted) with pluggable sources, in this order: + - Event Streams (`gh event listen`), once the account is enabled, detected with a probe; + - the webhook forwarder; + - polling. + + It logs which source is in use. + +4. **Callers to move to it:** + - **Harness (direct edit):** the `run_holon_flow.py` overlap wait, and the CI-wait, merge-wait and conflict-wait + steps in the holon_flow, resolve-conflict and post-pr-merge skills. + - **Target repo (through the Holon flow):** `flow/github/ci_wait.py`, the review-loop conflict gate and mergeability + checks, and the admission wait. Inside role containers, keep polling unless the host broker is reachable. Decide + this in the plan. +5. **Tests**, hermetic, with a fake event stream and a fake GitHub API: + - an event wakes the waiter and triggers one state read; + - a missed event is caught by the safety poll; + - a forwarder failure falls back to polling; + - a 304 counts as no change; + - batched GraphQL covers several PRs; + - no secrets are logged. + +## Replacement by `gh event listen` + +`gh webhook forward` is a stopgap until GitHub enables Event Streams for the maintainer's account. + +- Keep the forwarder and broker behind the single wait interface. No caller may depend on the forwarder directly. +- Once the probe shows `gh event listen` works (no 403), the replacement is: + - make Event Streams the push source; + - delete the forwarder, the broker and their tests; + - drop the `admin:repo_hook` scope requirement; + - keep cheap polling as the fallback. +- This should be a small follow-up change. Log it as a new bean when access is granted. + +## Notes + +- Never print the webhook secret or tokens. Forwarded payloads may include repo data, so keep them local and do not log + bodies. +- Measure the API calls and wall-clock latency of a flow before and after, using real data only. +- Related: Bean 0234 (event-driven CI progress logging), Bean 0348 (admission), Bean 0191 (one GitHub adapter owns every + `gh` call). Build on 0191's adapter if it lands first. diff --git a/.beans/holon-agentic-coder-ref-metadata-0353--review-test-gate-keeps-stale-stage-3-failure-after-resolver-fix.md b/.beans/holon-agentic-coder-ref-metadata-0353--review-test-gate-keeps-stale-stage-3-failure-after-resolver-fix.md new file mode 100644 index 0000000..24f0375 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0353--review-test-gate-keeps-stale-stage-3-failure-after-resolver-fix.md @@ -0,0 +1,93 @@ +--- +# holon-agentic-coder-ref-metadata-0353 +title: "_ReviewTestGate keeps stale Stage 3 tests_failed after Stage 4 resolver fixes and green CI" +status: scrapped +type: bug +priority: high +tags: + - holon-agentic-coder + - review-loop + - ci + - tests +created_at: 2026-11-21T05:09:38Z +updated_at: 2026-11-22T22:55:00Z +--- + +## Problem + +When Stage 3 (`execute`) completes with failing tests (`test_exit_code != 0` or `test_pass_rate < 1.0`) and Stage 4's +resolver subsequently fixes those test failures on a newer commit where all GitHub Actions CI checks pass (`11/11`), +Stage 4 never exits with consensus `APPROVED`. Instead, it gets trapped in an infinite loop generating synthetic +`FIND-CI-NNN` (`CI checks failed in iteration N: local_tests.`) findings until `max_review_iterations` is exhausted. + +Observed directly on **Bean 0322** (PR `#222`) across 9 consecutive review iterations (iterations 7–15): + +- Iteration 4 resolver fixed the 2 failing test assertions (`4944 passed, 1 skipped` locally) and pushed. +- Iterations 7–15 each had all 3 reviewers (`claude-agent / claude-opus-5-5`) unanimously return + `APPROVED (critical 0, important 0, nit 0)` AND `CI Checks: 11 total, 11 passed, 0 failed, 0 pending (github_cli)`. +- Yet Stage 4 kept emitting `FIND-CI-007` through `FIND-CI-015` + (`summary: "CI checks failed in iteration N: local_tests."`), forcing another full ensemble review each iteration + after the resolver rejected `FIND-CI-NNN` as `inaccurate`. +- **Bean 0190** (PR `#219`) hit the exact same trap at Iteration 6 (`APPROVED` + `11/11` CI green, yet continued into + Iteration 7 because its Stage 3 payload recorded `test_exit_code: 1`, `tests_failed: 6`). + +### Root Cause + +1. In `apps/sandbox-executor/src/sandbox_executor/flow/review/loop.py` (`line 206`), + `_ReviewTestGate(context, repo_dir)` caches + `self.stage_3_evidence = (rate, exit_code != 0 or (rate is not None and rate < 1.0))` once from + `context.stage_results.get("execute")`. +2. In `apps/sandbox-executor/src/sandbox_executor/flow/review/local_tests.py`: + - `_applies(ci_status, stage_3_rate, stage_3_failed)` returns `True` **only** when + `ci_status.get("source") == "local_tests" and stage_3_rate is None and not stage_3_failed`. + - Whenever Stage 3 failed (`stage_3_failed == True`) OR GitHub CLI CI checks are present (`source == "github_cli"`), + `evidence()` never updates or clears `tests_failed` — it returns the frozen Stage 3 `(rate, True)` tuple forever. +3. In `apps/sandbox-executor/src/sandbox_executor/flow/review/ci_outcome.py` (`gate_ci_flags`) and + `apps/sandbox-executor/src/sandbox_executor/flow/github/ci.py` (`_ci_green`), `tests_failed == True` overrides + `ci_status.get("all_passed") is True`, setting `ci_green = False` and `ci_finding = True` + (`FIND-CI-{iteration:03d}`). + +## Action + +Through the 5-stage Holon flow on `holon-agentic-coder`: + +1. Update `_ReviewTestGate` in `apps/sandbox-executor/src/sandbox_executor/flow/review/local_tests.py` (and any call + sites in `loop.py` if needed): + - When `ci_status.get("source") == "github_cli"`, authoritative CI on the current PR HEAD has already run: stale + Stage 3 `tests_failed` MUST NOT fail `_ci_green` / `gate_ci_flags` (use the `github_cli` outcome rather than a + frozen earlier-HEAD failure). + - When `ci_status.get("source") == "local_tests"` and the current `HEAD` differs from the Stage 3 execution commit + (e.g. a Stage 4 resolver committed fixes, or `test_gate` has not yet measured `HEAD`), re-measure tests on the + current `HEAD` via `_ReviewLocalTests` instead of reusing stale Stage 3 failure evidence. +2. Preserve existing behavior when `github_cli` is absent AND `HEAD` has not advanced since Stage 3 (so Stage 3 local + test results still gate Stage 4 without redundant test runs on the same commit, and unmeasured runs stay unmeasured). +3. Add hermetic unit tests in `apps/sandbox-executor/tests/flow/` covering: + - Stage 3 failed (`test_exit_code = 1`, `tests_failed > 0`), resolver pushes a fix, `github_cli` reports + `all_passed = True` -> `evidence()` / `gate_ci_flags()` / review loop approves without synthesizing `FIND-CI-NNN` + for `local_tests`. + - Stage 3 failed, `ci_status["source"] == "local_tests"`, and `HEAD` advanced past Stage 3 -> `_ReviewTestGate` + re-measures on the new `HEAD` and clears `tests_failed` if tests pass. + - Stage 3 failed, `ci_status["source"] == "local_tests"`, and `HEAD` is unchanged -> `tests_failed` still fails the + gate without re-running. + +## Acceptance Criteria + +- Stage 4 consensus `APPROVED` + `11/11` passing `github_cli` checks completes immediately in the same iteration even + when Stage 3's initial `execute` checkpoint recorded `test_exit_code != 0`. +- When running without `github_cli` (`local_tests`), advancing `HEAD` in Stage 4 invalidates stale Stage 3 + `tests_failed` evidence by measuring on the new `HEAD`. +- All existing and new tests pass via `uv run pytest`, and `uv run task lint` and `uv run task lint-docs` pass. +- `holon-config/hygiene/module_budgets.json` is unchanged. + +## Notes + +- Target repository: `Holon-Agentic-Coder/holon-agentic-coder` +- Related beans: `0235`, `0238`, `0267`, `0322`, `0190`. + +## Resolution + +Superseded as a duplicate of **Bean 0354**, which tracks the exact same `_ReviewTestGate` stale Stage 3 failure bug in +`flow/review/local_tests.py` and is currently in progress in `holon-agentic-coder` +[PR #230](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/230) (`flow-review-approved-and-fresh-tests`, +implementing `flow/review/head_test_evidence.py` and updated `flow/review/local_tests.py` covering green `github_cli` CI +on the PR head, local re-measurement on moved heads, unchanged Stage 3 head reuse, and hermetic tests). diff --git a/.beans/holon-agentic-coder-ref-metadata-0354--review-local-test-gate-uses-stale-stage-3-failures.md b/.beans/holon-agentic-coder-ref-metadata-0354--review-local-test-gate-uses-stale-stage-3-failures.md new file mode 100644 index 0000000..054810a --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0354--review-local-test-gate-uses-stale-stage-3-failures.md @@ -0,0 +1,84 @@ +--- +# holon-agentic-coder-ref-metadata-0354 +title: "Review-loop local test gate keeps reporting stale Stage 3 test failures, so consensus can never close" +status: completed +type: bug +priority: high +tags: + - flow + - stage-4 + - review-loop + - ci + - holon-agentic-coder +created_at: 2026-11-21T18:26:00+11:00 +updated_at: 2026-11-23T02:37:31Z +--- + +## Problem + +On 2026-11-21, PR #219 (`checkpoint-and-ledger-ownership`) had 3/3 APPROVED reviews with no findings in iterations 11 +and 13-19, and CI was green. Each approval was still followed by a "CI checks failed: local_tests" finding +(FIND-CI-0xx). The resolver rejected it with evidence every time, but it came back each iteration. The loop never posted +consensus and never reached Stage 5, so the flow ran until the iteration cap. + +Cause: `_ReviewTestGate` in `flow/review/local_tests.py` reuses the test result Stage 3 recorded (here 4768 passed, 6 +failed, 1 errored). `_applies()` re-measures only when Stage 3 recorded neither a rate nor a failure +(`stage_3_rate is None and not stage_3_failed`). Once Stage 3 fails tests, the gate keeps reporting that failure for the +rest of the loop, even after the resolver fixes it and the current tree passes 4992/4992. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- The gate judges the current head, not Stage 3's result. When Stage 3 recorded failures, or the head has changed since + Stage 3, re-measure locally, or accept a green CI run on the current head SHA as evidence. +- A finding the resolver rejected with evidence of a passing run on the same head is not raised again for that head. +- Log which evidence the gate used: Stage 3, a local re-run, or CI on the current head. +- Hermetic tests: + - Stage 3 failed and the current head passes, so there is no finding and consensus can close; + - Stage 3 failed and the current head still fails, so the finding is raised; + - green CI on the current SHA is accepted. + +## Notes + +- PR #219 also changes `flow/review/loop.py`, so this flow would overlap it until #219 merges. +- Seen alongside a one-off "branch is not fetched from origin" at iteration 20. The remote-tracking ref was rewritten at + the moment the container checked it, which may be a race on the shared `.git`. Not proven; record it here if it + happens again. + +## Progress + +- 2026-11-21: Started Holon flow `review-approved-and-fresh-tests` (claude-agent, claude-opus-5-5), shared with beans + 0347 and 0354. +- 2026-11-23: PR #230 (`flow-review-approved-and-fresh-tests`) is open, CI 11/11 pass, `CLEAN`, last commit `81525dfd` + (iteration 5 fix), halted at Stage 4 iter 7 on resolver stall timeout (idle). Unblocked to resume now that PR #235 + (`134e333`, Bean `0358` Part 1) merged and images were rebuilt. Bean `0353` was scrapped as a duplicate of `0354`. + +## Progress + +- PR: https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/230 (flow `review-approved-and-fresh-tests`, + resumed at Stage 4) +- 2026-11-23: Stage 4 resumed; run 1 halted at iteration 12 when the in-container resolver's merge commit `2467c0fb` + (origin/main merge) was on the remote but not in the host worktree, so the push was rejected (non-fast-forward). + Reconciled by merging the remote tip and pushing `97b06fba` (no rewrite). Resume then stopped before Stage 4 dispatch: + the branch conflicts with `origin/main` at `8afc215a` (#238) in `flow/pipeline.py`, `flow/stages/children.py`, + `.agents/holon_flow.md`, `docs/git_flow.md` (review-boundary logic, the same code as this bean) and + `holon-knowledge/ledger/executions.jsonl`. Stage 4 refuses unresolvable conflicts. Blocked on a conflict resolution + decision; the merge was aborted, worktree clean at `97b06fba`. + +- 2026-11-23: Resumed from `--from-stage review` after the conflict resolution (PR head `6a6f6e90`). Flow worktree + fast-forwarded from `97b06fba` to origin, then the Stage 4 review loop was restarted (checkpoint + `.holon/flow/checkpoint-review-approved-and-fresh-tests.json`). + +## Resolution + +Delivered via [PR #230](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/230) and squash-merged into +`main` (`f17f4b8`, 2026-11-23). Shipped in the same flow as bean 0347, which covers the other defect in the PR title. + +- **Key Architectural Deliverables**: The review-loop local test gate judges the current head rather than the stale + Stage 3 failure record, so consensus can close once the current tree passes. +- **Verification & Tests**: PR changes include hermetic tests (`test_review_local_tests.py`, `test_review_ci_wait.py`). + Consensus review `PRR_kwDORMmd1c8AAAABZpBIQA`; Stage 5 calibration included in the squashed merge (its tree matches + the calibrated branch tip). +- **Holon Flow Traversal**: Intent -> Plan -> Execute -> Review Loop -> Calibration completed for flow + `review-approved-and-fresh-tests`. Remote flow branches were deleted after merge. diff --git a/.beans/holon-agentic-coder-ref-metadata-0355--holon-calibrate-runs-full-stage-5.md b/.beans/holon-agentic-coder-ref-metadata-0355--holon-calibrate-runs-full-stage-5.md new file mode 100644 index 0000000..622c8a5 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0355--holon-calibrate-runs-full-stage-5.md @@ -0,0 +1,71 @@ +--- +# holon-agentic-coder-ref-metadata-0355 +title: "holon calibrate runs the full Stage 5 (report, reconciliation, knowledge promotion), like the flow" +status: completed +type: bug +priority: high +tags: + - calibration + - stage-5 + - cli + - knowledge + - holon-agentic-coder +created_at: 2026-11-21T18:45:00+11:00 +updated_at: 2026-11-23T11:51:44+11:00 +--- + +## Problem + +The flow's Stage 5 (`run_calibrate_stage` in `flow/stages/calibrate.py`) does three things, each with its own commit: + +1. `run_calibrate` writes and commits the calibration report; +2. `reconcile_records` reconciles the execution outcome in the executions ledger ("record stage 5 reconciliation"); +3. `promote_pending_candidates` promotes knowledge and wisdom candidates ("record stage 5 promoted knowledge and + wisdom"). + +The standalone `holon calibrate` command (`cli/commands/calibrate.py`) calls only `run_calibrate`. A calibration run by +hand, such as the one on PR #219 on 2026-11-21 after its review loop stalled, therefore produces the report but quietly +skips the reconciliation and the knowledge promotion. Nothing warns about it. The ledger never records the outcome, and +the knowledge base misses that flow's lessons. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- Extract one Stage 5 function, used by both the flow stage and `holon calibrate`, that runs `run_calibrate`, then + `reconcile_records`, then `promote_pending_candidates`, with the same commits on the `/calibrated` branch. + `run_calibrate_stage` and the CLI become thin callers, so the two paths cannot drift apart again. +- `holon calibrate` runs the full Stage 5 by default. A `--report-only` flag keeps the old behaviour and says so in its + output. `--no-commit` still means no commits for every step. +- `--json` output includes the reconciliation outcome and the number of candidates newly promoted. +- Re-running is idempotent: calibrating the same execution twice appends no duplicate reconciliation rows and promotes + nothing new (Stage 5 promotion already reports only new items). +- Hermetic tests: + - `holon calibrate` produces the same commits and ledger rows as the flow's Stage 5 for the same execution; + - `--report-only` skips reconciliation and promotion; + - a second run is a no-op; + - `--no-commit` leaves the tree with no commits. +- Update the CLI help and docs. + +## Notes + +- Follow-up for PR #219: its Stage 5 reconciliation and promotion did not run. Once this lands, re-run `holon calibrate` + for that execution, or run the two missing steps by hand before it merges. +- Related: Bean 0342 (promotion counts only new items), Bean 0354 (stale local test gate, which caused the hand-run). +- PR: https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/240 (flow run `calibrate-runs-full-stage-5`; + review consensus APPROVED 3/3, calibrated, awaiting human merge). + +## Resolution + +Delivered via [PR #240](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/240) and merged into `main` +(`192c6e8`): + +- **Key Architectural Deliverables**: Stage 5 is one shared function (`flow/stage5.py`) used by both + `run_calibrate_stage` and `holon calibrate`. It runs `run_calibrate`, then `reconcile_records`, then + `promote_pending_candidates`, with the same commits on the `/calibrated` branch. `holon calibrate` runs the full Stage + 5 by default; `--report-only` keeps the old behaviour and says so; `--no-commit` means no commits; `--json` reports + the reconciliation outcome and newly promoted count. Re-runs are idempotent. +- **Verification & Tests**: Hermetic `tests/test_calibrate_full_stage5.py` covers CLI/flow parity, `--report-only`, + second-run no-op, and `--no-commit`. +- **Holon Flow Traversal**: The flow ran through Intent, Plan, Execute, Review Loop (consensus APPROVED 3/3) and + Calibration on branch `I-1795388477-calibrate-runs-full-stage-5/...`. diff --git a/.beans/holon-agentic-coder-ref-metadata-0356--resume-inherits-skip-review-and-agent-from-checkpoint.md b/.beans/holon-agentic-coder-ref-metadata-0356--resume-inherits-skip-review-and-agent-from-checkpoint.md new file mode 100644 index 0000000..968d370 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0356--resume-inherits-skip-review-and-agent-from-checkpoint.md @@ -0,0 +1,79 @@ +--- +# holon-agentic-coder-ref-metadata-0356 +title: "A resumed flow inherits skip_review and the agent from its checkpoint instead of the run's own flags" +status: completed +type: bug +priority: high +tags: + - flow + - checkpoint + - stage-4 + - holon-agentic-coder +created_at: 2026-11-21T23:30:00+11:00 +updated_at: 2026-11-23T01:25:37Z +--- + +## Problem + +On 2026-11-21, PR #228 (`intent-plan-stage-decomposition`) was calibrated without a completed review: + +- An antigravity run (about 09:21-09:35Z) saved `skip_review: true` into the flow checkpoint's context. +- A later resume at 10:01Z (`holon flow ... --agent claude-agent --model claude-opus-5-5 --checkpoint ...`), run without + `--skip-review`, read the stored value. It logged "Stage 4 (REVIEW) skipped due to --skip-review flag" and went + straight to Stage 5. +- The same resume logged `Agent runner resolved to claude-agent (source: flag, --agent)`, but its calibration report + names `antigravity-agent/gemini-3.8-flash-medium` as the evaluating agent. The checkpoint's agent and model won over + the flags for at least part of the run. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- **Per-run switches are not checkpoint state.** `skip_review`, `skip_calibrate`, `skip_push` and `dry_run` apply only + to the run that passes them. A resume uses only its own flags, and logs it when it drops a stored skip that differs. +- **Flags win over the checkpoint.** On resume, `--agent` and `--model` override the checkpoint's agent and model for + every stage and role in that run: Stage 4 reviewers and resolver, and the Stage 5 evaluating agent. The checkpoint + records the new values, and the summary shows the agent and model actually used. +- Never skip Stage 4 for a PR that has no consensus approval unless the current run passes `--skip-review` explicitly. +- Hermetic tests: + - a checkpoint with `skip_review: true` resumed without the flag runs Stage 4; + - a resume with `--agent claude-agent` on a checkpoint saved by antigravity uses claude for review and calibration, + and the report names it; + - the old checkpoint format still loads. + +## Notes + +- Harness side, done 2026-11-21: `run_holon_flow.py` no longer switches runner on its own and reads hour-only reset + times. A resume that clears a stored `skip_review` by hand edits the checkpoint, as was done for #228. +- Related: Bean 0341 (resume keeps the checkpoint intact), Bean 0355 (holon calibrate runs the full Stage 5). + +## Flow (2026-11-23) + +- Intent: `todo/intent-0356-resume-flags-override-checkpoint.json`. PR: + https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/239 (`resume-flags-override-checkpoint`). +- Re-run (2026-11-23, after the hand-resolved merge of origin/main): main advanced with PR #240 and the execution branch + gained a merge commit (cd7a63b5) from another push, so the review loop's ledger pushes were rejected and Stage 4 + halted at iteration 2 (DIRTY). Reconciled `executions.jsonl` (rows interleaved by `created_at`) and pushed bf776021, + then resumed `--from-stage review`. Stage 4 reached consensus approval at iteration 4 (claude-agent / + claude-opus-5-5), Stage 5 calibrated (report covers c8ae5770 and is in the PR diff), final head CI passed. PR head + 374ca56f, CLEAN and MERGEABLE. Awaiting human merge. +- Overlap: ran with `--allow-overlap` alongside PRs #230 and #238 (shared `cli/commands/flow.py`). + +## Audit (2026-11-23) + +Bean `0357` removes `--skip-review` entirely, superseding the `skip_review` inheritance clause here while the +agent/model override and per-run switch rules remain. Bundle with `0357` or run right after it; waits for PR #230 +(overlaps `flow/checkpoint.py`, `flow/context.py`, `flow/pipeline.py`). + +## Resolution + +Delivered via [PR #239](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/239) and merged into `main` +(`4e1e761`): + +- **Key Architectural Deliverables**: Per-run switches (`skip_review`, `skip_calibrate`, `skip_push`, `dry_run`) apply + only to the run that passes them and are no longer read from the checkpoint; a resume logs any stored skip it drops. + `--agent` and `--model` on resume override the checkpoint's agent and model. +- **Verification & Tests**: Resume checkpoint tests in `apps/sandbox-executor/tests/flow/test_resume_checkpoint.py` and + `apps/sandbox-executor/tests/test_cli.py` updated for the new precedence; final head CI passed before merge. +- **Holon Flow Traversal**: All 5 stages completed. Stage 4 reached consensus approval at iteration 4; Stage 5 + calibrated (`E-1795390891-CLA-CO5.5`). diff --git a/.beans/holon-agentic-coder-ref-metadata-0357--remove-the-skip-review-flag-from-holon-flow.md b/.beans/holon-agentic-coder-ref-metadata-0357--remove-the-skip-review-flag-from-holon-flow.md new file mode 100644 index 0000000..76874e2 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0357--remove-the-skip-review-flag-from-holon-flow.md @@ -0,0 +1,53 @@ +--- +# holon-agentic-coder-ref-metadata-0357 +title: "Remove the --skip-review flag from holon flow" +status: completed +type: task +priority: high +tags: + - flow + - stage-4 + - holon-agentic-coder +created_at: 2026-11-21T23:45:00+11:00 +updated_at: 2026-11-23T00:08:00Z +pr: https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/238 +--- + +## Problem + +`holon flow --skip-review` skips Stage 4 and still runs Stage 5 calibration, CI waits and PR verification. On 2026-11-21 +a subagent used it after every review attempt stalled, and PR #228 reached calibrated, green and mergeable with no +consensus review. The maintainer's ruling (2026-11-21): there is no case where `--skip-review` is necessary. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- Remove the `--skip-review` option from `holon flow` (`cli/commands/flow.py`), the `skip_review` field from the flow + context and checkpoint (old checkpoints that still carry it must load, ignoring the key), and the skip branches in + `flow/pipeline.py`, `flow/resume_guard.py`, `flow/stages/children.py` and `flow/stages/review.py`. +- Remove the matching tests and the `--skip-review` mentions in `docs/git_flow.md`. +- A Stage 4 that fails or stalls halts the flow with the failure reported; nothing downstream runs without consensus. +- Hermetic tests: `holon flow --skip-review` is rejected as an unknown argument; a checkpoint with `skip_review: true` + resumes and runs Stage 4. + +## Notes + +- Harness rule, done 2026-11-21: `AGENTS.md` and `.agents/holon-flow.md` forbid `--skip-review` outright. +- Supersedes the `--skip-review` wording in Bean 0356 (its checkpoint-inheritance fix for `skip_review` becomes moot + once the flag is gone; its agent/model part stays). +- Related: Bean 0356 (resume inherits state from the checkpoint). + +## Resolution + +Delivered via [PR #238](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/238) and merged into `main` +(`8afc215a`), squash-merged by the maintainer: + +- **Key Architectural Deliverables**: `--skip-review` removed from `holon flow` (`cli/commands/flow.py`); `skip_review` + dropped from the flow context and checkpoint (old checkpoints still load, ignoring the key); skip branches removed + from `flow/pipeline.py`, `flow/resume_guard.py`, `flow/stages/children.py` and `flow/stages/review.py`; + `docs/git_flow.md` updated. A Stage 4 that fails or stalls now halts the flow. +- **Verification & Tests**: Hermetic tests cover `--skip-review` rejection as an unknown argument and resume of a + checkpoint carrying `skip_review: true` into Stage 4. +- **Holon Flow Traversal**: Run as intent `I-1795388476-remove-skip-review-flag`, plan `P-1795388496-CLA-CO5.5`, + execution `E-1795388672-CLA-CO5.5`; calibration report included in the PR. diff --git a/.beans/holon-agentic-coder-ref-metadata-0358--resolver-backgrounds-tests-and-stalls.md b/.beans/holon-agentic-coder-ref-metadata-0358--resolver-backgrounds-tests-and-stalls.md new file mode 100644 index 0000000..18de07a --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0358--resolver-backgrounds-tests-and-stalls.md @@ -0,0 +1,89 @@ +--- +# holon-agentic-coder-ref-metadata-0358 +title: "Stage 4 resolver backgrounds the test suite and ends its turn, so the 90 s stall budget kills it" +status: completed +type: bug +priority: high +tags: + - flow + - stage-4 + - resolver + - budgets + - holon-agentic-coder +created_at: 2026-11-22T00:30:00+11:00 +updated_at: 2026-11-23T10:45:00+11:00 +--- + +## Problem + +On 2026-11-21, the PR #230 review loop (`review-approved-and-fresh-tests`) failed twice at 12:52 and 13:23 UTC, the same +way each time: + +1. The claude-opus-5-5 resolver applied its findings. +2. It ran `uv run task test` in the background and ended its turn: "I'll get a notification when `uv run task test` + finishes". +3. The turn supervisor saw no output and stopped the agent: "turn stall budget of 90 s exceeded after 90.5 s". + +The loop then halted. Nothing in the container ever delivers the notification the agent is waiting for, so the pattern +can never succeed. The antigravity runner has the same shape: it backgrounds a long command, exits, and leaves an empty +diff (Bean 0349). + +The workaround used for #230 was to resume with `HOLON_TURN_STALL_SECONDS=900`. `HOLON_*` variables are passed into role +containers. + +## Action + +Through the Holon flow on `holon-agentic-coder`: + +- **Turn budgets (Part 1, merged via PR #235, 134e333d):** `_run_resolver_agent` in `entrypoint/review_loop.py` passes + `turn_budgets=load_budgets(os.environ).turn` to `run_turn(...)`, matching executor, planner and reviewer turns, with a + hermetic unit test. +- **Prompts:** the resolver, executor and review-loop prompt templates (`holon-config/prompts/`) tell the agent to run + tests and lint in the foreground and wait for the result inside the same turn. Never background a command and end the + turn. Use the bounded commands the repo provides (`uv run task test` / a targeted `uv run pytest`). +- **Supervisor:** while the agent has a child test or lint process running, the stall budget does not fire. The process + is visible as a running tool call or child process. The turn timeout still bounds it. Alternatively, a turn that ends + with background work still running counts as unfinished and is resumed or re-prompted, not killed as stalled. Decide + which in the plan. +- **Logging:** log a clear message when a turn ends with background processes still running, naming the command. +- **Hermetic tests:** + - a resolver turn that runs a 3-minute fake test in the foreground is not killed at 90 s; + - a turn that backgrounds a command and exits is reported clearly, not as a bare stall; + - the prompt templates contain the foreground rule. + +## Notes + +- Related: Bean 0349 (antigravity backgrounding), Bean 0172 (stage and turn budgets), Bean 0354 (local test gate). + +## Progress + +- 2026-11-22: Started part 1 (resolver honours turn budgets only: `_run_resolver_agent` passes `turn_budgets`; the + background-tests and stall-supervisor work stays in later parts). Flow `resolver-honours-turn-budgets` launched with + `--allow-overlap` (maintainer-authorised for this flow only; overlaps PR #230 on `entrypoint/review_loop.py`). +- 2026-11-22: Completed part 1 only (resolver honours turn budgets: `_run_resolver_agent` now passes the loaded `turn` + budgets, with hermetic tests). Flow `resolver-honours-turn-budgets` reached Stage 4 consensus APPROVED 3/3 at + iteration 3 (0 critical, 0 important, 0 nit), CI 11/11 green, calibration included in the PR diff, PR #235 + MERGEABLE/CLEAN, awaiting human merge into main. Background-tests and stall-supervisor work remains for later parts. +- 2026-11-22: PR #235 merged into main (`134e333d`), holon CLI & Docker images rebuilt, and flow worktree pruned. Part 2 + (foreground test prompt and supervisor background-process guard) remains open. +- 2026-11-23: Started part 2 (foreground test prompts and supervisor guard for a live child process or background + command). Flow `resolver-foreground-tests-stall` launched with `--allow-overlap` (intent + `todo/intent-0358-resolver-foreground-tests-stall.json`). +- 2026-11-23: Part 2 flow `resolver-foreground-tests-stall` completed all five stages: Stage 4 consensus APPROVED 3/3 at + iteration 2 (0 critical, 0 important, 0 nit), calibration included in the PR diff, CI clean, PR #237 MERGEABLE/CLEAN, + awaiting human merge into main: https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/237 + +## Resolution + +Delivered via [PR #237](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/237) and merged into `main` +(`032d9d44`): + +- **Key Architectural Deliverables**: Stage 4 resolver and executor prompt templates now require running tests and lint + in the foreground and waiting for the result in the same turn; the turn supervisor does not apply the stall budget + while a child test or lint process is live; a turn that ends with background work still running is logged naming the + command. +- **Verification & Tests**: Hermetic tests cover a 3-minute foreground fake test not killed at 90 s, a backgrounded + command reported clearly rather than as a bare stall, and the foreground rule present in the prompt templates. +- **Holon Flow Traversal**: Flow `resolver-foreground-tests-stall` completed all five stages (Intent -> Plan -> Execute + -> Review Loop -> Calibration); Stage 4 consensus APPROVED 3/3 at iteration 2 with 0 critical, 0 important, 0 nit + findings. diff --git a/.beans/holon-agentic-coder-ref-metadata-0359--pr-230-deferred-findings.md b/.beans/holon-agentic-coder-ref-metadata-0359--pr-230-deferred-findings.md new file mode 100644 index 0000000..618535f --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0359--pr-230-deferred-findings.md @@ -0,0 +1,48 @@ +--- +# holon-agentic-coder-ref-metadata-0359 +title: "PR #230 deferred findings" +status: completed +type: task +priority: low +tags: + - holon-agentic-coder + - pr-230 + - review + - deferred +created_at: 2026-11-22T09:45:00Z +updated_at: 2026-11-23T03:43:50Z +--- + +Deferred findings collected during the `Holon-Agentic-Coder/holon-agentic-coder` PR #230 review loop (outside the +reviewed increment). + +## Deferred findings + +- **D-1** (`apps/sandbox-executor/src/sandbox_executor/cli/commands/flow.py:344-352`, `_report_review_outcome`, flagged + at iteration 5 head `ef0de8009c773e8f742d7eda59fee5bf57375d64`): Line 345 checks + `review_res.payload.get("halted_for_human") and consensus.get("approved")`, whereas line 352 checks + `review_res.status == StageStatus.HALTED_FOR_HUMAN or review_res.payload.get("halted_for_human")`. A synthetic or + stripped `StageResult` with `status=StageStatus.HALTED_FOR_HUMAN` and `payload={"consensus": {"approved": True}}` + without `halted_for_human` in `payload` falls through to the `[SAFETY HALT]` branch rather than `[REVIEW APPROVED]`. + Deferred because `cli/commands/flow.py` was unchanged in increment `a2b8c26..ef0de80` and real legacy checkpoints set + `"halted_for_human": True`. + +## Notes + +- Target repository: `Holon-Agentic-Coder/holon-agentic-coder` (follow-up via `holon flow` once PR #230 lands). +- When resolving, check whether legacy `halted_for_human` handling should treat + `review_res.status == StageStatus.HALTED_FOR_HUMAN and consensus.get("approved")` consistently with line 352 and add a + unit test covering that behaviour. + +## Resolution + +Delivered via [PR #246](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/246) and merged into `main` +(`16f4f629`): + +- **Key Architectural Deliverables**: `_report_review_outcome` in `cli/commands/flow.py` now decides approval and halt + from the same signal, so an approved review that arrives as `HALTED_FOR_HUMAN` with `consensus.approved` is reported + as `[REVIEW APPROVED]` rather than `[SAFETY HALT]`. Hermetic test added in `tests/test_review_loop_approved.py`. +- **Verification & Tests**: hermetic regression test for the approved-but-`HALTED_FOR_HUMAN` case; CI green and review + approved before merge. +- **Holon Flow Traversal**: all 5 stages (Intent -> Plan -> Execute -> Review Loop -> Calibration) completed via + `holon flow`; calibration report included in the merged diff. diff --git a/.beans/holon-agentic-coder-ref-metadata-0360--resume-after-interrupted-plan-stage-creates-duplicate-p-branch.md b/.beans/holon-agentic-coder-ref-metadata-0360--resume-after-interrupted-plan-stage-creates-duplicate-p-branch.md new file mode 100644 index 0000000..54529bd --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0360--resume-after-interrupted-plan-stage-creates-duplicate-p-branch.md @@ -0,0 +1,33 @@ +--- +# holon-agentic-coder-ref-metadata-0360 +title: "Resume after an interrupted plan stage creates a duplicate P- branch" +status: todo +type: bug +priority: high +tags: + - flow + - checkpoint + - stage-2 + - holon-agentic-coder +created_at: 2026-11-23T00:10:00Z +updated_at: 2026-11-23T00:10:00Z +--- + +## Problem + +When `holon flow` is killed after Stage 2 has pushed its `P-.../_` branch but before the checkpoint advances past +`plan`, resuming with `--from-stage plan --checkpoint ` runs planning again. That creates a second `P-.../_` +branch under the same intent, and the plan stage then refuses with "ambiguous P-branches". Seen on 2026-11-23 for the +`resume-flags-override-checkpoint` flow (PR #239): the stale plan branch `P-1795388515` remains on origin, and the flow +only continued after a hand edit of the checkpoint (advance to `execute` with `plan_branch` set to the newer +`P-1795390638`). + +## Goal + +Stage 2 records its pushed plan branch in the checkpoint atomically with the push, or a resume from `plan` detects an +existing pushed plan branch for the intent and adopts it instead of planning again. No duplicate P- branch, and no hand +edit of the checkpoint. + +## Notes + +- About a dozen flows were stopped mid Stage 2 on 2026-11-23 (machine load), so each resume may hit this. diff --git a/.beans/holon-agentic-coder-ref-metadata-0361--fish-conda-homebrew-shell-hooks-and-clean-shell-tests.md b/.beans/holon-agentic-coder-ref-metadata-0361--fish-conda-homebrew-shell-hooks-and-clean-shell-tests.md new file mode 100644 index 0000000..c714053 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0361--fish-conda-homebrew-shell-hooks-and-clean-shell-tests.md @@ -0,0 +1,132 @@ +--- +# holon-agentic-coder-ref-metadata-0361 +title: "Restore Fish Conda and Homebrew hooks and add clean-env multi-shell runtime regression tests" +status: completed +type: bug +priority: high +tags: + - target:dev-env + - fish + - conda + - homebrew + - shell-parity + - tests +created_at: 2026-11-22T23:48:00Z +updated_at: 2026-11-23T01:42:00Z +pr: https://github.com/thomashan/dev-env/pull/33 +--- + +## Problem + +1. `dev-env` PR #18 (`0a4771e`) deleted the Conda shell hook, `brew shellenv`, and NVM PATH prepend from + `dotfiles/fish/.config/fish/config.fish`, turning `test_conda_path_parity_between_ansible_and_fish` and + `test_node_bin_is_first_on_path` in `tests/test_manifest.py` into negative assertions forbidding them in + `config.fish`. +2. PR #20 (_multi-shell parity_) restored Conda and Homebrew hooks in `dotfiles/bash/.bashrc` and `dotfiles/zsh/.zshrc` + alongside what it assumed was already in `dotfiles/fish/.config/fish/conf.d/00-devenv.fish`, and its parity test + (`test_multishell_conda_and_homebrew_parity`) checked only `.bashrc` and `.zshrc`. +3. PR #22 (_mamba-ansible_) added only `micromamba` discovery and hooking to `00-devenv.fish`, leaving macOS + Miniforge/`conda` (and Homebrew `brew shellenv`) unhooked in Fish. +4. All existing shell tests in `tests/` are static substring greps; no test spawns a clean (`env -i`) login/interactive + shell for Bash, Zsh, and Fish, `ansible/roles/conda/tasks/main.yml` only tests `{{ devenv_conda_bin }} --version` by + absolute path, `ansible/roles/fish/tasks/main.yml` only runs `fish -n`, and CI (`make.yml`) only runs + `make check-mode --tags dotfiles`. +5. Consequently, in a clean login Fish terminal on macOS, `which conda` passes only via Homebrew's + `/opt/homebrew/bin/conda` symlink -> `/opt/homebrew/Caskroom/miniforge/base/condabin/conda`, while `CONDA_SHLVL` and + `CONDA_DEFAULT_ENV` stay unset, `conda` is a raw binary instead of a shell function, and + `/opt/homebrew/Caskroom/miniforge/base/bin` is never on `$PATH` (so `conda install pipx` succeeds yet `pipx` fails + with `fish: Unknown command: pipx`). +6. Separately, in `.bashrc` and `.zshrc`, the Conda/Micromamba hook runs _after_ the `$NVM_DIR/current/bin` PATH + prepend, which allows `conda activate base` to place `miniforge/base/bin` ahead of NVM-managed Node. + +## Action + +Through the 5-stage Holon flow on `thomashan/dev-env`: + +1. **`dotfiles/fish/.config/fish/conf.d/00-devenv.fish`** (keeping `config.fish` pure so existing `config.fish` tests + remain satisfied): + - Add OS-guarded (`switch "$devenv_os"`) Homebrew/Linuxbrew evaluation (`brew shellenv | source`): + - `case Darwin`: `/opt/homebrew/bin/brew` (if not already in `$PATH`) and `/usr/local/bin/brew`. + - `case Linux`: `/home/linuxbrew/.linuxbrew/bin/brew`, `$HOME/.linuxbrew/bin/brew`, and + `/home/linuxbrew/.linuxbrew/bin` / `/home/linuxbrew/.linuxbrew/sbin` fallback. + - Add Conda root discovery probing `$MAMBA_ROOT_PREFIX`, `$HOME/.local/share/mamba`, `$HOME/micromamba`, + `$HOME/miniforge3`, `$HOME/miniforge`, `$HOME/mambaforge`, `case Darwin`-guarded + `/opt/homebrew/Caskroom/miniforge/base` and `/usr/local/Caskroom/miniforge/base`, `/opt/miniforge3`, `/opt/conda`, + `$HOME/anaconda3`, and `$HOME/miniconda3`. On the first root where `test -x "$conda_root/bin/conda"`, evaluate + `"$conda_root/bin/conda" shell.fish hook 2>/dev/null | source` (valid Fish syntax, never POSIX `eval "$(...)"`) and + track `conda_hook_activated 1`. + - Guard the `micromamba` fallback (`alias conda=micromamba` + `micromamba shell hook --shell fish | source`) on + `test $conda_hook_activated -eq 0`. + - Re-assert `fish_add_path -gpPm "$XDG_DATA_HOME/nvm/current/bin"` and `fish_add_path -gpPm "$HOME/.local/bin"` + **after** both Homebrew and Conda/Micromamba hooks so NVM-managed Node always wins ahead of Homebrew and Conda. +2. **`dotfiles/bash/.bashrc` and `dotfiles/zsh/.zshrc`**: + - Re-assert `$NVM_DIR/current/bin` and `$HOME/.local/bin` at the front of `$PATH` **after** the Conda/Micromamba hook + block so `conda activate base` never puts `miniforge/base/bin` ahead of NVM-managed Node (while preserving + non-interactive PATH setup and `test_multishell_nvm_and_node_parity`). +3. **`ansible/roles/conda/tasks/main.yml`**: + - Add clean-environment + (`env -i HOME="{{ devenv_home }}" USER="{{ ansible_facts['user_id'] | default(lookup('env', 'USER')) }}" PATH=...`) + runtime verification probes and assertions across available shells (`fish`, `zsh`, `bash`) — guarded by + `when: not ansible_check_mode` (and shell-present checks), with `changed_when: false`, `check_mode: false` on + read-only probes — verifying `conda` is a shell function, `CONDA_DEFAULT_ENV` is non-empty, and + `{{ devenv_conda_dir }}/bin` is on `$PATH`. +4. **`tests/test_shell_hooks.py`** (new module; keep `tests/test_manifest.py` <= 1,000 lines; generate fake scripts + dynamically under `tmp_path` so zero `.sh` files are tracked in git): + - **Static 3-shell parity checks**: assert `.bashrc`, `.zshrc`, and `00-devenv.fish` all evaluate OS-guarded Homebrew + `brew shellenv`, probe Conda roots (with macOS Caskroom inside `case Darwin` / `Darwin)`), invoke the shell's Conda + hook (`shell.bash hook`, `shell.zsh hook`, `shell.fish hook` piped to `source`), and re-assert NVM `current/bin` + precedence _after_ both Homebrew and Conda hooks. + - **Clean-env (`env -i`) runtime shell execution tests** in a hermetic `tmp_path` `$HOME` symlinking the repo's real + dotfiles, with fake `$HOME/miniforge3/` (`bin/conda` implementing `shell.bash`/`shell.zsh`/`shell.fish` hooks, + `condabin/conda`, `bin/pipx`, and a competing `bin/node`), fake `$HOME/.local/share/nvm/current/bin/node`, and a + Homebrew-style symlink `/bin/conda -> /miniforge3/condabin/conda` on the initial minimal `PATH` + (reproducing the exact masking bug): + - Exercise `bash -lic`, `zsh -lic` (and `zsh -lc`), and `fish -lc` + `fish -ic` under minimal `env -i`. + - Assert `CONDA_SHLVL == "1"`, `CONDA_DEFAULT_ENV == "base"`, `conda` is a shell function, `pipx` resolves inside + `/miniforge3/bin/pipx` and executes, and `node` resolves to + `/.local/share/nvm/current/bin/node`. + - Run `fish -n` on `config.fish` and `00-devenv.fish`. + - Verify clean-env `micromamba` fallback when no `bin/conda` exists. + - Fail closed in CI (`os.environ.get("CI") == "true"` and `os.environ.get("HOLON_IN_SANDBOX") != "1"`) if `bash`, + `zsh`, or `fish` is missing rather than skipping silently. +5. **`.github/workflows/test-unit.yml`**: + - Install `fish` and `zsh` on `ubuntu-latest` (`sudo apt update && sudo apt install -y fish zsh`) and `fish` on + `macos-latest` (`brew install fish`) prior to running pytest so CI exercises all three real shells on both OSes. + - Add a static assertion in `tests/test_shell_hooks.py` verifying `.github/workflows/test-unit.yml` installs `fish` + (and `zsh` on Ubuntu). + +## Acceptance Criteria + +- Stage 2 plan declares a `## Touch Set` section listing all created/modified repo-relative paths. +- `tests/test_manifest.py` remains <= 1,000 lines and zero `.sh` files are added outside `dotfiles/examples/`. +- Clean-env (`env -i`) runtime shell tests pass across real `bash`, `zsh`, and `fish` verifying `CONDA_SHLVL=1`, + `CONDA_DEFAULT_ENV=base`, `conda` as a shell function, `pipx` on `$PATH`, and NVM `node` ahead of Conda `node`. +- `uv run --extra test pytest -m "not network"`, `uv run --extra test ruff check .`, `uv run --extra test ansible-lint`, + `npx prettier --check "**/*.md"`, and `make check-syntax` pass cleanly. + +## Progress + +- 2026-11-23: Logged bean, wrote `todo/intent-0360-fish-conda-homebrew-hooks.json`, and launched Holon flow + `fish-conda-homebrew-hooks` on `/Users/thomashan/git/dev-env/main` (`antigravity-agent` / `gemini-4-argon`). +- 2026-11-23: Flow `fish-conda-homebrew-hooks` (`antigravity-agent` / `gemini-4-argon`) completed all 5 stages and + opened [PR #33](https://github.com/thomashan/dev-env/pull/33) (head `aa3b72e`): Stage 4 consensus APPROVED 3/3 (0 + critical, 0 important, 0 nit), Stage 5 calibration report included in PR diff (predicted EV 92.88, actual 94.53, delta + +1.65; touch-set precision/recall 100%), all 6 post-calibration CI checks green (including `test-unit` installing and + executing real `bash`/`zsh`/`fish` on `ubuntu-latest` and `macos-latest`), `MERGEABLE`/`CLEAN`, awaiting human + maintainer merge. (Renumbered from 0360 to 0361 after concurrent commit `a8006b2` claimed 0360.) + +## Resolution + +Delivered via [PR #33](https://github.com/thomashan/dev-env/pull/33) and merged into `main` (`425ff6fe`): + +- **Key Architectural Deliverables**: Restored OS-guarded Homebrew `brew shellenv` and Conda/Miniforge + `conda shell.fish hook | source` (with guarded `micromamba` fallback) in + `dotfiles/fish/.config/fish/conf.d/00-devenv.fish`, enforced NVM-over-Conda PATH ordering across Fish/Bash/Zsh, and + added read-only clean-environment (`env -i`) shell verification probes in `ansible/roles/conda/tasks/main.yml`. +- **Verification & Tests**: Added `tests/test_shell_hooks.py` (3-shell static parity, hermetic `env -i` + `bash`/`zsh`/`fish` runtime execution reproducing the Homebrew symlink masking scenario, `fish -n` syntax, + `micromamba` fallback, and fail-closed CI shell checks) and updated `.github/workflows/test-unit.yml` to install + `fish`/`zsh` on Ubuntu and `fish` on macOS (`6/6` CI checks green). +- **Holon Flow Traversal**: Completed all 5 stages (`I-1795391675-fish-conda-homebrew-hooks`, `P-1795391695-ANA-G4A`, + `E-1795391884-ANA-G4A`), Stage 4 consensus APPROVED 3/3 (0 findings), Stage 5 calibrated (EV predicted `92.88`, actual + `94.53`, delta `+1.65`; touch-set 100%). diff --git a/.beans/holon-agentic-coder-ref-metadata-0362--clear-stale-calibration-warning-when-fresh-calibration-lands.md b/.beans/holon-agentic-coder-ref-metadata-0362--clear-stale-calibration-warning-when-fresh-calibration-lands.md new file mode 100644 index 0000000..a3a0764 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0362--clear-stale-calibration-warning-when-fresh-calibration-lands.md @@ -0,0 +1,63 @@ +--- +# holon-agentic-coder-ref-metadata-0362 +title: "Clear the stale-calibration warning when a fresh calibration lands" +status: completed +type: bug +priority: high +tags: + - flow + - calibration + - stage-5 + - github + - holon-agentic-coder +created_at: 2026-11-23T03:20:00Z +updated_at: 2026-11-23T04:40:00Z +--- + +## Problem + +`flow/calibrate_rerun.py` (around line 189) posts a PR comment headed "⚠️ Calibration report is stale" when +non-calibration commits land after the evaluated commit ("Stage 5 must rerun; do not merge on this report"). When Stage +5 then reruns and commits a fresh report covering the head, nothing clears, edits or supersedes that comment, so the PR +keeps telling the maintainer not to merge. + +Seen on PR #243 (2026-11-23): warnings at 02:46:50 (report `8048484`, head `a8d0eae`) and 03:05:31 (report `8048484`, +head `58fe0be`). Stage 5 reran at 03:05:55 and the new report evaluated `25099f0a`, the last non-calibration commit, so +the merged report was current. Both warnings stayed on the PR and were the last word on it. + +## Goal + +- When a calibration report lands whose evaluated commit covers every non-calibration commit on the head, each earlier + stale-calibration comment on the PR is resolved: edited in place (or minimised as outdated) to say it is superseded, + naming the fresh report's evaluated SHA. +- A still-stale state keeps a single current warning (update the existing comment rather than adding another). +- Unit tests cover: warn → fresh calibration → warning marked superseded; warn → more commits → one updated warning; no + warning when the report is current. Extend `tests/test_calibrate_rerun.py`. + +## Flow + +- Intent: `todo/intent-0362-clear-stale-calibration-warning.json` +- PR: https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/247 (review approved at iteration 3, calibration + included in PR diff, MERGEABLE/CLEAN) +- Stage 4 halted once on merge conflicts with main (ledgers only, resolved mechanically) and once on a flaky + `test_url_message_fuzz` unit case (rerun passed, unrelated to the change). + +## Notes + +- Comment edits go through the existing GitHub posting path; keep a single place that owns the warning's lifecycle. + +## Resolution + +Delivered via [PR #247](https://github.com/Holon-Agentic-Coder/holon-agentic-coder/pull/247) and merged into `main` +(`79555f8`): + +- **Key Architectural Deliverables**: new `flow/calibrate_stale_warning.py` owns the stale-calibration warning + lifecycle; `calibrate_rerun.py` delegates to it. A fresh calibration covering the head edits earlier stale warnings in + place as superseded (marker kept, evaluated SHA named); a still-stale state keeps one updated warning instead of + adding another; the GitHub comment lister returns comment ids so edits go through `gh api`. +- **Verification & Tests**: hermetic tests in `tests/test_calibrate_rerun.py` (fake lister, poster and editor seams) + cover warn → fresh calibration → superseded, warn → more commits → one updated warning, and no warning when current. + Also `tests/test_approval_invalidation.py`. +- **Holon Flow Traversal**: Intent, plan, execute and review completed (approved at review iteration 3, after one + merge-conflict halt on ledgers and one unrelated flaky test rerun); calibration report `E-1795405033` is in the merged + diff. diff --git a/.beans/holon-agentic-coder-ref-metadata-0363--wait-for-ci-after-merging-main-and-restart-review-on-failure.md b/.beans/holon-agentic-coder-ref-metadata-0363--wait-for-ci-after-merging-main-and-restart-review-on-failure.md new file mode 100644 index 0000000..6570935 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0363--wait-for-ci-after-merging-main-and-restart-review-on-failure.md @@ -0,0 +1,55 @@ +--- +# holon-agentic-coder-ref-metadata-0363 +title: "After merging main, wait for CI before calibrating; restart PR review from the start if CI breaks" +status: in-progress +type: bug +priority: high +tags: + - flow + - stage-4 + - stage-5 + - ci + - calibration + - holon-agentic-coder +created_at: 2026-11-23T03:30:00Z +updated_at: 2026-11-23T03:30:00Z +--- + +## Problem + +After Stage 4 reaches consensus, the flow merges `origin/main` into the PR branch and goes straight to Stage 5, pushing +calibration commits without waiting for CI on the merged head. An approval can therefore be calibrated on code CI never +passed. + +Seen on PR #244 (2026-11-23): stress CI passed on `360f8471` (iteration 9) and consensus was reached at iteration 10 +(`aad7dae9`, ledger rows only). At 03:17:47 the flow merged main (`3dc0830c`, which brought in PR #243's env-file +change), then pushed calibration commits up to `575655bb` at 03:18:09. Workspace survival then failed on `575655bb` +(`test_url_message_fuzz.py::test_invalid_envelope_value_never_echoed_by_doctor_or_run_path`, 2/2480 cases with an +invalid `HOLON_TURN_TIMEOUT_SECONDS` value echoed). The flow's guard posted "Ensemble Consensus Approval no longer +stands" at 03:26, but the calibration report was already on the PR. + +## Goal + +1. **Wait for CI on the merged head.** Whenever the flow merges `main` into the PR branch (after consensus or at any + later point before Stage 5), Stage 5 starts only once every CI check on the merged head commit has completed and + passed. Cancelled or superseded runs do not count as passing; the flow waits for (or re-triggers) a run on that exact + head SHA. +2. **CI breaks → review restarts from the beginning.** If any check on the merged head fails, the earlier consensus is + void: the flow returns to the start of Stage 4 (a fresh review loop, iteration counter and reviewer ensemble reset + for the new head) so the failure is reviewed and resolved like any other finding, and must reach a new 3/3 consensus + before Stage 5. The voided approval is recorded in the ledger (append-only; old rows untouched) and the PR comment + says the approval was withdrawn and review restarted. +3. **No merge needed → unchanged.** If the head was already current with `main` and CI on it is green, Stage 5 proceeds + as today. +4. Log which CI run (head SHA, run ids, conclusions) Stage 5 relied on. + +## Tests + +- merge main after consensus → Stage 5 blocked until CI on the merged head is green, then runs; +- merge main → CI fails → review restarts at iteration 1 for the new head, no calibration commit pushed; +- cancelled run on the merged head → treated as not passed (wait or re-run), never as green; +- no merge needed and CI green → Stage 5 runs immediately. + +## Notes + +- Related: bean 0362 (stale-calibration warning lifecycle) and bean 0354 (test gate judges the current head). diff --git a/.beans/holon-agentic-coder-ref-metadata-0364--define-devenv-user-skip-wsl-wizard-gui-prompt-and-test-ansible-vars.md b/.beans/holon-agentic-coder-ref-metadata-0364--define-devenv-user-skip-wsl-wizard-gui-prompt-and-test-ansible-vars.md new file mode 100644 index 0000000..ebc58a3 --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0364--define-devenv-user-skip-wsl-wizard-gui-prompt-and-test-ansible-vars.md @@ -0,0 +1,131 @@ +--- +# holon-agentic-coder-ref-metadata-0364 +title: "Define devenv_user in dev-env, skip WSL GUI terminal wizard prompt, and audit Ansible Jinja variables in tests" +status: completed +type: bug +priority: high +tags: + - target:dev-env + - ansible + - wsl + - wizard + - testing +created_at: 2026-11-23T03:35:00Z +updated_at: 2026-11-23T04:20:00Z +pr: https://github.com/thomashan/dev-env/pull/37 +--- + +## Problem + +1. **Converge crash (`'devenv_user' is undefined`)**: Running `make install` (or any real non-check-mode converge) in + `dev-env` fails on `TASK [conda : Verify Conda activation in a clean Fish login shell]` with: + + ```text + Error while resolving value for 'cmd': 'devenv_user' is undefined + Origin: ansible/roles/conda/tasks/main.yml:258:3 + ``` + + All three clean-shell Conda verification tasks in `ansible/roles/conda/tasks/main.yml` (Fish line 261, Zsh line 297, + Bash line 333) interpolate `USER="{{ devenv_user }}"`, while `ansible/group_vars/all.yml` only defines `devenv_home` + and never defines `devenv_user`. + +2. **Confusing GUI terminal prompt on WSL**: `scripts/devenv_wizard.py` still asks + `Install GUI terminal apps (ghostty, warp)? (true/false) [true]:` whenever `chosen_backend == "apt"` with no WSL + check, even though Ghostty and Warp are unconditionally excluded on WSL in `ansible/roles/packages/tasks/main.yml`. +3. **Test / CI blind spot**: Neither unit tests nor CI caught `'devenv_user' is undefined` because: + - `tests/test_shell_hooks.py` (`test_conda_role_clean_env_shell_verification_tasks`) only inspects raw YAML + substrings (`"env -i" in cmd`) without rendering Jinja2 through Ansible's `Templar`. + - `tests/test_templating.py` only evaluates hand-picked `set_fact` expressions and never renders `command.cmd` task + templates or sweeps role/playbook task files for undefined variables. + - `make check-syntax` (`--syntax-check`) only validates YAML/task structure without evaluating Jinja2 expressions. + - CI `make check-mode` only runs `--tags dotfiles,nvim-sync`, and the clean-shell verify tasks guard on + `when: [not ansible_check_mode, ...]`. + +## Action + +Through the 5-stage Holon flow on `dev-env`: + +1. **`ansible/group_vars/all.yml`**: + - Define `devenv_user: "{{ ansible_facts.user_id | default(ansible_facts.env.USER) }}"` directly below + `devenv_home: "{{ ansible_facts.env.HOME }}"` with a concise comment explaining fact resolution and `env.USER` + fallback. +2. **`scripts/devenv_wizard.py`**: + - Add `is_wsl() -> bool`: return `False` unless `platform.system() == "Linux"`, and `True` on Linux when + `WSL_DISTRO_NAME` or `WSL_INTEROP` is non-empty in `os.environ`, or `"microsoft"` / `"wsl"` appears in + `platform.release().lower()` or `/proc/version` (ignoring `OSError`). + - In `run_wizard()`, preserve the literal `existing_choices.get("devenv_install_gui_casks", True)` line (asserted by + `tests/test_manifest.py:828`), set `install_gui_casks = False` when `is_wsl()` is `True`, and guard the `apt` GUI + terminal prompt with `elif chosen_backend == "apt" and not wsl:` so WSL never prompts + `Install GUI terminal apps (ghostty, warp)? (true/false)` and persists `devenv_install_gui_casks: false`. +3. **`tests/test_templating.py`**: + - Add `test_devenv_user_resolution(templar)` verifying `devenv_user` resolves from `ansible_facts.user_id` and falls + back to `ansible_facts.env.USER`. + - Add `test_conda_clean_env_shell_verification_cmd_templates(templar)` rendering all three + `Verify Conda activation in a clean ... shell` `cmd:` templates from `ansible/roles/conda/tasks/main.yml` through + the real `templar` fixture (with `ansible_facts` + `devenv_conda_has_`, and NO manual `devenv_user` + override) and asserting resolved `HOME="..."` and `USER="..."` values. + - Add `test_all_role_and_playbook_jinja_variables_are_defined(group_vars, os_vars, alias_tables)` walking every task + in `role_task_files()` and `ansible/playbooks/*.yml` (all string fields plus bare `when`, `changed_when`, + `failed_when`, and `assert.that` expressions), parsing Jinja2 ASTs with `jinja2.Environment()` and inspecting AST + `jinja2.nodes.Name` load nodes (NOT accessing deprecated `Templar.environment` under `ansible-core 2.22`), and + verifying every top-level referenced variable is declared in `group_vars/all.yml`, `ansible/vars/*.yml`, task + `register:` / `set_fact` keys, or the explicit Ansible/wizard runtime builtin set (`ansible_facts`, + `ansible_check_mode`, `ansible_playbook_python`, `playbook_dir`, `item`, `omit`, `lookup`, + `devenv_selected_variants`, `devenv_skip_links`). +4. **`tests/test_wizard.py`**: + - Add unit tests for `is_wsl()` across WSL2 kernel release, `WSL_DISTRO_NAME`, `WSL_INTEROP`, `/proc/version`, + bare-metal Linux, and Darwin with `WSL_DISTRO_NAME`. + - Patch `scripts.devenv_wizard.is_wsl` to `False` for the Linux `apt` case in + `test_wizard_gui_apps_prompts_brew_and_apt` so it remains deterministic if pytest runs inside WSL. + - Add `test_wizard_skips_gui_apps_prompt_on_wsl` verifying interactive mode on WSL omits the Ghostty/Warp GUI + terminal prompt and persists `devenv_install_gui_casks: False`. +5. Keep `tests/test_manifest.py` untouched (`<= 1,000` lines) and zero `.sh` files outside `dotfiles/examples/`. + +## Acceptance Criteria + +- Stage 2 plan declares an explicit `## Touch Set` section listing all created/modified repo-relative paths. +- `ansible/group_vars/all.yml` defines `devenv_user` resolving from `ansible_facts.user_id` with + `ansible_facts.env.USER` fallback. +- `scripts/devenv_wizard.py` detects WSL via `is_wsl()`, skips `Install GUI terminal apps (ghostty, warp)?` on WSL, + persists `devenv_install_gui_casks: false` on WSL, and keeps `tests/test_manifest.py` passing unchanged. +- `tests/test_templating.py` renders all three Conda clean-shell `cmd` templates via `templar` and audits every Jinja2 + variable across all role task files and `ansible/playbooks/*.yml` with zero deprecation warnings. +- `tests/test_wizard.py` covers `is_wsl()` and verifies WSL interactive runs skip the GUI terminal prompt and write + `devenv_install_gui_casks: False`. +- `make check-syntax`, `uv run --extra test ruff format --check .`, `uv run --extra test ruff check .`, + `uv run --extra test ansible-lint`, `npx --yes prettier@3 --check "**/*.md"`, and + `uv run --extra test pytest -m "not network"` all pass cleanly with zero deprecation warnings. + +## Notes + +- Target repository: `thomashan/dev-env` (`/Users/thomashan/git/dev-env/main`, at `a9dacf46`). +- Any `dev-env` Holon flow intent JSON MUST instruct the Stage 2 planner to include a `## Touch Set` section listing all + modified/created repo-relative paths. + +## Progress + +- 2026-11-23: Wrote `todo/intent-0364-dev-env-user-and-wsl-wizard.json` and launched Holon flow + `dev-env-user-and-wsl-wizard` off `/Users/thomashan/git/dev-env/main` (`a9dacf46`) with `antigravity-agent` / + `gemini-4-argon`. +- 2026-11-23: Flow `dev-env-user-and-wsl-wizard` (`antigravity-agent` / `gemini-4-argon`) completed all 5 stages and + opened [PR #37](https://github.com/thomashan/dev-env/pull/37) (head `686de567`): Stage 4 consensus 3/3 APPROVED (0 + critical, 0 important, 0 nit), Stage 5 calibration included in PR diff (predicted EV 95.02, actual 95.95, delta +0.93; + touch-set precision/recall 100.0%), all 6 CI checks green (`hygiene`, `make-matrix` `ubuntu-latest` / `macos-latest`, + `test-network`, `test-unit` `ubuntu-latest` / `macos-latest`), `MERGEABLE`/`CLEAN`, awaiting human maintainer merge. + +## Resolution + +Completed via [dev-env PR #37](https://github.com/thomashan/dev-env/pull/37) (merged into `main` as `4b1391c3` on +2026-11-23; head `686de567`): + +- Defined `devenv_user: "{{ ansible_facts.user_id | default(ansible_facts.env.USER) }}"` in `ansible/group_vars/all.yml` + directly under `devenv_home`. +- Added `is_wsl()` detection in `scripts/devenv_wizard.py` and updated `run_wizard()` to persist + `devenv_install_gui_casks: false` and skip the `Install GUI terminal apps (ghostty, warp)?` prompt on WSL while + preserving `tests/test_manifest.py` unchanged. +- Added `test_devenv_user_resolution`, `test_conda_clean_env_shell_verification_cmd_templates`, and + `test_all_role_and_playbook_jinja_variables_are_defined` in `tests/test_templating.py`, plus `test_is_wsl_detection` + and `test_wizard_skips_gui_apps_prompt_on_wsl` in `tests/test_wizard.py`. +- Traversed all 5 Holon flow stages (`antigravity-agent` / `gemini-4-argon`): Stage 4 consensus 3/3 APPROVED (0 + critical, 0 important, 0 nit), Stage 5 calibration included in PR diff (predicted EV 95.02, actual 95.95, delta +0.93; + touch-set precision/recall 100.0%), all 6 CI checks green. diff --git a/.beans/holon-agentic-coder-ref-metadata-0365--disable-expand-argument-vars-on-conda-clean-shell-checks.md b/.beans/holon-agentic-coder-ref-metadata-0365--disable-expand-argument-vars-on-conda-clean-shell-checks.md new file mode 100644 index 0000000..d60f74e --- /dev/null +++ b/.beans/holon-agentic-coder-ref-metadata-0365--disable-expand-argument-vars-on-conda-clean-shell-checks.md @@ -0,0 +1,122 @@ +--- +# holon-agentic-coder-ref-metadata-0365 +title: "Disable expand_argument_vars on dev-env Conda clean-shell command tasks and test via ansible-playbook" +status: completed +type: bug +priority: high +tags: + - target:dev-env + - ansible + - conda + - wsl + - testing +created_at: 2026-11-23T04:24:00Z +updated_at: 2026-11-23T04:57:00Z +pr: https://github.com/thomashan/dev-env/pull/38 +--- + +## Problem + +Real non-check-mode Ansible converges (such as `make install` on WSL) fail at +`TASK [conda : Verify Conda activation in a clean Fish login shell]` with `rc: 1` and empty `stderr`, while `stdout` +prints the parent `Makefile` / `ansible-playbook` `PATH` instead of the clean Fish shell's `$PATH`: + +```text +fatal: [localhost]: FAILED! => { + "cmd": ["env", "-i", ..., "/usr/bin/fish", "-lc", "type -t conda; echo \"ENV=$CONDA_DEFAULT_ENV\"; string join : $PATH"], + "rc": 1, + "stderr": "", + "stdout": "function\nENV=base\n/opt/homebrew/bin:..." +} +``` + +**Root cause:** `ansible.builtin.command` defaults to `expand_argument_vars: true`, which calls Python's +`os.path.expandvars()` on each `argv` element using `ansible-playbook`'s own environment after `shlex.split` strips the +single quotes and _before_ `env -i` launches Fish/Zsh/Bash. In `ansible/roles/conda/tasks/main.yml` (Fish line 264, Zsh +line 300, Bash line 336): + +1. In Fish, `$PATH` was expanded to one single colon-joined parent `PATH` string and passed to `string join : $PATH`. In + Fish, `string join` exits `1` whenever fewer than 2 arguments are provided (zero joins performed), failing the task. +2. In Zsh and Bash, `$PATH` was likewise expanded to `ansible-playbook`'s parent `PATH`, silently asserting against + parent `PATH` instead of the clean shell's `PATH`. + +Tests missed this because `tests/test_shell_hooks.py` invokes `subprocess.run(["env", "-i", ...])` directly in Python +(bypassing `ansible.builtin.command`) and CI `make check-mode` only runs `--tags dotfiles,nvim-sync`. + +## Action + +Through the 5-stage Holon flow on `dev-env`: + +1. **`ansible/roles/conda/tasks/main.yml`**: + - Add `expand_argument_vars: false` under `ansible.builtin.command:` on all three clean-shell verification tasks: + - `Verify Conda activation in a clean Fish login shell` + - `Verify Conda activation in a clean Zsh login interactive shell` + - `Verify Conda activation in a clean Bash login interactive shell` + - Update the Fish command to use `string join : -- $PATH` defensively so no `PATH` entry starting with `-` can be + treated as a flag. +2. **`tests/test_toolchain.py`**: + - Extend `test_ansible_static_task_hygiene()` to strip `{{ ... }}` Jinja blocks from every `ansible.builtin.command` + `cmd` string and assert `cmd_block.get("expand_argument_vars") is False` whenever the remaining string contains + shell variable references matching `r"\$[A-Za-z_{]"`. +3. **`tests/test_shell_hooks.py`**: + - Update `test_conda_role_clean_env_shell_verification_tasks()` to assert + `verify_task["ansible.builtin.command"].get("expand_argument_vars") is False` for all three shells and + `"string join : -- $PATH"` in the Fish command. + - Add `test_ansible_conda_clean_env_shell_verification_playbook(tmp_path: Path)` that executes the actual extracted + clean-shell verification + assert tasks from `ansible/roles/conda/tasks/main.yml` via real `ansible-playbook` + (`gather_facts: true`, `vars_files: [ansible/group_vars/all.yml]`, `-e devenv_home=`, + `-e devenv_conda_dir=/miniforge3`, omitting `-e devenv_user=...`) against + `_build_hermetic_conda_and_nvm_home(tmp_path)` with a polluted parent environment (`PATH` prefixed with + `/fake/polluted/makefile/path:` and `CONDA_DEFAULT_ENV=POLLUTED_PARENT_ENV`). Assert `proc.returncode == 0`, zero + `[DEPRECATION WARNING]` in stderr, Bash assertion execution, and Fish / Zsh assertions when installed (failing + closed in CI when `CI == "true"` and `HOLON_IN_SANDBOX != "1"`). +4. Keep `tests/test_manifest.py` and `tests/test_templating.py` untouched and zero `.sh` files outside + `dotfiles/examples/`. + +## Acceptance Criteria + +- Stage 2 plan declares an explicit `## Touch Set` section listing all created/modified repo-relative paths. +- All three clean-shell Conda verification tasks in `ansible/roles/conda/tasks/main.yml` declare + `expand_argument_vars: false` under `ansible.builtin.command`, and the Fish task uses `string join : -- $PATH`. +- `tests/test_toolchain.py` enforces `expand_argument_vars: false` on every `ansible.builtin.command` task whose `cmd` + contains shell `$VAR` references outside `{{ ... }}`. +- `tests/test_shell_hooks.py` asserts `expand_argument_vars: false` on all three tasks and exercises the real extracted + tasks via `ansible-playbook` against a hermetic fake HOME and polluted parent environment. +- `make check-syntax`, `uv run --extra test ruff format --check .`, `uv run --extra test ruff check .`, + `uv run --extra test ansible-lint`, `npx --yes prettier@3 --check "**/*.md"`, and + `uv run --extra test pytest -m "not network"` all pass cleanly with zero deprecation warnings. + +## Notes + +- Target repository: `thomashan/dev-env` (`/Users/thomashan/git/dev-env/main`, at `4b1391c3`). +- Any `dev-env` Holon flow intent JSON MUST instruct the Stage 2 planner to include a `## Touch Set` section listing all + modified/created repo-relative paths. + +## Progress + +- 2026-11-23: Wrote `todo/intent-0365-dev-env-conda-cmd-no-expand.json` and launched Holon flow + `dev-env-conda-cmd-no-expand` off `/Users/thomashan/git/dev-env/main` (`4b1391c3`) with `antigravity-agent` / + `gemini-4-argon`. +- 2026-11-23: Flow `dev-env-conda-cmd-no-expand` (`antigravity-agent` / `gemini-4-argon`) completed all 5 stages and + opened [PR #38](https://github.com/thomashan/dev-env/pull/38) (head `462fd8f3`): Stage 4 consensus 3/3 APPROVED (0 + critical, 0 important, 0 nit), Stage 5 calibration included in PR diff (predicted EV 96.27, actual 97.28, delta +1.01; + touch-set precision/recall 100.0%), all 6 CI checks green (`hygiene`, `make-matrix` `ubuntu-latest` / `macos-latest`, + `test-network`, `test-unit` `ubuntu-latest` / `macos-latest`), `MERGEABLE`/`CLEAN`, awaiting human maintainer merge. + +## Resolution + +Completed via [dev-env PR #38](https://github.com/thomashan/dev-env/pull/38) (merged into `main` as `68ddec98` on +2026-11-23; head `462fd8f3`): + +- Set `expand_argument_vars: false` under `ansible.builtin.command:` on all three clean-shell Conda verification tasks + (Fish, Zsh, Bash) in `ansible/roles/conda/tasks/main.yml`, and switched Fish to `string join : -- $PATH` so + `ansible-playbook` no longer expands `$PATH` / `$CONDA_DEFAULT_ENV` from the parent environment before `env -i` runs. +- Extended `test_ansible_static_task_hygiene()` in `tests/test_toolchain.py` to require `expand_argument_vars: false` on + every `ansible.builtin.command` task whose `cmd` contains shell `$VAR` references outside Jinja `{{ ... }}` blocks. +- Updated `test_conda_role_clean_env_shell_verification_tasks()` and added + `test_ansible_conda_clean_env_shell_verification_playbook()` in `tests/test_shell_hooks.py` to execute the extracted + Conda verification tasks via real `ansible-playbook` against a hermetic fake HOME with a polluted parent `PATH` and + `CONDA_DEFAULT_ENV`. +- Traversed all 5 Holon flow stages (`antigravity-agent` / `gemini-4-argon`): Stage 4 consensus 3/3 APPROVED (0 + critical, 0 important, 0 nit), Stage 5 calibration included in PR diff (predicted EV 96.27, actual 97.28, delta +1.01; + touch-set precision/recall 100.0%), all 6 CI checks green. diff --git a/AGENTS.md b/AGENTS.md index 3e1c9ca..1de9465 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,6 +38,11 @@ These apply to every task. Each links to the file that holds the full rule. flow, driven with `holon flow `; never hand-patch a target repository outside it. The harness files in this repository (`.beans/`, `.agents/`, `AGENTS.md`) stay directly editable. See [holon-flow.md](.agents/holon-flow.md). +- **Never pass `--skip-review`** (to `holon flow` or any wrapper). No case needs it (maintainer, 2026-11-21); if Stage 4 + fails or stalls, halt and report instead of bypassing review. See [holon-flow.md](.agents/holon-flow.md). +- **Default Holon coding model**: use `antigravity-agent` with `gemini-4-argon` for all Holon coding tasks until tokens + run out, then fall back to `gemini-4-hydrogen` $\rightarrow$ `gemini-3.8-flash` (maintainer, 2026-11-22). See + [holon-flow.md](.agents/holon-flow.md). - **Never merge a PR that targets `main`**, enable auto-merge or use the merge queue; the human maintainer merges. Stop after consensus approval and calibration, and report. See [pr-merging.md](.agents/pr-merging.md). - **One worktree per agent**, named for the flow or bean; the `main` worktrees are off-limits (never edit, stage, commit diff --git a/tests/test_bean_progress.py b/tests/test_bean_progress.py new file mode 100644 index 0000000..20d9859 --- /dev/null +++ b/tests/test_bean_progress.py @@ -0,0 +1,562 @@ +"""Unit tests for bean_progress in-flight dashboard (bean-progress skill).""" + +from __future__ import annotations + +import json +import sys +from datetime import UTC, datetime +from pathlib import Path + +SCRIPT_DIR = Path(__file__).resolve().parent.parent / ".agents" / "skills" / "bean_progress" / "scripts" +if str(SCRIPT_DIR) not in sys.path: + sys.path.insert(0, str(SCRIPT_DIR)) + +import bean_progress # noqa: E402 + + +def _make_bean(beans_dir: Path, num: str, slug: str, frontmatter: str) -> Path: + path = beans_dir / f"holon-agentic-coder-ref-metadata-{num}--{slug}.md" + path.write_text( + f"---\n# holon-agentic-coder-ref-metadata-{num}\n{frontmatter}\n---\n\n## Action\n", encoding="utf-8" + ) + return path + + +class TestParseFrontmatter: + """Verify folded multiline scalars, sequence lists, and edge cases.""" + + def test_multiline_title_and_lists(self) -> None: + content = ( + "---\n" + "# comment line\n" + "title:\n" + ' "Decompose the intent and\n' + ' plan stage modules"\n' + "status: in-progress\n" + "tags:\n" + " - refactor\n" + " - holon-agentic-coder\n" + "blocked_by:\n" + " - holon-agentic-coder-ref-metadata-0190\n" + "---\n" + ) + fm = bean_progress.parse_frontmatter(content) + assert fm["title"] == "Decompose the intent and plan stage modules" + assert fm["status"] == "in-progress" + assert fm["tags"] == ["refactor", "holon-agentic-coder"] + assert fm["blocked_by"] == ["holon-agentic-coder-ref-metadata-0190"] + + def test_missing_frontmatter(self) -> None: + assert bean_progress.parse_frontmatter("# Not frontmatter\n") == {} + + +class TestExclusionAndCorrelation: + """Strict exclusion of completed/scrapped beans and grouping across artifacts.""" + + def test_excludes_completed_and_scrapped_even_with_stale_flow_and_pr(self, tmp_path: Path) -> None: + beans_dir = tmp_path / ".beans" + beans_dir.mkdir() + _make_bean(beans_dir, "0199", "done-bean", "title: Done work\nstatus: completed\n") + _make_bean(beans_dir, "0200", "scrapped-bean", "title: Scrapped work\nstatus: scrapped\n") + _make_bean(beans_dir, "0354", "active-bug", "title: Active bug\nstatus: in-progress\n") + _make_bean(beans_dir, "0351", "todo-with-wt", "title: Todo with worktree\nstatus: todo\n") + _make_bean( + beans_dir, "0353", "orphan-in-progress", "title: Needs worktree\nstatus: in-progress\ntags:\n - harness\n" + ) + + beans = bean_progress.scan_beans(beans_dir) + intents = [ + bean_progress.IntentMapping(path=tmp_path / "intent-0199-done.json", slug="done", bean_nums=["0199"]), + bean_progress.IntentMapping( + path=tmp_path / "intent-0199-0354-mixed.json", + slug="mixed-flow", + bean_nums=["0199", "0354"], + ), + bean_progress.IntentMapping(path=tmp_path / "intent-0351-todo.json", slug="todo-flow", bean_nums=["0351"]), + ] + worktrees = [ + bean_progress.WorktreeFlow( + repo_name="HAC", + path=tmp_path / "apps" / "flow-done", + dir_name="flow-done", + slug="done", + current_stage="calibrate", + completed_stages=["intent", "plan", "execute", "review", "calibrate"], + timestamp="2026-11-21T10:00:00Z", + agent="claude-agent", + model="claude-opus-5-5", + execution_branch="I-1-done/P-2/E-3/_", + plan_branch="I-1-done/P-2/_", + intent_branch="I-1-done/_", + review_iterations_done=2, + admission={"state": "admitted"}, + stage_results={"calibrate": {"status": "success"}}, + ), + bean_progress.WorktreeFlow( + repo_name="HAC", + path=tmp_path / "apps" / "flow-mixed-flow", + dir_name="flow-mixed-flow", + slug="mixed-flow", + current_stage="review", + completed_stages=["intent", "plan", "execute"], + timestamp="2026-11-21T11:00:00Z", + agent="claude-agent", + model="claude-sonnet-4-6", + execution_branch="I-10-mixed-flow/P-2/E-3/_", + plan_branch="I-10-mixed-flow/P-2/_", + intent_branch="I-10-mixed-flow/_", + review_iterations_done=6, + admission={"state": "admitted"}, + stage_results={"review": {"status": "failed", "error": "Autonomous review halted: verdict FAILED."}}, + dirty_count=2, + ), + bean_progress.WorktreeFlow( + repo_name="dev-env", + path=tmp_path / "dev-env" / "flow-todo-flow", + dir_name="flow-todo-flow", + slug="todo-flow", + current_stage="plan", + completed_stages=["intent"], + timestamp="2026-11-21T11:10:00Z", + agent="antigravity-agent", + model="gemini-3.8-flash-medium", + execution_branch=None, + plan_branch="I-20-todo-flow/P-1/_", + intent_branch="I-20-todo-flow/_", + review_iterations_done=0, + admission={}, + stage_results={}, + ), + ] + prs = [ + bean_progress.PullRequestInfo( + repo_name="HAC", + number=227, + title="Done PR", + url="https://example.com/pr/227", + head_ref_name="I-1-done/P-2/E-3/_", + mergeable="MERGEABLE", + is_draft=False, + reviews_count=3, + comments_count=0, + ci_summary="11/11 pass", + ), + bean_progress.PullRequestInfo( + repo_name="HAC", + number=230, + title="Mixed active PR", + url="https://example.com/pr/230", + head_ref_name="I-10-mixed-flow/P-2/E-3/_", + mergeable="MERGEABLE", + is_draft=False, + reviews_count=0, + comments_count=0, + ci_summary="11/11 pass", + ), + ] + + rows = bean_progress.build_in_flight_rows(beans, intents, worktrees, prs, {}) + all_bean_ids = [n for r in rows for n in r.bean_nums] + assert "0199" not in all_bean_ids + assert "0200" not in all_bean_ids + assert sorted(all_bean_ids) == ["0351", "0353", "0354"] + + by_first = {r.bean_nums[0]: r for r in rows} + assert "#230" in by_first["0354"].pr_ci + assert by_first["0354"].stage == "Stage 4 (Halted iter 6)" + assert "dirty: 2 file(s)" in by_first["0354"].notes + assert by_first["0351"].target == "dev-env" + assert "bean status: todo" in by_first["0351"].notes + assert by_first["0353"].stage == "Not started" + assert by_first["0353"].target == "harness" + + def test_groups_combined_multi_bean_flow(self, tmp_path: Path) -> None: + beans_dir = tmp_path / ".beans" + beans_dir.mkdir() + _make_bean(beans_dir, "0347", "a", "title: Part A\nstatus: in-progress\n") + _make_bean(beans_dir, "0354", "b", "title: Part B\nstatus: in-progress\n") + beans = bean_progress.scan_beans(beans_dir) + intents = [ + bean_progress.IntentMapping( + path=tmp_path / "intent-0347-0354-combined.json", + slug="combined", + bean_nums=["0347", "0354"], + ) + ] + wt = bean_progress.WorktreeFlow( + repo_name="HAC", + path=tmp_path / "flow-combined", + dir_name="flow-combined", + slug="combined", + current_stage="review", + completed_stages=["intent", "plan", "execute"], + timestamp="2026-11-21T12:00:00Z", + agent="claude-agent", + model="claude-sonnet-4-6", + execution_branch="I-1-combined/P-1/E-1/_", + plan_branch="I-1-combined/P-1/_", + intent_branch="I-1-combined/_", + review_iterations_done=6, + admission={"state": "admitted"}, + stage_results={"calibrate": {"status": "success"}, "review": {"status": "skipped"}}, + ) + rows = bean_progress.build_in_flight_rows(beans, intents, [wt], [], {}) + assert len(rows) == 1 + assert rows[0].bean_nums == ["0347", "0354"] + assert rows[0].stage == "Stage 5 (Calibrated; review skipped)" + assert "--skip-review" in rows[0].notes + + +class TestLiveProcessesAndChecks: + """Verify strict ancestor session detection, live CLI overrides, and CI rollups.""" + + def test_ancestor_owner_ignores_child_claude_agent_flag(self, tmp_path: Path) -> None: + wt_path = (tmp_path / "flow-review").resolve() + wt_path.mkdir() + wt = bean_progress.WorktreeFlow( + repo_name="HAC", + path=wt_path, + dir_name="flow-review", + slug="review", + current_stage="review", + completed_stages=["intent", "plan", "execute"], + timestamp=None, + agent="claude-agent", + model="claude-sonnet-4-6", + execution_branch=None, + plan_branch=None, + intent_branch=None, + review_iterations_done=6, + admission={"state": "admitted"}, + stage_results={"review": {"status": "failed", "error": "Autonomous review halted: verdict FAILED."}}, + ) + procs = [ + bean_progress.ProcessInfo(1, 0, "05:00:00", "Ss", "/sbin/launchd"), + bean_progress.ProcessInfo(41784, 1, "04:00:00", "S", "/Users/u/.local/bin/agy serve"), + bean_progress.ProcessInfo( + 32031, + 41784, + "32:03", + "Ss+", + f"python3 run_holon_flow.py --target-worktree {wt_path} --agent claude-agent --model claude-opus-5-5", + ), + bean_progress.ProcessInfo( + 34515, + 32031, + "13:33", + "S+", + f"docker run -e HOLON_ROLE=review-loop -v {wt_path}:/home/holon/.holon-sandbox/workspace " + "holon/agent-claude claude-agent claude-opus-5-5 --resolve --iteration=7", + ), + ] + live = bean_progress.match_live_flows(procs, [wt], []) + tree = live[str(wt_path)] + assert tree.session_owner == "Antigravity" + assert tree.root_pid == 32031 + assert tree.model == "claude-opus-5-5" + assert tree.docker_role == "review-loop" + assert tree.docker_resolve is True + assert tree.docker_iteration == 7 + + assert bean_progress._derive_stage(wt, tree, True) == "Stage 4 (Resolve iter 7)" + assert bean_progress._derive_live_runner(wt, tree) == "opus-5-5 · 32m (PID 32031, Antigravity)" + assert bean_progress._derive_notes([], wt, None, tree) == "Resolving review findings" + + def test_detects_claude_code_parent_and_duplicate_trees(self, tmp_path: Path) -> None: + wt_path = (tmp_path / "flow-exec").resolve() + wt_path.mkdir() + wt = bean_progress.WorktreeFlow( + repo_name="HAC", + path=wt_path, + dir_name="flow-exec", + slug="exec", + current_stage="execute", + completed_stages=["intent", "plan"], + timestamp=None, + agent="antigravity-agent", + model="gemini-3.8-flash-medium", + execution_branch=None, + plan_branch=None, + intent_branch=None, + review_iterations_done=0, + admission={"state": "blocked", "blocked_by": [{"number": 228, "files": ["flow/__init__.py"]}]}, + stage_results={}, + ) + procs = [ + bean_progress.ProcessInfo(77752, 1, "03:00:00", "Ss", "claude --dangerously-skip-permissions"), + bean_progress.ProcessInfo( + 12804, + 77752, + "02:49:30", + "Ss+", + f"python3 run_holon_flow.py --target-worktree {wt_path} --model gemini-3.8-flash-medium", + ), + bean_progress.ProcessInfo( + 12900, + 77752, + "00:05:00", + "Ss+", + f"holon flow --target-worktree {wt_path} --model gemini-3.8-flash-medium", + ), + ] + live = bean_progress.match_live_flows(procs, [wt], []) + tree = live[str(wt_path)] + assert tree.session_owner == "Claude Code" + assert tree.duplicate_trees == 2 + assert tree.kind == "polling" + assert bean_progress._derive_stage(wt, tree, False) == "Stage 3 (Blocked: #228)" + runner = bean_progress._derive_live_runner(wt, tree) + assert "polling #228" in runner + assert "2h49m" in runner + assert "Claude Code" in runner + + def test_summarize_checks(self) -> None: + assert bean_progress.summarize_checks([]) == "no checks" + rollup = [ + {"status": "COMPLETED", "conclusion": "SUCCESS"}, + {"status": "COMPLETED", "conclusion": "FAILURE"}, + {"status": "IN_PROGRESS", "conclusion": ""}, + {"state": "SUCCESS"}, + ] + assert bean_progress.summarize_checks(rollup) == "2/4 pass, 1 fail, 1 running" + + def test_table_escaping_and_empty_cli(self, tmp_path: Path, capsys) -> None: + row = bean_progress.InFlightRow( + bean_nums=["0123"], + target="HAC", + title="Pipe | inside title", + stage="Stage 4", + pr_ci="—", + live_runner="Idle", + notes="a | b", + sort_bucket=0, + ) + md = bean_progress.render_markdown_table([row]) + assert "Pipe \\| inside title" in md + assert "a \\| b" in md + + (tmp_path / ".beans").mkdir() + rc = bean_progress.main(["--repo-root", str(tmp_path), "--no-gh", "--no-ps"]) + assert rc == 0 + out = capsys.readouterr().out.strip() + assert out == "No beans are currently in flight." + + rc_json = bean_progress.main(["--repo-root", str(tmp_path), "--no-gh", "--no-ps", "--json"]) + assert rc_json == 0 + assert json.loads(capsys.readouterr().out) == [] + + +NOW = datetime(2026, 11, 23, 12, 0, 0, tzinfo=UTC) + + +def _wt(tmp_path: Path, name: str, slug: str, **kw) -> bean_progress.WorktreeFlow: + base = { + "repo_name": "HAC", + "path": tmp_path / name, + "dir_name": name, + "slug": slug, + "current_stage": "execute", + "completed_stages": ["intent", "plan"], + "timestamp": None, + "agent": "claude-agent", + "model": "claude-opus-5-5", + "execution_branch": None, + "plan_branch": None, + "intent_branch": None, + "review_iterations_done": 0, + "admission": {}, + "stage_results": {}, + } + base.update(kw) + return bean_progress.WorktreeFlow(**base) + + +def _pr(number: int, head: str, title: str = "t") -> bean_progress.PullRequestInfo: + return bean_progress.PullRequestInfo( + "HAC", number, title, f"u/{number}", head, "MERGEABLE", False, 0, 0, "1/1 pass" + ) + + +class TestTimesAndColumns: + def test_format_duration(self) -> None: + f = bean_progress.format_duration + assert f(None, NOW) == "—" + assert f(datetime(2026, 11, 23, 11, 48, tzinfo=UTC), NOW) == "12m" + assert f(datetime(2026, 11, 23, 10, 55, tzinfo=UTC), NOW) == "1h05m" + assert f(datetime(2026, 11, 21, 9, 0, tzinfo=UTC), NOW) == "2d3h" + assert f(datetime(2026, 11, 23, 11, 59, 30, tzinfo=UTC), NOW) == "30s" + + def test_stage_started_sources(self) -> None: + mtime = datetime(2026, 11, 23, 1, 0, tzinfo=UTC) + sr = { + "execute": {"start_time": "2026-11-23T05:00:00Z", "end_time": "2026-11-23T06:00:00Z"}, + "review": {"status": "failed", "start_time": "2026-11-23T07:00:00Z", "end_time": "2026-11-23T08:00:00Z"}, + } + assert bean_progress.derive_stage_started("review", sr, None, mtime) == parse(sr["review"]["start_time"]) + # current stage has no record: previous stage end + assert bean_progress.derive_stage_started( + "plan", {"intent": {"end_time": "2026-11-23T03:23:20Z"}}, "x", mtime + ) == parse("2026-11-23T03:23:20Z") + # nothing recorded: checkpoint timestamp then mtime + assert bean_progress.derive_stage_started("plan", {}, "2026-11-23T02:00:00Z", mtime) == parse( + "2026-11-23T02:00:00Z" + ) + assert bean_progress.derive_stage_started("plan", {}, None, mtime) == mtime + + def test_total_time_earliest_of_branch_and_ledger(self, tmp_path: Path) -> None: + ledger = tmp_path / "ledger.jsonl" + ledger.write_text( + json.dumps({"branch": "I-100-foo/_", "created_at": "2026-11-23T10:00:00Z"}) + + "\n" + + json.dumps({"branch": "I-100-foo/P-1--1-child/_", "created_at": "2026-11-23T09:00:00Z"}) + + "\n" + + json.dumps({"branch": "I-100-other/_", "created_at": "2026-11-01T00:00:00Z"}) + + "\n", + encoding="utf-8", + ) + assert bean_progress.ledger_first_created(ledger, "foo") == parse("2026-11-23T09:00:00Z") + branch_ts = bean_progress.branch_started("I-1795388456-foo/_") + assert branch_ts is not None + assert bean_progress.earliest_of(branch_ts, parse("2030-01-01T00:00:00Z")) == branch_ts + assert bean_progress.earliest_of(None, None) is None + + def test_row_columns_and_runner_in_notes(self, tmp_path: Path) -> None: + beans = bean_progress.scan_beans(tmp_path / "none") + intents = [bean_progress.IntentMapping(tmp_path / "i.json", "foo", ["0100"], "foo")] + wt = _wt( + tmp_path, + "flow-foo", + "foo", + stage_started=parse("2026-11-23T11:48:00Z"), + flow_started=parse("2026-11-21T09:00:00Z"), + ) + rows = bean_progress.build_in_flight_rows(beans, intents, [wt], [], {}, now=NOW) + assert len(rows) == 1 + assert rows[0].time_in_stage == "12m" + assert rows[0].total_time == "2d3h" + md = bean_progress.render_markdown_table(rows) + header = md.splitlines()[0] + assert header == "| Bean # | Target | Title | Stage | Time in Stage | PR & CI | Total Time | Notes |" + line = md.splitlines()[2] + assert "| 12m |" in line and "| 2d3h |" in line and "idle (opus-5-5)" in line + wt2 = _wt(tmp_path, "flow-bar", "bar") + assert bean_progress.build_in_flight_rows(beans, [], [wt2], [], {}, now=NOW)[0].time_in_stage == "—" + + def test_scan_worktrees_reads_real_checkpoint(self, tmp_path: Path) -> None: + root = tmp_path / "apps" / "holon-agentic-coder" + wt = root / "flow-parent" + (wt / ".holon" / "flow").mkdir(parents=True) + (wt / "holon-knowledge" / "ledger").mkdir(parents=True) + (wt / "holon-knowledge" / "ledger" / "intents.jsonl").write_text( + json.dumps({"branch": "I-1795388456-parent/_", "created_at": "2026-11-22T23:00:00Z"}) + "\n" + ) + (wt / ".holon" / "flow" / "checkpoint-child.json").write_text( + json.dumps( + { + "intent_slug": "child", + "current_stage": "review", + "completed_stages": ["intent", "plan", "execute"], + "timestamp": "2026-11-23T03:19:33.661Z", + "context": { + "intent_branch": "I-1795388456-parent/P-1--1-child/_", + "stage_results": {"review": {"status": "failed", "start_time": "2026-11-23T03:00:47Z"}}, + }, + } + ) + ) + repo = bean_progress.RepoTarget("HAC", root, True) + (flow,) = bean_progress.scan_worktrees([repo]) + assert flow.slug == "parent" + assert flow.stage_started == parse("2026-11-23T03:00:47Z") + assert flow.flow_started == parse("2026-11-22T23:00:00Z") + + +def parse(text: str) -> datetime: + parsed = bean_progress.parse_iso(text) + assert parsed is not None + return parsed + + +class TestMappingFixes: + def _beans(self, tmp_path: Path, nums: list[str]) -> dict: + beans_dir = tmp_path / ".beans" + beans_dir.mkdir() + for n in nums: + _make_bean(beans_dir, n, f"b{n}", f"title: Bean {n}\nstatus: in-progress\n") + return bean_progress.scan_beans(beans_dir) + + def test_child_pr_maps_to_parent_bean_only(self, tmp_path: Path) -> None: + beans = self._beans(tmp_path, ["0174", "0191", "0198"]) + intents = [ + bean_progress.IntentMapping(tmp_path / "a.json", "github-adapter-pr-ci-review", ["0191"], "x"), + bean_progress.IntentMapping(tmp_path / "b.json", "document-env", ["0174"], "document-env"), + bean_progress.IntentMapping(tmp_path / "c.json", "runner-spec", ["0198"], "runner-spec"), + ] + child_head = "I-1795401745-github-adapter-pr-ci-review/P-1795397463-CLA--2-add-the-repository-scoped/E-1/_" + wts = [ + # checkpoint-derived slug is already the root slug (child branch names the parent) + _wt( + tmp_path, "flow-github-adapter-pr-ci-review", "github-adapter-pr-ci-review", execution_branch=child_head + ), + _wt(tmp_path, "flow-document-env", "document-env"), + _wt(tmp_path, "flow-runner-spec", "runner-spec"), + ] + rows = bean_progress.build_in_flight_rows(beans, intents, wts, [_pr(245, child_head)], {}, now=NOW) + by_bean = {r.bean_nums[0]: r for r in rows} + assert "#245" in by_bean["0191"].pr_ci or "u/245" in by_bean["0191"].pr_ci + assert by_bean["0174"].pr_ci == "—" + assert by_bean["0198"].pr_ci == "—" + assert by_bean["0191"].stage != "Not started" + assert len(rows) == 3 + + def test_timestamp_digits_do_not_match_bean_number(self) -> None: + pr = _pr(9, "I-1795401745-other/_") + assert bean_progress._match_pr_for_unit(None, None, ["0174"], [pr]) is None + pr2 = _pr(10, "I-5-x/bean-0174/_") + assert bean_progress._match_pr_for_unit(None, None, ["0174"], [pr2]) is pr2 + + def test_duplicate_attempts_merge_per_bean(self, tmp_path: Path) -> None: + beans = self._beans(tmp_path, ["0175"]) + intents = [ + bean_progress.IntentMapping(tmp_path / "1.json", "scopes", ["0175"], "scopes"), + bean_progress.IntentMapping(tmp_path / "2.json", "scopes-v2", ["0175"], "scopes-v2"), + ] + wts = [ + _wt(tmp_path, "flow-scopes", "scopes", current_stage="execute"), + _wt(tmp_path, "flow-scopes-v2", "scopes-v2", current_stage="review"), + ] + live = { + str(wts[1].path): bean_progress.LiveFlowTree( + 1, + "01:00:00", + "running", + "Claude Code", + str(wts[1].path), + "scopes-v2", + [], + None, + "claude-opus-5-5", + "review-loop", + False, + 1, + ) + } + rows = bean_progress.build_in_flight_rows(beans, intents, wts, [], live, now=NOW) + assert len(rows) == 1 + assert rows[0].stage.startswith("Stage 4") + assert "opus-5-5 · 1h00m" in rows[0].notes_cell() + assert "stale attempt flow-scopes" in rows[0].notes_cell() + + def test_untracked_flow_gets_bean_from_intent_file_slug(self, tmp_path: Path) -> None: + beans = self._beans(tmp_path, ["0175"]) + # json slug lacks the -v2 suffix that the file/branch slug carries + intents = [bean_progress.IntentMapping(tmp_path / "i.json", "scopes", ["0175"], "scopes-v2")] + wts = [_wt(tmp_path, "flow-scopes-v2", "scopes-v2")] + (row,) = bean_progress.build_in_flight_rows(beans, intents, wts, [], {}, now=NOW) + assert row.bean_nums == ["0175"] + # PR-only row for a v2 branch also resolves + (row2,) = bean_progress.build_in_flight_rows( + beans, intents, [], [_pr(5, "I-100-scopes-v2/P-1/E-1/_")], {}, now=NOW + ) + assert row2.bean_nums == ["0175"] + assert row2.total_time != "—" diff --git a/tests/test_flow_env.py b/tests/test_flow_env.py index b361985..ec2290c 100644 --- a/tests/test_flow_env.py +++ b/tests/test_flow_env.py @@ -184,3 +184,44 @@ def test_a_refusal_that_is_not_an_overlap_still_stops(monkeypatch, tmp_path): monkeypatch.setattr(run_holon_flow, "execute_flow_process", lambda cmd, **k: launched.append(cmd) or (1, refusal)) code = run_holon_flow.run_flow(intent, worktree, "claude-agent", "claude-opus-5-5") assert code == 1 and len(launched) == 1 + + +def _record_git(monkeypatch): + calls = [] + + def fake_run(cmd, **kwargs): + calls.append(cmd) + return run_holon_flow.subprocess.CompletedProcess(cmd, 0, "", "") + + monkeypatch.setattr(run_holon_flow.subprocess, "run", fake_run) + return calls + + +def test_a_missing_flow_worktree_beside_main_is_cut_from_origin_main(monkeypatch, tmp_path): + (tmp_path / "main").mkdir() + calls = _record_git(monkeypatch) + resolved = run_holon_flow.resolve_flow_worktree(tmp_path / "flow-review-keeps-branch", "ignored-slug") + assert resolved == (tmp_path / "flow-review-keeps-branch").resolve() + assert calls[-1][-5:] == [ + "--no-track", + "-b", + "flow-review-keeps-branch", + str(resolved), + "origin/main", + ] + assert calls[-1][:3] == ["git", "-C", str((tmp_path / "main").resolve())] + + +def test_an_existing_flow_worktree_is_reused_untouched(monkeypatch, tmp_path): + (tmp_path / "main").mkdir() + (tmp_path / "flow-x").mkdir() + calls = _record_git(monkeypatch) + assert run_holon_flow.resolve_flow_worktree(tmp_path / "flow-x", "x") == (tmp_path / "flow-x").resolve() + assert calls == [] + + +def test_a_missing_worktree_that_is_not_a_flow_worktree_is_not_created(monkeypatch, tmp_path): + (tmp_path / "main").mkdir() + calls = _record_git(monkeypatch) + assert run_holon_flow.resolve_flow_worktree(tmp_path / "other", "x") == (tmp_path / "other").resolve() + assert calls == [] diff --git a/tests/test_flow_fallback.py b/tests/test_flow_fallback.py new file mode 100644 index 0000000..bbef090 --- /dev/null +++ b/tests/test_flow_fallback.py @@ -0,0 +1,113 @@ +"""The flow runner waits out a named reset and never switches runner on its own.""" + +import sys +from datetime import datetime +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parent.parent / ".agents" / "skills" / "holon_flow" / "scripts" +if str(ROOT) not in sys.path: + sys.path.insert(0, str(ROOT)) + +import run_holon_flow # noqa: E402 + + +@pytest.mark.parametrize( + "text", + [ + "You've hit your session limit · resets 10am (UTC)", + "You've hit your 5-hour limit · resets 9pm (Australia/Melbourne)", + "limit reached, resets 5:40pm (Australia/Melbourne)", + ], +) +def test_a_named_reset_is_recognised_with_or_without_minutes(text): + assert run_holon_flow.parse_limit_reset(text) is not None + + +def test_an_hour_only_reset_is_that_hour_on_the_hour_in_the_named_zone(): + reset = run_holon_flow.parse_limit_reset("resets 10am (UTC)") + assert isinstance(reset, datetime) + assert (reset.hour, reset.minute, str(reset.tzinfo)) == (10, 0, "UTC") + + +def test_a_pm_reset_with_minutes_keeps_them(): + reset = run_holon_flow.parse_limit_reset("resets 5:40pm (Australia/Melbourne)") + assert (reset.hour, reset.minute) == (17, 40) + + +def test_no_reset_time_returns_none(): + assert run_holon_flow.parse_limit_reset("insufficient_quota") is None + + +def test_claude_steps_down_its_own_ladder(): + first = run_holon_flow.FALLBACK_LADDER_CLAUDE[0] + agent, model = run_holon_flow.resolve_next_model("claude-agent", first) + assert agent == "claude-agent" + assert model == run_holon_flow.FALLBACK_LADDER_CLAUDE[1] + + +def test_an_exhausted_claude_ladder_never_switches_to_antigravity(): + last = run_holon_flow.FALLBACK_LADDER_CLAUDE[-1] + assert run_holon_flow.resolve_next_model("claude-agent", last) is None + + +def test_an_exhausted_antigravity_ladder_never_switches_to_claude(): + last = run_holon_flow.FALLBACK_LADDER_ANTIGRAVITY[-1] + assert run_holon_flow.resolve_next_model("antigravity-agent", last) is None + + +def test_antigravity_ladder_starts_with_gemini_4_argon_then_hydrogen_then_flash(): + assert run_holon_flow.FALLBACK_LADDER_ANTIGRAVITY == [ + "gemini-4-argon", + "gemini-4-hydrogen", + "gemini-3.8-flash", + ] + assert run_holon_flow.resolve_next_model("antigravity-agent", "gemini-4-argon") == ( + "antigravity-agent", + "gemini-4-hydrogen", + ) + assert run_holon_flow.resolve_next_model("antigravity-agent", "gemini-4-hydrogen") == ( + "antigravity-agent", + "gemini-3.8-flash", + ) + assert run_holon_flow.resolve_next_model("antigravity-agent", "gemini-3.8-flash") is None + + +@pytest.mark.parametrize( + ("suffixed_model", "expected_next"), + [ + ("gemini-4-argon-medium", ("antigravity-agent", "gemini-4-hydrogen")), + ("gemini-4-hydrogen-medium", ("antigravity-agent", "gemini-3.8-flash")), + ("gemini-3.8-flash-medium", None), + ], +) +def test_antigravity_step_down_normalises_effort_suffixes(suffixed_model, expected_next): + assert run_holon_flow.resolve_next_model("antigravity-agent", suffixed_model) == expected_next + + +@pytest.mark.parametrize( + "text", + [ + "QUOTA_EXHAUSTED", + "Quota exceeded for model", + "usage limit reached", + ], +) +def test_quota_error_patterns_match_gemini_and_usage_limit_messages(text): + assert run_holon_flow.is_quota_error(text) is True + + +def test_cli_default_model_is_gemini_4_argon(monkeypatch): + captured = {} + + def fake_run_flow(**kwargs): + captured.update(kwargs) + return 0 + + monkeypatch.setattr(run_holon_flow, "run_flow", fake_run_flow) + monkeypatch.setattr(sys, "argv", ["run_holon_flow.py", "todo/fake.json", "--dry-run"]) + with pytest.raises(SystemExit) as exc_info: + run_holon_flow.main() + assert exc_info.value.code == 0 + assert captured["model"] == "gemini-4-argon" diff --git a/tests/test_flow_notify_calibration.py b/tests/test_flow_notify_calibration.py index f777e50..7ddb38f 100644 --- a/tests/test_flow_notify_calibration.py +++ b/tests/test_flow_notify_calibration.py @@ -18,6 +18,7 @@ def sent(monkeypatch): calls = [] monkeypatch.setattr(notify_ntfy, "notify", lambda *a, **k: calls.append((a, k))) + monkeypatch.setattr(run_holon_flow, "find_flow_pr", lambda worktree, slug: None) return calls @@ -53,3 +54,23 @@ def test_silent_without_a_checkpoint(tmp_path, sent): intent, _ = make_flow(tmp_path, []) run_holon_flow._notify_outcome(intent, 0, tmp_path / "missing") assert sent == [] + + +def test_the_notification_names_the_pull_request(tmp_path, sent, monkeypatch): + monkeypatch.setattr(run_holon_flow, "find_flow_pr", lambda worktree, slug: {"number": 217, "headRefName": "x"}) + intent, worktree = make_flow(tmp_path, ["intent", "plan", "execute", "review", "calibrate"]) + run_holon_flow._notify_outcome(intent, 0, worktree) + title, message = sent[0][0][:2] + assert "PR #217" in title + assert "PR #217" in message + + +def test_a_failed_pull_request_lookup_still_notifies(tmp_path, sent, monkeypatch): + def broken(worktree, slug): + raise RuntimeError("gh unavailable") + + monkeypatch.setattr(run_holon_flow, "find_flow_pr", broken) + intent, worktree = make_flow(tmp_path, ["intent", "plan", "execute", "review", "calibrate"]) + run_holon_flow._notify_outcome(intent, 0, worktree) + assert len(sent) == 1 + assert "demo" in sent[0][0][0] diff --git a/tests/test_pr_review_loop_convergence.py b/tests/test_pr_review_loop_convergence.py index 37e3738..c74465e 100644 --- a/tests/test_pr_review_loop_convergence.py +++ b/tests/test_pr_review_loop_convergence.py @@ -16,14 +16,15 @@ def test_pr_review_loop_defines_step_0_orchestrator_delegation(self) -> None: assert "### Step 0: Entrypoint Delegation — Spawn the Background Loop Orchestrator Subagent" in text assert text.index("### Step 0:") < text.index("### Step 1: Parse Parameters") - assert 'Role: "PR Review Loop Orchestrator ( PR #)"' in text + assert 'Role: "# - review loop orchestrator"' in text assert '"TypeName": "self"' in text assert '"Model": "inherit"' in text assert "invoke_subagent" in text assert "MUST NOT execute the loop inline" in text def test_pr_review_loop_defines_reentrancy_guard_and_terminal_notification(self) -> None: - text = PR_REVIEW_LOOP_SKILL.read_text(encoding="utf-8") + # Collapse whitespace so Prettier re-wrapping the prose cannot split a checked phrase. + text = " ".join(PR_REVIEW_LOOP_SKILL.read_text(encoding="utf-8").split()) assert "Re-Entrancy Guard" in text assert "DO NOT spawn another nested loop orchestrator" in text @@ -59,5 +60,5 @@ def test_coordination_doc_defines_two_tier_review_loop_delegation(self) -> None: assert "2-tier subagent delegation architecture" in text assert "Tier 1 (Main Interactive Agent -> Background Loop Orchestrator)" in text assert "Tier 2 (`PR Review Loop Orchestrator` Subagent -> Per-Pass Reviewer & Resolver Subagents)" in text - assert 'Role: "PR Review Loop Orchestrator ( PR #)"' in text + assert 'Role: "# - review loop orchestrator"' in text assert "Re-Entrancy Guard" in text