Repository navigation
feat(a2a): outbound A2A control is OSS-core (ent#761) - #3191
Merged
Merged
Conversation
…ent#761, checkpoint A)
Outbound A2A control is available in every edition by ruling, but the three
MCP control tools proxied the entitlement-gated management router, so on an
unlicensed instance they answered `{ not_entitled: true }` — while the only
store the runtime outbound call resolves against is the platform-wide endpoint
store under /api/settings (#736), which every build already has.
Checkpoint A repoints the TypeScript layer at that store. No backend route,
service, schema or gate changes; the inbound plane (exposure, inbound
allow-list, the full config read, the served card) is untouched and keeps its
entitlement-aware mapper.
- client.ts: `registerA2AEndpoint(body)` → PUT /api/settings/a2a-endpoints
(now carrying `clear_credentials`), `listA2AEndpoints()` → GET (endpoints +
the outbound switch state), `removeA2AEndpoint(ref)` → DELETE by id or name.
Each drops the agent-name argument it never sent: the store is platform-scope.
- a2a.ts: a second error mapper, `failOutbound`, on which `not_entitled` is
structurally unreachable. The existing mapper infers that flag from the body
text, so any 403 whose body mentions "a2a" told the operator to buy a licence
for what was really an admin-tier or human-only refusal. The new one branches
on status only.
- `agent_name` becomes optional on the three tools and is described as ignored
on this build: a required-but-ignored argument invites a caller to register
under one name, list under another, see the same rows and report a leak.
- `register_a2a_endpoint` reports `outbound_enabled` and, when the switch is
off, names the one admin step that makes a registered endpoint callable —
the switch default is unchanged. It also refuses `clear_credentials` together
with `credentials` client-side, which the store would otherwise accept while
silently dropping the supplied secret.
- `list_a2a_endpoints` refuses agent-scoped keys itself instead of running a
`{self} ∪ permitted` lookup: its route is human-only rather than
self-scoped, so that check denied a strict subset of what the backend denies
while costing a round trip.
- `get_agent_a2a_config` gains `outbound_endpoints_note` and a description
clause saying which of the two lists a call actually resolves against, so
the divergence is signposted rather than silent.
- a2a_call.ts: its description claimed `list_a2a_endpoints` reads a different
store and cannot name a callable target. That is false after the repoint.
- access.ts: the three ledger rows named an enterprise route; they now name the
gate that really holds the line.
Tests (node:test, src/mcp-server): 656 pass, up from 636. Mutation-verified —
reverting the outbound mapper to the entitlement-aware one, re-adding the
"Enterprise feature" sentence to a description, and pointing the list method
back at the enterprise router each turn a specific test red; sources restored
byte-identical. `npm run build` (tsc) clean.
Checkpoints B (backend `# mcp:` header, PUT response `enabled`, pytest guard)
and C (docs) follow separately.
Refs abilityai/trinity-enterprise#761
Co-Authored-By: Claude Opus 5 <[email protected]>
…(ent#761, checkpoint B) Backend half of the repoint: the three MCP outbound control tools now drive the OSS `/api/settings/a2a-endpoints` routes, so the backend has to say so and has to answer the question a write provokes. - `routers/settings/__init__.py` line 1: `# mcp: none` was true when nothing external drove this package and is now false in the direction that hides a live surface from the only audit that looks for it. The header names the covering tool module and the exposed routes; every other route in the package stays a human-only grant surface (Invariant #8, #13). - `PUT /api/settings/a2a-endpoints` returns `enabled`, the runtime-resolved outbound switch state the GET has reported since #736. The switch defaults OFF, so an operator who registers an endpoint on a fresh install otherwise gets a complete-looking registration and a dead call path; the tool layer turns `enabled: false` into the one admin step that fixes it. No gate change, no new route, no schema change. - `tests/unit/test_ent761_outbound_control_oss.py`: own FastAPI app over the settings router with a real `models.User` admin principal and NO resolver provider registered, because that is the configuration the claim is about. Pins the header, walks the AST of the three handlers to assert they carry no entitlement gate and keep `assert_admin` + the human-only guard, exercises register -> list -> resolve (two different agents, same platform-scope row) -> remove, and pins the 403 detail text the TS mapper matches on. Mutation-checked: reverting the header to `none` reddens the header pin; dropping the `enabled` key reddens both switch cases. Both restored byte-identical. Co-Authored-By: Claude Opus 5 <[email protected]>
Docs half of the repoint. Checkpoints A and B made the three MCP control tools drive the OSS platform-wide endpoint store; every doc that described them as part of the entitlement-gated management plane was now false in the direction that tells an operator a working capability is unavailable. - user-docs/integrations/a2a-protocol.md: the Availability note splits by direction — inbound exposure needs the A2A capability, outbound control and calling work on every edition behind their own switch. The MCP tool table row says platform-wide (not per-agent) and names the list call_a2a_agent resolves against; Part 3 gains the MCP path beside the curl one, plus why the tier is admin rather than owner: the list is platform-wide, so a registration is a fleet-wide grant of a credentialed egress target, which Trinity keeps human-only. The A2A tab's own panel is labelled a separate per-agent registry in both places a reader meets it, because that is the divergence a licensed build still has. - requirements/mcp.md: §32.3 records that outbound control left the entitled plane (admin-tier, every edition, a mapper on which not_entitled is unreachable, agent_name accepted and ignored) and amends the #736 read-gate bullet for list_a2a_endpoints only — against a platform-scope list "sibling" has no meaning, so the in-tool refusal replaces a check that denied a strict subset of the backend. §32.5 FR-2 records one store per question and why the PUT reports the switch state. - architecture/mcp-server.md: the a2a.ts row is one module with two planes and two mappers; a2a_call.ts no longer claims its sibling is wholly entitlement-gated. - architecture/api-endpoints.md: the a2a-endpoints cell is MCP-covered (Invariant #13), and these are the only routes in the settings package with a surface. - feature-flows/a2a-outbound-call.md: the owner note asking whether per-agent scoping was monetization is replaced by the ruling that answers it; the registry layer row fixes a pre-#1028 path (routers/settings.py -> routers/settings/integrations.py); layers and Testing gain the control tools and their two test files. Verified: the enterprise-docs-guard pattern is clean over all five files, no "Enterprise feature"/"not licensed" text survives near the three tool names, every in-page anchor resolves, and `npm run build` in src/mcp-server passes. faq/collaboration.md was checked and needed no change — it already describes outbound as admin-registered with no entitlement claim. Co-Authored-By: Claude Opus 5 <[email protected]>
…rinity-enterprise#761) /review findings I1 and I4, both one-line and non-functional. I1 — `routers/settings/__init__.py:1` carried the only `# mcp:` pointer in `src/backend/routers/**` spelled as a path (`tools/a2a.ts`); the other 24 use the bare module name, and plan finding E7 had adopted the bare spelling. A future tooling pass that resolves a pointer as `src/mcp-server/src/tools/<name>` would have read `tools/tools/a2a.ts`. Now names the three covering tools and the routes they cover. Every existing pin stays green: the header still begins `# mcp:`, still contains `a2a.ts` and `a2a-endpoints`, and still carries no `none` (test_ent761_outbound_control_oss.py:: test_settings_package_header_names_the_covering_tool_module). I4 — the feature-flow test table said the F8 addition made management *reads* (plural) gate agent-scoped keys. After ent#761 only `get_agent_a2a_config` gates; `list_a2a_endpoints` refuses agent keys outright, which the same row's ent#761 clause and requirements/mcp.md §32.3 already say. Reworded to "the config read gates agent-scoped keys" so the one remaining fragment a reader could misread is gone. No code behaviour change. I2 (frontend per-agent store, orchestrator handoff H3) and I3 (sibling-fixture `sys.path` insert, accepted as precedented) are noted in the review with no action. Co-Authored-By: Claude Opus 5 <[email protected]>
vybe
marked this pull request as ready for review
October 3, 2026 08:02
trinity-ability
approved these changes
Oct 3, 2026
trinity-ability
left a comment
Contributor
There was a problem hiding this comment.
/validate-pr: Lane B, APPROVE. Tier 1 is green and dev-ci is green. Security greps are clean. Mutation checks went red as expected: pytest PUT enabled (2 red) and node failOutbound→fail (3 red). The backend routes are admin + human-only on GET/PUT/DELETE. The H3 follow-up is filed as abilityai/trinity-enterprise#779. The AC1 live-stack check was not run.
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.
Fixes abilityai/trinity-enterprise#761 — a single PR off
dev(not stacked). Draft until the operator merges it.Outbound A2A control works on every edition by ruling. The three MCP control tools still proxied the entitlement-gated management router, though, so an unlicensed instance answered
{ not_entitled: true }. The only store the runtimecall_a2a_agentresolves against is the platform-wide endpoint store under/api/settings/a2a-endpoints(#736), and every build already has it. This PR points the control tools at that store. The inbound plane (exposure, inbound allow-list, full config read, served card) is untouched.What
src/mcp-server/src/):client.ts—register/list/removeA2AEndpointhitPUT/GET/DELETE /api/settings/a2a-endpointsand no longer take an agent name, because the store is platform-scope.tools/a2a.ts— newfailOutboundmapper that branches on status only, sonot_entitledcannot come out of it.agent_nameis optional and documented as ignored.register_a2a_endpointreportsoutbound_enabledand names the admin step when the switch is off. It also refusesclear_credentials+credentialstogether.list_a2a_endpointsrefuses agent-scoped keys in the tool, andget_agent_a2a_configgainsoutbound_endpoints_note.tools/a2a_call.ts— its description was correct before the repoint but is wrong after it, so it is updated.access.ts— the three ledger rows now name the gate that actually applies.src/backend/routers/settings/): the__init__.py# mcp:header namesa2a.tsand the three covered routes, and every other route in the package stays a human-only grant surface (Invariant security: implement safe tar extraction with symlink/hardlink validation #8 / feat: SMARTS trading pipeline with Telegram notifications and Miro visualization #13).integrations.py—PUT /api/settings/a2a-endpointsreturnsenabled, the runtime outbound switch state the GET has reported since feat: add call_a2a_agent MCP tool for outbound A2A protocol calls #736. Gates, routes and schema are unchanged.tests/unit/test_ent761_outbound_control_oss.pyruns its own FastAPI app with no resolver provider registered. It pins the header and walks the three handlers' AST to assert they have no entitlement gate and keepassert_adminplus the human-only guard. It runs register → list → resolve-as-two-agents → remove and pins the 403 detail text the TS mapper matches on.src/mcp-server/src/tools/a2a.test.ts(+20 node:test cases).tests/registry.json.user-docs/integrations/a2a-protocol.md(availability split by direction; MCP path next to curl; why the tier is admin),requirements/mcp.md§32.3/§32.5,architecture/{mcp-server,api-endpoints}.md,feature-flows/a2a-outbound-call.md.Rulings carried (orchestrator, on the operator's behalf — plan file)
All four taste decisions were accepted as the planner recommended, with no deviations:
agent_nameis optional on the three outbound tools and described as ignored, because the registry is platform-wide.get_agent_a2a_configsignposts which list a call resolves against.call_a2a_agentbehaviour is unchanged (only its description sentence is fixed), and the outbound kill switch still defaults OFF.Review + security
/review(claude-fable-5-1, report-only, range69ef0575..191fb445): MERGEABLE — 0 critical, 4 informational. These rider checks hold:enabledcontract.claudeandsrc/backend/enterpriseuntouched across the rangeFixed in
f6676650: I1 (barea2a.tspointer in the# mcp:header) and I4 (feature-flow wording). I2 is note-only: the A2A tab's per-agent panel is a separate registry, followed up under Handoffs. I3 was accepted: the sibling-fixturesys.pathinsert has 3 precedents./cso --diff: 0 security findings.Tests
src/mcp-server): 656/656 (+20);npm run build(tsc) clean; mutation-checked. Reverting the outbound mapper, re-adding the "Enterprise feature" sentence, or pointing the list back at the enterprise router each turns a test red.test_ent761_outbound_control_oss.py19 passed (also at the fix tip). At the reviewed tip: bug(auth): agent-scoped keys can toggle their own agent's autonomy — PUT /api/agents/{name}/autonomy lacks reject_agent_principal #2996/refactor: split oversized backend routers & services (settings, public, agent crud, git, agent_client) #1028/feat: add call_a2a_agent MCP tool for outbound A2A protocol calls #736 suites 340 passed, MCP a2a 54/54, access wiring 56/56. At the fix tip: the header-pin suites, 319 passed. Header andenabledmutations were also checked red → restored.devdc944b2a:git merge-treeis clean. The branch adds no Alembic revision, and the merged graph has one head (0087_pull_sync).Before merge
call_a2a_agentagainst it. The mechanism has a unit-level guard here; the live call does not.devtakes a migration first.Handoffs
withAuditfailure-as-success note applies to the new outbound mapper too.🤖 Generated with Claude Code