import type { SqliteConnection } from '../sqlite-connection.js'; import { type DiagnosticianOutputV1 } from '../../diagnostician-output.js'; export interface DiagnosticianCommitter { /** * Atomically commit a DiagnosticianOutputV1 to the artifact registry. * * @param input.runId - the run producing this output * @param input.taskId - the task being diagnosed * @param input.output - the DiagnosticianOutputV1 to persist * @param input.idempotencyKey - client-supplied key for deduplication * * @returns CommitResult with commitId, artifactId, candidateCount * * @throws PDRuntimeError{input_invalid} if output fails schema validation * @throws PDRuntimeError{artifact_commit_failed} on non-idempotency SQL errors * * Idempotency: re-commits with the same runId or idempotencyKey return the * existing commit result without error. */ commit(input: CommitInput): Promise; } export interface CommitInput { runId: string; taskId: string; output: DiagnosticianOutputV1; idempotencyKey: string; /** * Optional pre-built `contentJson` for the committed artifact. When omitted, * the committer serializes `output` itself (current behavior, shared with * the legacy monolithic diagnostician). * * Used by Layer 0 of the internalization progressive disclosure (design * §6.1, PR 1 task 3.11): the split diag-router runner builds an * ArtifactSummary envelope and passes the resulting JSON string here so the * committed principle artifact carries the same `summary` / * `predecessorSummary` fields every other SummaryRunnerKind writer attaches. * rc-9: when the runner's envelope build degrades it simply omits this * field and the committer falls back to `JSON.stringify(output)` — never * silent. */ readonly contentJson?: string; } export interface CommitResult { commitId: string; artifactId: string; candidateCount: number; } export declare class SqliteDiagnosticianCommitter implements DiagnosticianCommitter { private readonly connection; constructor(connection: SqliteConnection); commit(input: CommitInput): Promise; /** * Attempt to return an existing CommitResult when UNIQUE constraint is violated. * Returns null if no existing commit found (re-throw original error). */ private static tryGetExistingCommit; /** * Extract SQLite constraint name from an error object. */ private static extractConstraint; } //# sourceMappingURL=diagnostician-committer.d.ts.map