Skip to content

chore(examples): use built-in framework surface — hooks-and-scripts, host-test, mcp-app, skills-starter - #471

Merged
ScriptedAlchemy merged 3 commits into
mainfrom
chore/examples-group-b-use-builtins
Sep 4, 2026
Merged

chore(examples): use built-in framework surface — hooks-and-scripts, host-test, mcp-app, skills-starter#471
ScriptedAlchemy merged 3 commits into
mainfrom
chore/examples-group-b-use-builtins

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Examples-only. Audits hooks-and-scripts, host-test, mcp-app, and skills-starter for hand-rolled equivalents of surfaces agent-bundle / @agent-bundle/runtime ship publicly, and replaces the clear-cut ones. No publishable package changes (examples are private; changeset status should pass without a changeset).

Built-in test convention

Yes. agent-bundle/rstest (agentBundleRstest, agentBundleBrowserRstest) owns the route-unit and browser-app pools; agent-bundle/test and agent-bundle/test/browser ship the proof-level helpers (renderRoute, expectDocument, testManifest, openInMemoryMcpServer, runContractMatrix, mountBrowserApp, …). host-test and mcp-app already used them; hooks-and-scripts and skills-starter ship no tests and none were invented.

Per example

Example Finding Where Category Outcome
host-test snapshotRequest cast the context to reach an optional lineage; request.lineage is a first-class Observed<AgentLineage> since #444 src/capture.ts:139-148 (a) Reads context.lineage directly, recorded on every line (available or unavailable + reason); README updated; new route-unit test for a mounted lineage
host-test renderLineage parsed the serialized lineage with ad-hoc shapes src/dump.ts:156-163 (a) Typed against the public Observed<AgentLineage>
host-test Hand-rolled McpServer factory (host-test-raw), raw identity-key lifting, redaction, log-dir resolution, probe lifecycle scripts src/mcp/host-test-raw.ts, src/capture.ts, src/log.ts, scripts/probe.mjs (c) Intentional — the probe exists to record the wire/raw layer the framework abstracts; probe.mjs already drives agent-bundle install; no public redaction or uninstall surface exists
host-test CLI restates the dump zod schema src/cli/dump.tsx:16-24 (c) Documented: routed CLI argv projection needs literal zod
skills-starter Graders restated the grader context/outcome shapes by hand evals/graders/*.ts (a) Typed as the public EvalGraderFunction from agent-bundle/eval
skills-starter README named dist/ as build output; the CLI writes artifact/ README.md:67-68 (a) Corrected
mcp-app Grader restated the grader context/outcome shapes evals/graders/status-result.ts (a) Typed as the public EvalGraderFunction
mcp-app README mcp run … --artifact dist does not match the build output README.md:87 (a) --artifact artifact
mcp-app Hand-rolled McpServer factory with registerResource/registerTool src/mcp/status.ts (c) Intentional — the example teaches the src/mcp/<server>.ts factory convention and agent-bundle/mcp-apps
mcp-app waitFor polling helper in the browser test tests/browser-app/status-panel.browser.test.ts:27-33 No framework equivalent; left alone
hooks-and-scripts Hand-typed SessionStartEvent and plain main scripts src/hooks/session-start.ts, src/scripts/*.ts (c) Exactly the documented handler/script contract (guide/authoring/hooks.mdx); no public hook event type exists

Verification

  • examples/host-test: pnpm validate, pnpm build, pnpm typecheck, pnpm test (6 route-unit tests, incl. the new lineage test)
  • examples/skills-starter: pnpm check; agent-bundle eval --trials 1 --artifact artifact (3/3 pass) and the README command (--case release-artifact-is-ready)
  • examples/mcp-app: pnpm check; agent-bundle eval --case status-is-healthy (pass); pnpm test:browser-app (4/4); mcp run --server status --target portable --artifact artifact exits 0 on stdin EOF
  • examples/hooks-and-scripts: pnpm check
  • Repo: examples-contract.test.ts + examples-check-script.test.ts (integration pool, 6/6); pnpm test:examples:browser — real Chrome at 1440×900, populated state plus the stale-diagnostic and repair flow for skills-starter, hooks-and-scripts, mcp-app (5/5); pnpm typecheck; pnpm lint
  • host-test has no documented Workbench browser gate (its noninteractive checks are validate/build/typecheck/test), so no browser acceptance was run for it.

Review status

No external reviewer requested; merge on green CI.

CI: every check is green except Release gates (Node 22.19), which failed on four consecutive attempts of the same head (run 33816104907) inside pnpm audit:releasescripts/audit-packed-release.mjsnpm audit --omit=dev --json: attempt 1 503 Service Unavailable; attempt 2 400 Bad Request (This endpoint is being retired. Use the bulk advisory endpoint instead); attempts 3–4 the step goes silent after attw and the job ends with an orphaned npm audit process. The same job fails the same way on main (runs 33815925969, 33817708818) and on #473, and passed intermittently for #455. This PR touches no publishable package, no scripts/, and no lockfile, so the cause is the npm quick-audit endpoint; the fix belongs in scripts/audit-packed-release.mjs (bulk advisory endpoint or a bounded retry). Holding the merge for a green rerun.

…context member

request.lineage is a first-class Observed<AgentLineage> on AgentRequestContext
since #444, so the probe reads it directly instead of casting for an optional
member and records it on every line (available or unavailable with reason).
renderLineage types the serialized value against the public AgentLineage and
Observed types. The route-unit suite asserts a mounted lineage is recorded and
rendered.
…ndle/eval

Both graders declare themselves as the public EvalGraderFunction instead of
restating the grader context and outcome shapes by hand. The README names the
build output directory the CLI actually writes (artifact/, not dist/).
…/eval

The status grader declares itself as the public EvalGraderFunction instead of
restating the grader context and outcome shapes. The README's mcp run example
reuses the build output the CLI actually writes (--artifact artifact).
@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 571bb1e

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 3, 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-03T23:09:04.662654Z 571bb1e 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 3, 2026

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

commit: 571bb1e

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