Commit a3a0da5
authored
feat: add recoverable memory outbox (#108)
## Outcome
Implements the memory-adapter reference semantics for the transactional
outbox in #97, without changing AWS persistence yet.
- atomically copy-on-write commits the sendable email, provider-neutral
message, recipients, optional idempotency claim, and deterministic
outbox item
- validates linkage, pristine state, schedule/due time, unique envelope
recipients, and unexpired idempotency
- conditionally leases due items with exact expiry recovery and one
active owner
- publishes stable `job_id` values, acknowledges dispatch, and safely
retries queue failures
- preserves the same job identity after queue-acceptance ambiguity
- supports continuous sweeps with AbortSignal shutdown
- exposes privacy-safe due, leased, undispatched, oldest-age, and
failure counters
- injects failures at every staged commit/write and queue boundary
Closes #97
Parent direction: #81
Execution plan: #84
## Local evidence
- `npm run check`
- `npm run check:conformance`
- `npm test` (25 files, 201 tests; 21 focused outbox tests)
- `npm run build`
- `npm run lint:openapi`
- `sam validate --lint --template-file template.yaml --region us-east-1`
- `actionlint`
- `npm audit --audit-level=low` (0 vulnerabilities)
- `npm outdated --json` (`{}`)
- `npm pack --dry-run --json` (new port and reconciler included)
- `gitleaks git --staged` (no leaks)
- `git diff --check`
Signed-off-by: Yusuke Hayashi <yusuke8h@gmail.com>1 parent ae8875c commit a3a0da5
7 files changed
Lines changed: 1287 additions & 3 deletions
File tree
- docs
- src
- adapters
- core
- ports
- services
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
57 | 78 | | |
58 | 79 | | |
59 | 80 | | |
| |||
0 commit comments