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.
This commit is contained in:
Peter Steinberger
2026-08-12 21:33:31 -07:00
parent edcf197483
commit e4e558df21
+3 -3
View File
@@ -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);