Skip to content

fix(testing): honor discovery currency and metric filters for specialized sellers - #3514

Merged
bokelley merged 8 commits into
mainfrom
fix/pricing-currency-discovery-invariants
Oct 30, 2026
Merged

bokelley merged 8 commits into
mainfrom
fix/pricing-currency-discovery-invariants

Conversation

@bokelley

@bokelley bokelley commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Seller compliance currently assumes seeded rate-card identities, can miss non-matching products after the first result, and forces canonical discovery even for legacy-only AdCP 3.1 sellers. Currency conversion and optional product features are valid, but supplied discovery filters still bind the effective response.

This adds two default invariants using the exact request and effective response:

  • discovery.pricing_currency_filter checks every media option, fixed default signal selections (including group overrides), and simple required-selection capacity. Compatible alternatives and zero/bundled charges pass; optional foreign add-ons stay exempt. Valid empty currency-filter results, custom pricing, omitted mandatory menus, and aggregate selection constraints that cannot be proved are explicitly reported as unproven; empty results never masquerade as positive-price coverage.
  • discovery.required_metric_filters checks every product against all requested standard/vendor metrics, respecting implicit metrics, documented derivations, and numeric container subsumption. Vendor and metric pins must match one declared row, including a requested vendor brand ID. Projected-away declarations remain unproven; actually returned contradictions still fail. Empty matches and omitted filters do not require optional features.

A direct products payload takes precedence over an unrelated data extension, so schema-allowed extra fields cannot bypass either invariant.

Fixture discovery chooses its canonical wire hint through the existing negotiated creative capability resolver, permitting legacy-only AdCP 3.1 sellers.

Validation:

  • Full library build and repository pre-push formatting/typecheck/build checks passed.
  • 288 focused pricing/metric invariant, default-invariant, and fixture-resolution tests passed.
  • 221 related fixture and assertion-registry tests passed.
  • 488 adjacent filter, request-builder, validation, and lifecycle tests passed.
  • New modules pass ESLint without warnings; full lint passes with existing warnings.
  • Package audit passes with exactly eight additive runtime/declaration artifacts allowed and all byte budgets unchanged.
  • Changed-file formatting and git diff --check passed.
  • Protocol and seller-workflow experts independently reviewed the final source and regression coverage.

Companion protocol fixture fixes are being prepared in adcontextprotocol/adcp. The SDK 15.9 maintenance backport is #3516. Hold release until companion #3515 and its complete maintenance backport are reviewed, green, and merged.

@bokelley bokelley changed the title fix(testing): validate discovery currency contracts and respect creative capabilities fix(testing): honor discovery currency and metric filters for specialized sellers Oct 29, 2026
@bokelley
bokelley marked this pull request as ready for review October 29, 2026 23:16
aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Oct 29, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean additive testing-surface change with no blocking or medium findings.

What I checked:

  • Two new default-on get_products invariants (pricing-currency-filter, required-metric-filters) grounded in generated-schema MUSTs (pricing_currencies per-option contract; required_metrics container-subsumption). Both fail in the safe direction — no false failures against conformant sellers.
  • seeding.ts change defers creative-wire mode to resolveCreativeFormatWireMode instead of forcing canonical; no fabrication/re-shaping of wire data (witness-not-translator respected).
  • Changeset present (fix-pricing-currency-discovery-invariants.md, patch) and defensible for additive validation surface — no removed/renamed exports or response-shape changes, so patch is correct.
  • Coverage complete including the >200-line pricing-currency-filter.ts (331+237 line test suites).

Non-blocking follow-up (noted, not a finding): required-metric-filters DERIVED_FROM leniency (ctr/cpm/roas from inputs) is slightly more permissive than the schema's superset+container-subsumption text — safe direction, worth confirming its normative home in a later pass.

No critical/high/medium findings. Not a gated path; no author team gate; high_risk false. review_decision is REVIEW_REQUIRED but gated_paths is false, so row 2 does not apply. Falls through to row 9.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean fail-closed fix to two discovery invariants.

The delta changes response-unwrap to prefer root-level products over an unrelated data extension (pricing-currency-filter.ts:155, required-metric-filters.ts:346), closing a false-negative where a sibling data: {} masked currency/metric violations. This is a correctness tightening consistent with the witness-not-translator posture — no fabrication, no re-shaping, no crash path. New precedence unit tests plus updated integration mocks genuinely exercise the fix. Package-size count and changeset are consistent.

No Critical/High/Medium findings. Checked decision table top-down: no blocking findings (rows 1), gated_paths false (row 2), high_risk false (rows 3, 5), no medium findings (rows 4, 8), no no-auto-approve team match (row 7), prior decision was approve so sticky escalation (row 6) does not apply. Falls through to row 9 → approve. Note: review_decision is REVIEW_REQUIRED, but row 2 only forces escalate when gated_paths is true, which it is not here.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — no blocking or medium findings.

Checked:

  • describeDiscoverySchemaFailure now resolves version as options._serverAdcpVersion ?? options.adcpVersion ?? ADCP_VERSION (seeding.ts:1481), aligning with the established discovery convention at runner.ts:9916/10005/10074. The fallback branch now passes the resolved version to validateResponseSchema (seeding.ts:1491), fixing a real inconsistency where the two branches used different versions.
  • Test coverage added for both configured and unconfigured version cases.
  • Changeset present (patch) — correct for compliance-tooling behavior with no production wire change (witness-not-translator unaffected; no fabricated fields, no wire-shape change, no new transport code).

Prior pass was a clean approve; no prior blockers to re-surface. No new findings this run.

Decision path: no critical/high (row 1 n/a), gated_paths false (row 2 n/a), high_risk false (rows 3/5 n/a), no medium findings (rows 4/8 n/a), prior decision was approve (row 6 n/a), no author team gate (row 7 n/a) → row 9 approve. Note review_decision is REVIEW_REQUIRED but gated_paths is false, so row 2 does not apply.

@bokelley
bokelley merged commit 04b59cf into main Oct 30, 2026
45 checks passed
@bokelley
bokelley deleted the fix/pricing-currency-discovery-invariants branch October 30, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant