Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

storage adopt: keep fence_integrity next to search_mode; reword the field-refused summary so it names no command

garrytan381221ac9bdf
diff --git a/docs/guides/error-codes.md b/docs/guides/error-codes.md
index ff0ca24e3d..cafebf143c 100644
--- a/docs/guides/error-codes.md
+++ b/docs/guides/error-codes.md
@@ -4708,7 +4708,7 @@ More: [docs/guides/google-connect.md#troubleshooting](../../docs/guides/google-c
| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
|---|---|---|---|---|---|---|
-| Interim storage records carry fields a card refuses (a command, an unknown field, or a field gbrain stamps), and the adopt apply did not name each one with --drop-field; nothing was written. | Adopting leaves those fields out of the card, so the user decides; the original pages keep them until finalize soft-deletes the originals. | Show the user the refused fields the adopt preview lists; with their agreement, run the apply the refusal names, which drops each with --drop-field. | user | `repeat the read that failed` | 1 | no |
+| Interim storage records carry fields a card refuses (a command, an unknown field, or a field stamped by gbrain), and the adopt apply did not name each one with --drop-field; nothing was written. | Adopting leaves those fields out of the card, so the user decides; the original pages keep them until finalize soft-deletes the originals. | Show the user the refused fields the adopt preview lists; with their agreement, run the apply the refusal names, which drops each with --drop-field. | user | `repeat the read that failed` | 1 | no |
More: [docs/guides/write-refusals.md#storage-manifest-refusals](../../docs/guides/write-refusals.md#storage-manifest-refusals)
diff --git a/src/commands/doctor/registry.ts b/src/commands/doctor/registry.ts
index 8cd9a19982..61c501dd41 100644
--- a/src/commands/doctor/registry.ts
+++ b/src/commands/doctor/registry.ts
@@ -327,9 +327,9 @@ export const DOCTOR_CHECK_REGISTRY: readonly DoctorEntry[] = [
// GBRA-248 W0: writes waiting on a long-quiet owner host, and a file plane that disables embeddings over a database with vectors.
ownerHostStaleEntry,
embeddingPlaneDisagreementEntry,
- fenceIntegrityEntry,
// GST-1943: the storage shelf: cards failing the card schema, interim records not adopted, a hosted shelf directory gone.
storageManifestEntry,
+ fenceIntegrityEntry,
searchModeEntry,
];
diff --git a/src/core/error-registry.ts b/src/core/error-registry.ts
index 13189e6de6..f6949c0d14 100644
--- a/src/core/error-registry.ts
+++ b/src/core/error-registry.ts
@@ -766,7 +766,7 @@ export const CODES = {
stale_unavailable: { class: 'unavailable', summary: "No complete, current authorized shared-skills view is available; cached shared skills stay unused.", docs: 'docs/guides/shared-brain-skills.md#troubleshoot-leave-and-recover' },
state_mismatch: { class: 'caller', summary: "Google connect credential error: state mismatch.", docs: 'docs/guides/google-connect.md#troubleshooting' },
store_unavailable: { class: 'retryable', summary: "The object store an engine opened from settings names did not answer a file check (file_register, file_verify, file_url), so nothing was recorded and no file was reported missing.", why: 'A failed read says nothing about whether the object exists; reporting it missing could lead a host to re-upload or delete a file that is still there.', docs: 'docs/ENGINES.md#opening-an-engine-from-settings-experimental', suggestion: "Check the store named in settings.storage (its path, or its endpoint, bucket and keys), then call again." },
- storage_adopt_field_refused: { class: 'consent', actor: 'user', summary: "Interim storage records carry fields a card refuses (a command, an unknown field, or a field gbrain stamps), and the adopt apply did not name each one with --drop-field; nothing was written.", why: 'Adopting leaves those fields out of the card, so the user decides; the original pages keep them until finalize soft-deletes the originals.', docs: 'docs/guides/write-refusals.md#storage-manifest-refusals', suggestion: 'Show the user the refused fields the adopt preview lists; with their agreement, run the apply the refusal names, which drops each with --drop-field.' },
+ storage_adopt_field_refused: { class: 'consent', actor: 'user', summary: "Interim storage records carry fields a card refuses (a command, an unknown field, or a field stamped by gbrain), and the adopt apply did not name each one with --drop-field; nothing was written.", why: 'Adopting leaves those fields out of the card, so the user decides; the original pages keep them until finalize soft-deletes the originals.', docs: 'docs/guides/write-refusals.md#storage-manifest-refusals', suggestion: 'Show the user the refused fields the adopt preview lists; with their agreement, run the apply the refusal names, which drops each with --drop-field.' },
storage_adopt_unverified: { class: 'caller', summary: "An adopted interim original has no card on the storage shelf that matches its record, so finalize deleted nothing.", why: 'Finalize soft-deletes an original only when its card holds everything the record mapped to, so no archive record is lost.', docs: 'docs/guides/write-refusals.md#storage-manifest-refusals', suggestion: 'Compare the original with its card (gbrain storage-get), fix the card or the record, then preview gbrain storage adopt --finalize again.' },
storage_card_exists: { class: 'caller', summary: "A storage card with this id is already on the storage shelf; nothing was written.", why: 'Registering never overwrites a card, so two archives cannot silently share one id; a change to an existing card names the revision it read.', docs: 'docs/guides/write-refusals.md#storage-manifest-refusals', suggestion: 'Change the card with gbrain storage-update <id> --expected-revision <revision from storage_get>, or register the new item under another id.' },
storage_manifest_missing: { class: 'consent', actor: 'user', summary: "This brain has no storage shelf to write to (or the storage source ID belongs to another source); nothing was written.", why: 'On a brain with a Git checkout the shelf is a hosted git-canonical repository, created only after the user previews it, and hosting needs managed persistence. A repo-less brain gets its database-only shelf on the first register.', docs: 'docs/guides/write-refusals.md#storage-manifest-refusals', suggestion: 'Preview gbrain storage init --dir <absolute path> --dry-run and apply the command it prints after the user agrees.' },
diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.json
index 5b70d1a36f..39cd578d8d 100644
--- a/test/fixtures/goldens/doctor/content-pglite-human.json
+++ b/test/fixtures/goldens/doctor/content-pglite-human.json
@@ -256,8 +256,8 @@
" [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).",
" [INFO] storage_manifest: No storage shelf and no interim storage records on this brain.",
+ " [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.",
" [OK] eval_drift: No retrieval-affecting files changed in working tree.",
diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.json
index 1ec9c6cbe5..09ef984c7e 100644
--- a/test/fixtures/goldens/doctor/content-pglite-json.json
+++ b/test/fixtures/goldens/doctor/content-pglite-json.json
@@ -3903,6 +3903,18 @@
"name": "embedding_plane_disagreement",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/storage-manifest.md#doctor"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No storage shelf and no interim storage records on this brain.",
+ "name": "storage_manifest",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -4032,18 +4044,6 @@
"name": "fence_integrity",
"status": "ok"
},
- {
- "category": "brain",
- "details": {
- "docs": "docs/guides/storage-manifest.md#doctor"
- },
- "elapsed_ms": "<volatile>",
- "message": "No storage shelf and no interim storage records on this brain.",
- "name": "storage_manifest",
- "readiness_state": "not_applicable",
- "severity": "info",
- "status": "ok"
- },
{
"category": "ops",
"elapsed_ms": "<volatile>",
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index 29518773ed..bf4a15daf2 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -4167,6 +4167,18 @@
"name": "embedding_plane_disagreement",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/storage-manifest.md#doctor"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No storage shelf and no interim storage records on this brain.",
+ "name": "storage_manifest",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -4464,18 +4476,6 @@
"name": "fence_integrity",
"status": "warn"
},
- {
- "category": "brain",
- "details": {
- "docs": "docs/guides/storage-manifest.md#doctor"
- },
- "elapsed_ms": "<volatile>",
- "message": "No storage shelf and no interim storage records on this brain.",
- "name": "storage_manifest",
- "readiness_state": "not_applicable",
- "severity": "info",
- "status": "ok"
- },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -9289,6 +9289,18 @@
"name": "embedding_plane_disagreement",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/storage-manifest.md#doctor"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No storage shelf and no interim storage records on this brain.",
+ "name": "storage_manifest",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -9586,18 +9598,6 @@
"name": "fence_integrity",
"status": "warn"
},
- {
- "category": "brain",
- "details": {
- "docs": "docs/guides/storage-manifest.md#doctor"
- },
- "elapsed_ms": "<volatile>",
- "message": "No storage shelf and no interim storage records on this brain.",
- "name": "storage_manifest",
- "readiness_state": "not_applicable",
- "severity": "info",
- "status": "ok"
- },
{
"category": "ops",
"elapsed_ms": "<volatile>",
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index f176a3e68d..e586a8d74c 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -4170,6 +4170,18 @@
"name": "embedding_plane_disagreement",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/storage-manifest.md#doctor"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No storage shelf and no interim storage records on this brain.",
+ "name": "storage_manifest",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -4467,18 +4479,6 @@
"name": "fence_integrity",
"status": "warn"
},
- {
- "category": "brain",
- "details": {
- "docs": "docs/guides/storage-manifest.md#doctor"
- },
- "elapsed_ms": "<volatile>",
- "message": "No storage shelf and no interim storage records on this brain.",
- "name": "storage_manifest",
- "readiness_state": "not_applicable",
- "severity": "info",
- "status": "ok"
- },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -9293,6 +9293,18 @@
"name": "embedding_plane_disagreement",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/storage-manifest.md#doctor"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No storage shelf and no interim storage records on this brain.",
+ "name": "storage_manifest",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -9590,18 +9602,6 @@
"name": "fence_integrity",
"status": "warn"
},
- {
- "category": "brain",
- "details": {
- "docs": "docs/guides/storage-manifest.md#doctor"
- },
- "elapsed_ms": "<volatile>",
- "message": "No storage shelf and no interim storage records on this brain.",
- "name": "storage_manifest",
- "readiness_state": "not_applicable",
- "severity": "info",
- "status": "ok"
- },
{
"category": "ops",
"elapsed_ms": "<volatile>",
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index e1511c9b3a..0a2489d6cd 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -3528,6 +3528,18 @@
"name": "embedding_plane_disagreement",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/storage-manifest.md#doctor"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No storage shelf and no interim storage records on this brain.",
+ "name": "storage_manifest",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -3610,18 +3622,6 @@
"name": "fence_integrity",
"status": "ok"
},
- {
- "category": "brain",
- "details": {
- "docs": "docs/guides/storage-manifest.md#doctor"
- },
- "elapsed_ms": "<volatile>",
- "message": "No storage shelf and no interim storage records on this brain.",
- "name": "storage_manifest",
- "readiness_state": "not_applicable",
- "severity": "info",
- "status": "ok"
- },
{
"category": "ops",
"elapsed_ms": "<volatile>",
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index 6dd54048f6..35a49e0edb 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -3573,6 +3573,18 @@
"name": "embedding_plane_disagreement",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/storage-manifest.md#doctor"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No storage shelf and no interim storage records on this brain.",
+ "name": "storage_manifest",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -3655,18 +3667,6 @@
"name": "fence_integrity",
"status": "ok"
},
- {
- "category": "brain",
- "details": {
- "docs": "docs/guides/storage-manifest.md#doctor"
- },
- "elapsed_ms": "<volatile>",
- "message": "No storage shelf and no interim storage records on this brain.",
- "name": "storage_manifest",
- "readiness_state": "not_applicable",
- "severity": "info",
- "status": "ok"
- },
{
"category": "ops",
"elapsed_ms": "<volatile>",
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 5ab226fa0e..4b4d3a10da 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -3576,6 +3576,18 @@
"name": "embedding_plane_disagreement",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/storage-manifest.md#doctor"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No storage shelf and no interim storage records on this brain.",
+ "name": "storage_manifest",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -3658,18 +3670,6 @@
"name": "fence_integrity",
"status": "ok"
},
- {
- "category": "brain",
- "details": {
- "docs": "docs/guides/storage-manifest.md#doctor"
- },
- "elapsed_ms": "<volatile>",
- "message": "No storage shelf and no interim storage records on this brain.",
- "name": "storage_manifest",
- "readiness_state": "not_applicable",
- "severity": "info",
- "status": "ok"
- },
{
"category": "ops",
"elapsed_ms": "<volatile>",
diff --git a/test/fixtures/goldens/doctor/registry-build-checks.json b/test/fixtures/goldens/doctor/registry-build-checks.json
index be46e888cd..bfc1ed1162 100644
--- a/test/fixtures/goldens/doctor/registry-build-checks.json
+++ b/test/fixtures/goldens/doctor/registry-build-checks.json
@@ -1095,11 +1095,11 @@
},
{
"category": "brain",
- "name": "fence_integrity"
+ "name": "storage_manifest"
},
{
"category": "brain",
- "name": "storage_manifest"
+ "name": "fence_integrity"
},
{
"category": "ops",