eda: reclaim playbook_dispatches rows when a playbook is removed #455
Notifications
Due Date
No due date set.
Depends on
Reference: sam/archie#455
Reference in new issue
Block a user
t2db.24 ships DeletePlaybookDispatches (store + RPC + interface) but nothing calls it: playbooks are files loaded once at boot (internal/app/archied/bootstrap.go playbook.Load(cfg.EDAPlaybookDir)) and no removal/reload path exists, unlike DeleteBinding which deletes binding_dispatches inside the parent delete transaction. Wire the reclamation when a playbook is removed from the configured directory (loader reconcile or reload path), or explicitly document that rows are retained for the process lifetime. Raised by the 5-angle review of t2db.24 (runs ledger-review-scope/contract/wire-contract).
Close reason
Resolved by the documented branch of its own choice, landed the day the bead was started and never closed. Commit
b2dbcda6(2026-09-23, "docs(eda): playbook dispatch rows are retained until an explicit delete") rewrote docs/prds/state-store-contract.md to say DeletePlaybookDispatches "is the explicit reclamation primitive; nothing calls it automatically, because a playbook file absence at boot is not a deliberate removal", tightened docs/prds/eda-playbook-engine.md, and updated the storecontract.PlaybookDispatcher doc to the same rule. The Lifetime rule itself landed earlier in164ca8d4(2026-09-05): "no time-based expiry, and no automatic reclamation", and it rejects the loader-reconcile option this bead offers as its first choice, with a named failure mode - playbooks are read only at boot, so a boot that finds the directory missing or unmounted loads as "no playbooks" and would reclaim the whole ledger, letting redelivered events fire their side effects again. Table growth is explicitly accepted there as bounded by distinct (playbook, event, action) tuples, the same tradeoff binding_dispatches makes. So the wiring option is not outstanding work; it is a rejected design. The primitive it names is implemented and reachable: admin-gated per TestOnlyAdminOwnsThePlaybookLedger, idempotent per TestPlaybookDispatchIsIdempotent, and proved to clear the row over both the local store and the gRPC hop by the staterpc contract conformance suite (which also pins all four primary-key components across the hop). No contradiction remains in the docs: the only remaining mentions of reclaiming are the rejection rationales. Not changed: the primitive still has no operator CLI, because the design names the RPC as the primitive and adding a command would be new capability.Imported from beads
archie-core-t2db.30· GitHub #1116 · type task · priority P2 · created 2026-09-21 · closed 2026-09-29