Skip to content

feat(events): read-only runtime-identity status verb on the event IPC (#269) - #324

Merged
ScriptedAlchemy merged 3 commits into
mainfrom
wave/269-runtime-identity
Sep 2, 2026
Merged

feat(events): read-only runtime-identity status verb on the event IPC (#269)#324
ScriptedAlchemy merged 3 commits into
mainfrom
wave/269-runtime-identity

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Deliverable 2 of 2 for #269 (the #98 visibility remainder): a pinned read-only status verb on the event-runtime IPC exposes WarmRuntimeIdentity, so doctor and the Workbench Hosts page can honestly report which runtime instance owns process-lifetime state — previously doctor only bare-TCP-probed event-*.sock and never spoke the protocol.

  • Wire (additive, protocolVersion stays 1): request {"kind":"status","protocolVersion":1} (strict); success carries runtime: { instanceId, artifactEpoch, availability, pid, startedAt? } (strict). The verb has no artifact-epoch gate — its point is that a caller who does not know the epoch learns it. Backward compat is a detectable degraded state: an older server (or one composed without a status source) strict-rejects the request and answers invalid-message, which the new client maps to one honest unsupported outcome, distinct from unavailable (no listener). Event requests are byte-identical to before; generated hook standalone-fallback semantics on connect errors are untouched.
  • Warm runtime (@agent-bundle/runtime): additive WarmFlightHost.availability() accessor (available / runtime-restarted / runtime-unavailable); createFlightWorkerHost now marks the warm host on worker exit, so the verb reports runtime-restarted after a worker death while retaining the same instanceId (pinned in the generated-server integration test).
  • Wiring: createGeneratedRouteMcpServer feeds the status source from the warm host's own identity — generated entries get it automatically through the existing GeneratedEventRuntimeBinding; no codegen change. Servers with no warm-host identity stay honestly unsupported.
  • Doctor: each live socket gets a bounded (1 s) read-only status probe; findings gain runtime (identity or unsupported/unavailable/failed). New diagnostics registered in docs/diagnostics.md: AB7317 (info: pre-Workbench state-lifetime catalog display and runtime-instance identity introspection (#98 visibility remainder) #269 runtime, no identity support) and AB7318 (error: probe unavailable/timeout/invalid). Doctor never mutates and cannot hang (silent-socket bound pinned in tests).
  • Workbench: the discovery wire (contracts/discovery.ts → service → strict client decoder → Hosts page) carries the per-endpoint runtime identity; display is read-only with honest neutral text for unsupported/unreported (no role="alert" for absence). G6: zero mutation affordances.

Per the #218 stage-2/3 deferral ("blocked on #269"): the contract matrix can now assert warm-runtime instance identity at the packed and installed-host boundaries by speaking this verb against the artifact's event endpoint (requestEventRuntimeStatus accepts an endpointId or a raw socket path).

Test plan

  • pnpm build, pnpm lint (0/0), pnpm typecheck
  • pnpm test:unit, pnpm test:route-unit, pnpm test:projection
  • IPC: status by endpointId and by socket path, no-epoch-gate, unsupported vs unavailable distinctly, strict unknown-key rejection
  • Generated-server integration: same instanceId across consecutive status calls; runtime-restarted with retained identity after worker death; thin-client event path unchanged
  • Doctor: identity from a live status endpoint, honest AB7317 on an old-protocol socket, bounded AB7318 on a silent socket
  • Discovery integration (host-discovery-dev-server) + Workbench discovery.e2e at 1440×900
  • Changesets: @agent-bundle/runtime minor, agent-bundle minor

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e785249

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

This PR includes changesets to release 2 packages
Name Type
@agent-bundle/runtime Minor
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 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-02T22:55:51.073472Z f976d4f 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@324
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@324
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@324

commit: f976d4f

Add a pinned read-only status verb and carry warm-runtime availability through Doctor and Workbench discovery.
Exercise the generated event status endpoint before and after a worker exits nonzero.
Keep every event-runtime connection failure classified as unavailable so generated hooks retain standalone fallback behavior.

@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: f976d4ffa6

ℹ️ 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".

findings.push({ path, state: 'live' });
let runtime: DoctorRuntimeStatus;
try {
const probed = await requestEventRuntimeStatus({ endpoint: path, timeoutMs: 1_000 });

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 Bound the endpoint scan as a whole

When the endpoint directory contains multiple listeners that accept connections but never answer—exactly the silent-runtime failure this probe is intended to diagnose—this await runs each one-second timeout serially inside the surrounding loop. Doctor and the Workbench discovery request therefore take roughly N seconds for N silent endpoints, so the per-socket timeout does not provide a useful overall bound; probe endpoints concurrently with bounded concurrency or apply a deadline to the complete scan.

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 #397 (merged as d25a9c6). doctor.ts scans runtime endpoints with mapConcurrent (concurrency 8) instead of serially, so a directory of silent endpoints is bounded as a whole rather than costing one 1 s timeout each; tests/doctor.test.ts asserts concurrent probing timing against fake silent endpoints.

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