Repository navigation
feat(permissions): add capabilities and scoped tokens - #6
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
PiquelChips
force-pushed
the
feat/permissions
branch
from
October 14, 2026 14:54
730bb9b to
21caf29
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
2 times, most recently
from
October 14, 2026 17:32
6cef652 to
202bf52
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
2 times, most recently
from
October 14, 2026 18:50
8af0822 to
fe22e3e
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
from
October 14, 2026 21:10
fe22e3e to
cd2e8ca
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
from
October 14, 2026 21:29
cd2e8ca to
14a2c0a
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
2 times, most recently
from
October 14, 2026 21:46
e4017c6 to
2121267
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
from
October 14, 2026 21:48
2121267 to
38675f3
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
from
October 14, 2026 22:00
38675f3 to
c7d6efd
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
from
October 15, 2026 11:11
c7d6efd to
0bec471
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
from
October 19, 2026 10:43
1219d86 to
4ad7211
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
2 times, most recently
from
October 28, 2026 16:49
2c1a19f to
df030d0
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
from
October 28, 2026 20:33
df030d0 to
161d8db
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
2 times, most recently
from
November 2, 2026 14:14
8c541f7 to
3dc97d7
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
2 times, most recently
from
November 2, 2026 23:34
d736f8d to
7cd65f8
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
from
November 4, 2026 17:58
7cd65f8 to
65990d1
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
6 times, most recently
from
November 4, 2026 19:41
8d93a6a to
e24349d
Compare
PiquelChips
force-pushed
the
feat/permissions
branch
3 times, most recently
from
November 4, 2026 20:50
1c2976b to
bb3a243
Compare
policy.toml now says who may do what: [[paths]] rules give each user, node or group none, read or write under a path, and [grants] the annotate, land and admin capabilities. Only admin lands on `policy`, so no one grants themselves rights. Servers authenticate bearer tokens: static ones from their configuration, or short-lived scoped ones they sign with their node key and verify without storing, which only narrow their principal's rights (`origin token issue`). A token lasts at most 7 days, and one issued with a token expires with it. OriginService filters what each caller reads: a caller who reads no path sees nothing of the repository, snapshot walks withhold the content of unreadable paths, and revisions that only change such paths are hidden with their statements and events. Writes are checked: records put must be the caller's, statements must be about what they see and of a kind they annotate, promotions included, revisions may only change paths they write and only hold content they supplied or that a snapshot they refer to holds at the same path, and landings may only change what the submitter writes, whatever they land. Where a writer may not write, a successor must have exactly each predecessor's effect: the same files changed from the same entries to the same ones, on the same change below, with exactly the same conflicts unresolved; a root lists only those of the revision it's on. So anyone may take a change over and hand it on, but no base, chain of revisions or other change makes it revert, replace or resolve what they can't write, or add a conflict there. Only a new change gets a root, and revisions evolve only from their own change's, so no one becomes a change's creator, who abandons it, by adding one. Reserved kinds come only from those core names, whoever puts them. A batch is read before the store, so it may hold a stack. Promotions only copy results from records the caller sees. Descriptions and payloads become attachments, an object kind of their own, so no record can carry a file's content. Snapshots are fetched by the record they belong to, never by a tree within one. Clones record each user's rights, keep withheld files out of the working copy and in their snapshots, and refuse pushes the server would reject. A checkout asks the remote only for the files the clone lacks, so one that needs nothing from it works offline. Each user of a clone, and each scope of their tokens, keeps their own rights and event cursor, so the workspaces of one clone can act for different users and agents. Once their rights change, the next fetch compares every change again: the events since the last fetch don't show what they couldn't see then. The API also lists directories and reads files of any snapshot, without its history. New commands: `whoami`, `permissions`, `token issue`. An admin may also abandon anyone's change (`Policy::authorizes`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the old
origin.tomlpermissions.policy.tomlnow says who may do what:[[paths]]gives each user, node or groupnone,readorwriteunder a path.[grants]gives theannotate,landandadmincapabilities.Only
adminlands onpolicy, so nobody can grant themselves rights.Tokens:
origin token issue).Reading:
Writing:
Taking over a change: on paths a writer can't write, a new revision must have exactly the effect of each of its predecessors. That means the same files, changed from the same contents to the same ones, on the same change below, with the same conflicts unresolved.
Clones:
New commands and endpoints:
whoami,permissionsandtoken issue.GET /treeandGET /file, which browse any snapshot without its history.Benchmarks: permission checks cost nothing measurable. A landing takes about 16 ms with or without rules, and a 20k-file snapshot walk about 38 ms.
Review fixes: a pushed
core.conflictmust come with its list, or be refused. Proved with focused tests that fail without their fix, andjust(332 tests).Reviewed with review-loop: 2 rounds with 2× GPT-6.1 Sol and Claude Opus 5.5. Verdict: approved
Note
Written by Claude Opus 5.5 in Claude Code, reviewed by GPT-6.1 Sol and Claude Opus 5.5 over three review rounds (via T3 Code).
🤖 Generated with Claude Code