Skip to content

id: PoC: intermittent-signature live stream for collaborative editing #2241

Open

Description

@dezren39

Throwaway prototype: run the existing collaborative-editing live path through a session header, MAC-authenticated frames and segment checkpoints, and prove a late joiner can reconstruct from a checkpoint.

Why

#2034 investigation (doc: doc/2026-10-29T10-45-00Z_investigation_ephemeral_live_data_retention/) found the current live path is already unsigned and bounded — web/collab.rs carries steps and cursors as unsigned MessagePack frames, cursors are dropped 5 min after disconnect, document state 1 h after the last client leaves (world/mod.rs limits) — but nothing produces a signed checkpoint that makes that low-retention stream auditable afterwards. This PoC answers whether the checkpoint shape actually works before anyone commits to it.

Scope (prototype only)

  • Take pkgs/id/src/web/collab.rs steps/cursors and put them behind a session header + per-session MAC key (no per-keystroke signature).
  • Emit segment checkpoints every ~2 s or ~256 events, plus on commit/blur, chained to the previous checkpoint's signature.
  • Demonstrate: a late joiner loads the latest checkpoint and reconstructs state; a reconnecting peer reconciles at the next checkpoint boundary; a truncated tail is detectable by a verifier.
  • Measure the signature count and bytes saved versus signing every event.

Hard rule (program, #2056)

Proof of concept — must NOT be merged into the permanent feature, and no permanent feature may be built on it before a review round. Land it as a throwaway (branch or examples/) that the reviewer can run, not as a change to the production path.

Blocked by

Refs #2034, #2056.

Activity

  1. added
    priority/highImportant and time-sensitive
    queue/queuedHas a queued task in the Supabase agent queue
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 29, 2026
  2. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 1, 2026
  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  5. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Triage verdict: confirmed, with an important qualification

    At main 0f4731ea0, pkgs/id/src/web/collab.rs:6-16,207-225 defines unsigned MessagePack live steps/cursors held in memory. Optional first-message token authentication (:698-759) is not a per-frame signature. Disconnect immediately broadcasts cursor removal; server state retains the disconnected cursor for up to five minutes (:1178-1209), and idle document state is removed after one hour without clients (:182-185,1213-1232).

    A signed saved document revision already exists (pkgs/id/src/web/routes.rs:1194-1201,1233-1264), so “no signed checkpoint” is true only for a signed live-segment checkpoint binding ordered steps, session and previous root—not for saved snapshots. The save path does not attest each live edit or contributor.

    A throwaway PoC is plausible, but signer authority, canonical segment hashing, retained verification material and race-safe snapshot/reconnect semantics need specification. A checkpoint alone does not prove complete history or non-equivocation. #2240 remains open and supplies the required wire shape: do not start the PoC until it is settled. Any prototype must stay out of the permanent feature until reviewed.

    🤖 Agent note · triaged

    • Agent: OpenChamber scheduled lane (repo-worker-code)
    • Session / ID: ses_e5e69f2eb88ffewco0JLpXp4lr; queue task 3462
    • Evidence: read-only current-main inspection; no runtime tests.
    • Next: route a dependency-gated PoC follow-up.
  6. 105 remaining items

  7. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    Current triage — 2026-11-03

    #2241 remains OPEN. Its design dependency #2240 is CLOSED (completed), and design PR #3867 is MERGED. The existing throwaway PoC PR #4435 is OPEN at head 957cc11; its current check rollup is SUCCESS (1/1), but it has no approvals, codeowners are pending, and three unresolved Codex P2 findings remain:

    • pkgs/id/examples/session_checkpoint_poc.rs: the 2-second segment limit is not enforced while frames are idle; the timeout boundary waits for another frame/disconnect.
    • Late-joiner verification checks commitments but does not replay the checkpoint operations against the snapshot before claiming replay verification.
    • The verifier does not recompute the header-core hash, so participant/policy changes can retain the old session ID.

    These are material gaps in the requested PoC demonstrations, not work already landed on main. PR #4435 is the canonical fix path; do not create a competing PR or touch the merged design PR #3867. Keep #2241 open until the existing PR findings are addressed and the required review round completes. A follow-up queue task will target #4435. Added user/review for the outstanding reviewer/codeowner gate; no hard-stop labels were present.

  8. added
    user/reviewNeeds a user-look: Muse reviews first and handles what it can
    on Nov 3, 2026
  9. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: done
    task: 7317 (repo-health-code-pilot, repo-worker-code; OpenChamber scheduled lane; session ses_e5e5c3748bbffeCrbxVyjhADa8)
    state: Triage completed. #2241 remains OPEN; design #2240 is CLOSED and PR #3867 MERGED. Existing canonical PoC PR #4435 is OPEN with CI SUCCESS (1/1), no approvals, codeowners pending, and three unresolved Codex P2 findings (idle time-boundary checkpoint, late-joiner replay/snapshot consistency, header-core hash binding). Findings and blocker are recorded on #2241; no competing PR or code edits made.
    disposition: Follow-up task 8925 queued as a PR shepherd against existing PR #4435; issue remains open with user/review for codeowner review.
    links: #2241 · #2240 · #3867 · #4435 · task 8925

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

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  12. added a commit that references this issue on Nov 4, 2026
  13. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    What landed in commit e851254 (pkgs/id/examples/session_checkpoint_poc.rs only):

    1. Idle segment boundary (thread 4444678379 → reply 4461949249): new Producer::tick(at_ms) clock API checkpoints an idle segment with CloseReason::Interval at the boundary; build_session ticks at 4560 ms during the pause. Test: idle_segment_checkpoints_on_tick_at_time_boundary.
    2. Late-joiner replay (thread 4444678416 → reply 4461950297): SegmentBody carries state_before_snapshot; verify_segment parses and applies every frame onto it and requires landing exactly on the committed snapshot before reporting replay-verified. Test: keyless_verification_rejects_snapshot_the_frames_do_not_produce (owner-signed forged snapshot now rejected).
    3. Header binding (thread 4444678439 → reply 4461951035): shared header_core_bytes; verify_segment and verify_chain recompute the header hash via verify_header. Test: tampered_header_participant_is_rejected.

    Verification (laptop worktree ~/git/fleet/8925): cargo test --example session_checkpoint_poc — 6/6 pass; cargo run --example session_checkpoint_poc — ALL DEMOS PASSED (6 checkpoints, segment 1 closed by the tick). PR #4435 fresh state: OPEN, MERGEABLE, head e851254; basic line-limit check queued at completion time.

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)priority/highImportant and time-sensitivesource/creatorFiled by the new-issue-creator jobtask/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