feat(training-agent): @adcp/client 5.8.1 adoption + storyboard-driven compliance audit#2599
Merged
Merged
Conversation
5.7 shipped the remaining SDK fixes we asked for — adopt them and
delete the local workaround files they replace.
- `requireAuthenticatedOrSigned({ signature, fallback, requiredFor,
resolveOperation })`: the presence-gated composition with required_for
enforcement. Replaces server/src/training-agent/strict-auth.ts
(deleted). The SDK's pre-check now fires correctly when the fallback
throws (bad bearer), closing signed_requests vector 011 which was
falling through to the required_for path instead of hitting the
signature-layer malformed-header error.
- `signatureErrorCodeFromCause` + `respondUnauthorized({ signatureError })`:
SDK unwraps RFC 9421 errors from AuthError.cause and emits
WWW-Authenticate: Signature challenges. Replaces ~20 lines of
hand-rolled challenge emission in requireToken.
Also fix: the double-cancel guard in handleUpdateMediaBuy was emitting
INVALID_STATE_TRANSITION, which is a drift code (only appears in 5
prose lines of state-machine.yaml, not in any enum). Canonical seller
code is INVALID_STATE (distinct from the controller-specific
INVALID_TRANSITION). Corrected.
Legacy: 37/55 clean, 282 steps (was 35/55, 279).
Framework: 23/55 clean, 240 steps (was 21/55, 237).
signed_requests: 30/30 passing (was 29/30).
CI floors updated to match.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…RMS_REJECTED check - comply_test_controller sandbox gate: was blocking all calls without account.sandbox: true, which meant storyboards probing error codes (UNKNOWN_SCENARIO, INVALID_PARAMS, NOT_FOUND) got FORBIDDEN instead. Training agent is sandbox-only by deployment; only reject on explicit sandbox: false. +4 deterministic_testing steps passing (25/26 now, was 20/26). - Add cpm_guaranteed pricing alias on sports_ctv_q2 for the governance_spend_authority storyboard's hardcoded pricing id. - Reject create_media_buy packages with aggressive measurement_terms (max_variance_percent < 0.5%, measurement_window: "c30") with TERMS_REJECTED. Not yet firing end-to-end — under investigation whether the SDK client is stripping measurement_terms before the handler sees it (tracked via adcp#2605). Also filed 6 spec-clarification issues upstream: adcp#2603 (any_of single-branch), #2604 (conditional-approval schema), #2605 (schema-optional field assertions), #2606 (idempotency missing-key SDK coupling), #2607 (PRM for non-OAuth agents), #2608 (implementer DX docs). 37/55 clean, 288 steps passing (was 282). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tion fixes - Rename `targeting` → `targeting_overlay` on media-buy request/response (accept both on input, emit only `targeting_overlay`). Closes inventory_list_targeting storyboard. - brand_rights: standard_monthly pricing alias, expired-campaign-dates rejection, estimated rights commitment for governance denial, talent filter fallback, expanded available_uses, acquire_rights inputSchema expansion. Closes brand_rights + brand_rights/governance_denied. 40/55 clean, 293 steps passing (was 37/55, 288). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- sync_catalogs accepts spec field name `type` (in addition to `catalog_type`), defaults to `product`, aliases `url` for `feed_url`. - provide_performance_feedback accepts structured `feedback` object as alternative to `performance_index` (maps satisfaction → index). inputSchema declares brand/account so SDK doesn't strip them. 41/55 clean, 296 steps passing (was 40/55, 293). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- comply-test-controller: sandbox gate now rejects only on explicit sandbox: false (not missing sandbox / missing account) - training-agent: targeting tests use spec field `targeting_overlay` on both input and response Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Drop `standard_monthly` pricing alias resolver and talent filter fallback (brand-handlers.ts). Both existed only to mask brand_rights storyboard's advertiser/talent brand_id confusion — tracked in #2627. - Drop `feedback.satisfaction` → `performance_index` derivation (catalog-event-handlers.ts). Spec requires performance_index; test_kit sends non-spec feedback object — tracked in #2626. Filed improvement issues: #2623 (schema-driven validation), #2624 (buyer-side SDK smoke test), #2625 (property-based tests). Filed contradiction issues: #2628 (double-cancel) and #2629 (any_of reporting). Storyboards regress 41/55 → 39/55 — fake-clean count goes away. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nt-5.7-adoption # Conflicts: # .github/workflows/training-agent-storyboards.yml # package-lock.json # package.json
- update_media_buy response emits targeting_overlay (was targeting) - sync_catalogs discovery response emits type (was catalog_type); input still accepts both for backcompat - acquire_rights expired-dates error uses spec INVALID_REQUEST with field + recovery; was lowercase custom code Upstream filed: #2680 (CPM governance projection policy), #2681 (expired campaign dates spec clause). Storyboards hold at 39/56 / 308 passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nt-5.7-adoption # Conflicts: # .github/workflows/training-agent-storyboards.yml
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
Training-agent conformance work alongside the @adcp/client 5.6 → 5.8.1 upgrade. Not just the SDK bump — the PR is a compliance audit that fixed real protocol drift, surfaced 10 upstream spec/storyboard bugs (5 already merged), and kept the agent honest by reverting fixture-fitting hacks rather than preserving fake clean scores.
Compliance: 39/56 storyboards clean, 308 passing steps. Well above the post-5.8.1 CI floor (27 / 271).
What landed on the training agent
Spec-correct behavior fixes:
targeting→targeting_overlayrename across create/get/update_media_buy responses. Accept both on input as back-compat alias.sync_catalogsaccepts spec fieldtype(was onlycatalog_type); emitstypeon discovery response; aliasesurlforfeed_url; defaults toproductwhen omitted.create_media_buypackage validation.NOT_CANCELLABLE(canonical behavior after upstream contradiction Storyboard contradiction: double-cancel. state_machine permits idempotent-accept, invalid_transitions requires NOT_CANCELLABLE #2628 resolution).comply_test_controllersandbox gate narrowed to only reject explicitsandbox: false(training agent is sandbox-only by deployment).acquire_rightsinputSchema declaresaccount/brand/revocation_webhook(SDK was stripping them), rejects past-dated campaigns with specINVALID_REQUEST, enforces governance budget for CPM-priced rights via estimated commitment projection.Hacks reverted (honest score over fake score):
standard_monthlypricing alias resolver — dropped; storyboard was bug (→ brand_rights storyboard conflates advertiser brand_id with talent brand_id #2627)feedback.satisfaction→performance_indexderivation — dropped; spec requiresperformance_index(→ sales_catalog_driven test_kit sends feedback.satisfaction instead of performance_index #2626)Unit tests: updated to match spec-correct behavior (
targeting_overlay, new sandbox gate semantics). 1666/1700 server unit tests pass.Upstream issues filed
Expert pre-merge review
Reviewed by code-reviewer and ad-tech-protocol-expert. Both passed as merge-ready after three fixes landed in the final commit (
3a47cd800):update_media_buyresponse emitstargeting_overlay(was still emitting legacytargeting)sync_catalogsdiscovery response emitstype(was emittingcatalog_type)INVALID_REQUESTcode withfield+recoveryNo unresolved blockers. Two policy-ambiguity findings filed upstream (#2680, #2681) rather than encoded as agent policy.
Deliberately left for follow-up (separate PRs)
17 storyboards still fail — mostly fixture seeding (gov_acme_q2_2027, campaign_hero_video, mb_acme_q2_2026_auction),
signed_requestsvector 011 from the 5.8.1 tightening, and webhook emission checks. Categorized in the team backlog; each will land as its own PR rather than dragging along this one.Test plan
npm run typecheck— cleannpm run test:server-unit— 1666 passed / 34 skippedcode-reviewersubagentad-tech-protocol-expertsubagent🤖 Generated with Claude Code