import type { RunState } from '../engine/types.js'; export type CommandCheckScope = 'build' | 'verify'; export interface RecordedCommandCheck { sequence: number; timestamp: string; runId: string; scope: CommandCheckScope; command: string; exitCode: number; cwd: string; provenance?: 'runtime'; argv?: string[]; timeoutMs?: number; inputBefore?: string; inputAfter?: string; /** Input paths whose contents changed during this execution. */ changedDuringExecution?: string[]; environment?: string; logRef?: string; logHash?: string; /** * Post-write stat of the evidence log. Revalidation trusts an unchanged * size+mtime instead of rereading the whole log; records without these * fields (or a changed stat) keep the full content-hash check. */ logSize?: number; logMtimeNs?: string; /** Repository-relative per-file input manifest recorded at execution time. */ manifestRef?: string; manifestHash?: string; /** Incremental evidence maintains validity inside a phase; only full evidence advances it. */ tier?: 'full' | 'incremental'; reusable?: boolean; reused?: boolean; checkEpoch?: number; } /** * The exact Runtime command identity persisted before snapshotting or launch. * A started event may be the only durable evidence left after interruption, so * it must contain enough data for `comet check rerun` to retry without guessing. */ export interface RecordedCommandCheckAttempt { sequence: number; timestamp: string; runId: string; scope: CommandCheckScope; argv: string[]; cwd: string; timeoutMs: number; reusable: boolean; tier: 'full' | 'incremental'; } export interface RecordCommandCheckInput { scope: CommandCheckScope; command: string; exitCode: number; cwd?: string; } export declare function recordCommandCheck(projectRoot: string, changeDir: string, run: RunState, input: RecordCommandCheckInput): Promise; export declare function latestCommandCheck(projectRoot: string, changeDir: string, run: RunState, scope: CommandCheckScope): Promise; /** Returns only an unfinished latest attempt; older executions remain fenced. */ export declare function latestInterruptedCommandCheck(projectRoot: string, changeDir: string, run: RunState, scope: CommandCheckScope): Promise; export declare function invalidateCommandChecks(changeDir: string, run: RunState): Promise; /** * Explains why no record is visible when a `command_check_started` event * without a completing event is the latest trajectory entry for the scope — * the attempt was interrupted (killed, timed out during snapshotting, or the * process died) and must not expose an older success. */ export declare function interruptedCommandCheckReason(changeDir: string, run: RunState, scope: CommandCheckScope): Promise; export declare function recoverCommandChecks(root: string, changeDir: string, run: RunState, options?: { persistInvalidation?: boolean; }): Promise>; export declare function executeCommandCheck(root: string, changeDir: string, run: RunState, input: { scope: CommandCheckScope; argv: string[]; cwd?: string; timeoutMs?: number; reusable?: boolean; tier?: 'full' | 'incremental'; }): Promise; export interface CommandCheckEvaluation { record: RecordedCommandCheck | null; /** Why the latest record is not reusable; absent when a record is usable or none exists. */ reason?: string; /** Added, removed and changed input paths relative to the recorded manifest. */ changedPaths?: string[]; /** The declared input scope that decided relevance for the changed paths. */ relevance?: string; /** * Neutral document paths that changed since execution while every material * input stayed identical; the record remains usable and these edits are * reported instead of silently dropped. */ documentChangesIgnored?: string[]; } export declare function evaluateCommandCheck(root: string, changeDir: string, run: RunState, scope: CommandCheckScope, inputFingerprint?: (argv: string[], cwd: string) => Promise): Promise; export declare function usableCommandCheck(root: string, changeDir: string, run: RunState, scope: CommandCheckScope, inputFingerprint?: (argv: string[], cwd: string) => Promise): Promise; export declare function consumeCommandCheck(changeDir: string, run: RunState, record: RecordedCommandCheck): Promise; //# sourceMappingURL=classic-command-checks.d.ts.map