fix(bridge): debug log on sandbox-gate reject across 13 dispatcher branches#1780
Merged
Conversation
…account mismatch When an adopter sets account.sandbox: true (or context.sandbox: true) on a request but resolveAccount returns sandbox: false, the dispatcher's TestControllerBridge gate rejects the merge silently. Adopters chasing "why aren't my fixtures showing in storyboards" had no diagnostic surface — the request looked sandbox-shaped but no fixtures appeared and no logs explained the gap. That was the #1 adopter support question after #1753 shipped. Adds a single logger.debug line inside create-adcp-server.ts covering all 13 dispatcher branches in one shot — the diagnostic fires after the request-sandbox check passes but before the resolved-account check. Production traffic (no sandbox marker on request) fails the first gate and never reaches this branch, so the log surface is dev-only. Three regression tests in seed-per-tool-wiring.test.js verify: gate-mismatch fires debug; production traffic does not fire debug; gate-pass does not fire debug and merge proceeds normally. Product-review-driven during the post-merge review of (now-closed) #1754. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Product-expert review of PR #1780 flagged the log line as diagnostic but not prescriptive — it told you *what* (gate rejected) but not *what to change* (which tenant key resolved to sandbox: false). Adding resolved_account_id to the structured meta makes the line self- diagnostic for the common case: scope3-shaped adopters can match the rejected account against their resolveAccount source without correlating across log lines. account_ids appear in normal request logs already; no new PII surface. Regression test updated to assert hit.data.resolved_account_id. 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
logger.debugline insrc/lib/server/create-adcp-server.tsthat fires when the request carries a sandbox marker but the resolvedctx.accountis explicitlysandbox: false.test/lib/seed-per-tool-wiring.test.js: gate-mismatch fires, production traffic does not fire, gate-pass does not fire and merge proceeds.Why
After #1753 shipped, the #1 adopter support question was "why aren't my fixtures showing in storyboards" when their request was sandbox-shaped but their resolved account was production. The gate rejected silently and adopters had no diagnostic surface. The dev-only
debugline surfaces the rejection without adding production-traffic noise — production traffic fails the first gate (isSandboxRequest) and never reaches this branch.Product-review-driven during the post-merge review of (now-closed) #1754.
Test plan
NODE_ENV=test node --test test/lib/seed-per-tool-wiring.test.js— 138/138 pass (3 new + 135 existing).tsc --noEmitclean.prettier --checkclean.