Skip to content

fix(hir-def): preserve properties applied to connections and features (#237)#257

Open
avrabe wants to merge 2 commits into
fix/instance-extends-cross-file-panicfrom
fix/applies-to-connection-feature-props
Open

fix(hir-def): preserve properties applied to connections and features (#237)#257
avrabe wants to merge 2 commits into
fix/instance-extends-cross-file-panicfrom
fix/applies-to-connection-feature-props

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Jun 4, 2026

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

avrabe and others added 2 commits June 4, 2026 09:44
…#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant