/** * Dry-run transactions. Runs the tx body to STAGE ops, then builds * the directly-affected diff (before = current committed via collection.get, * after = staged record) and collects guard violations — without executing * phase 2. No adapter writes, no write-hooks, no commit. MV/derivation * cascade is NOT simulated (v2). Mirrors the guard loop in * `Collection._putInternal` — keep the two in sync. */ import type { Noydb } from '../../kernel/noydb.js'; import { TxContext } from './transaction.js'; export interface AffectedDocument { readonly vault: string; readonly op: 'create' | 'update' | 'delete'; readonly collection: string; readonly docId: string; readonly before: unknown; readonly after: unknown; } export interface GuardViolation { readonly vault: string; readonly collection: string; readonly docId: string; readonly message: string; } export interface DryRunResult { readonly affected: ReadonlyArray; readonly guardViolations: ReadonlyArray; } export declare function runDryRun(db: Noydb, fn: (tx: TxContext) => unknown): Promise;