Svelte block-header reads are not emitted although their script variables are indexed #434

Closed
opened 2026-10-23 22:59:35 +02:00 by buildagent · 1 comment
Member

A1X E4 on core0.41.14 reports visibleAdminMenuItems = $derived(...) indexed as static but its {#each visibleAdminMenuItems as item (item.path)} use is absent; activeSection = $state(...) has sparse refs across if/else-if and compound class attribute expressions.

Independent parser-free candidate0.41.15 (2cb0f028), signed Svelte0.2.1 + TypeScript0.1.3, minimal reproduction:

<script lang="ts">
let message = $state("hello");
let items = $derived([1, 2]);
</script>
<p>{message}</p>
{#each items as item}<p>{item}</p>{/each}
{#if message === "hello"}<p>Yes</p>{/if}

The bare {message} produces a resolved member_access to its own TS static symbol. The block header emits no use ref for items, and the comparison emits none for message. Both static declarations and the body read of item exist. This separates missing extraction from receiver/rune resolution; missing rows cannot appear in resolution_gaps denominators. The package's current whole-token rules do not parse arbitrary JS expressions.

Extend structural block-header handling with bounded, source-span-correct evidence; keep lexical each/snippet locals from binding same-named script variables. For arbitrary compound expressions, use a properly scoped embedded JS/TS producer or disclose unsupported extraction instead of regex guesses. Grade each iterable, if/else-if, keyed iteration, nested shadowing, script/style boundaries, malformed input and budget exits. The package-only lane should own the syntax fixtures. Do not treat a zero ref_count as proof that these variables are unused. Related #279 covers test reachability; #429 covers grammar parse errors.

A1X E4 on core0.41.14 reports visibleAdminMenuItems = $derived(...) indexed as static but its {#each visibleAdminMenuItems as item (item.path)} use is absent; activeSection = $state(...) has sparse refs across if/else-if and compound class attribute expressions. Independent parser-free candidate0.41.15 (2cb0f028), signed Svelte0.2.1 + TypeScript0.1.3, minimal reproduction: ```svelte <script lang="ts"> let message = $state("hello"); let items = $derived([1, 2]); </script> <p>{message}</p> {#each items as item}<p>{item}</p>{/each} {#if message === "hello"}<p>Yes</p>{/if} ``` The bare {message} produces a resolved member_access to its own TS static symbol. The block header emits no use ref for items, and the comparison emits none for message. Both static declarations and the body read of item exist. This separates missing extraction from receiver/rune resolution; missing rows cannot appear in resolution_gaps denominators. The package's current whole-token rules do not parse arbitrary JS expressions. Extend structural block-header handling with bounded, source-span-correct evidence; keep lexical each/snippet locals from binding same-named script variables. For arbitrary compound expressions, use a properly scoped embedded JS/TS producer or disclose unsupported extraction instead of regex guesses. Grade each iterable, if/else-if, keyed iteration, nested shadowing, script/style boundaries, malformed input and budget exits. The package-only lane should own the syntax fixtures. Do not treat a zero ref_count as proof that these variables are unused. Related #279 covers test reachability; #429 covers grammar parse errors.
Author
Member

Released Svelte 0.2.4 from merged PR #489. Simple each/if/else-if header reads and lexical template scopes were already present in 0.2.3; this release also handles simple keyed each headers, including local/index keys, external path keys, nested shadowing and else-scope restoration. Compound keys/conditions, calls and destructuring remain explicitly disclosed as unsupported; this does not claim arbitrary JavaScript expression parsing.

The corrected exhaustive keyed fixture fails against the prior extractor and passes against the released one. All 21 package-suite tests pass (one existing diagnostic test ignored), with ordinary/durable/reopen, malformed syntax and budget controls. Ten cases pass through published core v0.41.34 over both snapshot and daemon MCP, including live edits/deletion and restart with embedded producers configured. Those E2E archive bytes are byte-identical to the published archive. Guest gates and 82 release-contract checks pass.

PR qualification run2183 took4m55s; package release run2189 passed all four jobs. Independently verified published SHA-256, the official package signature and the signed channel, preserving all50 prior channel versions. ABI, authority requests and grammar did not change.

Closing under this ticket's bounded structural handling and explicit unsupported-extraction criterion. Cross-directory component imports remain tracked separately in #433.

Released [Svelte 0.2.4](https://git.h-dv.de/h-dv/code-index/releases/tag/pkg%2Fde.h-dv.svelte%2Fv0.2.4) from merged PR #489. Simple each/if/else-if header reads and lexical template scopes were already present in 0.2.3; this release also handles simple keyed each headers, including local/index keys, external path keys, nested shadowing and else-scope restoration. Compound keys/conditions, calls and destructuring remain explicitly disclosed as unsupported; this does not claim arbitrary JavaScript expression parsing. The corrected exhaustive keyed fixture fails against the prior extractor and passes against the released one. All 21 package-suite tests pass (one existing diagnostic test ignored), with ordinary/durable/reopen, malformed syntax and budget controls. Ten cases pass through published core v0.41.34 over both snapshot and daemon MCP, including live edits/deletion and restart with embedded producers configured. Those E2E archive bytes are byte-identical to the published archive. Guest gates and 82 release-contract checks pass. PR qualification run2183 took4m55s; package release run2189 passed all four jobs. Independently verified published SHA-256, the official package signature and the signed channel, preserving all50 prior channel versions. ABI, authority requests and grammar did not change. Closing under this ticket's bounded structural handling and explicit unsupported-extraction criterion. Cross-directory component imports remain tracked separately in #433.
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#434
No description provided.