Skip to content

fix: preserve capability portfolio routing fields - #2436

Merged
bokelley merged 2 commits into
mainfrom
adcp-client-issue-2435
Aug 3, 2026
Merged

fix: preserve capability portfolio routing fields#2436
bokelley merged 2 commits into
mainfrom
adcp-client-issue-2435

Conversation

@bokelley

@bokelley bokelley commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • normalize media_buy.portfolio.primary_channels into AdcpCapabilities.channels
  • expose primary_countries as the optional AdcpCapabilities.countries field
  • retain the previous nonstandard portfolio.channels behavior as a compatibility fallback, with canonical precedence
  • add a patch changeset for the published SDK

Root cause

The capability parser read a nonexistent portfolio.channels field and did not project portfolio.primary_countries, so spec-compliant sales-agent portfolio routing data was only available through _raw.

Validation

  • three independent expert reviews (parser/API, compatibility, test/release)
  • npm run typecheck
  • npm run build
  • node --test test/lib/v3-compatibility.test.js (181 passing)
  • Prettier and git diff --check

Closes #2435

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Aug 3, 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 — small, correct witness-not-translator fix.

What I checked:

  • parseCapabilitiesResponse now reads spec portfolio fields primary_channels (with legacy portfolio.channels fallback) and adds primary_countries, matching the get-adcp-capabilities schema (core.generated.ts:23072-23095). This corrects prior code that read the nonstandard portfolio.channels, which produced undefined channels downstream.
  • Witness-not-translator respected: _raw preserved, spec field surfaced, legacy read retained rather than fabricated — no re-shaping or invented fields.
  • Tests cover both primary-wins and legacy-fallback paths.
  • Changeset present (.changeset/fix-capability-portfolio-fields.md) covering the src/lib/** change.

Medium findings: none.

Note (low, non-blocking): The reviewer flagged that the new public field countries on AdcpCapabilities ships under a patch changeset. This is a low finding (additive new field, not a removed/renamed export or shape break), so it does not meet the high changeset-understatement bar and does not block.

Decision table: no critical/high findings (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); no author-team gate (row 7 n/a); no prior decision (row 6 n/a). Falls through to row 9 → approve. Note review_decision is REVIEW_REQUIRED, but gated_paths is false, so the row-2 gate does not apply.

@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 — additive/descriptive delta since prior approve, no blocking findings.

What I checked:

  • New optional HTTPS-gated sample_render_url field on the catalog-format schema (schemas/registry/registry.yaml) — additive, no wire-shape breakage.
  • OR-to-AND semantic refinements to metric_id/accreditation query-param descriptions in the vendored registry OpenAPI mirror — descriptive only.
  • src/lib/registry/types.generated.ts regeneration is JSDoc-only (no signature change).
  • Changeset present (.changeset/fix-capability-portfolio-fields.md) — satisfies changeset-vs-wire-impact rule.
  • No load-bearing SDK code path moved; no fabrication/re-shaping (witness-not-translator preserved).

Findings: none.

High-risk note: high_risk: true fires only because schemas/registry/registry.yaml (modified) matches schemas/registry/**. Per the decision rules, a modified high-risk file with no medium-or-higher finding is presumed safe — not an escalation trigger. gated_paths: false, no no-auto-approve team match. Rows 1–8 do not fire; falls through to row 9 = approve.

@bokelley
bokelley merged commit f01ac27 into main Aug 3, 2026
32 checks passed
@bokelley
bokelley deleted the adcp-client-issue-2435 branch August 3, 2026 11:59
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.

bug: capability parser drops portfolio primary_channels and primary_countries

1 participant