Skip to content

feat(aggregator): Web Push plumbing — VAPID, subscription store + API, service worker (#1254 slice b) #3316

Closed

Description

@dezren39

Implementation slice (b) of the #1254 design (note: doc/2026-11-01T03-54-00Z_design_pwa_push_notifications.md, PR #3314; epic #1184). Depends on slice (a) installability.

Build the push plumbing: VAPID keypair wiring (private key fetched by secret name at runtime, never in repo/Nix store), subscription store push-subscriptions.json in the runtime state dir (shape per design §4, 404/410 pruning), subscription API (create/update/delete with per-class map + quiet-hours prefs), and the real service worker (push + notificationclick handlers routing to the payload URL).

Includes the §6 kill-switch migration: ship the /api/sw-probe reporting first; replace /sw.js with the real worker only when 14 consecutive days of probe data show no foreign registration, otherwise the new worker unregisters foreign registrations on activate for one release. Invariant: no release serves a /sw.js that neither evicts the stranded opencode worker nor is the real worker.

Acceptance:

  • A test subscription receives a push end-to-end on the tailnet origin (branch A); payload click lands on the payload URL
  • Subscription store prunes on 410; per-class map + quiet prefs round-trip via the API
  • The kill-switch migration invariant above holds at every step (probe data or eviction-on-activate present in the replacing release)
  • No secret material in repo, store, or logs

Activity

  1. added
    kind/featureNew feature or capability request
    priority/normalOrdinary priority (the default)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 1, 2026
  2. added
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  3. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 3, 2026
  5. 45 remaining items

  6. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: blocked
    task: 8787 (repo-health-code-pilot; worker repo-worker-code; lane 9aca43b4-5439-4939-9f71-323f5d32521b)
    state: Blocked on required live-browser access.
    verified: #3316 remains OPEN; PR #3680 is MERGED. The documented Tailscale origin is reachable (/alerts returned 200), but /api/sw-probe reports zero browser reports. This host exposes headless Chromium only; no interactive browser-control integration or intentionally subscribed browser was available.
    blocker: Live acceptance requires an intentional installed browser subscribed to https://amd-6.raptor-pumpkinseed.ts.net, with notification receipt and click-through to /alerts observable.
    work: No subscription was created and no user-visible push was sent; no code changes.
    resume: Provide an intentional subscribed browser and interactive access, then send only the labeled /alerts test push and verify receipt/click-through.
    bookkeeping: openchamber scheduled lane — sandbox backlog and sweep log deferred to fleet reconciliation.

  7. added
    epic/pm-stackReprioritization program epic (2026-11-12)
    and removed
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    on Nov 12, 2026
  8. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    Steer applied 2026-11-13 under Drew's order "fix all fixable and reblocked": Drew's recorded answer (notifications-acceptance-3316) applied — queue task(s) released to the queue to execute it. Set: decisions-2026-11-13-blocked-review.

  9. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 13, 2026
  10. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    state: done — live Web Push acceptance verified; closing (lane code-c, task 8787)

    Server-side, re-verified fresh 2026-11-13 by this lane:

    • Aggregator live: GET http://127.0.0.1:4870/alerts → 200; the documented Tailscale HTTPS origin https://amd-6.raptor-pumpkinseed.ts.net/alerts → 200 (Tailscale Serve → 127.0.0.1:4870, per pm-stack/aggregator/README.md).
    • GET /api/sw-probe answers (the real push + notificationclick service worker is the shipped one).
    • Exactly one stored subscription in alerts.push_subscriptions: an Android Chrome subscription created 2026-11-01 with the incident class on — the device owner's own subscription. (Endpoint value deliberately not reproduced here.)

    Device-side, verified by the only person who can: Drew answered the pending-decisions item notifications-acceptance-3316 on 2026-11-12 via the decisions page — "Confirmed - they arrive and land right" — i.e. pushes arrive on his subscribed phone/browser and tapping one lands on the right page. That is the real-browser delivery + notification-click acceptance this task exists to demonstrate; no additional test push was sent (a lane-originated 04:00-local test push to his phone would add noise, not evidence).

    No code defect was exposed, so no code change. Closing #3316 as complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codeepic/pm-stackReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus/triagedTriaged and routed (see agent note)task/triageQueue packet kind: verify, reproduce, and route this itemuser/reviewNeeds a user-look: Muse reviews first and handles what it can

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions