Skip to content

fix(mcp): declare read-only J5 tools non-destructive - #774

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
fix/734-readonly-annotations
Oct 31, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
fix/734-readonly-annotations

Conversation

@BastiHu

@BastiHu BastiHu commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

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_status and t3_thread_read retain 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 with j5/main at 6a6aa43d08034bcd3bb69f2364903c061e7c8137, 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.
  • Knip reports 6 unused files and 142 unused exports, matching the verified unchanged baseline. These existing findings keep the overall command at exit 1.
  • The read-only audit explicitly includes j5_list_personas and j5_list_participants: Readonly=true, Destructive=false, OpenWorld=false. It asserts that t3_thread_read and task_status remain Readonly=false because reading their results acknowledges delivery.
  • The original regression demonstration restored baseline playbook metadata and made the annotation test fail; restoring the fix passed.
  • git diff --check passed. 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

  • One concern: the description has no "also"
  • Tests cover the changed behavior (backend changes ship with focused tests)
  • UI changes: before/after screenshots above, and a video for motion or interaction — no UI changes
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR — J5-owned paths only
  • Upstream product: any change to what upstream's product does has a human decision linked above and a register entry in docs/j5/product/upstream.md — no upstream product change
  • Surfaces: entry points, clients, providers, contracts, reverse states, connection modes (see AGENTS.md) — metadata covered; live provider acceptance remains unverified
  • Docs: definitions under docs/j5/product/ and user docs rewritten where this changes them — no documented behavior changed

@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Oct 30, 2026 5:11pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

.coderabbit.config.ts has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

Parsing errors: 1
Failed to lock down sandbox networking for config evaluation
Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between bddffec and 7c063e6.

Files selected for processing: 5
  • apps/server/src/j5/a2a/mcp/orchestratorSurface.ts
  • apps/server/src/j5/a2a/mcp/registration.ts
  • apps/server/src/j5/a2a/mcp/tools.test.ts
  • apps/server/src/j5/a2a/mcp/upstreamCatalog.ts
  • apps/server/src/j5/playbooks/mcp.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The pull request adds non-destructive and closed-world annotations to J5 read-only MCP tools, introduces an annotated artifact toolkit for list and read operations, and registers it for artifact handling. A test checks named read-only tools and their annotations.

Changes: J5 Read-Only Tool Hints

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: Normal

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: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Scope: directly linked issue #734 is 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 to… 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 …
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: marking read-only J5 MCP tools as non-destructive.
Out of Scope Changes check Passed 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 Passed 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 #734 was found.
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 #734 is 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.

@github-actions github-actions Bot added size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list. labels Oct 29, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Jacksondr5
Jacksondr5 merged commit d3221e7 into j5/main Oct 31, 2026
32 checks passed
@Jacksondr5
Jacksondr5 deleted the fix/734-readonly-annotations branch October 31, 2026 21:32

This branch was successfully deployed

1 active deployment
Preview — 9c5a824f Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read-only J5 tools keep Effect's destructive/open-world defaults, so Codex gates them

2 participants