/** * openlore doctor command * * Self-diagnostic tool that checks all prerequisites and surfaces actionable * fixes when something is misconfigured or missing. */ import { Command } from 'commander'; import type { GovernanceFinding } from '../../core/services/mcp-handlers/enforcement-policy.js'; type CheckStatus = 'ok' | 'warn' | 'fail'; /** * A machine-readable remediation for a check `--fix` can execute (change: * make-index-self-healing). Present ONLY on checks whose printed `fix:` hint maps * to a safe, in-process action, so `--fix` runs exactly what a check surfaced and * nothing more. Internal — stripped from `--json` so the read-only output contract * is byte-compatible. */ type Remediation = { kind: 'analyze'; label: string; } | { kind: 'rewire-mcp'; label: string; }; export interface CheckResult { name: string; status: CheckStatus; detail: string; fix?: string; remediation?: Remediation; findings?: GovernanceFinding[]; } /** Verify that an installed OpenLore gate is on Git's active, executable hook path. */ export declare function checkHookReachability(rootPath: string): Promise; /** * Diagnose instruction-shaped text at the human-review boundary. By default we * inspect locally recorded memory plus changed spec/decision files; already * reviewed corpus content is not re-litigated on every doctor run. */ export declare function checkServedContentTrust(rootPath: string, explicitFiles?: string[]): Promise; /** Validate the governance corpus as a closed typed graph. Read-only and offline. */ export declare function checkCorpusIntegrity(rootPath: string): Promise; /** * Corpus-size check (issue #504): walk exactly what `openlore analyze` would fingerprint * and compare its size with the byte budget, so a repository that would abort analyze * is caught here, with the paths to exclude, before anyone runs it. It costs one walk, * the same walk analyze starts with (which reads files up to 10 MB to count lines); it * does not hash content or read past the walk. */ export declare function checkAnalysisCorpus(rootPath: string): Promise; /** * Parse-health check (change: add-parse-health-boundary-disclosure): surface files that parsed with * errors (grammar drift, syntax errors, lossy encoding) so a degraded index isn't mistaken for a * genuinely small one. Absent artifact → clean (ok). A spike after a `tree-sitter-*` bump is the * signal this check exists to catch. * * Exclusions are read from the SAME record `analyze` reports from (change: * fix-analyze-native-abort-and-file-cost-budget), and via the same `describeExclusions` helper, so * this check cannot bless a repository whose analysis excluded files — the contradiction the * `EveryExcludedFileIsRecordedWithAReason` requirement exists to prevent. */ /** Exported for test: the exclusion-vs-degradation verdict must be pinned behaviorally. */ export declare function checkParseHealth(rootPath: string): Promise; /** * What retrieval this repository actually SERVES — read off the index, not off the * configuration and not off the endpoint. * * `Embedding connection` answers a different question ("can I reach the endpoint"), and * on 2026-09-20 it answered it correctly — `✓ … 384 dims · 1952ms` — while every query * in this repository and in a second one had been served from a vectorless index for * days. Two questions, two lines, two verdicts (spec `cli` * DoctorReportsTheRetrievalModeActuallyServed). */ export declare function checkRetrievalMode(rootPath: string): Promise; export declare const doctorCommand: Command; /** * The deduped set of remediations `--fix` will run: only non-ok checks that * surfaced a machine-readable remediation, each action at most once (two checks * may both print "re-analyze"). Pure and exported so the "fixes exactly what it * printed, nothing else" contract is unit-testable without executing anything. */ export declare function planRemediations(checks: CheckResult[]): Array<{ check: CheckResult; remediation: Remediation; }>; export {}; //# sourceMappingURL=doctor.d.ts.map