/** * Ticket intake outcome log (#828 coverage). * * One JSON line per owner message intake handled — created, appended to an * existing ticket, or ignored (with the reason) — so a receipt can say how * much of what the owner said it covers, instead of looking complete while * showing half (team norm: a check reports what it examined). * * The first line of the file is a `start` marker. A window that begins before * it cannot be counted, and the reader says so (`startedAt` later than the * window) rather than returning zeros. * * Append-only, best effort: a failed write is logged and never blocks intake. * * @module services/v3/ticket-intake-log */ /** What intake did with one owner message. */ export type IntakeLoggedAction = 'created' | 'appended' | 'ignored'; /** One logged owner message. */ export interface IntakeLogEvent { /** When intake handled it (ISO) */ at: string; /** Message ref (dedupe key) */ ref: string; action: IntakeLoggedAction; /** Why it was ignored (`trivial_or_short`, `status_ping`, …) */ reason?: string; /** The ticket it created or went into */ ticketId?: string; /** That ticket's number, for display */ ticketNumber?: number; /** * Appended messages only: the ask classifier saw request signals in it * (ask score > 0) even though it stayed under the new-ask threshold. */ askSignal?: boolean; /** Appended with askSignal only: the owner's words, shortened and redacted */ text?: string; } /** What {@link IntakeOutcomeLog.read} returns. */ export interface IntakeLogReading { /** When counting started, or null when the log does not exist yet */ startedAt: string | null; events: IntakeLogEvent[]; } /** Records and reads intake outcomes. */ export interface IntakeOutcomeRecorder { record(event: IntakeLogEvent): Promise; read(): Promise; } /** File-backed log (JSON lines). */ export declare class IntakeOutcomeLog implements IntakeOutcomeRecorder { private readonly now; private readonly file; private chain; /** * @param dir - Directory (the Request files' directory) * @param now - Clock, for the start marker */ constructor(dir: string, now?: () => Date); /** * Append one event (serialised; the start marker is written first on a new file). * * @param event - The event */ record(event: IntakeLogEvent): Promise; /** * Read the log. Malformed lines are skipped. * * @returns Start time and events */ read(): Promise; } /** In-memory recorder (tests, replays). */ export declare class MemoryIntakeOutcomeLog implements IntakeOutcomeRecorder { startedAt: string | null; readonly events: IntakeLogEvent[]; /** * @param startedAt - When counting started (null = never) */ constructor(startedAt: string | null); /** @param event - The event */ record(event: IntakeLogEvent): Promise; /** @returns Start time and events */ read(): Promise; } //# sourceMappingURL=ticket-intake-log.d.ts.map