Missing package facts hide live uses, public members, framework bindings and test roles #540

Open
opened 2026-11-09 08:35:48 +01:00 by buildagent · 2 comments
Member

Scope (consolidated 2026-11-12)

A symbol used as a value can appear unused because its language package emits no reference. Statement-defined members, enum children and template expressions can be absent entirely. Missing docs and signatures also force source reads, while missing test markers make test edits look like production risk. Packages must emit these facts and the host must preserve their meaning; unsupported constructs must withhold an earned zero.

Priority: High · Risk: wrong answer · Size: L
Merged into this ticket: #535 (Value uses and earned zeros), #548 (Framework scope and bridge gaps), #577 (Per-symbol test role), #534 (Conditional C# imports)

Done

  • macro_receiver_start in crates/guest/rust/src/rust.rs restores index/try/parenthesized macro receivers (b94c542a/c5239753, Rust package 0.1.8); the reported account restored exactly 30 correct ripgrep binds.
  • Shipped-package identity is checked by install_shipped and gate_packages_match_checkout_records in crates/test-support/src/shipped.rs, plus check_shipped_activation in crates/indexer/tests/corpus/shipped.rs.
  • C# stage pricing uses actual-key histograms in work_estimate, crates/indexer/src/index/inherited_members.rs, tested in crates/indexer/tests/resolver_cost_model.rs; withdrawal/direct-base repairs and audited baseline eefa9b6f shipped. Conditional using extraction remains open.
  • Svelte render_ref and attribute_ref in crates/guest/svelte/src/walk.rs handle render/attachment calls; they do not cover ordinary mustache expressions.

Remaining

Value uses and earned zeros

  • Emit load-position reads for Ruby constants, Python decorators/callbacks, JS callbacks, TS decorators/value/typeof and C# attributes/nameof, with LOCAL scope carried through. Cover argument/RHS/collection/default values and rescue/when/is/instanceof/as/nameof/typeof operands; reproduction table in #535. (#535)
  • Port the untyped JS/TS destructuring contract from builtins to guests; measure missing use channels per construct and gate either a reference row or name_fallback_unmeasured across languages and embedded scripts. (#535)
  • Reproduce the bridged-field no_use_reference_channel concern before changing the disclosure; this is not yet a confirmed defect. (#535)

Statement and child members

  • Emit JS assignment/prototype/export methods and Ruby alias/alias_method/define_method symbols. (#540)
  • Emit Rust/C# enum children, C# positional record properties, PHP class constants/enum cases/::class refs and anonymous-class ownership, plus TS namespace containers/abstract methods/ambient declarations; bind qualified children of the proven parent. (#540)

Language shapes, docs and claims

  • Finish TS constraints/conditional/as/instanceof/typeof, C# explicit-interface/is/default/out, PHP import-alias type refs, Ruby singleton-class attr_reader, Python fixture return types and Rust doc blocks. (#540)
  • Store leading doc blocks using a shared guest-kit helper and normalize signatures by removing attribute lists and CRLF; distinguish Dapper Query overloads. (#540)
  • Support shebang claims and Ruby .ru/.builder/.jbuilder/Guardfile/Capfile/Vagrantfile/Podfile coverage. (#540)

Per-symbol test facts

  • Emit normalized per-symbol test markers through the ABI, store them and use them alongside path/container rules; cover file-level tests and cfg(test) containers without marking unrelated symbols as tests. Reproduction in #577. (#577)

Conditional imports

  • Emit C# using directives under #if/#else as a conditional union; add the exact z2 with/without-wrapper fixture and mutation acceptance. This is the only implementation residue of #534. (#534)

Framework regions and bridges

  • Share template/script import scope and expression-region extraction for Vue/Svelte mustache calls; retain parity with standalone scripts and coordinate import routes with #536. (#548)
  • Emit XAML candidates for simple-identifier attribute values, with a unique bridge and destination (object, *EventArgs) signature check, plus xmlns element-type refs; count unresolved refs through eligible cross-language bridges; distinguish timeline :arguments from same-named columns and index .wat source as text. (#548)
  • Add directory-aware claims, type-driven joins, a bridge-cap policy, x:Class ownership and framework co-claims; MAX_BRIDGES remains 16. (#548)
  • Obtain the framework loader’s real cross-directory search roots, order, case and override rules from the reporter before implementing XAML/timeline cross-directory lookup. (#548)

Acceptance

  • The five language value-use examples in #535 have nonzero resolved or fallback evidence; a six-language plus Vue/Svelte matrix proves each load construct emits a ref or discloses unmeasured use coverage. Audit additions for precision.
  • Per-language member fixtures pass; CommandFlags.Buffered references and Rust enum-variant name lookup work. Corpus qualified-read gains have a sampled bind account without phantoms.
  • Framework fixtures reach recall ≥0.9 with precision 1.00; Vue/Svelte mustache parity and bridge-aware safe_delete unresolved evidence are tested.
  • Test markers work per symbol for Rust standalone tests and cfg(test) containers, and equivalent markers in other languages; adjacent production symbols keep their production role.
  • The exact z2-shaped C# fixture has equal binds with/without #if; branch-union conditional facts are graded and restoring the missing-import arm fails the fixture. Retain shipped stage/baseline identity and no-correct-bind-loss checks.

Suggested order

  1. Emit load-position uses and construct-level zero disclosures first; affected language package releases and bind accounts required.
  2. Emit statement/child members, docs and normalized signatures; affected language package releases and bind accounts required for new targets.
  3. Extend the fact ABI, storage and grader for per-symbol test markers; every language package needs release, with bind invariance checked.
  4. Complete conditional C# imports and framework region/bridge facts; C#/framework package releases and bind accounts required, loader policy waits for reporter input.

Original report

Summary

Several kinds of member are never symbols, so "where is X.Y used" has no answer in any of these languages. This is also the main reason qualified-read resolution is low.

Language Missing symbols Evidence
Rust enum variants (rust.rs:2464-2471 documents that no plugin emits SymbolKind::VARIANT) ripgrep: 777 qualified reads + 286 calls with a project-enum qualifier unresolved (Category::Output ×36, Match::None ×27). The code-index MCP itself cannot find FactStringTooLong or CsharpPartial by name
C# enum members (0 in all of dapper), positional record properties CommandFlags.Buffered, Row.First cannot bind
PHP class constants, enum cases; no ref for X::class / X::CONST 881 ::class lines in guzzle, 0 refs. The guest says class_constant_access_expression is "deliberately not covered"
TypeScript namespace X {} (members get container_name null; zod v3 util gives 663 no_candidate), abstract method signatures, ambient declare function in .d.ts fixture lang-out/typescript/fixture
PHP anonymous classes (their methods hang off the enclosing method as Acme\Child\run\run; their extends is lost) fixture

Proposal

  • A shared guest-kit shape for child members: VARIANT / enum-case / class-const / record-property symbols with parent set to the enclosing type, plus TS namespace and anonymous-class containers.
  • One resolver rule: Enum::Variant / Type::CONST / Type.Member → the child of the resolved Type.
  • X::class emits a qualified type ref.

Acceptance

  • Per-language fixtures.
  • ripgrep qualified-read resolution rises, with a sampled bind diff showing no phantoms.
  • find_references("CommandFlags.Buffered") (or the equivalent id) answers.
  • The code-index MCP can find Rust enum variants by name on its own repository.

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.

## Scope (consolidated 2026-11-12) A symbol used as a value can appear unused because its language package emits no reference. Statement-defined members, enum children and template expressions can be absent entirely. Missing docs and signatures also force source reads, while missing test markers make test edits look like production risk. Packages must emit these facts and the host must preserve their meaning; unsupported constructs must withhold an earned zero. **Priority:** High · **Risk:** wrong answer · **Size:** L **Merged into this ticket:** #535 (Value uses and earned zeros), #548 (Framework scope and bridge gaps), #577 (Per-symbol test role), #534 (Conditional C# imports) ## Done - `macro_receiver_start` in `crates/guest/rust/src/rust.rs` restores index/try/parenthesized macro receivers (b94c542a/c5239753, Rust package 0.1.8); the reported account restored exactly 30 correct ripgrep binds. - Shipped-package identity is checked by `install_shipped` and `gate_packages_match_checkout_records` in `crates/test-support/src/shipped.rs`, plus `check_shipped_activation` in `crates/indexer/tests/corpus/shipped.rs`. - C# stage pricing uses actual-key histograms in `work_estimate`, `crates/indexer/src/index/inherited_members.rs`, tested in `crates/indexer/tests/resolver_cost_model.rs`; withdrawal/direct-base repairs and audited baseline eefa9b6f shipped. Conditional using extraction remains open. - Svelte `render_ref` and `attribute_ref` in `crates/guest/svelte/src/walk.rs` handle render/attachment calls; they do not cover ordinary mustache expressions. ## Remaining ### Value uses and earned zeros - Emit load-position reads for Ruby constants, Python decorators/callbacks, JS callbacks, TS decorators/value/typeof and C# attributes/nameof, with LOCAL scope carried through. Cover argument/RHS/collection/default values and rescue/when/is/instanceof/as/nameof/typeof operands; reproduction table in #535. (#535) - Port the untyped JS/TS destructuring contract from builtins to guests; measure missing use channels per construct and gate either a reference row or name_fallback_unmeasured across languages and embedded scripts. (#535) - Reproduce the bridged-field no_use_reference_channel concern before changing the disclosure; this is not yet a confirmed defect. (#535) ### Statement and child members - Emit JS assignment/prototype/export methods and Ruby alias/alias_method/define_method symbols. (#540) - Emit Rust/C# enum children, C# positional record properties, PHP class constants/enum cases/::class refs and anonymous-class ownership, plus TS namespace containers/abstract methods/ambient declarations; bind qualified children of the proven parent. (#540) ### Language shapes, docs and claims - Finish TS constraints/conditional/as/instanceof/typeof, C# explicit-interface/is/default/out, PHP import-alias type refs, Ruby singleton-class attr_reader, Python fixture return types and Rust doc blocks. (#540) - Store leading doc blocks using a shared guest-kit helper and normalize signatures by removing attribute lists and CRLF; distinguish Dapper Query overloads. (#540) - Support shebang claims and Ruby .ru/.builder/.jbuilder/Guardfile/Capfile/Vagrantfile/Podfile coverage. (#540) ### Per-symbol test facts - Emit normalized per-symbol test markers through the ABI, store them and use them alongside path/container rules; cover file-level tests and cfg(test) containers without marking unrelated symbols as tests. Reproduction in #577. (#577) ### Conditional imports - Emit C# using directives under #if/#else as a conditional union; add the exact z2 with/without-wrapper fixture and mutation acceptance. This is the only implementation residue of #534. (#534) ### Framework regions and bridges - Share template/script import scope and expression-region extraction for Vue/Svelte mustache calls; retain parity with standalone scripts and coordinate import routes with #536. (#548) - Emit XAML candidates for simple-identifier attribute values, with a unique bridge and destination (object, *EventArgs) signature check, plus xmlns element-type refs; count unresolved refs through eligible cross-language bridges; distinguish timeline :arguments from same-named columns and index .wat source as text. (#548) - Add directory-aware claims, type-driven joins, a bridge-cap policy, x:Class ownership and framework co-claims; MAX_BRIDGES remains 16. (#548) - Obtain the framework loader’s real cross-directory search roots, order, case and override rules from the reporter before implementing XAML/timeline cross-directory lookup. (#548) ## Acceptance - The five language value-use examples in #535 have nonzero resolved or fallback evidence; a six-language plus Vue/Svelte matrix proves each load construct emits a ref or discloses unmeasured use coverage. Audit additions for precision. - Per-language member fixtures pass; CommandFlags.Buffered references and Rust enum-variant name lookup work. Corpus qualified-read gains have a sampled bind account without phantoms. - Framework fixtures reach recall ≥0.9 with precision 1.00; Vue/Svelte mustache parity and bridge-aware safe_delete unresolved evidence are tested. - Test markers work per symbol for Rust standalone tests and cfg(test) containers, and equivalent markers in other languages; adjacent production symbols keep their production role. - The exact z2-shaped C# fixture has equal binds with/without #if; branch-union conditional facts are graded and restoring the missing-import arm fails the fixture. Retain shipped stage/baseline identity and no-correct-bind-loss checks. ## Suggested order 1. Emit load-position uses and construct-level zero disclosures first; affected language package releases and bind accounts required. 2. Emit statement/child members, docs and normalized signatures; affected language package releases and bind accounts required for new targets. 3. Extend the fact ABI, storage and grader for per-symbol test markers; every language package needs release, with bind invariance checked. 4. Complete conditional C# imports and framework region/bridge facts; C#/framework package releases and bind accounts required, loader policy waits for reporter input. ## Original report ## Summary Several kinds of **member** are never symbols, so "where is `X.Y` used" has no answer in any of these languages. This is also the main reason qualified-`read` resolution is low. | Language | Missing symbols | Evidence | |---|---|---| | Rust | **enum variants** (`rust.rs:2464-2471` documents that no plugin emits `SymbolKind::VARIANT`) | ripgrep: 777 qualified reads + 286 calls with a project-enum qualifier unresolved (`Category::Output` ×36, `Match::None` ×27). The code-index MCP itself cannot find `FactStringTooLong` or `CsharpPartial` by name | | C# | **enum members** (0 in all of dapper), positional **record properties** | `CommandFlags.Buffered`, `Row.First` cannot bind | | PHP | **class constants**, **enum cases**; no ref for `X::class` / `X::CONST` | 881 `::class` lines in guzzle, 0 refs. The guest says `class_constant_access_expression` is "deliberately not covered" | | TypeScript | `namespace X {}` (members get `container_name null`; zod v3 `util` gives 663 `no_candidate`), `abstract` method signatures, ambient `declare function` in `.d.ts` | fixture `lang-out/typescript/fixture` | | PHP | anonymous classes (their methods hang off the enclosing method as `Acme\Child\run\run`; their `extends` is lost) | fixture | ## Proposal - A shared **guest-kit shape for child members**: `VARIANT` / enum-case / class-const / record-property symbols with `parent` set to the enclosing type, plus TS namespace and anonymous-class containers. - One resolver rule: `Enum::Variant` / `Type::CONST` / `Type.Member` → the child of the resolved `Type`. - `X::class` emits a qualified `type` ref. ## Acceptance - Per-language fixtures. - ripgrep qualified-read resolution rises, with a sampled bind diff showing no phantoms. - `find_references("CommandFlags.Buffered")` (or the equivalent id) answers. - The code-index MCP can find Rust enum variants by name on its own repository. --- _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._
buildagent changed title from Members that are never symbols: Rust enum variants, C# enum members/record props, PHP consts/enum cases/X::class, TS namespaces to Extraction coverage: members defined by statement (JS app.x = fn, Ruby alias), enum/const members, docs and signatures, per-language gaps, file claims 2026-11-09 09:20:59 +01:00
Author
Member

Field case from the #534 bind account: the Rust package lost the qualifier of index-expression receivers (shipped recall regression)

rust-ripgrep tests/json.rs:162 msgs[0].unwrap_begin() used to bind to Message::unwrap_begin (tests/json.rs:21) under the old pin (rust 0.1.5). Under the shipped rust 0.1.7 the ref has an empty qualifier and stays unresolved. There are 30 such correct binds lost on ripgrep (26 Message.unwrap_*, 4 IncrementalIgnore.root/normalize), all with an index expression or similar non-path receiver. To do: find the guest change between 0.1.5 and 0.1.7 that dropped the receiver qualifier for index_expression (and siblings), restore it, and add a guest fixture plus a corpus bind check. This blocks the #534 re-bless.

## Field case from the #534 bind account: the Rust package lost the qualifier of index-expression receivers (shipped recall regression) `rust-ripgrep` `tests/json.rs:162` `msgs[0].unwrap_begin()` used to bind to `Message::unwrap_begin` (`tests/json.rs:21`) under the old pin (rust 0.1.5). Under the shipped rust 0.1.7 the ref has an empty qualifier and stays unresolved. There are 30 such correct binds lost on ripgrep (26 `Message.unwrap_*`, 4 `IncrementalIgnore.root/normalize`), all with an index expression or similar non-path receiver. To do: find the guest change between 0.1.5 and 0.1.7 that dropped the receiver qualifier for `index_expression` (and siblings), restore it, and add a guest fixture plus a corpus bind check. This blocks the #534 re-bless.
Author
Member

Fixed on branch codex-534 (b94c542a), merged into integration-1109 (c5239753). Rust package 0.1.8, rebuilt through the existing flow (build.sh + package_records --write --package rust).

  • Cause: crates/guest/rust/src/rust.rs walk_macro_token_tree (from 330c6f25). Inside macro token trees (assert_eq! within rgtest!) the receiver arrives as a delimiter group, not an index_expression, and the bare-identifier guard cleared it. Ordinary receiver capture was unchanged across 0.1.5–0.1.7.
  • Fix: macro_receiver_start keeps the full index/try/parenthesized receiver spelling. Call-result and field-suffix receivers stay unproven on purpose (negative controls in the fixture). A broader first draft added 6 wrong rust-analyzer binds and was discarded.
  • Bind diff (shipped before/after): rust-ripgrep +30, 0 removed, 0 retargeted. These are exactly the 30 lost binds, all hand-checked. rust-analyzer is byte-identical. Precision 7/7, phantoms 0. Both mutations go red.
  • Release note: 0.1.8 still has to go through the signed package publish flow to actually ship.
Fixed on branch `codex-534` (`b94c542a`), merged into `integration-1109` (`c5239753`). Rust package **0.1.8**, rebuilt through the existing flow (`build.sh` + `package_records --write --package rust`). - **Cause:** `crates/guest/rust/src/rust.rs` `walk_macro_token_tree` (from `330c6f25`). Inside macro token trees (`assert_eq!` within `rgtest!`) the receiver arrives as a delimiter group, not an `index_expression`, and the bare-identifier guard cleared it. Ordinary receiver capture was unchanged across 0.1.5–0.1.7. - **Fix:** `macro_receiver_start` keeps the full index/try/parenthesized receiver spelling. Call-result and field-suffix receivers stay unproven on purpose (negative controls in the fixture). A broader first draft added 6 wrong rust-analyzer binds and was discarded. - **Bind diff (shipped before/after):** rust-ripgrep +30, 0 removed, 0 retargeted. These are exactly the 30 lost binds, all hand-checked. rust-analyzer is byte-identical. Precision 7/7, phantoms 0. Both mutations go red. - **Release note:** 0.1.8 still has to go through the signed package publish flow to actually ship.
buildagent changed title from Extraction coverage: members defined by statement (JS app.x = fn, Ruby alias), enum/const members, docs and signatures, per-language gaps, file claims to Missing package facts hide live uses, public members, framework bindings and test roles 2026-11-12 22:22:53 +01:00
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#540
No description provided.