Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(migrations): renumber the preparation_attempts migration to v220 (next free after master's v219)

garrytan20171f9e9057
diff --git a/src/core/persistence/model.ts b/src/core/persistence/model.ts
index 97bd712480..edd148a401 100644
--- a/src/core/persistence/model.ts
+++ b/src/core/persistence/model.ts
@@ -89,7 +89,7 @@ export interface WriteRequest {
blocked_reason: string | null;
compacted: boolean;
publication_started: boolean;
- /** #6278 (v221): preparations cut off by a deadline or an expired `preparing` claim; reset by a commit. Absent on rows read before the migration. */
+ /** #6278 (v220): preparations cut off by a deadline or an expired `preparing` claim; reset by a commit. Absent on rows read before the migration. */
/** #6176 (v217): the owner's claim-phase stamp (claim-phase.ts), read back by `claimStateOf`; absent on rows read before the migration. */
claim_phase?: unknown;
preparation_attempts?: number;
diff --git a/src/core/schema-migrations/registry.generated.ts b/src/core/schema-migrations/registry.generated.ts
index dc1b010f73..c693ecefee 100644
--- a/src/core/schema-migrations/registry.generated.ts
+++ b/src/core/schema-migrations/registry.generated.ts
@@ -220,7 +220,7 @@ import { v216 } from './v216-chronicle-campaign-stamps.ts';
import { v217 } from './v217-persistence-request-claim-phase.ts';
import { v218 } from './v218-purge-legacy-worktree-manifest-files.ts';
import { v219 } from './v219-pages-reconcile-name-indexes.ts';
-import { v221 } from './v221-persistence-request-preparation-attempts.ts';
+import { v220 } from './v220-persistence-request-preparation-attempts.ts';
// Array order is historical (see HISTORICAL_ARRAY_ORDER in the generator); the
// runner sorts by version before applying.
@@ -439,5 +439,5 @@ export const MIGRATIONS: Migration[] = [
v217,
v218,
v219,
- v221,
+ v220,
];
diff --git a/src/core/schema-migrations/v221-persistence-request-preparation-attempts.ts b/src/core/schema-migrations/v220-persistence-request-preparation-attempts.ts
similarity index 95%
rename from src/core/schema-migrations/v221-persistence-request-preparation-attempts.ts
rename to src/core/schema-migrations/v220-persistence-request-preparation-attempts.ts
index 611d6598ca..576ae3ecdd 100644
--- a/src/core/schema-migrations/v221-persistence-request-preparation-attempts.ts
+++ b/src/core/schema-migrations/v220-persistence-request-preparation-attempts.ts
@@ -11,8 +11,8 @@ import type { Migration } from './types.ts';
// preparation cannot stall a catch-up on every pass. Existing rows start at 0;
// a commit resets the counter. The column is also in the `persistence_requests`
// CREATE TABLE of src/schema.sql for fresh installs; no index references it.
-export const v221: Migration = {
- version: 221,
+export const v220: Migration = {
+ version: 220,
name: 'persistence_request_preparation_attempts',
idempotent: true,
sql: `
diff --git a/test/e2e/persistence-preparation-attempts-postgres.test.ts b/test/e2e/persistence-preparation-attempts-postgres.test.ts
index de0df71128..b0990b8b7d 100644
--- a/test/e2e/persistence-preparation-attempts-postgres.test.ts
+++ b/test/e2e/persistence-preparation-attempts-postgres.test.ts
@@ -1,5 +1,5 @@
/**
- * #6278 (v221) on Postgres: the `preparation_attempts` column on a fresh
+ * #6278 (v220) on Postgres: the `preparation_attempts` column on a fresh
* install and on an upgraded brain holding queued, running, failed and
* compacted requests. PGLite twin: test/persistence-preparation-attempts-migration.test.ts.
*/
diff --git a/test/persistence-preparation-attempts-migration.test.ts b/test/persistence-preparation-attempts-migration.test.ts
index b556467003..6dd74df6cc 100644
--- a/test/persistence-preparation-attempts-migration.test.ts
+++ b/test/persistence-preparation-attempts-migration.test.ts
@@ -1,5 +1,5 @@
/**
- * #6278 (v221): `persistence_requests.preparation_attempts`. Protects: a fresh
+ * #6278 (v220): `persistence_requests.preparation_attempts`. Protects: a fresh
* PGLite install has the column (integer, NOT NULL, default 0, non-negative)
* and an upgraded brain gets it with 0 on every existing request, whatever its
* state, without the runner touching the rows. Fails when the migration is
diff --git a/test/schema-bootstrap-coverage.test.ts b/test/schema-bootstrap-coverage.test.ts
index 053b4ba5df..fa441e2f14 100644
--- a/test/schema-bootstrap-coverage.test.ts
+++ b/test/schema-bootstrap-coverage.test.ts
@@ -1052,7 +1052,7 @@ const COLUMN_EXEMPTIONS = new Set<string>([
// as v178/v198: persistence_requests is migration-created on PGLite, no
// index references the column, and every reader treats NULL as no recorded phase.
'persistence_requests.claim_phase',
- // #6278 (migration v221) — preparation attempt counter. Same posture as
+ // #6278 (migration v220) — preparation attempt counter. Same posture as
// v178/v198/v217: migration-created on PGLite, no index references the
// column, and every reader treats a missing value as 0 attempts.
'persistence_requests.preparation_attempts',