/** * Harness template for the `sceneComposition` assembly arm — LANE-AWARE. * * A `sceneComposition` capsule declares a scene; its real, deterministic * frame computation IS the ECS tick (`SceneRuntime.build` + `tick`), NOT a * pixel render. There is no ffmpeg and no GPU here: ticking the registered * scene systems over the compiled descriptor is the canonical per-frame * computation, so every check below drives that real runtime. * * Each generated check is tagged with the LANE it runs in and emitted into * the file that lane owns: * * - **unit lane** (`.test.ts`, run by `pnpm test`) — the pure, deterministic * checks. `determinism` (identical input → byte-identical frame stream via * the canonical {@link contentAddressOf}), `sync-accuracy` (audio sample * phase stays locked to the video frame clock within tolerance), and * `invariant-preservation` (every declared scene invariant holds across the * ticked playback). No timing, no rendering — real ECS ticks + real * content-addressed comparison. * - **bench lane** (`.bench.ts`, run by `pnpm run bench`) — the per-frame * budget. A real generated benchmark ticks the scene and (the bench runner) * measures frame time against the capsule's declared p95 budget. A perf * contract, not a unit assertion. * - **integration lane** (`'integration'`) — reserved for the siteAdapter arm * coming next. The {@link HarnessLane} union carries it so the model has a * clean extension point; sceneComposition emits nothing into it today. * * Per the harness LAW (memory: "no vanity tests", "no placeholders ever"): a * `() => true` placeholder and a green `it.skip` shipping unwired work are BOTH * banned. When a declared check genuinely cannot apply to a given scene — e.g. * a capsule that declares no scene tracks (no frame stream, no audio/video, * no playback) — it is recorded as a TYPED, machine-readable EXEMPTION carrying * a reason (the `not-applicable` precedent, mirroring receiptedMutation's * `effect-outcome` waiver), never a skip and never a silent omission. * * @module */ import type { CapsuleDef } from '../assembly.js'; import type { HarnessOutput, HarnessContext } from './pure-transform.js'; /** * The lanes a generated check can run in. `unit` checks land in the `.test.ts` * file (run by `pnpm test`); `bench` checks land in the `.bench.ts` file (run * by `pnpm run bench`). `integration` is reserved for the siteAdapter arm — the * union carries it as a clean extension point but no arm emits it yet. */ export type HarnessLane = 'unit' | 'bench' | 'integration'; /** * Resolution of one declared sceneComposition check against a concrete scene. * Either the check is WIRED real into its lane, or it is an explicit * `not-applicable` EXEMPTION carrying the reason it cannot apply to this scene. * There is no skip variant by construction — a skip is exactly the thing the * harness LAW forbids. */ export type SceneCheckDisposition = { readonly status: 'wired'; readonly lane: HarnessLane; } | { readonly status: 'not-applicable'; readonly lane: HarnessLane; readonly reason: string; }; /** * The four canonical sceneComposition checks and the lane each runs in. The * `lane` here is the DECLARATIVE lane model: it states where the check belongs * (unit vs bench) independent of whether a given scene can satisfy it. The * driver's probe (see {@link HarnessContext.sceneDriver}) then resolves each to * a {@link SceneCheckDisposition} — wired-real-in-lane or not-applicable. */ export declare const SCENE_CHECKS: readonly [{ readonly id: "determinism"; readonly lane: "unit"; readonly title: "determinism: identical seed produces identical frame stream across 3 runs"; }, { readonly id: "sync-accuracy"; readonly lane: "unit"; readonly title: "sync accuracy: audio and video frame timestamps align within +/- 1ms"; }, { readonly id: "invariant-preservation"; readonly lane: "unit"; readonly title: "invariant preservation: every declared scene invariant holds across playback"; }, { readonly id: "per-frame-budget"; readonly lane: "bench"; readonly title: "per-frame budget: p95 frame time below declared budget"; }]; /** * Generate the test + bench file contents for a `sceneComposition` capsule. * * Drives the REAL ECS runtime when the driver resolved a `compileScene`-able * scene for this capsule ({@link HarnessContext.sceneDriver}). The three pure * checks are emitted as real `it(...)` blocks in the unit lane; the budget * check is emitted as a real bench in the bench lane. Checks that cannot apply * to the scene (e.g. no audio track → no audio/video sync) are recorded as * typed `not-applicable` exemptions — never `it.skip`. */ export declare function generateSceneComposition(cap: CapsuleDef<'sceneComposition', unknown, unknown, unknown>, ctx?: HarnessContext): HarnessOutput; /** * Everything the harness needs to drive a concrete scene through its ECS * runtime: the import for its `compileScene`-able function, the SceneRuntime * import, the canonical content-address import, and the declared facts the * dispositions branch on (track kinds present, p95 budget). Resolved by the * driver (`scripts/capsule-compile.ts`) from a scene-driver registry — the * sceneComposition equivalent of the cachedProjection fixture resolution. */ export interface SceneDriver { /** Exported name of the `() => CompiledScene` function (e.g. `compileIntro`). */ readonly compileName: string; /** ESM import specifier (with `.js`) for the compile function's module. */ readonly compileImport: string; /** Exported name of the sceneComposition capsule binding (e.g. `intro`). */ readonly capsuleName: string; /** ESM import specifier (with `.js`) for the capsule binding's module. */ readonly capsuleImport: string; /** Import specifier (with `.js`) for the module exporting `SceneRuntime`. */ readonly runtimeImport: string; /** Import specifier (with `.js`) for the canonical `contentAddressOf`. */ readonly contentAddressImport: string; /** Whether the scene declares at least one audio track (gates sync-accuracy). */ readonly hasAudio: boolean; /** Whether the scene declares at least one video track (gates sync-accuracy). */ readonly hasVideo: boolean; } //# sourceMappingURL=scene-composition.d.ts.map