{"type": "meta", "schema": "session-state/v1", "slug": "autonomy-p2a-state-core", "topic": "P2 first half — journal v2 (I2), single-writer state V6, runner split V7, intent log I3, land exactly-once I4 journal side, structured fatal stderr", "created": "2026-07-08", "exec_mode": "ship", "scheduler": "sequential", "land_mode": "merge-to-main", "base_branch": "main", "gate0_mode": "strict", "depends_on": ["autonomy-p1-foundations"], "status_enum": ["BLOCKED", "PENDING", "WORKING", "WRITTEN", "REVIEWED", "COMMITTED"], "truth_rule": "this file is ground truth for INTENT (goals/task list); git is ground truth for DONE-NESS — reconcile statuses against git, never trust a COMMITTED line with no commit", "report_rule": "at session end emit brief: done / blocked / deferred / canceled"}
{"type": "goal", "text": "trustworthy state substrate: self-verifying recoverable journal, one writer, modular engine, write-ahead intents, exactly-once land — resolver and daemon build on this"}
{"type": "anchor", "path": "spec/JOURNAL-V2.md", "what": "canonical spec for Tasks 1-4, 7 — implement per spec, plan only sequences"}
{"type": "anchor", "path": "spec/IMPLEMENTER-NOTES.md", "what": "READ FIRST — esp. cross-spec invariants + LLM failure-mode self-checks"}
{"type": "anchor", "path": "docs/plans/2026-07-08-autonomy-p2a-state-core.md", "what": "plan — pinned per-task contracts (### Task N)"}
{"type": "task", "id": "w1.t1", "wave": 1, "phase": 2, "seat": "coder", "tier": "high", "desc": "src/state/journal.js per spec/JOURNAL-V2.md (SQLite via node:sqlite, amended 2026-07-09): schema+triggers, API, open checks (integrity/version-skew fail-closed), v1 migration; spec tests 1-5 (plan Task 1)", "status": "PENDING", "deps": [], "requires_decision": null, "files": ["src/state/journal.js", "src/state/journal.test.js"], "blocker": null}
{"type": "task", "id": "w1.t2", "wave": 1, "phase": 2, "seat": "coder", "tier": "high", "desc": "src/state/lock.js (hardlink + pid/pidStartTime staleness) + src/state/liveness.js (port lib/liveness semantics + pgid/pidStartTime) per spec module layout (plan Task 2)", "status": "PENDING", "deps": [], "requires_decision": null, "files": ["src/state/lock.js", "src/state/lock.test.js", "src/state/liveness.js", "src/state/liveness.test.js"], "blocker": null}
{"type": "task", "id": "w2.t1", "wave": 2, "phase": 2, "seat": "coder", "tier": "medium", "desc": "src/state/cli.js (incl. journal-export) + lib/journal.sh and lib/liveness write-paths → ≤10-line exec shims; test-journal.sh asserts via journal-export, liveness tests UNMODIFIED (plan Task 3)", "status": "PENDING", "deps": ["w1.t1", "w1.t2"], "requires_decision": null, "files": ["src/state/cli.js", "lib/journal.sh", "lib/liveness"], "blocker": "waiting on wave 1"}
{"type": "task", "id": "w2.t2", "wave": 2, "phase": 2, "seat": "coder", "tier": "high", "desc": "src/state/intents.js: intent.start/done/swept, deterministic keys, redrive|rollback registry, unknown op fail-closed (plan Task 4)", "status": "PENDING", "deps": ["w1.t1"], "requires_decision": null, "files": ["src/state/intents.js", "src/state/intents.test.js"], "blocker": "waiting on w1.t1"}
{"type": "task", "id": "w3.t1", "wave": 3, "phase": 2, "seat": "coder", "tier": "high", "desc": "V7 split part 1: extract src/engine/scheduler.js + src/engine/lease.js from runner.js — moves only, zero behavior change, re-exports preserved, one module per commit (plan Task 5)", "status": "PENDING", "deps": [], "requires_decision": null, "files": ["src/runner.js", "src/engine/scheduler.js", "src/engine/lease.js"], "blocker": null}
{"type": "task", "id": "w4.t1", "wave": 4, "phase": 2, "seat": "coder", "tier": "high", "desc": "V7 split part 2: extract src/engine/gates.js, repair.js, ship.js; runner.js → wiring+CLI only; same pure-move rules (plan Task 6)", "status": "PENDING", "deps": ["w3.t1"], "requires_decision": null, "files": ["src/runner.js", "src/engine/gates.js", "src/engine/repair.js", "src/engine/ship.js"], "blocker": "waiting on w3.t1"}
{"type": "task", "id": "w5.t1", "wave": 5, "phase": 2, "seat": "coder", "tier": "high", "desc": "engine on v2 single-writer (migrate-on-open), run.done into slug journal, land.intent/land.done exactly-once per spec, structured fatal stderr JSON last line (plan Task 7)", "status": "PENDING", "deps": ["w2.t1", "w2.t2", "w4.t1"], "requires_decision": null, "files": ["src/runner.js", "src/engine/ship.js"], "blocker": "waiting on w4.t1"}
{"type": "task", "id": "w6.t1", "wave": 6, "phase": 2, "seat": "coder", "tier": "low", "desc": "ungate P2-state chaos assertions (journal integrity C9 SQLite form, kill matrix core+land-intent, concurrency suite) per spec/CHAOS-SUITE.md phase map (plan Task 8)", "status": "PENDING", "deps": ["w5.t1"], "requires_decision": null, "files": ["test/chaos/scenarios/"], "blocker": "waiting on w5.t1"}
