feat(example): hello-cluster orchestrator — npm run hello-cluster (#1335)#1370
Merged
Conversation
) `examples/hello-cluster.ts` boots every per-specialism hello adapter on its declared port (signals 3001 → retail-media 3006), preflights each adapter's upstream backend, health-checks via MCP tools/list, and emits a YAML routing manifest the storyboard runner (#1066, landing as #1355) consumes via `--agents-map`. Manifest shape locked end-to-end against #1355's parser: `agents.<key>.{ url, auth }` matching `TestOptions['auth']`, top-level `default_agent`, plus a top-level structured `pending: [...]` sibling that the runner ignores but tooling can surface. Today only the signals hello adapter exists; the rest (#1332/#1333/#1334 plus sales / retail-media) appear in the pending list and are picked up automatically when their entrypoint files land. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/hello-cluster.ts(andnpm run hello-cluster) boots every per-specialism hello adapter on its declared port (signals 3001 → retail-media 3006), preflights each adapter's upstream backend, health-checks via MCPtools/list, and emits a YAML routing manifest for the storyboard runner.parseAgentsMapArgs:agents.<key>.{ url, auth }matchingTestOptions['auth'], top-leveldefault_agent, plus a top-level structuredpending: [...]sibling that the runner ignores but tooling can surface.Closes #1335. Unblocks the local test loop for #1066 (#1355).
Behavior
tearingDownguard prevents N concurrent reap cycles when sibling exit handlers fire during the first reap.TypeError: fetch failed.AdapterConfigdeclares its upstream env var + default URL + probe path. Cluster fetches every distinct upstream URL once with a 1.5s timeout BEFORE spawning. Network refusal → exit 1 with a copy-pasteable hint:UPSTREAM_URL(they're clearly not running mock-server).NODE_ENV=developmentby default (the in-memory task registry refuses production). The cluster itself refuses to boot under a production parent unlessHELLO_CLUSTER_I_KNOW_NOT_PROD=1is set — defense in depth so an LLM scaffolding from this file or an adopter copy-pasting into staging can't accidentally rewrite NODE_ENV on a real deployment.HELLO_CLUSTER_PORT_BASE=40000shifts the whole range when 3001–3006 are busy or when running side-by-side clusters.default_agentomission: when its target (sales) is in pending, the key is omitted with an explanatory YAML comment so storyboards expectingsalesfail loud rather than silently retargeting to whichever adapter sorted first.Deferred (filed-worthy follow-ups)
HELLO_CLUSTER_HOSTfor binding0.0.0.0(peer-container topologies)HELLO_CLUSTER_STRICT=1so CI fails when the expected adapter set isn't fully presentHELLO_CLUSTER_SKIP_PREFLIGHT=1for offline bootReview history
Two rounds of expert review (code-reviewer + adtech-product-expert + dx-expert in parallel). Round 1 surfaced: dead-code ternary, reap re-entrancy, missing child-stderr surfacing, NODE_ENV footgun, silent
default_agentfallback, missing routing-key comment, missing structuredpending:, missing upstream preflight. Round 2 verified those landed and surfaced: empty-string env edge case, AbortController timer leak, misleading mock-server hint when on a non-default backend, missing default_agent omission explainer. All now fixed.Manifest shape verified end-to-end through the same
yaml.parse+parsed.agentslookup pattern PR #1355'sparseAgentsMapArgsuses.Test plan
tsc --strict --noUncheckedIndexedAccess --exactOptionalPropertyTypes)npm run typecheck:examplescleannpx prettier --checkcleannode --test test/examples/hello-seller-adapter-signal-marketplace.test.js— 4/4 pass, no regression to the adapter the cluster boots--agents-maponce feat(testing): per-specialism storyboard routing — runStoryboard({ agents }) (#1066) #1355 lands and Hello adapter for governance specialism #1332/Hello adapter for creative specialism #1333/Hello adapter for brand-rights specialism #1334 hello adapters are in tree🤖 Generated with Claude Code