Converter: derive choices from the explicit type ceiling, not slice names - #20
Merged
Conversation
Slice names no longer populate the choice declaration's choices list. Slices constrain types the element already allows, so for a typed root they add nothing, and for an untyped root under open rules emitting them as choices misstates the allowed set — the inherited ceiling stays in effect. When the differential does not restate the element's type list, choices is omitted entirely.
…licit type ceilings
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.
choicesfrom the explicitElementDefinition.typeceiling only — never from slice names. When a profile's differential does not restate the element'stypelist,choicesis omitted entirely.choiceOfelements with their constraints;slicing.rulesand discriminator stay on the declaration.choices), typed open-sliced root (ceilingchoicesincl. unsliced variants), untyped closed-sliced root (nochoices;rules: closed+ variants are the prohibition signal).Motivation: slicing a choice under
rules: openconstrains the sliced variants without restricting the choice, but merging slice names intochoicesmade that indistinguishable from a genuine type restriction. Downstream consumers (atomic-ehr/codegen) falsely prohibited unsliced variants for open profiles — the KBV Basis cases reported in atomic-ehr/codegen#196.Before (
KBV_PR_Base_Condition_Diagnosis.onset[x], open slicing, no type restatement):After:
Consumers inherit the base ceiling (
onsetStringstays permitted). Verified end-to-end against atomic-ehr/codegen: the full codegen suite passes unchanged, and the KBV profile resolves to all five base variants with nothing prohibited.