Skip to content

Remove dead code: unused core exports + deprecated dagre layout#487

Open
caius72 wants to merge 1 commit into
Egonex-AI:mainfrom
caius72:chore/remove-dead-code
Open

Remove dead code: unused core exports + deprecated dagre layout#487
caius72 wants to merge 1 commit into
Egonex-AI:mainfrom
caius72:chore/remove-dead-code

Conversation

@caius72

@caius72 caius72 commented Jun 20, 2026

Copy link
Copy Markdown

Removes code with no callers anywhere in the repo (skills, dashboard, or each other). No behavior change; all builds, lint, and tests pass.

What's removed

Symbol Why dead
embedding-search.tsSemanticSearchEngine, cosineSimilarity Never instantiated. The only reference is a stale store.ts comment ("when embeddings are available, semantic mode will use SemanticSearchEngine"). Search uses Fuse.js via SearchEngine.
analyzer/language-lesson.tsbuildLanguageLessonPrompt, parseLanguageLessonResponse, detectLanguageConcepts Zero callers. The languageLesson schema field is populated by agent prompts, not these helpers — the field is untouched.
change-classifier.tsclassifyUpdate Only the core/src/index.ts barrel re-exported it.
layout.worker.ts + applyDagreLayout() in layout.ts Both @deprecated/unreferenced (structural views use ELK, knowledge graphs use d3-force). They are the only users of @dagrejs/dagre, so that dependency is dropped.

Deliberately kept

  • generateStarterIgnoreFile / ignore-generator.ts — live, called by skills/understand/generate-ignore.mjs.
  • ELK, d3-force, graphology-louvain — each still drives a live view.

Impact

12 files changed, +2 / −1008, −1 dependency (@dagrejs/dagre).

Verification

  • pnpm --filter @understand-anything/core build
  • pnpm --filter @understand-anything/dashboard build ✓ (no dagre chunk)
  • pnpm lint
  • pnpm test — 207/207 ✓
  • No dangling source references to removed symbols

Note: packages/dashboard/public/knowledge-graph.json (the sample graph) still describes the removed functions; it's a generated artifact, best regenerated via /understand rather than hand-edited, so it's left out of this PR.

Prune exported API surface that nothing in the repo (skills, dashboard)
consumes, plus the deprecated dagre layout path the dashboard no longer
uses:

- embedding-search.ts (SemanticSearchEngine/cosineSimilarity) —
  speculative, never instantiated; only a stale store.ts comment
  referenced it
- analyzer/language-lesson.ts (buildLanguageLessonPrompt and friends)
  — zero callers; the languageLesson schema field is filled by agent
  prompts, not this code, and is kept
- change-classifier.ts (classifyUpdate) — only the barrel re-exported it
- dashboard layout.worker.ts and applyDagreLayout() — both @deprecated/
  unreferenced and the sole users of @dagrejs/dagre, which is dropped

generateStarterIgnoreFile / ignore-generator.ts is kept — it is live,
called by skills/understand/generate-ignore.mjs. ELK, d3-force and
graphology-louvain are also retained; each still drives a live view.

Build (core + dashboard), lint, and all tests pass.
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