fix(hir-def): preserve properties applied to connections and features (#237)#257
Open
avrabe wants to merge 2 commits into
Open
Conversation
…#237) `applies to <path>.<connection>` and `applies to <path>.<feature>` lost their properties in the instance model. `resolve_applies_to_path` only recognized subcomponents and features, so a connection segment fell through to `Unresolvable` and the property was dumped on the declaring component; feature targets were likewise stored on the owning component keyed by property name, so multiple ports collapsed last-wins. Neither connections nor features kept their own values. Fix: - Add per-feature and per-connection property side-maps to SystemInstance (`feature_property_maps`, `connection_property_maps`) with accessors `properties_for_feature` / `properties_for_connection`. - `AppliesTarget` gains `Feature(FeatureInstanceIdx)` and `Connection(ConnectionInstanceIdx)`; `resolve_applies_to_path` resolves a final connection segment, and feature targets now carry the specific feature index. `resolve_pending_applies_to` stores into the side-maps. - spar-hir serialization: `InstanceFeature` / `InstanceConnection` gain a `properties` map; a shared `prop_map_to_btree` helper serializes component, feature, and connection properties. Connection properties come from the originating raw connection (avoids mis-attributing a traced hop). Up/down connections (e.g. `input -> t1.input`) that carry `applies to` properties are now surfaced so their values aren't silently dropped. Verified on the issue's `dataflow.aadl`: c1..c4 each emit their own `stood::link_position` and ports keep `stood::port_position`. Regression test `applies_to_connection_and_feature_store_per_instance`. The bulk of the diff is mechanical: adding the two side-map fields to the ~50 `SystemInstance` test-builder literals across crates. Closes #237. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cargo fmt — no behavior change. (Format CI check.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 #237 — properties via
applies to <connection>/applies to <feature>were lost (connection→Unresolvable→dumped on component; feature→collapsed last-wins on component). Adds per-feature/per-connection property side-maps + AppliesTarget Feature/Connection + spar-hir serialization of feature/connection properties (originating raw connection; up/down connections surfaced). Verified on the issue's dataflow.aadl (c1–c4 keep distinct link_position; ports keep port_position). Regression test added; full suites green. Stacked on #256 (same file); retarget base to main once #256 merges. Bulk of diff = mechanical fixture updates to ~50 SystemInstance test literals.🤖 Generated with Claude Code