/** * Last `user_version` stamped by v0.1.0 (14 pre-squash journal entries). * DBs in the transitional range `1..LEGACY_PRE_SQUASH_MAX_USER_VERSION` are * adoptable by current builds under the old journal-count scheme. */ export declare const LEGACY_PRE_SQUASH_MAX_USER_VERSION = 14; /** * Offset for the first squashed journal. * * Current support calculation is: * * `SCHEMA_VERSION_OFFSET + entries.length` * * Additive migrations increase `entries.length` and therefore increase the DB * stamp. If the journal is squashed again, update this offset so the result * remains equal to the pre-squash supported version. */ export declare const SCHEMA_VERSION_OFFSET = 14; /** * Current logical schema stamp for the bundled post-squash journal. Eleven entries: * the squash (0000) + the `stable_id` drop (0001) + `run_outcome` (0002) + * baseline identity meta (0003) + suite grouping (0004) + policy audit (0005) + * session cli/engine version (0006) + run ledger (0007) + session/run-step * integrity indexes (0008) + host-plane namespace copy (0009) + task-context * graph snapshots and Run manifests (0010). Bump this in lockstep with the * bundled journal entry count (or fold into the offset on the next squash). */ export declare const LOGICAL_SCHEMA_VERSION: number; /** * The DB schema version this CLI supports = offset + bundled journal entries. * * The migrations folder is still read to verify the bundle is intact; an * unreadable journal returns `undefined` so callers skip the version guard * (migrate() will surface the canonical failure). */ export declare function readSupportedDbVersion(migrationsFolder: string): number | undefined; /** * True when the on-disk database was stamped by a CLI that knew a NEWER schema * than this one (`dbVersion > supportedVersion`) — i.e. the user downgraded the * CLI after a newer version advanced the schema. Only this future direction is * blocked; the forward direction (`dbVersion <= supportedVersion`, including `0` * on a fresh or pre-guard database) is always safe — Drizzle's migrator applies * any pending migrations and the caller re-stamps afterward. * * No legacy special-case is required. {@link SCHEMA_VERSION_OFFSET} pins the * supported version at `offset + entries.length`, which is always strictly * greater than {@link LEGACY_PRE_SQUASH_MAX_USER_VERSION}. Every v0.1.0-era * pre-squash stamp (≤ 14) is therefore `<= supportedVersion` and adopted by the * plain comparison below, while a genuinely newer schema (always ≥ offset + 1) * is always strictly above the legacy band — so the two ranges never overlap * and downgrade detection stays monotonic. (The `version-guard` suite locks * this invariant.) */ export declare function isDbNewerThanCli(dbVersion: number, supportedVersion: number): boolean; //# sourceMappingURL=schema-version.d.ts.map