Conversation
…ller scenarios Adds two new comply_test_controller scenarios for storyboard parity with the AdCP spec additions adcp#3104 and adcp#3138, mirroring the training-agent implementations at adcp#3115 and adcp#3194. - force_create_media_buy_arm: registers a single-shot per-principal directive that drives the next create_media_buy call into submitted or input-required arm; validates arm enum, task_id requirement (submitted arm), and length caps. - force_task_completion: resolves a submitted task to completed; validates task_id ≤128 chars, result is non-empty object, encoded size ≤256 KB. Uses json.RawMessage for stable opaque payload passing to store implementations. - Both scenarios advertised in list_scenarios when store functions are wired. - ForcedDirectiveSuccess type added; registered in KNOWN_TYPES and EXEMPT to keep generate.py / lint.py consistent. - Sandbox bool guard added to TestControllerStore: RegisterTestController panics if store.Sandbox is false, providing startup-time enforcement of the existing MUST NOT register in production contract (mirrors buildCapabilities pattern). - Nine new tests covering valid params, INVALID_PARAMS branches, NOT_FOUND cross-account, INVALID_TRANSITION diverging replay, and list_scenarios advertisement. Closes #97 https://claude.ai/code/session_01Js7WwyJontwvwN6G5Um1Z3
- Error strings now say "≤128 bytes" / "≤2000 bytes" (len() is byte-based) - TestRegisterTestController_SandboxGuard exercises the new panic contract - ForcedDirectiveSuccess KNOWN_TYPES entry notes pending adcp#3104 upstream schema so bundle-bump owner knows to revisit https://claude.ai/code/session_01Js7WwyJontwvwN6G5Um1Z3
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 #97
Adds
force_create_media_buy_arm(adcp#3104) andforce_task_completion(adcp#3138) toadcp/testcontroller.go, giving the Go reference seller storyboard parity with the training-agent implementations at adcp#3115 and adcp#3194.What changed
force_create_media_buy_arm— registers a single-shot per-principal directive that drives the nextcreate_media_buycall intosubmittedorinput-requiredarm. Validates arm enum usingTaskStatusSubmitted/TaskStatusInputRequiredconstants,task_idrequirement (submitted arm only), and byte-length caps (task_id ≤128 B, message ≤2000 B). ReturnsForcedDirectiveSuccess.force_task_completion— resolves a submitted task tocompleted. Validates task_id (≤128 B), result is non-empty object, encoded size ≤256 KB. Re-marshals frommap[string]anytojson.RawMessagebefore the size check for stable opaque payload passing. ReturnsStateTransitionSuccessfromtypes_gen.go(includesmessage,context,extfields the storyboard harness validates against).Sandbox boolguard —RegisterTestControllerpanics at startup ifstore.Sandboxis false, providing runtime enforcement of the existing "MUST NOT register in production" contract. Mirrors thebuildCapabilitiesstartup-panic pattern.ForcedDirectiveSuccesstype — hand-written and registered in bothKNOWN_TYPES(generate.py) andEXEMPT(lint.py). Comment notes the pending upstream schema in adcp#3104 so the bundle-bump owner knows to check for drift when the version pin moves past 3.0.0.Both scenarios advertised in
list_scenarioswhen store functions are wired.Cross-account isolation, single-shot consumed-and-cleared semantics, and idempotency are seller responsibilities (consistent with every other
force_*scenario in the existing dispatch layer).Caveats: buyer-side
tasks/getpolling round-trip is deferred pending adcp-client#994. This PR ships the controller-side primitive only; storyboard runners mark the buyer-side polling scenarionot_applicableuntil that lands.What was tested
go build ./...✓go vet ./...✓cd adcp && go test ./...✓ — all packages including 10 new tests:TestForceCreateMediaBuyArm_SubmittedTestForceCreateMediaBuyArm_InputRequiredTestForceCreateMediaBuyArm_InvalidParams(5 sub-cases: missing arm, invalid arm, submitted without task_id, task_id too long, message too long)TestForceTaskCompletion_ValidTestForceTaskCompletion_InvalidParams(5 sub-cases: missing task_id, task_id too long, missing result, empty result, result not object)TestForceTaskCompletion_NotFoundTestForceTaskCompletion_InvalidTransitionTestRegisterTestController_SandboxGuardTestListScenarios_IncludesNewScenariosPre-PR review
StateTransitionSuccessfor force_task_completion), arm enum values match A2A/AdCP vocab, deferred buyer-side polling does not create a conformance gapSession: https://claude.ai/code/session_01Js7WwyJontwvwN6G5Um1Z3
Generated by Claude Code