/** * Observability log writer for cohort observability per v0.6 Step * 6.2 / Q6.2.1 (JSONL format) + Q6.2.2 (observation shape lock at * Step 6.2 surface review). * * Writes newline-delimited JSON observations to local log file. * Append-only semantics; atomic single-line writes via * fs.appendFileSync. Log rotation deferred to v0.7+ pending size * empirical surface (cohort logs typically <10MB total per session). * * Per ADR-20 cohort observability contract: data collected = * MCP tool invocations + sanitized request args + response * shape; storage = local-only file at config.observability.logPath * (default .contextatlas/observe-log.jsonl); retention = cohort * exposure window + cycle-close synthesis. */ import type { SymbolKind } from "../types.js"; /** * Observation shape per Q6.2.2 lock + Refinement 1 * (contextatlas_version field). Recorded per MCP tool invocation; * one JSONL line per observation. */ export interface Observation { readonly timestamp: string; readonly contextatlas_version: string; readonly session_id: string; readonly tool: string; readonly request_args: unknown; readonly response: { readonly status: "success" | "error"; readonly latency_ms: number; readonly result_summary?: { readonly symbol_id?: string; readonly symbol_kind?: SymbolKind; readonly result_count?: number; }; readonly error_message?: string; }; } export declare function getSessionId(): string; /** * Reset cached session id — TEST-ONLY seam. Production code should * never call this; the session-id-stability invariant requires the * cache to persist across the process lifetime. */ export declare function resetSessionIdForTesting(): void; export interface ObservabilityWriterOptions { readonly logPath: string; readonly contextatlasVersion: string; } /** * Create an observability writer bound to a specific log path + * contextatlas version. Returned function appends one JSONL line * per call; ensures parent dir exists; surfaces actionable error * on write failure. */ export declare function createObservabilityWriter(options: ObservabilityWriterOptions): (observation: Omit) => void; //# sourceMappingURL=observe.d.ts.map