Repository navigation
feat(examples): add hello_seller_adapter_proposal_mode for sole-stateful exemption coverage (#1549) - #1594
Merged
Conversation
…ller_adapter_proposal_mode (#1549) Wires comply_test_controller into the proposal-mode reference adapter (seed.media_buy / force.media_buy_status / simulate.delivery, gated by the framework's mode==='sandbox' admission per the other reference sellers) and adds invariant assertions to the gate test that verify the SDK behavior PR #1545 introduced: sync_accounts skip carries the sole-stateful exemption marker AND none of the four downstream phases (brief_with_proposals, refine_proposal, finalize_proposal, accept_proposal) are cascade-skipped from the setup-phase skip. Closes the example-tier coverage gap nodejs-testing-expert flagged on PR #1545. The runner-level invariant test in the cascade-skip-on-skip matrix already covers the unit layer; this adds the end-to-end mirror of how proposal-mode adopters (adcp-client-python#550) actually exercise the SDK. The proposal lifecycle past brief_with_proposals stops on the balanced_reach_q2 placeholder gap tracked at adcp#4086 + draft PR #4088. The gate test acknowledges the failure via EXPECTED_FAILURES so the issue-#1549 invariants run against a clean grader output, and the defensive stale-allowlist check flips the gate red the moment that spec PR lands. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 8, 2026
bokelley
added a commit
that referenced
this pull request
May 8, 2026
…fork-target pointers (#1385) (#1597) * docs(skills): collapse signal/creative/seller specialism skills onto fork-target pointers (#1385) Extends the PR #1373 precedent (each specialism = "fork target + deltas") to the in-scope specialisms. Each specialism file now opens with a fork-target pointer and SHAPE-GOTCHAS reference; only this specialism's deltas remain. In-scope specialisms touched: - signal-marketplace, signal-owned: full fork-target shape; signal-owned now a delta-only section. - creative-generative: reuses creative-template adapter; delta-only section for brief-to-creative input + brand resolution. - sales-broadcast-tv: reuses sales-guaranteed; DMA, GRP, daypart, agency estimate number, measurement windows. - sales-streaming-tv (NEW): reuses sales-guaranteed; CTV deltas. Preview specialism — placeholder storyboard. - sales-catalog-driven, sales-retail-media: reuses sales-social adapter (already implements syncCatalogs/syncEventSources/logEvent). - audience-sync: reuses sales-social; audiences-only slice, no SalesCorePlatform. - sales-proposal-mode: full pointer to PR #1594 hello adapter; deltas around ProposalManager + ctx.recipes hydration + sole-stateful-step exemption + ctx_metadata. - build-seller-agent/SKILL.md: specialism table now lists each fork target + link to its deltas page. * chore(changeset): add changeset for #1385 docs collapse Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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 #1549. Companion to PR #1548 (cascade-skip matrix refactor) and PR #1545 (the runner fix that surfaced the coverage gap).
Summary
Wires
comply_test_controllerintoexamples/hello_seller_adapter_proposal_mode.tsand adds invariant assertions to its gate test that verify the SDK behavior PR adcp-client#1545 introduced: a proposal-mode adopter that doesn't advertisesync_accounts(because account state materializes on the firstget_productscall) MUST NOT trip the cross-phase cascade.nodejs-testing-expert's review on PR #1545 noted that none of the existingtest/examples/hello-*adapters are shaped like proposal-mode — they all advertisesync_accounts, so the example-adapter test layer never exercised the sole-stateful-step pattern that PR adcp-client-python#550 hit. The runner-level invariant test added in PR #1545 covers the unit layer (cascade-skip-on-skip matrix); this PR adds the end-to-end mirror of how a real proposal-mode adopter exercises the SDK.What the adapter advertises
Proposal-mode declares
accounts.resolution: 'explicit', which the framework projects toaccount.require_operator_auth: true. Buyers discover accounts vialist_accounts; the adapter doesn't implementsync_accounts. Tools advertised:get_products— returnsproposals[]alongsideproducts[]when a brief is supplied (catalog mode otherwise).get_productsbuying_mode: refine— refines a proposal (with optionalaction: finalizeto commit).create_media_buy— acceptsproposal_idto convert a committed proposal into an active buy.update_media_buy/get_media_buy_delivery/get_media_buys/tasks/get.comply_test_controller(sandbox-gated viamode==='sandbox') —seed.media_buy,force.media_buy_status,simulate.deliveryfor parity with the other reference seller adapters; relevant when the broadersales_proposal_modestoryboard suite drives cascade scenarios.Pointedly NOT advertised:
sync_accounts,list_accounts. The adapter's whole point is the implicit-account / proposal-mode shape.Proposal lifecycle wiring
getProductsmints a draft via the upstream/v1/proposalsroute when a brief lands; returns the proposals array unchanged.refineProductsreadsrefine[].proposal_idand POSTs to/v1/proposals/{id}/refine.finalizeProposalPOSTs to/v1/proposals/{id}/finalize, refreshes recipes with the locked CPM and upstream line-item template ids, and hands the recipe map back to the framework. The framework stores it on theInMemoryProposalStoreand hydratesctx.recipesfor the subsequentcreate_media_buy(proposal_id=...)call.sales.createMediaBuyreadsctx.recipes, splits the budget across allocated products, and creates one upstream order + per-product line items.State persists in
ctx_metadata(perdocs/guides/CTX-METADATA-SAFETY.md— non-secret upstream IDs only; credentials are re-derived per-request viaverifyApiKey).Gate test assertions
Three shared gates via
runHelloAdapterGates(tsc-strict, storyboard, façade) plus issue-#1549 invariant assertions threaded intofilterFailuresso they run on every storyboard pass:sync_accountscarries the sole-stateful exemption marker. The setup-phasesync_accountsstep isskipped: true, itsskip_reasonis in the exemption family (not_applicable/missing_tool/missing_test_controller— proposal-mode adopters land onnot_applicablevia therequire_operator_authprojection), AND itswarnings[0]matches/Sole stateful step exemption applied for phase 'setup'/(the marker PR adcp-client#1545 emits atrunner.ts:145).brief_with_proposals,refine_proposal,finalize_proposal,accept_proposal, every step's skip detail must NOT match/prior stateful step "sync_accounts" (skipped|failed)/. Phases may pass, fail, or skip on their own merits — but never with detail namingsync_accountsas the cascade trigger.EXPECTED_FAILURESlistsget_products_refine(the one step blocked by the storyboard placeholder gap at adcp#4086 / draft PR #4088). When that PR lands and the refine step starts passing, the defensive check flips the gate red so the allowlist gets dropped — silent green CI on a stale entry would hide regressions.Adversarial-sabotage validated locally: temporarily inverting
EXEMPTION_MARKERto a synthetic regex makes assertion (1) fire with a clean diagnostic; flippingassert.doesNotMatchtoassert.matchon the empty-warnings happy path makes assertion (2) fire.Non-obvious decisions
not_applicable, notmissing_tool. The issue text says "missing_tool"; the actual current SDK behavior isnot_applicablebecause the proposal-mode adapter declaresaccounts.resolution: 'explicit'which auto-projectsaccount.require_operator_auth: true. PR adcp-client#1545 expanded the exemption family to cover both. The assertion accepts any reason in the exemption family so a future projection change doesn't flip the test red without an underlying behavior regression.comply_test_controlleris wired even thoughproposal_finalize.yamldoesn't invoke it. The issue requires the controller surface for parity with other reference adapters and for the broadersales_proposal_modestoryboard suite (which fans out intodelivery_reporting,invalid_transitions,pending_creatives_to_start— all of which DO drive the controller). Wiring it into the proposal-mode adapter completes the reference set.EXPECTED_FAILURESacceptsget_products_refine. Theproposal_finalizestoryboard sends the literalbalanced_reach_q2placeholder asrefine[0].proposal_id. The adapter forwards that id to its upstream which 404s. Tracked at adcp#4086 + draft PR #4088 (storyboard fix to addcontext_outputs/context_inputschaining). Per the implementation guidance in Storyboard examples: add hello-seller-adapter-proposal-mode for sole-stateful-step coverage #1549, runner gaps that prevent the test from passing get filed as separate issues rather than worked around in the adapter — adcp#4086 was already filed and PR #4088 is in flight.Test plan
node --test test/examples/hello-seller-adapter-proposal-mode.test.jspasses (3/3 gates green).node --test test/examples/hello-seller-adapter-guaranteed.test.jsstill passes (helper change-free).npx tsc --noEmitclean across the project.npm run format:checkclean.adcp storyboard run http://127.0.0.1:PORT/mcp media_buy_seller/proposal_finalize --jsonreturnsoverall_status: partialwith the expectedget_products_refinefailure and the cascade-blocked downstream phases — matching the gate test's allowlist.🤖 Generated with Claude Code