Repository navigation
Conversation
A chat is private by default (the policy's default for the kind, and what
backfill registered), but GET /v1/workstreams/{id}/chats listed every other
person's chat title, owner, state and last activity to anyone who could see the
workstream (v2 ruling C10), whatever the chat's own visibility. Abir's call of
2026-11-24: chats are private by default, and a private chat is hidden from
shared lists. The list now asks the one decider whether the viewer may view each
chat, so only the owner and the people it is shared with see a private one; the
operator sees nothing private; a chat with no registry row is hidden.
An organization that wants the old listing sets the policy's default for chats
to owner or org; it applies to chats made after the change.
CONTRACT CHANGE: two tests asserted the old listing (the C10 block of
TestMySpaceChatsRunOnTheServerAndStayPrivate and
TestContractI9SharedWorkstreamChatListKeepsOnlyMetadata); they now assert that
the chat is hidden until shared, then listed with metadata only. The new
TestContractA* tests are derived from the lane's validation contract.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2890 dropped santosh/work's chats.read method (#2650) because dev's agents.entries already follows a saved remote head under the chats.read hello word. Abir's call of 2026-11-24: nothing Santosh added is dropped. The two are different abilities: dev's reader fetches the whole saved transcript, this one fetches only the transcript's own objects and the chunks under one page, into the store a later agents.take uses. Restored from the parent of cc9ca26 (the chunk-paged reader in cellsync and cellstore, the furrow path verbs, syncsetup.ReadChatPage, the engine method and its tests), additively: the method is advertised under a NEW hello word, chats.read.paged, and the chats.read word keeps exactly the meaning it has on dev, so a client can tell which ability an engine has. agents.entries and its tests are untouched. The embedded furrow is v0.3.7 again (it adds the path verbs; its checksums match the release's SHA256SUMS); without them the word is absent from hello, not present and failing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…it was shared with Sharing a private chat with one person used to un-private it, after which it inherited the workstream's shares and grants, the workstream owner's share and the operator. So sharing a chat with one person showed it, title and all, to everyone who could see the workstream. A private registration with a live grant on itself is now a closed private item: shares, organization visibility, inherited grants and the operator (unless the policy lets it see private things) stay out, and only its owner and the people its own grants name reach it. The grants list shows those grants and the audience of its events names the same people. Three older tests encoded the wider audience (the operator's chat list, the move event's audience, the sweep's lapse audience) and are changed to the contract, each with a comment saying so. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A request from 127.0.0.1 with no credential used to act as the factory's owner on every factory, so on a team server any program on the same machine, or any same-machine proxy that did not add a forwarding header, was the owner. The host config now has a `loopback_trust` key (true or false). Unset, it is on for a solo factory, which is one person at one computer, and off for a team factory: a credential-free local request is refused like one from any other machine, and one with a token or a session acts as that identity. A team factory used by one person at one computer can set it to true and gets the old behaviour back. The forwarded-header rule holds whatever the key says: a request carrying X-Forwarded-For, Forwarded, X-Real-Ip or X-Forwarded-Proto (even with an empty value) is not local unless a listed proxy names a loopback client in X-Forwarded-For. Tests cover an unlisted and a listed proxy with a remote client, a Forwarded-only request, X-Real-Ip alone, garbage forwarding headers, and both IPv6 loopback forms. Worker attach keeps its own local door (as it had), so a runner on this machine can still attach before its person signs in. Test fixtures that act as the host's person on a team-mode handler now say so with an explicit LoopbackTrust. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… their creator A person can make a bot (a name and, optionally, a narrower role) and gets its `cbt_` token once, in that answer. The store keeps the sha256 of the token with an eight-character hint and a last-used time, at most three live tokens per bot and twenty bots per person. A request with a bot token acts as the bot: the creator's verbs on the item right now, intersected with the organization policy's scope for `bot:<id>` and with the role the person gave the bot, through the same on-behalf-of evaluator Afi uses, with the creator as sponsor. Nothing is cached, so a creator who loses a share takes it from the bot on its next request, and a role that is later deleted means no verbs. What a bot creates is owned by its creator and recorded as created by the bot (kind `bot`, its id, the creator as sponsor); a chat it makes is private like any other chat. Revoking a token, removing a bot, or the operator removing the creator from the organization ends the credential on the next request with words that say which; an unrecognised `cbt_` token is a 401 and never falls through to loopback or the host's identity, and a bot token beside a session cookie is refused. Bots are default-deny. A bot reaches workstreams and what is under them (except the agent door, requests, drivers, jobs and imports), canvases, resources, My space, and the policy, member, team and about reads. Everything else answers "a bot cannot use this yet", and a bot cannot start an agent run. A bot cannot make bots, mint or revoke tokens, or use the operator's routes. A person lists, mints for, revokes and removes only their own bots; the operator lists every bot and may remove any, but cannot mint a token for another person's bot. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
factory.org_bots, factory.org_bot_new, factory.org_bot_token_new, factory.org_bot_token_revoke and factory.org_bot_remove follow the org_access pattern: one fixed request each, with checked path segments, advertised only by an engine that can reach an organization server. The minting answers carry the secret once; nothing logs a request or reply body on this path. PROTOCOL.md names every method and says the secret is shown once. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…isted to a workstream The chat manual now says what bots are and are not (a token shown once, never more than the person who made it, default-deny routes, no agent runs, ended with the creator), what loopback_trust does and why a forwarded request is never local, and adds probes in people's own words for both. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Five tests drove a team-mode factory with no credential from the same computer and relied on the old rule that such a request is the owner. They now say it with an explicit loopback trust (a plan-revision handler, a team publish and a worker fixture, the worker reply fixture), or, where the point is how a local client reaches its factory, send the token from the discovery file as every client does (the factory command test). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Says what was true and what is true now for private chats, the shared-chat audience, the paged remote read, loopback trust on a team server and bots, including the sentence in the #2890 entry that is no longer true. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A team factory with loopback_trust off (its default) no longer lets a process on the server's own computer attach a runner with no credential. A runner presents what a remote runner already uses: the host's access token, or a signed-in person's session. It names its handle unless its session does, and the factory's own person no longer stands in for one that names none. A solo factory and a team factory that sets loopback_trust are unchanged, and the app's private listener keeps its host token as the credential. Contract item C12 and its table test, the manual line, the PROTOCOL.md paragraph and the change entry go in the same commit. Three fixtures that attached with no credential to a team handler now say so (two opt in, the factory command test checks the 401 and attaches with the discovery token). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The paged remote reader keeps the method name chats.read, which the desk calls it by, and advertises itself under the hello word chats.read.paged. Dev's older chats.read word only says agents.entries follows a saved remote head. One sentence in PROTOCOL.md says so. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Nov 24, 2026
Collaborator
Author
|
Consolidated into #2903, the |
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]>
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.
Summary
Follow-ups to #2890 from the 2026-11-24 calls on the organization server. Draft; do not merge.
GET /v1/workstreams/{id}/chatsnow askscan(viewer, chat, view)for each chat, so a private chat is hidden from the workstream and from the operator, and a chat shared with someone is listed to its owner and the people it is shared with alone. Writing the contract test found a hole in the decider: a private chat's first grant un-privated it, after which it inherited the workstream's shares, the workstream's grants and the operator. It is now a closed private item (acl.Item.Closed): only the grants on the chat itself reach it. The audience of its events names the same people.chats.read {cell, before?, limit?}is back, additively and under its own hello wordchats.read.paged. Dev'schats.readword keeps its meaning (agents.entriesfollows a saved remote head) and its tests are unchanged. The answer carriessealed_at_msandfetched_bytes; a page fetches only the transcript's own objects and the chunks under it; a read takes no lease and runs no agent. The furrow pin moves to v0.3.7 for the verbs the read needs.loopback_trust. Unset: on for a solo factory, off for a team factory, where a credential-free request from the server's own computer is now a 401 like one from any other machine. The forwarded-header rule holds whatever the key says (tests: unlisted and listed proxy with a remote client,Forwardedonly,X-Real-Ipalone, garbage headers, both IPv6 loopback forms).cbt_token once; the store keeps only its sha256. A bot acts with its creator's rights right now (nothing cached), intersected with the policy's scope forbot:<id>and its own role, through the existing on-behalf-of evaluator with the creator as sponsor. What it creates is owned by its creator and recorded as created by the bot. Revoking a token, removing a bot, or removing the creator from the organization ends it on the next request. Bots are default-deny with a route allowlist and cannot start an agent run, make bots, mint tokens or use operator routes.loopback_trustoff (a team factory by default) a runner needs a runner credential even from the server's own computer: the host's access token or a signed-in person's session, the ones a remote runner already uses. The factory's own person no longer stands in for a runner that names no handle. Solo, and a team factory that setsloopback_trust: true, are unchanged; a bot token is still refused there.factory.org_bots,factory.org_bot_new,factory.org_bot_token_new,factory.org_bot_token_revoke,factory.org_bot_remove, hello wordorg_bots; PROTOCOL.md names them.organization-sharing.md,factory.md,my-space.md,workstream-chats-and-tools.md) and probes for bots and the loopback setting.Validation Contract
others: []for it (no title, owner, state or time); P's own list is unchanged; a grant on the chat lists it to that person alone and removing or lapsing the grant takes it away; a chat in My space is never listed to anyone else; the policy default for chats can be changed and applies to chats made after the change only; creating a private chat emits noresource.changed; a chat folder with no registry row is never listed; a private chat moved from My space into a workstream stays private.chats.readhello word unchanged;chats.read.pagedadvertised only by an engine that can read one file of a relayed snapshot; a page is newest first with a cursor,sealed_at_msandfetched_bytes; later pages and a later take do not refetch; a read takes no lease; without the capability the call is refused in words.loopback_trust: truedo not; a forwarding header never makes a request local unless a trusted proxy names a loopback client. A bot's verbs on an item are at most its creator's current verbs; the creator losing a share takes it from the bot on the next request; a deleted scope role means no verbs; tokens are shown once and never listed; revoke, removal and the creator's removal end the bot with words; an unresolvedcbt_token never falls through to loopback; a bot cannot reach a route that is not on the allowlist.Contract changes against #2890's tests
Each is a stated behaviour change, not a reshaped test, and carries a comment saying so: the operator's chat list, the chat-move event audience and the lapse-event audience no longer include the operator or the destination's people for a chat shared with one person (A); the others-list assertions in
myspace_test.goandaccess_move_chat_test.go(A); ten test fixtures that acted as the host's person on a team-mode handler with no credential now setLoopbackTrustexplicitly, and one sends the discovery token (C). Two worker test fixtures that attached a runner to a team-mode handler with no credential also opt in explicitly, and the factory command test now checks that a credential-free attach is 401 and attaches with the discovery token (C12).Test evidence
make test-quick: clean, includingGOOS=windows go vet ./...and the manual gates; windows/amd64 and darwin/arm64 builds of the touched packages.internal/factory/...tree, including serve (271 s) and factorytest (384 s);internal/appwire,internal/manual;cmd/codeafrun for the Factory and Runner tests and the config and loopback tests; item B'scellstore,cellsyncandsyncsetupwith furrow embedded throughmake.bin/codeaf factory servein team mode with a second person in a throwaway home: loopback andX-Forwarded-Forrequests with no credential are 401; the second person lists 0 other chats until the owner shares one, then 1; a bot token acts within its creator's rights, is cut when the creator's share is removed, a chat it makes is its creator's and private; revoking a token and removing the creator end the bots;loopback_trust: trueopens the local door and a forwarded request is still refused.make pr-ready, fullinternal/tui3,internal/sessionandcmd/codeaf. CI covers them. One local failure is environmental and in a package this branch does not touch:internal/factory/agentfield TestTheClientRefusesAWrongKeyInWords(an unreachable local port answers "did not answer in time").Open decisions
chats.read, as the reader Organization server: access model phase 2, run-owner proof, one chats.read #2890 removed, because the desk calls it by that name. Dev's hello word of that name means something else, andchats.read.pagedis the word that says the paged reader exists; PROTOCOL.md says in one sentence that the method and the older word are different things.loopback_trust(no implicit machine owner). The runner credential is the one a remote runner already uses, so nothing new was invented. A runner that is joined to a team server from the server's own computer now has to send the host's access token (codeaf runner join <url> --token ...) or a person's session, or the host setsloopback_trust: true.chats.read.paged, are listed in the lane notes (Rust:relay.rs,lib.rs; TypeScript:backend.ts,remoteChats.ts,RemoteChats.tsx,RemoteTranscript.tsx,engineModel.ts,remoteChatsModel.ts, the mount tests andbackend.settingsWrites.test.ts).🤖 Generated with Claude Code