import type { Collection } from '../../kernel/collection.js'; import type { ReadOnlyVaultFacade } from '../../with-audit/guards/types.js'; import type { TxContext } from '../../with-commit/tx/transaction.js'; import type { DerivationRegistry } from './registry.js'; import type { DerivationStrategy } from './types.js'; /** * Accessor shape passed through from the owning Vault. Provides the * registry (used to look up strategies and as the WeakMap key) and a * resolver from collection name to the live `Collection` instance. * Same shape as `Collection.derivationSource` so callers can pass it * through directly. */ export interface DerivationStaleAccessor { registry(): DerivationRegistry; getCollection(name: string): Collection; /** * Read-only vault facade handed to `derive(source, ctx)` on the lazy * resolve-on-read path. Same instance/shape as the eager path uses. */ getReadOnlyFacade(): ReadOnlyVaultFacade; /** * Active multi-record TxContext or `null`. The lazy resolve-on-read * path uses this to register tombstone deletes on `_executed` so a * later rollback restores the prior emission. Mirrors the eager * path's rollback tracking; the lazy `put` was historically * unregistered but the tombstone delete (a NEW write path) * matches the eager registration for symmetry. */ getActiveTxContext(): TxContext | null; } /** Mark every output of (strategy, sourceId) as stale. */ export declare function markStale(registry: DerivationRegistry, strategy: DerivationStrategy, sourceId: string): Promise; /** * Called from `Collection.get` on lazy-mode output collections. If the * id has a pending stale flag for any strategy producing this output * collection, re-derive before returning the record. No-op when there * is no pending work — keeps the read fast path negligible. */ export declare function resolveStaleOnRead(accessor: DerivationStaleAccessor, outputCollection: string, id: string): Promise;