Repository navigation
feat(id): note checkpoint core + note-ID collab session keying (#3819 Phase 3 slice 1) - #10808
Conversation
…Phase 3 slice 1)
|
Warning Review limit reachedYou'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. View limit details
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. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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::createestablishes a note (thenote.createevent ID is the stable note ID);checkpointpublishes one signed revision naming the note, its verifiedDocumentRefcontent, and the parent revision(s) the caller chose;checkpoint_on_headsis the ordinary save path for a single-head note.checkpoint_on_headson a multi-head note returnsExplicitMergeRequirednaming the heads and changes nothing; only the explicitmerge(naming every current head) retires more than one head. A checkpoint from a stale head forks instead of overwriting — no last-writer-wins.fold_notesbefore it is recorded, so a refused checkpoint leaves the log byte-identical.from_eventsrebuilds the log from the applied events alone (restart/sync), order-independently, with the same heads.Session identity —
id-web::collab.CollabStatesessions can now be keyed by a note's stable ID:note_session_key(note:<id>, a namespace that never aliases a filename) andget_or_create_for_note, over a shared keyed core that the existing filenameget_or_createalso 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
note_checkpointsoracle 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.cargo test -p id-store -p id-web --lib— 229 + 683 tests pass, 0 failed. Changed files arecargo fmtclean.Remaining slices on task 5826 (recorded, not in this PR)
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.