Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(persistence): full-gate follow-ups for F6 (migration v219)

garrytanaf0098b4352d
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-default.json b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
index f4ec3145f6..fafcbfa333 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
@@ -2564,7 +2564,8 @@
"37 consumer_host_id uuid/uuid NULL",
"38 published_at timestamp with time zone/timestamptz NULL",
"39 error_detail jsonb/jsonb NULL",
- "40 claim_phase jsonb/jsonb NULL"
+ "40 claim_phase jsonb/jsonb NULL",
+ "41 client_request_id text/text NULL"
],
"flags": "relkind=r rls=false force_rls=false"
},
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
index 8a10c3d1f2..18ca499a4d 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
@@ -2564,7 +2564,8 @@
"37 consumer_host_id uuid/uuid NULL",
"38 published_at timestamp with time zone/timestamptz NULL",
"39 error_detail jsonb/jsonb NULL",
- "40 claim_phase jsonb/jsonb NULL"
+ "40 claim_phase jsonb/jsonb NULL",
+ "41 client_request_id text/text NULL"
],
"flags": "relkind=r rls=false force_rls=false"
},
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
index 2df21d0469..7801fdda63 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
@@ -2560,7 +2560,8 @@
"37 consumer_host_id uuid/uuid NULL",
"38 published_at timestamp with time zone/timestamptz NULL",
"39 error_detail jsonb/jsonb NULL",
- "40 claim_phase jsonb/jsonb NULL"
+ "40 claim_phase jsonb/jsonb NULL",
+ "41 client_request_id text/text NULL"
],
"flags": "relkind=r rls=false force_rls=false"
},
diff --git a/test/fixtures/goldens/migrations/records.json b/test/fixtures/goldens/migrations/records.json
index 7b772fbcf5..4e87f6fba8 100644
--- a/test/fixtures/goldens/migrations/records.json
+++ b/test/fixtures/goldens/migrations/records.json
@@ -1,6 +1,6 @@
{
"golden": {
- "count": 213,
+ "count": 214,
"gaps": [
17,
18,
@@ -35,7 +35,7 @@
"sqlQueryForEngine": "71fb1ccec1b22cdc1662876dbd8c17ed81e9ab83485c6965cdf5caa4fc4a4ab5",
"verifyProjectionStatistics": "59d9ccfea1c53384d8607874a51209a9c2dfd51b2b85a2cb6269fa4120faf1f3"
},
- "latest": 218,
+ "latest": 219,
"records": [
{
"handler": {
@@ -3230,6 +3230,19 @@
"transaction": "absent",
"verify": "absent",
"version": 218
+ },
+ {
+ "handler": "absent",
+ "idempotent": true,
+ "name": "persistence_client_request_id",
+ "sql": {
+ "length": 88,
+ "sha256": "59694a9b9ad91af2199acb78cf50bbc2ac5c502bc76aadce59c4c011f4bed6c6"
+ },
+ "sqlFor": "absent",
+ "transaction": "absent",
+ "verify": "absent",
+ "version": 219
}
],
"versions": [
@@ -3445,7 +3458,8 @@
215,
216,
217,
- 218
+ 218,
+ 219
]
},
"normalizer": "migrations-record-v1"
diff --git a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
index e33ac41521..6fca927b3d 100644
--- a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
+++ b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
@@ -2564,7 +2564,8 @@
"37 consumer_host_id uuid/uuid NULL",
"38 published_at timestamp with time zone/timestamptz NULL",
"39 error_detail jsonb/jsonb NULL",
- "40 claim_phase jsonb/jsonb NULL"
+ "40 claim_phase jsonb/jsonb NULL",
+ "41 client_request_id text/text NULL"
],
"flags": "relkind=r rls=false force_rls=false"
},
diff --git a/test/graduation-verify.test.ts b/test/graduation-verify.test.ts
index 79a77b3fa7..a4a68de3a2 100644
--- a/test/graduation-verify.test.ts
+++ b/test/graduation-verify.test.ts
@@ -230,7 +230,7 @@ describe('replayProbe', () => {
expect(await replayProbe(engine, fixture.queuedRequestId, reordered, { sourceEnabled: true, runId: RUN_ID }))
.toEqual({ status: 'passed', requestId: fixture.queuedRequestId });
const changed = await replayProbe(engine, fixture.queuedRequestId, { ...callerIntent, content: 'different' }, { sourceEnabled: true, runId: RUN_ID });
- expect(changed).toMatchObject({ status: 'failed', detail: expect.stringContaining('different intent') });
+ expect(changed).toMatchObject({ status: 'failed', detail: expect.stringContaining('used for a different write') });
const unfenced = await replayProbe(engine, fixture.queuedRequestId, callerIntent, { sourceEnabled: true });
expect(unfenced).toMatchObject({ status: 'failed', detail: expect.stringContaining('graduation_in_progress') });
expect(await replayProbe(engine, fixture.queuedRequestId, undefined)).toEqual({ status: 'not_available', reason: 'no_caller_input' });
diff --git a/test/persistence-local-client.test.ts b/test/persistence-local-client.test.ts
index b136a6e81b..d543942c7f 100644
--- a/test/persistence-local-client.test.ts
+++ b/test/persistence-local-client.test.ts
@@ -41,7 +41,7 @@ describe('engine-free local persistence routing', () => {
await withEnv({ GBRAIN_HOME: dir }, () => {
expect(() => readPersistenceCliRegistration(BRAIN)).toThrow('no readable durable writer registration');
expect(() => readFileSync(join(dir, '.gbrain', 'persistence', `${BRAIN}.cli.json`))).toThrow();
- expect(() => readPersistenceCliRegistration('../other')).toThrow('UUID');
+ expect(() => readPersistenceCliRegistration('../other')).toThrow('Missing durable brain identity');
});
});
diff --git a/test/persistence-write-contracts.test.ts b/test/persistence-write-contracts.test.ts
index 4c1d743712..f082eaf998 100644
--- a/test/persistence-write-contracts.test.ts
+++ b/test/persistence-write-contracts.test.ts
@@ -27,7 +27,7 @@ describe('mutation preconditions', () => {
});
test.each([
- { request_id: 'not-a-uuid' }, { request_id: null }, { expected_revision: '' },
+ { request_id: 'two words' }, { request_id: null }, { expected_revision: '' },
{ expected_revision: 42 }, { force: 'true' }, { expected_revision: REQUEST_ID, force: true },
])('rejects invalid preconditions before mutation: %j', (params) => {
expect(() => parseMutationPrecondition(params)).toThrow(OperationError);
diff --git a/test/schema-bootstrap-coverage.test.ts b/test/schema-bootstrap-coverage.test.ts
index 5e4c104860..591311f034 100644
--- a/test/schema-bootstrap-coverage.test.ts
+++ b/test/schema-bootstrap-coverage.test.ts
@@ -1052,6 +1052,10 @@ 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',
+ // Cat 40 Hard F6 (migration v219) — the client's original request_id. Same
+ // posture as v178/v198: persistence_requests is migration-created on PGLite,
+ // no index references the column, and every reader treats NULL as "sent a UUID or nothing".
+ 'persistence_requests.client_request_id',
// #5455 (migration v183) — managed mode epoch. persistence_brain is
// migration-created on PGLite; no index in either blob references it, and
// pre-migration readers go through to_jsonb(persistence_brain)->'mode_epoch'.