Repository navigation
feat(session): fts.session over vox, the caller from the call's principal - #181
Merged
Merged
Conversation
…ncipal
`session::host` (feature `vox`): `SessionService::ask(doc, request)`, an
`#[architect::rpc]` service over `service::handle`, and `SessionHost`,
which serves open sessions by document id.
- The caller is `architect::permissions_gate::caller()`, never an
argument: `Principal::Extension { id, .. }` names the namespace, any
other principal is refused.
- What it may do is the permission engine's answer on `doc/<id>`: `read`
for reads, `write` for edits, `structure` for tempo, markers and
regions. The gate's table (`PERMITS`) checks `read` before decoding,
where `{doc}` widens to `doc/**`; the handler checks the exact document.
- The host asks the same engine as its gate: the org's one, which
answers a share link's guest by what the link grants. A read-only link
is a permission, not a code path.
Tests over a vox memory link behind the real `PermissionsGate`: each
extension writes and reads only its namespace; a read-only link's guest
reads and is refused writes, and a session the link does not cover; a
person's principal is refused; the structure action is a member's no,
an owner's yes. Payloads (`Value`, recursive) cross vox's schema
exchange.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Step 2 of the plan in
docs/design/session.md§9: thefts.sessionservice. Stacked on #179 (basefeat/session-primitive).What it is
session::host(featurevox):SessionService::ask(doc, request): an#[architect::rpc]service overservice::handle.SessionHost: serves the sessions a host has open, by document id.Who is asking: the call's principal (
architect::permissions_gate::caller()), never an argument. An extension calls asPrincipal::Extension { id, .. }, andidis its namespace. Any other principal is refused: a person's own view holds the document, it doesn't ask.What it may do: the permission engine's answer on
doc/<id>:readwritestructureThe gate's table (
PERMITS) checksreadbefore decoding, where{doc}widens todoc/**; the handler checks the exact document.Share links: the host asks the same engine as its gate, the org's one. Like Architect's spaces engine, it answers a share link's guest by what the link grants. So a read-only link is a permission, not a code path.
Found on the way
My first version checked with an engine of its own, while the gate checked with the lane's. The read-only guest test caught it: a guest is judged by the link's grants only if the host and gate ask the one engine.
SessionHost::newdocuments that.Tests
tests/session/host.rs, over a vox memory link behind the realPermissionsGate:NotFoundstructureas a memberstructureas an ownerThe payloads (
Value, recursive) cross vox's schema exchange.The link engine in the test is a small stand-in with the spaces engine's documented semantics (exact document,
doc/**by overlap). The real spaces engine is not exercised.Checked
In the fleet devenv shell:
cargo fmt --checkcargo test -p session --all-features: 40 tests🤖 Generated with Claude Code