import type { ViaBinding, ViaPosture } from './index.js'; /** * Narrow the graph's raw per-field effective postures (`ViaGraph. * taintedPostures`) down to the enforcement-facing overlay `ViaPipeline. * build`'s `taint.postures` carries: * - entries whose effective posture equals `DEFAULT_POSTURE` are DROPPED — * nothing to enforce, and (#553) keeping `postureFor` returning * `undefined` for an all-plain-sourced computed field matters: it is what * lets a collection with ONLY plain-sourced computed fields keep * `this.via === undefined` (see `applyTaintOverlay`'s no-op-when-empty * contract below). * - a `sealed` entry's `queryable` is clamped to `'none'`, regardless of * what the graph's fold inherited (e.g. classified's own `'det-exact'`): * `'det-exact'` presumes a purpose-built blind index the SOURCE binding * (classified) builds for its own declared fields — this generic * taint-seal never builds an equivalent index for the DERIVED field, so a * derived+sealed field is, in truth, unqueryable by any means. This * matches the query DSL's existing PARITY behavior for classified's own * `'det-exact'` fields (`.where()` silently matches nothing, never * throws) — a derived field has no such fallback because its stored form * is opaque ciphertext, not a plain (if index-less) value, so `'none'` * (explicit refusal) is the honest posture, not `'det-exact'`. * * Returns `undefined` when nothing survives the filter (equivalent to "no * taint on this collection"). */ export declare function buildTaintOverlay(rawPostures: ReadonlyMap, sealFields: ReadonlySet): ReadonlyMap | undefined; /** * The `taint` binding: seals `sealFields` at rest via `ctx.sealedSlots`, * presenting them as sealed handles on read — exactly as classified does, * reusing the same phase-B capability. `covers` = membership in `sealFields` * OR `presentRedactFields` (the brief's contract) — used by * `hasAtRestHooks`/`eraseSealed`'s posture-driven bookkeeping, NEVER by * `postureFor` (the taint OVERLAY short-circuits `postureFor` before any * binding's `covers`/`.posture` is consulted — see `ViaPipeline.postureFor`). * `erase` is intentionally unimplemented: today's crypto-shred * (`Collection._writeTombstone`) overwrites the whole envelope — `_sealed` * included — regardless of via bindings, so a taint-sealed field is already * erased on `forget()` with no extra participation; per-field erasure * bookkeeping (residue/shredded counts) is Task 6's (#622 forget fanout) * concern if ever needed. * * `presentRedactFields` (#638 Task 7, default empty) — tainted VIRTUAL * computed fields (never sealed — nothing to encodeAtRest/decodeAtRest; * `via/graph-wiring.ts#applyTaintOverlay` computes this set as * `graph.virtualFields(name) ∩ { field : postures.get(field).exportable === * false }`). This binding is appended AFTER whatever `compileViaBindings` * built (including the `computed` binding), so its `present` hook — when * `presentRedactFields` is non-empty — runs LAST and overwrites a virtual * field's freshly-computed value with `EXPORT_REDACTION_MARKER`, * unconditionally, closing the read-time leak the same way `SealedHandle` * closes it for a materialized-sealed field. `encodeAtRest`/`decodeAtRest`/ * `present` are all conditionally OMITTED (not just no-op) when their * respective field set is empty — a collection with ONLY a tainted virtual * field (no materialized-sealed field) must NOT flip * `ViaPipeline.hasAtRestHooks`, which would wrongly route it onto the async * at-rest-hook codec path for nothing to seal. * * `sealAllFields` (#642, default `false`) — whole-record seal for a * `'*'`-defaulted derivation/MV/overlay OUTPUT collection: `covers` claims * every non-`_`-prefixed field, and `encodeAtRest`/`decodeAtRest` route * through {@link encodeTaintAtRestAll}/{@link decodeTaintAtRestAll} instead * of the fixed `sealFields` list (moot in this mode — sealing everything is * already a superset of any field-specific taint on the same collection). */ export declare function taintBinding(sealFields: ReadonlySet, presentRedactFields?: ReadonlySet, sealAllFields?: boolean): ViaBinding;