Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: doctor goldens carry owner_host_stale and embedding_plane_disagreement; receipt-operations fixture owns its worktree

garrytan9233d4b25b5e
diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.json
index b9f96710bf..ccc3561d87 100644
--- a/test/fixtures/goldens/doctor/content-pglite-human.json
+++ b/test/fixtures/goldens/doctor/content-pglite-human.json
@@ -238,6 +238,8 @@
" [OK] db_ahead_of_git: Informational, nothing to do: the database compared with the commit at HEAD, per source with a Git checkout. notes: 5 equal. Page detail: gbrain sources git-gap <source-id>.",
" [OK] git_index_lag: No source is strict (git-canonical), so no index trails a commit.",
" [OK] outside_content_fences: No fact, take or link is indexed from a fence on an imported email, calendar, GitHub or transcript page.",
+ " [OK] owner_host_stale: No managed write is waiting on an owner host.",
+ " [OK] embedding_plane_disagreement: The config file disables embeddings and the database holds no vectors.",
" [OK] fence_integrity: No malformed facts or takes fence is held, stored or waiting in a checkout (2 source(s) scanned).",
" [OK] search_mode: Mode: conservative (no per-key overrides — mode bundle is canonical).",
" [OK] hidden_by_search_policy: No pages hidden by search-exclude policy.",
diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.json
index 38da984eca..b192e9d91a 100644
--- a/test/fixtures/goldens/doctor/content-pglite-json.json
+++ b/test/fixtures/goldens/doctor/content-pglite-json.json
@@ -3643,6 +3643,32 @@
"name": "outside_content_fences",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/troubleshooting.md#owner-host-stale",
+ "stale": [],
+ "stale_after_ms": "<volatile>"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No managed write is waiting on an owner host.",
+ "name": "owner_host_stale",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "database_disabled": false,
+ "docs": "docs/guides/troubleshooting.md#embedding-plane-disagreement",
+ "file_disabled": true,
+ "vector_tables": []
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "The config file disables embeddings and the database holds no vectors.",
+ "name": "embedding_plane_disagreement",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index a65e860c5f..917beeb521 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -3866,6 +3866,32 @@
"name": "outside_content_fences",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/troubleshooting.md#owner-host-stale",
+ "stale": [],
+ "stale_after_ms": "<volatile>"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No managed write is waiting on an owner host.",
+ "name": "owner_host_stale",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "database_disabled": false,
+ "docs": "docs/guides/troubleshooting.md#embedding-plane-disagreement",
+ "file_disabled": true,
+ "vector_tables": []
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "The config file disables embeddings and the database holds no vectors.",
+ "name": "embedding_plane_disagreement",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -8662,6 +8688,32 @@
"name": "outside_content_fences",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/troubleshooting.md#owner-host-stale",
+ "stale": [],
+ "stale_after_ms": "<volatile>"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No managed write is waiting on an owner host.",
+ "name": "owner_host_stale",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "database_disabled": false,
+ "docs": "docs/guides/troubleshooting.md#embedding-plane-disagreement",
+ "file_disabled": true,
+ "vector_tables": []
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "The config file disables embeddings and the database holds no vectors.",
+ "name": "embedding_plane_disagreement",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index 4dc9bb433a..db83e12014 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -3869,6 +3869,32 @@
"name": "outside_content_fences",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/troubleshooting.md#owner-host-stale",
+ "stale": [],
+ "stale_after_ms": "<volatile>"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No managed write is waiting on an owner host.",
+ "name": "owner_host_stale",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "database_disabled": false,
+ "docs": "docs/guides/troubleshooting.md#embedding-plane-disagreement",
+ "file_disabled": true,
+ "vector_tables": []
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "The config file disables embeddings and the database holds no vectors.",
+ "name": "embedding_plane_disagreement",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -8666,6 +8692,32 @@
"name": "outside_content_fences",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/troubleshooting.md#owner-host-stale",
+ "stale": [],
+ "stale_after_ms": "<volatile>"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No managed write is waiting on an owner host.",
+ "name": "owner_host_stale",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "database_disabled": false,
+ "docs": "docs/guides/troubleshooting.md#embedding-plane-disagreement",
+ "file_disabled": true,
+ "vector_tables": []
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "The config file disables embeddings and the database holds no vectors.",
+ "name": "embedding_plane_disagreement",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
diff --git a/test/persistence-receipt-operations.test.ts b/test/persistence-receipt-operations.test.ts
index b78faab5c8..0e27143f80 100644
--- a/test/persistence-receipt-operations.test.ts
+++ b/test/persistence-receipt-operations.test.ts
@@ -3,7 +3,7 @@ import { randomBytes, randomUUID } from 'node:crypto';
import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import type { BrainEngine } from '../src/core/engine.ts';
import { operations, type OperationContext } from '../src/core/operations.ts';
-import { withVerifiedLocalRegistration, type LocalGrant, type LocalRegistration } from '../src/core/persistence/identity.ts';
+import { localHostId, withVerifiedLocalRegistration, type LocalGrant, type LocalRegistration } from '../src/core/persistence/identity.ts';
import { submissionAuthority } from '../src/core/persistence/authority.ts';
import { admitWrite, getWriteRequest } from '../src/core/persistence/journal.ts';
import { sha256 } from '../src/core/persistence/digest.ts';
@@ -97,7 +97,7 @@ describe('own-principal write receipt operations', () => {
const first = await accept(foreign, 'PRIVATE_OTHER_SOURCE_HEAD', otherSource);
const own = await accept();
const worktree = randomUUID();
- await engine.executeRaw('INSERT INTO persistence_worktrees(id,owner_host_id) VALUES($1,$2)', [worktree, randomUUID()]);
+ await engine.executeRaw('INSERT INTO persistence_worktrees(id,owner_host_id) VALUES($1,$2)', [worktree, localHostId()]);
await engine.executeRaw('UPDATE persistence_requests SET worktree_id=$2 WHERE id=ANY($1::uuid[])', [[first.id, own.id], worktree]);
const result = await call('list_write_requests', {});
expect(result.requests).toHaveLength(1);