Report a Behavior Annex property reference that has no value 🤖 - #3214
Merged
lwrage merged 2 commits intoSep 11, 2026
Merged
Conversation
lwrage
added this pull request to stack #3215
September 11, 2026 14:50
lwrage
force-pushed
the
3211_reject_valueless_property_reference
branch
from
September 11, 2026 16:35
eeb7d7f to
7f41cfc
Compare
The model reads two properties through the AS5506/3 Rev A D.7 property reference alternative that names no element. Thread_Properties::Priority has no default value, so that reference denotes nothing; the assertion requires one error on it, naming the property and the reference as written. Communication_Properties::Queue_Size has a default value, which is the value its reference denotes, so requiring exactly one issue also pins that the defaulted reference stays legal. The reference is read in an assignment rather than an array size, since the rule is about property references and not about array dimensions. The regression fails today with no issue reported at all. The corpus goldens record that same current behavior, with an empty validated diagnostics projection, so the fix shows as the diagnostic appearing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The AS5506/3 Rev A D.7 property reference alternative that names no element can only denote the default value of the property it names. Translation puts that default in the first property name holder, and leaves the property definition there when the property has none, which denotes no value at all. No strict checker constrains that, so such a reference was accepted and the translated model carried a reference with nothing behind it. Report each one on the reference as written, naming the property. A reference that names a property type is untouched, since an enumeration literal is a value of its own. The check does not gate the strict checkers: the strict model does carry the reference, unlike the constructs the neighboring checks reject, so the checkers keep their model and whatever else they have to say about it. Two corpus models already wrote references of this shape and now report it: covering_syntax/aadlBaTest007.aadl in the section it marks as having no default value defined, and characterization/HolderCoverage.aadl for a record property with no default value. Neither model loses translation coverage; HolderCoverage still instantiates the same holder classes. Fixes #3211 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
lwrage
force-pushed
the
3211_reject_valueless_property_reference
branch
from
September 11, 2026 16:52
7f41cfc to
a23d79c
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.
Fixes #3211
Cause and correction
The first AS5506/3 Rev A D.7
property_referencealternative writes a property value name after#with nothing before it, so the reference names a property definition without naming anything that holds a value for it. The only value it can denote is the default value of the property.DeclarativeToStrictTranslator.toPropertyReferencesubstitutesProperty.getDefaultValue()into the first property name holder when the property has one, and leaves thePropertyitself there when it does not. No strict checker constrains that state, so such a reference was accepted and the translated model carried a reference with nothing behind it.BehaviorAnnexValidator.checkPropertyReferenceValueswalks the strict annex forPropertySetPropertyReference, the translation of that alternative, and reports each one whose first property name holder still holds aProperty— which is exactly the case where there was no default value to substitute. A reference that names a property type is untouched, since an enumeration literal is a value of its own, so#Ps::enum_type.enabledkeeps validating clean.The check does not gate the strict checkers. The strict model does carry the reference, unlike the constructs the neighboring checks reject, so gating would have suppressed unrelated diagnostics; while the rule was gating,
aadlBaTest007lost two pre-existing "resolved behavior annex holder has no element" errors. They are retained.The removed ANTLR resolver rejected part of this case:
AadlBaNameResolver.propertyDeclarationResolverreturnedfalseas soon asgetDefaultValue()was null, which failed resolution when a record field was selected. A bare name with no field, and a range bound on a range property, were accepted then as they were before this change.Regression model and assertion
ba/org.osate.ba.tests/models/issue3211/Issue3211.aadlreads two properties through that alternative, in an assignment rather than an array size, since the rule is about property references and not about array dimensions:value := # Thread_Properties::Priority—inherit aadlintegerwith no default value, so the reference denotes nothing.value := # Communication_Properties::Queue_Size— has a default value, which is what its reference denotes.Issue3211Testrequires exactly one issue, so it pins both the error on the first reference (severity, the source range# Thread_Properties::Priority, and the message naming the property) and that the defaulted reference stays legal. Before the fix it failed with[] expected:<1> but was:<0>; the regression commit records that same behavior in the corpus goldens as an empty validated diagnostics projection, so the fix shows up as the diagnostic appearing.Two corpus models already wrote references of this shape and now report it, both reviewed as genuine:
models/covering_syntax/aadlBaTest007.aadl— ten references in the section the model itself marks-- with default value not defined.models/characterization/HolderCoverage.aadl—#Issue2445_Holder_Properties::record_property.omitted, a record property with no default value. Its holder coverage is unaffected: theresolved-modelgolden is unchanged and the characterization test still instantiates the same holder classes.Validation
Clean root reactor, run outside the sandbox:
BUILD SUCCESS, 143 modules, no failures or errors.org.osate.ba.tests: 120 tests, 0 failures, 5 pre-existing conformance skips, includingIssue3211Test(1) andIssue3210Test(4). Goldens verified with regeneration off after regenerating.Dependencies and merge order
Based on
3208_reject_nonconstant_array_size(PR #3213), not onmaster, and targeted at that branch so the diff shows only the two commits here. The dependency is the new corpus model: itsresolved-modelgolden records theBehaviorArraySizeshape that PR #3213 introduces, so basing this onmasterwould leave a stale golden as soon as #3213 merges.Merge #3213 first, then retarget this PR to
master.Residual risk
toPropertyReferencecontinuing to substitute the default value there. A change to that substitution would silently change this rule.🤖 Generated with Claude Code