/**
 * Automation buffer pattern — file-driven, session-scoped, append-only sink
 * for lesson candidates captured during full-automation runs.
 *
 * Authoritative source: `docs/opensquid-real-design.md` §"Automation buffer
 * pattern" + §"Directory layout" + §"Four buffer categories" +
 * `project_opensquid_automation_buffer_pattern` (memory).
 *
 * The buffer resolves the conflict between full-automation throughput and
 * the wedge gate's capture-time validation requirement: during automation,
 * the agent dumps candidate lessons into one of four category subdirs and
 * appends a one-line index entry to `BUFFER.md`. At end-of-automation, the
 * user walks the buffer through the cycle (triage → validate → persist →
 * proceed) — nothing auto-promotes silently.
 *
 * Layout produced:
 *
 *   ~/.opensquid/sessions/<id>/pending-lessons/
 *     potential-lessons/   <ts>_<id>.md
 *     keep-as-context/     <ts>_<id>.md
 *     preferences/         <ts>_<id>.md
 *     new-rag-pointers/    <ts>_<id>.md
 *     BUFFER.md            ← chronological index, one bullet per write
 *
 * Atomic write: tmp + rename pattern. If the process crashes mid-write, the
 * `.tmp` file remains on disk (no partial reads), and the canonical filename
 * never appeared — so `walkBuffer` skips the half-written entry. BUFFER.md
 * is intentionally non-atomic (append-only) — its job is human-readable
 * progress, not source-of-truth. Source of truth is the per-entry file.
 *
 * Frontmatter parser: minimal regex-based, single-line string fields only.
 * No nesting, no dates, no anchors — `gray-matter` would be overkill (per
 * risk callout 1). The shape is locked at write-time, so the parser only
 * needs to handle what we ourselves emit. The `sourceContext` multiline
 * value uses YAML's `|-` block scalar (literal, strip-final-newline) with
 * two-space indentation — the parser strips the leading indent on read.
 *
 * Imports from: node:fs/promises, node:path, ./capture, ./types.
 * Imported by: src/runtime/wedge/index.ts, end-of-automation cycle UI.
 */
export type BufferCategory = 'potential-lessons' | 'keep-as-context' | 'preferences' | 'new-rag-pointers';
export interface BufferEntry {
    id: string;
    category: BufferCategory;
    body: string;
    frontmatter: {
        timestamp: string;
        proposedCategory: string;
        sourceContext: string;
        confidence: number;
    };
}
export declare function bufferDir(sessionId: string): string;
export declare function appendBufferEntry(sessionId: string, entry: BufferEntry): Promise<string>;
export declare function walkBuffer(sessionId: string): AsyncGenerator<BufferEntry>;
//# sourceMappingURL=automation_buffer.d.ts.map