Repository navigation
fix(mcp): declare read-only J5 tools non-destructive - #774
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning
|
| Layer / File(s) | Summary |
|---|---|
Declare read-only tool metadata apps/server/src/j5/a2a/mcp/upstreamCatalog.ts, apps/server/src/j5/a2a/mcp/orchestratorSurface.ts, apps/server/src/j5/playbooks/mcp.ts, apps/server/src/j5/a2a/mcp/tools.test.ts |
Read-only tool declarations add Destructive: false and OpenWorld: false. Playbook tools retain their readonly annotations. The test checks that named read-only tools have both metadata values set to false. |
Register the J5 artifact toolkit apps/server/src/j5/a2a/mcp/registration.ts |
Artifact handling uses J5ArtifactToolkit instead of ArtifactToolkit. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: jacksondr5
Merge Risk: 
Minimal · up to 7c063
-
No concrete current-head defect was established in the changed MCP metadata or artifact registration.
Pre-merge checks: 
3 · 
1
-
Failed checks: 1 inconclusive Passed checks: 3 passed-
Check name Status Explanation Title check The title clearly and concisely describes the main change: marking read-only J5 MCP tools as non-destructive. Out of Scope Changes check Each changed file in the whole-PR summary (merge base bddffec to head 7c063e6) ties to #734:
- playbooks/mcp.ts: adds explicit Tool.Destructive=false and Tool.OpenWorld=false to read verbs. Directly r…Description check The description is mostly complete. It includes the problem, change summary, linked issue, test evidence, live-testing status, scope, and checklist. The Surfaces checklist item remains unchecked, and … Full details: Out of Scope Changes check
-
Explanation
Each changed file in the whole-PR summary (merge base bddffec to head 7c063e6) ties to
#734:- playbooks/mcp.ts: adds explicit Tool.Destructive=false and Tool.OpenWorld=false to read verbs. Directly required by
#734. - upstreamCatalog.ts: adds the hint annotations on upstream read verbs and the J5ArtifactToolkit export. The export is needed so the artifact reads carry annotations. Import changes support this.
- registration.ts: registers J5ArtifactToolkit with ArtifactHandlers.layer instead of ArtifactToolkit. Handlers are keyed by tool, so the artifact service and workspace providers are unchanged. The change is needed so the annotated toolkit is the one advertised.
- orchestratorSurface.ts: adds Tool.OpenWorld=false to orchestrator_capabilities. Directly required by
#734. - tools.test.ts: adds the contract test required by
#734. The test imports only J5 toolkits in the verified scope.
No change in the reviewed summary alters tool handlers, pre-approval policy, or task_status classification. The PR description states the pre-approval list is unchanged, which is consistent with the file list. FORK.md and docs changes named in the checklist are supporting records, not coding changes, and were not in the summary. No change without a link to#734was found.
- playbooks/mcp.ts: adds explicit Tool.Destructive=false and Tool.OpenWorld=false to read verbs. Directly required by
Full details: Description check
-
Explanation
The description is mostly complete. It includes the problem, change summary, linked issue, test evidence, live-testing status, scope, and checklist. The Surfaces checklist item remains unchecked, and the required closing statement naming the model and harness is missing. The Upstream impact section is also omitted, but the description explains that only J5-owned paths changed.
-
Full details: Linked Issues check
-
Explanation
Scope: directly linked issue
#734is the only active target. Its coding requirements are (1) set Tool.Destructive=false and Tool.OpenWorld=false on every really read-only J5 tool, audited across J5 toolkits, and (2) add a test that every Tool.Readonly J5 tool sets both hints. Its note not to remove entries from J5_PREAPPROVED_TOOLS is a constraint, not a new task.Requirement 2 [
#734], test: met at head. apps/server/src/j5/a2a/mcp/tools.test.ts adds 'publishes closed-world, non-destructive hints for every read-only J5 tool'. It gathers tools from nine J5 groups and asserts both hints for each tool where Context.get(tool.annotations, Tool.Readonly) is true. The author reports 9 passing tests and a failing run on baseline metadata. I did not run the tests.Requirement 1 [
#734], annotations: met for the verified set. At head:- apps/server/src/j5/playbooks/mcp.ts sets both hints false on j5_playbook_list, j5_playbook_read, and j5_playbook_current.
- upstreamCatalog.ts sets both hints false on t3_environment_read, t3_project_list, t3_project_read, list_scheduled_tasks, t3_thread_list, t3_queue_list, t3_queue_read, t3_pending_request_list, t3_pending_request_read, t3_thread_configuration, t3_thread_transfers, t3_thread_search, j5_list_artifacts, and j5_read_artifact.
- orchestratorSurface.ts sets Tool.OpenWorld false on orchestrator_capabilities.
- registration.ts registers J5ArtifactToolkit, so the artifact read hints reach the provider.
Unresolved [
#734], audit completeness: the test checks only tools that carry Tool.Readonly. The evidence does not show the annotations for these J5 tools:- j5_list_personas (in J5Toolkit).
- j5_list_participants. The issue states it already sets both hints false, but its declaration is not in the reviewed evidence.
- t3_thread_read (OrchestratorToolkit, no annotation in upstreamCatalog.ts).
The required-name list in the test does not include these tools. So the test does not show whether they are read-only or whether they carry the hints. The J5 tools.ts declarations were not read.
Not a coding requirement: live Codex or Claude policy acceptance. The PR states it was not run. This does not affect the verdict.
Resolution
Provide, from the reviewed head, the Tool.Readonly, Tool.Destructive, and Tool.OpenWorld values for j5_list_personas, j5_list_participants, and t3_thread_read. Read the J5 tools.ts declarations and the upstream orchestrator tool definition for t3_thread_read. Then decide whether each is really read-only. Re-assess the audit requirement after that evidence is available.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Jacksondr5
left a comment
There was a problem hiding this comment.
Read-only hints now land on the tools J5 actually registers, including artifacts. task_status and t3_thread_read correctly stay mutating, and the pre-approval list is untouched. No findings.
Review panel: Claude Opus 5.5 (lead) and GPT-6 Astra, for @Jacksondr5.
Problem
Read-only J5 MCP tools can advertise destructive/open-world defaults, causing Codex to require approval for reads under restricted policies. Closes #734.
What changed
I set both hints explicitly to false on J5 read tools and the read verbs J5 admits from upstream. Artifact registration uses the annotated J5 toolkit. A contract test checks every read-only tool across nine J5 toolkit groups.
task_statusandt3_thread_readretain their mutating classification because they acknowledge delivery. The annotations follow the current upstream tool set, including consolidated pending-request and queue operations. The pre-approval list is unchanged.Evidence
At
9c5a824fbd89ad10d3a9660888c9c161ef6ae580, merged withj5/mainat6a6aa43d08034bcd3bb69f2364903c061e7c8137, using the current pinned Node 26.12.1 and pnpm 12.14.0:vp run check:changed origin/j5/main: 19 tests across 4 focused files passed, plus formatting, lint, generated GraphQL checks, and typechecks for all 3 affected packages.j5_list_personasandj5_list_participants: Readonly=true, Destructive=false, OpenWorld=false. It asserts thatt3_thread_readandtask_statusremain Readonly=false because reading their results acknowledges delivery.git diff --checkpassed. Independent review confirmed the merge preserves main's admitted tool names, J5 read hints, artifact registration, and pre-approval policy.Not verified: actual Codex or Claude policy acceptance on a live provider.
Live testing
The metadata contract is tested at
9c5a824fbd89ad10d3a9660888c9c161ef6ae580. No live provider turn was run. This changes tool annotations and has no UI change requiring screenshots.Merge Danger
Door: two-way; reverting restores prior annotations.
Blast Radius: provider-facing J5 tool safety hints and artifact toolkit registration. Tool handlers and pre-approval policy are unchanged.
After merge: nothing.
Checklist
FORK.md(case text and file-table row) in this PR — J5-owned paths onlydocs/j5/product/upstream.md— no upstream product changeAGENTS.md) — metadata covered; live provider acceptance remains unverifieddocs/j5/product/and user docs rewritten where this changes them — no documented behavior changed