protocol: decouple the IM reply via santi-protocol and a transactional outbox #45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "split-protocol-reply"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First step of the downstream-protocol design: what santi shares with a downstream consumer is a stable, transport-independent protocol, never its database. New crate santi-protocol holds the ReplyEvent contract + ReplyOutbox/ReplySink ports + dispatch_replies driver; the transport (outbox table now, MQ later) is an adapter behind the ports. Turn completion writes a self-contained ReplyEvent to a reply_outbox (schema v29) atomically with the turn; the service dispatches after completion (mirrors the error-outbox, latency preserved); the im consumer builds the reply from the event payload alone, reading none of santi's tables (at-least-once + idempotent via INSERT OR IGNORE on turn_id). By design, completion and delivery are no longer one cross-context tx: a downstream delivery failure no longer rolls the turn back (resilience gain; test rewritten). Follow-up: the ReplySink still lives in core's service, so core still crate-depends on im. 0 faults, core 0, 48 test groups green.