Skip to content

feat(projection): expose creative package fit decisions - #3564

Merged
bokelley merged 5 commits into
mainfrom
feat/creative-package-fit
Oct 31, 2026
Merged

bokelley merged 5 commits into
mainfrom
feat/creative-package-fit

Conversation

@bokelley

@bokelley bokelley commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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, inspect fits / 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

  • Docker: formatting, full TypeScript typecheck, and library build passed through the real pre-push hook. The broader regression and clean-room checks also passed on Node 20.19.0.
  • 687 creative, projection, loader, focused-client, and network regressions passed with zero skips, including every published canonical image-density vector.
  • Official HTTP MCP transport probe passed: planning and sync produce the same creative and scoped pin; assignments remain omitted; incompatible packages are refused before dispatch. This is a helper/transport check, not full seller conformance.
  • Clean-room packed artifact verification passed in Node and Bun: peer floors, seven-day release-age resolution, CJS/ESM loading, public examples, schemas, scaffolding, MCP negotiation, and browser enums. Existing byte, file-count, and import-graph limits remain unchanged; the packed artifact has 8,509 files.
  • Independent code, protocol/DX, and security review findings addressed.

Limits

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

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Oct 31, 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 — 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 return error, and if (decision.error) throw runs first, so wire is defined on every reachable line. The relevant filter 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.

@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 — behavior-preserving refactor with no blocking or medium findings.

What I checked:

  • creative-fit.ts deleted; contents moved verbatim into canonical-properties.ts. Only substantive changes: path→nodePath import rename (to avoid shadowing local path params) and @internal JSDoc tags. No wire-shape re-shaping or fabrication — witness-not-translator contract preserved.
  • creative-delivery.ts repoints its single import+re-export block to ./canonical-properties, no duplicates introduced.
  • creative-fit.type-checks.ts converts two @ts-expect-error member-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 via projection/index.ts) unchanged.
  • Existing .changeset/creative-package-fit.md covers 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.

@bokelley
bokelley merged commit 6fef3b8 into main Oct 31, 2026
47 checks passed
@bokelley
bokelley deleted the feat/creative-package-fit branch October 31, 2026 17:55
bokelley added a commit that referenced this pull request Oct 31, 2026
…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]>
bokelley added a commit that referenced this pull request Nov 1, 2026
…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]>
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.

1 participant