Repository navigation
fix(training-agent): webhook envelope protocol uses AdCP domain, not 'mcp' - #2876
Merged
Merged
Conversation
The completion-webhook envelope emitted `protocol: 'mcp'` (transport name), but `core/mcp-webhook-payload.json` references `enums/adcp-protocol.json`, whose values are AdCP domains (`media-buy`, `signals`, `governance`, `creative`, `brand`, `sponsored-intelligence`). Any strict validator would reject `'mcp'`. Adds `TOOL_TO_PROTOCOL` keyed off `TOOL_TO_TASK_TYPE` so tsc enforces both maps stay in sync. Rule: operational context over task grouping — creative ops emitted by an inline-creative seller stamp `media-buy` (matching the `sync_creatives → media-buy` example in the payload schema); accounts stamp `governance` (identity/authorization); signals / property ops / brand ops stamp their own domain. - webhook_emission storyboard: 7P/0F under both dispatches (unchanged) - full framework run: 27/56 (unchanged) - full legacy run: 45/56 (unchanged) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Apr 25, 2026
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
Webhook completion envelope emitted
protocol: 'mcp'(a transport name), butcore/mcp-webhook-payload.jsonreferencesenums/adcp-protocol.jsonwhose values are AdCP domain names (media-buy,signals,governance,creative,brand,sponsored-intelligence). Any strict schema validator rejects'mcp'.Adds
TOOL_TO_PROTOCOLinserver/src/training-agent/webhooks.ts, keyed offTOOL_TO_TASK_TYPEso tsc enforces both maps stay in sync. Rule: operational context over task grouping — matches the normativesync_creatives → media-buyexample in the payload schema.Mapping
Expert review
ad-tech-protocol-expertsigned off with one correction (accounts → governance, applied).Test plan
webhook_emissionstoryboard: 7P/0F under both dispatchesnpm run typecheckcleannpm run test:unit631/631 passingSurfaced during review of #2868.
🤖 Generated with Claude Code