refactor(lane): remove dead lane-classification code#522
Conversation
buildLaneClassificationPrompt and serializeLaneData in issue-lane.ts were referenced only by their own tests — never in production. The prompt builder also duplicated src/lib/groomer/llm.ts and risked silent drift from it. Delete both (+ their tests) and drop the now-unused lane-config imports. The /lane route keeps its live classifier path (parseLaneClassification, validateLaneRecord, classifyByHeuristics) — the lightweight manual-override classification, distinct from the groomer's LLM path.
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — escalated (fast_low_confidence)
Recommendation: Approve
This PR removes dead code from src/lib/issue-lane.ts as specified in issue PR 507. The changes are safe, targeted, and verified.
Change-by-Change Findings
src/lib/issue-lane.ts (-76 lines)
- Removes
buildLaneClassificationPrompt()— a prompt builder function that was never called in production - Removes
serializeLaneData()— a JSON serialization helper that was never called in production - Removes unused lane-config imports (
getConfiguredLanes,getDefaultClaimableLane,getEscalationLane,getBacklogLane) - Keeps
classifyLaneFromSignals,parseLaneClassification,validateLaneRecord, andclassifyByHeuristicswhich are live production code
src/lib/issue-lane.test.ts (-93 lines)
- Removes all tests for the two deleted functions (
buildLaneClassificationPromptandserializeLaneData) - Retains all tests for live functions
Standards Compliance
✅ No agent-specific names in generic docs — The removed prompt builder contained generic routing rules. This is acceptable as the live classifyLaneFromSignals (backed by src/lib/groomer/llm.ts) handles production lane classification.
✅ Code Standards — Dead code removal reduces maintenance burden and drift risk. No errors introduced.
✅ No secrets or build artifacts — Clean removal only.
Linked Issue Fit
Issue PR 507 explicitly identified:
buildLaneClassificationPromptandserializeLaneDataas dead code (only referenced by their own tests) ✅- Duplicate of
src/lib/groomer/llm.tscreating drift risk ✅ - Fix: delete dead exports + their tests ✅
The PR correctly:
- Removes both dead functions
- Removes their tests
- Preserves
classifyLaneFromSignals(the live classifier used byissue-lane.tsandissue-reconciliation) - Preserves the
/laneroute's heuristic classifier path
Evidence Provider Findings
No evidence providers configured.
Tool Harness Findings
Tool grep searches confirmed zero production usages of both removed functions:
buildLaneClassificationPrompt→ 0 matchesserializeLaneData→ 0 matches- Both combined → 0 matches
This confirms these were genuinely dead exports.
CI Verification
All CI checks passed: Docker Build, Tests (193 passing), Build, Lint, Typecheck. All terminal, authoritative.
Unknowns / Needs Verification
None. The diff is clean, tests pass, grep confirms no remaining usages, and the PR body correctly scopes what was preserved.
Findings
None — all checks pass.
Summary
buildLaneClassificationPromptandserializeLaneDatafromsrc/lib/issue-lane.ts— both were referenced only by their own tests, never in production. The prompt builder also duplicatedsrc/lib/groomer/llm.ts(drift risk). Remove them + their tests + the now-unusedlane-configimports.Scope notes
classifyLaneFromSignals(and its"normal"fallback) is live (used by issue-lane, issue-reconciliation) and covered by tests — left untouched./api/issues/[issueId]/laneroute keeps its heuristic classifier path (parseLaneClassification/validateLaneRecord/classifyByHeuristics) — the lightweight manual-override classification, intentionally distinct from the groomer's LLM path.Verification
tsc→ 0;eslint→ clean;vitestissue-lane + lane-config + issue-reconciliation +/laneroute → 193 passing.Closes #507 · part of #498