Skip to content

feat: add type-aware class-member proof of concept#1943

Open
BartWaardenburg wants to merge 21 commits into
mainfrom
feat/type-aware-class-members-poc
Open

feat: add type-aware class-member proof of concept#1943
BartWaardenburg wants to merge 21 commits into
mainfrom
feat/type-aware-class-members-poc

Conversation

@BartWaardenburg

@BartWaardenburg BartWaardenburg commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an experimental dead-code --type-aware refinement for unused class members
  • keep extraction, graph construction, caching, and default output syntactic-only
  • use a backend-neutral protocol with a reference TypeScript-Go 7.0.2 sidecar
  • emit bounded provenance, warnings, timings, and explain metadata under _meta.type_aware

The design follows the architecture validated by Oxc's stable type-aware linting release: the Rust analyzer keeps its existing responsibilities while a separate semantic engine builds TypeScript programs and answers narrow type queries.

Result

  • the nested generic reproduction reports both used and dead syntactically, then only dead with --type-aware
  • on Astro 6.3.1, the sidecar examined 104 candidates, confirmed 38 exact uses, conservatively retained 66, and added no findings
  • the final Astro smoke retained the genuinely unused NodePool.clear candidate
  • the semantic phase took approximately 1.1 to 2.7 seconds across measured local runs; no overall speedup is claimed

Safety

  • only exact declaration matches can remove a finding
  • diagnostics and inferred projects remain conservative
  • malformed, incomplete, oversized, or incompatible protocol responses fail with exit 2
  • blocked I/O, timeouts, output limits, Ctrl+C, and SIGTERM terminate the full sidecar process tree
  • the normal command never discovers or starts the sidecar

Verification

  • nested generic reproduction
  • TypeScript-Go sidecar behavior and inferred projects
  • Rust protocol, lifecycle, CLI, and output-contract coverage
  • Astro and additional real-project smoke tests
  • deterministic repeated output
  • cold, warm, and peak-memory measurements
  • generated schema and TypeScript contract validation
  • workspace check, tests, strict lint, format, rustdoc, typo, workflow, and self-audit gates
  • native Rust, CLI-output, and JSON-contract review

Scope

This is a proof of concept. Production packaging, persistent semantic caching, MCP and editor integration, and additional type-aware issue families remain separate product decisions.

@BartWaardenburg
BartWaardenburg force-pushed the feat/type-aware-class-members-poc branch 4 times, most recently from 96b98e8 to 957feb6 Compare July 22, 2026 14:51
@BartWaardenburg
BartWaardenburg force-pushed the feat/type-aware-class-members-poc branch from 957feb6 to e07dfab Compare July 22, 2026 16:11
@codspeed-hq

codspeed-hq Bot commented Jul 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 49 untouched benchmarks
⏩ 21 skipped benchmarks1


Comparing feat/type-aware-class-members-poc (79e94d1) with main (45f1642)

Open in CodSpeed

Footnotes

  1. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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