Repository navigation
feat(projection): expose creative package fit decisions - #3564
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean review, no blocking or medium findings.
Checked (per reviewer, all 14 files / 2942 delta lines):
- creative-delivery.ts:
decision.result.wire!.creative(L915) is safe — refusal paths returnerror, andif (decision.error) throwruns first, sowireis defined on every reachable line. Therelevantfilter flip (L865) retaining unscoped layers under explicit assignments is intentional and tested (creative-package-fit.test.js:2593). - creative-fit.ts: diagnostics bounded/sanitized (L1034); known-violation-beats-missing ordering (L1556) and VAST single-complete-MediaFile witness match spec and tests.
- Witness-not-translator honored: engine never fabricates; contradictions/legacy-density loss refuse rather than discard; structuredClone prevents caller-asset aliasing (test:2586).
- Changeset present (minor), impact aligned; doc link relative, no stale blob/main refs — doc-link integrity OK.
No no-auto-approve team match; gated_paths false; high_risk false; no prior decision. Decision table rows 1–8 do not fire → row 9 approve.
Note (Low, non-blocking): error.message.includes('ambiguous within') (L599) couples fallback behavior to internal error wording — a typed sentinel would be sturdier. Not blocking.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — behavior-preserving refactor with no blocking or medium findings.
What I checked:
creative-fit.tsdeleted; contents moved verbatim intocanonical-properties.ts. Only substantive changes:path→nodePathimport rename (to avoid shadowing localpathparams) and@internalJSDoc tags. No wire-shape re-shaping or fabrication — witness-not-translator contract preserved.creative-delivery.tsrepoints its single import+re-export block to./canonical-properties, no duplicates introduced.creative-fit.type-checks.tsconverts two@ts-expect-errormember-access statements to indexed-access type declarations that still raise on missing properties — type safety preserved.- No remaining importer of
./creative-fit; public exports (fitCreativeToPackages+ type aliases viaprojection/index.ts) unchanged. - Existing
.changeset/creative-package-fit.mdcovers the feature — changeset-vs-wire-impact satisfied.
Gates: gated_paths false; high_risk false; no no-auto-approve team match; no critical/high/medium findings. Rows 1–8 do not fire → row 9 approve. Consistent with the prior clean approval.
…it merges (#3565) #3559/#3560 (AdCP 3.3.0-beta.3) and #3564 (creative package-fit decisions) landed in parallel. #3564's test pinned adcpVersion 3.3.0-beta.2, which the SDK no longer bundles, and its published guide put the package one file over #3559's exact file-count budget. Read ADCP_VERSION in the test, count the guide, and raise the packed cap to cover the combined size plus the release PR's CHANGELOG growth. Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…adroom (#3568) * fix(packaging): stop shipping duplicate compliance and declaration bytes Trim @adcp/sdk from 26,862,556 to 24,993,401 packed bytes (8,529 to 8,176 files) without changing runtime behavior: - Exclude compliance/cache/*/domains/ from the package. Every bundle's domains/ is a byte-identical copy of protocols/, the only directory the storyboard loader reads (-286,556 bytes, -353 files). - Emit one-line ESM facades for the type-only generated declarations (types/core.generated, types/tools.generated, registry/types.generated), as types/schemas.generated already did, instead of copying 5.7 MB of declarations (-1,174,602 bytes). - Store the self-contained MCP tools/list request projections as compact JSON. They are only ever JSON.parse'd (-407,997 bytes). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * ci(packaging): size budgets with headroom and a per-PR growth check The packed-byte and file-count budgets were pinned to the measurement, so two PRs that each added a file or a few KB passed alone and broke main together (#3510 + #3541, #3564 + #3559/#3560). Replace the pins with: - Ceilings with headroom in scripts/package-size-budget.json: @adcp/sdk 26,000,000 packed bytes / 135,000,000 unpacked / 8,450 files against a measured 24,993,401 / 129,047,083 / 8,176 (about 4%), and @adcp/reporting-storage 490,000 / 2,250,000 / 150. A warning fires when less than two PRs' allowance of headroom is left. - A per-PR growth check. main caches each commit's measurement; a pull request compares itself with the record for its exact merge base and may add 100 KB / 25 files to the SDK (15 KB / 8 files to the storage package). More needs the same PR to raise the ceiling, so the growth is reviewed in the diff. A missing record skips only this comparison. - The focused-client eager graph count becomes a ceiling (230, measured 216) instead of an exact pin; the named heavy-module exclusions stay. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Summary
Expose
fitCreativeToPackages(creative, packages, { adcpVersion, ... })from the root SDK and projection entry point. Buyers can evaluate supplied asset measurements against each package's closed option set, inspectfits/insufficient_facts/does_not_fit, and obtain the shared canonical or legacy creative that sync would send.Sync uses the same decision engine. Omitted or empty assignments cover every supplied package; explicit assignments retain applicable unscoped constraints; library-only creatives retain upsert behavior. Measured facts can be passed directly to planning or supplied to sync keyed by creative ID, and are snapshotted before capability discovery. Option routing respects scoped pins and refuses ambiguous shared canonical selectors.
Known violations block delivery. Incomplete evidence can still produce a wire representation for seller validation, without claiming a fit. Authored canonical requirements remain binding independently of legacy links, including when completeness is not asserted. Image density and resolved VAST MediaFile evidence are checked without fetching or inferring transformations.
This intentionally strengthens two historical assumptions: canonical same-kind alternatives now require a valid shared option pin, and conflicting native requirements cannot be ignored in favor of a linked legacy reference. The existing tests now cover the refusals and valid alternatives.
Builds on merged #3563. Refs #3562 and adcontextprotocol/adcp#8644.
Validation
Limits
fits_with_adaptationis reserved; no proposed serve-adaptation permissions are inferred. Unsupported constraints and unresolved slot/schema/evidence requirements remain insufficient facts. Versions default to legacy below 3.2 and canonical from 3.2, with a coherent explicit negotiated mode for canonical-capable 3.1 peers. Legacy paths must retain required density or refuse.The proposed #8644 fit-vector corpus and Python/Go/Java parity remain separate work. This PR runs the existing published canonical image-density vectors and targeted fit regressions; it does not claim cross-SDK conformance. See the API guide.