Skip to content

cleanup: dead-code inventory — 12 unreferenced symbols, 18 unnecessary exports, 1 orphan script #310

Description

@JonasJesus42

Audit of what bun run deadcode (knip) reports, classified — the raw output mixes three very
different things and only one of them is actually dead.

Measured by counting references to each symbol in the file that defines it: one occurrence means it
is defined and never called anywhere; more than one means it is used in-module and the export is
what is unnecessary.

1. Defined and never called — 12 symbols

symbol file note
buildFastStoreNextTheme migrate/targets/faststore-next.ts behaviour gap — filed separately as #309
ALL_REPORT_SECTIONS report/extract-section.ts looks like it was meant to validate --section. Today an invalid name reaches the extractor and comes back as section "naoexiste" not present in this report — which reads like the section is missing from this run rather than not existing at all
promptForSelector engine/interactive-selector-prompt.ts a whole interactive prompt, never wired. Feature that was built and never connected, or superseded by LLM selector discovery?
providerName, getLlmLanguage llm/client.ts providerLabel is the one that gets used
LLM_MODEL_ANTHROPIC, LLM_MODEL_OPENROUTER llm/client.ts superseded by llm/models.ts
isComponentRefineLlmAvailable llm/component-refine.ts sibling isComponentDetectionLlmAvailable is used
PLP_STEP_LABELS, SPA_NAVIGATION_CRITICAL_STEPS checks/lib/step-names.ts
pageRoleHint checks/lib/pairing.ts
__TEST__ llm/resolve-search-terms.ts test hook nothing imports

2. Used in-module, export unnecessary — 18 symbols

fetchLlmsTxtQuality, classifyAll, fetchDecoPages, USER_AGENT_BY_VIEWPORT,
extractAgentA11y, SEVERITY_WEIGHTS, DECAY_K, effectiveRate, SelectorCacheEntrySchema,
ALL_FEATURES, PREMIUM_FEATURE_TIER, nodeFetchText, findPage, SOURCES, SOURCE_BY_KIND,
TARGETS, buildWaterfallRows, formatMs.

Not dead — dropping the keyword is a one-line change each. Caveat worth deciding before touching
these:
@decocms/parity is a published package, so an export may be someone's public API even
with no in-repo consumer. Since dist/cli.js is a bundle and the package has no library entry
point in exports, I believe none of these are reachable by a consumer — but that is worth
confirming rather than assuming.

findPage is mine, from #294. Happy to unexport it.

3. Also flagged

  • scripts/regen-report.ts — reported as an unused file. It is a maintainer utility run by
    hand (bun run scripts/regen-report.ts), which knip cannot see. Either add it to knip's entry
    patterns or drop it if parity report --deck/serve covered its purpose.
  • @types/diff — unused devDependency. diff ships its own types now.
  • 34 unused exported types — same in-module-vs-public question as section 2, lower stakes.

Suggested split

Not doing any of it blind: deleting something that turns out to be a half-finished feature is worse
than leaving it, which is why the list is split by why it is unreferenced instead of just being a
list.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpriority:P3Design refresh

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions