import type { LedgerRecord } from '../core/record.js'; import type { Checkpoint } from '../checkpoint/checkpoints.js'; import type { ExecFn } from '../util/exec.js'; /** * Scope verification compares three views of "what changed": * * declared scope (meta) — what the agent was ALLOWED to touch * ledger claims — what the agent SAID it touched * git ground truth — what ACTUALLY changed on disk * * The interesting findings are the disagreements: actual changes never * claimed in the ledger (out-of-band writes), and changes outside the * declared scope (drift). */ export interface ScopeReport { readonly groundTruth: 'git' | 'unavailable'; readonly claimedPaths: readonly string[]; readonly actualPaths: readonly string[]; readonly unclaimed: readonly string[]; readonly outOfScope: readonly string[]; readonly scopePatterns: readonly string[]; /** 0..1 share of actual changes inside declared scope; undefined without scope or changes. */ readonly inScopeRatio?: number; } export declare function analyzeScope(records: readonly LedgerRecord[], scopePatterns: readonly string[], projectRoot: string, firstCheckpoint?: Checkpoint, exec?: ExecFn): ScopeReport; /** * Paths the ledger says were touched via structured edit tools. Harnesses * send ABSOLUTE file paths while git speaks repo-relative — without * relativizing, every claim misses its actual counterpart and legitimate * edits get flagged as out-of-band writes (found by the first recorded * self-run). Absolute paths outside the project root are kept verbatim: * an out-of-repo write should look exactly as alien as it is. */ export declare function collectClaimedPaths(records: readonly LedgerRecord[], projectRoot?: string): readonly string[];