Skip to content

chore: pre-release consolidation — remove dead code, backward-compat shims, and code duplication#215

Merged
jafreck merged 2 commits intomainfrom
cleanup/pre-release-consolidation
Mar 15, 2026
Merged

chore: pre-release consolidation — remove dead code, backward-compat shims, and code duplication#215
jafreck merged 2 commits intomainfrom
cleanup/pre-release-consolidation

Conversation

@jafreck
Copy link
Owner

@jafreck jafreck commented Mar 15, 2026

Pre-Release Consolidation

Per CLAUDE.md: "No legacy code retention. Dead code, deprecated paths, compatibility shims, and migration layers should be removed rather than maintained."

This PR removes 851 net lines of dead code, backward-compatibility shims, and code duplication across 27 files.

Dead code removed

  • Config entry stubs (listConfigEntries, 3 interfaces) — no backing DDL ever existed
  • BenchmarkRunner class — never instantiated anywhere
  • Deprecated task constants (LORE_SELF_TASKS, GSON_TASKS, POSTGRES_TASKS) — callers migrated to getTasksForRepo()
  • toSlug() in docs.ts — never called
  • 7 dead tool refs in benchmark script (coverage, routes, notes, annotations, graph-analysis, architecture, writeback)
  • Deprecated parseAndExtract() helper — sole caller migrated to parseAndExtractStrict()

Backward-compat shims removed

  • Dual sync/async MCP servercreateLoreMcpServer() is now async (was sync), createLoreMcpServerAsync() removed. CLI and standalone entry points updated to await.
  • buildToolModulesSync() and 14 eager tool imports in server.ts — removed; single source of truth in tool-registry.ts
  • ENRICHMENT_SCHEMA_MIGRATIONS array (44 entries) + ensureEnrichmentSchema() + hasTableColumn() — DDL already defines all columns inline; is_exported column added to DDL, enrichment indexes added to DDL
  • Runtime table existence checkshasSymbolMetricsTable(), hasExternalSymbolsTable(), getTableColumns(), externalSymbolSelectColumns() removed; queries now always join symbol_metrics and use hardcoded column list for external_symbols
  • Defensive try-catch blocks in listCommitRefs, listCommitsByRef, listCommitsBySemanticQuery, listCommitBranchActivity — real errors now surface
  • Legacy database migration test removed (no longer applicable)

Code duplication fixed

  • EXT_TO_LANG in scip-indexer.ts (missing 10 languages!) now imports from walker.ts
  • SCIP flush logic (~50 lines duplicated in both FilePoller and FileWatcher) extracted to shared ScipFlushManager class
  • extractReturnType()lsp/enrichment.ts now imports from scip/index-reader.ts instead of maintaining an identical copy

Testing

All 1857 tests pass (69 skipped as expected). Test schemas updated to match the consolidated DDL.

…shims, and code duplication

Dead code removed:
- Config entry stubs (listConfigEntries, 3 interfaces) — no backing DDL
- BenchmarkRunner class — never instantiated
- Deprecated task constants (LORE_SELF_TASKS, GSON_TASKS, POSTGRES_TASKS)
- toSlug() in docs.ts — never called
- 7 dead tool refs in benchmark script (coverage, routes, notes, etc.)
- Deprecated parseAndExtract() helper — replaced by parseAndExtractStrict()

Backward-compat shims removed:
- Dual sync/async MCP server — consolidated to single async createLoreMcpServer()
- buildToolModulesSync() and 14 eager tool imports — removed
- ENRICHMENT_SCHEMA_MIGRATIONS + ensureEnrichmentSchema() — DDL already has all columns
- hasSymbolMetricsTable/hasExternalSymbolsTable/hasTableColumn/getTableColumns/
  externalSymbolSelectColumns — tables always exist
- Defensive try-catch blocks in 4 commit query functions — let re- Defensive try-catch blocks in 4 commit query functions — let re- Defensive try-catch blocks in 4 commit query functions âdexer.ts — now imports fr- Defensives (fixes- Defensive try-catch blocks in 4 commit query functions — let re- Defan- Defensive try-catch blocks in 4 commit querr
- Defensive try-catch blocks in 4 commit query functions — let re-dex-reader.ts

All 1857 tests pass.
@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 93.87755% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.49%. Comparing base (1fbefb6) to head (56fd5d1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/db/read-only.ts 85.71% 1 Missing ⚠️
src/discovery/scip-flush.ts 96.42% 1 Missing ⚠️
src/server/server.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #215      +/-   ##
==========================================
- Coverage   87.54%   87.49%   -0.06%     
==========================================
  Files          84       85       +1     
  Lines        9579     9475     -104     
  Branches     2958     2932      -26     
==========================================
- Hits         8386     8290      -96     
+ Misses       1193     1185       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jafreck jafreck merged commit 5ac2735 into main Mar 15, 2026
1 check passed
@jafreck jafreck mentioned this pull request Mar 15, 2026
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