/**
 * Drift catalog — automated SessionEnd scan that surfaces this session's
 * drift signals (0.7.22 / drift D10).
 *
 * D10 in the catalog: previously the agent only catalogued its drifts
 * AFTER the user prompted "please put in all the drifting issues found
 * recently." The whole project is anti-drift; the agent should be
 * cataloguing its own drifts continuously as the dogfood proof.
 *
 * This module scans the session's JSONL transcript at SessionEnd for
 * three classes of drift markers:
 *
 *   1. User-correction phrases in user messages ("you drifted",
 *      "stop X-ing", "no not that", "wrong")
 *   2. Locked-rule citations in user OR assistant messages
 *      (feedback_*, mem-*, drift D\d+)
 *   3. Agent mea-culpa phrases in assistant messages ("I should
 *      have", "my mistake", "I drifted", "I false-stopped")
 *
 * Hits are appended to `<dataRoot>/projects/<uuid>/drift-catalog.jsonl`.
 * One JSON record per line: `{timestamp, session_id, kind, evidence}`.
 *
 * If the project UUID can't be resolved (no `.opensquid/project.json`
 * card in any ancestor of cwd), entries fall back to
 * `<dataRoot>/sessions/<session_id>/drift-catalog.jsonl` so the data
 * isn't lost.
 *
 * Fail-open: any error (missing transcript, bad JSONL, write failure)
 * is swallowed with a stderr warning. SessionEnd is cleanup, not
 * blocking.
 */
export type DriftMarkerKind = "user_correction" | "rule_citation" | "mea_culpa";
export interface DriftCatalogEntry {
    /** ISO timestamp the entry was recorded. */
    timestamp: string;
    /** Claude Code session id. */
    session_id: string;
    /** Which class of marker fired. */
    kind: DriftMarkerKind;
    /** The matched substring (capped at 200 chars). */
    evidence: string;
    /** Optional surrounding context (up to 200 chars on either side). */
    context?: string;
}
/**
 * Scan a transcript and return all detected drift markers. Pure
 * function; exported for direct testing.
 */
export declare function scanTranscriptForDrift(lines: string[], sessionId: string, now?: () => Date): DriftCatalogEntry[];
/**
 * Run the SessionEnd drift-catalog scan + persist results. Returns
 * the number of entries written (0 if nothing matched OR write failed).
 */
export declare function runDriftCatalogScan(input: {
    sessionId: string;
    transcriptPath?: string;
    cwd?: string;
    dataRoot?: string;
    now?: () => Date;
}): Promise<number>;
/**
 * Decide where to write the catalog: project-scoped if we can resolve
 * a project UUID from cwd; session-scoped fallback otherwise.
 *
 * Exported for testing.
 */
export declare function resolveCatalogPath(cwd: string | undefined, sessionId: string, dataRoot?: string): Promise<string>;
//# sourceMappingURL=drift-catalog.d.ts.map