Skip to content

tech-debt I: Delete dead code: the per-section backward pipeline, legacy resync branch, and four dead types (~1,600 LOC) #166

Description

@mmcky

Determined by static analysis (knip + ts-prune) and verified by hand, not by grep intuition.

Delete by function name, not by line range. In backward-evaluator.ts the dead per-section path is buildEvaluationPrompt, parseEvaluationResponse, mockEvaluationResponse and evaluateSection — the last has zero callers anywhere and the other three are reachable only from it. Preserve validateCategory, parseSpecificChanges, sleep and buildSectionPairsBlock: all four sit among the dead functions but are called by the live whole-file path (parseFileEvaluationResponse at :516/:522, evaluateFile at :660, buildFileEvaluationPrompt at :413). buildSectionPairsBlock is the likeliest casualty — its name suggests it belongs to the per-section cluster and it does not. (Corrected 2026-07-24: the audit report's line ranges for this deletion were approximate at every boundary and carved out the wrong lines — see .dev/decisions/D-2026-07-24-tech-debt-audit-boundaries.md.) Likewise translateSectionResync (translator.ts:230) is a live sync-mode path and must not be swept into the legacy-resync deletion.

Expect the headline test count to drop ~2%. Run coverage before and after so the drop is provably optical.

Findings covered

10 audit findings land here. F<n> are stable references into the audit; rank is the report ordering (1 = act first of 139).

  • F45 · rank 54 · med · s/s — ~300 LOC of abandoned per-section backward evaluation, maintained as if live
  • F103 · rank 55 · med · s/s — The same cluster from the coverage angle: 262 of 665 LOC reachable only from its own test file
  • F46 · rank 56 · low · s/s — "Legacy section-by-section" forward-resync code, dead on arrival, never executed in any release
  • F104 · rank 57 · low · s/s — Its PR-body branch is dead too — nothing in the codebase constructs a ResyncSectionResult
  • F76 · rank 63 · low · t/t — Four exported types dead everywhere — delete them, skip the dead-code tooling
  • F105 · rank 64 · low · t/t — The same four, zero references, same line numbers at v0.23.0
  • F75 · rank 65 · low · t/t — ink-testing-library — declared, unreferenced, advertising a capability the CJS config cannot provide
  • F99 · rank 66 · low · t/t — The same dependency, zero imports anywhere
  • F106 · rank 67 · low · t/t — The same dependency; ReviewSession.tsx still has no render test (and is thin by design — see §6)
  • F115 · rank 72 · low · s/s — Six tests guarded on a gitignored reports/ fixture that exists on no machine — never run, cannot fail

Plan

Estimate 20h · Rebuilds dist-action/ yes · Wave 1, PR I

Dead code. F45 + F103 the backward per-section cluster (backward-evaluator.ts delete buildEvaluationPrompt, parseEvaluationResponse, mockEvaluationResponse, evaluateSection; preserve validateCategory, parseSpecificChanges, sleep, buildSectionPairsBlock — see above); F46 + F104 legacy resync; F76 + F105 four dead types; F75 + F99 + F106 ink-testing-library; F115 the .resync fixture, or delete the six tests


From the technical-debt audit of 2026-07-23 (141 candidates adversarially verified, re-validated against v0.23.0, 139 live). Effort is stopgap / full — t≈0.5h, s≈3.5h, m≈11h, L≈28h. Items marked ½ were partially addressed by v0.22.0/v0.23.0.

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

    maintenanceRoutine housekeeping: style, formatting, env & dependency upkeep

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions