Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(fix-wave-8): number wave-8 migrations v190-v192 (sources upstream observation, alias source cascade, take embedding identity)

garrytanb4572e8a626d
diff --git a/docs/architecture/canonical-writers.tsv b/docs/architecture/canonical-writers.tsv
index 51474c2e3b..b3ef3b2ae3 100644
--- a/docs/architecture/canonical-writers.tsv
+++ b/docs/architecture/canonical-writers.tsv
@@ -193,7 +193,7 @@ src/core/schema-migrations/v123-configurable-fts-language.ts 1 schema Schema ins
src/core/schema-migrations/v142-takes-embedding-dimension-matches-config.ts 1 schema Schema installation and forward-reference DDL; coordinated activation quiesces canonical writers.
src/core/schema-migrations/v144-open-loops.ts 1 schema Schema installation and forward-reference DDL; coordinated activation quiesces canonical writers.
src/core/schema-migrations/v189-pages-credential-projection-pending.ts 1 schema Projection-only: unseals live pages whose canonical body holds a private-key marker and queues their keyless rebuild; canonical page columns are unchanged.
-src/core/schema-migrations/v190-alias-source-cascade.ts 2 schema Orphan alias GC before the alias→sources FK (#5094); grants exactly the orphan rows' sources through gbrain.write_sources for its transaction.
+src/core/schema-migrations/v191-alias-source-cascade.ts 2 schema Orphan alias GC before the alias→sources FK (#5094); grants exactly the orphan rows' sources through gbrain.write_sources for its transaction.
src/core/persistence/connector-path.ts 1 coordinator Connector path clear locks the source row, refuses filesystem sources and bound connectors, and runs as a coordinated write on managed brains.
src/core/source-delete.ts 1 engine_guard Unmanaged source delete with its incarnation binding; managed brains route removal through source lifecycle first and the writer guard refuses a direct delete.
src/core/repair/extractor-facts.ts 1 coordinator `gbrain repair extractor-facts` (#5731) clears expired_at on preview-approved conversation-extractor facts and gives each a fresh row number. On a managed brain the UPDATE runs only inside the managed_maintenance_restore_extractor_facts publication (withCoordinatedWrite, page key locked, each fact reclassified first); an unmanaged brain runs the same function in one transaction under the page lock.
diff --git a/src/core/schema-migrations/registry.generated.ts b/src/core/schema-migrations/registry.generated.ts
index 38f4f6d928..a15abb5b68 100644
--- a/src/core/schema-migrations/registry.generated.ts
+++ b/src/core/schema-migrations/registry.generated.ts
@@ -191,6 +191,8 @@ import { v187 } from './v187-fact-relink-attempts.ts';
import { v188 } from './v188-facts-ontology-stint-dedup.ts';
import { v189 } from './v189-pages-credential-projection-pending.ts';
import { v190 } from './v190-sources-upstream-observation.ts';
+import { v191 } from './v191-alias-source-cascade.ts';
+import { v192 } from './v192-take-embedding-identity.ts';
// Array order is historical (see HISTORICAL_ARRAY_ORDER in the generator); the
// runner sorts by version before applying.
@@ -380,4 +382,6 @@ export const MIGRATIONS: Migration[] = [
v188,
v189,
v190,
+ v191,
+ v192,
];
diff --git a/src/core/schema-migrations/v190-alias-source-cascade.ts b/src/core/schema-migrations/v191-alias-source-cascade.ts
similarity index 98%
rename from src/core/schema-migrations/v190-alias-source-cascade.ts
rename to src/core/schema-migrations/v191-alias-source-cascade.ts
index 799e9b7541..178fc57491 100644
--- a/src/core/schema-migrations/v190-alias-source-cascade.ts
+++ b/src/core/schema-migrations/v191-alias-source-cascade.ts
@@ -16,8 +16,8 @@ import type { Migration } from './types.ts';
// nothing: its page_id FK already cascades when a source's pages go.
const ALIAS_TABLES = ['page_aliases', 'slug_aliases'] as const;
-export const v190: Migration = {
- version: 190,
+export const v191: Migration = {
+ version: 191,
name: 'alias_source_cascade',
idempotent: true,
sql: `
diff --git a/src/core/schema-migrations/v191-take-embedding-identity.ts b/src/core/schema-migrations/v192-take-embedding-identity.ts
similarity index 94%
rename from src/core/schema-migrations/v191-take-embedding-identity.ts
rename to src/core/schema-migrations/v192-take-embedding-identity.ts
index 5cbe16a20d..eb89fecf87 100644
--- a/src/core/schema-migrations/v191-take-embedding-identity.ts
+++ b/src/core/schema-migrations/v192-take-embedding-identity.ts
@@ -9,8 +9,8 @@ import { MANAGED_WRITER_GUARD_SQL } from '../persistence/writer-guard-schema.ts'
// instead of silently searchable. Existing vectors keep NULL provenance and
// count as stale until re-embedded. The writer guard treats both columns as
// physical projection on takes too (re-installed here).
-export const v191: Migration = {
- version: 191,
+export const v192: Migration = {
+ version: 192,
name: 'take_embedding_identity',
idempotent: true,
sql: `ALTER TABLE takes ADD COLUMN IF NOT EXISTS embedding_model TEXT;