test(example): adopt routes.mcpCommands in audiobook-curator (#102 stage 4) - #277
Conversation
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12e5c8d6a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }, | ||
| runtime: { node: '22.19.0' }, | ||
| // #102 stage 4 adopts the in-house G7 projection for every curator tool. | ||
| routes: { mcpCommands: true }, |
There was a problem hiding this comment.
Preserve receipt exit codes in projected commands
When a projected operation reports a domain failure in its receipt rather than throwing, this blanket opt-in turns that failure into process success: compileMcpCliCommands hardcodes projected commands to exitCode: 'zero', while CuratorResult always emits Agent.Result. For example, curator inventory_sources --yes --input '{"source":"…","strict":true}' --json returns exit 0 when probing errors make src/library.ts set the receipt's exitCode to 1, unlike the existing inventory command and contrary to the strict contract. Exclude receipt-driven tools from projection or preserve their result exit-code policy so audit, search, and verification failures cannot be mistaken for success.
AGENTS.md reference: AGENTS.md:L10-L13
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 5317ce619: projected tools now preserve an explicit config.exitCode: "result" policy, and the seven audiobook receipt-driven tools declare it. This is semantically honest without forcing arbitrary MCP result schemas to contain exitCode; non-receipt tools retain status-based zero-on-success behavior. Merged via #319.
Third #102 stage-4 PR (after #274 acceptance and #275 projection): the real audiobook-curator example adopts
routes.mcpCommands: true, projecting all fifteencuratorMCP tools into the same generated executable as its fifteen custom commands, and proves the projection at thecli-dispatchlevel.Coverage (all hermetic — empty temp libraries, no ffmpeg/ffprobe/network)
curator inspect_sources(annotations declarereadOnlyHint: true) runs without--yes;--jsonreceipt parses under the tool's ownresultSchema;routeIdistool:curator/inspect_sources.curator convert_audiobook(destructiveHint: true) exits 2 without--yeswith no route execution; with--yesthe run proceeds past the gate into the tool's own domain validation ("Selection contains no audio files.", exit 1) — proving the gate is the only barrier, without requiring media binaries.--inputcontract: invalid JSON → usage exit 2; schema-invalid object → exit 2 with the command help hint.curator <command>beside the custominspect;curator --helplists the tools; command help carries theMCP tool: curator:convert_audiobookprovenance line and "Mutation-capable; requires --yes."curatorgroup), zero diagnostics.README updated to describe the projected commands and the
--yespolicy. No changeset (unpublished example).Local gates
pnpm --filter @agent-bundle-example/audiobook-curator check— validate, build, typecheck, 33/0 + route suite 20/0 (16 → 20)pnpm lint— 0 errors, 0 warnings (939 files)