spec(delivery): define composable destination constraints - #13
Draft
ericfj2140 wants to merge 1 commit into
Draft
Conversation
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.
Summary
Propose a versioned, composable destination-constraint grammar for kind
30406shipping options. The proposal keeps ISO country and subdivision codes as shared primitives while adding country-scoped postal inclusion and exclusion rules with deterministic, fail-closed evaluation.This PR is intentionally stacked on #1 and targets
codex/spec-refactor-transpositionso the semantic proposal remains separate from the repository reorganization.Why
The current
countryand optionalregiontags identify administrative areas but do not define combination, exclusion, postal-zone, or overlap semantics. That leaves ordinary shipping policies—such as country-wide service with subdivision or postal exclusions—dependent on private tags or out-of-band interpretation. A client that ignores those rules can offer an automatic checkout price for a destination the merchant did not agree to serve.Shipping constraints also vary by country. The shared protocol should define portable predicates and deterministic matching without pretending that one universal address form or ISO subdivision list captures every carrier service area.
What changed
destination_schemamarker and typeddestinationinclude/exclude selectors.exact/prefixshapes.30406option.country,region, and existing country-scoped postal rules.SPEC.mdcompatibility snapshot.Validation
40a8d22d9bce1f8740d60bbf0dc4e25f6b7ef192.SPEC.md, current event kinds, existing tag examples, and normative transposition text remain unchanged.git diff --checkagainstcodex/spec-refactor-transposition.Runtime or visual evidence
Documentation-only experimental proposal; there is no runtime or visual surface.
Risks and follow-ups
exactandprefixintentionally avoid arbitrary regex behavior; numeric range semantics remain a possible versioned follow-up.SPEC.mdand the normative kind30406examples as one coherent change. Adding only part of the grammar would allow clients to mistake coarse country metadata for sufficient automatic-checkout eligibility.