fix(assertion-eval): has() matches features (v0.9.x bug closeout)#217
Open
avrabe wants to merge 2 commits into
Open
fix(assertion-eval): has() matches features (v0.9.x bug closeout)#217avrabe wants to merge 2 commits into
avrabe wants to merge 2 commits into
Conversation
The has() predicate in the assertion DSL previously only checked component
properties. It now also checks feature names (ports, bus access, etc.),
so has('sensor_out') correctly returns true when the component owns a
feature by that name. Bare names (no '::' separator) are matched against
both the property namespace and the feature namespace; qualified names
(set::name) continue to resolve against properties only.
Three new unit tests cover: feature found, feature absent, all() partial match.
Artifacts updated: REQ-HAS-FEATURES + TEST-HAS-FEATURES.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
# Conflicts: # artifacts/requirements.yaml # artifacts/verification.yaml
This was referenced May 13, 2026
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
has('name')in the assertion DSL only matched component properties; it now also matches features (ports, bus access, parameters, etc.) by name.::) are checked against both the property namespace and the component's feature list; qualified names (set::name) still resolve against properties only.has_matches_feature_by_name,has_feature_name_absent_returns_false,has_feature_all_fails_when_partial.REQ-HAS-FEATURES(requirement) +TEST-HAS-FEATURES(verification) added;rivet validatepasses.Minimal working example
Before fix — assertion always returned
falseeven thoughsensor_outexists:After fix:
Test plan
cargo test -p spar --bin spar -- assertion::tests— 46 tests pass (3 new)cargo test -p spar— full suite greencargo clippy -p spar— no warningsrivet validate— PASS (99 pre-existing warnings, no errors)Closes v0.9.x bug:
has()operator did not match features.🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com