Framework packages: templates cannot see script imports, Svelte drops mustache calls, XAML knows 7 events, cross-language misses not in same_name_unresolved #548

Closed
opened 2026-11-09 08:35:50 +01:00 by buildagent · 1 comment
Member

Consolidated scope (triage 2026-11-09)

Priority: Medium: framework recall is about 0.49 at precision 1.00.

This issue is now the canonical tracker for:

  • the bridge/claim primitives: claims are basename-only (claim.rs:99-107, needs a directory component, #135); a type-driven join; MAX_BRIDGES 16; XAML handler bridges use paired_file rather than the x:Class; a third-party framework package cannot co-claim .py/.ts (from #154, closed and merged here; its full report stays readable there)
  • XAML/Timeline cross-directory lookup: blocked on the framework loader's real search roots, order, case and override rules (needs the reporter) (from #229, closed and merged here; its full report stays readable there)

Original report

Summary

The framework packages never bind wrongly (precision 1.00 on 39 binds), but recall is about 0.49 because cross-language scope is missing. Fixture projects in lang-out/frameworks/ contain realistic Vue 3, Svelte, WPF and timeline samples.

Gap Evidence
Templates cannot see their script's imports Vue {{ formatCount(x) }} and Svelte {#each cart.items} are no_candidate even though the <script> imports the name. check_rename formatCount finds 3 sites, and both .vue files appear only under text_occurrence_files.
Svelte emits nothing for calls in mustaches crates/guest/svelte/src/expr.rs applies call_head only to {@render}. Vue does emit them, so the two packages diverge.
XAML recognises 7 event names The $handler_attr whitelist (tests/packages/xaml.extractor.wat:252-278): Click, KeyDown, KeyUp, PreviewKeyDown, PreviewKeyUp, Loaded, Unloaded. SelectionChanged, MouseDoubleClick, TextChanged, Closing, Startup and custom routed events emit no ref. Element types (<ctl:PriceBox>) emit no type ref.
Cross-language unresolved refs are invisible to same_name_unresolved safe_delete GoButton_Click reports same_name_unresolved: 0 while a XAML call GoButton_Click sits no_candidate. Same for formatCount. Only the text scan saves the verdict. The cause is likely a same-language filter (inferred).
Timeline :arg named like a column never binds :region_id binds when there is no region_id column and stays unresolved when one exists. The read lands in the member pool and does not fall back to the argument.
The extractor source tests/packages/xaml.extractor.wat is not indexed, so reviewing it required grep product gap

Proposal (generic)

  • Region scope: template refs resolve in a scope that includes the script region's import bindings and top-level declarations. Embedded-region imports resolve like file imports (see #543). Mustache expressions are handed to the host's TS/JS extractor as expression regions, which removes the Vue/Svelte divergence by construction.
  • XAML: emit a candidate for any simple-identifier attribute value and let the paired-file bridge decide (ambiguity=unique plus the destination's (object, *EventArgs) signature). Decoy safety held in the test. Emit type refs for element tags with an xmlns prefix.
  • same_name_unresolved counts unresolved refs from any language that has a bridge or embedded region into the symbol's language.
  • Timeline: a :name binding can only mean an argument; emit it with a kind or qualifier that admits only argument symbols.
  • Index .wat sources as text.

Acceptance

  • The fixture recall rises to at least 0.9 with precision still 1.00.
  • safe_delete counts cross-language unresolved refs.
  • A Vue/Svelte parity fixture for mustache calls.

Related: #154 (frameworks do not generalise), #229 (XAML/timeline cross-directory lookup).


Filed from the per-language review on 2026-11-09: 8 agents, one per language plus one for Vue/Svelte/XAML/timeline, run against copies of the pinned corpus repos (tests/corpus/corpus.toml) using installed build 2dcfc615, which differs from master only by XAML/CI commits. The top claim of every issue was spot-checked in the main session. Artifacts live under the review session's scratchpad lang-out/<lang>/ and are available on request.

## Consolidated scope (triage 2026-11-09) **Priority: Medium**: framework recall is about 0.49 at precision 1.00. This issue is now the canonical tracker for: - [ ] the bridge/claim primitives: claims are basename-only (`claim.rs:99-107`, needs a directory component, #135); a type-driven join; `MAX_BRIDGES` 16; XAML handler bridges use `paired_file` rather than the `x:Class`; a third-party framework package cannot co-claim `.py`/`.ts` (from #154, closed and merged here; its full report stays readable there) - [ ] XAML/Timeline cross-directory lookup: blocked on the framework loader's real search roots, order, case and override rules (needs the reporter) (from #229, closed and merged here; its full report stays readable there) --- ## Original report ## Summary The framework packages never bind wrongly (precision 1.00 on 39 binds), but **recall is about 0.49** because cross-language scope is missing. Fixture projects in `lang-out/frameworks/` contain realistic Vue 3, Svelte, WPF and timeline samples. | Gap | Evidence | |---|---| | **Templates cannot see their script's imports** | Vue `{{ formatCount(x) }}` and Svelte `{#each cart.items}` are `no_candidate` even though the `<script>` imports the name. `check_rename formatCount` finds 3 sites, and both `.vue` files appear only under `text_occurrence_files`. | | **Svelte emits nothing for calls in mustaches** | `crates/guest/svelte/src/expr.rs` applies `call_head` only to `{@render}`. Vue does emit them, so the two packages diverge. | | **XAML recognises 7 event names** | The `$handler_attr` whitelist (`tests/packages/xaml.extractor.wat:252-278`): Click, KeyDown, KeyUp, PreviewKeyDown, PreviewKeyUp, Loaded, Unloaded. `SelectionChanged`, `MouseDoubleClick`, `TextChanged`, `Closing`, `Startup` and custom routed events emit no ref. Element types (`<ctl:PriceBox>`) emit no type ref. | | **Cross-language unresolved refs are invisible to `same_name_unresolved`** | `safe_delete GoButton_Click` reports `same_name_unresolved: 0` while a XAML `call GoButton_Click` sits `no_candidate`. Same for `formatCount`. Only the text scan saves the verdict. The cause is likely a same-language filter (inferred). | | **Timeline `:arg` named like a column never binds** | `:region_id` binds when there is no `region_id` column and stays unresolved when one exists. The `read` lands in the member pool and does not fall back to the argument. | | The extractor source `tests/packages/xaml.extractor.wat` is **not indexed**, so reviewing it required grep | product gap | ## Proposal (generic) - **Region scope:** template refs resolve in a scope that includes the script region's import bindings and top-level declarations. Embedded-region imports resolve like file imports (see #543). Mustache expressions are handed to the host's TS/JS extractor as **expression regions**, which removes the Vue/Svelte divergence by construction. - **XAML:** emit a candidate for any simple-identifier attribute value and let the paired-file bridge decide (`ambiguity=unique` plus the destination's `(object, *EventArgs)` signature). Decoy safety held in the test. Emit type refs for element tags with an xmlns prefix. - **`same_name_unresolved`** counts unresolved refs from any language that has a bridge or embedded region into the symbol's language. - **Timeline:** a `:name` binding can only mean an argument; emit it with a kind or qualifier that admits only argument symbols. - Index `.wat` sources as text. ## Acceptance - The fixture recall rises to at least 0.9 with precision still 1.00. - `safe_delete` counts cross-language unresolved refs. - A Vue/Svelte parity fixture for mustache calls. Related: #154 (frameworks do not generalise), #229 (XAML/timeline cross-directory lookup). --- _Filed from the per-language review on 2026-11-09: 8 agents, one per language plus one for Vue/Svelte/XAML/timeline, run against copies of the pinned corpus repos (`tests/corpus/corpus.toml`) using installed build `2dcfc615`, which differs from master only by XAML/CI commits. The top claim of every issue was spot-checked in the main session. Artifacts live under the review session's scratchpad `lang-out/<lang>/` and are available on request._
Author
Member

Merged into #540.
Svelte walk.rs::render_ref and attribute_ref cover render/attachment calls, not ordinary mustaches.
Remaining: Framework regions and bridges, including reporter-supplied loader rules.

Merged into #540. Svelte walk.rs::render_ref and attribute_ref cover render/attachment calls, not ordinary mustaches. Remaining: Framework regions and bridges, including reporter-supplied loader rules.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#548
No description provided.