feat(create): scaffold the framework test harness with the mcp-server template (#103 migration step 8) - #244
Conversation
Issue #103 migration step 8. A scaffolded mcp-server project now starts with the testing story wired in: rstest.route-unit.config.ts and rstest.projection.config.ts built from agentBundleRstest(), one route-unit test (testManifest + renderRoute + expectDocument over the report-status route) and one compiled projection test at the mcp-in-memory level asserting that the server's structuredContent is the value the route rendered. `test` excludes both directories, `test:routes` and `test:projection` run them, and `check` runs all three pools. minimal and cli-tool keep their plain tests on purpose: a skills-only project compiles no routes, and the cli-tool CLI is a config-declared script bundle rather than a compiled route, so a harness pool in either would pass without addressing anything. Both READMEs document what each level would prove and the exact wiring to add with the first route module. The release-boundary template matrix now asserts positively that the scaffolded project's harness pools ran, instead of trusting a silent `check`.
… unit pool packedReleaseOnlyTestFiles was excluded from the packed pool's release gate but not from rstest.unit.config.ts, so the scaffolder template matrix — which packs, installs, and runs a scaffolded project's full check — ran in the build-free per-PR unit pool. Scoped `create-agent-bundle` unit run drops from 4 files in 50s to 3 files in 0.4s.
🦋 Changeset detectedLatest commit: 20f76f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20f76f7eef
ℹ️ 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".
| - `src/cli/**` command routes make `invokeCli` / `cliJson` (the `cli-dispatch` | ||
| level) meaningful — argv resolved and run through the routed CLI's own shell. |
There was a problem hiding this comment.
Document the required CLI route-mode selection
When a user follows this src/cli/** recommendation in the generated cli-tool project, the existing conventional src/cli.ts remains present. The route compiler treats those two surfaces as an AB4801 conflict, so validate, build, and agentBundleRstest() fail before the documented harness can run. Include the required migration step here: either remove the conventional entry or set routes.cli to generated.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in #249 — README now documents removing src/cli.ts and the ./src/cli.ts script entry before adding src/cli/** routes (or keeping routes.cli: 'conventional' to stay on the single-file CLI).
Summary
Issue #103 migration step 8 — the last unstaged template item: a scaffolded project starts with the testing story wired in instead of adopting it manually.
mcp-servertemplate — full adoption, two pools. Newrstest.route-unit.config.tsandrstest.projection.config.tsbuilt fromagentBundleRstest(), mirroring the repo's own layout because the levels are separate claims:tests/route-unit/report-status.test.ts—testManifest()smoke (proof level, clean diagnostics, route inventory), thenrenderRoute+expectDocumentovertool:status/report-status, including theresultSchema-parsedrendered.result.tests/projection/mcp-in-memory.test.ts—listMcpSurface()+invokeMcpToolagainst the real generated server over the SDK in-memory transport, assertingstructuredContentequals the value the same input rendered at route-unit level (parity, not a hand-copied literal).testexcludes both pools,test:routes/test:projectionrun them,checkruns all three.cli-toolandminimal— deliberately no harness pool. Verified, not inferred: the cli-tool'ssrc/cli.tsis claimed by the configscripts:declaration and never becomes a compiled route (routes: [],cliCommands: []in its manifest), and minimal is skills-only with zero routes — a pool in either would pass vacuously. Both READMEs document exactly what each level would prove and the wiring to add with the first route module.npmRunnow returns output, and the release-boundary matrix asserts positively that the scaffolded project's harness pools ran (checkoutput names both test files; explicittest:routes/test:projectionruns assert"failedTests": 0) instead of trusting a silentcheck. Per meta-framework: execution plan and sequencing #107 cost rules the per-PR packed pool stays minimal-template-only; no new installs there.rstest.unit.config.tsexcludedpackedTestFilesbut notpackedReleaseOnlyTestFiles, so the release-only scaffolder matrix (pack + install + full projectcheck) was running in the build-free per-PR unit pool. Scopedcreate-agent-bundleunit run drops from 4 files / 50s to 3 files / 0.43s.Changeset:
create-agent-bundleminor.Gates (local)
rstest --config rstest.unit.config.ts packages/create-agent-bundle— 37 passed, 0 failed (re-run post-rebase)pnpm test:packed:release— 24 passed / 1 skipped / 1 pre-existing failure:packed-consumer.test.ts :: uses only an installed tarball after source deletionparsesnpm pack --jsonas an array; npm 12 returns a package-keyed object. Byte-identical toorigin/main, untouched here — the same npm-12 shape feat(test): packed deleted-source proof level for the consumer harness (#103 stage 4) #225 fixed inrun-packed-tests.mjs/shared-pack.ts/audit-packed-release.mjsbut not in that one test file. Both scaffolder matrix templates passed with the new positive assertions.pnpm typecheck— clean (re-run post-rebase)pnpm lint— 0 errors, 0 warnings (re-run post-rebase)Part of #103 (with #239, this completes the issue's remaining items).