feat: --multi-instance storyboard mode#608
Merged
Merged
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
Round-robin storyboard steps across N seller URLs to catch horizontal-scaling persistence bugs where (brand, account)-scoped state lives in-process rather than in a shared store. Implements the client-side half of the cross-instance persistence requirement introduced in adcontextprotocol/adcp#2363. - CLI: --url repeatable, positional agent mutually exclusive - Library: runStoryboard(agentUrls: string | string[], ...) - Failure attribution: replica map + NOT_FOUND signature + docs deep-link - --stateful filter on storyboard list - docs/examples/multi-instance/ reference harness - URL validation: reject javascript:/file://, reject userinfo, require --allow-http for http Closes adcontextprotocol/adcp#2267. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3dc2d9c to
1ca73d4
Compare
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
Round-robin storyboard steps across N seller URLs to catch horizontal-scaling persistence bugs where
(brand, account)-scoped state lives in-process rather than in a shared store. Implements the client-side half of the cross-instance persistence requirement introduced in adcontextprotocol/adcp#2363.Closes adcontextprotocol/adcp#2267.
What shipped
runStoryboard(agentUrls: string | string[], ...). Multi-URL mode builds one client per URL, dispatches step N toclients[N % urls.length]. Each step result gainsagent_url+agent_index. Result gainsagent_urls[]+multi_instance_strategy._clientoption rejected in multi-instance (comply()'s shared client can't round-robin). Single-URL mode is unchanged.adcp storyboard run --url <a> --url <b> <storyboard_id>. Positional agent and--urlare mutually exclusive.--urlvalues are validated (http/https only, no userinfo, http requires--allow-http).--dry-runprints the per-step instance-assignment plan. JSON output includesagent_urls, per-stepagent_url,agent_index.--statefulfilter onstoryboard list. Derives from existingstep.statefulmetadata — returns the 40 storyboards that exercise write→read chains worth round-robining.docs/guides/MULTI-INSTANCE-TESTING.md(contract, failure signature, three verification paths, live smoke command against the public test agent),docs/examples/multi-instance/(docker-compose + Caddyfile + README).GovernanceAgentStub(with a regression assert that auth tokens are never echoed into any result field).Validated end-to-end
Ran against the live
test-agent.adcontextprotocol.orgwith?replica=a/?replica=bquery strings forcing two distinct MCP sessions:property_listspassed cross-replica (PR adcontextprotocol/adcp#2263 doing its job).Reproduce single-replicacommand in the attribution block gives the exact single-instance repro.Deliberate deferrals (tracked separately)
comply()— requires the full capability-driven path to share one client; multi-URL dispatch is incompatible with that optimization. Separate design pass.Expert review applied
Code review + security review run before filing. Must-fix and should-fix findings addressed:
--urlvalues are now validated for scheme, userinfo, andhttpvs--allow-httpparity (prevented--url file:///etc/passwdand userinfo-smuggled credentials from reaching the MCP transport).error,code,message,status,status_code) rather than regex-matching a fullJSON.stringify(response)— closes the gameability concern and theJSON.stringifycycles/size footgun..envis missingPOSTGRES_PASSWORD(removed the weak default); Caddyfile carries an explicit DEV-ONLY warning.rawMcpProbe) viaGovernanceAgentStub.Test plan
npm run build— cleannpm run lint— 0 errors, 457 warnings (all pre-existing)npm teston all storyboard + CLI tests — 1638/1638 passing locallytest-agent.adcontextprotocol.orgvia?replica=a|b— 6 of 7 stateful steps pass cross-replica, 1 intrinsic failure correctly attributed--urlvalidation smoke tests (javascript:,file://, userinfo, http-without-flag, malformed URL) all rejected with correct error messagesagent_url/agent_indexon steps in single-URL mode🤖 Generated with Claude Code