/** * Test runs the agent made, and the symbols it edited after the last one * (change: add-session-ledger-runs-contracts-tokens, first requirement). * * The after-tools hook sees each shell command the harness ran. A command that is a test run — a * runner from a closed list, or a test script the repository declares in `package.json` or a * Makefile — is recorded with its time and exit status (when the payload carries one), together * with the content hash of every symbol in the files this session edited. At stop, the symbols whose * hash changed since that run (or that are new) are named, with the tests that reach them. * * OpenLore runs no test. When no shell command ever reached the hook, test runs are not observed and * the fact is withheld with that reason, never stated as "nothing ran". One small JSON record per * harness session, beside the other hook records; writes merge with a concurrent hook's. */ export interface TestRun { at: number; command: string; exit?: number; interrupted?: boolean; } interface RunState { /** Shell commands seen by the after-tools hook this session (0 ⇒ test runs are not observed). */ shellSeen: number; /** Files this session edited (root-relative). */ editedFiles: string[]; runs: TestRun[]; /** At the last run: file → symbol id → { name, hash }. */ atLastRun: Record>; } export declare function readRunState(root: string, sessionId: string): RunState; /** Whether a shell command is a test run. */ export declare function isTestCommand(root: string, command: string): boolean; /** * After-tools, for a shell command: count it, and record it when it is a test run. An interrupted * run is recorded as interrupted and does not move the "last run" the stop fact compares with. */ export declare function recordShellCommand(root: string, sessionId: string, command: string, exit?: number, interrupted?: boolean): Promise; /** * Before-edit: a file first edited after the last run keeps its pre-edit symbols as the run saw * them. After-tools: the edit is recorded. */ export declare function recordEditIntent(root: string, sessionId: string, files: readonly string[]): Promise; export declare function recordEdits(root: string, sessionId: string, files: readonly string[]): Promise; export interface EditsAfterRun { kind: 'not-observed' | 'no-run' | 'after-run' | 'clean'; lastRun?: TestRun; /** Symbols edited after the last run (kind `after-run`); `removed` when the symbol is gone. */ symbols?: Array<{ name: string; file: string; removed?: boolean; }>; /** Files edited after the last run whose symbols at the run were not recorded. */ undetermined?: string[]; /** Files edited this session (kind `no-run`). */ files?: string[]; /** Test runs after the last completed one that were interrupted. */ interruptedSince?: number; } /** At stop: what was edited after the last observed, completed test run. */ export declare function editsAfterLastRun(root: string, sessionId: string): Promise; export {}; //# sourceMappingURL=test-run-ledger.d.ts.map