Repository navigation
Description
Parent: #2048 (ID Zettelkasten design). Phase 3 — depends on #3814 (stable note identity/revision graph) and Drew's explicit answer to Q2 on #2048 (shared-write authority).
Bridge the existing live ProseMirror session to durable note revisions. Key sessions by stable note ID rather than filename; keep live steps/cursors as transient transport; on save/checkpoint publish a signed immutable revision with the current note ID and parent head(s). A stale/offline edit must not overwrite another writer: retain concurrent heads and require an explicit merge revision. Do not make one web process's in-memory collaboration state the replicated source of truth.
Gate: before implementing any shared-write authorization, re-read #2048 Q2. Use the selected policy; if Drew has not answered, park without changing authorization behavior. Do not infer write permission from friendly-name resolution or the reader's writer-set projection. No cross-store resolver work (that remains #2259).
Acceptance:
- Reopening a note by stable ID recovers its latest known revision and history across server restart/replica sync.
- A normal live session can checkpoint to a signed revision; ephemeral steps/cursors are not emitted as permanent events.
- Concurrent/offline sessions create separate heads; an explicit merge names its parents; no last-writer-wins data loss.
- The chosen group/write policy is tested at the boundary and is separate from viewer-specific visibility.
- Existing filename-based document editing remains compatible during migration; tests cover old and new paths.
Activity
developing-today commentedon Nov 1, 2026
CODE-1554
dezren39 commentedon Nov 1, 2026
agent-note:v1 — queued, parent #2048 phase 3; queue task 5826, dedupe
repo-health:v1:fix:developing-today/code:issue:3819. Resume only after #3814 lands and Drew answers shared-write authority Q2 on #2048; then persist signed checkpoints and explicit concurrent merges. Filed by repo-worker-code, OpenChamber scheduled lane, 2026-11-01T16:54Z.dezren39 commentedon Nov 1, 2026
🤖 Agent note · parked — claimed early; both start gates in the packet are unmet
Writemembers with visibility handled separately by the id: design: writer-set + view-projection spec for pkgs/id — representation, set-change semantics, discovery query (from #2030) #2238 projection (recommended), (b) a new per-note ACL/owner model, or (c) any group member. The latest comment on id: design: Zettelkasten layer — multiplayer docs/wiki on ID #2048 is the task 5733 routing note (2026-11-01T16:55Z); no answer from Drew appears there or on this issue. This task's acceptance requires shared-write authorization to follow Drew's explicit answer — proceeding on the recommendation alone would pre-empt a product authority decision that is genuinely Drew's.dezren39 commentedon Nov 1, 2026
🤖 Agent note · parked
141 remaining items
Merge pull request #11732 from developing-today/feat/3819-note-group-…
feat(id): note policies survive a checkpoint-log rebuild (#3819)
dezren39 commentedon Nov 22, 2026
agent-note:v1
state: progress
task: 9602
lane: xaltha
Fresh re-verification (2026-11-22): #3819 still OPEN. All four Phase 3 slices are merged (#10808, #10831, #10843, #10846) and the group resolver landed via #11732, but the access-boundary acceptance is not complete: a checkpoint log rebuilt from its events treated every note as public, because policies lived only in the log's in-memory map and
from_eventsdropped them.This run worked the blocker instead of re-triaging it. Slice PR #12637 (#12637, branch xaltha/9602-3819-note-policy-restart, commit 455cef1) makes policies durable in snapshot form:
NotePolicyRecord(serde) +policies()/seed_policies()/from_events_with_policies()in id-store,note_policies()/seed_note_policies()on CollabState. Five new tests prove a scoped policy (user grant, group grant, owner) and its authorization survive a restart rebuild, and that mis-ordered or corrupt seeding is refused. Laptop evidence:cargo test -p id-store -p id-web --lib polic— 5 passed id-store, 3 passed id-web, 0 failed. Full note_checkpoints/collab module runs not done in this slice (laptop shell route degraded); CI is the backstop.Remaining on #3819: persisting the events+policies snapshot in the host (today nothing persists either), syncing policies to replicas (a note.policy event kind, which needs an ordering rule), and wire-level tests.
fix(id): validate restored note owners against the create event author (
dezren39 commentedon Nov 22, 2026
Progress on PR #12637 — Codex P2 review thread answered and fixed.
What was fixed: The Codex thread (review of 455cef1) found that a rebuilt log rejected its own valid policy snapshot when a note had a revision whose ID sorts before its create event and whose author differs from the creator:
NoteCheckpoints::access()derived the owner fromrecord.revisions.first(), whilefold_notessorts revisions by ID. Commit bd7252d ("fix(id): validate restored note owners against the create event author (#3819)") derives the owner directly from the create event instead — the revision whose ID is the note's ID (record.revision(note)?.author) — fixing both restore paths (from_events_with_policiesand the two-stepfrom_events+seed_policies). It also corrects the staleNoteRecord.revisionsdoc comment innotes.rsthat claimed the first sorted revision is the create. A regression test (test_restored_owner_comes_from_the_create_event_not_the_first_sorted_revision) covers a revision by another author whose ID sorts before the create event, asserting both restore paths accept the persisted snapshot.Thread status: the one Codex thread (PRRT_kwDOJWP47866mHw2) is answered — reply: #12637 (comment) — and resolved. No unresolved review threads remain on the PR.
What still blocks merge: CI on the new head bd7252d. Checks were SUCCESS on the previous head (455cef1); the fix commit was just pushed and CI has not reported yet (combined state pending; only CodeRabbit neutral so far). The fix was not compiled locally — no Rust toolchain in this seat — so CI is the first compile/test run. Nothing was merged.
dezren39 commentedon Nov 22, 2026
Lane AD (archer) claimed queue task 9602 via #5535: shepherding PR #12637 ("id: note policies survive a checkpoint-log rebuild") to a verdict — full review against this issue's acceptance criteria plus independent test verification on the PR head — then a remainder assessment on #3819 and #5535. No new Phase 3 implementation under #5535.
Merge pull request #12637 from developing-today/xaltha/9602-3819-note…
dezren39 commentedon Nov 22, 2026
PR #12637 merged (merge commit
2ba5263dfacd5965c4226fc9c67cad15d65e584c, headbd7252dd0) — shepherded by Lane AD under queue task 9602 (via #5535). This issue stays open; what the PR settled and what remains:Settled by #12637
NoteCheckpoints::from_eventsrebuilt every note as Public, so a scoped note silently reopened after a restart and a stranger's append was lawful. Nowpolicies()snapshots the effective policy of every note andseed_policies()/from_events_with_policies()re-state it after a rebuild (events first, then policies), refusing corrupt input atomically — a record for an unknown note (UnknownNote) or naming an owner other than the create event's author.CollabState::note_policies()/seed_note_policies()expose the pair on the session path.bd7252dd0):access()reads the owner from the create event — the revision whose ID is the note's ID — not the first ID-sorted revision, which a later revision can precede.test_a_scoped_policy_survives_a_restart_rebuild,test_seed_policies_refuses_unknown_notes_and_wrong_owners,test_restored_owner_comes_from_the_create_event_not_the_first_sorted_revision,test_policies_snapshot_serializes_for_the_host_to_persist) and id-web's productionCollabState(test_note_policies_survive_a_restart_rebuild— granted user and group member checkpoint after a rebuild, stranger refused and the refusal records nothing;test_seed_note_policies_before_events_is_refused).Independent verification (Lane AD, not the author's runs)
bd7252dd0, in thepkgs/iddev shell:cargo test -p id-store -p id-web --lib→ id-store 244 passed / 0 failed, id-web 735 passed / 0 failed. This includes the fullnote_checkpointsandcollab::module runs the PR body listed as not run.What remains on #3819 (unchanged by this PR, named precisely)
note_events()+note_policies()with the host's checkpoint snapshot and re-seed (events, then policies) on startup, with a host-level restart test.note.policyevent kind, which needs an ordering rule (design note first). Acceptance bullet 1's replica-sync half and the boundary on replicas stay open until then.The remaining acceptance bullets (checkpoint to a signed revision without emitting ephemeral steps/cursors; concurrent heads with explicit merges; filename-based editing compatibility) rest on the previously landed checkpoint-log work and are untouched by this PR.
dezren39 commentedon Nov 22, 2026
Lane AW claiming slice 1 of the #3819 remainder (per the Lane AD record): host persistence wiring.
Premise (from PR #12637, merged
2ba5263dfa): the snapshot API pair exists —NoteCheckpoints::policies()/seed_policies()/from_events_with_policies()in id-store,CollabState::note_policies()/seed_note_policies()alongsidenote_events()/seed_note_events()in id-web — and the restart path is proven at the log/session layer. What is missing: no host persists the events+policies snapshot or re-seeds it on startup, so acceptance bullet 1 is not yet end-to-end in the serving host.Slice: persist
note_events()+note_policies()with the host's checkpoint snapshot and re-seed (events first, then policies) on startup, with a host-level restart test as the oracle — set a non-Public policy, restart the host state, assert the policy is still in force (and a Public note stays Public).Out of scope for this slice, in order: (2) replica sync of policies (needs the
note.policyordering-rule design note first), (3) wire-level tests. #5535 unchanged.test(id-web): host restart drill for note checkpoint persistence (#3819)
id: note policies survive a real host restart (#3819)
Merge pull request #12708 from developing-today/archer-lane-aw/3819-h…
dezren39 commentedon Nov 22, 2026
Slice 1 of the remainder is landed: host persistence wiring. PR #12708 merged (
773a306a014ef0495ac518114732b5b9f58cb4bc).Premise (verified on main
dee25f7dbf6): the snapshot pair from #12637 existed with no caller across a restart —web_routers_with_surface(theid servepath) built itsCollabStatememory-only. One gap inside the gap:AppliedNotecarried no serde derives (its fields already do — the same typesNotePolicyRecordserializes), so the events half of the snapshot had no durable form at all until this slice added them.The wiring:
id-store:AppliedNoteisSerialize/Deserialize— the events are the durable form of the log.id-web:NoteCheckpointSnapshot(events + policies in one document, never written or read apart);CollabState::note_snapshot()/restore_note_snapshot()(events first, then policies, validated as a whole viafrom_events_with_policies); a snapshot path installed bywith_note_snapshot_path. Every mutation that leaves the log in a complete state — a publication (publish_note_checkpoint_text, so create + checkpoint), a policy change (set_note_access), a full restore — rewrites the file atomically (temp name + rename in the same directory). Persist is deliberately not hooked into the individual seed steps: the file never holds an events-only intermediate that would reopen notes as public after a crash. A write failure is logged (tracing::warn!), not propagated — the mutation already landed in memory.web_routers_with_surfaceinid-web— the pathid serve(id-cli) actually runs. The snapshot lives at.note-checkpoints.jsonbeside the identity store (derived fromidentity_db_path, mirroring how the local-events dir is derived), and restore runs before any router serves. Missing file = fresh host; a file that does not parse or does not fold fails startup (NoteSnapshotError::{Corrupt, Checkpoint}) — a failed restart, never a host that silently reopens scoped notes to public. States without an installed path (in-processAppState::new, tests) are unchanged, memory-only.Oracle and evidence: failing first — the tests-only commit fails to compile with exactly the missing pieces (
cannot find type NoteCheckpointSnapshot,no method named with_note_snapshot_path; 5 errors). The drill,test_note_policies_survive_a_host_restart_through_the_snapshot_file: a live state persists as it mutates (file parses as a snapshot: 2 events, 2 policy records); a fresh state over the same file restores — granted user and group member chain onto the scoped note, a stranger is refused withNotAuthorizedand the refusal records nothing, and a public note stays public for the same stranger. Plustest_a_corrupt_note_snapshot_fails_the_restart_not_opens_notes(truncated JSON →Err; missing file →Ok(false)).Verification (laptop worktree,
nix developinsidepkgs/id, per the workspace's own flake): the two new tests pass;cargo test -p id-store -p id-web --lib→ id-store 244 passed / 0 failed (baseline unchanged), id-web 737 passed / 0 failed (735 baseline + 2 new);cargo fmt --checkclean; no clippy findings in the touched files. Execution note: this lane's sandbox clone tripped the platform execution-risk flag on arrival, so all git/build/test ran in a laptop worktree (~/wt-lane-aw-3819, brancharcher-lane-aw/3819-host-persistence) under Drew's standing clone/laptop approvals; the sandbox clone was read-only reference only.Remainders, in order (unchanged):
2. Replica sync of policies — the
note.policysync kind and its ordering rule; needs the design note first (does a policy travel with the events it governs, or as its own kind, and what wins when they arrive out of order?). Not designed in this lane.3. Wire-level tests — policy enforcement asserted over real transports (iroh + loopback HTTP), including a scoped note created on one node, synced, and refused to a stranger on a second node after that node restarts — the restart leg of that drill can now run against the persisted snapshot this slice landed.
#5535 stays parked on this issue; this slice does not change its state.
fix(id): policies() snapshots only recorded policies (#12751, #3819)