Parent umbrella issue: #616
Source audit: Weekly tech debt audit: dispatch - 2026-07-15
Source audit date: 2026-07-15
Recommendation
Problem: src/lib/github.ts is 1049 lines spanning JWT auth, issue CRUD, PR queries, CI log fetching, code search, and repo metadata. One helper (fetchRepoJson) returns Promise<any>. Module bloat makes it hard to reason about, test in isolation, and change without risk.
Evidence:
src/lib/github.ts — 1049 lines
- Line 529:
async function fetchRepoJson(repoFullName: string, errorPrefix: string): Promise<any>
- Mixed responsibilities: auth setup (lines 14–100), issue fetch (lines 150–250), PR logic (lines 260–520), log fetching (lines 808–878), code search (lines 1006–1049)
Acceptance: Split into github-auth.ts, github-issues.ts, github-ci.ts, github-code-search.ts (or equivalent domain files). fetchRepoJson typed with Record<string, unknown> instead of any. Each new file under 400 lines.
Parent umbrella issue: #616
Source audit: Weekly tech debt audit: dispatch - 2026-07-15
Source audit date: 2026-07-15
Recommendation
Problem:
src/lib/github.tsis 1049 lines spanning JWT auth, issue CRUD, PR queries, CI log fetching, code search, and repo metadata. One helper (fetchRepoJson) returnsPromise<any>. Module bloat makes it hard to reason about, test in isolation, and change without risk.Evidence:
src/lib/github.ts— 1049 linesasync function fetchRepoJson(repoFullName: string, errorPrefix: string): Promise<any>Acceptance: Split into
github-auth.ts,github-issues.ts,github-ci.ts,github-code-search.ts(or equivalent domain files).fetchRepoJsontyped withRecord<string, unknown>instead ofany. Each new file under 400 lines.