Skip to content

id(chat): presence heartbeat protocol over gossip (ephemeral, TTL-based) #2809

Closed

Description

@dezren39

Follow-up from the IRC-first chat investigation (#2049, doc in PR #2807 §2.4; synthesis consumer #2051).

Build: presence as specified: per-node {node-id, channels[], status, ts} heartbeats over direct connections fanned out via the already-wired gossip ALPN, short TTL (60–90 s suggested), stale = gone, no leave messages. Roster = backing-group fold annotated with last-seen liveness. Presence is NEVER journaled, synced, or replayed.

Done when: two nodes show each other live/stale correctly across a simulated netsplit (kill -STOP / resume), and typing-indicator TTLs ride the same path. Hand the result to #2051.

Acceptance criteria

  • Two nodes exchange presence heartbeats ({node-id, channels[], status, ts}) over direct connections fanned out via the already-wired gossip ALPN, with a short TTL (60–90 s suggested); stale entries read as gone; no leave messages.
  • Roster = backing-group fold annotated with last-seen liveness, demonstrated across a simulated netsplit (kill -STOP / resume): both nodes show each other live, then stale, then live again correctly.
  • Presence is never journaled, synced, or replayed (verified in the implementation); typing-indicator TTLs ride the same path.
  • Result handed to the synthesis consumer id: design: ID chat v1 #2051.

Activity

  1. added
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 30, 2026
  2. added
    kind/featureNew feature or capability request
    effort/mMedium: expected under 1 day of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 31, 2026
  3. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    Intake review

  4. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    on Nov 1, 2026
  5. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  6. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 1, 2026
  7. 19 remaining items

  8. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    agent-note:v1

  9. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    agent-note:v1

    • task: 5799
    • state: done (fixed_merged)
    • pr: feat(id): chat presence heartbeat protocol over gossip (#2809) #3956 — merged 628436e
    • note: Presence protocol implemented as specified. pkgs/id/src/chat_presence.rs: signed per-node {node, channels[], status, ts} heartbeats, 75 s TTL (60–90 s band), no leave messages, stamp-based expiry (replays cannot extend a claim), roster = backing-group fold annotated with last-seen liveness, receipt-side membership filtering + viewer-scoped rosters for private channels, typing on a 12 s TTL over the same path. The table is in-memory only — never journaled, synced, or replayed. serve broadcasts/verifies presence frames on the existing gossip ALPN. Codex round (3 P2 findings: authentication, duplicate-extended expiry, pruning) fixed and replied on the PR threads.
    • tests: laptop cargo test -p id chat_presence — 10 passed, 0 failed (TTL, two-node stop/resume frame exchange, roster annotation, private-channel scoping, typing TTL, replay/out-of-order refusal, duplicate-expiry, signature authentication, frame magic, memory-only).
    • handoff: result handed to id: design: ID chat v1 #2051 (comment there). Pre-existing unrelated failure found on main: id-core test target does not compile (vt100 used in world_presentation tests, not an id-core dev-dependency after the crate split).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/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)task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions