You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Teach the public CLI test harness to exercise rendered commands #253
Close the remaining gap between production rendered CLI routes and the public Agent Bundle test harness. A consumer should be able to exercise a routed JSX/TSX CLI command through the same render-session and output-mode behavior used by the generated executable.
Verified gap
Production rendered CLI commands now use the generated render-session path, but packages/agent-bundle/src/test/cli.ts still documents and implements a plain-command-only bridge. Its invokeCli path calls the route export directly and validates the returned value; it does not drive the rendered command's Flight/Agent Document projection.
The original parent, #103, is closed. Its stated scope included real CLI/script projection helpers, but the rendered CLI proof currently lives in package-specific route-unit/build tests rather than the public agent-bundle/test harness.
Delivered in #266 (merged as 0131bc6) against every acceptance criterion:
Rendered detection + render session: invokeCli itself now drives rendered commands — the shell's compiled rendered flag is the detection, and the harness installs an in-process render session mirroring the generated executable's (events() from the runtime dispatcher's public stream(), validate = the route's resultSchema.parse, same invocation/request-scope shapes, cwd-derived workspace per fix(test): honest registry version gate, binary-faithful CLI cwd, README field #206). Rendered route modules are preloaded so inputSchema.parse runs synchronously inside the render factory — an input rejection stays a usage failure (exit 2), matching the generated render bridge byte-for-behavior. No second rendering path: the CLI session shares render.ts's Flight-dispatcher wiring (and mountManifestState, pinned by the fixture's stateMounted: z.literal(true)).
Markdown/TTY/JSON/NDJSON: piped Markdown is the deterministic default; InvokeCliOptions.tty selects interactive projection (progress in place via \r\x1b[2K); --json yields the canonical validated value (also surfaced as invocation.value); new cliNdjson() returns the ordered CliRenderedEvent[] with honest AgentTestError diagnostics otherwise.
Cancellation / errors / purity: projection tests pin mid-render abort (Aborted., exit 1), component render errors on stderr (exit 1), resultSchema rejection (exit 1), rendered inputSchema rejection (exit 2 + usage hint), --ndjson on a plain command and --json --ndjson conflicts (exit 2), monotonic NDJSON sequences ending in complete, and no jsonrpc key anywhere (CLI dialect, never MCP JSON-RPC).
End-to-end projection test: tests/projection/cli-dispatch-rendered.test.ts exercises the new rendered fixture command (route-harness/src/cli/report.tsx) through the public agent-bundle/test exports, in the in-process projection pool — zero cost added to the packed pool.
Stale comments: the src/test/cli.ts header no longer claims rendered routes are an AB4816 compiler error; it now states honestly what cli-dispatch does not prove (no worker thread, no process framing, no chunk-by-chunk Flight timing — cli-routes-build.test.ts owns that at the packed level).
Scaffolder docs: the cli-tool template README now explains plain vs rendered proof levels (invokeCli/cliJson for both, cliNdjson + tty for rendered modes, packed suite for process evidence); the package README table/example updated to match.
Local gates on the branch: projection pool green (10 new rendered-dispatch tests), unit 2366 passed / 5 skipped / 0 failed, route-unit 15/15, tsc --noEmit clean across all three projects, rslint 0 errors / 0 warnings. Ships as a minor agent-bundle changeset.
Activity
feat(test): rendered commands at the cli-dispatch proof level (#253) (#…
ScriptedAlchemy commentedon Sep 2, 2026
Delivered in #266 (merged as 0131bc6) against every acceptance criterion:
invokeCliitself now drives rendered commands — the shell's compiledrenderedflag is the detection, and the harness installs an in-process render session mirroring the generated executable's (events()from the runtime dispatcher's publicstream(),validate= the route'sresultSchema.parse, same invocation/request-scope shapes, cwd-derived workspace per fix(test): honest registry version gate, binary-faithful CLI cwd, README field #206). Rendered route modules are preloaded soinputSchema.parseruns synchronously inside the render factory — an input rejection stays a usage failure (exit 2), matching the generatedrenderbridge byte-for-behavior. No second rendering path: the CLI session sharesrender.ts's Flight-dispatcher wiring (andmountManifestState, pinned by the fixture'sstateMounted: z.literal(true)).InvokeCliOptions.ttyselects interactive projection (progress in place via\r\x1b[2K);--jsonyields the canonical validated value (also surfaced asinvocation.value); newcliNdjson()returns the orderedCliRenderedEvent[]with honestAgentTestErrordiagnostics otherwise.Aborted., exit 1), component render errors on stderr (exit 1), resultSchema rejection (exit 1), rendered inputSchema rejection (exit 2 + usage hint),--ndjsonon a plain command and--json --ndjsonconflicts (exit 2), monotonic NDJSON sequences ending incomplete, and nojsonrpckey anywhere (CLI dialect, never MCP JSON-RPC).tests/projection/cli-dispatch-rendered.test.tsexercises the new rendered fixture command (route-harness/src/cli/report.tsx) through the publicagent-bundle/testexports, in the in-process projection pool — zero cost added to the packed pool.src/test/cli.tsheader no longer claims rendered routes are an AB4816 compiler error; it now states honestly whatcli-dispatchdoes not prove (no worker thread, no process framing, no chunk-by-chunk Flight timing —cli-routes-build.test.tsowns that at the packed level).invokeCli/cliJsonfor both,cliNdjson+ttyfor rendered modes, packed suite for process evidence); the package README table/example updated to match.Local gates on the branch: projection pool green (10 new rendered-dispatch tests), unit 2366 passed / 5 skipped / 0 failed, route-unit 15/15,
tsc --noEmitclean across all three projects, rslint 0 errors / 0 warnings. Ships as a minoragent-bundlechangeset.