Skip to content

Co-DM presence: ephemeral authenticated presence on the encounter SSE stream (#816 slice 1) #2209

Closed

Description

@AwsomeFox

Split from #816 (Co-DM presence, P3, XL). This is the first and foundational slice: ephemeral authenticated presence on the encounter SSE stream. Subsequent slices (UI, intent indicators, secrecy filtering, lifecycle edge cases) build on this.

What this slice covers

Add ephemeral authenticated presence for humans on a running encounter, broadcast through the existing campaign-event SSE stream. This is the data foundation — the UI slice consumes it next.

Current state

  • Campaign events (packages/schema/src/index.ts:3525) have no human presence/actor model.
  • apps/server/src/modules/encounters/encounters.service.ts:167 publishes anonymous invalidation events.
  • The SSE stream already exists (campaign events); the AI driver presence model (RunSessionPage.tsx:783) is a precedent for ephemeral presence but is AI-specific.

Acceptance criteria

  • A server-side presence registry tracks which authenticated users have an active SSE subscription to a given encounter (userId, encounterId, coarse activity state: viewing | editing).
  • Presence is broadcast as a campaign event on the existing SSE stream when a user joins or leaves an encounter's live surface (subscribe/unsubscribe/heartbeat-expire).
  • Presence entries expire on disconnect (SSE close, heartbeat timeout). A reconnect restores presence.
  • Presence is role-filtered: a user's presence is visible only to other members of the same campaign (enforced server-side, consistent with existing membership/secrecy guards).
  • Presence does NOT leak on hidden prep or secret entity identity to unauthorized roles — a viewer/non-member cannot see presence on an encounter they cannot access.
  • Server tests cover: join/leave/expire lifecycle, role filtering, and that presence events flow through the SSE stream.

Out of scope (subsequent slices)

  • UI rendering of presence ("Alice and Bob are here") — separate slice.
  • Advisory intent ("Bob is resolving this turn") — separate slice.
  • Short-lived warnings/leases around high-risk actions — separate slice.
  • Tab close / sleep / network-loss detection beyond SSE disconnect — separate slice.

Related

Activity

  1. added
    enhancement
    theme: table-depth
    priority: P3 low
    complexity: M
    on Aug 11, 2026
  2. AwsomeFox commented on Aug 11, 2026

    @AwsomeFox
    OwnerAuthor

    Agent Workpad

    State: PR_OPEN
    Tool: copilot
    Run ID: copilot-20260811T120000Z-glm
    Claim comment ID: 5259188246
    Claimed at: 2026-08-11T12:00:00Z
    Lease until: 2026-08-11T13:30:00Z
    Worker: glm-issue-worker
    Worktree: /Users/anthonyanderson/Documents/campfire/.copilot-worktrees/glm-20260811T120000Z/issue-2209
    Branch: copilot/backlog-2209-encounter-presence
    PR: #2210
    Latest head: 5decbba

    Notes

    Blocker

    • None
  3. added
    agent: claimed
    agent: copilot
    on Aug 11, 2026
  4. added a commit that references this issue on Aug 11, 2026
  5. removed
    agent: claimed
    agent: copilot
    on Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity: Menhancementpriority: P3 lowtheme: table-depth

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions