docs: disclose python-sdk#34, and guard for its fix landing - #14
Open
chaz8081 wants to merge 1 commit into
Open
Conversation
Upstream variant generation rewrites external $refs only inside `properties`, so a schema whose alternatives live in a top-level oneOf/anyOf/allOf keeps refs pointing at the base response files. The generated request variant then wraps response types: FulfillmentDestinationCreateRequest holds *ShippingDestination, which requires `id`, rather than *ShippingDestinationCreateRequest, which does not. A spec-valid create request is rejected with "id: required property is missing". Reported upstream in April 2026 and still open. ucp-go reproduces it deliberately — preprocessor parity is byte-for-byte, so diverging unilaterally would break the parity that makes the goldens trustworthy, the same reasoning already applied to the dangling-$ref defect. Counted precisely rather than loosely, because the raw number overstates it three ways. Twelve refs in variant files point at a base schema. Six are correct: message_error/info/warning have no request variants, so the base is the only thing to point at. Of the six that are wrong, two are inert — postal_address's variant is identical to its base in properties and required — leaving four with a behavioural consequence, all in the fulfillment_destination create and update variants. Documented in the gap list rather than only in the upstream history, because it affects consumers today and that is where someone looks to find out what does not work. TestVariantUnionRefsStillPointAtBaseSchemas pins the exact set. The differential harness structurally cannot catch this class — Validate and the oracle read the same preprocessed schema, are wrong the same way and agree, so zero disagreements says nothing here — which makes an explicit guard the only thing that turns upstream's eventual fix into a build failure telling us to re-pin and port.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while sanity-checking upstream for movement. Both pins are current (spec
a2d8bf0, python-sdkd650f0b, zero drift) — but python-sdk#34, open since April, describes a defect we reproduce, and it affects consumers today.The defect
Variant generation rewrites external
$refs only insideproperties. A schema whose alternatives live in a top-leveloneOf/anyOf/allOfkeeps its refs pointing at the base response files, so the generated request variant wraps response types:ShippingDestinationrequiresid; its request variant does not, because a client creating a destination has no server-assigned id yet. Demonstrated, not inferred:on
{"type":"shipping","address":{"country":"US"}}— a spec-valid create request.Counted precisely
The raw number overstates this three ways, so:
The six
message_*refs are correct —message_error,message_infoandmessage_warninghave no request variants, so the base is the only thing to point at. Of the six that are wrong, two are inert:postal_address's variant is identical to its base in bothpropertiesandrequired. The four that matter arefulfillment_destination's create and update variants.Why we reproduce it rather than fix it
Preprocessor parity is byte-for-byte, so upstream's preprocessing defects are ours until upstream fixes them. Diverging unilaterally would break the parity that makes the committed goldens trustworthy — the same reasoning already applied to the dangling-
$refdefect before it was fixed.Why this needs an explicit guard
The differential harness cannot catch this class, by construction.
Validateand the oracle both read the same preprocessed schema, so both are wrong in the same way and agree. "Zero disagreements" is true here and tells you nothing.It is the clearest example in the repo of why agreement between two implementations is evidence about enforcement and not about meaning — and why preprocessor parity is layer 1 rather than a nicety.
TestVariantUnionRefsStillPointAtBaseSchemaspins the exact set, so upstream's fix arrives as a build failure that says to re-pin and port, rather than as something noticed on the next manual sweep. It fails in both directions: if the set shrinks (fixed upstream) or grows (new case, or a regression).Upstream status
Two PRs are in motion and they are related, not competing. #35 (April, community) is the preprocessor fix. #83 (opened today by a maintainer) fixes a
SyntaxErrorin their downstream Python codegen that #35's change triggers — longer variant refs push lines past the wrap width and their splice logic emits a double comma; its comment cites "#34/#35" directly. So the path is being cleared for the four-month-old PR.Only #35 would affect us. When it lands: re-pin goldens, port, and expect a breaking change as those variants start wrapping request types.
Verification
gofmtclean,go build,go vet, root tests and the conformance module all pass. README example re-extracted and run verbatim; output matched.