Skip to content

org: hosted chat rows carry the asker's verbs from the server - #2905

Merged
AbirAbbas merged 3 commits into
org/mainfrom
org/hosted-verbs
Nov 25, 2026
Merged

AbirAbbas merged 3 commits into
org/mainfrom
org/hosted-verbs

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

What changes

The desktop engine's hosted door worked out a person's verbs on a hosted chat itself, from the default policy's role table (appHostedRoles): the owner got every verb, a guest got the verbs of the role's name, and an unknown role got view. The organization server's roles and policy are configurable, so on any server whose policy differs from the default the window showed the wrong controls.

Now the server says it:

  • Every row of GET /v1/hosted/sessions (sessions and shared), and the answer to POST /v1/hosted/sessions, carries verbs: what the caller holds on that chat under the policy as it stands when the list is read. It is the guest wire's own decision (hostedGuestVerbs, re-read every heartbeat), so a row and the wire cannot come from two readings of the policy. A bot's rows hold its person's verbs narrowed by its scope. An operator-only row holds none. A verbs field the chats' host wrote is replaced.
  • The desktop engine reads verbs and nothing else. A row with no verbs (an older server) reads view only, for another person's chat and for the person's own. That is safe because it only hides controls: the wire refuses what the person does not hold, and nothing on the client enforces anything. appHostedRoles and the role mapping are removed.
  • Unchanged: the wire's enforcement, and the desk-facing HostedFacts.Verbs []string shape. I grepped the desk's org/hosted-routing worktree read-only: it only reads agent.hosted.verbs and tests it with includes("run" | "steer" | "answer"), so the desk needs no change.
  • Docs: deploy/org/README.md (the list row), docs/design/app-v3/PROTOCOL.md (hosted rows), and the manual page organization-hosted-sessions.md (the first section said the window shows "the actions your role allows").

Validation contract

  1. Every list row (own and shared) carries the asker's verbs from the live policy at list time: TestHostedListRowsCarryTheAskersVerbsFromTheLivePolicy (default policy, then a policy saved with no restart), TestHostedCreateAnswerCarriesTheMakersVerbs, TestHostedRowVerbsOfABotAreItsScope, and TestP2_2_HostedListKeepsOwnRowsAndLimitsSharedMetadata (shape, operator rows, single-chat read).
  2. With a non-default policy the engine's HostedFacts.Verbs is what the server enforces: TestHostedRowVerbsMatchWhatTheWireEnforces (server: each verb a row names is forwarded by the guest wire, each left out is refused, under a policy where edit cannot steer and the owner role cannot run, steer or manage) and TestAppHostedV2ListOnlyOwnAndShared plus TestAppHostedV1CreateOnOrganizationServer (engine: facts equal the server's verbs exactly, for a custom edit role and a restricted owner).
  3. No verbs means view only, never owner-equivalent: TestAppHostedV2ListOnlyOwnAndShared (own row with none, unknown role, familiar role with none, empty list, unknown verbs; order and duplicates normalised).
  4. Wire enforcement unchanged: the existing wire and heartbeat tests pass as they were, and TestHostedWithVerbsReplacesTheHostsOwnField pins that the host never decides.
  5. appHostedRoles removed; the desk shape is unchanged.
  6. Docs updated as above.

Worth knowing

  • An owner whose policy still holds run is attached by the byte-for-byte proxy, which has no verb table. Their row names what the policy gives them, which can be fewer verbs than the wire would let through (a policy where the owner role has run but not steer). That errs toward hiding a control, never showing one the wire refuses.
  • A handler built without a store relays the host's rows untouched, so they carry no verbs and read as view only. The server that runs chats is always started with its store.

🤖 Generated with Claude Code

AbirAbbas and others added 3 commits November 24, 2026 21:01
Every row of the hosted list (the caller's own and shared) and the answer that
makes a chat now name the verbs the caller holds on that chat, decided by the
same function the guest's wire re-reads every heartbeat, so a row and the wire
cannot come from two readings of the policy. A bot's rows hold its person's
verbs narrowed by its scope. An operator-only row holds none, and a verbs
field the chats' host wrote is replaced. The wire's enforcement is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…role table

The hosted door worked out a guest's verbs from the default policy's roles, gave
an owner every verb, and read an unknown role as view. An organization whose
policy differs from the default was therefore shown the wrong controls. The door
now reads the verbs on each list row and on the answer that makes a chat; a row
with none reads view only, which only hides controls because the server's wire
refuses what the person does not hold. The client role table is removed, and the
desk-facing HostedFacts.Verbs shape is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@AbirAbbas
AbirAbbas merged commit 0232c12 into org/main Nov 25, 2026
11 checks passed
@AbirAbbas
AbirAbbas deleted the org/hosted-verbs branch November 25, 2026 02:35
AbirAbbas added a commit that referenced this pull request Nov 25, 2026
…ack (#2903)

The hosted organisation line: a team-mode org server deciding every request through one access model (verbs, roles, grants and policy in SQLite), hosted chats run by the sessionhost under a per-chat uid inside a Landlock fence with minted model bearers, sealed keys and a git helper, shared chats acting through verbs, bots owned by their creator, the Hosting and chats policy settings, and a self-hosting stack (deploy/org Docker Compose, published images behind a leak gate, a Railway path).

Consolidates #2894 #2895 #2896 #2898 #2899 #2900 and the follow-ups #2904 #2905 #2907 #2908 #2910 #2911 #2912 #2913 #2915 #2916 #2918 #2927 #2936 #2944. Proven by the full suite, a keyless Compose smoke, a hostile wire client, sandbox escape probes, a real-model run and a production-style install from the published images.

Co-Authored-By: Santosh kumar <[email protected]>
Co-Authored-By: ZeroPoint95 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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