Skip to content

test(example): audiobook CLI dispatch acceptance across all output modes (#102 stage 4) - #274

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

test(example): audiobook CLI dispatch acceptance across all output modes (#102 stage 4)#274
ScriptedAlchemy merged 1 commit into
mainfrom
feat/102-s4-acceptance

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Part of #102 stage 4 (first of two PRs): the consumer-side acceptance pass over the routed CLI surface, at the cli-dispatch proof level the #266 harness landed. The companion framework PR (MCP-tool command projection) follows separately.

What this proves on the real example

examples/audiobook-curator/tests/route-unit/cli-dispatch.test.ts (+270 lines, 13 tests) drives the example's own compiled command graph through public agent-bundle/test (invokeCli, cliJson, cliNdjson) — no product code changes:

  • Plain commands: inspect canonical one-line JSON with direct-operation byte parity (stdout === JSON.stringify(direct) + '\n'); inventory --strict receipt exitCode authoritative for the process exit code in both the 0 and 1 cases (the failing case removes ffprobe from PATH, hermetically); report-file side effect equals the stdout receipt.
  • Usage failures: unknown command / unknown option / missing required option → exit 2 + the --help hint; the route's real zod bounds (--max-files 0) → exit 2.
  • Help agreement: command help carries the real kebab option spellings (--max-files <number>); root help lists every routed command.
  • Rendered library-audit, all four output modes (Generate CLI, MCPorter, and script projections from the compiled route graph #102 output contract): piped → exactly one final Markdown document, no progress frames on stdout; explicit TTY → \r\x1b[2K progress-in-place frames before the final Markdown; --json → canonical schema-validated receipt; --ndjson → monotonic sequence-numbered events, exactly one terminal complete, and no jsonrpc key anywhere (CLI dialect purity); --json --ndjson → exit 2.

Acceptance lines covered (issue #102)

  • "TTY, Markdown, JSON, and NDJSON output have direct Rstest … coverage" — the real-example Rstest half (the packed half stays with cli-routes-build.test.ts).
  • "A custom command can use the Agent renderer without becoming an MCP tool" — library-audit proven across modes at the dispatch level.
  • "A plain script remains a normal executable with no renderer assumptions" — plain commands proven to emit canonical JSON with byte parity and receipt-driven exit codes.

Local gates (this branch)

  • pnpm --filter @agent-bundle-example/audiobook-curator check — validate, build (53 files), typecheck, tests 33→49 passed / 0 failed (route suite 3→16)
  • root pnpm lint — 0 errors, 0 warnings (926 files)

Tests only; no changeset (example package is unpublished).

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 31515ed

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

@ScriptedAlchemy
ScriptedAlchemy merged commit cb07149 into main Sep 2, 2026
4 checks passed
@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-02T03:58:15.912818Z 31515ed 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.

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