fix(compilers/openapi): fill allOf position constraints - #457
Merged
Merged
Conversation
A value constraint written beside an allOf composing position — minProperties, maxProperties — reached a different channel than the same constraint written beside a plain object schema. lowerModel filled ir.Model.Constraints from the position's own schema; lowerAllOf built its Model without doing so, leaving Constraints nil. The census that runs afterward then found no value there and concluded the keyword had no home, reporting a false openapi/degraded-construct diagnostic and stashing the value under Unmodeled — even though the very field the diagnostic said was missing exists on every Model, allOf-composed or not. Fix lowerAllOf to read the position's constraints the same way lowerModel does, so the census sees them filled and the keyword lands where ir-design.md already documents it belonging (Model.Constraints), with no diagnostic and no Unmodeled entry. buildComposedVariant, which synthesizes a Model per distributed-union variant from the same kind of position, had the same gap — worse, since that path never runs the position's census at all, so a bound written beside a co-declared oneOf/anyOf was dropped in total silence rather than merely misfiled. Both are fixed the same way, reading schemaConstraints once per built Model. Closes #407 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TJZJ8HaugGZTjzVueafLAT
fuad-daoud
force-pushed
the
fix/allof-position-constraints
branch
from
September 14, 2026 21:19
69ffaea to
06412b8
Compare
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
A value constraint written beside an
allOfcomposing position —minProperties,maxProperties— reached a different channel than the same constraint beside a plain object schema.lowerModelfilledir.Model.Constraintsfrom the position's own schema;lowerAllOfbuilt its Model without doing so, leavingConstraintsnil. The census that runs afterwards found no value there and concluded the keyword had no home, reporting a falseopenapi/degraded-constructand stashing the value underUnmodeled— while the field the diagnostic said was missing exists on every Model (#407).lowerAllOfnow reads the position's constraints with the sameschemaConstraintscalllowerModelmakes, so the keyword lands whereir-design.mdalready documents it (Model.Constraints), with no diagnostic and noUnmodeledentry.buildComposedVariant, which synthesizes a Model per distributed-union variant from the same kind of position, had the same gap — and worse: that path never runs the position's census at all, so a bound written beside a co-declaredoneOf/anyOfwas dropped in total silence rather than misfiled. Both are fixed the same way. No otherir.Modelconstruction site is missing the fill (the sweep is in the commit).Test plan
allof-position-constraints(witnessesintersection): pinsViaAllOf.Constraints.MinProps == 2, noopenapi:minPropertiesunderUnmodeled, and nodegraded-constructat/components/schemas/ViaAllOf. Planting the defect back reddens it.allof-oneof-cooccurrence.yamlgainsminProperties: 2on itsComboschema, since no existing fixture reached thebuildComposedVariantgap (it was silent, not misfiled, so no golden could have changed); its golden now carries the bound on each distributed variant.make gatepasses: lint 0 issues, coverage at 100%, fuzz, bench-smoke.Closes #407
🤖 Generated with Claude Code
https://claude.ai/code/session_01TJZJ8HaugGZTjzVueafLAT