Repository navigation
fix(projection): reconcile packages when sync assignments are omitted - #3563
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean bug fix with regression coverage.
This PR reconciles supplied packages when sync_creatives omits assignments, routing through the existing per-package reconciler instead of the pooling path that could mis-accept a creative fitting only one package. The .every(package_id) guard preserves mixed/unkeyed context on the combined path, size > 1 keeps single-package context unchanged, and delivery scope matches the base combined path — only reconciliation strictness changed. Scope boundaries verified: assignments-present-but-not-for-this-creative stays library-only, canonical wire untouched, field presence (omitted vs []) preserved — consistent with the witness-not-translator rule. 8 new regression cases cover the {omitted,empty}×{legacy,unknown} matrix plus opt-out/pin/order-independence. Changeset present (patch, defensible for a bug fix).
No critical, high, or medium findings. No author team gate, high_risk is false, and gated_paths is false — so the REVIEW_REQUIRED status does not trigger the row-2 hard gate. Falls through to row 9.
When a
sync_creativesrequest omits assignments (or sends an empty array), the legacy projection pools supplied package declarations. Compatible sized/unsized references can then be refused as ambiguous, and a creative that fits only one package can be accepted for the whole context.Resolve each package through the existing reconciler when every supplied selector identifies its package. Preserve package-specific pins, legacy opt-outs, conflict diagnostics, request assignments, and canonical-wire behavior. Mixed or unkeyed contexts retain their existing handling so their constraints remain included.
Refs #3562. This repairs the bounded no-assignment case; the proposed public fit API and broader fit/adaptation semantics remain separate work.
Validation: Docker build and all 361 creative-delivery/projection tests pass with no skips. Eight new regression cases fail against the original implementation (83 tests pass in that baseline run). An official HTTP MCP client/server smoke check delivers the shared reference with assignments absent and refuses incompatible context before dispatch; this is a projection/transport check, not a claim of full seller conformance. Code, protocol/DX, and security reviews cleared the final scope and mixed-context guard. Normal push checks cover formatting, type checking, and a fresh build.