Skip to content

feat(id): note checkpoint core + note-ID collab session keying (#3819 Phase 3 slice 1) - #10808

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

dezren39 merged 1 commit into
mainfrom
queue/5826-3819-checkpoint-core

Conversation

@dezren39

@dezren39 dezren39 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Refs #3819. Queue task 5826 — Phase 3 slice 1 (checkpoint core) of 4.

Gates verified fresh this shift: #3814 CLOSED (Phase 1 note graph is in id-store::notes), #2048 CLOSED with Drew's Q2 answer recorded. Prior lanes parked task 5826 repeatedly as "needs a dedicated implementation session; resume at slice 1 (checkpoint core)". This PR is that slice.

What lands

Checkpoint core — id-store::note_checkpoints (new module). The rules that tie a live editing session to the durable note graph, with editor steps kept ephemeral and only checkpoints crossing into the graph:

  • NoteCheckpoints::create establishes a note (the note.create event ID is the stable note ID); checkpoint publishes one signed revision naming the note, its verified DocumentRef content, and the parent revision(s) the caller chose; checkpoint_on_heads is the ordinary save path for a single-head note.
  • Concurrent work is never silently joined: two checkpoints from one head leave two heads; checkpoint_on_heads on a multi-head note returns ExplicitMergeRequired naming the heads and changes nothing; only the explicit merge (naming every current head) retires more than one head. A checkpoint from a stale head forks instead of overwriting — no last-writer-wins.
  • Every append is proven against fold_notes before it is recorded, so a refused checkpoint leaves the log byte-identical. from_events rebuilds the log from the applied events alone (restart/sync), order-independently, with the same heads.

Session identity — id-web::collab. CollabState sessions can now be keyed by a note's stable ID: note_session_key (note:<id>, a namespace that never aliases a filename) and get_or_create_for_note, over a shared keyed core that the existing filename get_or_create also delegates to (filename behavior unchanged — its tests pass as before). A renamed or aliased note keeps the one session its editors share; the filename remains only a content-mode hint.

Tests

  • 5 new note_checkpoints oracle tests: checkpoint chaining + stable note ID; concurrent checkpoints → two heads → explicit merge (and merge-with-nothing-concurrent refused); stale-head fork; refused checkpoint leaves the log unchanged; rebuild-from-events with reversed arrival order yields identical records/heads.
  • 1 new collab test: same note ID under different filename hints returns the same session (Arc-identical); different notes and filename sessions never alias.
  • Full suites on the laptop: cargo test -p id-store -p id-web --lib — 229 + 683 tests pass, 0 failed. Changed files are cargo fmt clean.

Remaining slices on task 5826 (recorded, not in this PR)

  1. Route/WS wiring: resolve note sessions in the collab handler and publish checkpoints on save from the live session (content blobbed via the document path, signed by the session's key).
  2. Access boundary at checkpoint time per Drew's Q2 answer (public by default, or read/write/admin to named groups/users), separate from viewer visibility.
  3. Wire-level integration tests: restart/sync reconstruction from the published checkpoints, concurrent-head merge over the wire, and the existing filename path end to end.

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

@dezren39
dezren39 requested a review from a team as a code owner November 16, 2026 15:22
@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 57 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: df2b3ad1-8590-4fe0-a9cd-5d02efa42ff5
Commits

Reviewing files that changed from the base of the PR and between d7cf035 and afd4bea.

Files selected for processing: 4

  • pkgs/id/crates/id-store/src/lib.rs
  • pkgs/id/crates/id-store/src/note_checkpoints.rs
  • pkgs/id/crates/id-web/src/collab.rs
  • pkgs/id/crates/id-web/src/lib.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
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-16T15:22:34.943235Z
We couldn’t complete this review. Comment @codex review to try again.
afd4bea 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.

@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.

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