Skip to content

CI unused-exports dead-code lane is silently broken; no symbol-level dead-code enforcement #105575

Description

@steipete

Bug type

Behavior bug (incorrect output/state without crash surfaced)

What happened

The CI check-dependencies shard's advisory unused-exports report has been silently broken, so OpenClaw has zero symbol-level dead-code detection:

  • pnpm deadcode:ts-unused (ts-unused-exports@11) crashes on startup: pnpm dlx resolves the latest [email protected] peer, which is incompatible (TypeError: Cannot read properties of undefined (reading 'Unknown') in lib/parser/blacklists.js). CI pipes it through || true into the deadcode-reports artifact, so the artifact is just a stack trace and nothing fails.
  • pnpm deadcode:ts-prune uses ts-prune, which is archived upstream (author recommends knip).

Meanwhile knip (already pinned at 6.8.0 with a curated config/knip.config.ts, enforced for unused files + dependencies) is never run with export detection. A production-mode run with --include exports,types,enumMembers on current main reports ~1,506 unused exports and ~1,053 unused exported types across ~2.4M non-test TS LOC.

Evidence

  • deadcode-reports artifact from main CI run 29202053366 contains only the ts-unused-exports crash stack trace.
  • Local knip 6.8.0 production scan (--include exports,types,enumMembers) near main e8f8738aae7: Unused exports (1506), Unused exported types (1053).
  • package.json deadcode:* scripts; .github/workflows/ci.yml dependencies case; docs/ci.md "check-dependencies shard" section.

Expected behavior

Unused-export detection should work and be enforced the same way unused files already are (scripts/check-deadcode-unused-files.mjs allowlist ratchet): a checked-in baseline of pre-existing findings that can only shrink, with CI failing on new unused exports and on stale baseline entries.

Proposed fix

  • Remove the dead deadcode:ts-prune / deadcode:ts-unused lanes and their advisory CI artifact plumbing.
  • Add scripts/check-deadcode-exports.mjs: knip production --include exports,types,enumMembers scan compared against a checked-in baseline (ratchet semantics, --update regeneration), enforced in the check-dependencies CI shard.
  • Burning down the ~2.5k baseline entries is follow-up work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingclawsweeper:current-main-reproClawSweeper found a high-confidence current-main issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦀 challenger crabExceptional issue quality: high-confidence current-main reproduction and actionable evidence.maintainerMaintainer-authored PR

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions