Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/architecture/persisted-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ A golden over the current writer does not protect these. A reader can stop accep
|---|---|---|---|
| Artifacts | run `manifest.json`, `result.json`, `winner.patch`, apply receipts (`applications/*.json`), in every state a standalone `run` leaves them (room-, session- and workflow-origin artifacts are frozen with those families) | `runs list` / `show` / `prune`, `conversations list` / `show`, `diff`, `apply`, `recover` (`_bound_receipt`), `continue`, the TUI artifact view | `test_frozen_artifacts.py` (v0.1.2, v0.3.0) |
| Rooms | the room database (`rooms.sqlite3`, with the WAL a killed process leaves): rooms, rounds, candidates, members, workspaces, events, `sessions_json`, `selection_json` v1, `provenance_json` v1/v2, `conversation_json` v1; candidate `manifest.json`, patch and output; room-bound run artifacts. No release wrote `conversation_json` v2 or judgment rows | `room list` / `rounds` / `show` / `candidates` / `diff` / `compare` / `export`, `select`, `apply`, `judge`, `recover`, `close`, `prune` `RoomStore.member_sessions` (and through these `RoomCandidateStore.load`, `_parse_sessions_json`, `selection_record_status`, `room_outcome_status`, `round_provenance_status`, `round_conversation_status`); the standalone `apply` / `recover` refusal and skip for room-bound artifacts; a HEAD `room round` on a released room (`branch-from` resuming the released sessions on the released base patch, `fresh`, a first round on a draft, and the `continue-own` refusal when the released workspaces are gone); `room attach` over the released member log paths (tmux faked); the `apply --verify` settings notices; raw export (`--include` preview and confirm); the TUI Rooms tab's readers and pure renders (`build_room_evidence`, `render_room`, `render_round_table`, and the Diff, Output and Details views), not the Textual app | `test_frozen_rooms.py` (v0.1.2, v0.2.0, v0.3.0) |
| Workflows | stored `spec_json`, manifest `schema_version` 1 and 3 with accounting, node `result.json` and `commit.json`; workflow-origin run artifacts (v0.2.0 on) | `WorkflowStore.load`, bundle verification; for workflow-origin artifacts, the approval check at `apply` | not yet |
| Workflows | the workflow database (`workflows.db`): rows with `spec_json`, manifest `schema_version` 3 with `calls_used`, events, and from v0.3.0 the lineage columns and `file`/`revision` origins; per workflow `spec.json`, planner output, node bundles (`result.json`, `winner.patch`, `commit.json` v3) and stream logs; workflow-origin run artifacts, approved or not, with `plan.final_agent` from v0.3.0. No release wrote manifest v1 or v2 (both normalize to v3 before the insert); those readers stay covered by `test_workflow_durable.py::test_marked_v1_migration_preserves_exact_count_and_control_fields` and `test_workflow.py::test_a_workflow_whose_call_accounting_is_ambiguous_is_refused` | `workflow list` / `show` (`--prompts`) / `status` / `logs` / `lineage` / `export` / `cancel` / `prune`, a dead release-written lease recovered by `show` and `status`, `WorkflowStore.events` and `read_node_bundle`; for the final artifact `diff`, `runs show`, `apply` (approved, after a prune, approval healed from the database, refused for a workflow that never completed, `no_changes`), the standalone `recover` skip. A final artifact naming another run, and an unreadable store: `test_cli.py::test_apply_refuses_an_artifact_the_named_workflow_did_not_finalize` and `test_apply_guard_fails_closed_when_the_workflow_store_cannot_be_read`. Not yet: a HEAD `run` or `resume` of a released workflow, `apply --verify` environment narrowing, control-plan (toolgraph) workflows, recovery of an interrupted workflow-origin apply | `test_frozen_workflows.py` (v0.2.0, v0.3.0), partly |
| Sessions and project | isolated-session documents and their checkpoint run artifacts, project marker `.syncmill/project.json` | `IsolatedSessionStore.load` / `list`, `_marker_project_id`; the artifact readers for checkpoint runs | not yet |
| Board | item rows and their evidence and inputs, decisions | `_row_to_item`, `_load_evidence`, `_row_to_decision` | not yet |
| Memory backends | Mem0 and LangGraph stored payloads | the backends' read paths | not yet |
Expand Down
473 changes: 473 additions & 0 deletions tests/fixtures/persisted/workflows/freeze.py

Large diffs are not rendered by default.

208 changes: 208 additions & 0 deletions tests/fixtures/persisted/workflows/v0.2.0/bindings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
{
"release": "0.2.0",
"box_root": "/private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpis4bisz9",
"hostname": "frozen-host",
"tree": {
"calc.py": "def add(a, b):\n return a - b\n"
},
"spec": {
"schema_version": 1,
"goal": "fix add",
"final_node": "fix",
"nodes": [
{
"id": "draft",
"agent": "codex",
"prompt": "draft the fix"
},
{
"id": "fix",
"agent": "kimi-code",
"prompt": "apply the fix",
"needs": [
"draft"
]
}
]
},
"scenarios": {
"planned": {
"project_id": "frozen-workflows-planned",
"workflow_ids": [
"wf-5dae0f0d596348b5"
],
"states": {
"wf-5dae0f0d596348b5": "planned"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [],
"final_run_ids": [],
"run_artifacts": [],
"wal": []
},
"completed": {
"project_id": "frozen-workflows-completed",
"workflow_ids": [
"wf-55da1c5cde7b4e47"
],
"states": {
"wf-55da1c5cde7b4e47": "completed"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [],
"final_run_ids": [
"wf-55da1c5cde7b4e47-final"
],
"run_artifacts": [
"wf-55da1c5cde7b4e47-final"
],
"wal": []
},
"no-changes": {
"project_id": "frozen-workflows-no-changes",
"workflow_ids": [
"wf-cde618c312b34866"
],
"states": {
"wf-cde618c312b34866": "completed"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [],
"final_run_ids": [
"wf-cde618c312b34866-final"
],
"run_artifacts": [
"wf-cde618c312b34866-final"
],
"wal": []
},
"gate-failed": {
"project_id": "frozen-workflows-gate-failed",
"workflow_ids": [
"wf-62a8b48d99e44279"
],
"states": {
"wf-62a8b48d99e44279": "failed"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [],
"final_run_ids": [],
"run_artifacts": [],
"wal": []
},
"failed": {
"project_id": "frozen-workflows-failed",
"workflow_ids": [
"wf-d99be4e0722d412f"
],
"states": {
"wf-d99be4e0722d412f": "failed"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [],
"final_run_ids": [],
"run_artifacts": [],
"wal": []
},
"cancelled": {
"project_id": "frozen-workflows-cancelled",
"workflow_ids": [
"wf-fa435cefbe524d19"
],
"states": {
"wf-fa435cefbe524d19": "cancelled"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [],
"final_run_ids": [],
"run_artifacts": [],
"wal": []
},
"running": {
"project_id": "frozen-workflows-running",
"workflow_ids": [
"wf-a5e80d4b34c1400b"
],
"states": {
"wf-a5e80d4b34c1400b": "running"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [
"46320@frozen-host"
],
"final_run_ids": [],
"run_artifacts": [],
"wal": []
},
"recovery-required": {
"project_id": "frozen-workflows-running",
"workflow_ids": [
"wf-a5e80d4b34c1400b"
],
"states": {
"wf-a5e80d4b34c1400b": "recovery_required"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [],
"final_run_ids": [],
"run_artifacts": [],
"wal": []
},
"unapproved-completed": {
"project_id": "frozen-workflows-unapproved-completed",
"workflow_ids": [
"wf-10ba8b77464248b9"
],
"states": {
"wf-10ba8b77464248b9": "completed"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [],
"final_run_ids": [
"wf-10ba8b77464248b9-final"
],
"run_artifacts": [
"wf-10ba8b77464248b9-final"
],
"wal": []
},
"unapproved-running": {
"project_id": "frozen-workflows-unapproved-running",
"workflow_ids": [
"wf-21ef6ff85c3a4fb9"
],
"states": {
"wf-21ef6ff85c3a4fb9": "running"
},
"source_fingerprints": [
"8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef"
],
"lease_owners": [
"46553@frozen-host"
],
"final_run_ids": [],
"run_artifacts": [
"wf-21ef6ff85c3a4fb9-final"
],
"wal": []
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"schema_version": 1, "goal": "fix add", "final_node": "fix", "nodes": [{"id": "draft", "agent": "codex", "prompt": "draft the fix"}, {"id": "fix", "agent": "kimi-code", "prompt": "apply the fix", "needs": ["draft"]}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"schema_version": 1,
"goal": "fix add",
"nodes": [
{
"id": "draft",
"agent": "codex",
"prompt": "draft the fix",
"needs": [],
"timeout_seconds": null,
"max_attempts": 1
},
{
"id": "fix",
"agent": "kimi-code",
"prompt": "apply the fix",
"needs": [
"draft"
],
"timeout_seconds": null,
"max_attempts": 1
}
],
"final_node": "fix"
}
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"schema_version": 1,
"run_id": "wf-55da1c5cde7b4e47-final",
"project_id": "frozen-workflows-completed",
"parent_run_id": null,
"created_at": "2026-11-09T10:19:42.848946+00:00",
"updated_at": "2026-11-09T10:19:42.859356+00:00",
"state": "pending",
"repo_root": "/private/var/folders/4n/mt3km5rs1bn_b0w_d6hvlmhc0000gn/T/tmpis4bisz9/repo",
"source_fingerprint": "8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef",
"snapshot_commit": "40c213304d825b5d2698d0f0e0d1869a1d8104a4",
"task_id": "04da33b2-3bb3-4b0b-aaec-903436986d12",
"prompt": "fix add",
"strategy": "route",
"agents": [
"kimi-code"
],
"plan": {
"origin": "workflow",
"workflow_id": "wf-55da1c5cde7b4e47",
"node_id": "fix",
"spec_sha256": "977294d3defa4f3167fefdc2a3c8150025d683c5e39bb848336df5919c134283",
"source_fingerprint": "8146c9e064aa8eab7389bfeebf6ecc7d9f12a5de5cada8818dcbff8a9a288bef",
"bundle_sha256": "065e692b354df002d41777b3d7641e79578ecaf3fe701ab159a6eb075ea61978",
"patch_sha256": "35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba",
"approved": {
"workflow_id": "wf-55da1c5cde7b4e47",
"run_id": "wf-55da1c5cde7b4e47-final",
"patch_sha256": "35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba",
"approved_at": "2026-11-09T10:19:42.859351+00:00"
}
},
"agent_id": "kimi-code",
"files_changed": [
"calc.py"
],
"patch_sha256": "35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba",
"patch_bytes": 157,
"provider_session_id": null,
"conversation_id": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"status": "completed",
"output": "kimi (fake) fix.",
"error": null,
"exit_code": 0,
"duration_seconds": 0.08
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
diff --git a/calc.py b/calc.py
index 12ee743..4693ad3 100644
--- a/calc.py
+++ b/calc.py
@@ -1,2 +1,2 @@
def add(a, b):
- return a - b
+ return a + b
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"schema_version": 3, "workflow_id": "wf-55da1c5cde7b4e47", "node_id": "draft", "lease_id": "bd2ffa83a02640f1bb53cfe54fb73729", "attempt": 1, "spec_sha256": "977294d3defa4f3167fefdc2a3c8150025d683c5e39bb848336df5919c134283", "bundle_sha256": "c3d36f0c37e02e76fa308f3845bb482a30b7f32722cead55f4daec19378110e3"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"status": "completed",
"agent_id": "codex",
"output": "codex (fake) fix.",
"error": null,
"exit_code": 0,
"duration_seconds": 0.02,
"files_changed": [
"calc.py"
],
"gate": null,
"patch_sha256": "35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba",
"patch_bytes": 157,
"bundle_version": 3,
"workflow_id": "wf-55da1c5cde7b4e47",
"node_id": "draft",
"lease_id": "bd2ffa83a02640f1bb53cfe54fb73729",
"attempt": 1,
"spec_sha256": "977294d3defa4f3167fefdc2a3c8150025d683c5e39bb848336df5919c134283",
"usage": {
"total_input_tokens": 1,
"output_tokens": 1,
"cache_read_tokens": 0,
"cache_creation_tokens": null,
"total_cost_usd": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
diff --git a/calc.py b/calc.py
index 12ee743..4693ad3 100644
--- a/calc.py
+++ b/calc.py
@@ -1,2 +1,2 @@
def add(a, b):
- return a - b
+ return a + b
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"type": "thread.started", "thread_id": "fake-codex-thread"}
{"type": "item.completed", "item": {"type": "agent_message", "text": "codex (fake) fix."}}
{"type": "turn.completed", "usage": {"input_tokens": 1, "output_tokens": 1}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"schema_version": 3, "workflow_id": "wf-55da1c5cde7b4e47", "node_id": "fix", "lease_id": "bd2ffa83a02640f1bb53cfe54fb73729", "attempt": 1, "spec_sha256": "977294d3defa4f3167fefdc2a3c8150025d683c5e39bb848336df5919c134283", "bundle_sha256": "065e692b354df002d41777b3d7641e79578ecaf3fe701ab159a6eb075ea61978"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"status": "completed",
"agent_id": "kimi-code",
"output": "kimi (fake) fix.",
"error": null,
"exit_code": 0,
"duration_seconds": 0.08,
"files_changed": [
"calc.py"
],
"gate": {
"passed": true,
"score": 1.0,
"checks": [
{
"command": "python3 -c \"from calc import add; assert add(2, 3) == 5\"",
"passed": true,
"exit_code": 0,
"output": "",
"duration_seconds": 0.02
}
]
},
"patch_sha256": "35dc711418e60edc7974186bd853c7ab08db843f16e43066417b07a53d8566ba",
"patch_bytes": 157,
"bundle_version": 3,
"workflow_id": "wf-55da1c5cde7b4e47",
"node_id": "fix",
"lease_id": "bd2ffa83a02640f1bb53cfe54fb73729",
"attempt": 1,
"spec_sha256": "977294d3defa4f3167fefdc2a3c8150025d683c5e39bb848336df5919c134283",
"usage": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
diff --git a/calc.py b/calc.py
index 12ee743..4693ad3 100644
--- a/calc.py
+++ b/calc.py
@@ -1,2 +1,2 @@
def add(a, b):
- return a - b
+ return a + b
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"role": "assistant", "content": "kimi (fake) fix."}
{"role": "meta", "type": "session.resume_hint", "session_id": "fake-kimi-session", "content": "To resume this session: kimi -r fake-kimi-session"}
Loading
Loading