Skip to content

test(example): adopt routes.mcpCommands in audiobook-curator (#102 stage 4) - #277

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
feat/102-s4-audiobook-projection
Sep 2, 2026
Merged

test(example): adopt routes.mcpCommands in audiobook-curator (#102 stage 4)#277
ScriptedAlchemy merged 1 commit into
mainfrom
feat/102-s4-audiobook-projection

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Third #102 stage-4 PR (after #274 acceptance and #275 projection): the real audiobook-curator example adopts routes.mcpCommands: true, projecting all fifteen curator MCP tools into the same generated executable as its fifteen custom commands, and proves the projection at the cli-dispatch level.

Coverage (all hermetic — empty temp libraries, no ffmpeg/ffprobe/network)

  • Read-only projection: curator inspect_sources (annotations declare readOnlyHint: true) runs without --yes; --json receipt parses under the tool's own resultSchema; routeId is tool:curator/inspect_sources.
  • Mutation fail-closed, then opened: curator convert_audiobook (destructiveHint: true) exits 2 without --yes with no route execution; with --yes the 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.
  • --input contract: invalid JSON → usage exit 2; schema-invalid object → exit 2 with the command help hint.
  • Merged graph: root help lists curator <command> beside the custom inspect; curator --help lists the tools; command help carries the MCP tool: curator:convert_audiobook provenance line and "Mutation-capable; requires --yes."
  • Graph-level expectations updated: 30 commands total (15 custom + 15 projected, all projected rendered under the curator group), zero diagnostics.

README updated to describe the projected commands and the --yes policy. 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)
  • root pnpm lint — 0 errors, 0 warnings (939 files)

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 12e5c8d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T04:53:15.643323Z 12e5c8d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ScriptedAlchemy
ScriptedAlchemy merged commit c588546 into main Sep 2, 2026
6 of 8 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the feat/102-s4-audiobook-projection branch September 2, 2026 04:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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 },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant