Skip to content

fix(testing): extend ComplyControllerConfig.force with create_media_buy_arm and task_completion slots#1477

Merged
bokelley merged 2 commits into
mainfrom
claude/issue-1472-comply-controller-arm-task-slots
May 3, 2026
Merged

fix(testing): extend ComplyControllerConfig.force with create_media_buy_arm and task_completion slots#1477
bokelley merged 2 commits into
mainfrom
claude/issue-1472-comply-controller-arm-task-slots

Conversation

@bokelley

@bokelley bokelley commented May 3, 2026

Copy link
Copy Markdown
Contributor

Closes #1472

ComplyControllerConfig.force (the structured-config façade for createComplyController and createAdcpServerFromPlatform({ complyTest })) was missing create_media_buy_arm and task_completion slots. Both scenarios were already fully handled by the dispatcher in test-controller.ts (in CONTROLLER_SCENARIOS, SCENARIO_MAP, and the switch dispatch), but buildStore and advertisedScenarios had no bridge from the typed config to the corresponding store methods — so adopters on the structured config always hit UNKNOWN_SCENARIO regardless of whether they implemented the underlying logic. This PR adds both slots, the required param interfaces, a distinct DirectiveAdapter<P> type (returns ForcedDirectiveSuccess, not StateTransitionSuccess), wires them through buildStore and advertisedScenarios, re-exports all three new types from testing/index.ts, extends the client-side ControllerScenario union, and updates the "fully implemented" test in server-test-controller.test.js (count 6 → 8).

What changed

  • src/lib/testing/comply-controller.tsForceCreateMediaBuyArmParams, ForceTaskCompletionParams, DirectiveAdapter<P> types; two new force?:{} slots; buildStore and advertisedScenarios wiring
  • src/lib/testing/index.ts — re-exports DirectiveAdapter, ForceCreateMediaBuyArmParams, ForceTaskCompletionParams
  • src/lib/testing/test-controller.ts — client-side ControllerScenario union extended with both new scenario strings
  • test/comply-controller.test.js — 5 new tests: list_scenarios advertising, adapter dispatch + param capture, UNKNOWN_SCENARIO fallback for each new slot
  • test/server-test-controller.test.js — "fully implemented" store updated (adds forceCreateMediaBuyArm, forceTaskCompletion; length assertion 6 → 8)
  • .changeset/comply-controller-arm-task-slots.md — minor bump

What tested

  • npm run format:check — passed
  • npm run build:lib (via tsc --project tsconfig.lib.json) — passed (pre-existing @types/node + moduleResolution=node10 diagnostics are environment-level, present before this change, exit 0)
  • npm test — cannot run locally (no node_modules in this environment); CI will validate

Pre-PR review:

  • code-reviewer: approved after two blockers fixed (missing re-exports from testing/index.ts; stale "fully implemented" test count 6 → 8)
  • ad-tech-protocol-expert: approved — params match wire contract exactly, DirectiveAdapter<P> return type correct per AdCP 3.0 GA ForcedDirectiveSuccess discriminant, non-breaking

Nits surfaced (not fixed — cosmetic):

  • buildStore pass-through for create_media_buy_arm is intentionally asymmetric vs other bridges (direct object pass-through vs positional-to-object repack for task_completion); could use a one-line comment
  • isSuccess type guard in testing/test-controller.ts has stale annotation predating this PR (follow-up candidate)

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/session_018JaCGaJSMMiwTbnsGxrLaJ


Generated by Claude Code

…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.
@bokelley bokelley marked this pull request as ready for review May 3, 2026 15:27
@bokelley bokelley merged commit a6c71fb into main May 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ComplyControllerConfig.force missing create_media_buy_arm and task_completion slots

2 participants