/** * Capture Agent — Program FORM migrations (migrate-on-read) * * Old presets are stored at whatever `programSchemaVersion` (FORM) was current * when they were authored. `upgradeProgram` runs a chain of pure * `migrate_vN→vN+1` functions to bring any stored program up to the current * form BEFORE strict schema validation, so the runner only ever sees one shape. * * Properties of this layer (decisions locked in AUT-242): * - Compat forever: the chain is kept indefinitely; no support window. * - Migrate-on-read only: programs are NEVER rewritten back to storage. The * stored form changes only when the generator recompiles (create/modify). * - Pure + idempotent: a program already at the current form is a no-op. * * This module is intentionally free of Node-only imports so it can be pulled * into the schema validation chain on any runtime. Content hashing * (`node:crypto`) lives in program-hash.ts. */ /** * Reads the FORM version a raw (pre-migration) program was stored at. * Absent / non-finite ⇒ 0 (the oldest form). Used to stamp run provenance * (`program_schema_version_origin`) before `upgradeProgram` bumps it. */ export declare function readOriginSchemaVersion(raw: unknown): number; /** * Brings any stored program up to {@link CURRENT_PROGRAM_SCHEMA_VERSION} (form) * before strict validation. Pure: clones, never mutates `raw`. Idempotent: a * program already at the current form is returned with only its version stamped. * Non-object input is returned untouched so the schema raises a clean error. */ export declare function upgradeProgram(raw: unknown): unknown;