Repository navigation
fix(mcp): declare tool annotations and audit discovery subprocesses (#72) - #95
Conversation
Review (dev) — ACCEPTReviewed the full diff locally before the push (preliminary ACCEPT) and re-verified the published PR — identical after the clean rebase onto Tool annotations. All six tools publish the four boolean hints; the matrix is conservative and each non-obvious choice is documented in-code: reads T/F/T/F; send/reply F/F/T/T with Shell-out audit (M8ven). All three sites reviewed per-site: they are Verified independently: 24/24 targeted tests in a detached review worktree; author's full verify 107 files / 923 tests; CI 3/3 on a003225. Passing to CTO for final. |
All six participant MCP tools previously omitted effect annotations. They now expose explicit boolean
readOnlyHint,destructiveHint,idempotentHintandopenWorldHintvalues through the SDK'stools/listresponse; the integration test pins every entry.List/inbox/wait are reads over the configured project's roster/mailbox. Send/reply append messages and conservatively declare open-world interaction because delivery can reach another participant's host chat. Their idempotency hint is qualified by the existing seven-day key/dedup window in the tool descriptions. Ack is conservatively marked destructive because it changes existing delivery state/unread visibility and enables retention; it remains idempotent. Hints do not change authorization, input schemas, or Synloq v1.
The three M8ven-reported shell-out sites were audited at the actual Node boundary:
where/which+ literalopencode; a replacement would reimplement platform PATH/PATHEXT behavior without resolving executable trust.api get /api/infoargv, 10-second timeout and 1 MiB cap.All three already used
execFile, not shell command strings. Both wrappers now explicitly setshell: false; native-boundary tests cover literal metacharacter paths, overrides, both locator platforms, bounds and sanitized errors. No new dependency or host API replacement. The audit also inventories the newer Codex queue wrapper and optional probe scripts, documenting local environment/PATH/executable provenance as a remaining trust boundary.Evidence and rationale:
docs/security/2026-11-16-tool-annotations-shell-outs.md. CTO confirmed that issue #72 contains the available M8ven findings; there is no separate report file. External catalog acceptance and the claimed directory rejection policy were not independently tested. No live host probes or external M8ven contact were performed.Validation: initial
tools/listregression failed because all six annotations were absent; final fullpnpm verifyafter rebasing on maina0e57edpasses 107 test files / 923 tests, including six new cases, plus formatting, import check, typecheck and build. Existing behavior/security tests remain unchanged.Fixes #72. Review: dev → CTO.