Skip to content

feat(test): explicit target-capability fixtures for non-text MCP content (#103 remainder) - #239

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
chore/103-capability-fixtures
Sep 1, 2026
Merged

feat(test): explicit target-capability fixtures for non-text MCP content (#103 remainder)#239
ScriptedAlchemy merged 1 commit into
mainfrom
chore/103-capability-fixtures

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Closes out the target-capability acceptance item on #103: "Audio and other non-text content is projected only when the target capability fixture advertises support; fallback and fail-closed paths are both tested" — the harness previously had route-level fail-closed coverage but no dedicated capability-fixture surface in agent-bundle/test.

  • createTargetCapabilityFixture() (agent-bundle/test): an immutable, explicit fixture over the issue's capability list — image, audio, resource, progress, with text as the non-configurable always-supported baseline. No rich capability defaults to supported: callers choose every boolean and the richContentFallback: 'text' | 'fail' policy, so a test can never pretend unsupported content is accepted by omission.
  • projectTargetCapabilities(): reprojects a real renderRouteEvents() stream through the runtime's own projectMcpRenderStream — the same projector production uses — with exactly the advertised capabilities. Progress maps to the real progress-token/notification contract. Proof level stays honestly route-unit: real renderer, real projector, no transport/packed/host claim.
  • Fail-closed: a denied kind under fallback: 'fail' surfaces as AgentTestError code unsupported-rich-content, identifying the offending kind and the fixture, with the proof level in the failure output. Under fallback: 'text' the runtime's exact placeholder blocks ([image <mime>], [audio <mime>], [resource <name> <uri>]) are asserted and no rich block leaks.
  • Matchers: expectDocument() gains field-aware toContainImage / toContainAudio / toContainResource for non-text Agent Document nodes; existing text assertions are proven not to widen.
  • Fixture: a route module emitting text + PNG image + WAV audio + binary (data-URI) resource nodes plus request-scoped progress, exercised across supported / fallback / fail-closed in tests/projection/target-capabilities.test.ts.

Changeset: agent-bundle minor (new public test-harness surface). No runtime behavior changes.

Gates (local)

  • pnpm test:unit — 2303 passed / 5 skipped (worker run); scoped test-harness-manifest.test.ts re-run post-rebase: 32 passed
  • pnpm test:route-unit — passed (post-rebase)
  • pnpm test:projection — 30 passed, 0 failed (post-rebase)
  • pnpm typecheck — clean
  • pnpm lint — 0 errors, 0 warnings

Part of #103 (with the create-agent-bundle template-adoption PR, this completes the issue's remaining items).

@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:38:04.484649Z f7be27a 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@239
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@239
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@239

commit: 224c7a0

Expose route-unit fixtures that drive the real MCP projector so consumers can prove supported, fallback, and fail-closed rich-content behavior without overstating transport evidence.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the chore/103-capability-fixtures branch from f7be27a to 224c7a0 Compare September 1, 2026 23:43
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 224c7a0

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

This PR includes changesets to release 1 package
Name Type
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

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