Repository navigation
feat(workspace): a broker protocol for box capabilities and its conformance suite (#3164) - #3460
Merged
Merged
Conversation
…rmance suite (#3164) Specifies what a broker of box capabilities answers, as version 1 of a protocol: the declaration report, inference (the Anthropic proxy and the decide endpoint), egress, feedback and fountain, each route's scope word, and the rule that an undeclared word is a 403 naming the capability and the word. broker-protocol.schema.json holds the bodies and broker-protocol.ts the routes and scope words. runBrokerConformance and describeBrokerConformance check a broker against stand-in upstreams the caller serves, so chant itself still opens no listener. Records ws-097.
# Conflicts: # docs/design/decisions/README.md
# Conflicts: # docs/design/decisions/README.md # docs/src/content/docs/reference/boundary.mdx
This was referenced Oct 4, 2026
Closed
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.
A box holds no credential, and each capability in its box block names a broker and a scope. Until now, what a broker must answer was defined only by studio's lobby, so a team that wanted to serve a studio box without studio had to run or copy the lobby. This change writes the broker side down in chant as version 1 of a protocol, and ships a suite that checks an implementation.
The protocol is the lobby's existing wire surface, so studio passes without a change. A box reports its declaration to POST /api/box/declaration. Inference is the Anthropic proxy at /llm/anthropic (scope agent) and the decide endpoint at POST /decide/v1/systemone (scope decide), whose answers may carry the model's reason (#3345). Egress is /egress/NAME, where the scope word is the secret's name. Feedback is POST /api/feedback, with agent for entries and passive for counts. Fountain's API is at /fountain/api, with agent, conversations, sandboxes and vault. A request that needs a word the box's last report does not declare through this broker is a 403 whose message names the capability and the word. A box that never reported is refused. No upstream may see the box's token, and no answer may carry a credential or secret. The broker word in a box block names the broker the box reaches. An implementation answers for a configured word, so a box moves between implementations without changing its declaration. A capability is still a free string, and a lexicon or runtime adds one by giving a BrokerCapabilitySpec, which the suite takes in extra.
packages/core/src/workspace/broker-protocol.schema.json holds the bodies: the report and what is kept, the refusal, the decide request and answer, and the feedback batch. broker-protocol.ts holds the routes, the scope words, parseDeclarationReport and declaredRefusal. The suite is runBrokerConformance in @intentius/chant/workspace/conformance, with describeBrokerConformance in the vitest entry. It starts stand-in upstreams for Anthropic, Fountain and an egress echo host, calls the broker's start(env), and runs 23 checks. The caller serves the stand-ins through a listen function it passes, because chant itself never opens a listener (ws-052, test/no-listener.test.ts). A reference broker lives as a test fixture and passes every check. Two broken variants, one that grants every scope and one that leaks the token upstream, are caught by the suite.
Docs: a new reference page, Broker Protocol, linked from the declaration's Boxes section. The design is recorded as ws-097, with a roster row in docs/data/boundary.yaml and the boundary page regenerated. The new page is added to the prose baseline for its front matter and the word broker.
Verified with the core build, tsc for packages/core, targeted vitest (broker-protocol, conformance/broker, no-listener, boundary-roster, reason-codes, decision-kind-doc), docs-check, the prose ratchet, the citations check and import-decisions --check. I also ran the suite against studio's kit lobby (kit/lobby/box-side.mjs on studio integration/next at 88b828d) through the plain-Node entry. It passes all 21 checks it serves, and the two fountain checks are skipped because the lobby does not broker fountain. Fountain's own egress broker is an HTTPS_PROXY that attaches credentials by host and reads no declaration, so it does not pass yet. It needs a front that speaks this protocol, and that is noted on the issue.
Closes #3164