Skip to content

feat(session): fts.session as an Architect extension service - #182

Merged
fts-forge[bot] merged 2 commits into
mainfrom
feat/session-extension
Nov 18, 2026
Merged

fts-forge[bot] merged 2 commits into
mainfrom
feat/session-extension

Conversation

@fts-forge

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

Copy link
Copy Markdown
Contributor

Step 3, the session half: what Keyflow (or any host) needs to serve fts.session to an extension's view inside an Architect app. Stacked on #181.

How Architect's extension services work, and where this fits

  1. One extension asks another through the host with services.call("fts.session", method, args) (HostRequest::Service).
  2. The host runs the provider's action <PREFIX><METHOD> as the caller.
  3. On Architect's newer code (the runtime-compositor-keyflow pin, f0c04916; not v0.12.6), the action's context carries the caller's id as cx.caller, taken from the call's principal (invocation::caller_json). architect.playhead uses the same field.

session::extension::answer (feature extension) is what that action does. It needs no Architect crate:

  • in: {doc, request} as JSON;
  • out: a Response as JSON;
  • the namespace: cx.caller's.

Methods, so Architect's own permission holds them

method the provider's action effect requests
read read_only ReadData, ReadTimeline
write mutating the caller's namespace, lanes, items
structure mutating tempo, markers, regions

answer refuses a request sent through the wrong method. So a share link's guest, whose extensions Architect runs read_only, can call only read: its edits are refused by the host's effect check before the provider runs. That's a permission, not a code path.

Also

  • service::action_for, READ / WRITE / STRUCTURE and the Sessions registry move into service. The vox face (host) and this one share them; host re-exports its old paths.
  • CI's clippy loop covers extension and vox.

Tests

tests/session/extension.rs:

  • the caller in the context is the namespace;
  • a method takes only its own kind of request (an edit sent as a read is refused and writes nothing; structure only through structure);
  • no caller, an unopened session or bad JSON are refused;
  • payloads cross JSON whole.

Checked

In the fleet shell:

  • fmt
  • clippy with warnings denied: workspace and each feature set
  • 44 tests
  • wasm32

The host-side effect check itself is Architect's and is not exercised here. The Keyflow PR will exercise it once its extension registers these actions.

🤖 Generated with Claude Code

Inside an Architect app, one extension asks another through the host:
`services.call("fts.session", method, args)`, run as the provider's
action `<PREFIX><METHOD>` as the caller, with the caller's id in the
action's context (`cx.caller`, from the call's principal).
`session::extension::answer` (feature `extension`) is what that action
does, with no Architect crate: JSON in (`Call { doc, request }`), JSON
out (a `Response`), for `cx.caller`'s namespace.

One method per action a request needs (`read`, `write`, `structure`), and
`answer` refuses a request sent through another, so the effect each
method's action declares (read_only, mutating) is what Architect's own
check holds a caller to: a read-only share link's guest extension reads,
and its edits are refused before the provider runs.

`service::action_for`, `READ`/`WRITE`/`STRUCTURE` and the `Sessions`
registry move to `service`, shared by the vox face (`host` re-exports
its old paths) and this one. CI clippy covers `extension` and `vox`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…JSON

A `Response::Timeline` did not survive `facet-json`: its maps are keyed by
`LaneId` and `ItemId`, which it wrote as strings and could not read back
as ids ("expected LaneId, but got String"). Ignition's cue lists, the
first caller to read the timeline through the extension face, hit it.

The id newtypes are now `#[facet(transparent)]`: on every wire (JSON,
vox) an id is the string it wraps, a map key included. New test: a lane
and an item put and read back over JSON, keyed by their ids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fts-forge
fts-forge Bot changed the base branch from feat/session-host to main November 18, 2026 03:01
@fts-forge
fts-forge Bot marked this pull request as ready for review November 18, 2026 03:31
@fts-forge
fts-forge Bot merged commit cfb3037 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