Skip to content

refactor(lane): remove dead lane-classification code#522

Merged
joryirving merged 1 commit into
mainfrom
refactor/remove-dead-lane-code
Jul 2, 2026
Merged

refactor(lane): remove dead lane-classification code#522
joryirving merged 1 commit into
mainfrom
refactor/remove-dead-lane-code

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

  • Delete buildLaneClassificationPrompt and serializeLaneData from src/lib/issue-lane.ts — both were referenced only by their own tests, never in production. The prompt builder also duplicated src/lib/groomer/llm.ts (drift risk). Remove them + their tests + the now-unused lane-config imports.

Scope notes

  • classifyLaneFromSignals (and its "normal" fallback) is live (used by issue-lane, issue-reconciliation) and covered by tests — left untouched.
  • The /api/issues/[issueId]/lane route 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; vitest issue-lane + lane-config + issue-reconciliation + /lane route → 193 passing.

Closes #507 · part of #498

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.

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and classifyByHeuristics which are live production code

src/lib/issue-lane.test.ts (-93 lines)

  • Removes all tests for the two deleted functions (buildLaneClassificationPrompt and serializeLaneData)
  • 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:

  • buildLaneClassificationPrompt and serializeLaneData as dead code (only referenced by their own tests) ✅
  • Duplicate of src/lib/groomer/llm.ts creating drift risk ✅
  • Fix: delete dead exports + their tests ✅

The PR correctly:

  • Removes both dead functions
  • Removes their tests
  • Preserves classifyLaneFromSignals (the live classifier used by issue-lane.ts and issue-reconciliation)
  • Preserves the /lane route'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 matches
  • serializeLaneData → 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.

@joryirving joryirving merged commit f6a34bf into main Jul 2, 2026
6 checks passed
@joryirving joryirving deleted the refactor/remove-dead-lane-code branch July 2, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(lane): remove dead lane-classification code + resolve /lane duplication

1 participant