Files
omp-pygienium/tasks/09-check-dead-code.md

1.7 KiB

09. Dead code and obsolete paths check

meta: id: pygienium-09 feature: pygienium priority: P2 depends_on: [pygienium-06] tags: [check]

objective:

  • Implement the dead-code / obsolete-paths check: find unreferenced exports, dead files, obsolete compatibility shims, migration paths, and unused config; remove them (engineering rule: no backward-compat layers).

deliverables:

  • src/checks/dead-code.ts: CheckDefinition with scan + fix tasks
  • Rubric: unreferenced functions/exports, files with zero importers (cross-checked against the review graph), deprecated/compat shims, migration helpers, unused dependencies
  • /pygienium-dead-code runs E2E

steps:

  • Author buildScanTask: agent uses grep/import-graph + recon candidates to list dead code, writes pygienium/checks/dead-code/findings.md categorized by type
  • Author buildFixTask: remove clearly-dead items; list ambiguous ones (dynamic imports, runtime registration) for human review per pi-lens suspected-dead-weight semantics
  • Register the check

tests:

  • Integration: add an unused exported function + an obsolete compat wrapper; run --fix; assert both removed and changes.md lists them; assert a dynamically-imported shim is NOT auto-removed

acceptance_criteria:

  • findings.md categorizes dead code by type (export, file, shim, dep)
  • --fix removes clearly-dead items and preserves dynamic/runtime-registered ones with a review flag

validation:

  • Inspect pygienium/checks/dead-code/{findings.md,changes.md}

notes:

  • Cross-reference the project_report "suspected dead weight" semantics — single-importer/zero-importer files
  • Engineering rule mandates removing obsolete paths rather than leaving compat shims