Skip to content

feat(id): note access boundary at checkpoint time (#3819 Phase 3 slice 3) - #10846

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

dezren39 merged 1 commit into
mainfrom
queue/5826-3819-access-boundary

Conversation

@dezren39

@dezren39 dezren39 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What

Refs #3819 — Phase 3 slice 3 of 4 (access boundary). Slices 1–2 landed in PR #10808 (checkpoint core) and PR #10831 (WS wiring). This slice enforces Drew's recorded answers on #2048 at checkpoint time:

  • Q2 (ruling, comment 6599898441): members holding a write grant may append revisions; the owner retains grant/revoke; appends are attributed, never silent overwrites.
  • Q3 (ledger shared-notes-read-3819): notes are public by default, or read/write/admin to one or more groups and users.

id-store note_checkpoints — the policy + enforcement core:

  • NoteAccess (Public default | Scoped(Vec<NoteGrant>)), NoteGrant over NotePrincipal::{User, Group} with the Q3 ladder NoteRole::{Read, Write, Admin}. The note layer's ladder is deliberately its own (id-store depends on id-core only); a group resolver maps group roles onto it (Read→Read, Write/Manage→Write, Admin→Admin).
  • Every note records its owner (the create author, always Admin). effective_role / may_read / may_append evaluate owner → public → user grants → group grants via the GroupRoles resolver (a closure seam; GroupRoles::none() knows no groups).
  • Checked publish paths checkpoint_checked / checkpoint_on_heads_checked / merge_checked refuse with the new CheckpointError::NotAuthorized and record nothing. set_access takes Admin (owner or admin grant). The raw graph appends stay as the fold primitives from_events rebuilds through.
  • Policies are application state layered over the event log (the events carry no policy): a rebuilt log treats notes as owner-created + Public until the host re-states policies via set_access — stated in the module docs, not hidden.

id-web collab — the wiring:

  • CollabState carries a GroupRoles resolver (with_note_group_roles builder; default none) and a set_note_access delegate.
  • publish_note_checkpoint now publishes through checkpoint_on_heads_checked, so a scoped note refuses a non-grant author's publication — including at session end, where a refusal is already logged, never fatal (slice 2's shape).

Tests

  • id-store: 5 new boundary oracles (public attributed append; scoped refusals leave the log byte-identical; group grants resolve + cap at the resolver's lesser role; policy changes take Admin, owner retains it; merge enforces the boundary). cargo test -p id-store green (234 + 12).
  • id-web: new test_publish_note_checkpoint_enforces_the_access_boundary (owner scopes → granted author chains, stranger refused with nothing recorded, write-grant holder cannot re-open). Collab suite 46 passed.

Deliberately not in this slice

  • Slice 4 (wire-level integration tests) remains on task 5826, as does building the production GroupRoles resolver over the folded groups projection in id-web/src/groups.rs (the seam is installed; the default resolver knows no groups, so group grants take effect once a host wires its projection in).
  • Grant events in the note graph (policies as signed events) — the policy layer here is application state, matching how session bindings already work; a graph-level grant kind is a design step beyond the pinned slice sequence.

Part of queue task 5826.


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 18:02
@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-16T18:02:55.363075Z
We couldn’t complete this review. Comment @codex review to try again.
5f73011 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.

@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 31 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: 6f8fb229-bd53-49c1-b910-171ef4b37f1e
Commits

Reviewing files that changed from the base of the PR and between c70b167 and 5f73011.

Files selected for processing: 2

  • pkgs/id/crates/id-store/src/note_checkpoints.rs
  • 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

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