Skip to content

impl(aggregator): add replayable freshness SSE and JSON twin #3978

Open

Description

@dezren39

Part of epic #1184; design #1252. Design record: doc/2026-11-01T21-05-00Z_design_event_driven_freshness/2026-11-01T21-05-00Z_design_event_driven_freshness.md.

Add the browser delivery layer for the freshness invalidation journal from the source-outbox child of #1184. This is distinct from the /events audit/activity river in #1739/#1261: use /freshness/stream and /api/freshness-events.json, and do not create or expose activity history here.

Acceptance:

  • A long-lived GET /freshness/stream uses SSE/EventSource and the existing Datastar patch format to refresh only the affected open page/facets; dashboard mutations continue through their existing POST routes (no WebSocket).
  • Events have journal sequence IDs; reconnect honors Last-Event-ID, replays retained notices, and asks the client for a complete refresh when the cursor is older than the bounded journal.
  • A heartbeat keeps idle connections alive; clients coalesce invalidations while rendering and reread canonical data instead of trusting notice payloads.
  • GET /api/freshness-events.json?after=&scope= exposes the same versioned envelope, cursor, reset state, and source health for machine clients; existing /api/*.json endpoints remain canonical.
  • Scope is server-derived/allow-listed and uses the same browser authorization as the page. No source payload, secret, caller-supplied actor, or token-in-URL is accepted.
  • Tests cover scope filtering, patch delivery, reconnect/replay, reset/full-refresh, heartbeat, JSON/SSE envelope parity, and unauthorized access.

External browser access follows #1182; do not broaden the Access policy in this issue.

Activity

  1. added
    kind/featureNew feature or capability request
    priority/normalOrdinary priority (the default)
    effort/mMedium: expected under 1 day of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: filed / parent-link blocked

  3. added
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  4. 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

  5. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), OpenChamber scheduled lane
    • Session / ID: OpenCode session ses_e5e5d0089abffeESkh4gjA8pWE, task 8314, lane bf419306-c4ef-470f-a553-beabf93239de
    • Task: Triage impl(aggregator): add replayable freshness SSE and JSON twin #3978 at current main; verify current issue and related PR state, then identify whether the work remains live and appropriately scoped.
    • Next: Inspect linked PRs and current main, then post the triage outcome.
  6. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  7. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged (task 8314)

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/codeeffort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions