fix: preserve capability portfolio routing fields - #2436
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — small, correct witness-not-translator fix.
What I checked:
parseCapabilitiesResponsenow reads spec portfolio fieldsprimary_channels(with legacyportfolio.channelsfallback) and addsprimary_countries, matching theget-adcp-capabilitiesschema (core.generated.ts:23072-23095). This corrects prior code that read the nonstandardportfolio.channels, which produced undefined channels downstream.- Witness-not-translator respected:
_rawpreserved, 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 thesrc/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.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — additive/descriptive delta since prior approve, no blocking findings.
What I checked:
- New optional HTTPS-gated
sample_render_urlfield on the catalog-format schema (schemas/registry/registry.yaml) — additive, no wire-shape breakage. - OR-to-AND semantic refinements to
metric_id/accreditationquery-param descriptions in the vendored registry OpenAPI mirror — descriptive only. src/lib/registry/types.generated.tsregeneration 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.
Summary
media_buy.portfolio.primary_channelsintoAdcpCapabilities.channelsprimary_countriesas the optionalAdcpCapabilities.countriesfieldportfolio.channelsbehavior as a compatibility fallback, with canonical precedenceRoot cause
The capability parser read a nonexistent
portfolio.channelsfield and did not projectportfolio.primary_countries, so spec-compliant sales-agent portfolio routing data was only available through_raw.Validation
npm run typechecknpm run buildnode --test test/lib/v3-compatibility.test.js(181 passing)git diff --checkCloses #2435