/** * Doctor health checks - ported from lib/validation/doctor-checks.sh * * Global health check functions: CLI installation, version, docs accessibility, * agent configs, registered projects, injection files, and aliases. * * @task T4525 * @epic T4454 */ import type { CheckResult } from '@cleocode/contracts/scaffold-diagnostics'; export type { CheckResult, CheckStatus, } from '@cleocode/contracts/scaffold-diagnostics'; /** @task T4525 */ export declare function checkCliInstallation(cleoHome?: string): CheckResult; /** @task T4525 */ export declare function checkCliVersion(cleoHome?: string): CheckResult; /** @task T4525 */ export declare function checkDocsAccessibility(cleoHome?: string): CheckResult; /** @task T4525 */ export declare function checkAtReferenceResolution(): CheckResult; /** * Check that AGENTS.md exists in project root and contains the CAAMP:START marker, * indicating it serves as the injection hub for CLEO protocol content. */ export declare function checkAgentsMdHub(projectRoot?: string): CheckResult; /** * Check if project root .gitignore is blocking the entire .cleo/ directory. * This prevents core CLEO data from being tracked by git. * @task T4641 * @epic T4637 */ export declare function checkRootGitignore(projectRoot?: string): CheckResult; /** * Check if .cleo/.gitignore exists and matches the template. * @task T4700 */ export declare function checkCleoGitignore(projectRoot?: string): CheckResult; /** * Check that vital CLEO configuration files are tracked by git. * Only checks config files (config.json, .gitignore, project-info.json, * project-context.json). SQLite databases are excluded per ADR-013. * @task T4700 */ export declare function checkVitalFilesTracked(projectRoot?: string): CheckResult; /** * Check that core CLEO files are not being ignored by .gitignore. * Uses `git check-ignore` to detect files that would be excluded by * any gitignore rule (root, .cleo/, or global). * Returns critical status if any protected file is gitignored. */ export declare function checkCoreFilesNotIgnored(projectRoot?: string): CheckResult; /** * Check that SQLite databases (.cleo/tasks.db) are NOT tracked by project git. * Tracked SQLite files cause data loss from merge conflicts (ADR-013). * Warns if tasks.db is currently tracked so the user can untrack it. * @task T5160 */ export declare function checkSqliteNotTracked(projectRoot?: string): CheckResult; /** * Check if any legacy output directories still exist. * Delegates detection to the migration/agent-outputs utility. * @task T4700 */ export declare function checkLegacyAgentOutputs(projectRoot?: string): CheckResult; /** * Validate that artifacts are at canonical RCASD paths per ADR-045. * Detects drift: deprecated flat dirs, misplaced agent outputs, etc. * * @task T708 (scaffolding path drift validator) */ export declare function checkCanonicalRcasdPaths(projectRoot?: string): CheckResult; /** * Verify balanced CAAMP:START/END markers in CLAUDE.md and AGENTS.md. * @task T5153 */ export declare function checkCaampMarkerIntegrity(projectRoot?: string): CheckResult; /** * Parse @ references from AGENTS.md CAAMP block and verify each target file exists. * @task T5153 */ export declare function checkAtReferenceTargetExists(projectRoot?: string): CheckResult; /** * Compare templates/CLEO-INJECTION.md vs the XDG-canonical deployed path. * @task T5153 */ export declare function checkTemplateFreshness(projectRoot?: string): CheckResult; /** * Verify all 3 tier markers exist with matching close tags in deployed template. * @task T5153 */ export declare function checkTierMarkersPresent(): CheckResult; /** * Check that Node.js meets the minimum required version. * Provides OS-specific upgrade instructions when below minimum. */ export declare function checkNodeVersion(): CheckResult; /** * Check that global schemas at ~/.cleo/schemas/ are installed and not stale. * Delegates to checkGlobalSchemas() from schema-management.ts. * * The projectRoot parameter exists for API consistency with other check * functions in runAllGlobalChecks(), but global schemas live at ~/.cleo/schemas/ * (not per-project). The parameter is intentionally unused because schema * health is a system-wide concern, not project-scoped. */ export declare function checkGlobalSchemaHealth(_projectRoot?: string): CheckResult; /** * Warn if deprecated .cleo/schemas/ directory still exists in the project. * Schemas should live in ~/.cleo/schemas/ (global), not in project directories. */ export declare function checkNoLocalSchemas(projectRoot?: string): CheckResult; /** * Audit orphaned CLEO agent worktree directories. * * Lists all directories under `~/.local/share/cleo/worktrees/` (or the * XDG-resolved equivalent) whose names are NOT in the provided * `activeTaskIds` set. Surfaces them as a `warning` so the operator can * clean them with `cleo gc --worktrees`. * * @param worktreesRoot - Override for the worktrees root (testing). * @param activeTaskIds - Set of currently active task IDs to preserve. * @returns CheckResult with orphan paths in `details.orphans`. * * @task T9043 */ export declare function auditOrphanWorktrees(worktreesRoot?: string, activeTaskIds?: Set): CheckResult; /** * Audit orphaned CLEO-generated temp directories. * * Scans `os.tmpdir()` for directories matching any prefix in * `CLEO_TEMP_PREFIXES` that are older than 2 hours (the default orphan * threshold). Surfaces them as a `warning` so the operator can clean them * with `cleo gc --temp`. * * @param tempDirOverride - Override for os.tmpdir() (testing). * @param maxAgeMs - Maximum age threshold in ms (default: 2 hours). * @returns CheckResult with orphan paths in `details.orphans`. * * @task T9043 */ export declare function auditOrphanTempDirs(tempDirOverride?: string, maxAgeMs?: number): Promise; /** * Check that active JSON files (config.json, project-info.json, etc.) are valid * against their schemas and have current schema versions. * * Maps JsonFileIntegrityResult[] from checkSchemaIntegrity() into CheckResult[], * then returns a single rolled-up CheckResult for the doctor summary. */ export declare function checkJsonSchemaIntegrity(projectDir: string): Promise; /** * Detect stranded legacy source DBs after an exodus cutover. * * Once a scope's exodus completion marker (`exodus-complete`) exists, every one * of the six legacy source DBs for that scope SHOULD have been archived into the * scope's `_archive/` directory. A source still present on disk is "stranded * residue" โ€” it re-arms the `tasks_tasks=0` auto-recover / exodus-on-open * corruption trigger (DHQ-052 ยท T11662). This check surfaces that residue so it * can be archived via `cleo doctor exodus-residue --fix`. * * Read-only. Returns `'passed'` when no marker exists yet (a pre-cutover install * where the legacy DBs are still the live source of truth โ€” NOT residue) or when * every marked scope's sources have been archived. Returns `'warning'` when * residue is found (it is recoverable, never data-loss โ€” the fix only MOVES * files into `_archive/`). * * @param projectRoot - Project root used to resolve the project `.cleo/` dir. * @returns A {@link CheckResult} describing stranded residue (if any). * * @task T11777 */ export declare function checkExodusStrandedResidue(projectRoot?: string): Promise; /** * Run all global health checks and return results array. * @task T4525 */ export declare function runAllGlobalChecks(cleoHome?: string, projectRoot?: string): CheckResult[]; /** * Calculate overall status from check results. * Returns: 0=passed, 50=warning, 52=critical. * @task T4525 */ export declare function calculateHealthStatus(checks: CheckResult[]): number; //# sourceMappingURL=checks.d.ts.map