diff --git a/docs/architecture/persisted-contracts.md b/docs/architecture/persisted-contracts.md index 9a5721d..ee01d7e 100644 --- a/docs/architecture/persisted-contracts.md +++ b/docs/architecture/persisted-contracts.md @@ -58,7 +58,7 @@ A golden over the current writer does not protect these. A reader can stop accep | 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. HEAD operating a released board: `board run` dispatch (FIFO order, skipping human-required items and unmet or missing dependencies, `--goal`, `--id`) with the released handoff, inputs and active decisions in the prompt and the run's outcome added to the released row, an agent's `done` counted only with this run's gate; a released running lease reclaimed exactly at its timeout (the ledger's `reclaimed_at` stamped, on v0.1.2 in the column HEAD added), redispatch counted, `apply_update`, the crash block and `renew_claim` fenced by the released lease; the scratch GC over the released ledger (purged runs never collected, a live lease never, a reclaimed run after one lease timeout of grace, a failed purge scheduled and then cleared in the columns HEAD added); `board compact` of released history (stats unchanged, rollups and counters added to, a cutoff between two claims); the gateway `board_list` / `board_get` / `board_stats`, `dashboard.take_snapshot` and the TUI board tab; a lesson promoted onto a released board leaves the released decisions unbound, and cannot supersede one (scope refused before project). Not covered: a run v0.1.2 reclaimed but never purged (its `reclaimed_at` is NULL, so HEAD collects it with no grace; v0.1.2 had none either, and its own GC purged every such run in the fixtures); `room promote` onto a released board (needs a room; `test_lessons.py` covers the CLI); the memory a released board run wrote (outside `board.db`) | `test_frozen_board.py`, `test_frozen_board_ops.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 | +| Run envelope | report run directories as a release's `run` and `board run` leave them with recording on: `envelope.json` (completed, no change, route failure, gate passed and failed, a compete team, a file trace, a Phoenix export error, a trace error, breaker and multiple degradations, a board block, the skeleton a SIGKILL leaves, a SIGINT's finalized crash), `result.json`, `trace.otlp.json`, and a trace-only run with no envelope; v0.1.2 wrote no `.syncmill-run-dir` sentinel. Preflight blocks only as `disabled` (the released preflight records are not frozen yet) | HEAD's `contracts/run-envelope.schema.json` (and the release's own, frozen beside it), `load_envelope` returning the stored document, `report show` and `report list` compared with what the release's own CLI printed, including the refusal for a run without an envelope, the TUI Reports tab and the dashboard REPORT pane; retention ownership (`_is_run_dir`) through `RunReporter.start` and the Supervisor's trace-only sweep: a sentinel or, for v0.1.2, an envelope with syncmill's `kind` naming its own directory makes a run dir removable, and a v0.1.2 trace-only run dir (neither) is never removed; a custom `trace.dir` is never swept. Not covered: `trace.otlp.json` semantics (tracegraph's reader); `report list` also lists a foreign directory holding any nonempty JSON-object `envelope.json` (observed, unchanged) | `test_frozen_envelope.py` (v0.1.2, v0.2.0, v0.3.0) | ### How a family is frozen diff --git a/tests/fixtures/persisted/envelope/freeze.py b/tests/fixtures/persisted/envelope/freeze.py new file mode 100644 index 0000000..37cd174 --- /dev/null +++ b/tests/fixtures/persisted/envelope/freeze.py @@ -0,0 +1,331 @@ +"""Produce the frozen run-report directories under this directory (#271). + +Run once per release, with THAT release's interpreter and source, never the +current one: the point of the fixtures is that the current writer did not make +them. The output directory must not exist; nothing here is ever regenerated. + + git worktree add --detach /tmp/wt-v0.3.0 v0.3.0 + (cd /tmp/wt-v0.3.0 && uv sync --frozen --no-dev --extra phoenix) + python tests/fixtures/persisted/envelope/freeze.py \\ + --release-root /tmp/wt-v0.3.0 --out tests/fixtures/persisted/envelope/v0.3.0 + +The `phoenix` extra matters: without it a release records the stream as +`unavailable` instead of the export error the `phoenix-error` scenario needs. + +Every run directory comes from the released `syncmill run` (or `board run`) +with report recording on and fake `codex` / `kimi` binaries on PATH. The run +directory under the reports root is copied byte for byte as soon as its step +finishes, into `runs//`. `index.json` maps each scenario to its run id +and holds what the release's own CLI printed for `report list` (once, over the +whole reports root) and `report show ` (per scenario, with its return code +and stderr). `run-envelope.schema.json` is the release's own schema, with its +git blob id in `index.json`. No value in these files is bound to the +generating machine except `report show`'s error for a run with no envelope, +which names the reports root (recorded in `index.json` as `runs_dir`). +""" + +from __future__ import annotations + +import argparse +import json +import os +import shutil +import signal +import socket +import subprocess +import sys +import tempfile +import time +from pathlib import Path + +TREE = {"calc.py": "def add(a, b):\n return a - b\n"} +GOAL = "frozen-goal" +TEAMS = {"pair": {"agents": ["codex", "kimi-code"], "strategy": "compete"}} + +# FAKE_PLAN maps the binary to one behaviour: fix (codex a + b, kimi b + a), +# nochange, fail (exits 1), hang (records its pid, then sleeps). +FAKE_AGENT = '''\ +import json, os, sys, time +from pathlib import Path +BINARY = os.path.basename(sys.argv[0]) +args = sys.argv[1:] +if args[:2] == ["login", "status"] or args[:1] in (["--version"], ["--help"]): + print(BINARY + " (fake) - logged in"); sys.exit(0) +plan = json.loads(os.environ.get("FAKE_PLAN") or "{}").get(BINARY, "fix") +if plan == "hang": + marker = Path(os.environ["FAKE_STARTED"]) / BINARY + marker.with_suffix(".tmp").write_text(str(os.getpid())) + os.replace(marker.with_suffix(".tmp"), marker) # never seen half-written + time.sleep(120); sys.exit(1) +if plan == "fail": + sys.stderr.write(BINARY + " (fake): refused\\n"); sys.exit(1) +if plan == "fix": + body = "a + b" if BINARY == "codex" else "b + a" + Path("calc.py").write_text("def add(a, b):\\n return " + body + "\\n", encoding="utf-8") +message = BINARY + " (fake) " + plan + "." +if BINARY == "codex": + events = [ + {"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}}, + ] +else: + events = [ + {"role": "assistant", "content": message}, + {"role": "meta", "type": "session.resume_hint", "session_id": "fake-kimi-session", + "content": "To resume this session: kimi -r fake-kimi-session"}, + ] +for event in events: + print(json.dumps(event)) +''' + +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 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_phoenix = subprocess.run( + [str(python), "-c", "import phoenix.otel"], capture_output=True, + ).returncode == 0 + if not has_phoenix: + sys.exit("the release venv lacks the phoenix extra: uv sync --frozen --no-dev --extra phoenix") + schema_blob = subprocess.run( + ["git", "-C", str(release), "rev-parse", "HEAD:contracts/run-envelope.schema.json"], + check=True, capture_output=True, text=True, + ).stdout.strip() + + 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() + for binary in ("codex", "kimi"): + (fakebin / binary).write_text(f"#!{sys.executable}\n" + FAKE_AGENT, encoding="utf-8") + (fakebin / binary).chmod(0o755) + reports = state / "reports" + # A port bound but never listening: a connection is refused at once. + closed = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + closed.bind(("127.0.0.1", 0)) + phoenix_endpoint = f"http://127.0.0.1:{closed.getsockname()[1]}" + (state / "breaker-dir").mkdir() + (state / "trace-blocker").write_text("a regular file where a directory is expected\n") + base_env = { + "HOME": str(home), + "PATH": os.pathsep.join([str(fakebin), "/usr/bin", "/bin"]), + "TMPDIR": str(box), + "GIT_CONFIG_NOSYSTEM": "1", + "FAKE_STARTED": str(started), + "SYNCMILL_PROJECT__ID": "frozen-envelope", + "SYNCMILL_AGENT_PRIORITY": json.dumps(["codex", "kimi-code"]), + "SYNCMILL_CLAUDE__ENABLED": "false", + "SYNCMILL_TEAMS": json.dumps(TEAMS), + "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_BOARD__DB_PATH": str(state / "board.db"), + "SYNCMILL_INTEGRATION__REPORT__ENABLED": "true", + "SYNCMILL_INTEGRATION__REPORT__RUNS_DIR": str(reports), + # The release's own retention must not prune a scenario before it is read. + "SYNCMILL_INTEGRATION__REPORT__KEEP_LAST": "1000", + **GIT_ENV, + } + trace_on = {"SYNCMILL_INTEGRATION__TRACE__ENABLED": "true"} + phoenix = { + **trace_on, + "SYNCMILL_INTEGRATION__TRACE__EXPORTER": "otlp-http", + "SYNCMILL_INTEGRATION__TRACE__ENDPOINT": phoenix_endpoint, + } + breaker_dir = { + "SYNCMILL_BREAKER__ENABLED": "true", + "SYNCMILL_BREAKER__STATE_PATH": str(state / "breaker-dir"), + } + + 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 / "runs").mkdir(parents=True) + index: dict = { + "release": version, + "schema_blob": schema_blob, + "runs_dir": str(reports), + "scenarios": {}, + } + + def dirs() -> set[str]: + return {p.name for p in reports.iterdir() if p.is_dir()} if reports.exists() else set() + + def new_dir(before: set[str], what: str) -> str: + new = sorted(dirs() - before) + if len(new) != 1: + sys.exit(f"{what}: expected one new run dir, got {new}") + return new[0] + + def sm(argv: list[str], env: dict, plan: dict) -> subprocess.CompletedProcess: + return subprocess.run( + [str(syncmill), *argv], cwd=repo, capture_output=True, text=True, + env={**base_env, **env, "FAKE_PLAN": json.dumps(plan)}, + ) + + def freeze(scenario: str, run_id: str, expect: dict) -> None: + # Copied at once, before any later step can touch the reports root. + run_dir = reports / run_id + envelope = run_dir / "envelope.json" + doc = json.loads(envelope.read_text()) if envelope.exists() else None + for path, want in expect.items(): + got: object = doc + for key in path.split("."): + got = got.get(key) if isinstance(got, dict) else None + if got != want: + sys.exit(f"{scenario}: {path} is {got!r}, expected {want!r}") + shutil.copytree(run_dir, out / "runs" / run_id) + index["scenarios"][scenario] = {"run_id": run_id} + git("checkout", "--", ".") + + def run(scenario: str, expect: dict, *, plan: dict | None = None, + env: dict | None = None, argv: tuple[str, ...] = ("-a", "codex")) -> None: + before = dirs() + done = sm(["run", "fix add", *argv], env or {}, plan or {}) + freeze(scenario, new_dir(before, f"{scenario}: {done.stderr}"), expect) + + def interrupted(scenario: str, sig: int, expect: dict) -> None: + marker = started / "codex" + marker.unlink(missing_ok=True) + before = dirs() + proc = subprocess.Popen( + [str(syncmill), "run", "fix add", "-a", "codex"], cwd=repo, + env={**base_env, "FAKE_PLAN": json.dumps({"codex": "hang"})}, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, + ) + agent_pid = None + try: + deadline = time.monotonic() + 60 + # The agent is working and the skeleton envelope is on disk. + while not (marker.exists() and any( + (reports / d / "envelope.json").exists() for d in dirs() - before + )): + if time.monotonic() > deadline or proc.poll() is not None: + sys.exit(f"{scenario}: the fake agent never started") + time.sleep(0.1) + agent_pid = int(marker.read_text()) + proc.send_signal(sig) + proc.wait(timeout=60) + finally: + if proc.poll() is None: + proc.kill() + proc.wait() + if agent_pid is not None: + try: + os.kill(agent_pid, signal.SIGKILL) + except ProcessLookupError: + pass + freeze(scenario, new_dir(before, scenario), expect) + + completed = {"result.status": "completed", "result.agent_id": "codex"} + route_failed = {"result.status": "failed", "result.agent_id": "none", + "result.exit_code": -1, "result.gate_passed": None} + + run("completed", {**completed, "result.files_changed_count": 1}) + run("nochange", {**completed, "result.files_changed_count": 0}, plan={"codex": "nochange"}) + run("failed", route_failed, plan={"codex": "fail"}) + run("gate-pass", {**completed, "result.gate_passed": True}, + env={"SYNCMILL_GATE__COMMANDS": '["true"]'}) + run("gate-fail", {"result.status": "failed", "result.agent_id": "codex", + "result.gate_passed": False}, + env={"SYNCMILL_GATE__COMMANDS": '["false"]'}, argv=("-a", "codex", "-s", "pipeline")) + run("compete-team", {"team": "pair", "strategy": "compete", + "agents": ["codex", "kimi-code"], "result.status": "completed"}, + argv=("--team", "pair")) + run("traced", {**completed, "trace.status": "ok"}, env=trace_on) + run("phoenix-error", {**completed, "trace.status": "ok", "trace.stream.status": "error", + "degraded": ["phoenix"]}, env=phoenix) + run("trace-error", {**completed, "trace.status": "error", "degraded": ["trace"]}, + env={**trace_on, "SYNCMILL_INTEGRATION__TRACE__DIR": str(state / "trace-blocker")}) + run("breaker-degraded", {**completed, "degraded": ["breaker"]}, env=breaker_dir) + run("multi-degraded", {**completed, "degraded": ["breaker", "phoenix"]}, + env={**breaker_dir, **phoenix}) + run("trace-only", {}, env={**trace_on, "SYNCMILL_INTEGRATION__REPORT__ENABLED": "false"}) + + board_env = {"SYNCMILL_BOARD__ENABLED": "true"} + added = sm(["board", "add", "fix add", "--goal", GOAL], board_env, {}) + if added.returncode != 0: + sys.exit(f"board add: {added.stderr}") + item_id = added.stdout.split("added item ")[1].split()[0] + before = dirs() + done = sm(["board", "run", "--id", item_id, "--agent", "codex"], board_env, {}) + freeze("board", new_dir(before, f"board: {done.stderr}"), + {"board": {"item_id": item_id, "goal": GOAL}, **completed}) + + skeleton = {"result.status": "failed", "result.agent_id": None, "result.exit_code": None} + interrupted("killed", signal.SIGKILL, skeleton) + interrupted("interrupted", signal.SIGINT, {"result.status": "failed", + "result.agent_id": "none", + "result.exit_code": 1}) + + # A listing that merely returned directories in name order must not pass: + # the newest-first order has to differ from the ascending directory names. + listed = [ + d for d in sorted(dirs()) if (reports / d / "envelope.json").exists() + ] + newest = sorted( + listed, + key=lambda d: json.loads((reports / d / "envelope.json").read_text())["created_at"], + reverse=True, + ) + extra = 0 + while newest == listed or newest == listed[::-1]: + extra += 1 + if extra > 5: + sys.exit("could not make created_at order differ from name order") + run(f"completed-{extra}", {**completed}) + listed = [d for d in sorted(dirs()) if (reports / d / "envelope.json").exists()] + newest = sorted( + listed, + key=lambda d: json.loads((reports / d / "envelope.json").read_text())["created_at"], + reverse=True, + ) + + closed.close() + shown = sm(["report", "list"], {}, {}) + if shown.returncode != 0: + sys.exit(f"report list: {shown.stderr}") + index["report_list"] = shown.stdout + for entry in index["scenarios"].values(): + done = sm(["report", "show", entry["run_id"]], {}, {}) + entry["report_show"] = { + "returncode": done.returncode, "stdout": done.stdout, "stderr": done.stderr, + } + + shutil.copyfile(release / "contracts" / "run-envelope.schema.json", + out / "run-envelope.schema.json") + (out / "index.json").write_text(json.dumps(index, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tests/fixtures/persisted/envelope/v0.1.2/index.json b/tests/fixtures/persisted/envelope/v0.1.2/index.json new file mode 100644 index 0000000..b126b43 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/index.json @@ -0,0 +1,128 @@ +{ + "release": "0.1.2", + "report_list": "Recorded runs (newest first):\n\n bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb 2026-11-15T03:22:18.555370+00:00 route failed none\n edf56e1f-2e05-4d31-a8a0-7e27e0375e02 2026-11-15T03:22:17.713226+00:00 route failed \u2014\n a1017afe-6f62-437b-b81c-927830e0b1ed 2026-11-15T03:22:16.792905+00:00 route completed codex\n 59724727-43e0-407c-9a89-9ed9b2e63b01 2026-11-15T03:22:09.702399+00:00 route completed codex\n aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab 2026-11-15T03:22:08.781685+00:00 route completed codex\n a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d 2026-11-15T03:22:07.872759+00:00 route completed codex\n af345992-4c0b-4cbf-a5fe-34b5e1ec1187 2026-11-15T03:22:01.851756+00:00 route completed codex\n 164fc4da-7c38-45d2-85a4-bb31b6084807 2026-11-15T03:22:00.936924+00:00 route completed codex\n a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8 2026-11-15T03:21:59.922463+00:00 compete completed codex\n 8cbacc14-4fae-4723-a4c3-07c238ad3d38 2026-11-15T03:21:59.038563+00:00 pipeline failed codex\n 36b103b7-1d62-4088-8456-d88d56bcbd1f 2026-11-15T03:21:58.142212+00:00 route completed codex\n e1eba09f-01e1-40ee-ba12-e4573fc582a3 2026-11-15T03:21:57.233651+00:00 route failed none\n a26dd727-2edb-46b7-b50b-c6f1c2348c93 2026-11-15T03:21:56.316593+00:00 route completed codex\n 91947ecf-e0bb-417d-b6ea-cb0c006b3c23 2026-11-15T03:21:55.296148+00:00 route completed codex\n", + "runs_dir": "/private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpl2qgfbn4/state/reports", + "scenarios": { + "board": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: a1017afe-6f62-437b-b81c-927830e0b1ed\nCreated: 2026-11-15T03:22:16.792905+00:00\nFinished: 2026-11-15T03:22:17.418709+00:00\nStrategy: route\nTeam: \u2014\nTask: a4cb8478-f827-4196-9c6e-6318d74f815f\nAgents: codex\nBoard: a9ab35aa-99c0-4e04-9a6f-a8f73fab0e21 (goal: frozen-goal)\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "a1017afe-6f62-437b-b81c-927830e0b1ed" + }, + "breaker-degraded": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab\nCreated: 2026-11-15T03:22:08.781685+00:00\nFinished: 2026-11-15T03:22:09.427643+00:00\nStrategy: route\nTeam: \u2014\nTask: 5bc27d5c-5865-46e2-8366-dd4b5b4e6e78\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: breaker\n" + }, + "run_id": "aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab" + }, + "compete-team": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8\nCreated: 2026-11-15T03:21:59.922463+00:00\nFinished: 2026-11-15T03:22:00.630316+00:00\nStrategy: compete\nTeam: pair\nTask: fcebd4de-2308-4e62-8274-f22e3ad85464\nAgents: codex, kimi-code\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8" + }, + "completed": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 91947ecf-e0bb-417d-b6ea-cb0c006b3c23\nCreated: 2026-11-15T03:21:55.296148+00:00\nFinished: 2026-11-15T03:21:56.034474+00:00\nStrategy: route\nTeam: \u2014\nTask: 670e0a15-1e67-42d0-943b-8e831f00564a\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.08s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:0ba327f895a43644830c39bab9547db4d302481833bc02cd29c2e032d001236e\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "91947ecf-e0bb-417d-b6ea-cb0c006b3c23" + }, + "failed": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: e1eba09f-01e1-40ee-ba12-e4573fc582a3\nCreated: 2026-11-15T03:21:57.233651+00:00\nFinished: 2026-11-15T03:21:57.849809+00:00\nStrategy: route\nTeam: \u2014\nTask: fdc5dc9b-ce13-4472-a418-39c9c95945d4\nAgents: codex\nBoard: \u2014\nResult: failed (none)\n winner: \u2014\n exit code: -1\n duration: 0.02s\n gate passed: None\n files changed: 0\n artifact: result.json\n digest: sha256:9059d36c2be1b60372a334557eb5df9b67bb17963a87d474a12bcf09111cb5e0\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "e1eba09f-01e1-40ee-ba12-e4573fc582a3" + }, + "gate-fail": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 8cbacc14-4fae-4723-a4c3-07c238ad3d38\nCreated: 2026-11-15T03:21:59.038563+00:00\nFinished: 2026-11-15T03:21:59.637001+00:00\nStrategy: pipeline\nTeam: \u2014\nTask: b833444f-4f7e-4475-bd21-17bfdd8f8315\nAgents: codex\nBoard: \u2014\nResult: failed (codex)\n winner: \u2014\n exit code: 0\n duration: 0.02s\n gate passed: False\n files changed: 0\n artifact: result.json\n digest: sha256:435455a718cc82642af9c7fbbf3d1ac25ea0c076d1ef7d9a3ab32dd52fd37b12\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "8cbacc14-4fae-4723-a4c3-07c238ad3d38" + }, + "gate-pass": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 36b103b7-1d62-4088-8456-d88d56bcbd1f\nCreated: 2026-11-15T03:21:58.142212+00:00\nFinished: 2026-11-15T03:21:58.769548+00:00\nStrategy: route\nTeam: \u2014\nTask: a79783bb-b81c-4f99-b06c-ca60b451d226\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: True\n files changed: 1\n artifact: result.json\n digest: sha256:8365b12e60409279c196bd9927aff1c83731044f94fb11c8ce4427e4191dd5fe\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "36b103b7-1d62-4088-8456-d88d56bcbd1f" + }, + "interrupted": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb\nCreated: 2026-11-15T03:22:18.555370+00:00\nFinished: 2026-11-15T03:22:19.470351+00:00\nStrategy: route\nTeam: \u2014\nTask: 158d0aa6-dcf6-4c43-8200-266332e94bcc\nAgents: codex\nBoard: \u2014\nResult: failed (none)\n winner: \u2014\n exit code: 1\n duration: 0.0s\n gate passed: None\n files changed: 0\n artifact: result.json\n digest: sha256:b0851087e43974dedee36d9b43eae8215b30a68ef24fa6af047b01fa6231e28b\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb" + }, + "killed": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: edf56e1f-2e05-4d31-a8a0-7e27e0375e02\nCreated: 2026-11-15T03:22:17.713226+00:00\nFinished: 2026-11-15T03:22:17.713226+00:00\nStrategy: route\nTeam: \u2014\nTask: a8de1874-4434-4044-bf2c-eae376174565\nAgents: codex\nBoard: \u2014\nResult: failed\n winner: \u2014\n exit code: None\n duration: Nones\n gate passed: None\n files changed: None\n artifact: \u2014\n digest: \u2014\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "edf56e1f-2e05-4d31-a8a0-7e27e0375e02" + }, + "multi-degraded": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 59724727-43e0-407c-9a89-9ed9b2e63b01\nCreated: 2026-11-15T03:22:09.702399+00:00\nFinished: 2026-11-15T03:22:15.424283+00:00\nStrategy: route\nTeam: \u2014\nTask: 3ce7d88c-4c32-4a2e-befa-10b7a2c4d0f1\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: ok\n Phoenix stream: error (0 exported, 2 dropped)\nDegraded: breaker, phoenix\n" + }, + "run_id": "59724727-43e0-407c-9a89-9ed9b2e63b01" + }, + "nochange": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: a26dd727-2edb-46b7-b50b-c6f1c2348c93\nCreated: 2026-11-15T03:21:56.316593+00:00\nFinished: 2026-11-15T03:21:56.958926+00:00\nStrategy: route\nTeam: \u2014\nTask: fb96728e-2109-4882-8f49-6e0de13f1cd3\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 0\n artifact: result.json\n digest: sha256:4a445bcf21d479be2c86f803c4bd651d296b38d8ddc4ae56f5bef57f5f680255\n patch digest: sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "a26dd727-2edb-46b7-b50b-c6f1c2348c93" + }, + "phoenix-error": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: af345992-4c0b-4cbf-a5fe-34b5e1ec1187\nCreated: 2026-11-15T03:22:01.851756+00:00\nFinished: 2026-11-15T03:22:07.571698+00:00\nStrategy: route\nTeam: \u2014\nTask: b5769ec8-bbc6-4256-b149-45e4c4c46734\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: ok\n Phoenix stream: error (0 exported, 2 dropped)\nDegraded: phoenix\n" + }, + "run_id": "af345992-4c0b-4cbf-a5fe-34b5e1ec1187" + }, + "trace-error": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d\nCreated: 2026-11-15T03:22:07.872759+00:00\nFinished: 2026-11-15T03:22:08.516579+00:00\nStrategy: route\nTeam: \u2014\nTask: 6bfcbd77-92bd-42dd-a34d-30153ec989de\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: error\nDegraded: trace\n" + }, + "run_id": "a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d" + }, + "trace-only": { + "report_show": { + "returncode": 1, + "stderr": "Error: no report found for run '0dbe5fca-93d6-4673-8590-126ae8c02732' under /private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpl2qgfbn4/state/reports\n", + "stdout": "" + }, + "run_id": "0dbe5fca-93d6-4673-8590-126ae8c02732" + }, + "traced": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 164fc4da-7c38-45d2-85a4-bb31b6084807\nCreated: 2026-11-15T03:22:00.936924+00:00\nFinished: 2026-11-15T03:22:01.577246+00:00\nStrategy: route\nTeam: \u2014\nTask: ad197946-f6c6-4b1d-b367-d08966f304fa\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: ok\nDegraded: \u2014\n" + }, + "run_id": "164fc4da-7c38-45d2-85a4-bb31b6084807" + } + }, + "schema_blob": "1d993aac91015f646dec747e32cc3e73aeb371dc" +} diff --git a/tests/fixtures/persisted/envelope/v0.1.2/run-envelope.schema.json b/tests/fixtures/persisted/envelope/v0.1.2/run-envelope.schema.json new file mode 100644 index 0000000..1d993aa --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/run-envelope.schema.json @@ -0,0 +1,134 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://syncmill.dev/contracts/run-envelope.schema.json", + "title": "syncmill run envelope", + "description": "The per-run join artifact of the toolgraph/tracegraph/syncmill ecosystem, written to ~/.syncmill/runs/{run_id}/envelope.json. Sub-blocks are ALWAYS present (status 'disabled' when an integration is off) so consumers never branch on absence. Bodies are forbidden: prompts, agent output, patch content, and file paths never appear here — only digests and counts. Artifact paths are relative to the envelope's directory. Additive fields are allowed within the same major schema_version; consumers must reject an unknown major.", + "type": "object", + "additionalProperties": true, + "required": [ + "schema_version", + "kind", + "run_id", + "created_at", + "finished_at", + "strategy", + "team", + "task_id", + "agents", + "board", + "preflight", + "trace", + "result", + "degraded" + ], + "properties": { + "schema_version": {"const": 1}, + "kind": {"const": "syncmill.run-envelope"}, + "run_id": {"type": "string", "minLength": 1}, + "created_at": {"type": "string", "format": "date-time"}, + "finished_at": {"type": "string", "format": "date-time"}, + "strategy": {"enum": ["route", "pipeline", "compete", "council", "decompose"]}, + "team": {"type": ["string", "null"]}, + "task_id": {"type": "string", "minLength": 1}, + "agents": {"type": "array", "items": {"type": "string", "minLength": 1}}, + "board": { + "oneOf": [ + {"type": "null"}, + { + "type": "object", + "additionalProperties": true, + "required": ["item_id"], + "properties": { + "item_id": {"type": "string", "minLength": 1}, + "goal": {"type": ["string", "null"]} + } + } + ] + }, + "preflight": {"$ref": "#/$defs/preflightBlock"}, + "trace": {"$ref": "#/$defs/traceBlock"}, + "result": {"$ref": "#/$defs/resultBlock"}, + "degraded": {"type": "array", "items": {"type": "string"}} + }, + "$defs": { + "digest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}, + "relativeArtifact": { + "type": "string", + "pattern": "^(?![A-Za-z]:)(?!.*(^|/)\\.\\.(/|$))[^/\\\\].*$", + "description": "Path relative to the envelope's directory — never absolute (no leading /, no drive letter, no backslash) and no '..' traversal." + }, + "preflightBlock": { + "type": "object", + "additionalProperties": true, + "required": ["status"], + "properties": { + "status": {"enum": ["ok", "disabled", "timeout", "error", "unresolved_identity"]}, + "mode": {"enum": ["advisory", "strict"]}, + "profile": {"enum": ["strict", "review", "explore"]}, + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"}, + "graph_generation": {"type": "integer", "minimum": 0}, + "warning_count": {"type": "integer", "minimum": 0}, + "enforcement_decision": {"enum": ["allow", "block"]}, + "evaluation_count": {"type": "integer", "minimum": 0}, + "block_count": {"type": "integer", "minimum": 0} + }, + "if": {"properties": {"status": {"const": "ok"}}}, + "then": { + "required": ["mode", "profile", "artifact", "digest", "graph_generation", "warning_count"] + }, + "allOf": [{ + "if": {"properties": {"mode": {"const": "strict"}}, "required": ["mode"]}, + "then": {"required": ["enforcement_decision", "evaluation_count", "block_count", "warning_count"]} + }] + }, + "traceBlock": { + "type": "object", + "additionalProperties": true, + "required": ["status"], + "properties": { + "status": {"enum": ["ok", "disabled", "error"]}, + "protocol": {"const": "otlp-json-file"}, + "trace_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"}, + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"}, + "stream": {"$ref": "#/$defs/traceStreamBlock"} + }, + "if": {"properties": {"status": {"const": "ok"}}}, + "then": {"required": ["protocol", "trace_id", "artifact", "digest"]} + }, + "traceStreamBlock": { + "type": "object", + "additionalProperties": true, + "required": ["backend", "protocol", "status", "exported_span_count", "dropped_span_count"], + "properties": { + "backend": {"const": "phoenix"}, + "protocol": {"const": "otlp-http/protobuf"}, + "status": {"enum": ["ok", "error", "unavailable"]}, + "exported_span_count": {"type": "integer", "minimum": 0}, + "dropped_span_count": {"type": "integer", "minimum": 0} + } + }, + "resultBlock": { + "type": "object", + "additionalProperties": true, + "required": ["status"], + "properties": { + "status": {"enum": ["completed", "failed"]}, + "agent_id": {"type": ["string", "null"]}, + "winner": {"type": ["string", "null"]}, + "exit_code": {"type": ["integer", "null"]}, + "duration_seconds": {"type": ["number", "null"]}, + "gate_passed": {"type": ["boolean", "null"]}, + "files_changed_count": {"type": ["integer", "null"], "minimum": 0}, + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"}, + "patch_digest": { + "oneOf": [{"$ref": "#/$defs/digest"}, {"type": "null"}] + } + }, + "if": {"properties": {"status": {"const": "completed"}}}, + "then": {"required": ["agent_id", "artifact", "digest"]} + } + } +} diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/0dbe5fca-93d6-4673-8590-126ae8c02732/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/0dbe5fca-93d6-4673-8590-126ae8c02732/trace.otlp.json new file mode 100644 index 0000000..4f725fa --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/0dbe5fca-93d6-4673-8590-126ae8c02732/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "55acd45bf797435e96775d76b61a96ef", "spanId": "5ed66f0212b5ba06", "name": "attempt:codex", "startTimeUnixNano": "1794712936276602112", "endTimeUnixNano": "1794712936296602112", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "0dbe5fca-93d6-4673-8590-126ae8c02732"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "a1652e671aeb511a"}, {"traceId": "55acd45bf797435e96775d76b61a96ef", "spanId": "a1652e671aeb511a", "name": "syncmill.run", "startTimeUnixNano": "1794712936252241920", "endTimeUnixNano": "1794712936337901056", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "0dbe5fca-93d6-4673-8590-126ae8c02732"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/164fc4da-7c38-45d2-85a4-bb31b6084807/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/164fc4da-7c38-45d2-85a4-bb31b6084807/envelope.json new file mode 100644 index 0000000..7e70693 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/164fc4da-7c38-45d2-85a4-bb31b6084807/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "164fc4da-7c38-45d2-85a4-bb31b6084807", "created_at": "2026-11-15T03:22:00.936924+00:00", "finished_at": "2026-11-15T03:22:01.577246+00:00", "strategy": "route", "team": null, "task_id": "ad197946-f6c6-4b1d-b367-d08966f304fa", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "ok", "protocol": "otlp-json-file", "trace_id": "b28e3567df50e0b3d3ec80794f086f63", "artifact": "trace.otlp.json", "digest": "sha256:4ca854b145511eb6aaa5d7c73ec0ce39d6ea290ea94a6f4d9028571f646cecc3"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/164fc4da-7c38-45d2-85a4-bb31b6084807/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/164fc4da-7c38-45d2-85a4-bb31b6084807/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/164fc4da-7c38-45d2-85a4-bb31b6084807/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/164fc4da-7c38-45d2-85a4-bb31b6084807/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/164fc4da-7c38-45d2-85a4-bb31b6084807/trace.otlp.json new file mode 100644 index 0000000..d25f1e0 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/164fc4da-7c38-45d2-85a4-bb31b6084807/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "b28e3567df50e0b3d3ec80794f086f63", "spanId": "65022319ec85fe15", "name": "attempt:codex", "startTimeUnixNano": "1794712921513153024", "endTimeUnixNano": "1794712921533153024", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "164fc4da-7c38-45d2-85a4-bb31b6084807"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "130375ab1e074c46"}, {"traceId": "b28e3567df50e0b3d3ec80794f086f63", "spanId": "130375ab1e074c46", "name": "syncmill.run", "startTimeUnixNano": "1794712921493064960", "endTimeUnixNano": "1794712921576791040", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "164fc4da-7c38-45d2-85a4-bb31b6084807"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/36b103b7-1d62-4088-8456-d88d56bcbd1f/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/36b103b7-1d62-4088-8456-d88d56bcbd1f/envelope.json new file mode 100644 index 0000000..2d44379 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/36b103b7-1d62-4088-8456-d88d56bcbd1f/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "36b103b7-1d62-4088-8456-d88d56bcbd1f", "created_at": "2026-11-15T03:21:58.142212+00:00", "finished_at": "2026-11-15T03:21:58.769548+00:00", "strategy": "route", "team": null, "task_id": "a79783bb-b81c-4f99-b06c-ca60b451d226", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": true, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:8365b12e60409279c196bd9927aff1c83731044f94fb11c8ce4427e4191dd5fe", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/36b103b7-1d62-4088-8456-d88d56bcbd1f/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/36b103b7-1d62-4088-8456-d88d56bcbd1f/result.json new file mode 100644 index 0000000..d9c8514 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/36b103b7-1d62-4088-8456-d88d56bcbd1f/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": "1/1 checks passed", "gate_passed": true, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/59724727-43e0-407c-9a89-9ed9b2e63b01/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/59724727-43e0-407c-9a89-9ed9b2e63b01/envelope.json new file mode 100644 index 0000000..f9ba20e --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/59724727-43e0-407c-9a89-9ed9b2e63b01/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "59724727-43e0-407c-9a89-9ed9b2e63b01", "created_at": "2026-11-15T03:22:09.702399+00:00", "finished_at": "2026-11-15T03:22:15.424283+00:00", "strategy": "route", "team": null, "task_id": "3ce7d88c-4c32-4a2e-befa-10b7a2c4d0f1", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "ok", "protocol": "otlp-json-file", "trace_id": "c83747bbc99cfcef3b2464f6a2b2eb39", "artifact": "trace.otlp.json", "digest": "sha256:6ac9091043b5c3e1031a399ea11af45fcac9ca314dec12b81e4d4e61cdec69ac", "stream": {"backend": "phoenix", "protocol": "otlp-http/protobuf", "status": "error", "exported_span_count": 0, "dropped_span_count": 2}}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["breaker", "phoenix"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/59724727-43e0-407c-9a89-9ed9b2e63b01/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/59724727-43e0-407c-9a89-9ed9b2e63b01/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/59724727-43e0-407c-9a89-9ed9b2e63b01/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/59724727-43e0-407c-9a89-9ed9b2e63b01/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/59724727-43e0-407c-9a89-9ed9b2e63b01/trace.otlp.json new file mode 100644 index 0000000..6a0a78a --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/59724727-43e0-407c-9a89-9ed9b2e63b01/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "c83747bbc99cfcef3b2464f6a2b2eb39", "spanId": "ac66a98abb6c96b9", "name": "attempt:codex", "startTimeUnixNano": "1794712930352450048", "endTimeUnixNano": "1794712930372450048", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "59724727-43e0-407c-9a89-9ed9b2e63b01"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "b0f5045adf6ba2c5"}, {"traceId": "c83747bbc99cfcef3b2464f6a2b2eb39", "spanId": "b0f5045adf6ba2c5", "name": "syncmill.run", "startTimeUnixNano": "1794712930256630016", "endTimeUnixNano": "1794712930419041024", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "59724727-43e0-407c-9a89-9ed9b2e63b01"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/8cbacc14-4fae-4723-a4c3-07c238ad3d38/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/8cbacc14-4fae-4723-a4c3-07c238ad3d38/envelope.json new file mode 100644 index 0000000..07f30d1 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/8cbacc14-4fae-4723-a4c3-07c238ad3d38/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "8cbacc14-4fae-4723-a4c3-07c238ad3d38", "created_at": "2026-11-15T03:21:59.038563+00:00", "finished_at": "2026-11-15T03:21:59.637001+00:00", "strategy": "pipeline", "team": null, "task_id": "b833444f-4f7e-4475-bd21-17bfdd8f8315", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": "codex", "winner": null, "exit_code": 0, "duration_seconds": 0.02, "gate_passed": false, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:435455a718cc82642af9c7fbbf3d1ac25ea0c076d1ef7d9a3ab32dd52fd37b12", "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/8cbacc14-4fae-4723-a4c3-07c238ad3d38/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/8cbacc14-4fae-4723-a4c3-07c238ad3d38/result.json new file mode 100644 index 0000000..41575c5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/8cbacc14-4fae-4723-a4c3-07c238ad3d38/result.json @@ -0,0 +1 @@ +{"status": "failed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": [], "error": "quality gate failed: 0/1 checks passed; failed: false", "gate_summary": "0/1 checks passed; failed: false", "gate_passed": false, "patch": null} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/91947ecf-e0bb-417d-b6ea-cb0c006b3c23/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/91947ecf-e0bb-417d-b6ea-cb0c006b3c23/envelope.json new file mode 100644 index 0000000..368652f --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/91947ecf-e0bb-417d-b6ea-cb0c006b3c23/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "91947ecf-e0bb-417d-b6ea-cb0c006b3c23", "created_at": "2026-11-15T03:21:55.296148+00:00", "finished_at": "2026-11-15T03:21:56.034474+00:00", "strategy": "route", "team": null, "task_id": "670e0a15-1e67-42d0-943b-8e831f00564a", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.08, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:0ba327f895a43644830c39bab9547db4d302481833bc02cd29c2e032d001236e", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/91947ecf-e0bb-417d-b6ea-cb0c006b3c23/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/91947ecf-e0bb-417d-b6ea-cb0c006b3c23/result.json new file mode 100644 index 0000000..815aaf2 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/91947ecf-e0bb-417d-b6ea-cb0c006b3c23/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.08, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/a1017afe-6f62-437b-b81c-927830e0b1ed/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/a1017afe-6f62-437b-b81c-927830e0b1ed/envelope.json new file mode 100644 index 0000000..a25e937 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/a1017afe-6f62-437b-b81c-927830e0b1ed/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "a1017afe-6f62-437b-b81c-927830e0b1ed", "created_at": "2026-11-15T03:22:16.792905+00:00", "finished_at": "2026-11-15T03:22:17.418709+00:00", "strategy": "route", "team": null, "task_id": "a4cb8478-f827-4196-9c6e-6318d74f815f", "agents": ["codex"], "board": {"item_id": "a9ab35aa-99c0-4e04-9a6f-a8f73fab0e21", "goal": "frozen-goal"}, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/a1017afe-6f62-437b-b81c-927830e0b1ed/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/a1017afe-6f62-437b-b81c-927830e0b1ed/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/a1017afe-6f62-437b-b81c-927830e0b1ed/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/a26dd727-2edb-46b7-b50b-c6f1c2348c93/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/a26dd727-2edb-46b7-b50b-c6f1c2348c93/envelope.json new file mode 100644 index 0000000..ae55d4b --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/a26dd727-2edb-46b7-b50b-c6f1c2348c93/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "a26dd727-2edb-46b7-b50b-c6f1c2348c93", "created_at": "2026-11-15T03:21:56.316593+00:00", "finished_at": "2026-11-15T03:21:56.958926+00:00", "strategy": "route", "team": null, "task_id": "fb96728e-2109-4882-8f49-6e0de13f1cd3", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:4a445bcf21d479be2c86f803c4bd651d296b38d8ddc4ae56f5bef57f5f680255", "patch_digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/a26dd727-2edb-46b7-b50b-c6f1c2348c93/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/a26dd727-2edb-46b7-b50b-c6f1c2348c93/result.json new file mode 100644 index 0000000..94c1318 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/a26dd727-2edb-46b7-b50b-c6f1c2348c93/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) nochange.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": [], "error": null, "gate_summary": null, "gate_passed": null, "patch": ""} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8/envelope.json new file mode 100644 index 0000000..10f5df2 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8", "created_at": "2026-11-15T03:21:59.922463+00:00", "finished_at": "2026-11-15T03:22:00.630316+00:00", "strategy": "compete", "team": "pair", "task_id": "fcebd4de-2308-4e62-8274-f22e3ad85464", "agents": ["codex", "kimi-code"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/a5347f6a-b116-4c4e-a2ac-8a7bcd4d45b8/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d/envelope.json new file mode 100644 index 0000000..a5e78ae --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d", "created_at": "2026-11-15T03:22:07.872759+00:00", "finished_at": "2026-11-15T03:22:08.516579+00:00", "strategy": "route", "team": null, "task_id": "6bfcbd77-92bd-42dd-a34d-30153ec989de", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "error"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["trace"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/a83ceb7e-6d33-4f8a-ba9f-1db2eb0e6d6d/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab/envelope.json new file mode 100644 index 0000000..1f3bf11 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab", "created_at": "2026-11-15T03:22:08.781685+00:00", "finished_at": "2026-11-15T03:22:09.427643+00:00", "strategy": "route", "team": null, "task_id": "5bc27d5c-5865-46e2-8366-dd4b5b4e6e78", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["breaker"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/aeb17ed3-44bd-4e4a-833c-1a1d696fa3ab/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/af345992-4c0b-4cbf-a5fe-34b5e1ec1187/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/af345992-4c0b-4cbf-a5fe-34b5e1ec1187/envelope.json new file mode 100644 index 0000000..c4451f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/af345992-4c0b-4cbf-a5fe-34b5e1ec1187/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "af345992-4c0b-4cbf-a5fe-34b5e1ec1187", "created_at": "2026-11-15T03:22:01.851756+00:00", "finished_at": "2026-11-15T03:22:07.571698+00:00", "strategy": "route", "team": null, "task_id": "b5769ec8-bbc6-4256-b149-45e4c4c46734", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "ok", "protocol": "otlp-json-file", "trace_id": "75371e16fce1f8993d472af659dc9cd8", "artifact": "trace.otlp.json", "digest": "sha256:30a406e75122b2f28715e104177ef44a6ea99b49c4d5d854cf737d6d3697b18d", "stream": {"backend": "phoenix", "protocol": "otlp-http/protobuf", "status": "error", "exported_span_count": 0, "dropped_span_count": 2}}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["phoenix"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/af345992-4c0b-4cbf-a5fe-34b5e1ec1187/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/af345992-4c0b-4cbf-a5fe-34b5e1ec1187/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/af345992-4c0b-4cbf-a5fe-34b5e1ec1187/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/af345992-4c0b-4cbf-a5fe-34b5e1ec1187/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/af345992-4c0b-4cbf-a5fe-34b5e1ec1187/trace.otlp.json new file mode 100644 index 0000000..fcadde2 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/af345992-4c0b-4cbf-a5fe-34b5e1ec1187/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "75371e16fce1f8993d472af659dc9cd8", "spanId": "5e7ae5ec5cd497e1", "name": "attempt:codex", "startTimeUnixNano": "1794712922508797952", "endTimeUnixNano": "1794712922528797952", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "af345992-4c0b-4cbf-a5fe-34b5e1ec1187"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "6252e530c14dd5a5"}, {"traceId": "75371e16fce1f8993d472af659dc9cd8", "spanId": "6252e530c14dd5a5", "name": "syncmill.run", "startTimeUnixNano": "1794712922416124928", "endTimeUnixNano": "1794712922570670080", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "af345992-4c0b-4cbf-a5fe-34b5e1ec1187"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb/envelope.json new file mode 100644 index 0000000..2226278 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb", "created_at": "2026-11-15T03:22:18.555370+00:00", "finished_at": "2026-11-15T03:22:19.470351+00:00", "strategy": "route", "team": null, "task_id": "158d0aa6-dcf6-4c43-8200-266332e94bcc", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": "none", "winner": null, "exit_code": 1, "duration_seconds": 0.0, "gate_passed": null, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:b0851087e43974dedee36d9b43eae8215b30a68ef24fa6af047b01fa6231e28b", "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb/result.json new file mode 100644 index 0000000..17ea991 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/bb024ddc-dc38-4bcd-bb91-6fe45ee93dcb/result.json @@ -0,0 +1 @@ +{"status": "failed", "agent_id": "none", "output": "", "exit_code": 1, "duration_seconds": 0.0, "files_changed": [], "error": "orchestration crashed before producing a result", "gate_summary": null, "gate_passed": null, "patch": null} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/e1eba09f-01e1-40ee-ba12-e4573fc582a3/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/e1eba09f-01e1-40ee-ba12-e4573fc582a3/envelope.json new file mode 100644 index 0000000..0a0f86e --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/e1eba09f-01e1-40ee-ba12-e4573fc582a3/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "e1eba09f-01e1-40ee-ba12-e4573fc582a3", "created_at": "2026-11-15T03:21:57.233651+00:00", "finished_at": "2026-11-15T03:21:57.849809+00:00", "strategy": "route", "team": null, "task_id": "fdc5dc9b-ce13-4472-a418-39c9c95945d4", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": "none", "winner": null, "exit_code": -1, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:9059d36c2be1b60372a334557eb5df9b67bb17963a87d474a12bcf09111cb5e0", "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/e1eba09f-01e1-40ee-ba12-e4573fc582a3/result.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/e1eba09f-01e1-40ee-ba12-e4573fc582a3/result.json new file mode 100644 index 0000000..f0460d5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/e1eba09f-01e1-40ee-ba12-e4573fc582a3/result.json @@ -0,0 +1 @@ +{"status": "failed", "agent_id": "none", "output": "", "exit_code": -1, "duration_seconds": 0.02, "files_changed": [], "error": "All agents failed:\n [codex] codex (fake): refused", "gate_summary": null, "gate_passed": null, "patch": null} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.1.2/runs/edf56e1f-2e05-4d31-a8a0-7e27e0375e02/envelope.json b/tests/fixtures/persisted/envelope/v0.1.2/runs/edf56e1f-2e05-4d31-a8a0-7e27e0375e02/envelope.json new file mode 100644 index 0000000..d882c32 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.1.2/runs/edf56e1f-2e05-4d31-a8a0-7e27e0375e02/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "edf56e1f-2e05-4d31-a8a0-7e27e0375e02", "created_at": "2026-11-15T03:22:17.713226+00:00", "finished_at": "2026-11-15T03:22:17.713226+00:00", "strategy": "route", "team": null, "task_id": "a8de1874-4434-4044-bf2c-eae376174565", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": null, "winner": null, "exit_code": null, "duration_seconds": null, "gate_passed": null, "files_changed_count": null, "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/index.json b/tests/fixtures/persisted/envelope/v0.2.0/index.json new file mode 100644 index 0000000..c827852 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/index.json @@ -0,0 +1,128 @@ +{ + "release": "0.2.0", + "report_list": "Recorded runs (newest first):\n\n 7d5c039d-0a69-4df6-a3ee-4370dd68d7c9 2026-11-15T03:22:43.140035+00:00 route failed none\n d4725225-c957-4a02-bc5b-af2a67991c8f 2026-11-15T03:22:42.499509+00:00 route failed \u2014\n c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659 2026-11-15T03:22:41.793495+00:00 route completed codex\n ce8aa2cd-f644-4d00-945a-036bf3c5f8b0 2026-11-15T03:22:35.086349+00:00 route completed codex\n 1de26e4b-ea8c-49b3-b6ba-50e568b5b80f 2026-11-15T03:22:34.397057+00:00 route completed codex\n eb2183c1-da15-4a5b-97e9-84a1ebdd6675 2026-11-15T03:22:33.731001+00:00 route completed codex\n f35e9938-0bf6-4b68-91cf-7c3163ea0606 2026-11-15T03:22:27.910575+00:00 route completed codex\n db1d1864-8bea-49a5-a149-c3d05e5c34f4 2026-11-15T03:22:27.217702+00:00 route completed codex\n c485e5de-4423-4293-8dd5-82bc09e81fa1 2026-11-15T03:22:26.456782+00:00 compete completed codex\n 9b7efeda-eb7c-4a28-b105-558595a1332d 2026-11-15T03:22:25.834223+00:00 pipeline failed codex\n fde68f57-6ea1-4614-9760-31248d491ac9 2026-11-15T03:22:25.169653+00:00 route completed codex\n c604f18e-7c83-40f9-8ac0-c3dce0e45124 2026-11-15T03:22:24.533825+00:00 route failed none\n 7ed761c8-0bc7-4c59-94ad-35c40ec72061 2026-11-15T03:22:23.883161+00:00 route completed codex\n 16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d 2026-11-15T03:22:23.087222+00:00 route completed codex\n", + "runs_dir": "/private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpfage3a4g/state/reports", + "scenarios": { + "board": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659\nCreated: 2026-11-15T03:22:41.793495+00:00\nFinished: 2026-11-15T03:22:42.225570+00:00\nStrategy: route\nTeam: \u2014\nTask: e00070a8-b51b-4aa3-bb1b-c0efa161f0ef\nAgents: codex\nBoard: bb10099f-8654-4631-8b18-fb33b2feedee (goal: frozen-goal)\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659" + }, + "breaker-degraded": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 1de26e4b-ea8c-49b3-b6ba-50e568b5b80f\nCreated: 2026-11-15T03:22:34.397057+00:00\nFinished: 2026-11-15T03:22:34.816272+00:00\nStrategy: route\nTeam: \u2014\nTask: d8072ae5-9ad6-44f2-b97e-cec1ce4dc8ed\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: breaker\n" + }, + "run_id": "1de26e4b-ea8c-49b3-b6ba-50e568b5b80f" + }, + "compete-team": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: c485e5de-4423-4293-8dd5-82bc09e81fa1\nCreated: 2026-11-15T03:22:26.456782+00:00\nFinished: 2026-11-15T03:22:26.935476+00:00\nStrategy: compete\nTeam: pair\nTask: 1aa6349a-9ad1-4b54-ba4b-f53fc6464f47\nAgents: codex, kimi-code\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "c485e5de-4423-4293-8dd5-82bc09e81fa1" + }, + "completed": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d\nCreated: 2026-11-15T03:22:23.087222+00:00\nFinished: 2026-11-15T03:22:23.618053+00:00\nStrategy: route\nTeam: \u2014\nTask: 033fef7b-7ca3-46d9-8208-d500ebe3d209\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.08s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:0ba327f895a43644830c39bab9547db4d302481833bc02cd29c2e032d001236e\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d" + }, + "failed": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: c604f18e-7c83-40f9-8ac0-c3dce0e45124\nCreated: 2026-11-15T03:22:24.533825+00:00\nFinished: 2026-11-15T03:22:24.903019+00:00\nStrategy: route\nTeam: \u2014\nTask: 6ca81499-01e0-42d7-992d-b627125faa21\nAgents: codex\nBoard: \u2014\nResult: failed (none)\n winner: \u2014\n exit code: -1\n duration: 0.02s\n gate passed: None\n files changed: 0\n artifact: result.json\n digest: sha256:9059d36c2be1b60372a334557eb5df9b67bb17963a87d474a12bcf09111cb5e0\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "c604f18e-7c83-40f9-8ac0-c3dce0e45124" + }, + "gate-fail": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 9b7efeda-eb7c-4a28-b105-558595a1332d\nCreated: 2026-11-15T03:22:25.834223+00:00\nFinished: 2026-11-15T03:22:26.193549+00:00\nStrategy: pipeline\nTeam: \u2014\nTask: f2b4c207-6d81-4285-b1ba-d55db2a06d10\nAgents: codex\nBoard: \u2014\nResult: failed (codex)\n winner: \u2014\n exit code: 0\n duration: 0.02s\n gate passed: False\n files changed: 0\n artifact: result.json\n digest: sha256:435455a718cc82642af9c7fbbf3d1ac25ea0c076d1ef7d9a3ab32dd52fd37b12\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "9b7efeda-eb7c-4a28-b105-558595a1332d" + }, + "gate-pass": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: fde68f57-6ea1-4614-9760-31248d491ac9\nCreated: 2026-11-15T03:22:25.169653+00:00\nFinished: 2026-11-15T03:22:25.569454+00:00\nStrategy: route\nTeam: \u2014\nTask: 6dc38e48-9757-487a-a409-4938b67bbe22\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: True\n files changed: 1\n artifact: result.json\n digest: sha256:8365b12e60409279c196bd9927aff1c83731044f94fb11c8ce4427e4191dd5fe\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "fde68f57-6ea1-4614-9760-31248d491ac9" + }, + "interrupted": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 7d5c039d-0a69-4df6-a3ee-4370dd68d7c9\nCreated: 2026-11-15T03:22:43.140035+00:00\nFinished: 2026-11-15T03:22:43.540908+00:00\nStrategy: route\nTeam: \u2014\nTask: b6a8295d-df23-4743-8957-1b9f84d4cafe\nAgents: codex\nBoard: \u2014\nResult: failed (none)\n winner: \u2014\n exit code: 1\n duration: 0.0s\n gate passed: None\n files changed: 0\n artifact: result.json\n digest: sha256:b0851087e43974dedee36d9b43eae8215b30a68ef24fa6af047b01fa6231e28b\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "7d5c039d-0a69-4df6-a3ee-4370dd68d7c9" + }, + "killed": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: d4725225-c957-4a02-bc5b-af2a67991c8f\nCreated: 2026-11-15T03:22:42.499509+00:00\nFinished: 2026-11-15T03:22:42.499509+00:00\nStrategy: route\nTeam: \u2014\nTask: 7826ec2b-93b0-4582-8868-4add676de26f\nAgents: codex\nBoard: \u2014\nResult: failed\n winner: \u2014\n exit code: None\n duration: Nones\n gate passed: None\n files changed: None\n artifact: \u2014\n digest: \u2014\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "d4725225-c957-4a02-bc5b-af2a67991c8f" + }, + "multi-degraded": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: ce8aa2cd-f644-4d00-945a-036bf3c5f8b0\nCreated: 2026-11-15T03:22:35.086349+00:00\nFinished: 2026-11-15T03:22:40.587419+00:00\nStrategy: route\nTeam: \u2014\nTask: 1c295998-7496-4fc8-9e8c-8453d27ed831\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: ok\n Phoenix stream: error (0 exported, 2 dropped)\nDegraded: breaker, phoenix\n" + }, + "run_id": "ce8aa2cd-f644-4d00-945a-036bf3c5f8b0" + }, + "nochange": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 7ed761c8-0bc7-4c59-94ad-35c40ec72061\nCreated: 2026-11-15T03:22:23.883161+00:00\nFinished: 2026-11-15T03:22:24.271799+00:00\nStrategy: route\nTeam: \u2014\nTask: 55e13a24-8231-4aa0-8eb4-9a1d8e5e0dfa\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 0\n artifact: result.json\n digest: sha256:4a445bcf21d479be2c86f803c4bd651d296b38d8ddc4ae56f5bef57f5f680255\n patch digest: sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "7ed761c8-0bc7-4c59-94ad-35c40ec72061" + }, + "phoenix-error": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: f35e9938-0bf6-4b68-91cf-7c3163ea0606\nCreated: 2026-11-15T03:22:27.910575+00:00\nFinished: 2026-11-15T03:22:33.451599+00:00\nStrategy: route\nTeam: \u2014\nTask: 17370b6c-c534-47b7-973e-56261d66902d\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: ok\n Phoenix stream: error (0 exported, 2 dropped)\nDegraded: phoenix\n" + }, + "run_id": "f35e9938-0bf6-4b68-91cf-7c3163ea0606" + }, + "trace-error": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: eb2183c1-da15-4a5b-97e9-84a1ebdd6675\nCreated: 2026-11-15T03:22:33.731001+00:00\nFinished: 2026-11-15T03:22:34.130804+00:00\nStrategy: route\nTeam: \u2014\nTask: b6f4ec6f-f39e-403d-837e-ed83c79d6eaf\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: error\nDegraded: trace\n" + }, + "run_id": "eb2183c1-da15-4a5b-97e9-84a1ebdd6675" + }, + "trace-only": { + "report_show": { + "returncode": 1, + "stderr": "Error: no report found for run 'a32d918d-ffde-4001-bc66-50050316ef32' under /private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpfage3a4g/state/reports\n", + "stdout": "" + }, + "run_id": "a32d918d-ffde-4001-bc66-50050316ef32" + }, + "traced": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: db1d1864-8bea-49a5-a149-c3d05e5c34f4\nCreated: 2026-11-15T03:22:27.217702+00:00\nFinished: 2026-11-15T03:22:27.634417+00:00\nStrategy: route\nTeam: \u2014\nTask: 78751b6b-71db-4648-9599-f1aedc992771\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: ok\nDegraded: \u2014\n" + }, + "run_id": "db1d1864-8bea-49a5-a149-c3d05e5c34f4" + } + }, + "schema_blob": "db5da9b38b42a643423b02cddf2e0ec47f276031" +} diff --git a/tests/fixtures/persisted/envelope/v0.2.0/run-envelope.schema.json b/tests/fixtures/persisted/envelope/v0.2.0/run-envelope.schema.json new file mode 100644 index 0000000..db5da9b --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/run-envelope.schema.json @@ -0,0 +1,154 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://syncmill.dev/contracts/run-envelope.schema.json", + "title": "syncmill run envelope", + "description": "The per-run join artifact of the toolgraph/tracegraph/syncmill ecosystem, written to ~/.syncmill/runs/{run_id}/envelope.json. Sub-blocks are ALWAYS present (status 'disabled' when an integration is off) so consumers never branch on absence. Bodies are forbidden: prompts, agent output, patch content, and file paths never appear here — only digests and counts. Artifact paths are relative to the envelope's directory. Additive fields are allowed within the same major schema_version; consumers must reject an unknown major.", + "type": "object", + "additionalProperties": true, + "required": [ + "schema_version", + "kind", + "run_id", + "created_at", + "finished_at", + "strategy", + "team", + "task_id", + "agents", + "board", + "preflight", + "trace", + "result", + "degraded" + ], + "properties": { + "schema_version": {"const": 1}, + "kind": {"const": "syncmill.run-envelope"}, + "run_id": {"type": "string", "minLength": 1}, + "created_at": {"type": "string", "format": "date-time"}, + "finished_at": {"type": "string", "format": "date-time"}, + "strategy": {"enum": ["route", "pipeline", "compete", "council", "decompose"]}, + "team": {"type": ["string", "null"]}, + "task_id": {"type": "string", "minLength": 1}, + "agents": {"type": "array", "items": {"type": "string", "minLength": 1}}, + "board": { + "oneOf": [ + {"type": "null"}, + { + "type": "object", + "additionalProperties": true, + "required": ["item_id"], + "properties": { + "item_id": {"type": "string", "minLength": 1}, + "goal": {"type": ["string", "null"]} + } + } + ] + }, + "preflight": {"$ref": "#/$defs/preflightBlock"}, + "trace": {"$ref": "#/$defs/traceBlock"}, + "result": {"$ref": "#/$defs/resultBlock"}, + "degraded": {"type": "array", "items": {"type": "string"}} + }, + "$defs": { + "digest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}, + "relativeArtifact": { + "type": "string", + "pattern": "^(?![A-Za-z]:)(?!.*(^|/)\\.\\.(/|$))[^/\\\\].*$", + "description": "Path relative to the envelope's directory — never absolute (no leading /, no drive letter, no backslash) and no '..' traversal." + }, + "preflightBlock": { + "type": "object", + "additionalProperties": true, + "required": ["status"], + "properties": { + "status": {"enum": ["ok", "disabled", "timeout", "error", "unresolved_identity"]}, + "mode": {"enum": ["advisory", "strict"]}, + "profile": {"enum": ["strict", "review", "explore"]}, + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"}, + "graph_generation": {"type": "integer", "minimum": 0}, + "graph_state": {"$ref": "#/$defs/graphState"}, + "control_plan": {"$ref": "#/$defs/controlPlanArtifact"}, + "warning_count": {"type": "integer", "minimum": 0}, + "enforcement_decision": {"enum": ["allow", "block"]}, + "evaluation_count": {"type": "integer", "minimum": 0}, + "block_count": {"type": "integer", "minimum": 0} + }, + "if": {"properties": {"status": {"const": "ok"}}}, + "then": { + "required": ["mode", "profile", "artifact", "digest", "graph_generation", "warning_count"] + }, + "allOf": [{ + "if": {"properties": {"mode": {"const": "strict"}}, "required": ["mode"]}, + "then": {"required": ["enforcement_decision", "evaluation_count", "block_count", "warning_count"]} + }] + }, + "graphState": { + "type": "object", + "additionalProperties": false, + "required": ["instance_id", "generation"], + "properties": { + "instance_id": {"type": "string", "minLength": 1}, + "generation": {"type": "integer", "minimum": 0} + } + }, + "controlPlanArtifact": { + "type": "object", + "additionalProperties": false, + "required": ["artifact", "digest"], + "properties": { + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"} + } + }, + "traceBlock": { + "type": "object", + "additionalProperties": true, + "required": ["status"], + "properties": { + "status": {"enum": ["ok", "disabled", "error"]}, + "protocol": {"const": "otlp-json-file"}, + "trace_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"}, + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"}, + "stream": {"$ref": "#/$defs/traceStreamBlock"} + }, + "if": {"properties": {"status": {"const": "ok"}}}, + "then": {"required": ["protocol", "trace_id", "artifact", "digest"]} + }, + "traceStreamBlock": { + "type": "object", + "additionalProperties": true, + "required": ["backend", "protocol", "status", "exported_span_count", "dropped_span_count"], + "properties": { + "backend": {"const": "phoenix"}, + "protocol": {"const": "otlp-http/protobuf"}, + "status": {"enum": ["ok", "error", "unavailable"]}, + "exported_span_count": {"type": "integer", "minimum": 0}, + "dropped_span_count": {"type": "integer", "minimum": 0} + } + }, + "resultBlock": { + "type": "object", + "additionalProperties": true, + "required": ["status"], + "properties": { + "status": {"enum": ["completed", "failed"]}, + "agent_id": {"type": ["string", "null"]}, + "winner": {"type": ["string", "null"]}, + "exit_code": {"type": ["integer", "null"]}, + "duration_seconds": {"type": ["number", "null"]}, + "gate_passed": {"type": ["boolean", "null"]}, + "files_changed_count": {"type": ["integer", "null"], "minimum": 0}, + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"}, + "patch_digest": { + "oneOf": [{"$ref": "#/$defs/digest"}, {"type": "null"}] + } + }, + "if": {"properties": {"status": {"const": "completed"}}}, + "then": {"required": ["agent_id", "artifact", "digest"]} + } + } +} diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d/envelope.json new file mode 100644 index 0000000..1d317e6 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d", "created_at": "2026-11-15T03:22:23.087222+00:00", "finished_at": "2026-11-15T03:22:23.618053+00:00", "strategy": "route", "team": null, "task_id": "033fef7b-7ca3-46d9-8208-d500ebe3d209", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.08, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:0ba327f895a43644830c39bab9547db4d302481833bc02cd29c2e032d001236e", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d/result.json new file mode 100644 index 0000000..815aaf2 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/16a8b95d-0d8b-4a52-ab0e-2a5bd3ed214d/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.08, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/1de26e4b-ea8c-49b3-b6ba-50e568b5b80f/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/1de26e4b-ea8c-49b3-b6ba-50e568b5b80f/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/1de26e4b-ea8c-49b3-b6ba-50e568b5b80f/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/1de26e4b-ea8c-49b3-b6ba-50e568b5b80f/envelope.json new file mode 100644 index 0000000..6b0a641 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/1de26e4b-ea8c-49b3-b6ba-50e568b5b80f/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "1de26e4b-ea8c-49b3-b6ba-50e568b5b80f", "created_at": "2026-11-15T03:22:34.397057+00:00", "finished_at": "2026-11-15T03:22:34.816272+00:00", "strategy": "route", "team": null, "task_id": "d8072ae5-9ad6-44f2-b97e-cec1ce4dc8ed", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["breaker"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/1de26e4b-ea8c-49b3-b6ba-50e568b5b80f/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/1de26e4b-ea8c-49b3-b6ba-50e568b5b80f/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/1de26e4b-ea8c-49b3-b6ba-50e568b5b80f/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/7d5c039d-0a69-4df6-a3ee-4370dd68d7c9/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/7d5c039d-0a69-4df6-a3ee-4370dd68d7c9/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/7d5c039d-0a69-4df6-a3ee-4370dd68d7c9/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/7d5c039d-0a69-4df6-a3ee-4370dd68d7c9/envelope.json new file mode 100644 index 0000000..86b6b9d --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/7d5c039d-0a69-4df6-a3ee-4370dd68d7c9/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "7d5c039d-0a69-4df6-a3ee-4370dd68d7c9", "created_at": "2026-11-15T03:22:43.140035+00:00", "finished_at": "2026-11-15T03:22:43.540908+00:00", "strategy": "route", "team": null, "task_id": "b6a8295d-df23-4743-8957-1b9f84d4cafe", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": "none", "winner": null, "exit_code": 1, "duration_seconds": 0.0, "gate_passed": null, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:b0851087e43974dedee36d9b43eae8215b30a68ef24fa6af047b01fa6231e28b", "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/7d5c039d-0a69-4df6-a3ee-4370dd68d7c9/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/7d5c039d-0a69-4df6-a3ee-4370dd68d7c9/result.json new file mode 100644 index 0000000..17ea991 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/7d5c039d-0a69-4df6-a3ee-4370dd68d7c9/result.json @@ -0,0 +1 @@ +{"status": "failed", "agent_id": "none", "output": "", "exit_code": 1, "duration_seconds": 0.0, "files_changed": [], "error": "orchestration crashed before producing a result", "gate_summary": null, "gate_passed": null, "patch": null} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/7ed761c8-0bc7-4c59-94ad-35c40ec72061/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/7ed761c8-0bc7-4c59-94ad-35c40ec72061/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/7ed761c8-0bc7-4c59-94ad-35c40ec72061/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/7ed761c8-0bc7-4c59-94ad-35c40ec72061/envelope.json new file mode 100644 index 0000000..c848509 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/7ed761c8-0bc7-4c59-94ad-35c40ec72061/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "7ed761c8-0bc7-4c59-94ad-35c40ec72061", "created_at": "2026-11-15T03:22:23.883161+00:00", "finished_at": "2026-11-15T03:22:24.271799+00:00", "strategy": "route", "team": null, "task_id": "55e13a24-8231-4aa0-8eb4-9a1d8e5e0dfa", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:4a445bcf21d479be2c86f803c4bd651d296b38d8ddc4ae56f5bef57f5f680255", "patch_digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/7ed761c8-0bc7-4c59-94ad-35c40ec72061/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/7ed761c8-0bc7-4c59-94ad-35c40ec72061/result.json new file mode 100644 index 0000000..94c1318 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/7ed761c8-0bc7-4c59-94ad-35c40ec72061/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) nochange.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": [], "error": null, "gate_summary": null, "gate_passed": null, "patch": ""} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/9b7efeda-eb7c-4a28-b105-558595a1332d/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/9b7efeda-eb7c-4a28-b105-558595a1332d/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/9b7efeda-eb7c-4a28-b105-558595a1332d/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/9b7efeda-eb7c-4a28-b105-558595a1332d/envelope.json new file mode 100644 index 0000000..c3231b0 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/9b7efeda-eb7c-4a28-b105-558595a1332d/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "9b7efeda-eb7c-4a28-b105-558595a1332d", "created_at": "2026-11-15T03:22:25.834223+00:00", "finished_at": "2026-11-15T03:22:26.193549+00:00", "strategy": "pipeline", "team": null, "task_id": "f2b4c207-6d81-4285-b1ba-d55db2a06d10", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": "codex", "winner": null, "exit_code": 0, "duration_seconds": 0.02, "gate_passed": false, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:435455a718cc82642af9c7fbbf3d1ac25ea0c076d1ef7d9a3ab32dd52fd37b12", "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/9b7efeda-eb7c-4a28-b105-558595a1332d/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/9b7efeda-eb7c-4a28-b105-558595a1332d/result.json new file mode 100644 index 0000000..41575c5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/9b7efeda-eb7c-4a28-b105-558595a1332d/result.json @@ -0,0 +1 @@ +{"status": "failed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": [], "error": "quality gate failed: 0/1 checks passed; failed: false", "gate_summary": "0/1 checks passed; failed: false", "gate_passed": false, "patch": null} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/a32d918d-ffde-4001-bc66-50050316ef32/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/a32d918d-ffde-4001-bc66-50050316ef32/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/a32d918d-ffde-4001-bc66-50050316ef32/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/a32d918d-ffde-4001-bc66-50050316ef32/trace.otlp.json new file mode 100644 index 0000000..79490dc --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/a32d918d-ffde-4001-bc66-50050316ef32/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "8e2d5969deb2239ca1cd4514c2ad5e05", "spanId": "bd1721c8dc3bde8e", "name": "attempt:codex", "startTimeUnixNano": "1794712961229053952", "endTimeUnixNano": "1794712961249053952", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "a32d918d-ffde-4001-bc66-50050316ef32"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "9a144b79398cae0e"}, {"traceId": "8e2d5969deb2239ca1cd4514c2ad5e05", "spanId": "9a144b79398cae0e", "name": "syncmill.run", "startTimeUnixNano": "1794712961201303040", "endTimeUnixNano": "1794712961302955008", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "a32d918d-ffde-4001-bc66-50050316ef32"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/c485e5de-4423-4293-8dd5-82bc09e81fa1/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/c485e5de-4423-4293-8dd5-82bc09e81fa1/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/c485e5de-4423-4293-8dd5-82bc09e81fa1/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/c485e5de-4423-4293-8dd5-82bc09e81fa1/envelope.json new file mode 100644 index 0000000..5840d0d --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/c485e5de-4423-4293-8dd5-82bc09e81fa1/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "c485e5de-4423-4293-8dd5-82bc09e81fa1", "created_at": "2026-11-15T03:22:26.456782+00:00", "finished_at": "2026-11-15T03:22:26.935476+00:00", "strategy": "compete", "team": "pair", "task_id": "1aa6349a-9ad1-4b54-ba4b-f53fc6464f47", "agents": ["codex", "kimi-code"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/c485e5de-4423-4293-8dd5-82bc09e81fa1/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/c485e5de-4423-4293-8dd5-82bc09e81fa1/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/c485e5de-4423-4293-8dd5-82bc09e81fa1/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659/envelope.json new file mode 100644 index 0000000..b7de3e4 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659", "created_at": "2026-11-15T03:22:41.793495+00:00", "finished_at": "2026-11-15T03:22:42.225570+00:00", "strategy": "route", "team": null, "task_id": "e00070a8-b51b-4aa3-bb1b-c0efa161f0ef", "agents": ["codex"], "board": {"item_id": "bb10099f-8654-4631-8b18-fb33b2feedee", "goal": "frozen-goal"}, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/c4ea30e3-75a7-4b4a-9424-8a4ad4f8d659/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/c604f18e-7c83-40f9-8ac0-c3dce0e45124/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/c604f18e-7c83-40f9-8ac0-c3dce0e45124/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/c604f18e-7c83-40f9-8ac0-c3dce0e45124/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/c604f18e-7c83-40f9-8ac0-c3dce0e45124/envelope.json new file mode 100644 index 0000000..4a3abf5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/c604f18e-7c83-40f9-8ac0-c3dce0e45124/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "c604f18e-7c83-40f9-8ac0-c3dce0e45124", "created_at": "2026-11-15T03:22:24.533825+00:00", "finished_at": "2026-11-15T03:22:24.903019+00:00", "strategy": "route", "team": null, "task_id": "6ca81499-01e0-42d7-992d-b627125faa21", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": "none", "winner": null, "exit_code": -1, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:9059d36c2be1b60372a334557eb5df9b67bb17963a87d474a12bcf09111cb5e0", "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/c604f18e-7c83-40f9-8ac0-c3dce0e45124/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/c604f18e-7c83-40f9-8ac0-c3dce0e45124/result.json new file mode 100644 index 0000000..f0460d5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/c604f18e-7c83-40f9-8ac0-c3dce0e45124/result.json @@ -0,0 +1 @@ +{"status": "failed", "agent_id": "none", "output": "", "exit_code": -1, "duration_seconds": 0.02, "files_changed": [], "error": "All agents failed:\n [codex] codex (fake): refused", "gate_summary": null, "gate_passed": null, "patch": null} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/envelope.json new file mode 100644 index 0000000..4850ad6 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "ce8aa2cd-f644-4d00-945a-036bf3c5f8b0", "created_at": "2026-11-15T03:22:35.086349+00:00", "finished_at": "2026-11-15T03:22:40.587419+00:00", "strategy": "route", "team": null, "task_id": "1c295998-7496-4fc8-9e8c-8453d27ed831", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "ok", "protocol": "otlp-json-file", "trace_id": "d752ac741e6e2aba37996b61c4860d08", "artifact": "trace.otlp.json", "digest": "sha256:cc3a4afc914615abdb5b925178b3d2ee9dffa3032a7e4a24491e18d2db7c489e", "stream": {"backend": "phoenix", "protocol": "otlp-http/protobuf", "status": "error", "exported_span_count": 0, "dropped_span_count": 2}}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["breaker", "phoenix"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/trace.otlp.json new file mode 100644 index 0000000..d43b362 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/ce8aa2cd-f644-4d00-945a-036bf3c5f8b0/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "d752ac741e6e2aba37996b61c4860d08", "spanId": "252128427b0dab16", "name": "attempt:codex", "startTimeUnixNano": "1794712955510402048", "endTimeUnixNano": "1794712955530402048", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "ce8aa2cd-f644-4d00-945a-036bf3c5f8b0"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "e86ae42b9038d207"}, {"traceId": "d752ac741e6e2aba37996b61c4860d08", "spanId": "e86ae42b9038d207", "name": "syncmill.run", "startTimeUnixNano": "1794712955407739904", "endTimeUnixNano": "1794712955584782080", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "ce8aa2cd-f644-4d00-945a-036bf3c5f8b0"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/d4725225-c957-4a02-bc5b-af2a67991c8f/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/d4725225-c957-4a02-bc5b-af2a67991c8f/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/d4725225-c957-4a02-bc5b-af2a67991c8f/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/d4725225-c957-4a02-bc5b-af2a67991c8f/envelope.json new file mode 100644 index 0000000..1565059 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/d4725225-c957-4a02-bc5b-af2a67991c8f/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "d4725225-c957-4a02-bc5b-af2a67991c8f", "created_at": "2026-11-15T03:22:42.499509+00:00", "finished_at": "2026-11-15T03:22:42.499509+00:00", "strategy": "route", "team": null, "task_id": "7826ec2b-93b0-4582-8868-4add676de26f", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": null, "winner": null, "exit_code": null, "duration_seconds": null, "gate_passed": null, "files_changed_count": null, "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/envelope.json new file mode 100644 index 0000000..5df7fd3 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "db1d1864-8bea-49a5-a149-c3d05e5c34f4", "created_at": "2026-11-15T03:22:27.217702+00:00", "finished_at": "2026-11-15T03:22:27.634417+00:00", "strategy": "route", "team": null, "task_id": "78751b6b-71db-4648-9599-f1aedc992771", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "ok", "protocol": "otlp-json-file", "trace_id": "c4ec956c662da72a2f467ccd89835e75", "artifact": "trace.otlp.json", "digest": "sha256:8be34a8ad3b5b75c03a719a7556574be830119c9ec78cdb000419702e1e2666a"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/trace.otlp.json new file mode 100644 index 0000000..bbb6bf9 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/db1d1864-8bea-49a5-a149-c3d05e5c34f4/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "c4ec956c662da72a2f467ccd89835e75", "spanId": "f82cc78d1e6278ce", "name": "attempt:codex", "startTimeUnixNano": "1794712947558422016", "endTimeUnixNano": "1794712947578422016", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "db1d1864-8bea-49a5-a149-c3d05e5c34f4"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "cf1e8caa1e5eeeab"}, {"traceId": "c4ec956c662da72a2f467ccd89835e75", "spanId": "cf1e8caa1e5eeeab", "name": "syncmill.run", "startTimeUnixNano": "1794712947531641088", "endTimeUnixNano": "1794712947633869056", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "db1d1864-8bea-49a5-a149-c3d05e5c34f4"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/eb2183c1-da15-4a5b-97e9-84a1ebdd6675/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/eb2183c1-da15-4a5b-97e9-84a1ebdd6675/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/eb2183c1-da15-4a5b-97e9-84a1ebdd6675/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/eb2183c1-da15-4a5b-97e9-84a1ebdd6675/envelope.json new file mode 100644 index 0000000..18102ec --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/eb2183c1-da15-4a5b-97e9-84a1ebdd6675/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "eb2183c1-da15-4a5b-97e9-84a1ebdd6675", "created_at": "2026-11-15T03:22:33.731001+00:00", "finished_at": "2026-11-15T03:22:34.130804+00:00", "strategy": "route", "team": null, "task_id": "b6f4ec6f-f39e-403d-837e-ed83c79d6eaf", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "error"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["trace"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/eb2183c1-da15-4a5b-97e9-84a1ebdd6675/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/eb2183c1-da15-4a5b-97e9-84a1ebdd6675/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/eb2183c1-da15-4a5b-97e9-84a1ebdd6675/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/envelope.json new file mode 100644 index 0000000..fda95c2 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "f35e9938-0bf6-4b68-91cf-7c3163ea0606", "created_at": "2026-11-15T03:22:27.910575+00:00", "finished_at": "2026-11-15T03:22:33.451599+00:00", "strategy": "route", "team": null, "task_id": "17370b6c-c534-47b7-973e-56261d66902d", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "ok", "protocol": "otlp-json-file", "trace_id": "cd27023e8178ab1cbe60c95c1520fdd2", "artifact": "trace.otlp.json", "digest": "sha256:7449d4ad87585fe11b4ff4d6fd4675d782ed24a3059d8dbe556c3b07290743da", "stream": {"backend": "phoenix", "protocol": "otlp-http/protobuf", "status": "error", "exported_span_count": 0, "dropped_span_count": 2}}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["phoenix"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/trace.otlp.json new file mode 100644 index 0000000..89ac152 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/f35e9938-0bf6-4b68-91cf-7c3163ea0606/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "cd27023e8178ab1cbe60c95c1520fdd2", "spanId": "79e04eb80f841744", "name": "attempt:codex", "startTimeUnixNano": "1794712948373413120", "endTimeUnixNano": "1794712948393413120", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "f35e9938-0bf6-4b68-91cf-7c3163ea0606"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "5faf8ab28f9641b9"}, {"traceId": "cd27023e8178ab1cbe60c95c1520fdd2", "spanId": "5faf8ab28f9641b9", "name": "syncmill.run", "startTimeUnixNano": "1794712948266144000", "endTimeUnixNano": "1794712948445915904", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "f35e9938-0bf6-4b68-91cf-7c3163ea0606"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/fde68f57-6ea1-4614-9760-31248d491ac9/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.2.0/runs/fde68f57-6ea1-4614-9760-31248d491ac9/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/fde68f57-6ea1-4614-9760-31248d491ac9/envelope.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/fde68f57-6ea1-4614-9760-31248d491ac9/envelope.json new file mode 100644 index 0000000..a71ec4a --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/fde68f57-6ea1-4614-9760-31248d491ac9/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "fde68f57-6ea1-4614-9760-31248d491ac9", "created_at": "2026-11-15T03:22:25.169653+00:00", "finished_at": "2026-11-15T03:22:25.569454+00:00", "strategy": "route", "team": null, "task_id": "6dc38e48-9757-487a-a409-4938b67bbe22", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": true, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:8365b12e60409279c196bd9927aff1c83731044f94fb11c8ce4427e4191dd5fe", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.2.0/runs/fde68f57-6ea1-4614-9760-31248d491ac9/result.json b/tests/fixtures/persisted/envelope/v0.2.0/runs/fde68f57-6ea1-4614-9760-31248d491ac9/result.json new file mode 100644 index 0000000..d9c8514 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.2.0/runs/fde68f57-6ea1-4614-9760-31248d491ac9/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": "1/1 checks passed", "gate_passed": true, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/index.json b/tests/fixtures/persisted/envelope/v0.3.0/index.json new file mode 100644 index 0000000..43558f8 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/index.json @@ -0,0 +1,128 @@ +{ + "release": "0.3.0", + "report_list": "Recorded runs (newest first):\n\n f5200817-7522-4574-8ed5-8260c9f3bbf3 2026-11-15T03:23:07.386162+00:00 route failed none\n c5c3099d-51a7-4aa2-8496-71efed43a7c5 2026-11-15T03:23:06.750988+00:00 route failed \u2014\n 9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5 2026-11-15T03:23:06.076554+00:00 route completed codex\n d367883b-0cf2-48fa-bf0c-41c8f87f324c 2026-11-15T03:22:59.440478+00:00 route completed codex\n 238952d4-3622-43cd-bc68-7f480e241ad9 2026-11-15T03:22:58.782665+00:00 route completed codex\n f251ed32-c9a8-4a54-8c96-48e154f24902 2026-11-15T03:22:58.136071+00:00 route completed codex\n 0067368c-a9a7-4053-a8d0-3f83cc18a015 2026-11-15T03:22:52.347858+00:00 route completed codex\n 52b3660a-9ee5-453c-aab1-c43a28718bda 2026-11-15T03:22:51.670966+00:00 route completed codex\n 86be507a-5f1a-40a0-a345-9d4d7324c5e1 2026-11-15T03:22:50.908839+00:00 compete completed codex\n 3a180f14-d1dd-4344-ab57-7ce09a25bffe 2026-11-15T03:22:50.291751+00:00 pipeline failed codex\n 28c29e61-9351-4b93-8f3d-85b1688d45f6 2026-11-15T03:22:49.570441+00:00 route completed codex\n 45c16ae4-3548-4748-a1ec-57c58509bf13 2026-11-15T03:22:48.933418+00:00 route failed none\n e29498f8-33c4-45dc-8789-0899fd62fce5 2026-11-15T03:22:48.280213+00:00 route completed codex\n 00387d34-bf92-4278-ab4b-d4c3be523364 2026-11-15T03:22:47.497286+00:00 route completed codex\n", + "runs_dir": "/private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpqzsunwlp/state/reports", + "scenarios": { + "board": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5\nCreated: 2026-11-15T03:23:06.076554+00:00\nFinished: 2026-11-15T03:23:06.478317+00:00\nStrategy: route\nTeam: \u2014\nTask: b41cb24f-ada2-408f-b12a-64b35d6e3a92\nAgents: codex\nBoard: c7a42a96-242e-4437-bd90-be4f7f9dd4ac (goal: frozen-goal)\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5" + }, + "breaker-degraded": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 238952d4-3622-43cd-bc68-7f480e241ad9\nCreated: 2026-11-15T03:22:58.782665+00:00\nFinished: 2026-11-15T03:22:59.181974+00:00\nStrategy: route\nTeam: \u2014\nTask: 6f3a3792-fd63-4a82-9870-d033049f6ea0\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: breaker\n" + }, + "run_id": "238952d4-3622-43cd-bc68-7f480e241ad9" + }, + "compete-team": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 86be507a-5f1a-40a0-a345-9d4d7324c5e1\nCreated: 2026-11-15T03:22:50.908839+00:00\nFinished: 2026-11-15T03:22:51.404836+00:00\nStrategy: compete\nTeam: pair\nTask: 6dea95b3-998d-4bdb-8c9d-72f5c16d4e22\nAgents: codex, kimi-code\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "86be507a-5f1a-40a0-a345-9d4d7324c5e1" + }, + "completed": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 00387d34-bf92-4278-ab4b-d4c3be523364\nCreated: 2026-11-15T03:22:47.497286+00:00\nFinished: 2026-11-15T03:22:48.006823+00:00\nStrategy: route\nTeam: \u2014\nTask: 704741d1-9d0c-459b-a6b5-76f532f1af66\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.07s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:828d10f991eab6ef70a59e6d6c2d22b52b2e0e1ae50a02b1198ea54eb8a191cc\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "00387d34-bf92-4278-ab4b-d4c3be523364" + }, + "failed": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 45c16ae4-3548-4748-a1ec-57c58509bf13\nCreated: 2026-11-15T03:22:48.933418+00:00\nFinished: 2026-11-15T03:22:49.300001+00:00\nStrategy: route\nTeam: \u2014\nTask: c9757d1f-891b-4deb-b5ac-4fa3c09116d3\nAgents: codex\nBoard: \u2014\nResult: failed (none)\n winner: \u2014\n exit code: -1\n duration: 0.02s\n gate passed: None\n files changed: 0\n artifact: result.json\n digest: sha256:9059d36c2be1b60372a334557eb5df9b67bb17963a87d474a12bcf09111cb5e0\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "45c16ae4-3548-4748-a1ec-57c58509bf13" + }, + "gate-fail": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 3a180f14-d1dd-4344-ab57-7ce09a25bffe\nCreated: 2026-11-15T03:22:50.291751+00:00\nFinished: 2026-11-15T03:22:50.641419+00:00\nStrategy: pipeline\nTeam: \u2014\nTask: 4c17300b-670c-41f9-9153-1ebeb63e2e9b\nAgents: codex\nBoard: \u2014\nResult: failed (codex)\n winner: \u2014\n exit code: 0\n duration: 0.02s\n gate passed: False\n files changed: 0\n artifact: result.json\n digest: sha256:435455a718cc82642af9c7fbbf3d1ac25ea0c076d1ef7d9a3ab32dd52fd37b12\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "3a180f14-d1dd-4344-ab57-7ce09a25bffe" + }, + "gate-pass": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 28c29e61-9351-4b93-8f3d-85b1688d45f6\nCreated: 2026-11-15T03:22:49.570441+00:00\nFinished: 2026-11-15T03:22:50.025070+00:00\nStrategy: route\nTeam: \u2014\nTask: 46addbfb-67f3-45b4-8daa-da2cc8b809c5\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: True\n files changed: 1\n artifact: result.json\n digest: sha256:8365b12e60409279c196bd9927aff1c83731044f94fb11c8ce4427e4191dd5fe\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "28c29e61-9351-4b93-8f3d-85b1688d45f6" + }, + "interrupted": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: f5200817-7522-4574-8ed5-8260c9f3bbf3\nCreated: 2026-11-15T03:23:07.386162+00:00\nFinished: 2026-11-15T03:23:07.796288+00:00\nStrategy: route\nTeam: \u2014\nTask: fd70f1f9-9246-4b75-b726-e57957c7804f\nAgents: codex\nBoard: \u2014\nResult: failed (none)\n winner: \u2014\n exit code: 1\n duration: 0.0s\n gate passed: None\n files changed: 0\n artifact: result.json\n digest: sha256:b0851087e43974dedee36d9b43eae8215b30a68ef24fa6af047b01fa6231e28b\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "f5200817-7522-4574-8ed5-8260c9f3bbf3" + }, + "killed": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: c5c3099d-51a7-4aa2-8496-71efed43a7c5\nCreated: 2026-11-15T03:23:06.750988+00:00\nFinished: 2026-11-15T03:23:06.750988+00:00\nStrategy: route\nTeam: \u2014\nTask: a1256348-398a-4b23-be4a-289712160446\nAgents: codex\nBoard: \u2014\nResult: failed\n winner: \u2014\n exit code: None\n duration: Nones\n gate passed: None\n files changed: None\n artifact: \u2014\n digest: \u2014\n patch digest: \u2014\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "c5c3099d-51a7-4aa2-8496-71efed43a7c5" + }, + "multi-degraded": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: d367883b-0cf2-48fa-bf0c-41c8f87f324c\nCreated: 2026-11-15T03:22:59.440478+00:00\nFinished: 2026-11-15T03:23:04.924470+00:00\nStrategy: route\nTeam: \u2014\nTask: bc4c7b26-3d4e-4c38-b1eb-99a608707a6f\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: ok\n Phoenix stream: error (0 exported, 2 dropped)\nDegraded: breaker, phoenix\n" + }, + "run_id": "d367883b-0cf2-48fa-bf0c-41c8f87f324c" + }, + "nochange": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: e29498f8-33c4-45dc-8789-0899fd62fce5\nCreated: 2026-11-15T03:22:48.280213+00:00\nFinished: 2026-11-15T03:22:48.661139+00:00\nStrategy: route\nTeam: \u2014\nTask: 5d428d30-6628-48cb-b628-84b9b6d26bab\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 0\n artifact: result.json\n digest: sha256:4a445bcf21d479be2c86f803c4bd651d296b38d8ddc4ae56f5bef57f5f680255\n patch digest: sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nPreflight: disabled\nTrace: disabled\nDegraded: \u2014\n" + }, + "run_id": "e29498f8-33c4-45dc-8789-0899fd62fce5" + }, + "phoenix-error": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 0067368c-a9a7-4053-a8d0-3f83cc18a015\nCreated: 2026-11-15T03:22:52.347858+00:00\nFinished: 2026-11-15T03:22:57.849063+00:00\nStrategy: route\nTeam: \u2014\nTask: 60e9a704-aead-4650-bc12-a98d106a1220\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: ok\n Phoenix stream: error (0 exported, 2 dropped)\nDegraded: phoenix\n" + }, + "run_id": "0067368c-a9a7-4053-a8d0-3f83cc18a015" + }, + "trace-error": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: f251ed32-c9a8-4a54-8c96-48e154f24902\nCreated: 2026-11-15T03:22:58.136071+00:00\nFinished: 2026-11-15T03:22:58.519029+00:00\nStrategy: route\nTeam: \u2014\nTask: 2f73bd40-7f11-4e98-9215-fd56d6251c72\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: error\nDegraded: trace\n" + }, + "run_id": "f251ed32-c9a8-4a54-8c96-48e154f24902" + }, + "trace-only": { + "report_show": { + "returncode": 1, + "stderr": "Error: no report found for run 'cf550572-194d-46af-ab86-4dc77446d953' under /private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpqzsunwlp/state/reports\n", + "stdout": "" + }, + "run_id": "cf550572-194d-46af-ab86-4dc77446d953" + }, + "traced": { + "report_show": { + "returncode": 0, + "stderr": "", + "stdout": "Run: 52b3660a-9ee5-453c-aab1-c43a28718bda\nCreated: 2026-11-15T03:22:51.670966+00:00\nFinished: 2026-11-15T03:22:52.086720+00:00\nStrategy: route\nTeam: \u2014\nTask: 4e1307ac-48a3-40d6-9027-e6f0bef9df66\nAgents: codex\nBoard: \u2014\nResult: completed (codex)\n winner: codex\n exit code: 0\n duration: 0.02s\n gate passed: None\n files changed: 1\n artifact: result.json\n digest: sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7\n patch digest: sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba\nPreflight: disabled\nTrace: ok\nDegraded: \u2014\n" + }, + "run_id": "52b3660a-9ee5-453c-aab1-c43a28718bda" + } + }, + "schema_blob": "db5da9b38b42a643423b02cddf2e0ec47f276031" +} diff --git a/tests/fixtures/persisted/envelope/v0.3.0/run-envelope.schema.json b/tests/fixtures/persisted/envelope/v0.3.0/run-envelope.schema.json new file mode 100644 index 0000000..db5da9b --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/run-envelope.schema.json @@ -0,0 +1,154 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://syncmill.dev/contracts/run-envelope.schema.json", + "title": "syncmill run envelope", + "description": "The per-run join artifact of the toolgraph/tracegraph/syncmill ecosystem, written to ~/.syncmill/runs/{run_id}/envelope.json. Sub-blocks are ALWAYS present (status 'disabled' when an integration is off) so consumers never branch on absence. Bodies are forbidden: prompts, agent output, patch content, and file paths never appear here — only digests and counts. Artifact paths are relative to the envelope's directory. Additive fields are allowed within the same major schema_version; consumers must reject an unknown major.", + "type": "object", + "additionalProperties": true, + "required": [ + "schema_version", + "kind", + "run_id", + "created_at", + "finished_at", + "strategy", + "team", + "task_id", + "agents", + "board", + "preflight", + "trace", + "result", + "degraded" + ], + "properties": { + "schema_version": {"const": 1}, + "kind": {"const": "syncmill.run-envelope"}, + "run_id": {"type": "string", "minLength": 1}, + "created_at": {"type": "string", "format": "date-time"}, + "finished_at": {"type": "string", "format": "date-time"}, + "strategy": {"enum": ["route", "pipeline", "compete", "council", "decompose"]}, + "team": {"type": ["string", "null"]}, + "task_id": {"type": "string", "minLength": 1}, + "agents": {"type": "array", "items": {"type": "string", "minLength": 1}}, + "board": { + "oneOf": [ + {"type": "null"}, + { + "type": "object", + "additionalProperties": true, + "required": ["item_id"], + "properties": { + "item_id": {"type": "string", "minLength": 1}, + "goal": {"type": ["string", "null"]} + } + } + ] + }, + "preflight": {"$ref": "#/$defs/preflightBlock"}, + "trace": {"$ref": "#/$defs/traceBlock"}, + "result": {"$ref": "#/$defs/resultBlock"}, + "degraded": {"type": "array", "items": {"type": "string"}} + }, + "$defs": { + "digest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}, + "relativeArtifact": { + "type": "string", + "pattern": "^(?![A-Za-z]:)(?!.*(^|/)\\.\\.(/|$))[^/\\\\].*$", + "description": "Path relative to the envelope's directory — never absolute (no leading /, no drive letter, no backslash) and no '..' traversal." + }, + "preflightBlock": { + "type": "object", + "additionalProperties": true, + "required": ["status"], + "properties": { + "status": {"enum": ["ok", "disabled", "timeout", "error", "unresolved_identity"]}, + "mode": {"enum": ["advisory", "strict"]}, + "profile": {"enum": ["strict", "review", "explore"]}, + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"}, + "graph_generation": {"type": "integer", "minimum": 0}, + "graph_state": {"$ref": "#/$defs/graphState"}, + "control_plan": {"$ref": "#/$defs/controlPlanArtifact"}, + "warning_count": {"type": "integer", "minimum": 0}, + "enforcement_decision": {"enum": ["allow", "block"]}, + "evaluation_count": {"type": "integer", "minimum": 0}, + "block_count": {"type": "integer", "minimum": 0} + }, + "if": {"properties": {"status": {"const": "ok"}}}, + "then": { + "required": ["mode", "profile", "artifact", "digest", "graph_generation", "warning_count"] + }, + "allOf": [{ + "if": {"properties": {"mode": {"const": "strict"}}, "required": ["mode"]}, + "then": {"required": ["enforcement_decision", "evaluation_count", "block_count", "warning_count"]} + }] + }, + "graphState": { + "type": "object", + "additionalProperties": false, + "required": ["instance_id", "generation"], + "properties": { + "instance_id": {"type": "string", "minLength": 1}, + "generation": {"type": "integer", "minimum": 0} + } + }, + "controlPlanArtifact": { + "type": "object", + "additionalProperties": false, + "required": ["artifact", "digest"], + "properties": { + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"} + } + }, + "traceBlock": { + "type": "object", + "additionalProperties": true, + "required": ["status"], + "properties": { + "status": {"enum": ["ok", "disabled", "error"]}, + "protocol": {"const": "otlp-json-file"}, + "trace_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"}, + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"}, + "stream": {"$ref": "#/$defs/traceStreamBlock"} + }, + "if": {"properties": {"status": {"const": "ok"}}}, + "then": {"required": ["protocol", "trace_id", "artifact", "digest"]} + }, + "traceStreamBlock": { + "type": "object", + "additionalProperties": true, + "required": ["backend", "protocol", "status", "exported_span_count", "dropped_span_count"], + "properties": { + "backend": {"const": "phoenix"}, + "protocol": {"const": "otlp-http/protobuf"}, + "status": {"enum": ["ok", "error", "unavailable"]}, + "exported_span_count": {"type": "integer", "minimum": 0}, + "dropped_span_count": {"type": "integer", "minimum": 0} + } + }, + "resultBlock": { + "type": "object", + "additionalProperties": true, + "required": ["status"], + "properties": { + "status": {"enum": ["completed", "failed"]}, + "agent_id": {"type": ["string", "null"]}, + "winner": {"type": ["string", "null"]}, + "exit_code": {"type": ["integer", "null"]}, + "duration_seconds": {"type": ["number", "null"]}, + "gate_passed": {"type": ["boolean", "null"]}, + "files_changed_count": {"type": ["integer", "null"], "minimum": 0}, + "artifact": {"$ref": "#/$defs/relativeArtifact"}, + "digest": {"$ref": "#/$defs/digest"}, + "patch_digest": { + "oneOf": [{"$ref": "#/$defs/digest"}, {"type": "null"}] + } + }, + "if": {"properties": {"status": {"const": "completed"}}}, + "then": {"required": ["agent_id", "artifact", "digest"]} + } + } +} diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/00387d34-bf92-4278-ab4b-d4c3be523364/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/00387d34-bf92-4278-ab4b-d4c3be523364/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/00387d34-bf92-4278-ab4b-d4c3be523364/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/00387d34-bf92-4278-ab4b-d4c3be523364/envelope.json new file mode 100644 index 0000000..aa955f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/00387d34-bf92-4278-ab4b-d4c3be523364/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "00387d34-bf92-4278-ab4b-d4c3be523364", "created_at": "2026-11-15T03:22:47.497286+00:00", "finished_at": "2026-11-15T03:22:48.006823+00:00", "strategy": "route", "team": null, "task_id": "704741d1-9d0c-459b-a6b5-76f532f1af66", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.07, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:828d10f991eab6ef70a59e6d6c2d22b52b2e0e1ae50a02b1198ea54eb8a191cc", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/00387d34-bf92-4278-ab4b-d4c3be523364/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/00387d34-bf92-4278-ab4b-d4c3be523364/result.json new file mode 100644 index 0000000..a0896bd --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/00387d34-bf92-4278-ab4b-d4c3be523364/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.07, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/envelope.json new file mode 100644 index 0000000..30a8b48 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "0067368c-a9a7-4053-a8d0-3f83cc18a015", "created_at": "2026-11-15T03:22:52.347858+00:00", "finished_at": "2026-11-15T03:22:57.849063+00:00", "strategy": "route", "team": null, "task_id": "60e9a704-aead-4650-bc12-a98d106a1220", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "ok", "protocol": "otlp-json-file", "trace_id": "ff2f26e9b3a7b9b6f40f10764406c986", "artifact": "trace.otlp.json", "digest": "sha256:600f897eedd74c2de01daa8378be78e09c0fc299ba86dc2b2cb7a92ccce034b1", "stream": {"backend": "phoenix", "protocol": "otlp-http/protobuf", "status": "error", "exported_span_count": 0, "dropped_span_count": 2}}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["phoenix"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/trace.otlp.json new file mode 100644 index 0000000..ca1ffe8 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/0067368c-a9a7-4053-a8d0-3f83cc18a015/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "ff2f26e9b3a7b9b6f40f10764406c986", "spanId": "913beab43d5d5b88", "name": "attempt:codex", "startTimeUnixNano": "1794712972767904000", "endTimeUnixNano": "1794712972787904000", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "0067368c-a9a7-4053-a8d0-3f83cc18a015"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "895336b3bb531ae6"}, {"traceId": "ff2f26e9b3a7b9b6f40f10764406c986", "spanId": "895336b3bb531ae6", "name": "syncmill.run", "startTimeUnixNano": "1794712972663640064", "endTimeUnixNano": "1794712972843643904", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "0067368c-a9a7-4053-a8d0-3f83cc18a015"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/238952d4-3622-43cd-bc68-7f480e241ad9/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/238952d4-3622-43cd-bc68-7f480e241ad9/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/238952d4-3622-43cd-bc68-7f480e241ad9/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/238952d4-3622-43cd-bc68-7f480e241ad9/envelope.json new file mode 100644 index 0000000..90befda --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/238952d4-3622-43cd-bc68-7f480e241ad9/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "238952d4-3622-43cd-bc68-7f480e241ad9", "created_at": "2026-11-15T03:22:58.782665+00:00", "finished_at": "2026-11-15T03:22:59.181974+00:00", "strategy": "route", "team": null, "task_id": "6f3a3792-fd63-4a82-9870-d033049f6ea0", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["breaker"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/238952d4-3622-43cd-bc68-7f480e241ad9/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/238952d4-3622-43cd-bc68-7f480e241ad9/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/238952d4-3622-43cd-bc68-7f480e241ad9/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/28c29e61-9351-4b93-8f3d-85b1688d45f6/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/28c29e61-9351-4b93-8f3d-85b1688d45f6/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/28c29e61-9351-4b93-8f3d-85b1688d45f6/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/28c29e61-9351-4b93-8f3d-85b1688d45f6/envelope.json new file mode 100644 index 0000000..f2f568d --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/28c29e61-9351-4b93-8f3d-85b1688d45f6/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "28c29e61-9351-4b93-8f3d-85b1688d45f6", "created_at": "2026-11-15T03:22:49.570441+00:00", "finished_at": "2026-11-15T03:22:50.025070+00:00", "strategy": "route", "team": null, "task_id": "46addbfb-67f3-45b4-8daa-da2cc8b809c5", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": true, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:8365b12e60409279c196bd9927aff1c83731044f94fb11c8ce4427e4191dd5fe", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/28c29e61-9351-4b93-8f3d-85b1688d45f6/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/28c29e61-9351-4b93-8f3d-85b1688d45f6/result.json new file mode 100644 index 0000000..d9c8514 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/28c29e61-9351-4b93-8f3d-85b1688d45f6/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": "1/1 checks passed", "gate_passed": true, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/3a180f14-d1dd-4344-ab57-7ce09a25bffe/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/3a180f14-d1dd-4344-ab57-7ce09a25bffe/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/3a180f14-d1dd-4344-ab57-7ce09a25bffe/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/3a180f14-d1dd-4344-ab57-7ce09a25bffe/envelope.json new file mode 100644 index 0000000..fcd6814 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/3a180f14-d1dd-4344-ab57-7ce09a25bffe/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "3a180f14-d1dd-4344-ab57-7ce09a25bffe", "created_at": "2026-11-15T03:22:50.291751+00:00", "finished_at": "2026-11-15T03:22:50.641419+00:00", "strategy": "pipeline", "team": null, "task_id": "4c17300b-670c-41f9-9153-1ebeb63e2e9b", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": "codex", "winner": null, "exit_code": 0, "duration_seconds": 0.02, "gate_passed": false, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:435455a718cc82642af9c7fbbf3d1ac25ea0c076d1ef7d9a3ab32dd52fd37b12", "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/3a180f14-d1dd-4344-ab57-7ce09a25bffe/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/3a180f14-d1dd-4344-ab57-7ce09a25bffe/result.json new file mode 100644 index 0000000..41575c5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/3a180f14-d1dd-4344-ab57-7ce09a25bffe/result.json @@ -0,0 +1 @@ +{"status": "failed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": [], "error": "quality gate failed: 0/1 checks passed; failed: false", "gate_summary": "0/1 checks passed; failed: false", "gate_passed": false, "patch": null} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/45c16ae4-3548-4748-a1ec-57c58509bf13/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/45c16ae4-3548-4748-a1ec-57c58509bf13/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/45c16ae4-3548-4748-a1ec-57c58509bf13/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/45c16ae4-3548-4748-a1ec-57c58509bf13/envelope.json new file mode 100644 index 0000000..a9b65ba --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/45c16ae4-3548-4748-a1ec-57c58509bf13/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "45c16ae4-3548-4748-a1ec-57c58509bf13", "created_at": "2026-11-15T03:22:48.933418+00:00", "finished_at": "2026-11-15T03:22:49.300001+00:00", "strategy": "route", "team": null, "task_id": "c9757d1f-891b-4deb-b5ac-4fa3c09116d3", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": "none", "winner": null, "exit_code": -1, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:9059d36c2be1b60372a334557eb5df9b67bb17963a87d474a12bcf09111cb5e0", "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/45c16ae4-3548-4748-a1ec-57c58509bf13/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/45c16ae4-3548-4748-a1ec-57c58509bf13/result.json new file mode 100644 index 0000000..f0460d5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/45c16ae4-3548-4748-a1ec-57c58509bf13/result.json @@ -0,0 +1 @@ +{"status": "failed", "agent_id": "none", "output": "", "exit_code": -1, "duration_seconds": 0.02, "files_changed": [], "error": "All agents failed:\n [codex] codex (fake): refused", "gate_summary": null, "gate_passed": null, "patch": null} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/envelope.json new file mode 100644 index 0000000..2a3b4de --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "52b3660a-9ee5-453c-aab1-c43a28718bda", "created_at": "2026-11-15T03:22:51.670966+00:00", "finished_at": "2026-11-15T03:22:52.086720+00:00", "strategy": "route", "team": null, "task_id": "4e1307ac-48a3-40d6-9027-e6f0bef9df66", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "ok", "protocol": "otlp-json-file", "trace_id": "17b9f95706665d2d1acdb9b0848e42c7", "artifact": "trace.otlp.json", "digest": "sha256:2e4b0d5449f01c172160ad4743ac84006198015007d95e1affe476f48a3661d2"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/trace.otlp.json new file mode 100644 index 0000000..bac5ec7 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/52b3660a-9ee5-453c-aab1-c43a28718bda/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "17b9f95706665d2d1acdb9b0848e42c7", "spanId": "cce305cec884c8b3", "name": "attempt:codex", "startTimeUnixNano": "1794712972010556928", "endTimeUnixNano": "1794712972030556928", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "52b3660a-9ee5-453c-aab1-c43a28718bda"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "12a33707f1b4a1ae"}, {"traceId": "17b9f95706665d2d1acdb9b0848e42c7", "spanId": "12a33707f1b4a1ae", "name": "syncmill.run", "startTimeUnixNano": "1794712971982921984", "endTimeUnixNano": "1794712972086194944", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "52b3660a-9ee5-453c-aab1-c43a28718bda"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/86be507a-5f1a-40a0-a345-9d4d7324c5e1/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/86be507a-5f1a-40a0-a345-9d4d7324c5e1/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/86be507a-5f1a-40a0-a345-9d4d7324c5e1/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/86be507a-5f1a-40a0-a345-9d4d7324c5e1/envelope.json new file mode 100644 index 0000000..87cba4e --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/86be507a-5f1a-40a0-a345-9d4d7324c5e1/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "86be507a-5f1a-40a0-a345-9d4d7324c5e1", "created_at": "2026-11-15T03:22:50.908839+00:00", "finished_at": "2026-11-15T03:22:51.404836+00:00", "strategy": "compete", "team": "pair", "task_id": "6dea95b3-998d-4bdb-8c9d-72f5c16d4e22", "agents": ["codex", "kimi-code"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/86be507a-5f1a-40a0-a345-9d4d7324c5e1/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/86be507a-5f1a-40a0-a345-9d4d7324c5e1/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/86be507a-5f1a-40a0-a345-9d4d7324c5e1/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5/envelope.json new file mode 100644 index 0000000..4931af4 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5", "created_at": "2026-11-15T03:23:06.076554+00:00", "finished_at": "2026-11-15T03:23:06.478317+00:00", "strategy": "route", "team": null, "task_id": "b41cb24f-ada2-408f-b12a-64b35d6e3a92", "agents": ["codex"], "board": {"item_id": "c7a42a96-242e-4437-bd90-be4f7f9dd4ac", "goal": "frozen-goal"}, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/9e44bc3f-a025-48fb-8dc9-19bf1e65d8a5/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/c5c3099d-51a7-4aa2-8496-71efed43a7c5/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/c5c3099d-51a7-4aa2-8496-71efed43a7c5/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/c5c3099d-51a7-4aa2-8496-71efed43a7c5/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/c5c3099d-51a7-4aa2-8496-71efed43a7c5/envelope.json new file mode 100644 index 0000000..78fce7f --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/c5c3099d-51a7-4aa2-8496-71efed43a7c5/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "c5c3099d-51a7-4aa2-8496-71efed43a7c5", "created_at": "2026-11-15T03:23:06.750988+00:00", "finished_at": "2026-11-15T03:23:06.750988+00:00", "strategy": "route", "team": null, "task_id": "a1256348-398a-4b23-be4a-289712160446", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": null, "winner": null, "exit_code": null, "duration_seconds": null, "gate_passed": null, "files_changed_count": null, "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/cf550572-194d-46af-ab86-4dc77446d953/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/cf550572-194d-46af-ab86-4dc77446d953/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/cf550572-194d-46af-ab86-4dc77446d953/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/cf550572-194d-46af-ab86-4dc77446d953/trace.otlp.json new file mode 100644 index 0000000..c354285 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/cf550572-194d-46af-ab86-4dc77446d953/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "355b2caa9052a1705d9db6904366af50", "spanId": "4262c0189a649141", "name": "attempt:codex", "startTimeUnixNano": "1794712985527227904", "endTimeUnixNano": "1794712985547227904", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "cf550572-194d-46af-ab86-4dc77446d953"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "fdeba85acebe69cd"}, {"traceId": "355b2caa9052a1705d9db6904366af50", "spanId": "fdeba85acebe69cd", "name": "syncmill.run", "startTimeUnixNano": "1794712985499386880", "endTimeUnixNano": "1794712985600291072", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "cf550572-194d-46af-ab86-4dc77446d953"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/envelope.json new file mode 100644 index 0000000..595f826 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "d367883b-0cf2-48fa-bf0c-41c8f87f324c", "created_at": "2026-11-15T03:22:59.440478+00:00", "finished_at": "2026-11-15T03:23:04.924470+00:00", "strategy": "route", "team": null, "task_id": "bc4c7b26-3d4e-4c38-b1eb-99a608707a6f", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "ok", "protocol": "otlp-json-file", "trace_id": "67132d73346e9e8503f1cc2b4308bbd3", "artifact": "trace.otlp.json", "digest": "sha256:1e383c330c239ea6d542854ebe5222445ef09a882039324a62dea18dd5639867", "stream": {"backend": "phoenix", "protocol": "otlp-http/protobuf", "status": "error", "exported_span_count": 0, "dropped_span_count": 2}}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["breaker", "phoenix"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/trace.otlp.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/trace.otlp.json new file mode 100644 index 0000000..79ef4cb --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/d367883b-0cf2-48fa-bf0c-41c8f87f324c/trace.otlp.json @@ -0,0 +1 @@ +{"resourceSpans": [{"scopeSpans": [{"spans": [{"traceId": "67132d73346e9e8503f1cc2b4308bbd3", "spanId": "ef6bc3530982d7d3", "name": "attempt:codex", "startTimeUnixNano": "1794712979840969984", "endTimeUnixNano": "1794712979860969984", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "AGENT"}}, {"key": "graph.node.id", "value": {"stringValue": "attempt:codex:0"}}, {"key": "graph.node.parent_id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "d367883b-0cf2-48fa-bf0c-41c8f87f324c"}}, {"key": "syncmill.phase", "value": {"stringValue": "attempt"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "codex"}}, {"key": "syncmill.attempt", "value": {"intValue": "0"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}, {"key": "syncmill.exit_code", "value": {"intValue": "0"}}, {"key": "syncmill.winner", "value": {"boolValue": true}}, {"key": "syncmill.files_changed_count", "value": {"intValue": "1"}}], "parentSpanId": "8e6cb2ccb5d23ef4"}, {"traceId": "67132d73346e9e8503f1cc2b4308bbd3", "spanId": "8e6cb2ccb5d23ef4", "name": "syncmill.run", "startTimeUnixNano": "1794712979740592128", "endTimeUnixNano": "1794712979919429888", "attributes": [{"key": "openinference.span.kind", "value": {"stringValue": "CHAIN"}}, {"key": "graph.node.id", "value": {"stringValue": "run"}}, {"key": "syncmill.schema_version", "value": {"intValue": "1"}}, {"key": "syncmill.run_id", "value": {"stringValue": "d367883b-0cf2-48fa-bf0c-41c8f87f324c"}}, {"key": "syncmill.strategy", "value": {"stringValue": "route"}}, {"key": "syncmill.agent_id", "value": {"stringValue": "supervisor"}}, {"key": "syncmill.status", "value": {"stringValue": "completed"}}]}]}]}]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/e29498f8-33c4-45dc-8789-0899fd62fce5/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/e29498f8-33c4-45dc-8789-0899fd62fce5/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/e29498f8-33c4-45dc-8789-0899fd62fce5/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/e29498f8-33c4-45dc-8789-0899fd62fce5/envelope.json new file mode 100644 index 0000000..d152baf --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/e29498f8-33c4-45dc-8789-0899fd62fce5/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "e29498f8-33c4-45dc-8789-0899fd62fce5", "created_at": "2026-11-15T03:22:48.280213+00:00", "finished_at": "2026-11-15T03:22:48.661139+00:00", "strategy": "route", "team": null, "task_id": "5d428d30-6628-48cb-b628-84b9b6d26bab", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:4a445bcf21d479be2c86f803c4bd651d296b38d8ddc4ae56f5bef57f5f680255", "patch_digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/e29498f8-33c4-45dc-8789-0899fd62fce5/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/e29498f8-33c4-45dc-8789-0899fd62fce5/result.json new file mode 100644 index 0000000..94c1318 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/e29498f8-33c4-45dc-8789-0899fd62fce5/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) nochange.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": [], "error": null, "gate_summary": null, "gate_passed": null, "patch": ""} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/f251ed32-c9a8-4a54-8c96-48e154f24902/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/f251ed32-c9a8-4a54-8c96-48e154f24902/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/f251ed32-c9a8-4a54-8c96-48e154f24902/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/f251ed32-c9a8-4a54-8c96-48e154f24902/envelope.json new file mode 100644 index 0000000..d6c5324 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/f251ed32-c9a8-4a54-8c96-48e154f24902/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "f251ed32-c9a8-4a54-8c96-48e154f24902", "created_at": "2026-11-15T03:22:58.136071+00:00", "finished_at": "2026-11-15T03:22:58.519029+00:00", "strategy": "route", "team": null, "task_id": "2f73bd40-7f11-4e98-9215-fd56d6251c72", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "error"}, "result": {"status": "completed", "agent_id": "codex", "winner": "codex", "exit_code": 0, "duration_seconds": 0.02, "gate_passed": null, "files_changed_count": 1, "artifact": "result.json", "digest": "sha256:ed6406ef70e8e2654213147460991afa8be83eefc62ff0ca2febbcbcf3baaed7", "patch_digest": "sha256:35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba"}, "degraded": ["trace"]} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/f251ed32-c9a8-4a54-8c96-48e154f24902/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/f251ed32-c9a8-4a54-8c96-48e154f24902/result.json new file mode 100644 index 0000000..39965f5 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/f251ed32-c9a8-4a54-8c96-48e154f24902/result.json @@ -0,0 +1 @@ +{"status": "completed", "agent_id": "codex", "output": "codex (fake) fix.", "exit_code": 0, "duration_seconds": 0.02, "files_changed": ["calc.py"], "error": null, "gate_summary": null, "gate_passed": null, "patch": "diff --git a/calc.py b/calc.py\nindex 12ee743..4693ad3 100644\n--- a/calc.py\n+++ b/calc.py\n@@ -1,2 +1,2 @@\n def add(a, b):\n- return a - b\n+ return a + b\n"} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/f5200817-7522-4574-8ed5-8260c9f3bbf3/.syncmill-run-dir b/tests/fixtures/persisted/envelope/v0.3.0/runs/f5200817-7522-4574-8ed5-8260c9f3bbf3/.syncmill-run-dir new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/f5200817-7522-4574-8ed5-8260c9f3bbf3/envelope.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/f5200817-7522-4574-8ed5-8260c9f3bbf3/envelope.json new file mode 100644 index 0000000..86a13ec --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/f5200817-7522-4574-8ed5-8260c9f3bbf3/envelope.json @@ -0,0 +1 @@ +{"schema_version": 1, "kind": "syncmill.run-envelope", "run_id": "f5200817-7522-4574-8ed5-8260c9f3bbf3", "created_at": "2026-11-15T03:23:07.386162+00:00", "finished_at": "2026-11-15T03:23:07.796288+00:00", "strategy": "route", "team": null, "task_id": "fd70f1f9-9246-4b75-b726-e57957c7804f", "agents": ["codex"], "board": null, "preflight": {"status": "disabled"}, "trace": {"status": "disabled"}, "result": {"status": "failed", "agent_id": "none", "winner": null, "exit_code": 1, "duration_seconds": 0.0, "gate_passed": null, "files_changed_count": 0, "artifact": "result.json", "digest": "sha256:b0851087e43974dedee36d9b43eae8215b30a68ef24fa6af047b01fa6231e28b", "patch_digest": null}, "degraded": []} \ No newline at end of file diff --git a/tests/fixtures/persisted/envelope/v0.3.0/runs/f5200817-7522-4574-8ed5-8260c9f3bbf3/result.json b/tests/fixtures/persisted/envelope/v0.3.0/runs/f5200817-7522-4574-8ed5-8260c9f3bbf3/result.json new file mode 100644 index 0000000..17ea991 --- /dev/null +++ b/tests/fixtures/persisted/envelope/v0.3.0/runs/f5200817-7522-4574-8ed5-8260c9f3bbf3/result.json @@ -0,0 +1 @@ +{"status": "failed", "agent_id": "none", "output": "", "exit_code": 1, "duration_seconds": 0.0, "files_changed": [], "error": "orchestration crashed before producing a result", "gate_summary": null, "gate_passed": null, "patch": null} \ No newline at end of file diff --git a/tests/test_frozen_envelope.py b/tests/test_frozen_envelope.py new file mode 100644 index 0000000..2d9e432 --- /dev/null +++ b/tests/test_frozen_envelope.py @@ -0,0 +1,568 @@ +"""Released run-report directories read by HEAD (#271, Run envelope family). + +`tests/fixtures/persisted/envelope//runs/` holds run directories that +v0.1.2, v0.2.0 and v0.3.0 wrote through their own `syncmill run` / `board run` +with report recording on (see `freeze.py` there): `envelope.json`, +`result.json`, `trace.otlp.json` and, from v0.1.3 on, the `.syncmill-run-dir` +sentinel. `index.json` holds what each release's own CLI printed for +`report list` and `report show`, the oracle these tests compare HEAD with. + +The readers: the schema (`contracts/run-envelope.schema.json`, the contract +tracegraph reads), `report.load_envelope` / `list_reports` behind +`report list` / `report show`, the TUI Reports tab, the dashboard REPORT pane, +and retention (`report._is_run_dir` through `RunReporter.start` and the +Supervisor's trace-only sweep), whose misread deletes data or leaks it. + +Preflight blocks appear here only as `disabled`; the released preflight +records are the second part of this family. `trace.otlp.json` is evidence for +the digest and for retention ownership; its meaning is tracegraph's to test. +""" + +from __future__ import annotations + +import asyncio +import hashlib +import json +import os +import shutil +from pathlib import Path + +import jsonschema +import pytest +from click.testing import CliRunner +from textual.widgets import OptionList + +from syncmill.board import Board +from syncmill.cli import cli +from syncmill.config import ReportConfig, SyncmillConfig +from syncmill.dashboard import DashboardApp +from syncmill.models import Task, TaskStatus +from syncmill.report import RUN_DIR_SENTINEL, RunReporter, list_reports, load_envelope +from syncmill.tui import SyncmillTuiApp + +from conftest import FakeAgent, FakeMemory, FakeRegistry +from test_supervisor import _supervisor, patched_worktree # noqa: F401 (fixture) + +FIXTURES = Path(__file__).resolve().parent / "fixtures" / "persisted" / "envelope" +HEAD_SCHEMA = Path(__file__).resolve().parent.parent / "contracts" / "run-envelope.schema.json" +#: Every release frozen here, from the directories on disk: a release added by +#: `freeze.py` is picked up without editing this file. +RELEASES = tuple(sorted(p.parent.name for p in FIXTURES.glob("v*/index.json"))) +SCENARIOS = { + "completed", "nochange", "failed", "gate-pass", "gate-fail", "compete-team", + "traced", "phoenix-error", "trace-error", "breaker-degraded", "multi-degraded", + "trace-only", "board", "killed", "interrupted", +} +#: The one scenario that leaves a run directory without an envelope. +NO_ENVELOPE = "trace-only" + + +def _index(release: str) -> dict: + return json.loads((FIXTURES / release / "index.json").read_text()) + + +def _scenarios(release: str) -> list[str]: + """Every scenario the release froze: SCENARIOS, plus any `completed-N` run + freeze.py added to make name order differ from created_at order.""" + return sorted(_index(release)["scenarios"]) + + +CASES = [(r, s) for r in RELEASES for s in _scenarios(r)] +ENVELOPE_CASES = [(r, s) for r, s in CASES if s != NO_ENVELOPE] + + +def _run_id(release: str, scenario: str) -> str: + return _index(release)["scenarios"][scenario]["run_id"] + + +def _run_dir(release: str, scenario: str) -> Path: + return FIXTURES / release / "runs" / _run_id(release, scenario) + + +def _doc(release: str, scenario: str) -> dict: + return json.loads((_run_dir(release, scenario) / "envelope.json").read_bytes()) + + +def _sha(data: bytes) -> str: + return "sha256:" + hashlib.sha256(data).hexdigest() + + +def _copy_runs(root: Path, *releases: str) -> Path: + root.mkdir(parents=True, exist_ok=True) + for release in releases: + for run_dir in (FIXTURES / release / "runs").iterdir(): + shutil.copytree(run_dir, root / run_dir.name) + return root + + +@pytest.fixture +def report_root(tmp_path, monkeypatch): + """Point the CLI's `[integration.report] runs_dir` at a copy of the fixtures.""" + def make(*releases: str) -> Path: + root = _copy_runs(tmp_path / "reports", *releases) + monkeypatch.setenv("SYNCMILL_INTEGRATION__REPORT__RUNS_DIR", str(root)) + return root + return make + + +# ── the fixtures are what the releases wrote ────────────────────────────── + + +def test_the_frozen_releases_are_all_present(): + # Discovery from disk must not hide a fixture directory that went missing. + assert {"v0.1.2", "v0.2.0", "v0.3.0"} <= set(RELEASES) + + +@pytest.mark.parametrize("release", RELEASES) +def test_every_release_froze_every_scenario(release): + index = _index(release) + assert index["release"] == release.lstrip("v") + # The frozen schema is the release's own file: its git blob id is the one + # freeze.py read from the release tree. + schema = (FIXTURES / release / "run-envelope.schema.json").read_bytes() + blob = hashlib.sha1(b"blob %d\0" % len(schema) + schema).hexdigest() + assert blob == index["schema_blob"] + assert SCENARIOS <= set(index["scenarios"]) + extra = set(index["scenarios"]) - SCENARIOS + assert all(s.startswith("completed-") for s in extra), extra + ids = [entry["run_id"] for entry in index["scenarios"].values()] + assert sorted(ids) == sorted(p.name for p in (FIXTURES / release / "runs").iterdir()) + # Sentinel from v0.1.3 on, for the reporter and the tracer alike. + for scenario in _scenarios(release): + has = (_run_dir(release, scenario) / RUN_DIR_SENTINEL).exists() + assert has is (release != "v0.1.2"), scenario + + +@pytest.mark.parametrize(("release", "scenario"), CASES) +def test_the_fixture_digests_bind_the_stored_sidecars(release, scenario): + """Fixture integrity, not reader coverage: no HEAD reader checks the sidecars.""" + run_dir = _run_dir(release, scenario) + if scenario == NO_ENVELOPE: + assert sorted(p.name for p in run_dir.iterdir() if p.name != RUN_DIR_SENTINEL) == [ + "trace.otlp.json" + ] + return + result = _doc(release, scenario)["result"] + if scenario == "killed": # the skeleton `start` writes; finish never ran + assert "artifact" not in result and "digest" not in result + assert not (run_dir / "result.json").exists() + return + stored = (run_dir / "result.json").read_bytes() + assert result["artifact"] == "result.json" + assert result["digest"] == _sha(stored) + patch = json.loads(stored)["patch"] + expected_patch = None if patch is None else _sha(patch.encode("utf-8", "surrogateescape")) + assert result["patch_digest"] == expected_patch + trace = _doc(release, scenario)["trace"] + if trace.get("status") == "ok": + assert trace["artifact"] == "trace.otlp.json" + assert trace["digest"] == _sha((run_dir / "trace.otlp.json").read_bytes()) + + +# ── the schema ───────────────────────────────────────────────────────────── + + +@pytest.mark.parametrize(("release", "scenario"), ENVELOPE_CASES) +def test_head_schema_accepts_the_released_envelope(release, scenario): + doc = _doc(release, scenario) + # Formats are checked where jsonschema can: `date` and the like always, + # `date-time` only with the optional rfc3339-validator installed. + checker = jsonschema.FormatChecker() + jsonschema.Draft202012Validator( + json.loads(HEAD_SCHEMA.read_text()), format_checker=checker + ).validate(doc) + # And the release's own schema, frozen beside it: the fixture is what it meant. + own = json.loads((FIXTURES / release / "run-envelope.schema.json").read_text()) + jsonschema.Draft202012Validator(own, format_checker=checker).validate(doc) + + +# ── load_envelope / report show / report list ───────────────────────────── + + +@pytest.mark.parametrize(("release", "scenario"), CASES) +def test_load_envelope_returns_the_stored_document(release, scenario, tmp_path): + raw = None + if scenario != NO_ENVELOPE: + raw = json.loads((_run_dir(release, scenario) / "envelope.json").read_bytes()) + root = _copy_runs(tmp_path / "reports", release) + assert load_envelope(root, _run_id(release, scenario)) == raw + + +def _v(value: object) -> str: + return str(value) + + +def _show_lines(doc: dict) -> list[str]: + """`report show` for a stored envelope, from its raw values (the fixtures + hold no control characters, so no escaping is involved).""" + result, trace = doc["result"], doc["trace"] + board = doc["board"] + lines = [ + f"Run: {doc['run_id']}", + f"Created: {doc['created_at']}", + f"Finished: {doc['finished_at']}", + f"Strategy: {doc['strategy']}", + f"Team: {doc['team'] or '—'}", + f"Task: {doc['task_id']}", + f"Agents: {', '.join(doc['agents']) or '—'}", + f"Board: {board['item_id']} (goal: {board['goal']})" if board else "Board: —", + f"Result: {result['status']}" + + (f" ({result['agent_id']})" if result["agent_id"] else ""), + f" winner: {result['winner'] or '—'}", + f" exit code: {_v(result['exit_code'])}", + f" duration: {_v(result['duration_seconds'])}s", + f" gate passed: {_v(result['gate_passed'])}", + f" files changed: {_v(result['files_changed_count'])}", + f" artifact: {result.get('artifact') or '—'}", + f" digest: {result.get('digest') or '—'}", + f" patch digest: {result['patch_digest'] or '—'}", + f"Preflight: {doc['preflight']['status']}", + f"Trace: {trace['status']}", + ] + if "stream" in trace: + stream = trace["stream"] + lines.append( + f" Phoenix stream: {stream['status']} ({stream['exported_span_count']} " + f"exported, {stream['dropped_span_count']} dropped)" + ) + lines.append(f"Degraded: {', '.join(doc['degraded']) or '—'}") + return lines + + +#: What each scenario must show, written from the release's own measurements, +#: so an expectation helper that drifted with the renderer cannot pass alone. +SHOWN = { + "completed": {"Result:": "completed (codex)", "files changed:": "1", "gate passed:": "None"}, + "nochange": {"files changed:": "0", + "patch digest:": _sha(b"")}, + "failed": {"Result:": "failed (none)", "winner:": "—", "exit code:": "-1", + "patch digest:": "—"}, + "gate-pass": {"gate passed:": "True"}, + "gate-fail": {"Result:": "failed (codex)", "gate passed:": "False", "exit code:": "0", + "Strategy:": "pipeline"}, + "compete-team": {"Team:": "pair", "Agents:": "codex, kimi-code", "Strategy:": "compete"}, + "traced": {"Trace:": "ok"}, + "phoenix-error": {"Phoenix stream:": "error (0 exported, 2 dropped)", "Degraded:": "phoenix"}, + "trace-error": {"Trace:": "error", "Degraded:": "trace"}, + "breaker-degraded": {"Degraded:": "breaker"}, + "multi-degraded": {"Degraded:": "breaker, phoenix"}, + "board": {"Board:": None}, # checked against the item id below + "killed": {"Result:": "failed", "exit code:": "None", "duration:": "Nones", + "artifact:": "—", "digest:": "—"}, + "interrupted": {"Result:": "failed (none)", "exit code:": "1", "duration:": "0.0s"}, +} + + +def _field(stdout: str, label: str) -> str: + matches = [line for line in stdout.splitlines() if line.strip().startswith(label)] + assert len(matches) == 1, (label, matches) + return matches[0].strip()[len(label):].strip() + + +@pytest.mark.parametrize(("release", "scenario"), ENVELOPE_CASES) +def test_report_show_renders_the_released_envelope(release, scenario, report_root): + report_root(release) + run_id = _run_id(release, scenario) + done = CliRunner().invoke(cli, ["report", "show", run_id]) + assert done.exit_code == 0, done.output + release_show = _index(release)["scenarios"][scenario]["report_show"] + assert release_show["returncode"] == 0 + # The release's own `report show` of the same bytes: no field changed meaning. + assert done.stdout == release_show["stdout"] + assert done.stdout.splitlines() == _show_lines(_doc(release, scenario)) + shown = SHOWN["completed"] if scenario.startswith("completed-") else SHOWN[scenario] + for label, value in shown.items(): + if scenario == "board": + board = _doc(release, scenario)["board"] + assert board["goal"] == "frozen-goal" + value = f"{board['item_id']} (goal: frozen-goal)" + assert _field(done.stdout, label) == value, label + + +@pytest.mark.parametrize("release", RELEASES) +def test_report_show_refuses_a_run_dir_without_an_envelope(release, report_root): + root = report_root(release) + run_id = _run_id(release, NO_ENVELOPE) + done = CliRunner().invoke(cli, ["report", "show", run_id]) + release_show = _index(release)["scenarios"][NO_ENVELOPE]["report_show"] + assert (done.exit_code, release_show["returncode"]) == (1, 1) + assert done.stdout == release_show["stdout"] == "" + # The message names the configured reports root, which differs per machine. + assert done.stderr == release_show["stderr"].replace(_index(release)["runs_dir"], str(root)) + assert done.stderr == f"Error: no report found for run {run_id!r} under {root}\n" + + +def _with_long_run(root: Path) -> list[dict]: + """Add a test-made long run to `root`; return every report newest first. + + Every released run started and finished before the next began, so + created_at and finished_at order agree on them. This one (a released + envelope started before all of them and finished after all of them) tells + the two orders apart: newest first means by created_at, so it comes last.""" + released = _newest_first(*RELEASES) + long_run = {**_doc("v0.1.2", "completed"), "run_id": "probe-long-run", + "created_at": "2026-01-01T00:00:00+00:00", + "finished_at": "2099-01-01T00:00:00+00:00"} + assert long_run["created_at"] < min(d["created_at"] for d in released) + assert long_run["finished_at"] > max(d["finished_at"] for d in released) + (root / "probe-long-run").mkdir() + (root / "probe-long-run" / "envelope.json").write_text(json.dumps(long_run)) + return [*released, long_run] + + +def _newest_first(*releases: str) -> list[dict]: + docs = [ + _doc(r, s) for r in releases for s in _scenarios(r) if s != NO_ENVELOPE + ] + return sorted(docs, key=lambda d: d["created_at"], reverse=True) + + +def _list_row(doc: dict) -> str: + r = doc["result"] + return (f" {doc['run_id']} {doc['created_at']} {doc['strategy']} " + f"{r['status']} {r['agent_id'] or '—'}") + + +@pytest.mark.parametrize("release", RELEASES) +def test_report_list_matches_the_release_listing(release, report_root): + report_root(release) + done = CliRunner().invoke(cli, ["report", "list"]) + assert done.exit_code == 0, done.output + assert done.stdout == _index(release)["report_list"] + rows = [line for line in done.stdout.splitlines() if line.startswith(" ")] + assert rows == [_list_row(d) for d in _newest_first(release)] + # Name order is not the answer: a listing that skipped the sort would differ. + names = sorted(d["run_id"] for d in _newest_first(release)) + assert [d["run_id"] for d in _newest_first(release)] not in (names, names[::-1]) + + +def test_report_list_orders_every_release_and_skips_foreign_entries(report_root): + root = report_root(*RELEASES) + (root / "not-a-run").mkdir() + (root / "not-a-run" / "notes.txt").write_text("someone else's\n") + (root / "torn").mkdir() + (root / "torn" / "envelope.json").write_text('{"run_id": "torn"') + (root / "stray.json").write_text("{}") + expected = _with_long_run(root) + done = CliRunner().invoke(cli, ["report", "list"]) + assert done.exit_code == 0, done.output + rows = [line for line in done.stdout.splitlines() if line.startswith(" ")] + assert rows == [_list_row(d) for d in expected] + assert [d["run_id"] for d in list_reports(root)] == [d["run_id"] for d in expected] + + +# ── the TUI Reports tab and the dashboard REPORT pane ───────────────────── + + +def _shown(screen, selector: str) -> str: + """What the widget displays (not the app's cache of what it last sent).""" + return str(screen.query_one(selector).render()) + + +async def _settle(pilot, ready, *, tries: int = 200) -> None: + for _ in range(tries): + await pilot.pause(0) + if ready(): + return + raise AssertionError("the UI never reached the expected state") + + +def _prompts(options: OptionList) -> list[str]: + return [str(options.get_option_at_index(i).prompt) for i in range(options.option_count)] + + +def _release_show(doc: dict) -> str: + """The release's own `report show` text; for the test-made long run, its + fields from the raw values.""" + for release in RELEASES: + for scenario, entry in _index(release)["scenarios"].items(): + if entry["run_id"] == doc["run_id"]: + return entry["report_show"]["stdout"].rstrip("\n") + assert doc["run_id"] == "probe-long-run" + return "\n".join(_show_lines(doc)) + + +def test_tui_reports_tab_shows_every_released_run(report_root, tmp_path): + root = report_root(*RELEASES) + expected = _with_long_run(root) + + async def scenario(): + app = SyncmillTuiApp( + SyncmillConfig(board={"enabled": False}, + tui={"state_dir": str(tmp_path / "jobs")}, + integration={"report": {"runs_dir": str(root)}}), + board=None, board_error=None, toml_path=tmp_path / "syncmill.toml", + refresh_seconds=3600, initial_tab="reports", + ) + async with app.run_test() as pilot: + options = app.query_one("#report-list", OptionList) + await _settle(pilot, lambda: options.option_count == len(expected)) + assert _prompts(options) == [ + f"{d['run_id']} {d['strategy']} {d['result']['status']}" for d in expected + ] + for row, doc in enumerate(expected): + options.highlighted = row + want = _release_show(doc) + await _settle(pilot, lambda: _shown(app, "#report-detail") == want) + + asyncio.run(scenario()) + + +class _Clock: + def __init__(self) -> None: + self.now = 1_800_000_000.0 + + def __call__(self) -> float: + return self.now + + +def test_dashboard_report_pane_shows_every_released_run(report_root, tmp_path): + root = report_root(*RELEASES) + expected = _with_long_run(root) + board = Board(str(tmp_path / "board.db"), now=_Clock()) + + async def scenario(): + app = DashboardApp( + board, refresh_seconds=3600, now=_Clock(), + config=SyncmillConfig(integration={"report": {"runs_dir": str(root)}}), + ) + async with app.run_test() as pilot: + await pilot.pause() + await pilot.press("p") + await _settle(pilot, lambda: app.screen.query("#report-list")) + options = app.screen.query_one("#report-list", OptionList) + await _settle(pilot, lambda: options.option_count == len(expected)) + assert _prompts(options) == [ + f"{d['run_id']} {d['created_at']} {d['strategy']} " + f"{d['result']['status']} {d['result']['agent_id'] or '—'}" + for d in expected + ] + for row, doc in enumerate(expected): + options.highlighted = row + want = _release_show(doc) + await _settle(pilot, lambda: _shown(app.screen, "#report-detail") == want) + + try: + asyncio.run(scenario()) + finally: + board.close() + + +# ── retention ownership over released run dirs ───────────────────────────── + + +CURRENT = "current-run" +KEEP_LAST = 10 +MARKER = "kept-by-the-current-run" +MARKER_BYTES = b"written before the sweep\n" + + +def _variant(root: Path, name: str, doc: object) -> None: + """A test-made directory holding a changed copy of a released envelope.""" + (root / name).mkdir() + (root / name / "envelope.json").write_text(json.dumps(doc)) + + +def _retention_root(root: Path) -> tuple[set[str], set[str]]: + """Seed `root` with every released run dir plus labelled ownership probes. + Returns (owned, not_owned) directory names. Each probe breaks ONE predicate + of `_is_run_dir`; the owned probe shows the probe-making keeps ownership.""" + _copy_runs(root, *RELEASES) + owned = { + _run_id(r, s) for r in RELEASES for s in _scenarios(r) + if not (r == "v0.1.2" and s == NO_ENVELOPE) + } + # v0.1.2 wrote no sentinel and a trace-only run writes no envelope: nothing + # proves the directory is syncmill's, so HEAD never removes it. + not_owned = {_run_id("v0.1.2", NO_ENVELOPE)} + + released = _doc("v0.1.2", "completed") + _variant(root, "probe-owned", {**released, "run_id": "probe-owned"}) + owned.add("probe-owned") + _variant(root, "probe-renamed", released) # run_id names another directory + _variant(root, "probe-kind-changed", + {**released, "run_id": "probe-kind-changed", "kind": "someone.else"}) + _variant(root, "probe-kind-removed", + {k: v for k, v in {**released, "run_id": "probe-kind-removed"}.items() if k != "kind"}) + _variant(root, "probe-not-object", [released]) + (root / "probe-torn").mkdir() + (root / "probe-torn" / "envelope.json").write_text( + json.dumps({**released, "run_id": "probe-torn"})[:-1] + ) + (root / "probe-foreign").mkdir() + shutil.copyfile(_run_dir("v0.1.2", "completed") / "result.json", + root / "probe-foreign" / "result.json") + not_owned |= {"probe-renamed", "probe-kind-changed", "probe-kind-removed", + "probe-not-object", "probe-torn", "probe-foreign"} + + # The current run exists already and is the OLDEST: it must survive anyway. + # It holds a marker, so a sweep that removed it and a writer that then + # recreated it cannot pass for one that left it alone. + (root / CURRENT).mkdir() + (root / CURRENT / RUN_DIR_SENTINEL).write_text("") + (root / CURRENT / MARKER).write_bytes(MARKER_BYTES) + # Distinct, explicit mtimes in an order unrelated to names or releases, so + # owned and foreign directories interleave around the retention cutoff. + names = sorted(p.name for p in root.iterdir() if p.name != CURRENT) + names.sort(key=lambda n: hashlib.sha256(n.encode()).hexdigest()) + base = 1_700_000_000 + os.utime(root / CURRENT, (base, base)) + for i, name in enumerate(names, start=1): + os.utime(root / name, (base + i, base + i)) + assert set(names) == owned | not_owned + return owned, not_owned + + +def _survivors(root: Path, owned: set[str], not_owned: set[str]) -> set[str]: + newest_owned = sorted(owned, key=lambda n: (root / n).stat().st_mtime, reverse=True) + kept = set(newest_owned[: KEEP_LAST - 1]) + # The cutoff must fall inside the owned set, with foreign dirs on both sides. + assert len(owned) > KEEP_LAST + order = sorted(owned | not_owned, key=lambda n: (root / n).stat().st_mtime) + first_kept = min(order.index(n) for n in kept) + assert any(order.index(n) > first_kept for n in not_owned) + assert any(order.index(n) < first_kept for n in not_owned) + return kept | not_owned | {CURRENT} + + +def test_run_reporter_retention_owns_released_dirs_only(tmp_path): + root = tmp_path / "reports" + owned, not_owned = _retention_root(root) + expected = _survivors(root, owned, not_owned) + reporter = RunReporter(ReportConfig(enabled=True, runs_dir=str(root), keep_last=KEEP_LAST)) + reporter.start(run_id=CURRENT, task_id="t", strategy="route", team=None, agents=["codex"]) + assert not reporter.degraded + assert {p.name for p in root.iterdir()} == expected + assert (root / CURRENT / MARKER).read_bytes() == MARKER_BYTES + + +def _trace_only(tmp_path, root: Path, trace_dir: str): + config = SyncmillConfig(integration={ + "report": {"enabled": False, "runs_dir": str(root), "keep_last": KEEP_LAST}, + "trace": {"enabled": True, "dir": trace_dir}, + }) + return _supervisor(FakeRegistry([FakeAgent("claude")]), FakeMemory(), config=config) + + +def test_supervisor_trace_only_sweep_owns_released_dirs_only(patched_worktree, tmp_path): # noqa: F811 + root = tmp_path / "reports" + owned, not_owned = _retention_root(root) + expected = _survivors(root, owned, not_owned) + result = _trace_only(tmp_path, root, "").run(Task(prompt="go"), run_id=CURRENT) + assert result.status is TaskStatus.COMPLETED + assert {p.name for p in root.iterdir()} == expected + assert (root / CURRENT / "trace.otlp.json").exists() + assert (root / CURRENT / MARKER).read_bytes() == MARKER_BYTES + + +def test_supervisor_never_sweeps_a_custom_trace_dir(patched_worktree, tmp_path): # noqa: F811 + # Both settings name the seeded root: a sweep that ignored the custom + # trace.dir would prune report.runs_dir, which is this same directory. + root = tmp_path / "reports" + _retention_root(root) + before = {p.name for p in root.iterdir()} + result = _trace_only(tmp_path, root, str(root)).run(Task(prompt="go"), run_id=CURRENT) + assert result.status is TaskStatus.COMPLETED + assert {p.name for p in root.iterdir()} == before + assert (root / CURRENT / "trace.otlp.json").exists() + assert (root / CURRENT / MARKER).read_bytes() == MARKER_BYTES