You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve explicit enum member numbers in Screenplay extraction #91
Cratis/Screenplay#643 and accepted decision 0065 make the model own stored enum identity with all-or-none name = N member syntax (unique int32 values). Authoring ships in Screenplay 4.137.0; ESM admission follows separately.
Preserve explicit/sparse enum numbers during extraction so a generated model does not silently change stored numeric identities. Emit all numbers and round-trip member names and values; reject aliases or unsupported flag combinations rather than defaulting to positional numbering. Update the focused docs/examples and add a sparse/reordered enum regression.
Source/DotNET/CritterStack/EnumConceptFacts.cs:107 populates EnumerationValues from the extracted values. Its lowering guard at Source/DotNET/CritterStack/EnumConceptFacts.cs:297 validates a list of strings. This representation preserves names but does not itself carry explicit numeric member identities. The shared Generation packages are pinned to 0.18.2 in Directory.Packages.props:9–12.
Root cause / gap
A name-only enumeration cannot distinguish positional numbering from explicit sparse or reordered persisted values. Updating printed syntax alone would not fix information already lost during contribution construction.
Proposed change
Read each enum field's Roslyn constant value and retain explicit numeric identity in the shared concept representation. Validate unique int32 values and reject aliases, unsupported ranges and flag combinations with located diagnostics. Emit complete member numbering whenever numeric identity is represented; never silently fall back to positions. Extend EnumConceptFacts.cs, focused documentation and enum fixtures. Add when_* specifications for sparse and reordered members, negative values, aliases, flags and out-of-range underlying types, followed by compiler-backed generation assertions that verify names and numbers together.
Size, risk and release intent
M; medium data-identity risk; minor.
Dependencies and blockers
Coordinate authoring and semantic-model support with Cratis/Screenplay#643. Shared Generation contracts must preserve member numbers before this adapter can safely emit them end to end.
Partial progress in #119: enums whose members are not numbered positionally (explicit sparse, reordered, negative, alias, flags or out-of-range values) now get a located CRITTERSTACK0005 warning, so the lost numbering is reported. Positional enums are unchanged. Emitting the numbers needs ConceptDefinition in Screenplay.Generation to carry them; that is requested in Cratis/Screenplay.Generation#102. This issue stays open until then. (The pinned Generation version mentioned in the description is now 0.21.2.)
Activity
woksin commentedon Oct 29, 2026
Analysis and proposed solution
Current behaviour
Source/DotNET/CritterStack/EnumConceptFacts.cs:107populatesEnumerationValuesfrom the extracted values. Its lowering guard atSource/DotNET/CritterStack/EnumConceptFacts.cs:297validates a list of strings. This representation preserves names but does not itself carry explicit numeric member identities. The shared Generation packages are pinned to 0.18.2 inDirectory.Packages.props:9–12.Root cause / gap
A name-only enumeration cannot distinguish positional numbering from explicit sparse or reordered persisted values. Updating printed syntax alone would not fix information already lost during contribution construction.
Proposed change
Read each enum field's Roslyn constant value and retain explicit numeric identity in the shared concept representation. Validate unique int32 values and reject aliases, unsupported ranges and flag combinations with located diagnostics. Emit complete member numbering whenever numeric identity is represented; never silently fall back to positions. Extend
EnumConceptFacts.cs, focused documentation and enum fixtures. Addwhen_*specifications for sparse and reordered members, negative values, aliases, flags and out-of-range underlying types, followed by compiler-backed generation assertions that verify names and numbers together.Size, risk and release intent
M; medium data-identity risk; minor.
Dependencies and blockers
Coordinate authoring and semantic-model support with Cratis/Screenplay#643. Shared Generation contracts must preserve member numbers before this adapter can safely emit them end to end.
woksin commentedon Nov 21, 2026
Partial progress in #119: enums whose members are not numbered positionally (explicit sparse, reordered, negative, alias, flags or out-of-range values) now get a located
CRITTERSTACK0005warning, so the lost numbering is reported. Positional enums are unchanged. Emitting the numbers needsConceptDefinitionin Screenplay.Generation to carry them; that is requested in Cratis/Screenplay.Generation#102. This issue stays open until then. (The pinned Generation version mentioned in the description is now 0.21.2.)github-actions commentedon Nov 22, 2026
Closed by release v0.28.2.