feat: new-data prerequisites — mod-declaration imports, per-binding import split, churn, stats history #31

Open
opened 2026-07-20 22:38:52 +02:00 by buildagent · 1 comment
Member

Needs-new-data section of the 2026-07-20 index-data brainstorm (_prdoc/records/brainstorm-2026-07-20-index-data-catalog.md). Small extraction/schema additions with outsized unlock (receiver capture is tracked separately in #29):

  1. mod-declaration capture in imports: Rust mod x; / PHP require / Ruby require_relative emit no imports rows today — the single false-positive source making all 5 non-Rust plugin source files look orphaned. With it, an orphan_files detector goes clean (verifiably 0 genuine orphans in this repo) and Rust get_dependencies improves generally.
  2. Per-binding import split: use a::{B, C} is stored as ONE unsplittable row (568 imports, only 279 analyzable). Prerequisite for unused_imports — whose payoff is the 5 non-Rust languages where no compiler warns. Two lenses independently measured heavy FP classes (trait-method imports, derive/attr usage, pub-use re-exports) → confidence labels required.
  3. file_churn (table or on-demand git log shell-out): churn × fan-in hotspot quadrants. Three independent metrics already converge on server.rs (51 commits/90d), local_index.rs (46), index.rs (37, 891-line resolve_ref_targets_in_tx). gitdiff.rs plumbing exists; can start query-time-only.
  4. stats_history snapshot table: one row per full index run — turns the manual "resolved refs NET UP 5456→5696" release-note ritual (every schema migration v14→v19 so far) into a query and gives resolver changes automatic regression detection.
Needs-new-data section of the 2026-07-20 index-data brainstorm (`_prdoc/records/brainstorm-2026-07-20-index-data-catalog.md`). Small extraction/schema additions with outsized unlock (receiver capture is tracked separately in #29): 1. **mod-declaration capture in imports**: Rust `mod x;` / PHP `require` / Ruby `require_relative` emit no `imports` rows today — the single false-positive source making all 5 non-Rust plugin source files look orphaned. With it, an orphan_files detector goes clean (verifiably 0 genuine orphans in this repo) and Rust get_dependencies improves generally. 2. **Per-binding import split**: `use a::{B, C}` is stored as ONE unsplittable row (568 imports, only 279 analyzable). Prerequisite for unused_imports — whose payoff is the 5 non-Rust languages where no compiler warns. Two lenses independently measured heavy FP classes (trait-method imports, derive/attr usage, pub-use re-exports) → confidence labels required. 3. **file_churn** (table or on-demand `git log` shell-out): churn × fan-in hotspot quadrants. Three independent metrics already converge on server.rs (51 commits/90d), local_index.rs (46), index.rs (37, 891-line resolve_ref_targets_in_tx). gitdiff.rs plumbing exists; can start query-time-only. 4. **stats_history snapshot table**: one row per full index run — turns the manual "resolved refs NET UP 5456→5696" release-note ritual (every schema migration v14→v19 so far) into a query and gives resolver changes automatic regression detection.
Author
Member

Triage: P1 for graph correctness; split before implementation

This issue combines four unrelated data investments. Recommended split:

  1. P1: import/module-edge completenessmod, require, require_relative, and per-binding imports. This directly improves graph truth, context selection, impact, cycles, and orphan analysis.
  2. P2: stats history — resolver regression measurement and release validation.
  3. P3: churn/hotspot evidence — optional ranking input, query-time first.
  4. Defer unused-import productization until false-positive classes are controlled; compilers already cover part of this space.

Implement the import work before adding more graph-derived conclusions. Each extraction change needs upgrade/fresh-index equivalence and before/after resolution precision measurements.

### Triage: P1 for graph correctness; split before implementation This issue combines four unrelated data investments. Recommended split: 1. **P1: import/module-edge completeness** — `mod`, `require`, `require_relative`, and per-binding imports. This directly improves graph truth, context selection, impact, cycles, and orphan analysis. 2. **P2: stats history** — resolver regression measurement and release validation. 3. **P3: churn/hotspot evidence** — optional ranking input, query-time first. 4. **Defer unused-import productization** until false-positive classes are controlled; compilers already cover part of this space. Implement the import work before adding more graph-derived conclusions. Each extraction change needs upgrade/fresh-index equivalence and before/after resolution precision measurements.
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#31
No description provided.