Skip to content

fix(projection): lint package selector dimensions - #2585

Merged
bokelley merged 6 commits into
mainfrom
review-adcp-client-2553
Aug 18, 2026
Merged

bokelley merged 6 commits into
mainfrom
review-adcp-client-2553

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • add a pure write-side diagnostic helper for fixed-size image package selectors
  • reuse the existing legacy projection catalog/converter to compare canonical and deprecated selector dimensions
  • report incomplete, invalid, and conflicting dimensions without choosing selector precedence or mutating requests
  • keep canonical-only, legacy-only, multi-size, responsive, and inherently canonical-only selectors valid

Why

Legacy 3.x callers can still send both canonical format_kind/params and deprecated format_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 build
  • NODE_ENV=test npm test (15,020 fast; 64 slow; 30 eslint-plugin tests; 0 failures)
  • npm run typecheck
  • targeted ESLint and Prettier checks
  • npm run ci:docs-check

Closes #2584

@bokelley
bokelley enabled auto-merge (squash) August 18, 2026 10:51
Comment thread .changeset/tidy-banners-lint.md Outdated
@@ -0,0 +1,5 @@
---
'@adcp/sdk': patch

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@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: Request changes

Request changes — 1 blocking finding.

Blocking findings

  • .changeset/tidy-banners-lint.md:2 — Changeset bump is patch for a new public export (lintPackageFormatSelectorDimensions); should be minor. Per the repo's mandatory changeset-vs-wire-impact rule, a changeset type that understates impact is a high finding. The PR adds a new public export under src/lib/**, which is an additive API surface change and warrants a minor bump.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@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: 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 is patch but 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 a high finding, not medium. A new public API surface warrants a minor bump.

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)

@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 — 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)

@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 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.

@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.

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_decision is 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.

@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.

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 sizes array as FORMAT_SELECTOR_DIMENSIONS_INVALID.
  • Change 2 (L292-326): replaces the ref.duration_ms===undefined heuristic with an actual base re-projection, so a non-image (html/video) catalog_requirement_conflict is 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.

@bokelley
bokelley merged commit ae9a8fc into main Aug 18, 2026
46 of 48 checks passed
@bokelley
bokelley deleted the review-adcp-client-2553 branch August 18, 2026 11:23
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.

Lint fixed-size image package selector dimensions

1 participant