Skip to content

feat(session): fts.session over vox, the caller from the call's principal - #181

Merged
fts-forge[bot] merged 1 commit into
mainfrom
feat/session-host
Nov 18, 2026
Merged

fts-forge[bot] merged 1 commit into
mainfrom
feat/session-host

Conversation

@fts-forge

@fts-forge fts-forge Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Step 2 of the plan in docs/design/session.md §9: the fts.session service. Stacked on #179 (base feat/session-primitive).

What it is

session::host (feature vox):

  • SessionService::ask(doc, request): an #[architect::rpc] service over service::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 as Principal::Extension { id, .. }, and id is 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>:

request action
reads read
edits write
tempo, markers, regions structure

The gate's table (PERMITS) checks read before decoding, where {doc} widens to doc/**; 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::new documents that.

Tests

tests/session/host.rs, over a vox memory link behind the real PermissionsGate:

case expected result
two extensions write and read each sees only its own namespace pass
read-only link's guest reads data and the timeline pass
read-only link's guest refused edits; nothing written pass
link guest asks another session refused pass
a person's own principal refused pass
unknown session NotFound pass
structure as a member refused pass
structure as an owner allowed pass

The 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 --check
  • clippy with warnings denied: whole workspace and each feature set
  • cargo test -p session --all-features: 40 tests
  • the wasm32 check

🤖 Generated with Claude Code

…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>
@fts-forge
fts-forge Bot changed the base branch from feat/session-primitive to main November 18, 2026 02:16
@fts-forge
fts-forge Bot marked this pull request as ready for review November 18, 2026 02:17
@fts-forge
fts-forge Bot merged commit fe3e244 into main Nov 18, 2026
1 check passed
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.

0 participants