From e4e558df215a009fb24faa4471c4ee8dc7730151 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 12 Aug 2026 21:33:31 -0700 Subject: [PATCH] fix(ci): rename state migration assertion map off the env-var pattern OPENCLAW_STATE_MIGRATION_ASSERTIONS (a module-local const introduced by #122959) matches the OPENCLAW_[A-Z0-9_]+ source scan in scripts/check-env-var-count.mts, pushing the env-var ratchet to 503/502 and failing check:env-var-count on every branch based on current main. It is not an environment variable; rename it to STATE_MIGRATION_ASSERTIONS so the ratchet stays an honest env-var count. --- src/state/openclaw-state-db.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/state/openclaw-state-db.ts b/src/state/openclaw-state-db.ts index 33beb6953142..cf29f9394ecc 100644 --- a/src/state/openclaw-state-db.ts +++ b/src/state/openclaw-state-db.ts @@ -81,7 +81,7 @@ import { import { getOpenClawStateRuntimeSchema } from "./openclaw-state-schema-compatibility.js"; import { OPENCLAW_STATE_SCHEMA_SQL } from "./openclaw-state-schema.js"; -const OPENCLAW_STATE_MIGRATION_ASSERTIONS = { +const STATE_MIGRATION_ASSERTIONS = { 5: assertOpenClawStateDatabaseV5ForMigration, 6: assertOpenClawStateDatabaseV6ForMigration, } as const; @@ -178,7 +178,7 @@ function repairOpenClawStateDatabaseSchemaWithWriteAccess( allowedMissingTables: LAZY_ADDITIVE_STATE_TABLES, }); } else if (previousVersion === 5 || previousVersion === 6) { - OPENCLAW_STATE_MIGRATION_ASSERTIONS[previousVersion](db, { pathname }); + STATE_MIGRATION_ASSERTIONS[previousVersion](db, { pathname }); } if (rebuiltIndexNames.size === 0) { assertSqliteIntegrity(db, pathname); @@ -366,7 +366,7 @@ function ensureSchema(db: DatabaseSync, pathname: string, env: NodeJS.ProcessEnv ensureAdditiveStateColumns(db); assertCurrentStateRuntimeSchema(db, pathname); } else if (previousVersion === 5 || previousVersion === 6) { - OPENCLAW_STATE_MIGRATION_ASSERTIONS[previousVersion](db, { pathname }); + STATE_MIGRATION_ASSERTIONS[previousVersion](db, { pathname }); } dropLegacyStateTables(db); migrateRetiredCommitmentsSchema(db, previousVersion);