/**
 * Honesty ledger — catches claim-vs-action gaps in assistant turns.
 *
 * The agent makes claims like "running tests now" or "starting research"
 * or "committed" in its text output. These claims are checkable against
 * the tool calls that actually happened in the same turn. When the
 * claim has no matching tool call, that's a "broken promise" — opensquid
 * records it so the next turn surfaces it to the agent for correction.
 *
 * Storage:
 *   <data-root>/sessions/<session-id>/turn-ledger.jsonl
 *     One JSON line per tool call this turn, appended by the PreToolUse
 *     hook. Cleared at turn-end after reconciliation.
 *
 *   <data-root>/sessions/<session-id>/broken-promises.jsonl
 *     Append-only ledger of claims that lacked matching evidence.
 *     Surfaced to the agent on the NEXT turn via SessionStart/
 *     UserPromptSubmit hook output.
 */
export type ClaimEvidenceShape = {
    kind: "any_tool";
} | {
    kind: "bash_contains";
    needle: string;
} | {
    kind: "bash_regex";
    pattern: string;
} | {
    kind: "tool_called";
    tool: string;
} | {
    kind: "any_of";
    options: ClaimEvidenceShape[];
} | {
    kind: "input_contains";
    tool: string;
    needle: string;
};
export interface ClaimPattern {
    /** Stable id (e.g. "research-start"). */
    id: string;
    /** Regex matched against assistant text. */
    text_regex: string;
    /** What proof of action satisfies this claim. */
    evidence: ClaimEvidenceShape;
    /** Short label surfaced to the agent when the promise is broken. */
    promise_label: string;
}
/**
 * Claim catalog — sourced from the bundled-default codex (0.7.17,
 * drift-as-codex chunk 3b). Previously a hand-maintained TS array;
 * now loaded once at module init from
 * `src/codex/bundled-default/codex.yaml` via the chunk-2 loader.
 *
 * Fail-open: if the codex is unloadable, the catalog is empty and
 * no claims fire. Better silent under-enforcement than a hook crash.
 */
export declare const CLAIM_PATTERNS: ClaimPattern[];
/**
 * One tool-call entry, persisted across ALL turns in the same Claude
 * Code session. Cleared only at session end (or explicit
 * `clearSessionLedger`).
 *
 * #114 (2026-05-15) — v0.4.C.1 fix: previously this was a PER-TURN
 * ledger that got cleared by the Stop hook, which caused recap text
 * describing prior-turn work to be flagged as broken promises. Now
 * the ledger accumulates across the whole session so claims like
 * "tests pass" satisfy against any `npm test` from any earlier turn
 * in the same session.
 */
export interface TurnLedgerEntry {
    ts: string;
    tool: string;
    /** Subset of tool_input relevant to reconciliation. */
    input_summary: string;
}
/** Called by PreToolUse hook to record what the agent is about to do. */
export declare function recordToolCall(sessionId: string, tool: string, inputSummary: string, options?: {
    dataRoot?: string;
}): Promise<void>;
/** Read the session-scoped ledger (every tool call so far this session). */
export declare function readTurnLedger(sessionId: string, options?: {
    dataRoot?: string;
}): Promise<TurnLedgerEntry[]>;
/**
 * Clear the session ledger. ONLY called at session end (or by tests).
 * Stop hook does NOT call this anymore — the ledger persists across
 * turns to avoid recap-text false-positives.
 */
export declare function clearTurnLedger(sessionId: string, options?: {
    dataRoot?: string;
}): Promise<void>;
/**
 * Explicit session-end clear: wipes everything opensquid wrote under
 * this session's directory — turn ledger, broken promises, plus the
 * heartbeat checkpoint and pending marker (#124). Files are removed
 * individually so unrelated files in the session dir survive (in case
 * a future hook drops something else there).
 */
export declare function clearSession(sessionId: string, options?: {
    dataRoot?: string;
}): Promise<void>;
export interface BrokenPromise {
    ts: string;
    claim_id: string;
    claim_label: string;
    matched_text: string;
    reason: string;
}
/**
 * Scan assistant text for claim phrases, reconcile against the ledger,
 * return any unfulfilled promises.
 */
export declare function reconcile(assistantText: string, ledger: TurnLedgerEntry[]): BrokenPromise[];
/** Append a broken promise to the session's append-only ledger. */
export declare function recordBrokenPromise(sessionId: string, promise: BrokenPromise, options?: {
    dataRoot?: string;
}): Promise<void>;
/** Read all broken promises for a session (used by next turn's hook). */
export declare function readBrokenPromises(sessionId: string, options?: {
    dataRoot?: string;
}): Promise<BrokenPromise[]>;
//# sourceMappingURL=honesty-ledger.d.ts.map