Repository navigation
fix(projection): lint package selector dimensions - #2585
Conversation
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| '@adcp/sdk': patch | |||
There was a problem hiding this comment.
Medium: patch understates this. The PR adds a new public export — lintPackageFormatSelectorDimensions plus five exported types (PackageFormatSelectorInput, PackageFormatSelectorDimensionOptions, FixedSizeDimensions, PackageFormatSelectorDimensionDiagnosticCode, PackageFormatSelectorDimensionDiagnostic) — surfaced through the published @adcp/sdk/v2/projection subpath. New public API is minor per semver, and repo precedent is explicit: add-additive-canonical-product.md bumped minor for the same shape (exposing toAdditiveCanonicalProduct()). Change the bump to minor.
There was a problem hiding this comment.
Ladon verdict: Request changes
Request changes — 1 blocking finding.
Blocking findings
- .changeset/tidy-banners-lint.md:2 — Changeset bump is
patchfor a new public export (lintPackageFormatSelectorDimensions); should beminor. Per the repo's mandatory changeset-vs-wire-impact rule, a changeset type that understates impact is ahighfinding. The PR adds a new public export undersrc/lib/**, which is an additive API surface change and warrants aminorbump.
What was checked
- Write-side lint helper is advisory / non-wire; no witness/fabrication concerns.
- No transport reimplementation; no correctness or query issues.
- Logic is defensive and well-tested.
The only remaining item is the changeset bump-type correction. Bump patch → minor and this is good to merge.
Blocking findings
.changeset/tidy-banners-lint.md:2— Changeset bump is patch for a new public export; per changeset-vs-wire-impact rule this understatement is a high finding, should be minor
Medium findings
- .changeset/tidy-banners-lint.md:2 — Changeset bump is patch for a new public export (should be minor)
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| '@adcp/sdk': minor | |||
There was a problem hiding this comment.
Medium: patch understates impact. This ships a new public export — lintPackageFormatSelectorDimensions plus five new types (PackageFormatSelectorInput, PackageFormatSelectorDimensionOptions, FixedSizeDimensions, PackageFormatSelectorDimensionDiagnosticCode, PackageFormatSelectorDimensionDiagnostic) — from src/lib/v2/projection/index.ts. New backward-compatible API surface is minor under semver; a patch bump mis-signals the feature in the changelog. Bump to minor.
There was a problem hiding this comment.
Ladon verdict: Request changes
Request changes — 1 blocking finding
The reviewer's summary describes the new lint logic (multi-size atomicity, projection-aware converters, catalog_requirement_conflict/invalid_format_id_parameters detection) as correct and well-tested. The prior blocking issues around the new logic are resolved. However, one blocking finding survives.
Blocking findings
.changeset/tidy-banners-lint.md:2— Changeset bump ispatchbut this PR adds a new public export. Per the repo's mandatory changeset-vs-wire-impact rule, a changeset whose type understates impact (a new/changed export) is ahighfinding, not medium. A new public API surface warrants aminorbump.
Note: although the reviewer labeled this as medium, the repo context explicitly classifies changeset-type understatement on src/lib/** changes as a high finding. This PR modifies src/lib/v2/projection/* and adds a new public export, so the understated patch bump is blocking. Bump to minor and re-run.
Blocking findings
- .changeset/tidy-banners-lint.md:2 — Changeset bump is patch for a new public export shipped from src/lib/**; per changeset-vs-wire-impact this understates impact (should be minor) and is a high finding
Medium findings
- .changeset/tidy-banners-lint.md:2 — Changeset bump is patch for a new public export (should be minor)
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — subsequent review; prior blocking-adjacent finding resolved.
What changed since last run: The prior run flagged a [medium] changeset issue (.changeset/tidy-banners-lint.md:2 — patch bump for a new public export). This delta corrects it to a minor bump, satisfying the changeset-vs-wire-impact rule. The reviewer also refined lintPackageFormatSelectorDimensions with projectionContext plumbing and per-sizes[] atomicity inspection, and traced wrapped-converter side effects against projectWithLegacyConverter call sites — no duplicate diagnostics, inline vs converter paths mutually exclusive per format_id, catalog-conflict/invalid discrimination correct. Thorough tests.
Current findings: The single listed finding is the now-resolved changeset item (patch → minor), which is corrected in this delta. No new critical/high/medium findings.
Decision trace: No critical/high (row 1 no). gated_paths false (row 2 no — the CHANGES_REQUESTED review_decision only gates when gated_paths is true). No high-risk deletions/modifications (rows 3–5 no). Prior decision was request-changes, not escalate (row 6 no). No no-auto-approve team match (row 7 no). Fewer than three medium findings (row 8 no). Falls through to row 9 → approve. The developer addressed the prior feedback and the diff is clean.
Medium findings
- .changeset/tidy-banners-lint.md:2 — Changeset bump was patch for a new public export (now minor)
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean subsequent review.
The prior Medium (changeset bump patch→minor for the new public export lintPackageFormatSelectorDimensions) has been resolved in this delta. The write-side.ts logic changes are correct and each branch is covered by a new test:
- diagnoses direct width/height alongside sizes
- rejects empty
sizes[] - normalizes absent/non_fixed size entries to invalid
- narrows the catalog-conflict path to genuine image-dimension refs via
inspection.kind === 'complete' && duration_ms === undefined, correctly preventing video projection failures from being relabeled as image-dimension mismatches
No current findings. gated_paths is false and no no-auto-approve team match, so no hard gate applies (review_decision is CHANGES_REQUESTED but that only gates when gated_paths is true). With zero findings, rows 1–8 do not fire; row 9 applies.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
The reviewer surfaced no blocking or medium findings in the current run. The delta refines lintPackageFormatSelectorDimensions in write-side.ts so that direct width/height combined with a sizes[] array and empty/dimensionless entries are correctly diagnosed, and the legacy catalog-conflict path no longer relabels video-duration projection failures as image-dimension mismatches. Both behaviors are covered by new tests.
The prior run's single medium finding (changeset bump was patch for a new public export) was resolved — it is now out of delta scope and already corrected (minor bump).
Decision-table walk-through:
- Row 1 (critical/high): no such findings.
- Row 2 (gated_paths): false — does not fire, even though
review_decisionis CHANGES_REQUESTED, because the gate is path-based and no gated path is touched. - Row 3 (deleted high-risk): high_risk is false.
- Rows 4–5 (medium + sensitive category / modified high-risk): no medium findings.
- Row 6 (sticky escalate): prior decision was
approve, not escalate. - Row 7 (no-auto-approve team): no team match.
- Row 8 (≥3 medium): zero medium findings.
- Row 9: approve.
No no-auto-approve team gate and no gated paths, so the hard rules do not apply.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Delta refines two branches of lintPackageFormatSelectorDimensions in src/lib/v2/projection/write-side.ts:
- Change 1 (L185-196): flags fixed width+height combined with a multi-size
sizesarray asFORMAT_SELECTOR_DIMENSIONS_INVALID. - Change 2 (L292-326): replaces the
ref.duration_ms===undefinedheuristic with an actual base re-projection, so a non-image (html/video)catalog_requirement_conflictis no longer mislabeled as an image dimension mismatch.
Both changes are load-bearing-correct and test-covered (display_728x90_html -> [], MISMATCH test now loops duration_ms); continue/fall-through paths resolve safely for an advisory linter. Existing changeset covers the export; no new changeset owed for the refinement.
No critical/high/medium findings. Consistent with the prior approve on the earlier head. Gates: gated_paths false, no no-auto-approve team match, high_risk false. review_decision is CHANGES_REQUESTED but no gated path or prose gate applies, so it does not force escalation. Falls through to row 9 — approve.
Summary
Why
Legacy 3.x callers can still send both canonical
format_kind/paramsand deprecatedformat_ids. Missing or conflicting fixed-size image dimensions could survive shape validation and fail later inside an adapter. This adds an advisory SDK seam while leaving the protocol-level precedence decision to adcontextprotocol/adcp#6648.Validation
npm run buildNODE_ENV=test npm test(15,020 fast; 64 slow; 30 eslint-plugin tests; 0 failures)npm run typechecknpm run ci:docs-checkCloses #2584