You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pm-stack notifications Phase 2 step 2: event mirror to the pm-notify DO (#8569) #13468
Parent: #8569. Design of record: doc/2026-11-17_design_pm8569_notifications_phase2.md §1 (sync topology) + §5 step 2. Step 1 (relay skeleton + dead-man's switch: pm-stack/notify-relay Worker/DO + the aggregator's heartbeat/subscription-mirror client) landed first; this step builds on it.
Scope
Edge: add POST /mirror/event to the pm-notify Worker (shared-secret auth, same as the other laptop → edge POSTs). The DO appends each event to its mirror log, deduped on the envelope's mirrorId (duplicates ack as success), pruned to a rolling 30 days (design §2). The mirror log is a mirror, never the record — the throat's store stays authoritative (invariant 1).
Laptop: the aggregator mirrors every push-worthy event — incident raised/escalated transitions, needs-drew raises, quota walls — at raise/transition time, one POST per event carrying the throat's existing event payload plus the mirror envelope {mirrorId, objectRef, transition, raisedAt}. Delivery obligation is retry-until-acked (the §1 shape); reuse the step-1 relay client's auth/secret plumbing.
Dual-send discipline holds: the edge remains a silent mirror for these classes (no sends). This step proves the sync before any cutover is contemplated; whether any mirrored class beyond stack.silent ever cuts over to edge sending is separately reviewed (step 4's review, not this issue).
Acceptance
Mirror log in the DO matches the throat store across a soak window (the comparison method is part of the work: a read-back surface or a test harness against both stores).
Dedupe verified by forced retries: replaying the same mirrorId (simulated lost acks) leaves exactly one log entry per event.
A missed mirror POST (edge down at raise time) is retried until acked — no event in the throat store is absent from the mirror log after the edge returns.
Tests name their oracles (repo testing doctrine) and run remotely per REMOTE BUILDS ONLY.
Out of scope
Any edge sending for mirrored classes; answer intake (step 3); cron narrowing (step 4).
Filed by lane felix from #8569's step-1 pass, 2026-11-23. Filed without a pilot packet: the shortlist is operator-managed, and chained packets for #8569's steps are cut by the queue operator (same recorded pattern as #13342).
Activity
developing-today commentedon Nov 23, 2026
CODE-4910