fix(testing): extend ComplyControllerConfig.force with create_media_buy_arm and task_completion slots#1477
Merged
bokelley merged 2 commits intoMay 3, 2026
Conversation
…uy_arm and task_completion slots Closes #1472 buildStore and advertisedScenarios in comply-controller.ts now bridge the two scenarios that were already handled by the dispatcher and SCENARIO_MAP but had no path through the structured-config façade. Adds DirectiveAdapter<P> (returns ForcedDirectiveSuccess, not StateTransitionSuccess) for the arm- registration scenario, and the corresponding param interfaces. All three new types are re-exported from testing/index.ts. Client-side ControllerScenario union in testing/test-controller.ts extended to include both new scenario strings. server-test-controller.test.js "fully implemented" test updated to include forceCreateMediaBuyArm and forceTaskCompletion (count 6 → 8). https://claude.ai/code/session_018JaCGaJSMMiwTbnsGxrLaJ
CI's prettier --check flagged a multi-line array literal that fits within the 120-char line limit. No behavior change.
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.
Closes #1472
ComplyControllerConfig.force(the structured-config façade forcreateComplyControllerandcreateAdcpServerFromPlatform({ complyTest })) was missingcreate_media_buy_armandtask_completionslots. Both scenarios were already fully handled by the dispatcher intest-controller.ts(inCONTROLLER_SCENARIOS,SCENARIO_MAP, and theswitchdispatch), butbuildStoreandadvertisedScenarioshad no bridge from the typed config to the corresponding store methods — so adopters on the structured config always hitUNKNOWN_SCENARIOregardless of whether they implemented the underlying logic. This PR adds both slots, the required param interfaces, a distinctDirectiveAdapter<P>type (returnsForcedDirectiveSuccess, notStateTransitionSuccess), wires them throughbuildStoreandadvertisedScenarios, re-exports all three new types fromtesting/index.ts, extends the client-sideControllerScenariounion, and updates the "fully implemented" test inserver-test-controller.test.js(count 6 → 8).What changed
src/lib/testing/comply-controller.ts—ForceCreateMediaBuyArmParams,ForceTaskCompletionParams,DirectiveAdapter<P>types; two newforce?:{}slots;buildStoreandadvertisedScenarioswiringsrc/lib/testing/index.ts— re-exportsDirectiveAdapter,ForceCreateMediaBuyArmParams,ForceTaskCompletionParamssrc/lib/testing/test-controller.ts— client-sideControllerScenariounion extended with both new scenario stringstest/comply-controller.test.js— 5 new tests: list_scenarios advertising, adapter dispatch + param capture, UNKNOWN_SCENARIO fallback for each new slottest/server-test-controller.test.js— "fully implemented" store updated (addsforceCreateMediaBuyArm,forceTaskCompletion; length assertion 6 → 8).changeset/comply-controller-arm-task-slots.md— minor bumpWhat tested
npm run format:check— passednpm run build:lib(viatsc --project tsconfig.lib.json) — passed (pre-existing@types/node+moduleResolution=node10diagnostics are environment-level, present before this change, exit 0)npm test— cannot run locally (nonode_modulesin this environment); CI will validatePre-PR review:
testing/index.ts; stale "fully implemented" test count 6 → 8)DirectiveAdapter<P>return type correct per AdCP 3.0 GAForcedDirectiveSuccessdiscriminant, non-breakingNits surfaced (not fixed — cosmetic):
buildStorepass-through forcreate_media_buy_armis intentionally asymmetric vs other bridges (direct object pass-through vs positional-to-object repack fortask_completion); could use a one-line commentisSuccesstype guard intesting/test-controller.tshas stale annotation predating this PR (follow-up candidate)Session: https://claude.ai/code/session_018JaCGaJSMMiwTbnsGxrLaJ
Generated by Claude Code