test(eda): pin playbook dispatch ledger docs and regression gaps

This commit is contained in:
sam committed 2026-09-22 04:51:17 +10:00
1 parent c9765d9afd
commit a092e2198e
9 files changed
+167 -21

No files matched your search

+6 -5
View File
@@ -168,11 +168,12 @@ treats as "another cycle raced us," not an error. This guarantee holds
**across daemon restarts**, not just within one process's lifetime, because
the ledger is a durable table, not in-memory state.
This ledger is also the direct precedent for the still-open EDA playbook
engine idempotency question (`archie-core-t2db.17`, `docs/prds/eda-playbook-
engine.md`'s execution-time gap 2) -- the same `(owner, event)`-keyed
`INSERT OR IGNORE` shape almost certainly generalizes to playbook-run
idempotency rather than needing a new mechanism invented from scratch.
This ledger is also the direct precedent for the EDA playbook engine's
execution-time idempotency, now landed (`archie-core-t2db.17` closed): the
`playbook_dispatches` table in `internal/store/playbook_dispatches.go` copies
`binding_dispatches`'s `INSERT OR IGNORE` conventions with a
`(playbook_id, playbook_version, event_id, action_id)` key
(`docs/prds/eda-playbook-engine.md` gap 2).
## What this document does not cover
+16
View File
@@ -122,6 +122,7 @@ consumer-capability lines so no consumer acquires a surface it does not need
| `BindingStore` (store) | — | 6 | `*Store` | `*staterpc.Client` |
| `BindingDispatcher` (store) | — | 3 | `*Store` | `*staterpc.Client` |
| `BindingTaskCreator` (store) | — | 1 | `*Store` | `*staterpc.Client` |
| `PlaybookDispatcher` (store) | — | 2 | `*Store` | `*staterpc.Client` |
**Key property of the remote client:** `*staterpc.Client` is a *single* adapter that wraps one
`StateStoreClient` and is asserted against **whichever narrow Go interfaces its caller needs**
@@ -156,6 +157,7 @@ access through daemon-side narrow adapter interfaces.
| `BindingStore` (6) | DAEMON (dashboard editor + dispatch loop) | not yet |
| `BindingDispatcher` (3) | DAEMON (dispatch loop) | not yet |
| `BindingTaskCreator` (1) | DAEMON (dispatch loop) | not yet |
| `PlaybookDispatcher` (2) | DAEMON (EDA playbook dispatch loop) | **YES** (side-effecting-action idempotency ledger over gRPC) |
**Consequence for migration order:** the **agent's `workflow.Store` is already cross-process
already** (via the NATS `storerpc` surrogate), so it is the first contract to move to gRPC. The
@@ -292,6 +294,19 @@ condition, and the panel that collapsed them told operators task logging was swi
it was not. The Go facade is `storecontract.TaskLogStore` (2 methods), carried by
`*staterpc.Client` alongside the rest.
The playbook pair was added by `archie-core-t2db.17`'s implementation (see
`docs/prds/eda-playbook-engine.md`, execution-time gap 2). It is administrative
for the same reason as the config-snapshot and apply-status pairs, and
deny-by-default in `authorizesTaskScopedCall` covers it without a new rule. The
row is the structural `(playbook_id, playbook_version, event_id, action_id)`
tuple, written **before** the action's side effect fires (the reverse of
`binding_dispatches`), so a duplicate returns `store.ErrAlreadyDispatched` and
the coordinator skips the invoke rather than repeating a non-revocable side
effect. `DeletePlaybookDispatches` is the reclamation primitive for a playbook
removed from the configured directory. The Go facade is
`storecontract.PlaybookDispatcher` (2 methods), carried by `*staterpc.Client`
alongside the rest.
### Domain types and `values.go` mapping
`values.go` maps proto ⇄ these types. The task model for the **agent** path is the domain-owned
@@ -591,6 +606,7 @@ an explicit operator decision.
var _ store.BindingStore = (*staterpc.Client)(nil)
var _ store.BindingDispatcher = (*staterpc.Client)(nil)
var _ store.BindingTaskCreator = (*staterpc.Client)(nil)
var _ store.PlaybookDispatcher = (*staterpc.Client)(nil)
// local side (in store), already present:
var _ workflow.Store = (*Store)(nil)
```