diff --git a/docs/architecture/persisted-contracts.md b/docs/architecture/persisted-contracts.md index 2c97ed9..2667083 100644 --- a/docs/architecture/persisted-contracts.md +++ b/docs/architecture/persisted-contracts.md @@ -55,7 +55,7 @@ A golden over the current writer does not protect these. A reader can stop accep | Rooms | the room database (`rooms.sqlite3`, with the WAL a killed process leaves): rooms, rounds, candidates, members, workspaces, events, `sessions_json`, `selection_json` v1, `provenance_json` v1/v2, `conversation_json` v1; candidate `manifest.json`, patch and output; room-bound run artifacts. No release wrote `conversation_json` v2 or judgment rows | `room list` / `rounds` / `show` / `candidates` / `diff` / `compare` / `export`, `select`, `apply`, `judge`, `recover`, `close`, `prune` `RoomStore.member_sessions` (and through these `RoomCandidateStore.load`, `_parse_sessions_json`, `selection_record_status`, `room_outcome_status`, `round_provenance_status`, `round_conversation_status`); the standalone `apply` / `recover` refusal and skip for room-bound artifacts; a HEAD `room round` on a released room (`branch-from` resuming the released sessions on the released base patch, `fresh`, a first round on a draft, and the `continue-own` refusal when the released workspaces are gone); `room attach` over the released member log paths (tmux faked); the `apply --verify` settings notices; raw export (`--include` preview and confirm); the TUI Rooms tab's readers and pure renders (`build_room_evidence`, `render_room`, `render_round_table`, and the Diff, Output and Details views), not the Textual app | `test_frozen_rooms.py` (v0.1.2, v0.2.0, v0.3.0) | | Workflows | the workflow database (`workflows.db`): rows with `spec_json`, manifest `schema_version` 3 with `calls_used`, events, and from v0.3.0 the lineage columns and `file`/`revision` origins; per workflow `spec.json`, planner output, node bundles (`result.json`, `winner.patch`, `commit.json` v3) and stream logs; workflow-origin run artifacts, approved or not, with `plan.final_agent` from v0.3.0. No release wrote manifest v1 or v2 (both normalize to v3 before the insert); those readers stay covered by `test_workflow_durable.py::test_marked_v1_migration_preserves_exact_count_and_control_fields` and `test_workflow.py::test_a_workflow_whose_call_accounting_is_ambiguous_is_refused` | `workflow list` / `show` (`--prompts`) / `status` / `logs` / `lineage` / `export` / `cancel` / `prune`, a dead release-written lease recovered by `show` and `status`, `WorkflowStore.events` and `read_node_bundle`; for the final artifact `diff`, `runs show`, `apply` (approved, after a prune, approval healed from the database, refused for a workflow that never completed, `no_changes`), the standalone `recover` skip. A final artifact naming another run, and an unreadable store: `test_cli.py::test_apply_refuses_an_artifact_the_named_workflow_did_not_finalize` and `test_apply_guard_fails_closed_when_the_workflow_store_cannot_be_read`. HEAD execution (`WorkflowCoordinator.run`, what the job worker calls): `run` of released planned, created and revised rows (accounting, stored prompts, dependency output); `resume` of released crashes and failures against the stored deadline (expired: fails before dispatch; before it: the completed dependency's bundle is reused and the unfinished node's attempt refunded, a published final artifact is reused and approved without backfilling `final_agent`, an exhausted node dispatches nothing), refused from a final or unstarted state and while the owner lives, with the released execution history and events kept; `workflow revise` (a v0.2.0 parent gains a lineage); the launch's team peek and state check; `apply --verify` narrowing (v0.2.0: the gate's list only, with a notice; also after a prune); control plans enabled refuse a released workflow planned without one. Written later by the same releases (`freeze.py --part 2b`, `bindings-2b.json`): a node bundle saved just before the crash, reclaimed on resume through `read_node_result` / `read_node_bundle` with its usage added once (`_record_usage`), and re-run when its patch, its commit record or its digest disagrees; control-plan workflows, whose released `control-plan.json` is the control preflight's request, whose binding and validation topology refuse a changed configuration, and whose stored limits and node timeouts bound a run with control plans on, off, or Toolgraph off (`_execution_limits`), plus `show`, `read_control_plan`, `conversations show` and `apply` of a completed one; an interrupted apply of a final artifact, classified by `recover` (completed, not applied, manual recovery; `_bound_receipt`) without touching its approval or the workflow row. Not covered: the TUI's `_read_artifact_result`; no reader revalidates a released execution's `control-preflight.json` | `test_frozen_workflows.py` (v0.2.0, v0.3.0) | | Sessions and project | isolated-session documents in every state a release leaves (open, checkpointed, closed, and from injected exits creating, closing, recovery_required) and their checkpoint run artifacts; the project marker `.syncmill/project.json` and the `syncmill.toml` that `init` writes | `session isolated-list` (`IsolatedSessionStore.list`: live, source staleness in the stored fingerprint's version), `IsolatedSessionStore.load` path binding (repository, workspace run root, worktree, derived tmux name) through `attach-isolated` (state, liveness, pane cwd), `checkpoint` (a missing worktree) and `close` (each state, a missing workspace), `tui_collaboration.render_session`; for the checkpoint artifact `runs list` / `show`, `diff`, `conversations show` / `list` / `close`, `continue` (refused), `recover` (skipped), `apply` and `validate_applicable`, `discard`, `prune` (pending kept), the TUI `render_artifact` / `_read_artifact_result`; `project_id` with the marker untracked, tracked or symlinked, `load_project_config` of the released config, `initialize_project` falling back to the marker. Not covered: a successful checkpoint or worktree cleanup (a release-written workspace is not relocatable) | `test_frozen_sessions.py` (v0.1.2, v0.2.0, v0.3.0) | -| Board | item rows and their evidence and inputs, decisions | `_row_to_item`, `_load_evidence`, `_row_to_decision` | not yet | +| Board | the board database (`board.db`, with the WAL a killed run leaves): items in every state a release's `board add` / `run` / `update` / `import-review-candidates` leave them (gate evidence passing and failing, the agent's `done` and `review` blocks with handoff and outputs, an agent failure, a killed and a reclaimed claim, a SIGINT and an orchestration crash, manual evidence and sign-off, dependencies including a missing one, imported review candidates), their transitions, decisions including a superseded one, the run ledger, and from v0.2.0 the compaction rollups and counters (partly compacted: a count needs both the live audit and the rollups). No release wrote the lesson columns (`project_id`, `provenance_json`, `source_key`); `test_lessons.py::test_an_old_board_gains_the_lesson_columns` and `::test_a_damaged_provenance_reads_as_not_recorded` cover those readers, and the mixed-project tests there the project filter. Every release writes a claim's ledger row in the claim's transaction, so the ledger backfill's positive branch stays covered by the synthetic tests in `test_board.py`; no release writer produces damaged JSON or a malformed evidence entry either | HEAD's first open (columns and tables added, every released cell kept, a second open a no-op), `Board.get` / `list` / `transitions` (`_row_to_item`, `_load_list`, `_load_evidence`) compared field by field with what the release's own interpreter read from the same database and with the raw cells, `board list` / `show`, `active_decisions` and `_row_to_decision` on every row (retired ones included), `board decisions`, `project_lessons` (empty: no released decision is a lesson), `stats` at fixed clocks including both sides of the aging cutoff, and `board stats` at a fresh and an aged clock; the human path on released rows: `update --state done` counting stored evidence or refused without it, `--sign-off`, `--clear-human-required`, an annotate keeping a released lease, `decide --supersedes` in and out of scope, a re-import skipped, and refused when the stored provenance differs. Not covered: HEAD `board run` and GC on a released board, `board compact` of released history, `renew_claim` of a released lease, the gateway, dashboard and TUI board readers (#271 Board-2); the memory a released board run wrote (outside `board.db`) | `test_frozen_board.py` (v0.1.2, v0.2.0, v0.3.0) | | Memory backends | Mem0 and LangGraph stored payloads | the backends' read paths | not yet | | TUI jobs | job documents, `schema_version` 1 and 2 | `JobStore.list_jobs` | not yet | | Run envelope | `envelope.json` | `contracts/run-envelope.schema.json`, `report list` / `report show` | not yet | diff --git a/tests/fixtures/persisted/board/freeze.py b/tests/fixtures/persisted/board/freeze.py new file mode 100644 index 0000000..5023dde --- /dev/null +++ b/tests/fixtures/persisted/board/freeze.py @@ -0,0 +1,636 @@ +"""Produce the frozen work-board databases under this directory (#271). + +Run once per release, with THAT release's interpreter and source, never the +current one. The output directory must not exist; frozen fixtures are never +regenerated. + + git worktree add --detach /tmp/wt-v0.3.0 v0.3.0 + (cd /tmp/wt-v0.3.0 && uv sync --frozen --no-dev) + python tests/fixtures/persisted/board/freeze.py \\ + --release-root /tmp/wt-v0.3.0 --out tests/fixtures/persisted/board/v0.3.0 + +Each scenario is one board database. The released CLI makes every row: +`board add`, `board run` (with a fake `codex` whose behaviour each run sets), +`board update`, `board import-review-candidates`, `board decide` and, from +v0.2.0, `board compact`. Three states need a process death no CLI exposes: +- a run SIGKILLed while its agent works (a live lease, and the WAL it leaves); +- a run interrupted with SIGINT (the release's cancel path); +- a run whose orchestration raises, from a `.pth` hook this script puts in the + release venv for the run and removes afterwards. + +Generation fails unless every property the tests rely on is present (see +`_require`), so a release that writes something else cannot silently narrow +the coverage. The database is copied byte for byte as soon as its scenario +finishes. Only then does the release's own interpreter read a scratch copy and +record what it makes of every row (`Board.get`, `transitions`, +`active_decisions`, the decision rows and `stats` at two fixed clocks): that is +the expected interpretation the tests hold HEAD's readers to. +""" + +from __future__ import annotations + +import argparse +import json +import os +import shutil +import signal +import socket +import sqlite3 +import subprocess +import sys +import tempfile +import time +from pathlib import Path + +TREE = {"calc.py": "def add(a, b):\n return a - b\n"} +GATE = ["python -c \"from calc import add; assert add(2, 3) == 5\""] +MISSING_DEP = "00000000-0000-4000-8000-000000000000" +STALL_SECONDS = 3600 + +# FAKE_PLAN = {"do": fix | wrong | none | fail | hang, "block": {...} | absent}. +# fix makes the gate pass, wrong and none make it fail, fail exits 1, hang waits +# to be killed. A "block" is appended to the reply as a syncmill-board block. +FAKE_AGENT = r''' +import json, os, sys, time +from pathlib import Path +args = sys.argv[1:] +if args[:2] == ["login", "status"] or args[:1] in (["--version"], ["--help"]): + print("codex (fake) - logged in"); sys.exit(0) +plan = json.loads(os.environ.get("FAKE_PLAN") or "{}") +do = plan.get("do", "fix") +if do == "hang": + marker = Path(os.environ["FAKE_STARTED"]) / "codex" + marker.with_suffix(".tmp").write_text(str(os.getpid())) + os.replace(marker.with_suffix(".tmp"), marker) + time.sleep(120); sys.exit(1) +if do == "fail": + sys.stderr.write("codex (fake): refused\n"); sys.exit(1) +body = {"fix": "a + b", "wrong": "a * b"}.get(do) +if body: + Path("calc.py").write_text("def add(a, b):\n return " + body + "\n", encoding="utf-8") +message = "codex (fake) " + do + "." +if plan.get("block"): + message += "\n```syncmill-board\n" + json.dumps(plan["block"]) + "\n```\n" +for event in [ + {"type": "thread.started", "thread_id": "fake-codex-thread"}, + {"type": "item.completed", "item": {"type": "agent_message", "text": message}}, + {"type": "turn.completed", "usage": {"input_tokens": 1, "output_tokens": 1}}, +]: + print(json.dumps(event)) +''' + +# Loaded at interpreter start by the .pth below, in every process of the +# release venv. With HOME/crash-at present the orchestration raises inside +# run_item's guard (Supervisor.run), the way a bug in a strategy would. +HOOK_MODULE = "_syncmill_freeze_board_hook" +CRASH_HOOK = '''\ +import os +from pathlib import Path + + +def _install(): + flag = Path(os.environ.get("HOME", "/nonexistent")) / "crash-at" + if not flag.is_file(): + return + from syncmill.supervisor import Supervisor + + def run(self, *args, **kwargs): + raise RuntimeError("frozen: injected orchestration failure") + Supervisor.run = run + + +_install() +''' + +# Runs inside the RELEASED interpreter on a scratch copy: what the release +# itself reads from every row. argv: db, frozen_at, decision goals (JSON list), +# stall seconds, and the item whose aging boundary is probed ("" for none). +RELEASE_READ = '''\ +import dataclasses, enum, json, math, sqlite3, sys +from syncmill.board import Board, _row_to_decision +db, frozen_at, goals = sys.argv[1], float(sys.argv[2]), json.loads(sys.argv[3]) +stall, boundary_item = int(sys.argv[4]), sys.argv[5] + + +def plain(value): + if isinstance(value, enum.Enum): + return value.value + if dataclasses.is_dataclass(value): + return {f.name: plain(getattr(value, f.name)) for f in dataclasses.fields(value)} + if isinstance(value, (list, tuple)): + return [plain(v) for v in value] + if isinstance(value, dict): + return {k: plain(v) for k, v in value.items()} + return value + + +board = Board(db, now=lambda: frozen_at, stall_seconds=stall) +items = board.list() +conn = sqlite3.connect(db) +conn.row_factory = sqlite3.Row +read = { + "items": {it.id: plain(board.get(it.id)) for it in items}, + "order": [it.id for it in items], + "transitions": {it.id: board.transitions(it.id) for it in items}, + "active_decisions": { + "*": [plain(d) for d in board.active_decisions()], + **{g: [plain(d) for d in board.active_decisions(goal=g)] for g in goals}, + }, + "decision_rows": [dict(r) for r in conn.execute("SELECT * FROM decisions ORDER BY rowid")], + # Every decision row through the release's own mapper, retired ones too: + # no listing returns a superseded decision, so its superseded_by and + # superseded_at reach a reader only through the mapper itself. + "decisions_mapped": [ + plain(_row_to_decision(r)) + for r in conn.execute("SELECT * FROM decisions ORDER BY rowid") + ], + "aggregates": { + table: [dict(r) for r in conn.execute(f"SELECT * FROM {table} ORDER BY rowid")] + for (table,) in conn.execute( + "SELECT name FROM sqlite_master WHERE type='table' " + "AND name IN ('transition_rollups', 'transition_counters') ORDER BY name" + ).fetchall() + }, + "stats": { + "fresh": plain(board.stats(now=frozen_at)), + "aged": plain(board.stats(now=frozen_at + stall + 1)), + }, +} +if boundary_item: + # The clocks around an item's aging boundary (stats ages an item once + # updated_at <= now - stall): the last one that does not age it, the first + # one that does, and the one after. + updated = board.get(boundary_item).updated_at + first = updated + stall + while first - stall < updated: + first = math.nextafter(first, math.inf) + while math.nextafter(first, -math.inf) - stall >= updated: + first = math.nextafter(first, -math.inf) + times = {"before": math.nextafter(first, -math.inf), "at": first, + "after": math.nextafter(first, math.inf)} + read["boundary"] = { + "item": boundary_item, + "times": times, + "stats": {k: plain(board.stats(now=t)) for k, t in times.items()}, + } +conn.close() +board.close() +print(json.dumps(read, ensure_ascii=False, sort_keys=True)) +''' + +GIT_ENV = { + "GIT_AUTHOR_NAME": "frozen", "GIT_AUTHOR_EMAIL": "frozen@example.invalid", + "GIT_COMMITTER_NAME": "frozen", "GIT_COMMITTER_EMAIL": "frozen@example.invalid", + "GIT_AUTHOR_DATE": "2026-01-01T00:00:00Z", "GIT_COMMITTER_DATE": "2026-01-01T00:00:00Z", +} + + +def _site_packages(python: Path) -> Path: + return Path(subprocess.run( + [str(python), "-c", "import sysconfig; print(sysconfig.get_paths()['purelib'])"], + check=True, capture_output=True, text=True, + ).stdout.strip()) + + +def main() -> None: + parser = argparse.ArgumentParser() + parser.add_argument("--release-root", type=Path, required=True) + parser.add_argument("--out", type=Path, required=True) + args = parser.parse_args() + release = args.release_root.resolve() + out = args.out.resolve() + if out.exists(): + sys.exit(f"{out} exists; frozen fixtures are never regenerated") + python = release / ".venv" / "bin" / "python" + syncmill = release / ".venv" / "bin" / "syncmill" + version = subprocess.run( + [str(python), "-c", "import importlib.metadata as m; print(m.version('syncmill'))"], + check=True, capture_output=True, text=True, + ).stdout.strip() + has_compact = version != "0.1.2" + site = _site_packages(python) + hook_files = [site / f"{HOOK_MODULE}.py", site / f"zz{HOOK_MODULE}.pth"] + if any(p.exists() for p in hook_files): + sys.exit(f"hook files already present in {site}; remove them first") + try: + hook_files[0].write_text(CRASH_HOOK, encoding="utf-8") + hook_files[1].write_text(f"import {HOOK_MODULE}\n", encoding="utf-8") + _generate(release, out, python, syncmill, version, has_compact) + finally: + for p in hook_files: + p.unlink(missing_ok=True) + + +def _generate(release: Path, out: Path, python: Path, syncmill: Path, + version: str, has_compact: bool) -> None: + with tempfile.TemporaryDirectory() as tmp: + box = Path(tmp).resolve() + repo, home, state, fakebin, started = ( + box / n for n in ("repo", "home", "state", "fakebin", "started") + ) + for folder in (repo, home, state, fakebin, started): + folder.mkdir() + (fakebin / "codex").write_text(f"#!{sys.executable}\n" + FAKE_AGENT, encoding="utf-8") + (fakebin / "codex").chmod(0o755) + (fakebin / "python").symlink_to(sys.executable) + base_env = { + "HOME": str(home), + "PATH": os.pathsep.join([str(fakebin), "/usr/bin", "/bin"]), + "TMPDIR": str(box), + "GIT_CONFIG_NOSYSTEM": "1", + "PYTHONDONTWRITEBYTECODE": "1", + "FAKE_STARTED": str(started), + "SYNCMILL_AGENT_PRIORITY": json.dumps(["codex"]), + "SYNCMILL_CLAUDE__ENABLED": "false", + "SYNCMILL_BOARD__ENABLED": "true", + "SYNCMILL_BOARD__STALL_SECONDS": str(STALL_SECONDS), + "SYNCMILL_GATE__COMMANDS": json.dumps(GATE), + "SYNCMILL_RUNS__ROOT": str(state / "runs"), + "SYNCMILL_WORKSPACE__ROOT": str(state / "workspaces"), + "SYNCMILL_MEMORY__DB_PATH": str(state / "memory" / "memtomem.db"), + "SYNCMILL_MEMORY__MEMORY_DIR": str(state / "memory" / "files"), + "SYNCMILL_BREAKER__STATE_PATH": str(state / "breaker.json"), + "SYNCMILL_TUI__STATE_DIR": str(state / "tui"), + "SYNCMILL_PROJECT__ID": "frozen-board", + **GIT_ENV, + } + + def git(*argv: str) -> None: + subprocess.run(["git", *argv], cwd=repo, env=base_env, check=True, + capture_output=True) + + git("init", "-q", "-b", "main") + for name, text in TREE.items(): + (repo / name).write_text(text, encoding="utf-8") + git("add", "-A") + git("commit", "-q", "-m", "frozen tree") + + out.mkdir(parents=True) + report = release / "tests" / "fixtures" / "tracegraph" / "v1.json" + bindings: dict = { + "release": version, + "box_root": str(box), + "stall_seconds": STALL_SECONDS, + "missing_dependency": MISSING_DEP, + "tracegraph_report": "tests/fixtures/tracegraph/v1.json", + "scenarios": {}, + } + + class Scenario: + def __init__(self, name: str): + self.name = name + self.dir = state / name + self.dir.mkdir() + self.env = {**base_env, "SYNCMILL_BOARD__DB_PATH": str(self.dir / "board.db")} + self.items: dict[str, str] = {} + self.decisions: dict[str, str] = {} + + def sm(self, *argv: str, ok: bool = True, plan: dict | None = None, + env: dict | None = None) -> str: + done = subprocess.run( + [str(syncmill), *argv], cwd=repo, + env={**self.env, "FAKE_PLAN": json.dumps(plan or {}), **(env or {})}, + capture_output=True, text=True, + ) + if ok and done.returncode != 0: + sys.exit(f"{self.name}: {argv}: {done.stdout}{done.stderr}") + if not ok and done.returncode == 0: + sys.exit(f"{self.name}: {argv} was expected to fail: {done.stdout}") + return done.stdout + + def add(self, role: str, task: str, *flags: str) -> str: + line = self.sm("board", "add", task, *flags) + self.items[role] = line.split("added item ")[1].split()[0] + return self.items[role] + + def run(self, role: str, plan: dict, *flags: str, ok: bool = True, + env: dict | None = None) -> None: + self.sm("board", "run", "--id", self.items[role], *flags, + ok=ok, plan=plan, env=env) + + def update(self, role: str, *flags: str, ok: bool = True) -> None: + self.sm("board", "update", self.items[role], *flags, ok=ok) + + def decide(self, role: str, text: str, *flags: str) -> None: + line = self.sm("board", "decide", text, *flags) + self.decisions[role] = line.split("recorded decision ")[1].split()[0] + + def hang(self, role: str): + """Start a run whose agent hangs; return it once the agent is up.""" + for p in started.iterdir(): + p.unlink() + proc = subprocess.Popen( + [str(syncmill), "board", "run", "--id", self.items[role]], + cwd=repo, env={**self.env, "FAKE_PLAN": json.dumps({"do": "hang"})}, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, + start_new_session=True, + ) + deadline = time.monotonic() + 60 + while not (started / "codex").exists(): + if proc.poll() is not None or time.monotonic() > deadline: + sys.exit(f"{self.name}: hanging agent never started: " + f"{proc.communicate()[0] if proc.poll() is not None else ''}") + time.sleep(0.1) + return proc, int((started / "codex").read_text()) + + def kill(self, role: str) -> None: + proc, agent = self.hang(role) + os.killpg(proc.pid, signal.SIGKILL) + proc.wait() + _kill_quietly(agent) + + def interrupt(self, role: str) -> None: + proc, agent = self.hang(role) + proc.send_signal(signal.SIGINT) + try: + proc.wait(timeout=60) + except subprocess.TimeoutExpired: + os.killpg(proc.pid, signal.SIGKILL) + sys.exit(f"{self.name}: SIGINT did not end the run") + _kill_quietly(agent) + + def crash(self, role: str) -> None: + flag = home / "crash-at" + flag.write_text("run", encoding="utf-8") + try: + self.run(role, {"do": "fix"}, ok=False) + finally: + flag.unlink() + + def reclaim(self, role: str) -> None: + """Kill a claim, then let the release's next run reclaim and finish it.""" + self.kill(role) + time.sleep(2) + self.run(role, {"do": "fix"}, + env={"SYNCMILL_BOARD__LEASE_TIMEOUT_SECONDS": "1"}) + + def freeze(sc: Scenario, *, killed: bool, goals: list[str], + boundary: str = "") -> dict: + wal = sorted(p.name for p in sc.dir.glob("*-wal")) + if bool(wal) != killed: + sys.exit(f"{sc.name}: expected {'a' if killed else 'no'} WAL, found {wal}") + shutil.copytree(sc.dir, out / sc.name) + read = release_read(sc, goals, sc.items.get(boundary, "")) + # Rows no `board add` named (the imported review candidates) get a + # role from their position in the release's own FIFO listing. + unnamed = [i for i in read["order"] if i not in sc.items.values()] + for n, item_id in enumerate(unnamed, 1): + sc.items[f"imported-{n}"] = item_id + entry = { + "items": sc.items, + "decisions": sc.decisions, + "frozen_at": read.pop("frozen_at"), + "files": sorted(p.name for p in (out / sc.name).iterdir()), + "release_read": read, + } + bindings["scenarios"][sc.name] = entry + return entry + + def release_read(sc: Scenario, goals: list[str], boundary_item: str = "") -> dict: + # A scratch copy with its sidecars, read with a normal connection: + # rows still in a killed process's WAL are seen, and neither the + # release nor this script ever opens the frozen files. + scratch = box / "read" / sc.name + shutil.rmtree(scratch, ignore_errors=True) + shutil.copytree(sc.dir, scratch) + db = scratch / "board.db" + _no_machine_values(db, box, home) + with sqlite3.connect(db) as conn: + frozen_at = conn.execute( + "SELECT MAX(m) FROM (SELECT MAX(updated_at) AS m FROM work_items " + "UNION ALL SELECT MAX(at) FROM transitions " + "UNION ALL SELECT MAX(created_at) FROM decisions)" + ).fetchone()[0] + conn.close() + done = subprocess.run( + [str(python), "-c", RELEASE_READ, str(db), repr(frozen_at), + json.dumps(goals), str(STALL_SECONDS), boundary_item], + env={**base_env, "SYNCMILL_BOARD__DB_PATH": str(db)}, + capture_output=True, text=True, + ) + if done.returncode != 0: + sys.exit(f"{sc.name}: release read failed: {done.stderr}") + read = json.loads(done.stdout) + read["frozen_at"] = frozen_at + return read + + # ── lifecycle: every row shape the released CLI writes ─────────── + sc = Scenario("lifecycle") + sc.add("passed", "fix add") + sc.run("passed", {"do": "fix"}) + sc.add("verified", "fix add and finish", "--goal", "backend") + sc.run("verified", {"do": "fix", "block": {"state": "done"}}) + sc.add("handed-off", "덧셈을 고친다", "--goal", "backend") + sc.run("handed-off", {"do": "fix", "block": { + "state": "review", "handoff": "검토: 부호를 확인할 것", + "outputs": ["notes/plan.md"]}}) + sc.add("route-gate-failed", "fix add badly") + sc.run("route-gate-failed", {"do": "wrong"}, ok=False) + sc.add("pipeline-gate-failed", "fix add badly in a pipeline") + sc.run("pipeline-gate-failed", {"do": "wrong"}, "--strategy", "pipeline", ok=False) + sc.add("agent-failed", "ask a refusing agent") + sc.run("agent-failed", {"do": "fail"}, ok=False) + sc.add("reclaimed", "fix add after a crash") + sc.reclaim("reclaimed") + sc.add("evidence-done", "verified by CI") + sc.run("evidence-done", {"do": "fix"}) + sc.update("evidence-done", "--state", "done", "--evidence", "CI ✓ run 42 — grün") + sc.add("signed-off", "verified by a human") + sc.run("signed-off", {"do": "fix"}) + sc.update("signed-off", "--state", "done", "--sign-off") + sc.add("bare-done-refused", "no verification yet") + sc.update("bare-done-refused", "--state", "done", ok=False) + sc.add("human-blocked", "waits on ops") + sc.update("human-blocked", "--state", "blocked", "--note", "waiting on ops") + sc.add("annotated", "carries a reference") + sc.update("annotated", "--evidence", "https://example.invalid/log/7") + sc.add("human-required", "needs a person", "--human-required") + sc.add("human-cleared", "needed a person", "--human-required") + sc.update("human-cleared", "--clear-human-required") + sc.add("needs-done", "after the verified item", "--depends-on", sc.items["verified"]) + sc.add("needs-planned", "after a planned item", "--depends-on", sc.items["annotated"]) + sc.add("needs-missing", "after an item that does not exist", "--depends-on", MISSING_DEP) + sc.add("needs-two", "after two items", + "--depends-on", sc.items["verified"], "--depends-on", sc.items["annotated"]) + line = sc.sm("board", "import-review-candidates", str(report), "--goal", "review") + if "imported" not in line: + sys.exit(f"lifecycle: import printed {line!r}") + sc.decide("global", "Use uv for every Python command.") + sc.decide("scoped", "백엔드는 SQLite를 유지한다.", "--scope", "backend") + sc.decide("superseded", "Tabs, not spaces.") + sc.decide("replacement", "Spaces, not tabs.", "--supersedes", sc.decisions["superseded"]) + sc.decide("other-scope", "Ship the docs with the code.", "--scope", "docs") + entry = freeze(sc, killed=False, goals=["backend", "docs", "review", "nothing"], + boundary="human-blocked") + _require_lifecycle(entry) + + # ── running: a run killed while its agent works ────────────────── + sc = Scenario("running") + sc.add("waiting", "still planned") + sc.add("killed", "killed mid-run", "--goal", "backend") + sc.kill("killed") + entry = freeze(sc, killed=True, goals=["backend"]) + _require(entry, "killed", state="running", lease=True) + + # ── crash-blocked: the release's cancel and crash paths ────────── + sc = Scenario("crash-blocked") + sc.add("interrupted", "interrupted by the operator") + sc.interrupt("interrupted") + sc.add("crashed", "orchestration raises") + sc.crash("crashed") + entry = freeze(sc, killed=False, goals=[], boundary="crashed") + _require(entry, "interrupted", state="blocked", human=True, + note="orchestration cancelled by operator (SIGINT)") + _require(entry, "crashed", state="blocked", human=True, + note="orchestration crashed: RuntimeError: frozen: injected orchestration failure") + + # ── compacted: aggregates folded out of a partly trimmed audit ──── + # `rolled` is reclaimed and re-claimed entirely before the cutoff, so + # its two claims and its reclaim live only in the rollups. `mixed` is + # claimed before the cutoff and reclaimed and re-claimed after it, so + # each of its counts needs the live rows AND the rollups. + if has_compact: + sc = Scenario("compacted") + sc.add("rolled", "fix add after a crash") + sc.reclaim("rolled") + sc.add("mixed", "fix add after a later crash") + sc.kill("mixed") + time.sleep(6) + sc.run("mixed", {"do": "fix"}, + env={"SYNCMILL_BOARD__LEASE_TIMEOUT_SECONDS": "1"}) + sc.add("passed", "fix add") + sc.run("passed", {"do": "fix"}) + before = release_read(sc, []) + history = before["transitions"][sc.items["mixed"]] + first_claim = history[1]["at"] + recovery = next(t["at"] for t in history if t["note"] == "stale-claim recovery") + if recovery - first_claim < 4: + sys.exit(f"compacted: no room for a cutoff: {history!r}") + older_than = time.time() - (first_claim + recovery) / 2 + line = sc.sm("board", "compact", "--older-than", f"{older_than:.3f}") + if not line.startswith("Compacted "): + sys.exit(f"compacted: compact printed {line!r}") + entry = freeze(sc, killed=False, goals=[]) + entry["before_compaction"] = before + _require_compacted(entry, before) + + (out / "bindings.json").write_text( + json.dumps(bindings, indent=2, ensure_ascii=False, sort_keys=True) + "\n", + encoding="utf-8", + ) + + +def _kill_quietly(pid: int) -> None: + try: + os.kill(pid, signal.SIGKILL) + except ProcessLookupError: + pass + + +def _no_machine_values(db: Path, box: Path, home: Path) -> None: + needles = {str(box), str(home), socket.gethostname(), os.path.expanduser("~")} + with sqlite3.connect(db) as conn: + for (table,) in conn.execute("SELECT name FROM sqlite_master WHERE type='table'"): + for row in conn.execute(f"SELECT * FROM {table}"): + for cell in row: + if isinstance(cell, str) and any(n and n in cell for n in needles): + sys.exit(f"{db}: {table} holds a machine-bound value: {cell[:200]!r}") + conn.close() + + +def _require(entry: dict, role: str, *, state: str, human: bool | None = None, + lease: bool | None = None, note: str | None = None, + evidence: list | None = None) -> None: + item_id = entry["items"][role] + item = entry["release_read"]["items"][item_id] + history = entry["release_read"]["transitions"][item_id] + problems = [] + if item["state"] != state: + problems.append(f"state {item['state']!r}") + if human is not None and item["human_required"] != human: + problems.append(f"human_required {item['human_required']!r}") + if lease is not None and bool(item["lease_run_id"]) != lease: + problems.append(f"lease {item['lease_run_id']!r}") + if note is not None and history[-1]["note"] != note: + problems.append(f"last note {history[-1]['note']!r}") + if evidence is not None: + got = [(e["kind"], e["passed"]) for e in item["evidence"]] + if got != evidence: + problems.append(f"evidence {got!r}") + if problems: + sys.exit(f"{role}: required property missing: {', '.join(problems)}") + + +def _claims(history: list[dict]) -> int: + return sum(1 for t in history if (t["from_state"], t["to_state"]) == ("planned", "running")) + + +def _require_lifecycle(entry: dict) -> None: + _require(entry, "passed", state="review", evidence=[("gate", True)], + note="agent completed; awaiting review") + _require(entry, "verified", state="done", evidence=[("gate", True)], + note="agent completed; verified") + _require(entry, "handed-off", state="review", evidence=[("gate", True)]) + _require(entry, "route-gate-failed", state="blocked", human=True, evidence=[]) + _require(entry, "pipeline-gate-failed", state="blocked", human=True, + evidence=[("gate", False)]) + _require(entry, "agent-failed", state="blocked", human=True, evidence=[]) + _require(entry, "reclaimed", state="review", evidence=[("gate", True)]) + _require(entry, "evidence-done", state="done", evidence=[("gate", True), ("manual", True)]) + _require(entry, "signed-off", state="done", evidence=[("gate", True), ("human", True)]) + _require(entry, "bare-done-refused", state="planned", evidence=[]) + _require(entry, "human-blocked", state="blocked", note="waiting on ops") + _require(entry, "annotated", state="planned", evidence=[("manual", True)]) + _require(entry, "human-required", state="planned", human=True) + _require(entry, "human-cleared", state="planned", human=False) + read = entry["release_read"] + handed = read["items"][entry["items"]["handed-off"]] + if not handed["handoff"] or "notes/plan.md" not in handed["outputs"]: + sys.exit(f"handed-off: handoff/outputs not recorded: {handed!r}") + reclaimed = read["transitions"][entry["items"]["reclaimed"]] + if _claims(reclaimed) != 2 or not any(t["note"] == "stale-claim recovery" for t in reclaimed): + sys.exit(f"reclaimed: expected two claims and a stale recovery: {reclaimed!r}") + imported = [read["items"][i] for r, i in entry["items"].items() if r.startswith("imported-")] + if not imported or any( + len(i["inputs"]) != 5 or i["state"] != "review" or not i["human_required"] + or [(e["kind"], e["passed"]) for e in i["evidence"]] != [("tracegraph", False)] + for i in imported + ): + sys.exit(f"lifecycle: review candidates not imported as expected: {imported!r}") + active = {d["id"] for d in read["active_decisions"]["*"]} + if entry["decisions"]["superseded"] in active or len(active) != 4: + sys.exit(f"lifecycle: unexpected active decisions: {sorted(active)}") + stats = read["stats"] + if stats["fresh"]["redispatched"] != [entry["items"]["reclaimed"]] \ + or stats["fresh"]["reclaimed_stale"] != 1: + sys.exit(f"lifecycle: unexpected stats: {stats['fresh']!r}") + if stats["aged"]["blocked_aged"] == stats["fresh"]["blocked_aged"]: + sys.exit("lifecycle: the aged clock changed no stall count") + + +def _require_compacted(entry: dict, before: dict) -> None: + after = entry["release_read"] + rolled, mixed = entry["items"]["rolled"], entry["items"]["mixed"] + for label, read in (("before", before), ("after", after)): + fresh = read["stats"]["fresh"] + if sorted(fresh["redispatched"]) != sorted([rolled, mixed]) \ + or fresh["reclaimed_stale"] != 2: + sys.exit(f"compacted: stats {label} compaction: {fresh!r}") + if before["stats"] != after["stats"]: + sys.exit("compacted: the release's own stats changed across compaction") + rollups = {r["item_id"]: r["claim_count"] + for r in after["aggregates"].get("transition_rollups", [])} + counters = {r["name"]: r["value"] + for r in after["aggregates"].get("transition_counters", [])} + live = after["transitions"] + if rollups.get(rolled) != 2 or live[rolled]: + sys.exit(f"compacted: rolled is not wholly rolled up: {rollups!r} {live[rolled]!r}") + if rollups.get(mixed) != 1 or _claims(live[mixed]) != 1: + sys.exit(f"compacted: mixed does not split its claims: {rollups!r} {live[mixed]!r}") + if counters.get("reclaimed_stale") != 1 or not any( + t["note"] == "stale-claim recovery" for t in live[mixed]): + sys.exit(f"compacted: reclaims do not split: {counters!r} {live[mixed]!r}") + + +if __name__ == "__main__": + main() diff --git a/tests/fixtures/persisted/board/v0.1.2/bindings.json b/tests/fixtures/persisted/board/v0.1.2/bindings.json new file mode 100644 index 0000000..c4c6d7d --- /dev/null +++ b/tests/fixtures/persisted/board/v0.1.2/bindings.json @@ -0,0 +1,1557 @@ +{ + "box_root": "/private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpup2411q6", + "missing_dependency": "00000000-0000-4000-8000-000000000000", + "release": "0.1.2", + "scenarios": { + "crash-blocked": { + "decisions": {}, + "files": [ + "board.db" + ], + "frozen_at": 1794698668.965004, + "items": { + "crashed": "73ba618d-6255-4b7d-9be5-e69a8100fe1f", + "interrupted": "fa697534-212a-4918-b7b0-0be81b290879" + }, + "release_read": { + "active_decisions": { + "*": [] + }, + "aggregates": {}, + "boundary": { + "item": "73ba618d-6255-4b7d-9be5-e69a8100fe1f", + "stats": { + "after": { + "blocked_aged": [ + "fa697534-212a-4918-b7b0-0be81b290879", + "73ba618d-6255-4b7d-9be5-e69a8100fe1f" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "fa697534-212a-4918-b7b0-0be81b290879", + "73ba618d-6255-4b7d-9be5-e69a8100fe1f" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "at": { + "blocked_aged": [ + "fa697534-212a-4918-b7b0-0be81b290879", + "73ba618d-6255-4b7d-9be5-e69a8100fe1f" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "fa697534-212a-4918-b7b0-0be81b290879", + "73ba618d-6255-4b7d-9be5-e69a8100fe1f" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "before": { + "blocked_aged": [ + "fa697534-212a-4918-b7b0-0be81b290879" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "fa697534-212a-4918-b7b0-0be81b290879" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + } + }, + "times": { + "after": 1794702268.9650042, + "at": 1794702268.965004, + "before": 1794702268.9650037 + } + }, + "decision_rows": [], + "decisions_mapped": [], + "items": { + "73ba618d-6255-4b7d-9be5-e69a8100fe1f": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698667.57725, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "73ba618d-6255-4b7d-9be5-e69a8100fe1f", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "blocked", + "task": "orchestration raises", + "updated_at": 1794698668.965004 + }, + "fa697534-212a-4918-b7b0-0be81b290879": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698664.676212, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "fa697534-212a-4918-b7b0-0be81b290879", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "blocked", + "task": "interrupted by the operator", + "updated_at": 1794698666.826995 + } + }, + "order": [ + "fa697534-212a-4918-b7b0-0be81b290879", + "73ba618d-6255-4b7d-9be5-e69a8100fe1f" + ], + "stats": { + "aged": { + "blocked_aged": [ + "fa697534-212a-4918-b7b0-0be81b290879", + "73ba618d-6255-4b7d-9be5-e69a8100fe1f" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "fa697534-212a-4918-b7b0-0be81b290879", + "73ba618d-6255-4b7d-9be5-e69a8100fe1f" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + } + }, + "transitions": { + "73ba618d-6255-4b7d-9be5-e69a8100fe1f": [ + { + "actor": "human", + "at": 1794698667.57725, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "14971b36-7613-4006-b310-3ba051053413", + "at": 1794698668.964285, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698668.965004, + "from_state": "running", + "note": "orchestration crashed: RuntimeError: frozen: injected orchestration failure", + "to_state": "blocked" + } + ], + "fa697534-212a-4918-b7b0-0be81b290879": [ + { + "actor": "human", + "at": 1794698664.676212, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "05534c8c-56b0-438b-b8ce-1688c9b7206a", + "at": 1794698665.291122, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698666.826995, + "from_state": "running", + "note": "orchestration cancelled by operator (SIGINT)", + "to_state": "blocked" + } + ] + } + } + }, + "lifecycle": { + "decisions": { + "global": "a5219469-1a17-4ee4-aa0a-e837654e84d4", + "other-scope": "28e3851b-1711-42a4-a5e5-60fa734a51e9", + "replacement": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "scoped": "296dc056-3c9e-4699-b044-d85baedd0d1a", + "superseded": "cb12bc01-96f6-4322-ae3a-6c4e9bb80f9f" + }, + "files": [ + "board.db" + ], + "frozen_at": 1794698661.102981, + "items": { + "agent-failed": "09b4c67a-ec4a-4732-8658-01d721dfc1b3", + "annotated": "3d5c3169-7023-4aa9-ad9d-62910fb767e6", + "bare-done-refused": "590a63d0-4d6b-43bc-a149-5a9ede88fbcb", + "evidence-done": "67ba43ad-2711-49b1-994f-af73fc7a6523", + "handed-off": "250805f5-fc0e-4ca3-8564-fa449f3e1855", + "human-blocked": "cd38d7ed-82f3-41c0-abad-841b590acf07", + "human-cleared": "f8e414fa-db58-4364-abc8-a26ade5ed297", + "human-required": "52e6c512-57f9-4c22-bd22-51e8427ea20f", + "imported-1": "db0ad772-7a10-587a-b48c-581e726e7b09", + "needs-done": "fa1452c9-a890-4136-8385-240cbea236bc", + "needs-missing": "d03a57bf-7d9c-4fdf-9169-69f55cd21a23", + "needs-planned": "fbca3bb1-35b9-4b27-994f-41367fbdd25b", + "needs-two": "fb34011e-6cab-4e76-a46a-ebc0c01b86fb", + "passed": "e80780d3-ea25-47d4-9e61-179e54db39ab", + "pipeline-gate-failed": "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "reclaimed": "5d99bb0d-60d3-4d03-99fa-3777680c1208", + "route-gate-failed": "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "signed-off": "cba2fe9d-c44e-4b28-a569-c54a2c40a32c", + "verified": "ed3507e2-101b-49d7-b88f-a2f4e20c55fb" + }, + "release_read": { + "active_decisions": { + "*": [ + { + "created_at": 1794698659.07176, + "id": "a5219469-1a17-4ee4-aa0a-e837654e84d4", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698659.577112, + "id": "296dc056-3c9e-4699-b044-d85baedd0d1a", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698660.593653, + "id": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698661.102981, + "id": "28e3851b-1711-42a4-a5e5-60fa734a51e9", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "backend": [ + { + "created_at": 1794698659.07176, + "id": "a5219469-1a17-4ee4-aa0a-e837654e84d4", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698659.577112, + "id": "296dc056-3c9e-4699-b044-d85baedd0d1a", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698660.593653, + "id": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + } + ], + "docs": [ + { + "created_at": 1794698659.07176, + "id": "a5219469-1a17-4ee4-aa0a-e837654e84d4", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698660.593653, + "id": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698661.102981, + "id": "28e3851b-1711-42a4-a5e5-60fa734a51e9", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "nothing": [ + { + "created_at": 1794698659.07176, + "id": "a5219469-1a17-4ee4-aa0a-e837654e84d4", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698660.593653, + "id": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + } + ], + "review": [ + { + "created_at": 1794698659.07176, + "id": "a5219469-1a17-4ee4-aa0a-e837654e84d4", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698660.593653, + "id": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + } + ] + }, + "aggregates": {}, + "boundary": { + "item": "cd38d7ed-82f3-41c0-abad-841b590acf07", + "stats": { + "after": { + "blocked_aged": [ + "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "09b4c67a-ec4a-4732-8658-01d721dfc1b3", + "cd38d7ed-82f3-41c0-abad-841b590acf07" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "250805f5-fc0e-4ca3-8564-fa449f3e1855" + ], + "false_done": [], + "human_required_aged": [ + "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "09b4c67a-ec4a-4732-8658-01d721dfc1b3" + ], + "reclaimed_stale": 1, + "redispatched": [ + "5d99bb0d-60d3-4d03-99fa-3777680c1208" + ], + "stall_seconds": 3600, + "total": 19 + }, + "at": { + "blocked_aged": [ + "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "09b4c67a-ec4a-4732-8658-01d721dfc1b3", + "cd38d7ed-82f3-41c0-abad-841b590acf07" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "250805f5-fc0e-4ca3-8564-fa449f3e1855" + ], + "false_done": [], + "human_required_aged": [ + "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "09b4c67a-ec4a-4732-8658-01d721dfc1b3" + ], + "reclaimed_stale": 1, + "redispatched": [ + "5d99bb0d-60d3-4d03-99fa-3777680c1208" + ], + "stall_seconds": 3600, + "total": 19 + }, + "before": { + "blocked_aged": [ + "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "09b4c67a-ec4a-4732-8658-01d721dfc1b3" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "250805f5-fc0e-4ca3-8564-fa449f3e1855" + ], + "false_done": [], + "human_required_aged": [ + "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "09b4c67a-ec4a-4732-8658-01d721dfc1b3" + ], + "reclaimed_stale": 1, + "redispatched": [ + "5d99bb0d-60d3-4d03-99fa-3777680c1208" + ], + "stall_seconds": 3600, + "total": 19 + } + }, + "times": { + "after": 1794702253.6544821, + "at": 1794702253.654482, + "before": 1794702253.6544816 + } + }, + "decision_rows": [ + { + "created_at": 1794698659.07176, + "id": "a5219469-1a17-4ee4-aa0a-e837654e84d4", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698659.577112, + "id": "296dc056-3c9e-4699-b044-d85baedd0d1a", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698660.086337, + "id": "cb12bc01-96f6-4322-ae3a-6c4e9bb80f9f", + "scope": "", + "superseded_at": 1794698660.593653, + "superseded_by": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "text": "Tabs, not spaces." + }, + { + "created_at": 1794698660.593653, + "id": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698661.102981, + "id": "28e3851b-1711-42a4-a5e5-60fa734a51e9", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "decisions_mapped": [ + { + "created_at": 1794698659.07176, + "id": "a5219469-1a17-4ee4-aa0a-e837654e84d4", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698659.577112, + "id": "296dc056-3c9e-4699-b044-d85baedd0d1a", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698660.086337, + "id": "cb12bc01-96f6-4322-ae3a-6c4e9bb80f9f", + "scope": "", + "superseded_at": 1794698660.593653, + "superseded_by": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "text": "Tabs, not spaces." + }, + { + "created_at": 1794698660.593653, + "id": "a022b75e-fa2f-4ff0-9c13-b19a42b42c86", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698661.102981, + "id": "28e3851b-1711-42a4-a5e5-60fa734a51e9", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "items": { + "09b4c67a-ec4a-4732-8658-01d721dfc1b3": { + "blocked_reason": "All agents failed:\n [codex] codex (fake): refused", + "claimed_at": null, + "created_at": 1794698639.064196, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "09b4c67a-ec4a-4732-8658-01d721dfc1b3", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": "none", + "state": "blocked", + "task": "ask a refusing agent", + "updated_at": 1794698640.572549 + }, + "250805f5-fc0e-4ca3-8564-fa449f3e1855": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698632.811248, + "depends_on": [], + "evidence": [ + { + "at": 1794698634.37516, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "backend", + "handoff": "검토: 부호를 확인할 것", + "human_required": false, + "id": "250805f5-fc0e-4ca3-8564-fa449f3e1855", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "notes/plan.md", + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "덧셈을 고친다", + "updated_at": 1794698634.37516 + }, + "3d5c3169-7023-4aa9-ad9d-62910fb767e6": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698654.1412852, + "depends_on": [], + "evidence": [ + { + "at": 1794698654.6227572, + "by": "human", + "kind": "manual", + "passed": true, + "ref": "https://example.invalid/log/7" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "3d5c3169-7023-4aa9-ad9d-62910fb767e6", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "carries a reference", + "updated_at": 1794698654.6228008 + }, + "52e6c512-57f9-4c22-bd22-51e8427ea20f": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698655.101978, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "52e6c512-57f9-4c22-bd22-51e8427ea20f", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "needs a person", + "updated_at": 1794698655.101978 + }, + "590a63d0-4d6b-43bc-a149-5a9ede88fbcb": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698652.167226, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "590a63d0-4d6b-43bc-a149-5a9ede88fbcb", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "no verification yet", + "updated_at": 1794698652.167226 + }, + "5d99bb0d-60d3-4d03-99fa-3777680c1208": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698641.113525, + "depends_on": [], + "evidence": [ + { + "at": 1794698646.1966789, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "5d99bb0d-60d3-4d03-99fa-3777680c1208", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a crash", + "updated_at": 1794698646.1966789 + }, + "67ba43ad-2711-49b1-994f-af73fc7a6523": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698646.730467, + "depends_on": [], + "evidence": [ + { + "at": 1794698648.338629, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + }, + { + "at": 1794698648.906337, + "by": "human", + "kind": "manual", + "passed": true, + "ref": "CI ✓ run 42 — grün" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "67ba43ad-2711-49b1-994f-af73fc7a6523", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "done", + "task": "verified by CI", + "updated_at": 1794698648.906389 + }, + "cba2fe9d-c44e-4b28-a569-c54a2c40a32c": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698649.4325051, + "depends_on": [], + "evidence": [ + { + "at": 1794698651.0604858, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + }, + { + "at": 1794698651.638635, + "by": "human", + "kind": "human", + "passed": true, + "ref": "sign-off" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "cba2fe9d-c44e-4b28-a569-c54a2c40a32c", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "done", + "task": "verified by a human", + "updated_at": 1794698651.638696 + }, + "cd38d7ed-82f3-41c0-abad-841b590acf07": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698653.167745, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "cd38d7ed-82f3-41c0-abad-841b590acf07", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "blocked", + "task": "waits on ops", + "updated_at": 1794698653.654482 + }, + "d03a57bf-7d9c-4fdf-9169-69f55cd21a23": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698657.559104, + "depends_on": [ + "00000000-0000-4000-8000-000000000000" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "d03a57bf-7d9c-4fdf-9169-69f55cd21a23", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after an item that does not exist", + "updated_at": 1794698657.559104 + }, + "db0ad772-7a10-587a-b48c-581e726e7b09": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698658.567849, + "depends_on": [], + "evidence": [ + { + "at": 1794698658.567849, + "by": "tracegraph", + "kind": "tracegraph", + "passed": false, + "ref": "sha256:2469307ff4b7bc62fd803a18822f3d26c6620bfaa06e0037db62082f6c9c528b" + } + ], + "goal": "review", + "handoff": "", + "human_required": true, + "id": "db0ad772-7a10-587a-b48c-581e726e7b09", + "inputs": [ + "source:tracegraph.review-candidates@v1", + "run_id:efd16fc1-758e-48fd-a765-bb3e27815952", + "pattern:tool-retry-failure@v2", + "tool_key:syncmill::board_stats", + "artifact_digest:sha256:2469307ff4b7bc62fd803a18822f3d26c6620bfaa06e0037db62082f6c9c528b" + ], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "review", + "task": "Review Tracegraph tool-retry-failure@v2 finding for syncmill::board_stats", + "updated_at": 1794698658.567849 + }, + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1": { + "blocked_reason": "quality gate failed: 0/1 checks passed; failed: python -c \"from calc import add; assert add(2, 3) == 5\"", + "claimed_at": null, + "created_at": 1794698636.983017, + "depends_on": [], + "evidence": [ + { + "at": 1794698638.513152, + "by": "codex", + "kind": "gate", + "passed": false, + "ref": "0/1 checks passed; failed: python -c \"from calc import add; assert add(2, 3) == 5\"" + } + ], + "goal": "", + "handoff": "", + "human_required": true, + "id": "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": "codex", + "state": "blocked", + "task": "fix add badly in a pipeline", + "updated_at": 1794698638.513152 + }, + "e80780d3-ea25-47d4-9e61-179e54db39ab": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698628.608104, + "depends_on": [], + "evidence": [ + { + "at": 1794698630.214753, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "e80780d3-ea25-47d4-9e61-179e54db39ab", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add", + "updated_at": 1794698630.214753 + }, + "ed0d53d3-6670-4949-8557-b38f8f7a1465": { + "blocked_reason": "All agents failed:\n [codex] quality gate failed: 0/1 checks passed; failed: python -c \"from calc import add; assert add(2, 3) == 5\"", + "claimed_at": null, + "created_at": 1794698634.904182, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": "none", + "state": "blocked", + "task": "fix add badly", + "updated_at": 1794698636.43021 + }, + "ed3507e2-101b-49d7-b88f-a2f4e20c55fb": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698630.7539961, + "depends_on": [], + "evidence": [ + { + "at": 1794698632.287241, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "backend", + "handoff": "", + "human_required": false, + "id": "ed3507e2-101b-49d7-b88f-a2f4e20c55fb", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "done", + "task": "fix add and finish", + "updated_at": 1794698632.287241 + }, + "f8e414fa-db58-4364-abc8-a26ade5ed297": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698655.5769348, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "f8e414fa-db58-4364-abc8-a26ade5ed297", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "needed a person", + "updated_at": 1794698656.059977 + }, + "fa1452c9-a890-4136-8385-240cbea236bc": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698656.5677388, + "depends_on": [ + "ed3507e2-101b-49d7-b88f-a2f4e20c55fb" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "fa1452c9-a890-4136-8385-240cbea236bc", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after the verified item", + "updated_at": 1794698656.5677388 + }, + "fb34011e-6cab-4e76-a46a-ebc0c01b86fb": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698658.060055, + "depends_on": [ + "ed3507e2-101b-49d7-b88f-a2f4e20c55fb", + "3d5c3169-7023-4aa9-ad9d-62910fb767e6" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "fb34011e-6cab-4e76-a46a-ebc0c01b86fb", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after two items", + "updated_at": 1794698658.060055 + }, + "fbca3bb1-35b9-4b27-994f-41367fbdd25b": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698657.056418, + "depends_on": [ + "3d5c3169-7023-4aa9-ad9d-62910fb767e6" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "fbca3bb1-35b9-4b27-994f-41367fbdd25b", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after a planned item", + "updated_at": 1794698657.056418 + } + }, + "order": [ + "e80780d3-ea25-47d4-9e61-179e54db39ab", + "ed3507e2-101b-49d7-b88f-a2f4e20c55fb", + "250805f5-fc0e-4ca3-8564-fa449f3e1855", + "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "09b4c67a-ec4a-4732-8658-01d721dfc1b3", + "5d99bb0d-60d3-4d03-99fa-3777680c1208", + "67ba43ad-2711-49b1-994f-af73fc7a6523", + "cba2fe9d-c44e-4b28-a569-c54a2c40a32c", + "590a63d0-4d6b-43bc-a149-5a9ede88fbcb", + "cd38d7ed-82f3-41c0-abad-841b590acf07", + "3d5c3169-7023-4aa9-ad9d-62910fb767e6", + "52e6c512-57f9-4c22-bd22-51e8427ea20f", + "f8e414fa-db58-4364-abc8-a26ade5ed297", + "fa1452c9-a890-4136-8385-240cbea236bc", + "fbca3bb1-35b9-4b27-994f-41367fbdd25b", + "d03a57bf-7d9c-4fdf-9169-69f55cd21a23", + "fb34011e-6cab-4e76-a46a-ebc0c01b86fb", + "db0ad772-7a10-587a-b48c-581e726e7b09" + ], + "stats": { + "aged": { + "blocked_aged": [ + "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "09b4c67a-ec4a-4732-8658-01d721dfc1b3", + "cd38d7ed-82f3-41c0-abad-841b590acf07" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "250805f5-fc0e-4ca3-8564-fa449f3e1855" + ], + "false_done": [], + "human_required_aged": [ + "ed0d53d3-6670-4949-8557-b38f8f7a1465", + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1", + "09b4c67a-ec4a-4732-8658-01d721dfc1b3", + "52e6c512-57f9-4c22-bd22-51e8427ea20f", + "db0ad772-7a10-587a-b48c-581e726e7b09" + ], + "reclaimed_stale": 1, + "redispatched": [ + "5d99bb0d-60d3-4d03-99fa-3777680c1208" + ], + "stall_seconds": 3600, + "total": 19 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 1, + "redispatched": [ + "5d99bb0d-60d3-4d03-99fa-3777680c1208" + ], + "stall_seconds": 3600, + "total": 19 + } + }, + "transitions": { + "09b4c67a-ec4a-4732-8658-01d721dfc1b3": [ + { + "actor": "human", + "at": 1794698639.064196, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "acbe6df4-c07f-43d9-ab21-d3832a18538f", + "at": 1794698640.161309, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "none", + "at": 1794698640.572549, + "from_state": "running", + "note": "run failed", + "to_state": "blocked" + } + ], + "250805f5-fc0e-4ca3-8564-fa449f3e1855": [ + { + "actor": "human", + "at": 1794698632.811248, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "ad3df32b-9c9f-432f-b2cd-85b2861fcd66", + "at": 1794698633.918839, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698634.37516, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "3d5c3169-7023-4aa9-ad9d-62910fb767e6": [ + { + "actor": "human", + "at": 1794698654.1412852, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "human", + "at": 1794698654.6228008, + "from_state": "planned", + "note": "annotated", + "to_state": "planned" + } + ], + "52e6c512-57f9-4c22-bd22-51e8427ea20f": [ + { + "actor": "human", + "at": 1794698655.101978, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "590a63d0-4d6b-43bc-a149-5a9ede88fbcb": [ + { + "actor": "human", + "at": 1794698652.167226, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "5d99bb0d-60d3-4d03-99fa-3777680c1208": [ + { + "actor": "human", + "at": 1794698641.113525, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "8628b3d3-5984-41ca-ab2d-5188935c6ec8", + "at": 1794698642.242814, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698645.181956, + "from_state": "running", + "note": "stale-claim recovery", + "to_state": "planned" + }, + { + "actor": "db8ffa31-0ff2-41b9-ab2e-a2c8ee2eb108", + "at": 1794698645.774993, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698646.1966789, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "67ba43ad-2711-49b1-994f-af73fc7a6523": [ + { + "actor": "human", + "at": 1794698646.730467, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "4e950744-afa9-4a60-b518-6236f74e78be", + "at": 1794698647.853072, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698648.338629, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + }, + { + "actor": "human", + "at": 1794698648.906389, + "from_state": "review", + "note": "", + "to_state": "done" + } + ], + "cba2fe9d-c44e-4b28-a569-c54a2c40a32c": [ + { + "actor": "human", + "at": 1794698649.4325051, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "a4e7383d-eb2d-4f3e-bc14-31e3c13d31a2", + "at": 1794698650.589119, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698651.0604858, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + }, + { + "actor": "human", + "at": 1794698651.638696, + "from_state": "review", + "note": "", + "to_state": "done" + } + ], + "cd38d7ed-82f3-41c0-abad-841b590acf07": [ + { + "actor": "human", + "at": 1794698653.167745, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "human", + "at": 1794698653.654482, + "from_state": "planned", + "note": "waiting on ops", + "to_state": "blocked" + } + ], + "d03a57bf-7d9c-4fdf-9169-69f55cd21a23": [ + { + "actor": "human", + "at": 1794698657.559104, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "db0ad772-7a10-587a-b48c-581e726e7b09": [ + { + "actor": "tracegraph-import", + "at": 1794698658.567849, + "from_state": null, + "note": "imported review candidate", + "to_state": "review" + } + ], + "e2b2d0e1-1042-49bd-b09d-f8574b086ef1": [ + { + "actor": "human", + "at": 1794698636.983017, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "cb05fc5d-cc05-4cca-8c0c-44c76cfacf33", + "at": 1794698638.0754921, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698638.513152, + "from_state": "running", + "note": "run failed", + "to_state": "blocked" + } + ], + "e80780d3-ea25-47d4-9e61-179e54db39ab": [ + { + "actor": "human", + "at": 1794698628.608104, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "8763a631-fac4-4b9a-b102-ad4fb49e7cb3", + "at": 1794698629.1479979, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698630.214753, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "ed0d53d3-6670-4949-8557-b38f8f7a1465": [ + { + "actor": "human", + "at": 1794698634.904182, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "9e1507ff-30b9-49e1-8276-22b8bef585f2", + "at": 1794698636.0288231, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "none", + "at": 1794698636.43021, + "from_state": "running", + "note": "run failed", + "to_state": "blocked" + } + ], + "ed3507e2-101b-49d7-b88f-a2f4e20c55fb": [ + { + "actor": "human", + "at": 1794698630.7539961, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "c2451fa6-eb7c-4468-ad55-edb97bc22b24", + "at": 1794698631.854018, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698632.287241, + "from_state": "running", + "note": "agent completed; verified", + "to_state": "done" + } + ], + "f8e414fa-db58-4364-abc8-a26ade5ed297": [ + { + "actor": "human", + "at": 1794698655.5769348, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "human", + "at": 1794698656.059977, + "from_state": "planned", + "note": "annotated", + "to_state": "planned" + } + ], + "fa1452c9-a890-4136-8385-240cbea236bc": [ + { + "actor": "human", + "at": 1794698656.5677388, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "fb34011e-6cab-4e76-a46a-ebc0c01b86fb": [ + { + "actor": "human", + "at": 1794698658.060055, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "fbca3bb1-35b9-4b27-994f-41367fbdd25b": [ + { + "actor": "human", + "at": 1794698657.056418, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ] + } + } + }, + "running": { + "decisions": {}, + "files": [ + "board.db", + "board.db-shm", + "board.db-wal" + ], + "frozen_at": 1794698662.841047, + "items": { + "killed": "0fe98d25-4f1e-437f-a0bc-0c28cdbc6fcc", + "waiting": "eba73a32-22cd-4052-8cfb-c1bc12fb40bb" + }, + "release_read": { + "active_decisions": { + "*": [], + "backend": [] + }, + "aggregates": {}, + "decision_rows": [], + "decisions_mapped": [], + "items": { + "0fe98d25-4f1e-437f-a0bc-0c28cdbc6fcc": { + "blocked_reason": "", + "claimed_at": 1794698662.841047, + "created_at": 1794698662.309786, + "depends_on": [], + "evidence": [], + "goal": "backend", + "handoff": "", + "human_required": false, + "id": "0fe98d25-4f1e-437f-a0bc-0c28cdbc6fcc", + "inputs": [], + "lease_run_id": "c8eecea0-a585-42e8-aa9d-dff948c5b960", + "outputs": [], + "owner_agent": null, + "state": "running", + "task": "killed mid-run", + "updated_at": 1794698662.841047 + }, + "eba73a32-22cd-4052-8cfb-c1bc12fb40bb": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698661.811179, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "eba73a32-22cd-4052-8cfb-c1bc12fb40bb", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "still planned", + "updated_at": 1794698661.811179 + } + }, + "order": [ + "eba73a32-22cd-4052-8cfb-c1bc12fb40bb", + "0fe98d25-4f1e-437f-a0bc-0c28cdbc6fcc" + ], + "stats": { + "aged": { + "blocked_aged": [], + "by_state": { + "planned": 1, + "running": 1 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "planned": 1, + "running": 1 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + } + }, + "transitions": { + "0fe98d25-4f1e-437f-a0bc-0c28cdbc6fcc": [ + { + "actor": "human", + "at": 1794698662.309786, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "c8eecea0-a585-42e8-aa9d-dff948c5b960", + "at": 1794698662.841047, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + } + ], + "eba73a32-22cd-4052-8cfb-c1bc12fb40bb": [ + { + "actor": "human", + "at": 1794698661.811179, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ] + } + } + } + }, + "stall_seconds": 3600, + "tracegraph_report": "tests/fixtures/tracegraph/v1.json" +} diff --git a/tests/fixtures/persisted/board/v0.1.2/crash-blocked/board.db b/tests/fixtures/persisted/board/v0.1.2/crash-blocked/board.db new file mode 100644 index 0000000..8b71a7e Binary files /dev/null and b/tests/fixtures/persisted/board/v0.1.2/crash-blocked/board.db differ diff --git a/tests/fixtures/persisted/board/v0.1.2/lifecycle/board.db b/tests/fixtures/persisted/board/v0.1.2/lifecycle/board.db new file mode 100644 index 0000000..c57d9e2 Binary files /dev/null and b/tests/fixtures/persisted/board/v0.1.2/lifecycle/board.db differ diff --git a/tests/fixtures/persisted/board/v0.1.2/running/board.db b/tests/fixtures/persisted/board/v0.1.2/running/board.db new file mode 100644 index 0000000..3dde73c Binary files /dev/null and b/tests/fixtures/persisted/board/v0.1.2/running/board.db differ diff --git a/tests/fixtures/persisted/board/v0.1.2/running/board.db-shm b/tests/fixtures/persisted/board/v0.1.2/running/board.db-shm new file mode 100644 index 0000000..2cce4dd Binary files /dev/null and b/tests/fixtures/persisted/board/v0.1.2/running/board.db-shm differ diff --git a/tests/fixtures/persisted/board/v0.1.2/running/board.db-wal b/tests/fixtures/persisted/board/v0.1.2/running/board.db-wal new file mode 100644 index 0000000..391e2cc Binary files /dev/null and b/tests/fixtures/persisted/board/v0.1.2/running/board.db-wal differ diff --git a/tests/fixtures/persisted/board/v0.2.0/bindings.json b/tests/fixtures/persisted/board/v0.2.0/bindings.json new file mode 100644 index 0000000..8119b5d --- /dev/null +++ b/tests/fixtures/persisted/board/v0.2.0/bindings.json @@ -0,0 +1,2015 @@ +{ + "box_root": "/private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpv85ishkt", + "missing_dependency": "00000000-0000-4000-8000-000000000000", + "release": "0.2.0", + "scenarios": { + "compacted": { + "before_compaction": { + "active_decisions": { + "*": [] + }, + "aggregates": { + "transition_counters": [], + "transition_rollups": [] + }, + "decision_rows": [], + "decisions_mapped": [], + "frozen_at": 1794698724.9303622, + "items": { + "38a4eb0e-6f63-4136-bdb7-aecebb384994": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698723.688433, + "depends_on": [], + "evidence": [ + { + "at": 1794698724.9303622, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "38a4eb0e-6f63-4136-bdb7-aecebb384994", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add", + "updated_at": 1794698724.9303622 + }, + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698714.736595, + "depends_on": [], + "evidence": [ + { + "at": 1794698723.098138, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a later crash", + "updated_at": 1794698723.098138 + }, + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698709.73811, + "depends_on": [], + "evidence": [ + { + "at": 1794698714.145309, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a crash", + "updated_at": 1794698714.145309 + } + }, + "order": [ + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde", + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2", + "38a4eb0e-6f63-4136-bdb7-aecebb384994" + ], + "stats": { + "aged": { + "blocked_aged": [], + "by_state": { + "review": 3 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 2, + "redispatched": [ + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2", + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde" + ], + "stall_seconds": 3600, + "total": 3 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "review": 3 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 2, + "redispatched": [ + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2", + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde" + ], + "stall_seconds": 3600, + "total": 3 + } + }, + "transitions": { + "38a4eb0e-6f63-4136-bdb7-aecebb384994": [ + { + "actor": "human", + "at": 1794698723.688433, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "fa6db59f-ed84-46e9-84af-f735377e54d5", + "at": 1794698724.332741, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698724.9303622, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2": [ + { + "actor": "human", + "at": 1794698714.736595, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "4a88c995-ec11-4a6c-b921-ff4a7757057c", + "at": 1794698715.370608, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698722.522509, + "from_state": "running", + "note": "stale-claim recovery", + "to_state": "planned" + }, + { + "actor": "41ad381d-ea7d-4a7f-8b68-11043cbd031c", + "at": 1794698722.5228841, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698723.098138, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde": [ + { + "actor": "human", + "at": 1794698709.73811, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "e5c8c080-3332-49de-b9e2-71af3b4be14e", + "at": 1794698710.380436, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698713.545851, + "from_state": "running", + "note": "stale-claim recovery", + "to_state": "planned" + }, + { + "actor": "7f9fbf8a-c641-46be-b8c9-15bee55b2ee0", + "at": 1794698713.546366, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698714.145309, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ] + } + }, + "decisions": {}, + "files": [ + "board.db", + "board.db.gc-lock" + ], + "frozen_at": 1794698724.9303622, + "items": { + "mixed": "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2", + "passed": "38a4eb0e-6f63-4136-bdb7-aecebb384994", + "rolled": "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde" + }, + "release_read": { + "active_decisions": { + "*": [] + }, + "aggregates": { + "transition_counters": [ + { + "name": "reclaimed_stale", + "value": 1 + } + ], + "transition_rollups": [ + { + "claim_count": 1, + "item_id": "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2" + }, + { + "claim_count": 2, + "item_id": "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde" + } + ] + }, + "decision_rows": [], + "decisions_mapped": [], + "items": { + "38a4eb0e-6f63-4136-bdb7-aecebb384994": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698723.688433, + "depends_on": [], + "evidence": [ + { + "at": 1794698724.9303622, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "38a4eb0e-6f63-4136-bdb7-aecebb384994", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add", + "updated_at": 1794698724.9303622 + }, + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698714.736595, + "depends_on": [], + "evidence": [ + { + "at": 1794698723.098138, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a later crash", + "updated_at": 1794698723.098138 + }, + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698709.73811, + "depends_on": [], + "evidence": [ + { + "at": 1794698714.145309, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a crash", + "updated_at": 1794698714.145309 + } + }, + "order": [ + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde", + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2", + "38a4eb0e-6f63-4136-bdb7-aecebb384994" + ], + "stats": { + "aged": { + "blocked_aged": [], + "by_state": { + "review": 3 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 2, + "redispatched": [ + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2", + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde" + ], + "stall_seconds": 3600, + "total": 3 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "review": 3 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 2, + "redispatched": [ + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2", + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde" + ], + "stall_seconds": 3600, + "total": 3 + } + }, + "transitions": { + "38a4eb0e-6f63-4136-bdb7-aecebb384994": [ + { + "actor": "human", + "at": 1794698723.688433, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "fa6db59f-ed84-46e9-84af-f735377e54d5", + "at": 1794698724.332741, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698724.9303622, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "66df6f1f-e77e-45fd-bb53-ee80c30ee9d2": [ + { + "actor": "system", + "at": 1794698722.522509, + "from_state": "running", + "note": "stale-claim recovery", + "to_state": "planned" + }, + { + "actor": "41ad381d-ea7d-4a7f-8b68-11043cbd031c", + "at": 1794698722.5228841, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698723.098138, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "b66ac996-f4bb-4a4c-ac2a-00c3f3bb7cde": [] + } + } + }, + "crash-blocked": { + "decisions": {}, + "files": [ + "board.db" + ], + "frozen_at": 1794698708.938221, + "items": { + "crashed": "fce654b0-a66e-4025-aed5-1f1f231ca6dd", + "interrupted": "830ba165-c068-47d0-b062-dde4d9edc8f7" + }, + "release_read": { + "active_decisions": { + "*": [] + }, + "aggregates": { + "transition_counters": [], + "transition_rollups": [] + }, + "boundary": { + "item": "fce654b0-a66e-4025-aed5-1f1f231ca6dd", + "stats": { + "after": { + "blocked_aged": [ + "830ba165-c068-47d0-b062-dde4d9edc8f7", + "fce654b0-a66e-4025-aed5-1f1f231ca6dd" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "830ba165-c068-47d0-b062-dde4d9edc8f7", + "fce654b0-a66e-4025-aed5-1f1f231ca6dd" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "at": { + "blocked_aged": [ + "830ba165-c068-47d0-b062-dde4d9edc8f7", + "fce654b0-a66e-4025-aed5-1f1f231ca6dd" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "830ba165-c068-47d0-b062-dde4d9edc8f7", + "fce654b0-a66e-4025-aed5-1f1f231ca6dd" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "before": { + "blocked_aged": [ + "830ba165-c068-47d0-b062-dde4d9edc8f7" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "830ba165-c068-47d0-b062-dde4d9edc8f7" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + } + }, + "times": { + "after": 1794702308.9382212, + "at": 1794702308.938221, + "before": 1794702308.9382207 + } + }, + "decision_rows": [], + "decisions_mapped": [], + "items": { + "830ba165-c068-47d0-b062-dde4d9edc8f7": { + "blocked_reason": "orchestration cancelled by operator (SIGINT)", + "claimed_at": null, + "created_at": 1794698706.51917, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "830ba165-c068-47d0-b062-dde4d9edc8f7", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "blocked", + "task": "interrupted by the operator", + "updated_at": 1794698707.687259 + }, + "fce654b0-a66e-4025-aed5-1f1f231ca6dd": { + "blocked_reason": "orchestration crashed: RuntimeError: frozen: injected orchestration failure", + "claimed_at": null, + "created_at": 1794698708.296758, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "fce654b0-a66e-4025-aed5-1f1f231ca6dd", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "blocked", + "task": "orchestration raises", + "updated_at": 1794698708.938221 + } + }, + "order": [ + "830ba165-c068-47d0-b062-dde4d9edc8f7", + "fce654b0-a66e-4025-aed5-1f1f231ca6dd" + ], + "stats": { + "aged": { + "blocked_aged": [ + "830ba165-c068-47d0-b062-dde4d9edc8f7", + "fce654b0-a66e-4025-aed5-1f1f231ca6dd" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "830ba165-c068-47d0-b062-dde4d9edc8f7", + "fce654b0-a66e-4025-aed5-1f1f231ca6dd" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + } + }, + "transitions": { + "830ba165-c068-47d0-b062-dde4d9edc8f7": [ + { + "actor": "human", + "at": 1794698706.51917, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "26ded5cf-6699-415f-86b6-44bd600d3388", + "at": 1794698707.1460102, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698707.687259, + "from_state": "running", + "note": "orchestration cancelled by operator (SIGINT)", + "to_state": "blocked" + } + ], + "fce654b0-a66e-4025-aed5-1f1f231ca6dd": [ + { + "actor": "human", + "at": 1794698708.296758, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "8432681a-71c7-47d5-84f7-f31c77f787bc", + "at": 1794698708.937366, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698708.938221, + "from_state": "running", + "note": "orchestration crashed: RuntimeError: frozen: injected orchestration failure", + "to_state": "blocked" + } + ] + } + } + }, + "lifecycle": { + "decisions": { + "global": "c0602ab1-9fa4-4221-9ee0-81e089f61624", + "other-scope": "99c3daef-8147-48cb-abeb-7b842c6ab0da", + "replacement": "358e296b-d874-4e27-a720-3769aecd1ef3", + "scoped": "1ff40700-3a13-4eb1-82c0-df0f990651e8", + "superseded": "8582ff36-6ca3-4848-841d-ce32c1fa0c66" + }, + "files": [ + "board.db", + "board.db.gc-lock" + ], + "frozen_at": 1794698703.200497, + "items": { + "agent-failed": "f5cb4597-7808-46ab-8f59-debe82245705", + "annotated": "439e0971-097a-43d8-9b40-26bab7fcd3a4", + "bare-done-refused": "48612b52-f063-47d1-82b0-f9463462fd09", + "evidence-done": "82af13a6-2af7-4a89-99b5-cb76f17f38d6", + "handed-off": "c7e03b49-63e9-43cb-8812-7e64e3540945", + "human-blocked": "3e7efe25-07e3-45da-8e63-6e9ed7c37bed", + "human-cleared": "0b7b1a14-7073-41ad-9a7d-062ee8c0148c", + "human-required": "e29da672-99dd-4f00-8256-eb49ac361207", + "imported-1": "db0ad772-7a10-587a-b48c-581e726e7b09", + "needs-done": "9d0ec325-02d4-4d12-a45e-60ae52f2df82", + "needs-missing": "0632579b-7a48-4acc-9877-087a27d146bf", + "needs-planned": "926acf3f-8331-4ffc-9878-743004594319", + "needs-two": "5c7adc0d-d21d-4064-ba3b-32ab946bcc80", + "passed": "3e42aab6-7ce1-45eb-aac4-826a6dfcc78b", + "pipeline-gate-failed": "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "reclaimed": "4dc5d162-1dc5-452c-8ad4-efebc110f4ab", + "route-gate-failed": "db0e439a-57dc-4e10-a956-d0f7b4807781", + "signed-off": "55907557-c8d1-4a3b-8242-c39e85bc24d8", + "verified": "2424fc1b-2463-48ca-8368-561083b6b32a" + }, + "release_read": { + "active_decisions": { + "*": [ + { + "created_at": 1794698700.838753, + "id": "c0602ab1-9fa4-4221-9ee0-81e089f61624", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698701.433802, + "id": "1ff40700-3a13-4eb1-82c0-df0f990651e8", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698702.6140192, + "id": "358e296b-d874-4e27-a720-3769aecd1ef3", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698703.200497, + "id": "99c3daef-8147-48cb-abeb-7b842c6ab0da", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "backend": [ + { + "created_at": 1794698700.838753, + "id": "c0602ab1-9fa4-4221-9ee0-81e089f61624", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698701.433802, + "id": "1ff40700-3a13-4eb1-82c0-df0f990651e8", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698702.6140192, + "id": "358e296b-d874-4e27-a720-3769aecd1ef3", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + } + ], + "docs": [ + { + "created_at": 1794698700.838753, + "id": "c0602ab1-9fa4-4221-9ee0-81e089f61624", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698702.6140192, + "id": "358e296b-d874-4e27-a720-3769aecd1ef3", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698703.200497, + "id": "99c3daef-8147-48cb-abeb-7b842c6ab0da", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "nothing": [ + { + "created_at": 1794698700.838753, + "id": "c0602ab1-9fa4-4221-9ee0-81e089f61624", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698702.6140192, + "id": "358e296b-d874-4e27-a720-3769aecd1ef3", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + } + ], + "review": [ + { + "created_at": 1794698700.838753, + "id": "c0602ab1-9fa4-4221-9ee0-81e089f61624", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698702.6140192, + "id": "358e296b-d874-4e27-a720-3769aecd1ef3", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + } + ] + }, + "aggregates": { + "transition_counters": [], + "transition_rollups": [] + }, + "boundary": { + "item": "3e7efe25-07e3-45da-8e63-6e9ed7c37bed", + "stats": { + "after": { + "blocked_aged": [ + "db0e439a-57dc-4e10-a956-d0f7b4807781", + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "f5cb4597-7808-46ab-8f59-debe82245705", + "3e7efe25-07e3-45da-8e63-6e9ed7c37bed" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "c7e03b49-63e9-43cb-8812-7e64e3540945" + ], + "false_done": [], + "human_required_aged": [ + "db0e439a-57dc-4e10-a956-d0f7b4807781", + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "f5cb4597-7808-46ab-8f59-debe82245705" + ], + "reclaimed_stale": 1, + "redispatched": [ + "4dc5d162-1dc5-452c-8ad4-efebc110f4ab" + ], + "stall_seconds": 3600, + "total": 19 + }, + "at": { + "blocked_aged": [ + "db0e439a-57dc-4e10-a956-d0f7b4807781", + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "f5cb4597-7808-46ab-8f59-debe82245705", + "3e7efe25-07e3-45da-8e63-6e9ed7c37bed" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "c7e03b49-63e9-43cb-8812-7e64e3540945" + ], + "false_done": [], + "human_required_aged": [ + "db0e439a-57dc-4e10-a956-d0f7b4807781", + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "f5cb4597-7808-46ab-8f59-debe82245705" + ], + "reclaimed_stale": 1, + "redispatched": [ + "4dc5d162-1dc5-452c-8ad4-efebc110f4ab" + ], + "stall_seconds": 3600, + "total": 19 + }, + "before": { + "blocked_aged": [ + "db0e439a-57dc-4e10-a956-d0f7b4807781", + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "f5cb4597-7808-46ab-8f59-debe82245705" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "c7e03b49-63e9-43cb-8812-7e64e3540945" + ], + "false_done": [], + "human_required_aged": [ + "db0e439a-57dc-4e10-a956-d0f7b4807781", + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "f5cb4597-7808-46ab-8f59-debe82245705" + ], + "reclaimed_stale": 1, + "redispatched": [ + "4dc5d162-1dc5-452c-8ad4-efebc110f4ab" + ], + "stall_seconds": 3600, + "total": 19 + } + }, + "times": { + "after": 1794702294.361, + "at": 1794702294.3609998, + "before": 1794702294.3609996 + } + }, + "decision_rows": [ + { + "created_at": 1794698700.838753, + "id": "c0602ab1-9fa4-4221-9ee0-81e089f61624", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698701.433802, + "id": "1ff40700-3a13-4eb1-82c0-df0f990651e8", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698702.025722, + "id": "8582ff36-6ca3-4848-841d-ce32c1fa0c66", + "scope": "", + "superseded_at": 1794698702.6140192, + "superseded_by": "358e296b-d874-4e27-a720-3769aecd1ef3", + "text": "Tabs, not spaces." + }, + { + "created_at": 1794698702.6140192, + "id": "358e296b-d874-4e27-a720-3769aecd1ef3", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698703.200497, + "id": "99c3daef-8147-48cb-abeb-7b842c6ab0da", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "decisions_mapped": [ + { + "created_at": 1794698700.838753, + "id": "c0602ab1-9fa4-4221-9ee0-81e089f61624", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698701.433802, + "id": "1ff40700-3a13-4eb1-82c0-df0f990651e8", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698702.025722, + "id": "8582ff36-6ca3-4848-841d-ce32c1fa0c66", + "scope": "", + "superseded_at": 1794698702.6140192, + "superseded_by": "358e296b-d874-4e27-a720-3769aecd1ef3", + "text": "Tabs, not spaces." + }, + { + "created_at": 1794698702.6140192, + "id": "358e296b-d874-4e27-a720-3769aecd1ef3", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698703.200497, + "id": "99c3daef-8147-48cb-abeb-7b842c6ab0da", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "items": { + "0632579b-7a48-4acc-9877-087a27d146bf": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698699.065164, + "depends_on": [ + "00000000-0000-4000-8000-000000000000" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "0632579b-7a48-4acc-9877-087a27d146bf", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after an item that does not exist", + "updated_at": 1794698699.065164 + }, + "0b7b1a14-7073-41ad-9a7d-062ee8c0148c": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698696.702538, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "0b7b1a14-7073-41ad-9a7d-062ee8c0148c", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "needed a person", + "updated_at": 1794698697.2933462 + }, + "2424fc1b-2463-48ca-8368-561083b6b32a": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698672.8998332, + "depends_on": [], + "evidence": [ + { + "at": 1794698674.222513, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "backend", + "handoff": "", + "human_required": false, + "id": "2424fc1b-2463-48ca-8368-561083b6b32a", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "done", + "task": "fix add and finish", + "updated_at": 1794698674.222513 + }, + "3e42aab6-7ce1-45eb-aac4-826a6dfcc78b": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698670.41087, + "depends_on": [], + "evidence": [ + { + "at": 1794698672.084589, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "3e42aab6-7ce1-45eb-aac4-826a6dfcc78b", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add", + "updated_at": 1794698672.084589 + }, + "3e7efe25-07e3-45da-8e63-6e9ed7c37bed": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698693.766751, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "3e7efe25-07e3-45da-8e63-6e9ed7c37bed", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "blocked", + "task": "waits on ops", + "updated_at": 1794698694.3609998 + }, + "439e0971-097a-43d8-9b40-26bab7fcd3a4": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698694.95162, + "depends_on": [], + "evidence": [ + { + "at": 1794698695.5368562, + "by": "human", + "kind": "manual", + "passed": true, + "ref": "https://example.invalid/log/7" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "439e0971-097a-43d8-9b40-26bab7fcd3a4", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "carries a reference", + "updated_at": 1794698695.5369 + }, + "48612b52-f063-47d1-82b0-f9463462fd09": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698692.575265, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "48612b52-f063-47d1-82b0-f9463462fd09", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "no verification yet", + "updated_at": 1794698692.575265 + }, + "4dc5d162-1dc5-452c-8ad4-efebc110f4ab": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698682.411555, + "depends_on": [], + "evidence": [ + { + "at": 1794698686.957033, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "4dc5d162-1dc5-452c-8ad4-efebc110f4ab", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a crash", + "updated_at": 1794698686.957033 + }, + "55907557-c8d1-4a3b-8242-c39e85bc24d8": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698690.095215, + "depends_on": [], + "evidence": [ + { + "at": 1794698691.3665679, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + }, + { + "at": 1794698691.984378, + "by": "human", + "kind": "human", + "passed": true, + "ref": "sign-off" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "55907557-c8d1-4a3b-8242-c39e85bc24d8", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "done", + "task": "verified by a human", + "updated_at": 1794698691.984438 + }, + "5c7adc0d-d21d-4064-ba3b-32ab946bcc80": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698699.6489332, + "depends_on": [ + "2424fc1b-2463-48ca-8368-561083b6b32a", + "439e0971-097a-43d8-9b40-26bab7fcd3a4" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "5c7adc0d-d21d-4064-ba3b-32ab946bcc80", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after two items", + "updated_at": 1794698699.6489332 + }, + "82af13a6-2af7-4a89-99b5-cb76f17f38d6": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698687.585543, + "depends_on": [], + "evidence": [ + { + "at": 1794698688.848358, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + }, + { + "at": 1794698689.4897459, + "by": "human", + "kind": "manual", + "passed": true, + "ref": "CI ✓ run 42 — grün" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "82af13a6-2af7-4a89-99b5-cb76f17f38d6", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "done", + "task": "verified by CI", + "updated_at": 1794698689.4897978 + }, + "926acf3f-8331-4ffc-9878-743004594319": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698698.480046, + "depends_on": [ + "439e0971-097a-43d8-9b40-26bab7fcd3a4" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "926acf3f-8331-4ffc-9878-743004594319", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after a planned item", + "updated_at": 1794698698.480046 + }, + "9d0ec325-02d4-4d12-a45e-60ae52f2df82": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698697.882132, + "depends_on": [ + "2424fc1b-2463-48ca-8368-561083b6b32a" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "9d0ec325-02d4-4d12-a45e-60ae52f2df82", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after the verified item", + "updated_at": 1794698697.882132 + }, + "c7e03b49-63e9-43cb-8812-7e64e3540945": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698674.842975, + "depends_on": [], + "evidence": [ + { + "at": 1794698676.149426, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "backend", + "handoff": "검토: 부호를 확인할 것", + "human_required": false, + "id": "c7e03b49-63e9-43cb-8812-7e64e3540945", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "notes/plan.md", + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "덧셈을 고친다", + "updated_at": 1794698676.149426 + }, + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f": { + "blocked_reason": "quality gate failed: 0/1 checks passed; failed: python -c \"from calc import add; assert add(2, 3) == 5\"", + "claimed_at": null, + "created_at": 1794698678.669067, + "depends_on": [], + "evidence": [ + { + "at": 1794698679.930895, + "by": "codex", + "kind": "gate", + "passed": false, + "ref": "0/1 checks passed; failed: python -c \"from calc import add; assert add(2, 3) == 5\"" + } + ], + "goal": "", + "handoff": "", + "human_required": true, + "id": "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": "codex", + "state": "blocked", + "task": "fix add badly in a pipeline", + "updated_at": 1794698679.930895 + }, + "db0ad772-7a10-587a-b48c-581e726e7b09": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698700.236747, + "depends_on": [], + "evidence": [ + { + "at": 1794698700.236747, + "by": "tracegraph", + "kind": "tracegraph", + "passed": false, + "ref": "sha256:2469307ff4b7bc62fd803a18822f3d26c6620bfaa06e0037db62082f6c9c528b" + } + ], + "goal": "review", + "handoff": "", + "human_required": true, + "id": "db0ad772-7a10-587a-b48c-581e726e7b09", + "inputs": [ + "source:tracegraph.review-candidates@v1", + "run_id:efd16fc1-758e-48fd-a765-bb3e27815952", + "pattern:tool-retry-failure@v2", + "tool_key:syncmill::board_stats", + "artifact_digest:sha256:2469307ff4b7bc62fd803a18822f3d26c6620bfaa06e0037db62082f6c9c528b" + ], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "review", + "task": "Review Tracegraph tool-retry-failure@v2 finding for syncmill::board_stats", + "updated_at": 1794698700.236747 + }, + "db0e439a-57dc-4e10-a956-d0f7b4807781": { + "blocked_reason": "All agents failed:\n [codex] quality gate failed: 0/1 checks passed; failed: python -c \"from calc import add; assert add(2, 3) == 5\"", + "claimed_at": null, + "created_at": 1794698676.7810402, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "db0e439a-57dc-4e10-a956-d0f7b4807781", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": "none", + "state": "blocked", + "task": "fix add badly", + "updated_at": 1794698678.03695 + }, + "e29da672-99dd-4f00-8256-eb49ac361207": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698696.119448, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "e29da672-99dd-4f00-8256-eb49ac361207", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "needs a person", + "updated_at": 1794698696.119448 + }, + "f5cb4597-7808-46ab-8f59-debe82245705": { + "blocked_reason": "All agents failed:\n [codex] codex (fake): refused", + "claimed_at": null, + "created_at": 1794698680.559537, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "f5cb4597-7808-46ab-8f59-debe82245705", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": "none", + "state": "blocked", + "task": "ask a refusing agent", + "updated_at": 1794698681.787213 + } + }, + "order": [ + "3e42aab6-7ce1-45eb-aac4-826a6dfcc78b", + "2424fc1b-2463-48ca-8368-561083b6b32a", + "c7e03b49-63e9-43cb-8812-7e64e3540945", + "db0e439a-57dc-4e10-a956-d0f7b4807781", + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "f5cb4597-7808-46ab-8f59-debe82245705", + "4dc5d162-1dc5-452c-8ad4-efebc110f4ab", + "82af13a6-2af7-4a89-99b5-cb76f17f38d6", + "55907557-c8d1-4a3b-8242-c39e85bc24d8", + "48612b52-f063-47d1-82b0-f9463462fd09", + "3e7efe25-07e3-45da-8e63-6e9ed7c37bed", + "439e0971-097a-43d8-9b40-26bab7fcd3a4", + "e29da672-99dd-4f00-8256-eb49ac361207", + "0b7b1a14-7073-41ad-9a7d-062ee8c0148c", + "9d0ec325-02d4-4d12-a45e-60ae52f2df82", + "926acf3f-8331-4ffc-9878-743004594319", + "0632579b-7a48-4acc-9877-087a27d146bf", + "5c7adc0d-d21d-4064-ba3b-32ab946bcc80", + "db0ad772-7a10-587a-b48c-581e726e7b09" + ], + "stats": { + "aged": { + "blocked_aged": [ + "db0e439a-57dc-4e10-a956-d0f7b4807781", + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "f5cb4597-7808-46ab-8f59-debe82245705", + "3e7efe25-07e3-45da-8e63-6e9ed7c37bed" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "c7e03b49-63e9-43cb-8812-7e64e3540945" + ], + "false_done": [], + "human_required_aged": [ + "db0e439a-57dc-4e10-a956-d0f7b4807781", + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f", + "f5cb4597-7808-46ab-8f59-debe82245705", + "e29da672-99dd-4f00-8256-eb49ac361207", + "db0ad772-7a10-587a-b48c-581e726e7b09" + ], + "reclaimed_stale": 1, + "redispatched": [ + "4dc5d162-1dc5-452c-8ad4-efebc110f4ab" + ], + "stall_seconds": 3600, + "total": 19 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 1, + "redispatched": [ + "4dc5d162-1dc5-452c-8ad4-efebc110f4ab" + ], + "stall_seconds": 3600, + "total": 19 + } + }, + "transitions": { + "0632579b-7a48-4acc-9877-087a27d146bf": [ + { + "actor": "human", + "at": 1794698699.065164, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "0b7b1a14-7073-41ad-9a7d-062ee8c0148c": [ + { + "actor": "human", + "at": 1794698696.702538, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "human", + "at": 1794698697.2933462, + "from_state": "planned", + "note": "annotated", + "to_state": "planned" + } + ], + "2424fc1b-2463-48ca-8368-561083b6b32a": [ + { + "actor": "human", + "at": 1794698672.8998332, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "69236332-c7b0-4fec-8031-7bef465c20d0", + "at": 1794698673.585401, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698674.222513, + "from_state": "running", + "note": "agent completed; verified", + "to_state": "done" + } + ], + "3e42aab6-7ce1-45eb-aac4-826a6dfcc78b": [ + { + "actor": "human", + "at": 1794698670.41087, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "7c6848c4-0788-4532-9fd5-22fcba8511e5", + "at": 1794698671.138468, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698672.084589, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "3e7efe25-07e3-45da-8e63-6e9ed7c37bed": [ + { + "actor": "human", + "at": 1794698693.766751, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "human", + "at": 1794698694.3609998, + "from_state": "planned", + "note": "waiting on ops", + "to_state": "blocked" + } + ], + "439e0971-097a-43d8-9b40-26bab7fcd3a4": [ + { + "actor": "human", + "at": 1794698694.95162, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "human", + "at": 1794698695.5369, + "from_state": "planned", + "note": "annotated", + "to_state": "planned" + } + ], + "48612b52-f063-47d1-82b0-f9463462fd09": [ + { + "actor": "human", + "at": 1794698692.575265, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "4dc5d162-1dc5-452c-8ad4-efebc110f4ab": [ + { + "actor": "human", + "at": 1794698682.411555, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "07f2e02c-a5c6-43c2-b60e-352c910540a7", + "at": 1794698683.05756, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698686.332617, + "from_state": "running", + "note": "stale-claim recovery", + "to_state": "planned" + }, + { + "actor": "3a9d8230-7135-4a49-abb0-5eb470cf5813", + "at": 1794698686.3330638, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698686.957033, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "55907557-c8d1-4a3b-8242-c39e85bc24d8": [ + { + "actor": "human", + "at": 1794698690.095215, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "78531eea-b3d4-408b-898f-03f77b526188", + "at": 1794698690.738274, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698691.3665679, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + }, + { + "actor": "human", + "at": 1794698691.984438, + "from_state": "review", + "note": "", + "to_state": "done" + } + ], + "5c7adc0d-d21d-4064-ba3b-32ab946bcc80": [ + { + "actor": "human", + "at": 1794698699.6489332, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "82af13a6-2af7-4a89-99b5-cb76f17f38d6": [ + { + "actor": "human", + "at": 1794698687.585543, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "1d2fe260-f7bf-4d48-b56b-32095d82b0f0", + "at": 1794698688.226159, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698688.848358, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + }, + { + "actor": "human", + "at": 1794698689.4897978, + "from_state": "review", + "note": "", + "to_state": "done" + } + ], + "926acf3f-8331-4ffc-9878-743004594319": [ + { + "actor": "human", + "at": 1794698698.480046, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "9d0ec325-02d4-4d12-a45e-60ae52f2df82": [ + { + "actor": "human", + "at": 1794698697.882132, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "c7e03b49-63e9-43cb-8812-7e64e3540945": [ + { + "actor": "human", + "at": 1794698674.842975, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "05d4da4c-9c6d-41df-aa86-f5fbe03aaed7", + "at": 1794698675.4951308, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698676.149426, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "d3eb1d37-c360-4e72-8ec7-6198f513ba8f": [ + { + "actor": "human", + "at": 1794698678.669067, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "8cb9d4e1-44fb-45e4-ae94-367dd66efc3e", + "at": 1794698679.3364139, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698679.930895, + "from_state": "running", + "note": "run failed", + "to_state": "blocked" + } + ], + "db0ad772-7a10-587a-b48c-581e726e7b09": [ + { + "actor": "tracegraph-import", + "at": 1794698700.236747, + "from_state": null, + "note": "imported review candidate", + "to_state": "review" + } + ], + "db0e439a-57dc-4e10-a956-d0f7b4807781": [ + { + "actor": "human", + "at": 1794698676.7810402, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "5a85a64e-3158-4cbb-98b3-b4a4fe729ab5", + "at": 1794698677.4456031, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "none", + "at": 1794698678.03695, + "from_state": "running", + "note": "run failed", + "to_state": "blocked" + } + ], + "e29da672-99dd-4f00-8256-eb49ac361207": [ + { + "actor": "human", + "at": 1794698696.119448, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "f5cb4597-7808-46ab-8f59-debe82245705": [ + { + "actor": "human", + "at": 1794698680.559537, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "f2fbb500-b702-4d18-9b4c-969b7cbad0f9", + "at": 1794698681.226685, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "none", + "at": 1794698681.787213, + "from_state": "running", + "note": "run failed", + "to_state": "blocked" + } + ] + } + } + }, + "running": { + "decisions": {}, + "files": [ + "board.db", + "board.db-shm", + "board.db-wal" + ], + "frozen_at": 1794698705.2356749, + "items": { + "killed": "0a33e021-c123-47a2-ae88-1b7833bddc36", + "waiting": "31846270-93c4-4261-8808-ecf9247cda34" + }, + "release_read": { + "active_decisions": { + "*": [], + "backend": [] + }, + "aggregates": { + "transition_counters": [], + "transition_rollups": [] + }, + "decision_rows": [], + "decisions_mapped": [], + "items": { + "0a33e021-c123-47a2-ae88-1b7833bddc36": { + "blocked_reason": "", + "claimed_at": 1794698705.2356749, + "created_at": 1794698704.587973, + "depends_on": [], + "evidence": [], + "goal": "backend", + "handoff": "", + "human_required": false, + "id": "0a33e021-c123-47a2-ae88-1b7833bddc36", + "inputs": [], + "lease_run_id": "c8b5aa92-62d3-4de0-ba79-b61b15e23f53", + "outputs": [], + "owner_agent": null, + "state": "running", + "task": "killed mid-run", + "updated_at": 1794698705.2356749 + }, + "31846270-93c4-4261-8808-ecf9247cda34": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698704.0078442, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "31846270-93c4-4261-8808-ecf9247cda34", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "still planned", + "updated_at": 1794698704.0078442 + } + }, + "order": [ + "31846270-93c4-4261-8808-ecf9247cda34", + "0a33e021-c123-47a2-ae88-1b7833bddc36" + ], + "stats": { + "aged": { + "blocked_aged": [], + "by_state": { + "planned": 1, + "running": 1 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "planned": 1, + "running": 1 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + } + }, + "transitions": { + "0a33e021-c123-47a2-ae88-1b7833bddc36": [ + { + "actor": "human", + "at": 1794698704.587973, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "c8b5aa92-62d3-4de0-ba79-b61b15e23f53", + "at": 1794698705.2356749, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + } + ], + "31846270-93c4-4261-8808-ecf9247cda34": [ + { + "actor": "human", + "at": 1794698704.0078442, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ] + } + } + } + }, + "stall_seconds": 3600, + "tracegraph_report": "tests/fixtures/tracegraph/v1.json" +} diff --git a/tests/fixtures/persisted/board/v0.2.0/compacted/board.db b/tests/fixtures/persisted/board/v0.2.0/compacted/board.db new file mode 100644 index 0000000..ad7b20b Binary files /dev/null and b/tests/fixtures/persisted/board/v0.2.0/compacted/board.db differ diff --git a/tests/fixtures/persisted/board/v0.2.0/compacted/board.db.gc-lock b/tests/fixtures/persisted/board/v0.2.0/compacted/board.db.gc-lock new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/board/v0.2.0/crash-blocked/board.db b/tests/fixtures/persisted/board/v0.2.0/crash-blocked/board.db new file mode 100644 index 0000000..0da0e0a Binary files /dev/null and b/tests/fixtures/persisted/board/v0.2.0/crash-blocked/board.db differ diff --git a/tests/fixtures/persisted/board/v0.2.0/lifecycle/board.db b/tests/fixtures/persisted/board/v0.2.0/lifecycle/board.db new file mode 100644 index 0000000..adea925 Binary files /dev/null and b/tests/fixtures/persisted/board/v0.2.0/lifecycle/board.db differ diff --git a/tests/fixtures/persisted/board/v0.2.0/lifecycle/board.db.gc-lock b/tests/fixtures/persisted/board/v0.2.0/lifecycle/board.db.gc-lock new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/board/v0.2.0/running/board.db b/tests/fixtures/persisted/board/v0.2.0/running/board.db new file mode 100644 index 0000000..a20b62f Binary files /dev/null and b/tests/fixtures/persisted/board/v0.2.0/running/board.db differ diff --git a/tests/fixtures/persisted/board/v0.2.0/running/board.db-shm b/tests/fixtures/persisted/board/v0.2.0/running/board.db-shm new file mode 100644 index 0000000..c6e875f Binary files /dev/null and b/tests/fixtures/persisted/board/v0.2.0/running/board.db-shm differ diff --git a/tests/fixtures/persisted/board/v0.2.0/running/board.db-wal b/tests/fixtures/persisted/board/v0.2.0/running/board.db-wal new file mode 100644 index 0000000..2514dfa Binary files /dev/null and b/tests/fixtures/persisted/board/v0.2.0/running/board.db-wal differ diff --git a/tests/fixtures/persisted/board/v0.3.0/bindings.json b/tests/fixtures/persisted/board/v0.3.0/bindings.json new file mode 100644 index 0000000..aacaea7 --- /dev/null +++ b/tests/fixtures/persisted/board/v0.3.0/bindings.json @@ -0,0 +1,2015 @@ +{ + "box_root": "/private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpwi711q0i", + "missing_dependency": "00000000-0000-4000-8000-000000000000", + "release": "0.3.0", + "scenarios": { + "compacted": { + "before_compaction": { + "active_decisions": { + "*": [] + }, + "aggregates": { + "transition_counters": [], + "transition_rollups": [] + }, + "decision_rows": [], + "decisions_mapped": [], + "frozen_at": 1794698781.3185, + "items": { + "554d0700-3c52-42e8-a072-ac29dd9e1eb2": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698780.0333068, + "depends_on": [], + "evidence": [ + { + "at": 1794698781.3185, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "554d0700-3c52-42e8-a072-ac29dd9e1eb2", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add", + "updated_at": 1794698781.3185 + }, + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698765.559068, + "depends_on": [], + "evidence": [ + { + "at": 1794698770.206312, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a crash", + "updated_at": 1794698770.206312 + }, + "8a6070da-67d6-491d-92ca-5c1801d526c2": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698770.8670259, + "depends_on": [], + "evidence": [ + { + "at": 1794698779.412703, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "8a6070da-67d6-491d-92ca-5c1801d526c2", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a later crash", + "updated_at": 1794698779.412703 + } + }, + "order": [ + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac", + "8a6070da-67d6-491d-92ca-5c1801d526c2", + "554d0700-3c52-42e8-a072-ac29dd9e1eb2" + ], + "stats": { + "aged": { + "blocked_aged": [], + "by_state": { + "review": 3 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 2, + "redispatched": [ + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac", + "8a6070da-67d6-491d-92ca-5c1801d526c2" + ], + "stall_seconds": 3600, + "total": 3 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "review": 3 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 2, + "redispatched": [ + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac", + "8a6070da-67d6-491d-92ca-5c1801d526c2" + ], + "stall_seconds": 3600, + "total": 3 + } + }, + "transitions": { + "554d0700-3c52-42e8-a072-ac29dd9e1eb2": [ + { + "actor": "human", + "at": 1794698780.0333068, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "369e5972-3979-4d58-b1cd-82a3e882878b", + "at": 1794698780.7056189, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698781.3185, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac": [ + { + "actor": "human", + "at": 1794698765.559068, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "43ce6bc3-fef6-4bf8-9d80-a77f30c11a90", + "at": 1794698766.225875, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698769.50398, + "from_state": "running", + "note": "stale-claim recovery", + "to_state": "planned" + }, + { + "actor": "e29927c4-093e-4aa3-91b2-c4ed8c4cf0e5", + "at": 1794698769.504431, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698770.206312, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "8a6070da-67d6-491d-92ca-5c1801d526c2": [ + { + "actor": "human", + "at": 1794698770.8670259, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "e13e94f2-8616-442a-acb3-3041d8a6c42f", + "at": 1794698771.513713, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698778.778651, + "from_state": "running", + "note": "stale-claim recovery", + "to_state": "planned" + }, + { + "actor": "d471aa02-a69f-4a07-a622-65a46dcdbd81", + "at": 1794698778.7790341, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698779.412703, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ] + } + }, + "decisions": {}, + "files": [ + "board.db", + "board.db.gc-lock" + ], + "frozen_at": 1794698781.3185, + "items": { + "mixed": "8a6070da-67d6-491d-92ca-5c1801d526c2", + "passed": "554d0700-3c52-42e8-a072-ac29dd9e1eb2", + "rolled": "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac" + }, + "release_read": { + "active_decisions": { + "*": [] + }, + "aggregates": { + "transition_counters": [ + { + "name": "reclaimed_stale", + "value": 1 + } + ], + "transition_rollups": [ + { + "claim_count": 2, + "item_id": "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac" + }, + { + "claim_count": 1, + "item_id": "8a6070da-67d6-491d-92ca-5c1801d526c2" + } + ] + }, + "decision_rows": [], + "decisions_mapped": [], + "items": { + "554d0700-3c52-42e8-a072-ac29dd9e1eb2": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698780.0333068, + "depends_on": [], + "evidence": [ + { + "at": 1794698781.3185, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "554d0700-3c52-42e8-a072-ac29dd9e1eb2", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add", + "updated_at": 1794698781.3185 + }, + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698765.559068, + "depends_on": [], + "evidence": [ + { + "at": 1794698770.206312, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a crash", + "updated_at": 1794698770.206312 + }, + "8a6070da-67d6-491d-92ca-5c1801d526c2": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698770.8670259, + "depends_on": [], + "evidence": [ + { + "at": 1794698779.412703, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "8a6070da-67d6-491d-92ca-5c1801d526c2", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a later crash", + "updated_at": 1794698779.412703 + } + }, + "order": [ + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac", + "8a6070da-67d6-491d-92ca-5c1801d526c2", + "554d0700-3c52-42e8-a072-ac29dd9e1eb2" + ], + "stats": { + "aged": { + "blocked_aged": [], + "by_state": { + "review": 3 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 2, + "redispatched": [ + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac", + "8a6070da-67d6-491d-92ca-5c1801d526c2" + ], + "stall_seconds": 3600, + "total": 3 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "review": 3 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 2, + "redispatched": [ + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac", + "8a6070da-67d6-491d-92ca-5c1801d526c2" + ], + "stall_seconds": 3600, + "total": 3 + } + }, + "transitions": { + "554d0700-3c52-42e8-a072-ac29dd9e1eb2": [ + { + "actor": "human", + "at": 1794698780.0333068, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "369e5972-3979-4d58-b1cd-82a3e882878b", + "at": 1794698780.7056189, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698781.3185, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "5aa259d1-6f23-41ae-8ba2-87d2ec71c8ac": [], + "8a6070da-67d6-491d-92ca-5c1801d526c2": [ + { + "actor": "system", + "at": 1794698778.778651, + "from_state": "running", + "note": "stale-claim recovery", + "to_state": "planned" + }, + { + "actor": "d471aa02-a69f-4a07-a622-65a46dcdbd81", + "at": 1794698778.7790341, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698779.412703, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ] + } + } + }, + "crash-blocked": { + "decisions": {}, + "files": [ + "board.db" + ], + "frozen_at": 1794698764.732039, + "items": { + "crashed": "9528575c-aedb-4c2e-ae84-361dc144bc53", + "interrupted": "42561466-5838-4697-b299-2ffff69e64f5" + }, + "release_read": { + "active_decisions": { + "*": [] + }, + "aggregates": { + "transition_counters": [], + "transition_rollups": [] + }, + "boundary": { + "item": "9528575c-aedb-4c2e-ae84-361dc144bc53", + "stats": { + "after": { + "blocked_aged": [ + "42561466-5838-4697-b299-2ffff69e64f5", + "9528575c-aedb-4c2e-ae84-361dc144bc53" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "42561466-5838-4697-b299-2ffff69e64f5", + "9528575c-aedb-4c2e-ae84-361dc144bc53" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "at": { + "blocked_aged": [ + "42561466-5838-4697-b299-2ffff69e64f5", + "9528575c-aedb-4c2e-ae84-361dc144bc53" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "42561466-5838-4697-b299-2ffff69e64f5", + "9528575c-aedb-4c2e-ae84-361dc144bc53" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "before": { + "blocked_aged": [ + "42561466-5838-4697-b299-2ffff69e64f5" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "42561466-5838-4697-b299-2ffff69e64f5" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + } + }, + "times": { + "after": 1794702364.7320392, + "at": 1794702364.732039, + "before": 1794702364.7320387 + } + }, + "decision_rows": [], + "decisions_mapped": [], + "items": { + "42561466-5838-4697-b299-2ffff69e64f5": { + "blocked_reason": "orchestration cancelled by operator (SIGINT)", + "claimed_at": null, + "created_at": 1794698762.1561542, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "42561466-5838-4697-b299-2ffff69e64f5", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "blocked", + "task": "interrupted by the operator", + "updated_at": 1794698763.438907 + }, + "9528575c-aedb-4c2e-ae84-361dc144bc53": { + "blocked_reason": "orchestration crashed: RuntimeError: frozen: injected orchestration failure", + "claimed_at": null, + "created_at": 1794698764.075649, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "9528575c-aedb-4c2e-ae84-361dc144bc53", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "blocked", + "task": "orchestration raises", + "updated_at": 1794698764.732039 + } + }, + "order": [ + "42561466-5838-4697-b299-2ffff69e64f5", + "9528575c-aedb-4c2e-ae84-361dc144bc53" + ], + "stats": { + "aged": { + "blocked_aged": [ + "42561466-5838-4697-b299-2ffff69e64f5", + "9528575c-aedb-4c2e-ae84-361dc144bc53" + ], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [ + "42561466-5838-4697-b299-2ffff69e64f5", + "9528575c-aedb-4c2e-ae84-361dc144bc53" + ], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "blocked": 2 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + } + }, + "transitions": { + "42561466-5838-4697-b299-2ffff69e64f5": [ + { + "actor": "human", + "at": 1794698762.1561542, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "374d6c22-7066-4aa2-bd96-359fbbf30ce7", + "at": 1794698762.819686, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698763.438907, + "from_state": "running", + "note": "orchestration cancelled by operator (SIGINT)", + "to_state": "blocked" + } + ], + "9528575c-aedb-4c2e-ae84-361dc144bc53": [ + { + "actor": "human", + "at": 1794698764.075649, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "4e313a33-e7ec-4d22-bb27-b930c1c1bd5a", + "at": 1794698764.7313511, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698764.732039, + "from_state": "running", + "note": "orchestration crashed: RuntimeError: frozen: injected orchestration failure", + "to_state": "blocked" + } + ] + } + } + }, + "lifecycle": { + "decisions": { + "global": "d62074be-bae5-4602-b56f-fb3d05a350d8", + "other-scope": "92c803c3-bbd9-434d-92f5-9b1992bde19b", + "replacement": "508e80a7-b951-453d-8810-9b3e202c3902", + "scoped": "06ef68ec-d3e5-42e9-a0d9-b410bb4f2010", + "superseded": "41153f56-9772-4a98-af8e-e07449e72429" + }, + "files": [ + "board.db", + "board.db.gc-lock" + ], + "frozen_at": 1794698758.615681, + "items": { + "agent-failed": "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9", + "annotated": "2bf84561-3100-43b4-b18b-6852c5e6fdf4", + "bare-done-refused": "50e5fd9f-b290-4669-8b50-adaddfb77666", + "evidence-done": "7d718991-93a0-4810-9974-4b03f991f49f", + "handed-off": "734659f1-2efe-4ea5-a1ee-61fc28833f96", + "human-blocked": "fb625361-3bb5-41f1-a3a2-35776a5d5ad2", + "human-cleared": "f305a5e1-4109-48ed-b7dd-45776391f3de", + "human-required": "9881d72d-cabb-42cb-bb76-4a80fb5215ff", + "imported-1": "db0ad772-7a10-587a-b48c-581e726e7b09", + "needs-done": "641a64eb-9490-47d8-83fc-976bf44cbfc2", + "needs-missing": "42cab35d-4f16-46f6-8b0f-73c2a0bfc454", + "needs-planned": "25bb4bc9-655b-4720-9ec5-4532b156662c", + "needs-two": "a741aa62-b45b-42cb-ad67-3aee1100c050", + "passed": "806b4c98-9f90-4b58-bf0d-74b3639c2661", + "pipeline-gate-failed": "f4187a31-3f44-420a-99cf-9e76a6889012", + "reclaimed": "634c75c2-f4ab-4094-a040-9b7ffb7c994d", + "route-gate-failed": "959998b8-6833-4792-9a93-acc84c8b4c4e", + "signed-off": "86165555-70ea-4b47-818f-f448c51c3f84", + "verified": "b2475413-f713-4306-bf87-c9400e1c3066" + }, + "release_read": { + "active_decisions": { + "*": [ + { + "created_at": 1794698756.241415, + "id": "d62074be-bae5-4602-b56f-fb3d05a350d8", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698756.838748, + "id": "06ef68ec-d3e5-42e9-a0d9-b410bb4f2010", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698758.017269, + "id": "508e80a7-b951-453d-8810-9b3e202c3902", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698758.615681, + "id": "92c803c3-bbd9-434d-92f5-9b1992bde19b", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "backend": [ + { + "created_at": 1794698756.241415, + "id": "d62074be-bae5-4602-b56f-fb3d05a350d8", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698756.838748, + "id": "06ef68ec-d3e5-42e9-a0d9-b410bb4f2010", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698758.017269, + "id": "508e80a7-b951-453d-8810-9b3e202c3902", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + } + ], + "docs": [ + { + "created_at": 1794698756.241415, + "id": "d62074be-bae5-4602-b56f-fb3d05a350d8", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698758.017269, + "id": "508e80a7-b951-453d-8810-9b3e202c3902", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698758.615681, + "id": "92c803c3-bbd9-434d-92f5-9b1992bde19b", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "nothing": [ + { + "created_at": 1794698756.241415, + "id": "d62074be-bae5-4602-b56f-fb3d05a350d8", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698758.017269, + "id": "508e80a7-b951-453d-8810-9b3e202c3902", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + } + ], + "review": [ + { + "created_at": 1794698756.241415, + "id": "d62074be-bae5-4602-b56f-fb3d05a350d8", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698758.017269, + "id": "508e80a7-b951-453d-8810-9b3e202c3902", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + } + ] + }, + "aggregates": { + "transition_counters": [], + "transition_rollups": [] + }, + "boundary": { + "item": "fb625361-3bb5-41f1-a3a2-35776a5d5ad2", + "stats": { + "after": { + "blocked_aged": [ + "959998b8-6833-4792-9a93-acc84c8b4c4e", + "f4187a31-3f44-420a-99cf-9e76a6889012", + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9", + "fb625361-3bb5-41f1-a3a2-35776a5d5ad2" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "734659f1-2efe-4ea5-a1ee-61fc28833f96" + ], + "false_done": [], + "human_required_aged": [ + "959998b8-6833-4792-9a93-acc84c8b4c4e", + "f4187a31-3f44-420a-99cf-9e76a6889012", + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9" + ], + "reclaimed_stale": 1, + "redispatched": [ + "634c75c2-f4ab-4094-a040-9b7ffb7c994d" + ], + "stall_seconds": 3600, + "total": 19 + }, + "at": { + "blocked_aged": [ + "959998b8-6833-4792-9a93-acc84c8b4c4e", + "f4187a31-3f44-420a-99cf-9e76a6889012", + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9", + "fb625361-3bb5-41f1-a3a2-35776a5d5ad2" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "734659f1-2efe-4ea5-a1ee-61fc28833f96" + ], + "false_done": [], + "human_required_aged": [ + "959998b8-6833-4792-9a93-acc84c8b4c4e", + "f4187a31-3f44-420a-99cf-9e76a6889012", + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9" + ], + "reclaimed_stale": 1, + "redispatched": [ + "634c75c2-f4ab-4094-a040-9b7ffb7c994d" + ], + "stall_seconds": 3600, + "total": 19 + }, + "before": { + "blocked_aged": [ + "959998b8-6833-4792-9a93-acc84c8b4c4e", + "f4187a31-3f44-420a-99cf-9e76a6889012", + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "734659f1-2efe-4ea5-a1ee-61fc28833f96" + ], + "false_done": [], + "human_required_aged": [ + "959998b8-6833-4792-9a93-acc84c8b4c4e", + "f4187a31-3f44-420a-99cf-9e76a6889012", + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9" + ], + "reclaimed_stale": 1, + "redispatched": [ + "634c75c2-f4ab-4094-a040-9b7ffb7c994d" + ], + "stall_seconds": 3600, + "total": 19 + } + }, + "times": { + "after": 1794702349.717631, + "at": 1794702349.7176309, + "before": 1794702349.7176306 + } + }, + "decision_rows": [ + { + "created_at": 1794698756.241415, + "id": "d62074be-bae5-4602-b56f-fb3d05a350d8", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698756.838748, + "id": "06ef68ec-d3e5-42e9-a0d9-b410bb4f2010", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698757.4252732, + "id": "41153f56-9772-4a98-af8e-e07449e72429", + "scope": "", + "superseded_at": 1794698758.017269, + "superseded_by": "508e80a7-b951-453d-8810-9b3e202c3902", + "text": "Tabs, not spaces." + }, + { + "created_at": 1794698758.017269, + "id": "508e80a7-b951-453d-8810-9b3e202c3902", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698758.615681, + "id": "92c803c3-bbd9-434d-92f5-9b1992bde19b", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "decisions_mapped": [ + { + "created_at": 1794698756.241415, + "id": "d62074be-bae5-4602-b56f-fb3d05a350d8", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Use uv for every Python command." + }, + { + "created_at": 1794698756.838748, + "id": "06ef68ec-d3e5-42e9-a0d9-b410bb4f2010", + "scope": "backend", + "superseded_at": null, + "superseded_by": null, + "text": "백엔드는 SQLite를 유지한다." + }, + { + "created_at": 1794698757.4252732, + "id": "41153f56-9772-4a98-af8e-e07449e72429", + "scope": "", + "superseded_at": 1794698758.017269, + "superseded_by": "508e80a7-b951-453d-8810-9b3e202c3902", + "text": "Tabs, not spaces." + }, + { + "created_at": 1794698758.017269, + "id": "508e80a7-b951-453d-8810-9b3e202c3902", + "scope": "", + "superseded_at": null, + "superseded_by": null, + "text": "Spaces, not tabs." + }, + { + "created_at": 1794698758.615681, + "id": "92c803c3-bbd9-434d-92f5-9b1992bde19b", + "scope": "docs", + "superseded_at": null, + "superseded_by": null, + "text": "Ship the docs with the code." + } + ], + "items": { + "25bb4bc9-655b-4720-9ec5-4532b156662c": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698753.872281, + "depends_on": [ + "2bf84561-3100-43b4-b18b-6852c5e6fdf4" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "25bb4bc9-655b-4720-9ec5-4532b156662c", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after a planned item", + "updated_at": 1794698753.872281 + }, + "2bf84561-3100-43b4-b18b-6852c5e6fdf4": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698750.316517, + "depends_on": [], + "evidence": [ + { + "at": 1794698750.9170392, + "by": "human", + "kind": "manual", + "passed": true, + "ref": "https://example.invalid/log/7" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "2bf84561-3100-43b4-b18b-6852c5e6fdf4", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "carries a reference", + "updated_at": 1794698750.917084 + }, + "42cab35d-4f16-46f6-8b0f-73c2a0bfc454": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698754.470057, + "depends_on": [ + "00000000-0000-4000-8000-000000000000" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "42cab35d-4f16-46f6-8b0f-73c2a0bfc454", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after an item that does not exist", + "updated_at": 1794698754.470057 + }, + "50e5fd9f-b290-4669-8b50-adaddfb77666": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698747.9179049, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "50e5fd9f-b290-4669-8b50-adaddfb77666", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "no verification yet", + "updated_at": 1794698747.9179049 + }, + "634c75c2-f4ab-4094-a040-9b7ffb7c994d": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698737.9575748, + "depends_on": [], + "evidence": [ + { + "at": 1794698742.361517, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "634c75c2-f4ab-4094-a040-9b7ffb7c994d", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add after a crash", + "updated_at": 1794698742.361517 + }, + "641a64eb-9490-47d8-83fc-976bf44cbfc2": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698753.2922099, + "depends_on": [ + "b2475413-f713-4306-bf87-c9400e1c3066" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "641a64eb-9490-47d8-83fc-976bf44cbfc2", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after the verified item", + "updated_at": 1794698753.2922099 + }, + "734659f1-2efe-4ea5-a1ee-61fc28833f96": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698730.772115, + "depends_on": [], + "evidence": [ + { + "at": 1794698732.008031, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "backend", + "handoff": "검토: 부호를 확인할 것", + "human_required": false, + "id": "734659f1-2efe-4ea5-a1ee-61fc28833f96", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "notes/plan.md", + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "덧셈을 고친다", + "updated_at": 1794698732.008031 + }, + "7d718991-93a0-4810-9974-4b03f991f49f": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698742.971026, + "depends_on": [], + "evidence": [ + { + "at": 1794698744.230538, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + }, + { + "at": 1794698744.849049, + "by": "human", + "kind": "manual", + "passed": true, + "ref": "CI ✓ run 42 — grün" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "7d718991-93a0-4810-9974-4b03f991f49f", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "done", + "task": "verified by CI", + "updated_at": 1794698744.849101 + }, + "806b4c98-9f90-4b58-bf0d-74b3639c2661": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698726.8066401, + "depends_on": [], + "evidence": [ + { + "at": 1794698728.3508952, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "806b4c98-9f90-4b58-bf0d-74b3639c2661", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "review", + "task": "fix add", + "updated_at": 1794698728.3508952 + }, + "86165555-70ea-4b47-818f-f448c51c3f84": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698745.4488971, + "depends_on": [], + "evidence": [ + { + "at": 1794698746.7029939, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + }, + { + "at": 1794698747.319458, + "by": "human", + "kind": "human", + "passed": true, + "ref": "sign-off" + } + ], + "goal": "", + "handoff": "", + "human_required": false, + "id": "86165555-70ea-4b47-818f-f448c51c3f84", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "done", + "task": "verified by a human", + "updated_at": 1794698747.3195179 + }, + "959998b8-6833-4792-9a93-acc84c8b4c4e": { + "blocked_reason": "All agents failed:\n [codex] quality gate failed: 0/1 checks passed; failed: python -c \"from calc import add; assert add(2, 3) == 5\"", + "claimed_at": null, + "created_at": 1794698732.623751, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "959998b8-6833-4792-9a93-acc84c8b4c4e", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": "none", + "state": "blocked", + "task": "fix add badly", + "updated_at": 1794698733.833706 + }, + "9881d72d-cabb-42cb-bb76-4a80fb5215ff": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698751.5166779, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "9881d72d-cabb-42cb-bb76-4a80fb5215ff", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "needs a person", + "updated_at": 1794698751.5166779 + }, + "a741aa62-b45b-42cb-ad67-3aee1100c050": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698755.069921, + "depends_on": [ + "b2475413-f713-4306-bf87-c9400e1c3066", + "2bf84561-3100-43b4-b18b-6852c5e6fdf4" + ], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "a741aa62-b45b-42cb-ad67-3aee1100c050", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "after two items", + "updated_at": 1794698755.069921 + }, + "b2475413-f713-4306-bf87-c9400e1c3066": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698728.955035, + "depends_on": [], + "evidence": [ + { + "at": 1794698730.181229, + "by": "codex", + "kind": "gate", + "passed": true, + "ref": "1/1 checks passed" + } + ], + "goal": "backend", + "handoff": "", + "human_required": false, + "id": "b2475413-f713-4306-bf87-c9400e1c3066", + "inputs": [], + "lease_run_id": null, + "outputs": [ + "calc.py" + ], + "owner_agent": "codex", + "state": "done", + "task": "fix add and finish", + "updated_at": 1794698730.181229 + }, + "db0ad772-7a10-587a-b48c-581e726e7b09": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698755.65433, + "depends_on": [], + "evidence": [ + { + "at": 1794698755.65433, + "by": "tracegraph", + "kind": "tracegraph", + "passed": false, + "ref": "sha256:2469307ff4b7bc62fd803a18822f3d26c6620bfaa06e0037db62082f6c9c528b" + } + ], + "goal": "review", + "handoff": "", + "human_required": true, + "id": "db0ad772-7a10-587a-b48c-581e726e7b09", + "inputs": [ + "source:tracegraph.review-candidates@v1", + "run_id:efd16fc1-758e-48fd-a765-bb3e27815952", + "pattern:tool-retry-failure@v2", + "tool_key:syncmill::board_stats", + "artifact_digest:sha256:2469307ff4b7bc62fd803a18822f3d26c6620bfaa06e0037db62082f6c9c528b" + ], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "review", + "task": "Review Tracegraph tool-retry-failure@v2 finding for syncmill::board_stats", + "updated_at": 1794698755.65433 + }, + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9": { + "blocked_reason": "All agents failed:\n [codex] codex (fake): refused", + "claimed_at": null, + "created_at": 1794698736.2164521, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": true, + "id": "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": "none", + "state": "blocked", + "task": "ask a refusing agent", + "updated_at": 1794698737.354914 + }, + "f305a5e1-4109-48ed-b7dd-45776391f3de": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698752.109395, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "f305a5e1-4109-48ed-b7dd-45776391f3de", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "needed a person", + "updated_at": 1794698752.705991 + }, + "f4187a31-3f44-420a-99cf-9e76a6889012": { + "blocked_reason": "quality gate failed: 0/1 checks passed; failed: python -c \"from calc import add; assert add(2, 3) == 5\"", + "claimed_at": null, + "created_at": 1794698734.4337862, + "depends_on": [], + "evidence": [ + { + "at": 1794698735.610032, + "by": "codex", + "kind": "gate", + "passed": false, + "ref": "0/1 checks passed; failed: python -c \"from calc import add; assert add(2, 3) == 5\"" + } + ], + "goal": "", + "handoff": "", + "human_required": true, + "id": "f4187a31-3f44-420a-99cf-9e76a6889012", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": "codex", + "state": "blocked", + "task": "fix add badly in a pipeline", + "updated_at": 1794698735.610032 + }, + "fb625361-3bb5-41f1-a3a2-35776a5d5ad2": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698749.121001, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "fb625361-3bb5-41f1-a3a2-35776a5d5ad2", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "blocked", + "task": "waits on ops", + "updated_at": 1794698749.7176309 + } + }, + "order": [ + "806b4c98-9f90-4b58-bf0d-74b3639c2661", + "b2475413-f713-4306-bf87-c9400e1c3066", + "734659f1-2efe-4ea5-a1ee-61fc28833f96", + "959998b8-6833-4792-9a93-acc84c8b4c4e", + "f4187a31-3f44-420a-99cf-9e76a6889012", + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9", + "634c75c2-f4ab-4094-a040-9b7ffb7c994d", + "7d718991-93a0-4810-9974-4b03f991f49f", + "86165555-70ea-4b47-818f-f448c51c3f84", + "50e5fd9f-b290-4669-8b50-adaddfb77666", + "fb625361-3bb5-41f1-a3a2-35776a5d5ad2", + "2bf84561-3100-43b4-b18b-6852c5e6fdf4", + "9881d72d-cabb-42cb-bb76-4a80fb5215ff", + "f305a5e1-4109-48ed-b7dd-45776391f3de", + "641a64eb-9490-47d8-83fc-976bf44cbfc2", + "25bb4bc9-655b-4720-9ec5-4532b156662c", + "42cab35d-4f16-46f6-8b0f-73c2a0bfc454", + "a741aa62-b45b-42cb-ad67-3aee1100c050", + "db0ad772-7a10-587a-b48c-581e726e7b09" + ], + "stats": { + "aged": { + "blocked_aged": [ + "959998b8-6833-4792-9a93-acc84c8b4c4e", + "f4187a31-3f44-420a-99cf-9e76a6889012", + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9", + "fb625361-3bb5-41f1-a3a2-35776a5d5ad2" + ], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [ + "734659f1-2efe-4ea5-a1ee-61fc28833f96" + ], + "false_done": [], + "human_required_aged": [ + "959998b8-6833-4792-9a93-acc84c8b4c4e", + "f4187a31-3f44-420a-99cf-9e76a6889012", + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9", + "9881d72d-cabb-42cb-bb76-4a80fb5215ff", + "db0ad772-7a10-587a-b48c-581e726e7b09" + ], + "reclaimed_stale": 1, + "redispatched": [ + "634c75c2-f4ab-4094-a040-9b7ffb7c994d" + ], + "stall_seconds": 3600, + "total": 19 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "blocked": 4, + "done": 3, + "planned": 8, + "review": 4 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 1, + "redispatched": [ + "634c75c2-f4ab-4094-a040-9b7ffb7c994d" + ], + "stall_seconds": 3600, + "total": 19 + } + }, + "transitions": { + "25bb4bc9-655b-4720-9ec5-4532b156662c": [ + { + "actor": "human", + "at": 1794698753.872281, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "2bf84561-3100-43b4-b18b-6852c5e6fdf4": [ + { + "actor": "human", + "at": 1794698750.316517, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "human", + "at": 1794698750.917084, + "from_state": "planned", + "note": "annotated", + "to_state": "planned" + } + ], + "42cab35d-4f16-46f6-8b0f-73c2a0bfc454": [ + { + "actor": "human", + "at": 1794698754.470057, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "50e5fd9f-b290-4669-8b50-adaddfb77666": [ + { + "actor": "human", + "at": 1794698747.9179049, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "634c75c2-f4ab-4094-a040-9b7ffb7c994d": [ + { + "actor": "human", + "at": 1794698737.9575748, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "4d739a5c-490b-47ee-9b92-7595217ac71f", + "at": 1794698738.6025841, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "system", + "at": 1794698741.758962, + "from_state": "running", + "note": "stale-claim recovery", + "to_state": "planned" + }, + { + "actor": "f932738a-73d7-481a-9e78-eee1d7f1ba0b", + "at": 1794698741.759357, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698742.361517, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "641a64eb-9490-47d8-83fc-976bf44cbfc2": [ + { + "actor": "human", + "at": 1794698753.2922099, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "734659f1-2efe-4ea5-a1ee-61fc28833f96": [ + { + "actor": "human", + "at": 1794698730.772115, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "a52224e5-c34e-4b0e-846e-dbd34035fdee", + "at": 1794698731.4154382, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698732.008031, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "7d718991-93a0-4810-9974-4b03f991f49f": [ + { + "actor": "human", + "at": 1794698742.971026, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "e2339bf3-419c-4014-a74c-3e2b3e3770b9", + "at": 1794698743.612858, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698744.230538, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + }, + { + "actor": "human", + "at": 1794698744.849101, + "from_state": "review", + "note": "", + "to_state": "done" + } + ], + "806b4c98-9f90-4b58-bf0d-74b3639c2661": [ + { + "actor": "human", + "at": 1794698726.8066401, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "040d295d-c8bf-4bfa-ac1f-cdfc1c18aa9f", + "at": 1794698727.45507, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698728.3508952, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + } + ], + "86165555-70ea-4b47-818f-f448c51c3f84": [ + { + "actor": "human", + "at": 1794698745.4488971, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "990e4d11-f723-477a-a58c-21b3b4dd378e", + "at": 1794698746.101783, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698746.7029939, + "from_state": "running", + "note": "agent completed; awaiting review", + "to_state": "review" + }, + { + "actor": "human", + "at": 1794698747.3195179, + "from_state": "review", + "note": "", + "to_state": "done" + } + ], + "959998b8-6833-4792-9a93-acc84c8b4c4e": [ + { + "actor": "human", + "at": 1794698732.623751, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "eff407ff-7ed0-4096-8912-b68c456aae5e", + "at": 1794698733.26769, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "none", + "at": 1794698733.833706, + "from_state": "running", + "note": "run failed", + "to_state": "blocked" + } + ], + "9881d72d-cabb-42cb-bb76-4a80fb5215ff": [ + { + "actor": "human", + "at": 1794698751.5166779, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "a741aa62-b45b-42cb-ad67-3aee1100c050": [ + { + "actor": "human", + "at": 1794698755.069921, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ], + "b2475413-f713-4306-bf87-c9400e1c3066": [ + { + "actor": "human", + "at": 1794698728.955035, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "8f77b081-6f04-4b50-bce3-df2d7541517a", + "at": 1794698729.589066, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698730.181229, + "from_state": "running", + "note": "agent completed; verified", + "to_state": "done" + } + ], + "db0ad772-7a10-587a-b48c-581e726e7b09": [ + { + "actor": "tracegraph-import", + "at": 1794698755.65433, + "from_state": null, + "note": "imported review candidate", + "to_state": "review" + } + ], + "dcd8bc21-2b62-4271-9ed5-ee9d34b5f4e9": [ + { + "actor": "human", + "at": 1794698736.2164521, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "bfe2d6e0-6534-49b9-834f-4fa2dab76a48", + "at": 1794698736.8496, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "none", + "at": 1794698737.354914, + "from_state": "running", + "note": "run failed", + "to_state": "blocked" + } + ], + "f305a5e1-4109-48ed-b7dd-45776391f3de": [ + { + "actor": "human", + "at": 1794698752.109395, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "human", + "at": 1794698752.705991, + "from_state": "planned", + "note": "annotated", + "to_state": "planned" + } + ], + "f4187a31-3f44-420a-99cf-9e76a6889012": [ + { + "actor": "human", + "at": 1794698734.4337862, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "3388503a-0ad2-4440-aded-469f06ee4c07", + "at": 1794698735.063678, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + }, + { + "actor": "codex", + "at": 1794698735.610032, + "from_state": "running", + "note": "run failed", + "to_state": "blocked" + } + ], + "fb625361-3bb5-41f1-a3a2-35776a5d5ad2": [ + { + "actor": "human", + "at": 1794698749.121001, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "human", + "at": 1794698749.7176309, + "from_state": "planned", + "note": "waiting on ops", + "to_state": "blocked" + } + ] + } + } + }, + "running": { + "decisions": {}, + "files": [ + "board.db", + "board.db-shm", + "board.db-wal" + ], + "frozen_at": 1794698760.70875, + "items": { + "killed": "812d1dc4-9188-4fc5-bd8e-b938a1b6cdc0", + "waiting": "83927daf-eec8-4b31-a557-92d4756ead71" + }, + "release_read": { + "active_decisions": { + "*": [], + "backend": [] + }, + "aggregates": { + "transition_counters": [], + "transition_rollups": [] + }, + "decision_rows": [], + "decisions_mapped": [], + "items": { + "812d1dc4-9188-4fc5-bd8e-b938a1b6cdc0": { + "blocked_reason": "", + "claimed_at": 1794698760.70875, + "created_at": 1794698760.043403, + "depends_on": [], + "evidence": [], + "goal": "backend", + "handoff": "", + "human_required": false, + "id": "812d1dc4-9188-4fc5-bd8e-b938a1b6cdc0", + "inputs": [], + "lease_run_id": "16b27654-3d6c-44f7-974d-7943173efa02", + "outputs": [], + "owner_agent": null, + "state": "running", + "task": "killed mid-run", + "updated_at": 1794698760.70875 + }, + "83927daf-eec8-4b31-a557-92d4756ead71": { + "blocked_reason": "", + "claimed_at": null, + "created_at": 1794698759.424586, + "depends_on": [], + "evidence": [], + "goal": "", + "handoff": "", + "human_required": false, + "id": "83927daf-eec8-4b31-a557-92d4756ead71", + "inputs": [], + "lease_run_id": null, + "outputs": [], + "owner_agent": null, + "state": "planned", + "task": "still planned", + "updated_at": 1794698759.424586 + } + }, + "order": [ + "83927daf-eec8-4b31-a557-92d4756ead71", + "812d1dc4-9188-4fc5-bd8e-b938a1b6cdc0" + ], + "stats": { + "aged": { + "blocked_aged": [], + "by_state": { + "planned": 1, + "running": 1 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + }, + "fresh": { + "blocked_aged": [], + "by_state": { + "planned": 1, + "running": 1 + }, + "dropped_handoffs": [], + "false_done": [], + "human_required_aged": [], + "reclaimed_stale": 0, + "redispatched": [], + "stall_seconds": 3600, + "total": 2 + } + }, + "transitions": { + "812d1dc4-9188-4fc5-bd8e-b938a1b6cdc0": [ + { + "actor": "human", + "at": 1794698760.043403, + "from_state": null, + "note": "created", + "to_state": "planned" + }, + { + "actor": "16b27654-3d6c-44f7-974d-7943173efa02", + "at": 1794698760.70875, + "from_state": "planned", + "note": "claimed", + "to_state": "running" + } + ], + "83927daf-eec8-4b31-a557-92d4756ead71": [ + { + "actor": "human", + "at": 1794698759.424586, + "from_state": null, + "note": "created", + "to_state": "planned" + } + ] + } + } + } + }, + "stall_seconds": 3600, + "tracegraph_report": "tests/fixtures/tracegraph/v1.json" +} diff --git a/tests/fixtures/persisted/board/v0.3.0/compacted/board.db b/tests/fixtures/persisted/board/v0.3.0/compacted/board.db new file mode 100644 index 0000000..34f5f3a Binary files /dev/null and b/tests/fixtures/persisted/board/v0.3.0/compacted/board.db differ diff --git a/tests/fixtures/persisted/board/v0.3.0/compacted/board.db.gc-lock b/tests/fixtures/persisted/board/v0.3.0/compacted/board.db.gc-lock new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/board/v0.3.0/crash-blocked/board.db b/tests/fixtures/persisted/board/v0.3.0/crash-blocked/board.db new file mode 100644 index 0000000..0df795b Binary files /dev/null and b/tests/fixtures/persisted/board/v0.3.0/crash-blocked/board.db differ diff --git a/tests/fixtures/persisted/board/v0.3.0/lifecycle/board.db b/tests/fixtures/persisted/board/v0.3.0/lifecycle/board.db new file mode 100644 index 0000000..a0bd73a Binary files /dev/null and b/tests/fixtures/persisted/board/v0.3.0/lifecycle/board.db differ diff --git a/tests/fixtures/persisted/board/v0.3.0/lifecycle/board.db.gc-lock b/tests/fixtures/persisted/board/v0.3.0/lifecycle/board.db.gc-lock new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/board/v0.3.0/running/board.db b/tests/fixtures/persisted/board/v0.3.0/running/board.db new file mode 100644 index 0000000..c5a23d9 Binary files /dev/null and b/tests/fixtures/persisted/board/v0.3.0/running/board.db differ diff --git a/tests/fixtures/persisted/board/v0.3.0/running/board.db-shm b/tests/fixtures/persisted/board/v0.3.0/running/board.db-shm new file mode 100644 index 0000000..dfbf003 Binary files /dev/null and b/tests/fixtures/persisted/board/v0.3.0/running/board.db-shm differ diff --git a/tests/fixtures/persisted/board/v0.3.0/running/board.db-wal b/tests/fixtures/persisted/board/v0.3.0/running/board.db-wal new file mode 100644 index 0000000..6c988d7 Binary files /dev/null and b/tests/fixtures/persisted/board/v0.3.0/running/board.db-wal differ diff --git a/tests/test_frozen_board.py b/tests/test_frozen_board.py new file mode 100644 index 0000000..c460376 --- /dev/null +++ b/tests/test_frozen_board.py @@ -0,0 +1,786 @@ +"""Released work-boards, read by the current readers (#271, persisted contracts D). + +The databases under ``fixtures/persisted/board///`` were +written by that release's own ``syncmill board`` commands (see ``freeze.py`` +there) and are never regenerated by the current writer. ``bindings.json`` holds, +per scenario, what the RELEASE's own interpreter read from a scratch copy of +each database: every item through ``Board.get``, its transitions, the active +decisions, every decision row through ``_row_to_decision``, and ``stats`` at +fixed clocks. Those reads are the interpretation HEAD must keep; the raw cells +are checked beside them, so a reader and a writer drifting together still fail. + +The board stores nothing bound to the generating machine (freeze.py refuses a +cell holding its paths or hostname), so nothing is rebound. Every test works on +a copy; HEAD opening a released database adds columns and tables to it. +""" + +from __future__ import annotations + +import dataclasses +import enum +import json +import os +import shutil +import sqlite3 +import stat +from pathlib import Path + +import pytest +from click.testing import CliRunner + +from syncmill import cli as cli_module +from syncmill.board import ( + Board, + BoardStats, + Decision, + Evidence, + WorkItem, + WorkState, + _row_to_decision, + lesson_source, + render_board, + render_board_stats, + render_decisions, + render_item, +) +from syncmill.cli import cli + +FROZEN = Path(__file__).parent / "fixtures" / "persisted" / "board" +RELEASES = sorted(p.parent.name for p in FROZEN.glob("v*/bindings.json")) +REPORT = Path(__file__).parent / "fixtures" / "tracegraph" / "v1.json" + +#: scenario per release; v0.1.2 has no `board compact`. +SCENARIOS = { + "v0.1.2": ["crash-blocked", "lifecycle", "running"], + "v0.2.0": ["compacted", "crash-blocked", "lifecycle", "running"], + "v0.3.0": ["compacted", "crash-blocked", "lifecycle", "running"], +} +CASES = [(r, s) for r in RELEASES for s in SCENARIOS.get(r, [])] + +_WORK_ITEMS = [ + "id", "goal", "task", "state", "owner_agent", "inputs", "outputs", "evidence", + "handoff", "human_required", "blocked_reason", "depends_on", "lease_run_id", + "claimed_at", "created_at", "updated_at", +] +_TRANSITIONS = ["id", "item_id", "from_state", "to_state", "actor", "note", "at"] +_DECISIONS = ["id", "text", "scope", "created_at", "superseded_by", "superseded_at"] +_LEDGER_V1 = ["run_id", "item_id", "claimed_at", "purged_at"] +_LEDGER_V2 = [*_LEDGER_V1, "reclaimed_at", "failed_attempts", "next_attempt_at"] +_ROLLUPS = {"transition_rollups": ["item_id", "claim_count"], + "transition_counters": ["name", "value"]} +#: The schema each release wrote, read from its database. +TABLES = { + "v0.1.2": {"work_items": _WORK_ITEMS, "transitions": _TRANSITIONS, + "decisions": _DECISIONS, "board_run_namespaces": _LEDGER_V1}, + "v0.2.0": {"work_items": _WORK_ITEMS, "transitions": _TRANSITIONS, + "decisions": _DECISIONS, "board_run_namespaces": _LEDGER_V2, **_ROLLUPS}, +} +TABLES["v0.3.0"] = TABLES["v0.2.0"] +_INDEXES_V1 = [ + "idx_board_run_namespaces_purged", "idx_decisions_active", "idx_decisions_scope", + "idx_transitions_item", "idx_work_items_goal", "idx_work_items_lease", + "idx_work_items_owner", "idx_work_items_state", +] +_INDEXES_V2 = sorted([*_INDEXES_V1, "idx_transitions_reclaim", "idx_transitions_redispatch", + "idx_work_items_created"]) +INDEXES = {"v0.1.2": _INDEXES_V1, "v0.2.0": _INDEXES_V2, + "v0.3.0": sorted([*_INDEXES_V2, "idx_transitions_at"])} +#: What HEAD's first open adds to each release's schema (all nullable or new). +ADDED_COLUMNS = { + "v0.1.2": {("board_run_namespaces", c) for c in _LEDGER_V2[4:]} + | {("decisions", c) for c in ("project_id", "provenance_json", "source_key")}, + "v0.2.0": {("decisions", c) for c in ("project_id", "provenance_json", "source_key")}, +} +ADDED_COLUMNS["v0.3.0"] = ADDED_COLUMNS["v0.2.0"] +ADDED_TABLES = {"v0.1.2": set(_ROLLUPS), "v0.2.0": set(), "v0.3.0": set()} + + +def _bindings(release: str) -> dict: + return json.loads((FROZEN / release / "bindings.json").read_text(encoding="utf-8")) + + +def _cells(db: Path) -> dict[tuple[str, str], list]: + conn = sqlite3.connect(db) + try: + tables = [r[0] for r in conn.execute( + "SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%'" + )] + cells: dict[tuple[str, str], list] = {} + for table in tables: + columns = [r[1] for r in conn.execute(f"PRAGMA table_info({table})")] + rows = conn.execute(f"SELECT * FROM {table} ORDER BY rowid").fetchall() + for index, column in enumerate(columns): + cells[(table, column)] = [row[index] for row in rows] + return cells + finally: + conn.close() + + +def _schema(db: Path) -> tuple[dict[str, list[str]], list[str]]: + conn = sqlite3.connect(db) + try: + tables = { + name: [r[1] for r in conn.execute(f"PRAGMA table_info({name})")] + for (name,) in conn.execute( + "SELECT name FROM sqlite_master WHERE type = 'table' " + "AND name NOT LIKE 'sqlite_%' ORDER BY name" + ).fetchall() + } + indexes = sorted(n for (n,) in conn.execute( + "SELECT name FROM sqlite_master WHERE type = 'index' AND name NOT LIKE 'sqlite_%'" + )) + return tables, indexes + finally: + conn.close() + + +def plain(value): + """A dataclass as the JSON freeze.py stored the release's reads in.""" + if isinstance(value, enum.Enum): + return value.value + if dataclasses.is_dataclass(value): + return {f.name: plain(getattr(value, f.name)) for f in dataclasses.fields(value)} + if isinstance(value, (list, tuple)): + return [plain(v) for v in value] + if isinstance(value, dict): + return {k: plain(v) for k, v in value.items()} + return value + + +def _item(read: dict) -> WorkItem: + return WorkItem(**{ + **read, + "state": WorkState(read["state"]), + "evidence": [Evidence(**e) for e in read["evidence"]], + }) + + +#: Fields HEAD's Decision has and no release stored: a released decision is +#: unbound and was never promoted. +_UNBOUND = {"project_id": None, "provenance": None} + + +def _decision(read: dict) -> dict: + return {**read, **_UNBOUND} + + +class Frozen: + """One release scenario copied into ``tmp_path`` with the board enabled on it.""" + + def __init__(self, release: str, scenario: str, tmp_path: Path, monkeypatch): + self.release = release + self.scenario = scenario + self.bindings = _bindings(release) + self.facts = self.bindings["scenarios"][scenario] + self.read = self.facts["release_read"] + self.items = self.facts["items"] + self.decisions = self.facts["decisions"] + self.frozen_at = self.facts["frozen_at"] + self.stall = self.bindings["stall_seconds"] + self.source = FROZEN / release / scenario + self.dir = tmp_path / "board" / scenario + shutil.copytree(self.source, self.dir) + self.db = self.dir / "board.db" + self._monkeypatch = monkeypatch + monkeypatch.setenv("SYNCMILL_BOARD__ENABLED", "true") + monkeypatch.setenv("SYNCMILL_BOARD__DB_PATH", str(self.db)) + monkeypatch.setenv("SYNCMILL_BOARD__STALL_SECONDS", str(self.stall)) + self.clock(self.frozen_at) + + def clock(self, now: float) -> None: + """Fix the clock of every board the CLI opens, and of the evidence it stamps.""" + def build_board(config): + return Board(config.db_path, now=lambda: now, + lease_timeout_seconds=config.lease_timeout_seconds, + stall_seconds=config.stall_seconds) + self._monkeypatch.setattr(cli_module, "build_board", build_board) + self._monkeypatch.setattr(cli_module.time, "time", lambda: now) + + def board(self) -> Board: + return Board(str(self.db), now=lambda: self.frozen_at, stall_seconds=self.stall) + + def cli(self, *argv: str): + return CliRunner().invoke(cli, list(argv)) + + def rows(self, sql: str, *params) -> list[sqlite3.Row]: + conn = sqlite3.connect(self.db) + conn.row_factory = sqlite3.Row + try: + return conn.execute(sql, params).fetchall() + finally: + conn.close() + + def expected_items(self) -> list[WorkItem]: + return [_item(self.read["items"][i]) for i in self.read["order"]] + + +@pytest.fixture +def frozen(request, tmp_path, monkeypatch): + def install(release: str, scenario: str) -> Frozen: + return Frozen(release, scenario, tmp_path, monkeypatch) + return install + + +def _last_line(result) -> str: + return result.output.rstrip("\n").splitlines()[-1] + + +# ── inventory ───────────────────────────────────────────────────────────── + + +def test_every_release_freezes_every_scenario(tmp_path): + # A release directory that lost a scenario, or a scenario that lost the + # shape it was frozen for, would silently shrink coverage. + assert RELEASES == ["v0.1.2", "v0.2.0", "v0.3.0"] + for release in RELEASES: + bindings = _bindings(release) + assert bindings["release"] == release[1:] + assert sorted(bindings["scenarios"]) == SCENARIOS[release] + for scenario, facts in bindings["scenarios"].items(): + source = FROZEN / release / scenario + assert sorted(p.name for p in source.iterdir()) == facts["files"] + assert ("board.db-wal" in facts["files"]) == (scenario == "running"), scenario + # A normal connection on a copy WITH the sidecars: an immutable + # read of the original would not see rows still in the WAL. + scratch = tmp_path / release / scenario + shutil.copytree(source, scratch) + tables, indexes = _schema(scratch / "board.db") + assert tables == TABLES[release], (release, scenario) + assert indexes == INDEXES[release], (release, scenario) + conn = sqlite3.connect(scratch / "board.db") + conn.row_factory = sqlite3.Row + ids = {r["id"] for r in conn.execute("SELECT id FROM work_items")} + assert ids == set(facts["release_read"]["items"]) == set(facts["items"].values()) + if scenario == "running": + # The killed claim's lease and its ledger row, written in one + # transaction and never purged (the run never finished). + item = conn.execute("SELECT * FROM work_items WHERE id = ?", + (facts["items"]["killed"],)).fetchone() + ledger = conn.execute("SELECT * FROM board_run_namespaces WHERE run_id = ?", + (item["lease_run_id"],)).fetchall() + assert item["state"] == "running" and item["lease_run_id"] + assert [(r["item_id"], r["claimed_at"], r["purged_at"]) for r in ledger] == [ + (item["id"], item["claimed_at"], None)] + conn.close() + + +@pytest.mark.parametrize("release", RELEASES) +def test_released_lifecycle_holds_every_shape_the_tests_read(release): + read = _bindings(release)["scenarios"]["lifecycle"] + items = {role: read["release_read"]["items"][i] for role, i in read["items"].items()} + shapes = {role: (it["state"], [(e["kind"], e["passed"]) for e in it["evidence"]]) + for role, it in items.items()} + assert shapes["passed"] == ("review", [("gate", True)]) + assert shapes["verified"] == ("done", [("gate", True)]) + assert shapes["pipeline-gate-failed"] == ("blocked", [("gate", False)]) + assert shapes["route-gate-failed"] == ("blocked", []) + assert shapes["evidence-done"] == ("done", [("gate", True), ("manual", True)]) + assert shapes["signed-off"] == ("done", [("gate", True), ("human", True)]) + assert shapes["imported-1"] == ("review", [("tracegraph", False)]) + assert items["handed-off"]["handoff"] and items["handed-off"]["outputs"] + assert items["needs-missing"]["depends_on"] == [_bindings(release)["missing_dependency"]] + assert len(items["imported-1"]["inputs"]) == 5 + + +# ── HEAD's first open of a released database ────────────────────────────── + + +@pytest.mark.parametrize(("release", "scenario"), CASES) +def test_head_open_adds_its_schema_without_touching_a_released_cell( + release, scenario, frozen, tmp_path +): + f = frozen(release, scenario) + # The baseline comes from a second copy: reading it replays and + # checkpoints a killed run's WAL, and HEAD must open the original shape. + pristine = tmp_path / "pristine" + shutil.copytree(f.source, pristine) + before = _cells(pristine / "board.db") + + f.board().close() + after = _cells(f.db) + + for key, values in before.items(): + assert after[key] == values, key + added = set(after) - set(before) + tables = {table for table, _ in added} + assert {k for k in added if k[0] not in ADDED_TABLES[release]} == ADDED_COLUMNS[release] + assert tables - {t for t, _ in ADDED_COLUMNS[release]} == ADDED_TABLES[release] + for key in added: + assert all(v is None for v in after[key]), key # nullable columns, empty tables + for name in ("board.db", "board.db-wal", "board.db-shm"): + path = f.dir / name + if path.exists(): + assert stat.S_IMODE(os.stat(path).st_mode) == 0o600, name + + # A second open changes nothing: the migration and the ledger backfill + # leave a migrated release alone (every release claimed and wrote its + # ledger row in one transaction, so there is nothing to backfill). + f.board().close() + assert _cells(f.db) == after + + +# ── the item reader ─────────────────────────────────────────────────────── + + +@pytest.mark.parametrize(("release", "scenario"), CASES) +def test_get_reads_every_released_item_as_the_release_did(release, scenario, frozen): + f = frozen(release, scenario) + board = f.board() + try: + expected = [f.read["items"][i] for i in f.read["order"]] + assert plain(board.list()) == expected + for state in WorkState: + assert plain(board.list(state=state.value)) == \ + [i for i in expected if i["state"] == state.value], state + for goal in sorted({i["goal"] for i in expected}): + assert plain(board.list(goal=goal)) == [i for i in expected if i["goal"] == goal] + for item_id, expected in f.read["items"].items(): + got = board.get(item_id) + assert set(plain(got)) == set(expected), "WorkItem fields changed" + assert plain(got) == expected, item_id + assert board.transitions(item_id) == f.read["transitions"][item_id], item_id + finally: + board.close() + # The raw cells too: the release read them the same way, but a stored + # value has one meaning of its own (a scalar is passed through, a list + # column is JSON, evidence is a JSON list of Evidence fields). + board = f.board() + try: + for row in f.rows("SELECT * FROM work_items"): + got = board.get(row["id"]) + for column in ("goal", "task", "owner_agent", "handoff", "blocked_reason", + "lease_run_id", "claimed_at", "created_at", "updated_at"): + assert getattr(got, column) == row[column], (row["id"], column) + assert got.state.value == row["state"] + assert got.human_required is bool(row["human_required"]) + for column in ("inputs", "outputs", "depends_on"): + assert getattr(got, column) == json.loads(row[column]), (row["id"], column) + assert [dataclasses.asdict(e) for e in got.evidence] == json.loads(row["evidence"]) + finally: + board.close() + + +@pytest.mark.parametrize(("release", "scenario"), CASES) +def test_board_list_and_show_render_the_released_items(release, scenario, frozen): + f = frozen(release, scenario) + items = f.expected_items() + shown = f.cli("board", "list") + assert shown.exit_code == 0, shown.output + assert shown.output == render_board(items) + "\n" + for state in WorkState: + shown = f.cli("board", "list", "--state", state.value) + assert shown.exit_code == 0, shown.output + assert shown.output == render_board([i for i in items if i.state == state]) + "\n" + for goal in sorted({i.goal for i in items}): + shown = f.cli("board", "list", "--goal", goal) + assert shown.output == render_board([i for i in items if i.goal == goal]) + "\n" + for item in items: + shown = f.cli("board", "show", item.id) + assert shown.exit_code == 0, shown.output + assert shown.output == render_item(item, f.read["transitions"][item.id]) + "\n" + + +@pytest.mark.parametrize(("release", "scenario"), CASES) +def test_board_list_prints_one_row_per_released_item(release, scenario, frozen): + # Independent of render_board: one row per item, in the release's order, + # each naming its id, state, goal and flags. + f = frozen(release, scenario) + rows = f.cli("board", "list").output.splitlines() + assert len(rows) == len(f.read["order"]) + for row, item_id in zip(rows, f.read["order"]): + item = f.read["items"][item_id] + assert row.startswith(f" {item_id} {item['state']:<8} "), row + assert (f"[{item['goal']}] " in row) is bool(item["goal"]), row + assert ("human-required" in row) is item["human_required"], row + assert (f"deps={len(item['depends_on'])}" in row) is bool(item["depends_on"]), row + task = item["task"] if len(item["task"]) <= 60 else item["task"][:57] + "..." + assert f"{item['state']:<8} {'[' + item['goal'] + '] ' if item['goal'] else ''}{task}" \ + in row, row + + +def _show_lines(item: dict, transitions: list[dict]) -> list[str]: + """Every line `board show` must print for a released item, written out from + the release's read and the documented field labels, not from render_item.""" + lines = [ + f"id: {item['id']}", + f"state: {item['state']}", + f"goal: {item['goal'] or '-'}", + f"task: {item['task']}", + f"owner: {item['owner_agent'] or '-'}", + ] + for label, key in (("depends: ", "depends_on"), ("inputs: ", "inputs"), + ("outputs: ", "outputs")): + if item[key]: + lines.append(label + ", ".join(item[key])) + if item["handoff"]: + lines.append(f"handoff: {item['handoff']}") + if item["human_required"]: + lines.append("human: REQUIRED") + if item["blocked_reason"]: + lines.append(f"blocked: {item['blocked_reason']}") + if item["evidence"]: + lines.append("evidence:") + for e in item["evidence"]: + by = f" (by {e['by']})" if e["by"] else "" + lines.append(f" - [{e['kind']}/{'pass' if e['passed'] else 'fail'}] {e['ref']}{by}") + if transitions: + lines.append("history:") + for t in transitions: + note = f" — {t['note']}" if t["note"] else "" + lines.append(f" {t['from_state'] or '·'} → {t['to_state']} " + f"[{t['actor'] or '?'}]{note}") + return lines + + +def _printable(text: str) -> str: + # The one escape the released rows need: a multi-line failure reason is one + # display line (printable_name shows LF as the four characters \x0a). + return text.replace("\n", "\\x0a") + + +@pytest.mark.parametrize(("release", "scenario"), CASES) +def test_board_show_prints_every_field_of_every_released_item(release, scenario, frozen): + f = frozen(release, scenario) + for item_id in f.read["order"]: + item = f.read["items"][item_id] + transitions = f.read["transitions"][item_id] + shown = f.cli("board", "show", item_id) + assert shown.exit_code == 0, shown.output + expected = [_printable(line) for line in _show_lines(item, transitions)] + assert shown.output.splitlines() == expected, item_id + + +@pytest.mark.parametrize("release", RELEASES) +def test_board_show_prints_each_released_shape(release, frozen): + # Literal lines, independent of render_item: a reader and a renderer that + # drifted together would still pass the comparison above. + f = frozen(release, "lifecycle") + + def show(role: str) -> list[str]: + shown = f.cli("board", "show", f.items[role]) + assert shown.exit_code == 0, shown.output + return shown.output.splitlines() + + assert " - [gate/pass] 1/1 checks passed (by codex)" in show("passed") + gate = (' - [gate/fail] 0/1 checks passed; failed: ' + 'python -c "from calc import add; assert add(2, 3) == 5" (by codex)') + lines = show("pipeline-gate-failed") + assert gate in lines and "human: REQUIRED" in lines + lines = show("evidence-done") + assert "state: done" in lines + assert " - [manual/pass] CI ✓ run 42 — grün (by human)" in lines + assert " - [human/pass] sign-off (by human)" in show("signed-off") + lines = show("handed-off") + assert "goal: backend" in lines and "task: 덧셈을 고친다" in lines + assert "handoff: 검토: 부호를 확인할 것" in lines + assert "outputs: notes/plan.md, calc.py" in lines # the block's, then the changed files + assert f"depends: {_bindings(release)['missing_dependency']}" in show("needs-missing") + assert (f"depends: {f.items['verified']}, {f.items['annotated']}" + in show("needs-two")) + lines = show("imported-1") + imported = f.read["items"][f.items["imported-1"]] + assert f"inputs: {', '.join(imported['inputs'])}" in lines + assert [i.split(":", 1)[0] for i in imported["inputs"]] == [ + "source", "run_id", "pattern", "tool_key", "artifact_digest"] + assert imported["inputs"][0] == "source:tracegraph.review-candidates@v1" + assert "history:" in lines and " · → planned [human] — created" in show("passed") + assert " running → planned [system] — stale-claim recovery" in show("reclaimed") + + +@pytest.mark.parametrize("release", RELEASES) +def test_board_show_reads_a_released_crash(release, frozen): + f = frozen(release, "crash-blocked") + crashed = "orchestration crashed: RuntimeError: frozen: injected orchestration failure" + cancelled = "orchestration cancelled by operator (SIGINT)" + for role, note in (("crashed", crashed), ("interrupted", cancelled)): + lines = f.cli("board", "show", f.items[role]).output.splitlines() + assert "state: blocked" in lines and "human: REQUIRED" in lines + assert f" running → blocked [system] — {note}" in lines + # v0.1.2 blocked a crashed item without recording why on the item. + assert (f"blocked: {note}" in lines) is (release != "v0.1.2"), role + + +# ── decisions ───────────────────────────────────────────────────────────── + + +@pytest.mark.parametrize("release", RELEASES) +def test_decisions_read_as_the_release_did_and_stay_unbound(release, frozen): + f = frozen(release, "lifecycle") + board = f.board() + try: + for goal, expected in f.read["active_decisions"].items(): + got = board.active_decisions() if goal == "*" else board.active_decisions(goal=goal) + assert plain(got) == [_decision(d) for d in expected], goal + mapped = [plain(_row_to_decision(r)) + for r in f.rows("SELECT * FROM decisions ORDER BY rowid")] + assert mapped == [_decision(d) for d in f.read["decisions_mapped"]] + retired = [d for d in mapped if d["superseded_by"]] + assert [d["id"] for d in retired] == [f.decisions["superseded"]] + assert retired[0]["superseded_by"] == f.decisions["replacement"] + assert retired[0]["superseded_at"] is not None + # Legacy decisions are unbound: included for any project, never a + # project's lesson. (A project-bound lesson is excluded elsewhere: + # test_lessons.py covers the project filter with mixed rows.) + assert all(lesson_source(d) is None for d in board.active_decisions()) + assert [d.id for d in board.active_decisions(project_id="frozen-board")] == \ + [d["id"] for d in f.read["active_decisions"]["*"]] + assert board.project_lessons("frozen-board") == [] + assert board.project_lessons("frozen-board", goal="backend") == [] + finally: + board.close() + for goal, expected in f.read["active_decisions"].items(): + argv = ["board", "decisions"] + ([] if goal == "*" else ["--goal", goal]) + shown = f.cli(*argv) + assert shown.exit_code == 0, shown.output + assert shown.output == render_decisions( + [Decision(**_decision(d)) for d in expected]) + "\n" + # Written out from the release's read, not from render_decisions: one + # line per decision, oldest first, and no lesson line for any of them. + assert shown.output.splitlines() == ( + [f" {d['id']} [{d['scope'] or 'global'}] {d['text']}" for d in expected] + or ["[syncmill] no active decisions"]), goal + shown = f.cli("board", "decisions", "--goal", "backend").output + assert f" {f.decisions['scoped']} [backend] 백엔드는 SQLite를 유지한다." in shown.splitlines() + + +# ── stats ───────────────────────────────────────────────────────────────── + + +@pytest.mark.parametrize(("release", "scenario"), CASES) +def test_stats_read_as_the_release_did_at_every_clock(release, scenario, frozen): + f = frozen(release, scenario) + board = f.board() + try: + clocks = {"fresh": f.frozen_at, "aged": f.frozen_at + f.stall + 1} + for label, now in clocks.items(): + assert plain(board.stats(now=now)) == f.read["stats"][label], label + boundary = f.read.get("boundary") + if boundary: + stats = boundary["stats"] + # The probe straddles the aging cutoff, or it protects nothing. + assert stats["before"]["blocked_aged"] != stats["at"]["blocked_aged"] + for label, now in boundary["times"].items(): + assert plain(board.stats(now=now)) == stats[label], label + if scenario == "compacted": + assert f.read["stats"] == f.facts["before_compaction"]["stats"] + finally: + board.close() + for label, now in clocks.items(): + f.clock(now) + shown = f.cli("board", "stats") + assert shown.exit_code == 0, shown.output + expected = f.read["stats"][label] + assert shown.output == render_board_stats(BoardStats(**expected)) + "\n", label + # Literal counts, independent of render_board_stats. + lines = shown.output.splitlines() + assert lines[0] == f"items: {expected['total']}" + assert f" reclaimed (stale-lease): {expected['reclaimed_stale']}" in lines + for title, key in (("redispatched (work redone)", "redispatched"), + ("false-done (done, unverified)", "false_done"), + (f"blocked > {f.stall}s", "blocked_aged"), + (f"human-required > {f.stall}s", "human_required_aged"), + (f"dropped handoffs > {f.stall}s", "dropped_handoffs")): + found = [x for x in lines if x.startswith(f" {title}: ")] + assert len(found) == 1, (label, title, lines) + line = found[0] + assert line.split(": ")[1].split()[0] == str(len(expected[key])), (label, line) + for item_id in expected[key]: + assert item_id in line, (label, title) + by_state = " ".join(f"{s}={n}" for s, n in sorted(expected["by_state"].items())) + assert f" by state: {by_state}" in lines + + +@pytest.mark.parametrize("release", ["v0.2.0", "v0.3.0"]) +def test_compacted_counts_add_the_rollups_to_the_live_audit(release, frozen): + f = frozen(release, "compacted") + rolled, mixed = f.items["rolled"], f.items["mixed"] + rollups = {r["item_id"]: r["claim_count"] + for r in f.rows("SELECT * FROM transition_rollups")} + live = f.rows("SELECT item_id, note FROM transitions " + "WHERE from_state = 'planned' AND to_state = 'running'") + # Each count needs both sources: neither alone reaches it. + assert rollups[rolled] == 2 and rollups[mixed] == 1 + assert [r["item_id"] for r in live].count(mixed) == 1 + board = f.board() + try: + stats = board.stats(now=f.frozen_at) + finally: + board.close() + assert sorted(stats.redispatched) == sorted([rolled, mixed]) + assert stats.reclaimed_stale == 2 + assert " reclaimed (stale-lease): 2" in f.cli("board", "stats").output.splitlines() + + +# ── the human path on released rows ─────────────────────────────────────── + +_NO_VERIFICATION = ( + "Error: cannot mark item {} done without verification — attach passing " + "evidence (--evidence) or a human sign-off (--sign-off)" +) + + +@pytest.mark.parametrize("release", RELEASES) +def test_done_counts_the_evidence_a_release_recorded(release, frozen): + f = frozen(release, "lifecycle") + item_id = f.items["passed"] + done = f.cli("board", "update", item_id, "--state", "done") + assert done.exit_code == 0, done.output + board = f.board() + try: + item = board.get(item_id) + assert item.state == WorkState.DONE + assert plain(item.evidence) == f.read["items"][item_id]["evidence"] + last = board.transitions(item_id)[-1] + assert (last["from_state"], last["to_state"], last["actor"]) == ("review", "done", "human") + finally: + board.close() + + +@pytest.mark.parametrize("release", RELEASES) +@pytest.mark.parametrize("role", ["imported-1", "bare-done-refused", "route-gate-failed", + "pipeline-gate-failed"]) +def test_done_refuses_a_released_item_without_passing_evidence(release, role, frozen): + f = frozen(release, "lifecycle") + f.board().close() # migrate first, so the comparison is of this command alone + before = _cells(f.db) + refused = f.cli("board", "update", f.items[role], "--state", "done") + assert refused.exit_code == 1 + assert _last_line(refused) == _NO_VERIFICATION.format(f.items[role]) + assert _cells(f.db) == before + + +@pytest.mark.parametrize("release", RELEASES) +def test_human_updates_on_released_items_keep_what_they_do_not_change(release, frozen): + f = frozen(release, "lifecycle") + stamp = f.frozen_at + 10 + f.clock(stamp) + imported = f.items["imported-1"] + signed = f.cli("board", "update", imported, "--state", "done", "--sign-off") + assert signed.exit_code == 0, signed.output + board = f.board() + try: + item = board.get(imported) + assert item.state == WorkState.DONE + assert plain(item.evidence) == f.read["items"][imported]["evidence"] + [ + {"kind": "human", "ref": "sign-off", "passed": True, "at": stamp, "by": "human"}] + assert item.inputs == f.read["items"][imported]["inputs"] + finally: + board.close() + + +@pytest.mark.parametrize("release", RELEASES) +def test_clearing_human_required_keeps_a_released_crash_blocked(release, frozen): + f = frozen(release, "crash-blocked") + item_id = f.items["crashed"] + cleared = f.cli("board", "update", item_id, "--clear-human-required") + assert cleared.exit_code == 0, cleared.output + board = f.board() + try: + item = board.get(item_id) + finally: + board.close() + expected = {**f.read["items"][item_id], "human_required": False, + "updated_at": f.frozen_at} + assert plain(item) == expected + + +@pytest.mark.parametrize("release", RELEASES) +def test_annotating_a_released_running_item_keeps_its_lease(release, frozen): + f = frozen(release, "running") + item_id = f.items["killed"] + stamp = f.frozen_at + 5 + f.clock(stamp) + noted = f.cli("board", "update", item_id, "--evidence", "log://killed") + assert noted.exit_code == 0, noted.output + board = f.board() + try: + item = board.get(item_id) + history = board.transitions(item_id) + stats = board.stats(now=f.frozen_at) + finally: + board.close() + # An annotate is not a second claim. + assert stats.redispatched == f.read["stats"]["fresh"]["redispatched"] == [] + released = f.read["items"][item_id] + assert item.state == WorkState.RUNNING + assert item.lease_run_id == released["lease_run_id"] is not None + assert item.claimed_at == released["claimed_at"] + assert plain(item.evidence) == [ + {"kind": "manual", "ref": "log://killed", "passed": True, "at": stamp, "by": "human"}] + assert history[:-1] == f.read["transitions"][item_id] + assert (history[-1]["to_state"], history[-1]["note"]) == ("running", "annotated") + + +@pytest.mark.parametrize("release", RELEASES) +def test_a_released_decision_is_superseded_in_its_own_scope_only(release, frozen): + f = frozen(release, "lifecycle") + replacement = f.decisions["replacement"] + made = f.cli("board", "decide", "Spaces, four of them.", "--supersedes", replacement) + assert made.exit_code == 0, made.output + new_id = made.output.split("recorded decision ")[1].split()[0] + rows = {r["id"]: dict(r) for r in f.rows("SELECT * FROM decisions")} + assert rows[replacement]["superseded_by"] == new_id + assert rows[new_id]["project_id"] is None # inherits the released, unbound reach + f.board().close() + before = _cells(f.db) + for role, reason in ( + ("scoped", "it is scoped to 'backend', not '' — supersede only retires a " + "decision in the same scope"), + ("superseded", "it is already superseded"), + ): + refused = f.cli("board", "decide", "Something else.", "--supersedes", f.decisions[role]) + assert refused.exit_code == 1 + assert _last_line(refused) == f"Error: cannot supersede {f.decisions[role]}: {reason}" + assert _cells(f.db) == before + + +@pytest.mark.parametrize("release", RELEASES) +def test_reimporting_a_released_review_candidate_skips_it(release, frozen): + f = frozen(release, "lifecycle") + f.board().close() + before = _cells(f.db) + again = f.cli("board", "import-review-candidates", str(REPORT), "--goal", "review") + assert again.exit_code == 0, again.output + assert _last_line(again) == "[syncmill] imported 0 review candidate(s); skipped 1 existing" + other = f.cli("board", "import-review-candidates", str(REPORT), "--goal", "other") + assert _last_line(other) == ( + "[syncmill] imported 0 review candidate(s); skipped 1 existing " + "(1 kept their original goal)") + assert _cells(f.db) == before + + +def _evidence_with(row, **change) -> str: + evidence = json.loads(row["evidence"]) + evidence[0].update(change) + return json.dumps(evidence) + + +@pytest.mark.parametrize("release", RELEASES) +@pytest.mark.parametrize("change", [ + pytest.param(lambda row: ("task", row["task"] + " (edited)"), id="task"), + pytest.param(lambda row: ("inputs", json.dumps(json.loads(row["inputs"])[:4])), id="inputs"), + pytest.param(lambda row: ("evidence", _evidence_with(row, ref="sha256:" + "0" * 64)), + id="evidence-ref"), + pytest.param(lambda row: ("evidence", _evidence_with(row, by="someone")), id="evidence-by"), + pytest.param(lambda row: ("evidence", _evidence_with(row, kind="manual")), id="evidence-kind"), + pytest.param(lambda row: ("evidence", _evidence_with(row, passed=True)), id="evidence-passed"), +]) +def test_reimport_refuses_a_released_candidate_whose_provenance_differs( + release, change, frozen +): + # The item id is a uuid5 of the provenance, so only a stored row that no + # longer matches it can collide; each checked component is changed alone. + f = frozen(release, "lifecycle") + f.board().close() + item_id = f.items["imported-1"] + row = f.rows("SELECT * FROM work_items WHERE id = ?", item_id)[0] + column, value = change(row) + conn = sqlite3.connect(f.db) + with conn: + conn.execute(f"UPDATE work_items SET {column} = ? WHERE id = ?", (value, item_id)) + conn.close() + before = _cells(f.db) + refused = f.cli("board", "import-review-candidates", str(REPORT), "--goal", "review") + assert refused.exit_code == 1 + assert _last_line(refused) == f"Error: review-candidate provenance collision for item {item_id}" + assert _cells(f.db) == before