/** * v2.15.0 follow-up — G8: legacy code detector. * * 12 Gaps memory: when peaks-loop is applied to a 存量老项目 (legacy * codebase), it is helpful to surface a quick inventory of "what * smells old" so the LLM / operator knows where to focus. * * Heuristics (intentionally light, since the user is Senior FE and * the AI is the integrator): * - TODO / FIXME / HACK comments * - console.log calls (debug leftover) * - any-type TypeScript annotations (`as any`, `: any`) * - large files (> 500 lines) * - ts-ignore / @ts-expect-error (suppressed type errors) * * Pure function. No I/O. The CLI is `peaks legacy detect`. */ export type LegacyKind = 'todo' | 'console-log' | 'any-type' | 'large-file' | 'ts-ignore' | 'fixme' | 'hack'; export interface LegacyFinding { readonly kind: LegacyKind; readonly file: string; /** Line number, or null when the finding is file-level (e.g. large-file). */ readonly line: number | null; /** A short excerpt of the offending line. */ readonly excerpt: string; } export interface LegacyReport { readonly projectRoot: string; readonly scannedFiles: number; readonly findings: readonly LegacyFinding[]; readonly summary: Record; readonly smells: 'low' | 'medium' | 'high'; } export declare function detectLegacy(projectRoot: string, dir?: string): LegacyReport;