Repository navigation
fix(mcp): fence get_agent_assignments — built, not registered, for the 0.9.5 cut (F1) - #2863
Conversation
…e 0.9.5 cut (work-order F1, ent#500) The assignments layer is not shipping in 0.9.5, so the MCP tool that reads it must not be advertised. `server.ts` no longer imports/registers `createAssignmentTools`; `access.ts` drops the policy row (the ent#628 totality test forbids a row for an unregistered tool); `tool-visibility.test.ts` pins the ABSENCE of the registration instead of its presence. `tools/assignments.ts` and `assignments.test.ts` stay — re-enabling is one import + one line + the row. Docs rows (architecture, user-docs, feature-flow) say "fenced". MCP suite: 409/409; `tsc --noEmit` clean. Related to Abilityai/trinity-enterprise#500 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
/review ReportBranch: Critical Findings (block merge)None. Informational Findings (review required)[I1] Consistency (4.7): the flipped test block's names now say the opposite of what it asserts (Confidence: 8/10) [I2] Documentation staleness (4.13): the advertised tool counts (Confidence: 7/10) [I3] Scope note (4.14): the fence is the MCP advertisement only (Confidence: 9/10) Clean Categories
Summary
Review complete. Next: |
`fallback_to_api_key` fails OPEN on a raising settings read, so the test kept running past its mocked `db` into two call-time reads it never stubbed: the agent container and the platform API key. Whatever the pytest process held decided the outcome — on CI under one randomly order a key leaked in from an earlier test, the fallback ran for real, and the `is None` assertion failed on a PR that touched only the MCP server (regression-diff job on #2863). Reproduced locally with ANTHROPIC_API_KEY set: identical assertion message. Stub both reads so the assertion states its actual premise — no key ⇒ nothing to fall back onto ⇒ None, and no exception. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…129 (F1) — mechanical /review I1: the ent#500 describe/it names said the tool is advertised to operator scopes; those cases exercise the operatorOnly gate, and the block now pins that the tool is NOT registered. /review I2: the booted server registers 129 tools (124 operator) with inline login on; the user doc said 130/125. The architecture doc already reads 129. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
merge-train 2026-09-17: one mechanical commit pushed to this branch —
Noted, not changed: the "not registered" pin at |
…sed consent, gitlink bump (Abilityai/trinity-enterprise#500) (#3034) * fix(assignments): unresolved proactive consent fails closed (trinity-enterprise#500 [I1]) _render_assignment appended the consent qualifier only when proactive_consent was not None, so a provider answering {primary_user_display, role_id} and nothing else -- a valid answer, since _validated skips absent keys -- rendered a bare name. That is the inference the function's own docstring forbids: a name with no qualifier reads as permission to reach out. Only an explicit True now renders "permitted"; False and None both render the restrictive clause. The compose-time merge in compose_system_prompt is left as is: it preserves None, which the renderer now closes, and no src/ caller pre-fills the fields. dolho's go-live condition from the #2596 review. * feat(mcp): register get_agent_assignments again -- reverse the 0.9.5 fence (#2863) (trinity-enterprise#500) #2863 withheld the tool from toolGroups for the 0.9.5 cut because the assignments layer had no backend. PR2a (trinity-enterprise#669) ships that layer, so the registration, the access.ts policy row and the presence pins in tool-visibility.test.ts return, along with the doc text #2863 replaced (restored verbatim from its diff). Must not merge before the enterprise gitlink bump: on a build without #669 the tool is advertised but always answers "not available". * fix(mcp): get_agent_assignments never echoes the raw error text (trinity-enterprise#500 [I3]) degrade() returned `detail: error.message` beside the curated message. On the unexpected-status branch that is a raw backend body or an internal URL, handed unfiltered to a model. Drop the field on every branch; the curated per-status sentence is the whole answer. dolho's [I3] from the #2596 review. * fix(mcp): get_agent_assignments enforces agent self-scope in the tool (trinity-enterprise#500 [I2]) The tool description promises "an agent may only read its own roster", but only the backend route -- in the private module -- enforced it. An agent key naming another agent, or carrying no agent name, is now refused with not_authorized before any backend call and audited as a denial via accessDenied. Deliberately redundant with the backend, like a2a_call.ts checkSelf. user and system keys still pass to the backend. The access.ts row moves from baselined to in-tool. The I3 doc note for the degraded shape lands here too, in the same flow section. dolho's [I2] from the #2596 review. * fix(assignments): a non-bool consent is unresolved, never coerced (trinity-enterprise#500 [R1]) assignment_provider._validated coerced proactive_consent with bool(value), and bool("false") is True -- so a provider answering the string "false" (or "0", "no") rendered "proactive contact permitted". The same permission-fails-open class as [I1], one layer earlier. Only a real bool is kept now. Anything else is dropped with a WARNING like any malformed field, so consent is unresolved and the renderer's [I1] path states the restrictive clause. test_proactive_consent_is_coerced_to_bool pinned the coercion and is replaced. New tests were red against bool() (8 failed) and green after; the end-to-end one drives the real compose_system_prompt path with a provider answering "false". Found in the PR3 pre-push review. * docs(user-docs): count get_agent_assignments in the MCP tool totals (142 -> 143, 137 -> 138 operator) * chore(enterprise): bump the private module to trinity-enterprise#669 (Abilityai/trinity-enterprise#500) Points src/backend/enterprise at be1160f3a, the squash-merge of the assignments record and prompt (#669) on trinity-enterprise main. Adds migration 0018_agent_assignments; one enterprise Alembic head.
0.9.5 work order F1 ("The assignments tool gets fenced"). Related to abilityai/trinity-enterprise#500 (moved back to
status-in-progress).What
src/mcp-server/src/server.ts:createAssignmentToolsno longer imported or added totoolGroups—get_agent_assignmentsis not advertised to any scope. Comment at the site says why and how to re-enable.src/mcp-server/src/access.ts: policy row removed (the ent#628 totality test forbids a row for a tool that isn't registered); kept as a commented line to restore.src/mcp-server/src/tool-visibility.test.ts: the ent#500 block now pins the absence of the registration (module still builds; no write tool still asserted).tools/assignments.ts+assignments.test.tsuntouched — the module stays; only the registration is withheld.architecture/mcp-server.md,user-docs/integrations/mcp-server.md,feature-flows/role-assignments.mdsay fenced.Re-enable = one import + one
toolGroupsline + the access row + flip the test.Verification
npm test(MCP server): 409 passed, 0 failed — includesaccess.test.ts(policy total over registered tools) and the flipped visibility test.tsc --noEmit: clean.🤖 Generated with Claude Code