Skip to content

feat(workspace): a broker protocol for box capabilities and its conformance suite (#3164) - #3460

Merged
lex00 merged 3 commits into
mainfrom
ws-3164-broker-protocol
Oct 4, 2026
Merged

lex00 merged 3 commits into
mainfrom
ws-3164-broker-protocol

Conversation

@lex00

@lex00 lex00 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

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

lex00 added 2 commits October 3, 2026 21:27
…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
@lex00 lex00 added design Design or research note, no deliverable yet area:workspace chant workspace epic (#2525) boundaries Epic: boundaries between chant, hud, studio, behold and fountain labels Oct 4, 2026
# Conflicts:
#	docs/design/decisions/README.md
#	docs/src/content/docs/reference/boundary.mdx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace chant workspace epic (#2525) boundaries Epic: boundaries between chant, hud, studio, behold and fountain design Design or research note, no deliverable yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workspace: a broker protocol for box capabilities (inference, decide, egress, fountain), so studio's lobby and fountain's broker are interchangeable

1 participant