Repository navigation
Commit 2919a5d
feat(serving): replay outbox + dead-letter behind ControlPlaneStore (ADR 0010 slice 3)
Third rollout slice of ADR 0010: the replay outbox and dead-letter status
transitions move behind the ControlPlaneStore port, preserving invariant 8
verbatim. Pure extraction — table DDL and SQL shapes are byte-compatible; no
behavior change on the embedded (default) profile.
- ControlPlaneStore gains claim_due_outbox_entries / get_pending_outbox_entry
(reads), mark_outbox_sent / schedule_outbox_retry (invariant 8, one
transaction each), enqueue_outbox_replay (the other invariant-8 half —
EventReplayer.replay's dead-letter-update + outbox-insert), plus
get_dead_letter_event_for_replay / dismiss_dead_letter_event /
dead_letter_event_exists / get_dead_letter_event / list_dead_letter_events /
get_dead_letter_stats for the router's read/write paths.
- OutboxProcessor and EventReplayer gain an additive `store:
ControlPlaneStore | None = None` kwarg; when omitted (every existing call
site) they build a private embedded store from whichever conn/duckdb_path
they already owned, preserving main.py's :memory:-vs-file dual-connection
split verbatim. routers/deadletter.py resolves the app's shared store and
passes it via store=, so it never reaches query_engine._conn directly.
- ensure_outbox_table / ensure_dead_letter_table moved to
control_plane/embedded.py. Unlike the webhook/alert log methods, the
outbox/dead-letter write-transaction methods do NOT lazily ensure their
tables — ensure_outbox_schema runs once at construction instead, matching
pre-port timing exactly and keeping the fault-injection rollback tests
(table-drop, connection-wrapper) meaningful.
Tests: tests/unit/test_control_plane_store.py gains outbox/dead-letter
coverage (claim ordering, mark-sent + rollback, retry/backoff/kafka-floor,
replay enqueue + rollback, tenant-scoped reads, stats); structural ratchet
extended to outbox.py/event_replayer.py/routers/deadletter.py; 6 test files'
ensure_dead_letter_table imports rewired to the new module.
Verified: full unit+property 1575 passed, mypy strict clean, ruff clean,
targeted integration (test_outbox/test_deadletter/test_logical_correctness)
27 passed. Full integration suite re-run was interrupted by a tool error at
session end — rerun tests/integration -m "not requires_docker and not live"
before merging.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent e88d5b1 commit 2919a5d
14 files changed
Lines changed: 991 additions & 496 deletions
File tree
- src
- processing
- serving
- api/routers
- control_plane
- tests
- chaos
- integration
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
7 | 38 | | |
8 | 39 | | |
9 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 43 | | |
71 | 44 | | |
72 | 45 | | |
73 | | - | |
| 46 | + | |
74 | 47 | | |
75 | 48 | | |
| 49 | + | |
| 50 | + | |
76 | 51 | | |
77 | | - | |
| 52 | + | |
| 53 | + | |
78 | 54 | | |
79 | 55 | | |
80 | | - | |
81 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
82 | 67 | | |
83 | 68 | | |
84 | 69 | | |
| |||
95 | 80 | | |
96 | 81 | | |
97 | 82 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
144 | 91 | | |
145 | 92 | | |
146 | | - | |
| 93 | + | |
147 | 94 | | |
148 | 95 | | |
149 | 96 | | |
| |||
159 | 106 | | |
160 | 107 | | |
161 | 108 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 109 | + | |
166 | 110 | | |
167 | 111 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 112 | + | |
179 | 113 | | |
180 | 114 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 115 | + | |
186 | 116 | | |
187 | 117 | | |
188 | 118 | | |
| |||
0 commit comments