Skip to content

Phase 3 slice 4: client-driven note checkpoints + cold-open hydration (#3819) - #10843

Merged
dezren39 merged 1 commit into
mainfrom
queue/5826-3819-slice4-wire
Nov 16, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/5826-3819-slice4-wire

Conversation

@dezren39

@dezren39 dezren39 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Phase 3 (#3819) slice 4: wire-level note checkpoints — client-driven publication, and hydration of reopened note sessions from the checkpoint log.

Slices 1–2 (#10808, #10831) built the signed checkpoint log and wired note sessions (note:<hex> doc IDs) into the collab WebSocket handler, publishing the session document when the last editor disconnected. Building this slice surfaced a semantic problem with that trigger: the server never applies editor steps to the session document — steps are stored and broadcast, and the document a socket holds is the session's base content. Publishing at disconnect would therefore sign the stale base text as a new revision after any step edit. Slice 4 corrects the trigger instead of shipping that:

  • Publication is client-driven. New CollabMessage variants Checkpoint { text } (tag 10, client → server) and Checkpointed { head } (tag 11, server → client). The client, which holds the live step-edited content, sends its current text; the handler records it through the slice-2 checkpoint core (publish_note_checkpoint_text) under the server identity's author key, stores the bytes in the blob store under their document hash, and replies with the new head. Filename sessions refuse with an Error message. The disconnect-time publication is removed, with the reason recorded in the cleanup path.
  • Hydration. A reopened note session's initial content is its checkpoint log's current head revision content, fetched from the blob store by document hash (a DocumentRef's content hash is the blob's hash). This is the cold-open path: a session document outlives its last client by a one-hour cleanup grace period (DOCUMENT_CLEANUP), so hydration serves opens after eviction or a server restart, and the recorded media type supplies the filename hint mode detection needs. Concurrent heads hydrate deterministically from the smallest head ID; the heads themselves are untouched. CollabState::note_head_content exposes the lookup; publish_note_checkpoint (base-document text) is kept for server-side callers and now shares the text core.
  • Tests. Wire-level integration test over a real socket: connect → steps acked → Checkpoint → Checkpointed with a 64-hex head → exactly one durable event → eviction (the remove_document the cleanup task performs) → cold reopen hydrates the checkpointed text into Init → filename session refuses checkpoints. Plus unit tests for publish-by-text (records the given text, not the base document), head-content tracking across publications and forks, and message round-trips for the new variants.

Remaining for #3819: slice 3 (access boundary at checkpoint time, per the recorded Q2 answer on #2048: public by default, read/write/admin scoped to groups and users).

Tests

  • cargo test -p id-web --lib — 692 passed, 0 failed (includes the 4 new slice-4 tests and all slice 1–2 collab tests).

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…slice 4)

Publication moves from session-end (which would sign the session base text, since the server never applies steps to the document) to a client-driven Checkpoint message carrying the live text; Checkpointed replies with the new head. Reopened note sessions hydrate from the checkpoint log head via the blob store. Wire-level round-trip test plus unit tests; 692 id-web lib tests pass.
@dezren39
dezren39 requested a review from a team as a code owner November 16, 2026 17:57
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T17:57:13.207904Z
We couldn’t complete this review. Comment @codex review to try again.
92d24e6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe4ef54a-f433-4e7c-99c5-a3f23172fac4
Commits

Reviewing files that changed from the base of the PR and between ece1b43 and 92d24e6.

Files selected for processing: 1

  • pkgs/id/crates/id-web/src/collab.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit c70b167 into main Nov 16, 2026
1 check passed
@dezren39
dezren39 deleted the queue/5826-3819-slice4-wire branch November 16, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant