Implement A9 state-change logging in the state store
CI / checks (push) Successful in 9s
CI / checks (pull_request) Successful in 8s

Retrofit for the conventions merged in #4 (issue #3):

- OpLog: JSON-lines emitter with the fixed envelope (ts, agent,
  event, task_id, cause); task_id set by the orchestrator at
  unit-of-work start
- StateStore owns emission: transition, intent begin/commit/abort,
  and schema migrations each emit their event right after the
  durable write commits; callers pass the cause
- reconcile_on_boot emits boot.reconcile with action and verdicts,
  and resolves intents with reconciliation-verdict causes
- Failed resolutions emit nothing (a line exists iff the write
  committed)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
dongarandClaude Fable 5 committed 2026-09-05 21:13:36 +00:00
1 parent ba848281ec
commit 18d4fcd701
7 files changed
+216 -32

No files matched your search

+2 -2
View File
@@ -18,8 +18,8 @@ import sys
from nisse_dev.state import StateStore
store = StateStore(sys.argv[1])
store.transition("EXECUTING", project="demo", data={"milestone": 2})
store.begin_intent("push_branch", {"branch": "milestone-2"})
store.transition("EXECUTING", cause="test", project="demo", data={"milestone": 2})
store.begin_intent("push_branch", {"branch": "milestone-2"}, cause="test")
os._exit(1) # die without closing anything, as a power cut would
"""