Skip to content

feat(create): scaffold the framework test harness with the mcp-server template (#103 migration step 8) - #244

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
chore/103-remainders
Sep 1, 2026
Merged

feat(create): scaffold the framework test harness with the mcp-server template (#103 migration step 8)#244
ScriptedAlchemy merged 2 commits into
mainfrom
chore/103-remainders

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

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-server template — full adoption, two pools. New rstest.route-unit.config.ts and rstest.projection.config.ts built from agentBundleRstest(), mirroring the repo's own layout because the levels are separate claims:
    • tests/route-unit/report-status.test.tstestManifest() smoke (proof level, clean diagnostics, route inventory), then renderRoute + expectDocument over tool:status/report-status, including the resultSchema-parsed rendered.result.
    • tests/projection/mcp-in-memory.test.tslistMcpSurface() + invokeMcpTool against the real generated server over the SDK in-memory transport, asserting structuredContent equals the value the same input rendered at route-unit level (parity, not a hand-copied literal).
    • Scripts: test excludes both pools, test:routes / test:projection run them, check runs all three.
  • cli-tool and minimal — deliberately no harness pool. Verified, not inferred: the cli-tool's src/cli.ts is claimed by the config scripts: 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.
  • Scaffold e2e extended. npmRun now returns output, and the release-boundary matrix asserts positively that the scaffolded project's harness pools ran (check output names both test files; explicit test:routes / test:projection runs assert "failedTests": 0) instead of trusting a silent check. Per meta-framework: execution plan and sequencing #107 cost rules the per-PR packed pool stays minimal-template-only; no new installs there.
  • Pool-leak fix (separate commit): rstest.unit.config.ts excluded packedTestFiles but not packedReleaseOnlyTestFiles, so the release-only scaffolder matrix (pack + install + full project check) was running in the build-free per-PR unit pool. Scoped create-agent-bundle unit run drops from 4 files / 50s to 3 files / 0.43s.

Changeset: create-agent-bundle minor.

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 deletion parses npm pack --json as an array; npm 12 returns a package-keyed object. Byte-identical to origin/main, untouched here — the same npm-12 shape feat(test): packed deleted-source proof level for the consumer harness (#103 stage 4) #225 fixed in run-packed-tests.mjs / shared-pack.ts / audit-packed-release.mjs but 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).

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-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 20f76f7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-agent-bundle Minor

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 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-01T23:55:54.614752Z 20f76f7 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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 1, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@244
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@244
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@244

commit: 20f76f7

@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: 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".

Comment on lines +46 to +47
- `src/cli/**` command routes make `invokeCli` / `cliJson` (the `cli-dispatch`
level) meaningful — argv resolved and run through the routed CLI's own shell.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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 #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).

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