/** * SqliteIntentDecisionStore — SQLite implementation of IntentDecisionStore. * * PRI-470 / SPEC §21.7 durable persistence for Owner decisions on * intentTension. Records are written to the `intent_decisions` table * (schema created by SqliteConnection.initSchema). * * Idempotency (SPEC §21.7 req 4): * - When `painId` is non-null: dedupe on (pain_id, intent_doc_hash, owner_action). * - When `painId` is null: dedupe on (task_id, intent_doc_hash, owner_action) * using the NULL-safe `IS` operator so a null intentDocHash compares equal. * * Snapshots (SPEC §21.7 audit boundary): * - source / evidenceStrength / relatedIntentFields / evidenceRefs are stored * twice: once in the live columns and once in the `_snapshot` columns. The * snapshot is the immutable audit copy; the live columns mirror it at write * time. This keeps the audit trail accurate even if a future migration or * artifact change alters the live columns. * * ERR checklist: * - EP-01 / ERR-001, ERR-005: DB rows treated as unknown, mapped via guards * - EP-03 / ERR-002: write failures throw (fail loud) * - EP-07 / ERR-015, ERR-018: idempotency SELECT reads fresh state each call */ import type { SqliteConnection } from '../sqlite-connection.js'; import type { IntentDecisionInput, IntentDecisionRecord, IntentDecisionRecordResult, IntentDecisionSummary, IntentDecisionStore, FollowUpPatch } from '../../intent/intent-decision-record.js'; export declare class SqliteIntentDecisionStore implements IntentDecisionStore { private readonly connection; constructor(connection: SqliteConnection); record(input: IntentDecisionInput): Promise; getById(id: string): Promise; listByPainId(painId: string): Promise; listByTaskId(taskId: string): Promise; getSummary(): Promise; /** * Update follow-up action fields on an existing record (PRI-471, SPEC §22.1.4). * * Only fields present in `patch` are written; absent fields are left unchanged. * Returns the updated record, or null if no record exists with the given id. * * ERR checklist: * - EP-01 / ERR-001: the patch fields are typed via the `FollowUpPatch` * interface; we still re-check string-ness before binding to defend * against a caller that constructed the patch from untrusted input. * - EP-03 / ERR-002: write failures throw (fail loud). * - EP-07 / ERR-015: re-reads the row after UPDATE so the returned record * reflects fresh DB state, not optimistic in-memory mutation. */ updateFollowUp(id: string, patch: FollowUpPatch): Promise; } //# sourceMappingURL=sqlite-intent-decision-store.d.ts.map