Skip to content

feat(test): assert warm runtime identity in contract matrix - #337

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
fix/218-identity-assertions
Sep 3, 2026
Merged

feat(test): assert warm runtime identity in contract matrix#337
ScriptedAlchemy merged 2 commits into
mainfrom
fix/218-identity-assertions

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a capability-gated runtime-instance-identity boundary check that samples the pinned event-runtime status before and throughout packed and installed-host matrix events
  • fail on instance, artifact-epoch, or degraded-availability drift; report honest not-applicable outcomes for in-memory, non-owning-server, and stateless/no-event boundaries
  • pin lifecycle state declarations to the compiled manifest catalog, expose installed runtime socket derivation, and add a patch changeset

Closes the runtime-identity assertion gap tracked in #218 after #269.

Test plan

  • pnpm exec rstest --config rstest.projection.config.ts packages/agent-bundle/tests/projection/contract-matrix.test.ts (13 passed)
  • pnpm test:host-install (9 passed, 0 skipped; real Claude and Codex lanes ran, plus Cursor)
  • node scripts/run-packed-tests.mjs packages/agent-bundle/tests/packed-stdio-projection.test.ts (1 passed)
  • pnpm typecheck
  • pnpm lint (0 errors, 0 warnings)
  • CI Release gates (Node 22.19), including the full packed pool

Known upstream CI blocker

  • Verify (Node 24): unchanged overview.e2e.test.ts expects one event-hub subscription after fixture startup but receives two after the concurrently landed host-proxy change
  • current main fails identically; one PR rerun reproduced it
  • this PR does not alter Workbench/runtime subscription code

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 28124ce

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 Patch

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 2, 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-02T23:33:37.811506Z 9f5870d 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 2, 2026

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

commit: 28124ce

@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: 9f5870d024

ℹ️ 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 +413 to +414
const hasEventRoutes = Object.values(manifest.routes)
.some((route) => route.kind === 'event-route');

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 Restrict identity checks to the runtime-owning server

In artifacts with multiple generated MCP servers and any event route, this global predicate enables runtime tracking for every server selected via options.server. However, compileMcpEntries attaches eventRoutes only to the first generated eventHostId, so a matrix run against another server either reports the shared endpoint as unavailable and fails an otherwise healthy contract, or—if the owner is also running—measures the wrong process. Pass serverName into this decision and only require identity evidence for the server that actually owns the event runtime.

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 371b4b1. The test manifest now records the first generated MCP server that owns event routes, and the identity tracker reports not-applicable for any other selected server; the regression passes a dead socket to prove it is never read.

Pin packed and installed-host event sequences to one warm runtime instance and match stateful lifecycle fixtures to the compiled state catalog.
Record the generated server that owns event routes so multi-server matrices do not probe another server's runtime.
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