/** * Harness template for the `policyGate` assembly arm. * * A policyGate resolves an `allow`/`deny` {@link Decision} (verdict + reason * chain) against a typed subject via its pure `decide(subject)` core. Disposition * is resolved at COMPILE TIME by `scripts/capsule-compile.ts` (the same probe * pattern `pureTransform`/`stateMachine`/`cachedProjection` use): the harness * emits ONE clean, real test, or THROWS a tagged `UnsupportedError` so * `capsule:compile` fails loud (wire-or-fail). It never emits an `it.skip`, never * a `() => true` placeholder. * * The generated test drives the REAL `decide` over subjects sampled from the * capsule's input (subject) schema and pins the policyGate laws: * * - **allow/deny coverage** — every verdict is a well-formed `Decision` * (`effect ∈ {allow, deny}`, `reasons` an array of `{code, message}`), and the * reason-chain law holds: `reasons` is non-empty EXACTLY when `effect` is * `deny` (a denial names why; a silent gate is the thing this arm forbids). * - **reason-chain integrity** — every reason's `code` and `message` are * non-empty strings, and each decodes against the capsule's `output` * (`Decision`) schema (the verdict shape is the contract, proved by round-trip). * - **determinism** — the SAME subject yields a deep-equal verdict twice (the * `decide` core is pure, exactly the discipline `mutate` follows). * - **every declared invariant** `check(subject, verdict)` over random subjects. * * The bench drives `decide` over presampled subjects — the capsule's real hot * path — never re-sampling inside the timed loop. * * @module */ import type { CapsuleDef } from '../assembly.js'; import type { HarnessContext, HarnessOutput } from './pure-transform.js'; /** * Generate the test + bench file contents for a `policyGate` capsule. * * Disposition is resolved at COMPILE TIME (see the module docstring). This * generator emits ONE clean real test, or THROWS a tagged `UnsupportedError` * so `capsule:compile` fails loud (wire-or-fail) — never an `it.skip`. */ export declare function generatePolicyGate(cap: CapsuleDef<'policyGate', unknown, unknown, unknown>, ctx?: HarnessContext): HarnessOutput; //# sourceMappingURL=policy-gate.d.ts.map