Repository navigation
Description
PM push unification — one registry, one sender, the Android app as a first-class endpoint
Drew's order (2026-11-23): "start a lane now to unify push between the like 2 pm stack locations and the pm stack android app."
Full design of record: dated doc record doc/2026-11-24T04-45-43Z_design_pm-push-unification/ (doc-only PR linked below when landed). This body is the faithful summary; the doc record governs.
Premise check — the landscape is worse than "two locations" (verified 2026-11-23, code + live stores)
There are four Web Push senders, three subscription stores (+ one mirror), three VAPID keypairs, and two incompatible class/preference models:
| Location | Store (live count) | Classes | Sender / keys | Surfaces |
|---|---|---|---|---|
Aggregator (laptop, pm-stack/aggregator) |
Turso alerts.push_subscriptions — 0 (2026-11-23, #14048); sends ledger alerts.notification_sends — 271 rows, none after 2026-11-17, 269/269 undated per the roll-up (#14061) |
8 toggleable: incident, needs-drew, quota-wall, quota-near-wall, section-risk, stack-health, blocked-age, prompt (+ digest as a delivery shape) |
web-push library; VAPID pair A (public key in code, private in Bitwarden by name) |
/alerts, /alerts/preferences, /notifications at the tailnet URL |
Console origin (laptop, pm-stack/console src/server.ts) |
File store ~/.local/state/pm-console/push.json — 0 (live count tonight) |
4: replies, needs, questions, trouble — toggled by a store-global off-list, not per subscription |
Hand-rolled RFC 8291/8292 (src/push.ts); VAPID pair B in the store file |
The console site at its origin; GET /push delivery status |
Console edge (Cloudflare, pm-stack/console/edge) |
KV store (kvStore(kv, "push")) — count not readable from the laptop; no census route exists |
Same 4 (same code) | Same hand-rolled sender, VAPID pair C held in the KV store document | pm.security.cab — the live site the Android app wraps |
Notify-relay (Cloudflare DO, pm-stack/notify-relay, #8569) |
Mirror of the aggregator's full set (snapshot POST on change, seq-ordered) | Sends only stack.silent + recovered, riding incident |
Own push.ts, reusing pair A (private key as a Worker secret) |
GET /status only |
The Android app (pm-stack/console/android, package today.developing.pmconsole) is a Trusted Web Activity over the console site: it has no push channel of its own — the console's Web Push arrives as the app's notifications. Its widget polls a summary every ~30 min on a separate read-only device token (console/src/devices.ts), an identity registry unrelated to push subscriptions.
Consequences, plainly:
- The app Drew actually uses can only ever receive the console's 4 classes. The answerable
needs-drewpushes (the ones pm-stack: push answer write-back to the queue broker — a phone tap applies broker-sourced decides (Actions-exec extensions first) #14043's write-back serves), the quota family,section-risk,stack-health,blocked-age,promptcan only reach an aggregator browser subscription — of which there are currently zero. - PM push delivery dark since 2026-11-17: no push subscriptions registered in the alerts store #14048 ("delivery dark") and pm-stack notifications: all 269 send-ledger rows lack a usable timestamp — the measurement page is blind #14061 ("pushes do reach Drew's phone") are both true — of different stacks.
- Nobody can answer "how many live push endpoints exist?" — the edge KV store has no census route, and the other two stores are both empty.
- Class models diverge: the aggregator's preferences are per-subscription (class map + quiet hours); the console's are store-global. Twelve distinct class ids exist across the stacks with near-miss overlaps (
needsvsneeds-drew,troublevsincident/stack-health). - pm-stack notifications: all 269 send-ledger rows lack a usable timestamp — the measurement page is blind #14061's blindness is structural:
AlertsStore.logSend's insert names no timestamp column — the send time rides on a column default in a SQL-translated store, and the roll-up's parser rejects what the live rows carry (269/269 excluded).
The design (summary — doc record governs)
- One registry.
push_endpoints+ per-endpoint preference rows in the fleet-platform Turso store — hosted, already the aggregator's store, and reachable from the console edge over HTTPS (the same store family the edge already uses for decision sets). An endpoint row names its transport (webpush), its client (browser|android-app), an optional link to the console device registry, label, user agent, created/last-seen, gone count. The Android app's TWA-held subscription registers as an endpoint in its own right — named, countable, preference-bearing as the app — and the transport column is where a future native (FCM) transport lands without redesign. - One sender. A single send service owning VAPID pair A; every producer submits candidates to it. The aggregator engine and the console Notifier both become producers into the one candidate path (dedupe/cooldown/fingerprint/quiet-hours machinery is the aggregator's, reused). The notify-relay keeps pair A and its mirror as the designed exception — a sender of last resort whose whole purpose is the primary being down. Console origin + edge
Pushinstances retire as senders; pairs B and C retire with them. - One class taxonomy. The union of the 12 ids, each with exactly one producer of record.
needs(console census-diff: new needs-me items) andneeds-drew(answerable attention-tier questions) stay distinct ids with distinct labels in v1 — merging them is a product decision flagged below, not an engineering default.stack.silentremains a payload variant ofincidentat the relay.digestremains a delivery shape, never a class. - One preference model. Per-endpoint class map + quiet hours (the aggregator's model — the richer one). The console's store-global off-list migrates onto its endpoints' maps. One preferences surface, served from the console (pm.security.cab — where Drew and the app live), backed by the registry; the aggregator's
/alerts/preferenceskeeps working during migration, then redirects there. - Event-driven at detection. Producers emit at their detection points (broker/watchdog raises, quota snapshot transitions, console state-doc diffs, relay alarm) into the candidate intake — per Drew's standing requirement, the stack pushes itself; no new polling loops are introduced.
- Answerable pushes unchanged. The
needs-drewpayload contract (ledger id + options + per-question answer landing) is preserved exactly, and must work identically when the endpoint is the app (the TWA already intercepts pm.security.cab links). Answer application remains pm-stack: push answer write-back to the queue broker — a phone tap applies broker-sourced decides (Actions-exec extensions first) #14043's territory; edge answer intake (pm-stack notifications Phase 2 step 3: edge answer intake + heartbeat drain (#8569) #13469) composes unchanged. - Delivery observability by construction. One sends ledger in the registry store: one row per attempt,
sent_atstamped by the writer (ISO-8601 UTC, schema-required — never a column default again), endpoint id, class, object ref, outcome incl. push-service status,acted_on_atvia the existing Ack transition. Two designed-in alarms: undated-row alarm (any row the roll-up cannot date is a data defect that pages — this subsumes pm-stack notifications: all 269 send-ledger rows lack a usable timestamp — the measurement page is blind #14061's alarm ask for the unified ledger; pm-stack notifications: all 269 send-ledger rows lack a usable timestamp — the measurement page is blind #14061 remains the vehicle for the legacy ledger's repair/backfill) and the zero-endpoint sentinel (PM push delivery dark since 2026-11-17: no push subscriptions registered in the alerts store #14048's detection ask): zero live endpoints while undelivered incidents exist — or no successful send in N days with incidents open — raises a stack-health incident on a non-push surface, because a push about no-push is a dead letter by definition. A census read (endpoints by transport/client + last successful send) is exposed on both stacks' status surfaces: one answer to "how many live endpoints?"
Migration
- Aggregator subscriptions: none live — nothing to move; its schema shape seeds the registry.
- Console edge subscriptions cannot be re-keyed: a Web Push subscription is bound to the application-server key used at subscribe time, so pair-C subscriptions cannot be carried to pair A as rows. Migration is a re-subscription: the console site/app detects the sender-key change via its existing endpoint-mark mechanism (built for exactly this — "so the app can tell that this sender has lost it") and re-subscribes under pair A into the registry. The KV store freezes read-only for one release, then drops. Console origin store: empty — retired outright.
- Relay mirror source switches from the aggregator store to the registry (same snapshot protocol, same secret by name).
- Legacy sends ledger stays as-is under pm-stack notifications: all 269 send-ledger rows lack a usable timestamp — the measurement page is blind #14061; the unified ledger starts at cutover and the
/notificationsroll-up reads it from then on.
Boundaries
Not this design's: #14043 (answer write-back — untouched), #13469 (edge answer intake — composes), #8570 (service consolidation — the sender's natural eventual home, not a prerequisite), native FCM/APNs transport (v2 option the registry's transport column reserves), #14061's legacy-ledger backfill (linked, not duplicated).
Build-slice map (ordered; not packetised — reason below)
- S1 — Registry + aggregator adoption. Unified endpoint/preference tables in fleet-platform Turso;
AlertsStorereads/writes them;/alerts/preferencesunchanged externally. Proof: aggregator notification test suite + a live subscribe → test-send on the laptop. - S2 — Unified sends ledger + observability. Writer-stamped
sent_at; roll-up on the unified ledger; undated-row alarm; zero-endpoint sentinel wired into stack-health (lands PM push delivery dark since 2026-11-17: no push subscriptions registered in the alerts store #14048's detection ask); census read. Needs S1. - S3 — Sender consolidation. Console Notifier becomes a producer to the one sender (pair A); console origin
Pushretires. Proof: the 4 console classes delivered by the unified sender to a browser endpoint. Needs S1. - S4 — Edge cutover + app endpoint. Edge
Pushretires as sender; subscribe path writes the registry with client + device link; endpoint-mark-driven re-subscription under pair A; the one preferences surface on pm.security.cab;/alerts/preferencesredirect. Needs S3. - S5 — Relay re-point + close-out. Mirror source = registry; legacy stores frozen/dropped; closure evidence for PM push delivery dark since 2026-11-17: no push subscriptions registered in the alerts store #14048/pm-stack notifications: all 269 send-ledger rows lack a usable timestamp — the measurement page is blind #14061 (census ≥ 1 live endpoint per class path; a week of dated sends). Needs S4.
Why no packet yet: two seams must be settled on this record before any slice is specified exactly — (i) the needs/needs-drew taxonomy call is Drew-facing (it changes what his toggles say) and is posed here for his word; (ii) S4's re-subscription slice can only be specified against the endpoint-mark flow's behaviour in the shipped app build, which the S3/S4 builder must verify live first. S1/S2 are close to specifiable and packetise on this design's acceptance — the #14043 pattern (design of record first, build slices from it).
Open questions for Drew
- Class taxonomy: keep
needsandneeds-drewas separate toggles (recommended — different promises: "new items need your hands" vs "a question only you can answer"), or merge into one "Needs you" class? - Preferences surface home: console (pm.security.cab) as the one surface, aggregator page redirecting — as designed — or the reverse?
— Lane PUSH-UNIFY, 2026-11-24. Progress + records on this issue at each boundary.
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-24T04:46:16Z",
"session_id": null,
"lane": null,
"host": "htch-runtime",
"worktree": null,
"model": null,
"lane_start_issues": [],
"workspace_ref": null,
"auth_subject": "archer",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Activity
developing-today commentedon Nov 24, 2026
CODE-5176
Merge pull request #14087 from developing-today/docs/pm-push-unification
developing-today-fleet commentedon Nov 24, 2026
Lane PUSH-UNIFY — complete (2026-11-24)
Delivered:
18ca19558a3bb6d25278879c1050e89c0cecd242—doc/2026-11-24T04-45-43Z_design_pm-push-unification/+ onedoc/README.mdindex line; diff verified at exactly those two files, doc blob byte-verified on main post-merge.logSendnames no timestamp column; the unified ledger subsumes the alarm ask by construction, legacy repair stays on pm-stack notifications: all 269 send-ledger rows lack a usable timestamp — the measurement page is blind #14061).Packetisation: deliberately none yet. Two seams are posed on this issue for settlement first — (i) the
needs/needs-drewtaxonomy call is Drew-facing (it changes what his toggles say); (ii) S4's re-subscription slice can only be specified against the endpoint-mark flow's behaviour in the shipped app build, which must be verified live first. S1/S2 packetise on this design's acceptance, the #14043 pattern.Open questions for Drew (also at the end of this issue's body): (1) keep
needsandneeds-drewas separate toggles (recommended) or merge into one "Needs you" class? (2) the one preferences surface on the console (pm.security.cab) with the aggregator page redirecting — as designed — or the reverse?No platform flags fired during this lane. No code was changed; this lane was design + filing only, per its brief.
developing-today-fleet commentedon Nov 24, 2026
Ruling recorded — one push system, responses handled centrally (Drew, 2026-11-24 00:28 CST)
Drew confirms this design's core and adds the response half:
One system, every endpoint. Push is a single system no matter where it lands: the same push goes out to website push AND to the Android app, as endpoints of the one registry. That is what this design already builds — one registry, one sender, the app a first-class endpoint (
client=android-app) — and it is recorded here as Drew's confirmation of that shape, including that the app receives through its registered endpoint rather than through a channel of its own. A native (FCM) transport remains the reserved v2 column in the registry, untouched by this ruling.Responses return and are handled centrally. A response given on any endpoint — a notification action tap, the Android app, a browser — is sent back and handled by the same single path: the answer capture and write-back owned by #14043. The endpoint of origin is never a fork in how an answer is handled. This design's boundary ("#14043 (answer write-back — untouched)") stands; the join is that this sender's payloads must carry what that handling needs:
Notification response payloads. Pushes carry standard AND custom responses. The standard options ride as notification action buttons in the payload; the notification also clicks through to a detail view that gathers more detail and builds the appropriate context for answering — custom free-text lives there, since it cannot be typed into a notification action. So the unified sender's payload contract gains two things: the question's standard options as actions, and a click-through target carrying the question's identity. The rich question schema itself — checkboxes, radio, always a custom option, per-question or per-set answering, lossless radio→checklist conversion — is recorded on #14043, which owns the question/answer model; this design only carries a question's standard options into the payload.
Not decided by this ruling: the class-taxonomy question posed in this design (keep
needsandneeds-drewas separate toggles, or merge into one "Needs you" class) is still open. Drew's "single system" words are about delivery unification — one registry, one sender, every endpoint — not about merging classes. It stays posed for his word, exactly as the design left it.Slice note: S1–S5 remain unpacketised, as this design directs, so no queued work changes. The payload-contract point above belongs in S3/S4 when they are specified.
— Lane PM-OFFLINE-PUSH-AMEND, 2026-11-24.
developing-today-fleet commentedon Nov 24, 2026
Taxonomy settled — the staged pipeline: needs-review first, needs-user only when it has to be (Drew, 2026-11-24 00:37 CST)
Drew ruled on this design's open question 1. The answer is neither of the two options posed (separate toggles, or one merged "Needs you" class). It is a staged pipeline:
1. The class is
needs-user, notneeds-drew. Rename it wherever this design names it — the aggregator's answerable class id, the unified taxonomy, the payload contract, the census, the preferences labels. (The answer path's existing/api/needs-drew/…naming is an implementation surface the build slices rename or alias as they touch it; the class of record isneeds-user.)2. Everything goes to
needs-reviewfirst. Every item that would have been an answerable push lands in a needs-review stage first. The AI works that stage: it handles items and makes decisions itself whenever possible — Drew's standing decision posture applied to this queue. Only items that absolutely need Drew escalate to needs-user and are pushed to him. The console'sneedsclass (new needs-me items from the census diff) feeds this same pipeline at the review stage.3. "Send back" is a standard answer option on every needs-user item. One of the options on every escalated item is send back: it returns the item to the needs-review stage, to be decided there by the AI. It is recorded and handled like any other answer (see #14043, where the answer-flow half of this ruling is recorded).
4. Push delivery is user-configurable on the one preferences surface (the console surface this design already names). Pushes send immediately by default. The user can set:
These settings join the per-endpoint preference model (design point 4) as first-class settings, not sender-local behaviour.
5. The needs-user list carries triage metadata. The list Drew answers from supports setting priority on items, and each item shows the number of issues blocked by its answer — so the highest-unblock answers get answered first.
What this settles: open question 1 is closed by this ruling — the taxonomy is the staged
needs-review→needs-userpipeline withneeds-useras the escalation class. Open question 2 (the one preferences surface lives on the console, pm.security.cab) stands as previously ratified. This ruling also confirms the direction recorded at comment 7124013638 (one system, responses handled centrally) and gives that handling its front door: the review stage is where the AI handles responses first.Build slices S1 and S2 are packetised from this design with this ruling folded in (task IDs in the following comment). S3–S5 are not packetised: S4 still depends on verifying the endpoint-mark flow against the shipped app build.
— Lane PUSH-UNIFY-PACKETS, 2026-11-24.
developing-today-fleet commentedon Nov 24, 2026
Slices S1 + S2 packetised — tasks 21692 and 21693
Per Drew's taxonomy ruling recorded above (comment 7124146989), the first two build slices of this design are now queued on
repo-health-code-pilot, both priority 40, kindfeature_slice, each validated and verified by read-back after enqueue:repo-health:v1:slice:developing-today/code:issue:14084:slice-1. Thepush_endpoints/push_preferencestables in fleet-platform Turso;AlertsStorereads/writes them;/alerts/preferencesunchanged externally. The ruling is folded in: the class isneeds-user(noneeds-drewin the touched paths); item stage is modelled (needs-reviewentry →needs-userescalation, send-back returns an item to review); the per-endpoint preference model carries the delivery settings (send immediately by default, rate cap = max pushes per unit of time, grouping, reminders for groups); the needs-user list supports priority setting and shows each item's blocked-by count. Proof in-packet: aggregator notification test suite + live subscribe → test-send on the laptop. Read-back at enqueue: statusqueued; since claimed once and parked by a fleet lane (attempts 1) — in the fleet's flow.repo-health:v1:slice:developing-today/code:issue:14084:slice-2. One sends ledger in the registry store with writer-stampedsent_at(ISO-8601 UTC, schema-required — never a column default again); the/notificationsroll-up reads it; undated-row alarm; zero-endpoint sentinel into stack-health (lands PM push delivery dark since 2026-11-17: no push subscriptions registered in the alerts store #14048's detection ask); census read on both stacks' status surfaces, including the needs-user backlog with blocked-by totals. Grouped sends and group reminders are recorded as their own ledger attempts. Hard prerequisite in-packet: task 21692 must be terminal-done first — a lane claiming 21693 earlier parks behind it. Read-back at enqueue: statusqueued.Not packetised: S3 (sender consolidation), S4 (edge cutover + app endpoint), S5 (relay re-point + close-out) — as directed. S4 still depends on verifying the endpoint-mark flow against the shipped app build.
— Lane PUSH-UNIFY-PACKETS, 2026-11-24.