Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(6948): doctor goldens at the stamped version; twin-merge write-gate exemption

garrytan5ba2cb506bd2
diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.json
index f38a2a2088..b858ddf9c3 100644
--- a/test/fixtures/goldens/doctor/content-pglite-human.json
+++ b/test/fixtures/goldens/doctor/content-pglite-human.json
@@ -88,7 +88,7 @@
" [INFO] supersession_calibration: Embeddings are off on this brain, so facts are only deduplicated by exact text; no supersession threshold applies.",
" [INFO] fact_admission_floors: Embeddings are off on this brain, so facts are admitted by keyword and named entity only; no cosine floor applies.",
" [OK] chat_fallback_chain: No chat_fallback_chain is set: every chat call uses only its own model.",
- " [OK] behavior_changes: gbrain v0.60.296.0 changed 1 behavior on this brain. All stay on; this is a one-time disclosure, not a request for consent. (1) Managed sync no longer stops a whole source when several live pages record one file as their origin (duplicate-origin twins, #6948): only that file is held `origin_conflict` and the rest syncs. When the pages are verified duplicates (the page the path names, one body, a readable file, compatible ids, one visibility and trust tier, nothing the merge would lose), the sync merges the others into it right after the run: their links, relationship dates, timeline, raw data, user tags, aliases and facts move, their slugs become aliases, and they are soft-deleted without touching the file (restorable for 72 h; the receipt lists any frontmatter they carried that the file lacks). Opt out with `gbrain config set sync.origin_twins.auto_resolve false`. Any other group stays held for a person: `gbrain repair origin-twins --source <id>` previews every group, and `--slug <kept-slug>` detaches the others without deleting them. New index `pages_live_origin_key` makes a new twin unwritable; it is built only on a brain with no twins, so with twins the upgrade changes nothing and doctor `origin_twins` reports \"Index pending\" until the repair resolves them. gbrain doctor --only behavior_changes shows this again.",
+ " [OK] behavior_changes: Nothing to disclose: this brain is a fresh install at v<version>, after every disclosed behavior change, so the one-time behavior-change notice does not apply.",
" [OK] graph_coverage: Only 2 eligible entity pages (< 5) — coverage ratio not meaningful at this scale",
" [WARN] brain_score: Brain score 36/100 (embed 0/35, links 5/25, timeline density (entity and event pages) 15/15, orphans 6/15, dead-links 10/10)",
" Fix: gbrain doctor --remediation-plan --json --brain host",
diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.json
index 404da3e8b7..fcb058d774 100644
--- a/test/fixtures/goldens/doctor/content-pglite-json.json
+++ b/test/fixtures/goldens/doctor/content-pglite-json.json
@@ -1147,34 +1147,8 @@
},
{
"category": "meta",
- "details": {
- "baseline": "<version>",
- "shown": {
- "cli": true,
- "stdio": false
- },
- "since": "0.60.296.0"
- },
"elapsed_ms": "<volatile>",
- "fix": {
- "actor": "agent",
- "argv": [
- "gbrain",
- "doctor",
- "--only",
- "behavior_changes",
- "--json",
- "--brain",
- "host"
- ],
- "command": "gbrain doctor --only behavior_changes --json --brain host",
- "consent": [],
- "docs": "https://github.com/garrytan/gbrain/blob/master/docs/guides/chat-fallback.md",
- "next": "run",
- "requires_exclusive": false,
- "why": "Shows this disclosure again; read-only."
- },
- "message": "gbrain v0.60.296.0 changed 1 behavior on this brain. All stay on; this is a one-time disclosure, not a request for consent. (1) Managed sync no longer stops a whole source when several live pages record one file as their origin (duplicate-origin twins, #6948): only that file is held `origin_conflict` and the rest syncs. When the pages are verified duplicates (the page the path names, one body, a readable file, compatible ids, one visibility and trust tier, nothing the merge would lose), the sync merges the others into it right after the run: their links, relationship dates, timeline, raw data, user tags, aliases and facts move, their slugs become aliases, and they are soft-deleted without touching the file (restorable for 72 h; the receipt lists any frontmatter they carried that the file lacks). Opt out with `gbrain config set sync.origin_twins.auto_resolve false`. Any other group stays held for a person: `gbrain repair origin-twins --source <id>` previews every group, and `--slug <kept-slug>` detaches the others without deleting them. New index `pages_live_origin_key` makes a new twin unwritable; it is built only on a brain with no twins, so with twins the upgrade changes nothing and doctor `origin_twins` reports \"Index pending\" until the repair resolves them. gbrain doctor --only behavior_changes shows this again.",
+ "message": "Nothing to disclose: this brain is a fresh install at v<version>, after every disclosed behavior change, so the one-time behavior-change notice does not apply.",
"name": "behavior_changes",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index 639e2bd739..09fe4e6157 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -1207,34 +1207,8 @@
},
{
"category": "meta",
- "details": {
- "baseline": "<version>",
- "shown": {
- "cli": true,
- "stdio": false
- },
- "since": "0.60.296.0"
- },
"elapsed_ms": "<volatile>",
- "fix": {
- "actor": "agent",
- "argv": [
- "gbrain",
- "doctor",
- "--only",
- "behavior_changes",
- "--json",
- "--brain",
- "host"
- ],
- "command": "gbrain doctor --only behavior_changes --json --brain host",
- "consent": [],
- "docs": "https://github.com/garrytan/gbrain/blob/master/docs/guides/chat-fallback.md",
- "next": "run",
- "requires_exclusive": false,
- "why": "Shows this disclosure again; read-only."
- },
- "message": "gbrain v0.60.296.0 changed 1 behavior on this brain. All stay on; this is a one-time disclosure, not a request for consent. (1) Managed sync no longer stops a whole source when several live pages record one file as their origin (duplicate-origin twins, #6948): only that file is held `origin_conflict` and the rest syncs. When the pages are verified duplicates (the page the path names, one body, a readable file, compatible ids, one visibility and trust tier, nothing the merge would lose), the sync merges the others into it right after the run: their links, relationship dates, timeline, raw data, user tags, aliases and facts move, their slugs become aliases, and they are soft-deleted without touching the file (restorable for 72 h; the receipt lists any frontmatter they carried that the file lacks). Opt out with `gbrain config set sync.origin_twins.auto_resolve false`. Any other group stays held for a person: `gbrain repair origin-twins --source <id>` previews every group, and `--slug <kept-slug>` detaches the others without deleting them. New index `pages_live_origin_key` makes a new twin unwritable; it is built only on a brain with no twins, so with twins the upgrade changes nothing and doctor `origin_twins` reports \"Index pending\" until the repair resolves them. gbrain doctor --only behavior_changes shows this again.",
+ "message": "Nothing to disclose: this brain is a fresh install at v<version>, after every disclosed behavior change, so the one-time behavior-change notice does not apply.",
"name": "behavior_changes",
"status": "ok"
},
@@ -5522,34 +5496,8 @@
},
{
"category": "meta",
- "details": {
- "baseline": "<version>",
- "shown": {
- "cli": true,
- "stdio": false
- },
- "since": "0.60.296.0"
- },
"elapsed_ms": "<volatile>",
- "fix": {
- "actor": "agent",
- "argv": [
- "gbrain",
- "doctor",
- "--only",
- "behavior_changes",
- "--json",
- "--brain",
- "host"
- ],
- "command": "gbrain doctor --only behavior_changes --json --brain host",
- "consent": [],
- "docs": "https://github.com/garrytan/gbrain/blob/master/docs/guides/chat-fallback.md",
- "next": "run",
- "requires_exclusive": false,
- "why": "Shows this disclosure again; read-only."
- },
- "message": "gbrain v0.60.296.0 changed 1 behavior on this brain. All stay on; this is a one-time disclosure, not a request for consent. (1) Managed sync no longer stops a whole source when several live pages record one file as their origin (duplicate-origin twins, #6948): only that file is held `origin_conflict` and the rest syncs. When the pages are verified duplicates (the page the path names, one body, a readable file, compatible ids, one visibility and trust tier, nothing the merge would lose), the sync merges the others into it right after the run: their links, relationship dates, timeline, raw data, user tags, aliases and facts move, their slugs become aliases, and they are soft-deleted without touching the file (restorable for 72 h; the receipt lists any frontmatter they carried that the file lacks). Opt out with `gbrain config set sync.origin_twins.auto_resolve false`. Any other group stays held for a person: `gbrain repair origin-twins --source <id>` previews every group, and `--slug <kept-slug>` detaches the others without deleting them. New index `pages_live_origin_key` makes a new twin unwritable; it is built only on a brain with no twins, so with twins the upgrade changes nothing and doctor `origin_twins` reports \"Index pending\" until the repair resolves them. gbrain doctor --only behavior_changes shows this again.",
+ "message": "Nothing to disclose: this brain is a fresh install at v<version>, after every disclosed behavior change, so the one-time behavior-change notice does not apply.",
"name": "behavior_changes",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index 86d9fc9f9b..caceb53749 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -1199,34 +1199,8 @@
},
{
"category": "meta",
- "details": {
- "baseline": "<version>",
- "shown": {
- "cli": true,
- "stdio": false
- },
- "since": "0.60.296.0"
- },
"elapsed_ms": "<volatile>",
- "fix": {
- "actor": "agent",
- "argv": [
- "gbrain",
- "doctor",
- "--only",
- "behavior_changes",
- "--json",
- "--brain",
- "host"
- ],
- "command": "gbrain doctor --only behavior_changes --json --brain host",
- "consent": [],
- "docs": "https://github.com/garrytan/gbrain/blob/master/docs/guides/chat-fallback.md",
- "next": "run",
- "requires_exclusive": false,
- "why": "Shows this disclosure again; read-only."
- },
- "message": "gbrain v0.60.296.0 changed 1 behavior on this brain. All stay on; this is a one-time disclosure, not a request for consent. (1) Managed sync no longer stops a whole source when several live pages record one file as their origin (duplicate-origin twins, #6948): only that file is held `origin_conflict` and the rest syncs. When the pages are verified duplicates (the page the path names, one body, a readable file, compatible ids, one visibility and trust tier, nothing the merge would lose), the sync merges the others into it right after the run: their links, relationship dates, timeline, raw data, user tags, aliases and facts move, their slugs become aliases, and they are soft-deleted without touching the file (restorable for 72 h; the receipt lists any frontmatter they carried that the file lacks). Opt out with `gbrain config set sync.origin_twins.auto_resolve false`. Any other group stays held for a person: `gbrain repair origin-twins --source <id>` previews every group, and `--slug <kept-slug>` detaches the others without deleting them. New index `pages_live_origin_key` makes a new twin unwritable; it is built only on a brain with no twins, so with twins the upgrade changes nothing and doctor `origin_twins` reports \"Index pending\" until the repair resolves them. gbrain doctor --only behavior_changes shows this again.",
+ "message": "Nothing to disclose: this brain is a fresh install at v<version>, after every disclosed behavior change, so the one-time behavior-change notice does not apply.",
"name": "behavior_changes",
"status": "ok"
},
@@ -5515,34 +5489,8 @@
},
{
"category": "meta",
- "details": {
- "baseline": "<version>",
- "shown": {
- "cli": true,
- "stdio": false
- },
- "since": "0.60.296.0"
- },
"elapsed_ms": "<volatile>",
- "fix": {
- "actor": "agent",
- "argv": [
- "gbrain",
- "doctor",
- "--only",
- "behavior_changes",
- "--json",
- "--brain",
- "host"
- ],
- "command": "gbrain doctor --only behavior_changes --json --brain host",
- "consent": [],
- "docs": "https://github.com/garrytan/gbrain/blob/master/docs/guides/chat-fallback.md",
- "next": "run",
- "requires_exclusive": false,
- "why": "Shows this disclosure again; read-only."
- },
- "message": "gbrain v0.60.296.0 changed 1 behavior on this brain. All stay on; this is a one-time disclosure, not a request for consent. (1) Managed sync no longer stops a whole source when several live pages record one file as their origin (duplicate-origin twins, #6948): only that file is held `origin_conflict` and the rest syncs. When the pages are verified duplicates (the page the path names, one body, a readable file, compatible ids, one visibility and trust tier, nothing the merge would lose), the sync merges the others into it right after the run: their links, relationship dates, timeline, raw data, user tags, aliases and facts move, their slugs become aliases, and they are soft-deleted without touching the file (restorable for 72 h; the receipt lists any frontmatter they carried that the file lacks). Opt out with `gbrain config set sync.origin_twins.auto_resolve false`. Any other group stays held for a person: `gbrain repair origin-twins --source <id>` previews every group, and `--slug <kept-slug>` detaches the others without deleting them. New index `pages_live_origin_key` makes a new twin unwritable; it is built only on a brain with no twins, so with twins the upgrade changes nothing and doctor `origin_twins` reports \"Index pending\" until the repair resolves them. gbrain doctor --only behavior_changes shows this again.",
+ "message": "Nothing to disclose: this brain is a fresh install at v<version>, after every disclosed behavior change, so the one-time behavior-change notice does not apply.",
"name": "behavior_changes",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index 71245accb8..9ea315222b 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -1062,34 +1062,8 @@
},
{
"category": "meta",
- "details": {
- "baseline": "<version>",
- "shown": {
- "cli": false,
- "stdio": false
- },
- "since": "0.60.296.0"
- },
"elapsed_ms": "<volatile>",
- "fix": {
- "actor": "agent",
- "argv": [
- "gbrain",
- "doctor",
- "--only",
- "behavior_changes",
- "--json",
- "--brain",
- "host"
- ],
- "command": "gbrain doctor --only behavior_changes --json --brain host",
- "consent": [],
- "docs": "https://github.com/garrytan/gbrain/blob/master/docs/guides/chat-fallback.md",
- "next": "run",
- "requires_exclusive": false,
- "why": "Shows this disclosure again; read-only."
- },
- "message": "gbrain v0.60.296.0 changed 1 behavior on this brain. All stay on; this is a one-time disclosure, not a request for consent. (1) Managed sync no longer stops a whole source when several live pages record one file as their origin (duplicate-origin twins, #6948): only that file is held `origin_conflict` and the rest syncs. When the pages are verified duplicates (the page the path names, one body, a readable file, compatible ids, one visibility and trust tier, nothing the merge would lose), the sync merges the others into it right after the run: their links, relationship dates, timeline, raw data, user tags, aliases and facts move, their slugs become aliases, and they are soft-deleted without touching the file (restorable for 72 h; the receipt lists any frontmatter they carried that the file lacks). Opt out with `gbrain config set sync.origin_twins.auto_resolve false`. Any other group stays held for a person: `gbrain repair origin-twins --source <id>` previews every group, and `--slug <kept-slug>` detaches the others without deleting them. New index `pages_live_origin_key` makes a new twin unwritable; it is built only on a brain with no twins, so with twins the upgrade changes nothing and doctor `origin_twins` reports \"Index pending\" until the repair resolves them. gbrain doctor --only behavior_changes shows this again.",
+ "message": "Nothing to disclose: this brain is a fresh install at v<version>, after every disclosed behavior change, so the one-time behavior-change notice does not apply.",
"name": "behavior_changes",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index a4e4140307..44fa320735 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -1118,34 +1118,8 @@
},
{
"category": "meta",
- "details": {
- "baseline": "<version>",
- "shown": {
- "cli": false,
- "stdio": false
- },
- "since": "0.60.296.0"
- },
"elapsed_ms": "<volatile>",
- "fix": {
- "actor": "agent",
- "argv": [
- "gbrain",
- "doctor",
- "--only",
- "behavior_changes",
- "--json",
- "--brain",
- "host"
- ],
- "command": "gbrain doctor --only behavior_changes --json --brain host",
- "consent": [],
- "docs": "https://github.com/garrytan/gbrain/blob/master/docs/guides/chat-fallback.md",
- "next": "run",
- "requires_exclusive": false,
- "why": "Shows this disclosure again; read-only."
- },
- "message": "gbrain v0.60.296.0 changed 1 behavior on this brain. All stay on; this is a one-time disclosure, not a request for consent. (1) Managed sync no longer stops a whole source when several live pages record one file as their origin (duplicate-origin twins, #6948): only that file is held `origin_conflict` and the rest syncs. When the pages are verified duplicates (the page the path names, one body, a readable file, compatible ids, one visibility and trust tier, nothing the merge would lose), the sync merges the others into it right after the run: their links, relationship dates, timeline, raw data, user tags, aliases and facts move, their slugs become aliases, and they are soft-deleted without touching the file (restorable for 72 h; the receipt lists any frontmatter they carried that the file lacks). Opt out with `gbrain config set sync.origin_twins.auto_resolve false`. Any other group stays held for a person: `gbrain repair origin-twins --source <id>` previews every group, and `--slug <kept-slug>` detaches the others without deleting them. New index `pages_live_origin_key` makes a new twin unwritable; it is built only on a brain with no twins, so with twins the upgrade changes nothing and doctor `origin_twins` reports \"Index pending\" until the repair resolves them. gbrain doctor --only behavior_changes shows this again.",
+ "message": "Nothing to disclose: this brain is a fresh install at v<version>, after every disclosed behavior change, so the one-time behavior-change notice does not apply.",
"name": "behavior_changes",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index e7c62b7f11..b4ca77657a 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -1110,34 +1110,8 @@
},
{
"category": "meta",
- "details": {
- "baseline": "<version>",
- "shown": {
- "cli": false,
- "stdio": false
- },
- "since": "0.60.296.0"
- },
"elapsed_ms": "<volatile>",
- "fix": {
- "actor": "agent",
- "argv": [
- "gbrain",
- "doctor",
- "--only",
- "behavior_changes",
- "--json",
- "--brain",
- "host"
- ],
- "command": "gbrain doctor --only behavior_changes --json --brain host",
- "consent": [],
- "docs": "https://github.com/garrytan/gbrain/blob/master/docs/guides/chat-fallback.md",
- "next": "run",
- "requires_exclusive": false,
- "why": "Shows this disclosure again; read-only."
- },
- "message": "gbrain v0.60.296.0 changed 1 behavior on this brain. All stay on; this is a one-time disclosure, not a request for consent. (1) Managed sync no longer stops a whole source when several live pages record one file as their origin (duplicate-origin twins, #6948): only that file is held `origin_conflict` and the rest syncs. When the pages are verified duplicates (the page the path names, one body, a readable file, compatible ids, one visibility and trust tier, nothing the merge would lose), the sync merges the others into it right after the run: their links, relationship dates, timeline, raw data, user tags, aliases and facts move, their slugs become aliases, and they are soft-deleted without touching the file (restorable for 72 h; the receipt lists any frontmatter they carried that the file lacks). Opt out with `gbrain config set sync.origin_twins.auto_resolve false`. Any other group stays held for a person: `gbrain repair origin-twins --source <id>` previews every group, and `--slug <kept-slug>` detaches the others without deleting them. New index `pages_live_origin_key` makes a new twin unwritable; it is built only on a brain with no twins, so with twins the upgrade changes nothing and doctor `origin_twins` reports \"Index pending\" until the repair resolves them. gbrain doctor --only behavior_changes shows this again.",
+ "message": "Nothing to disclose: this brain is a fresh install at v<version>, after every disclosed behavior change, so the one-time behavior-change notice does not apply.",
"name": "behavior_changes",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/registry-build-checks.json b/test/fixtures/goldens/doctor/registry-build-checks.json
index a02d00ad6f..401437405a 100644
--- a/test/fixtures/goldens/doctor/registry-build-checks.json
+++ b/test/fixtures/goldens/doctor/registry-build-checks.json
@@ -861,6 +861,10 @@
"category": "brain",
"name": "ghost_pages"
},
+ {
+ "category": "brain",
+ "name": "origin_twins"
+ },
{
"category": "brain",
"name": "rename_identity_downgrades"
diff --git a/test/trust-write-gate-drift.test.ts b/test/trust-write-gate-drift.test.ts
index bf82621ca0..15ae9f7e6c 100644
--- a/test/trust-write-gate-drift.test.ts
+++ b/test/trust-write-gate-drift.test.ts
@@ -54,6 +54,7 @@ const EXEMPT: Record<string, string> = {
'src/core/repair/captured-facts.ts': 'owner repair of existing rows',
'src/core/repair/extractor-facts.ts': 'owner repair of existing rows',
'src/core/repair/frontmatter.ts': 'owner repair of existing frontmatter',
+ 'src/core/persistence/twin-merge.ts': 'owner repair or post-sync heal of verified duplicate-origin twins (#6948): moves rows the twin already stores (links, timeline, raw data, tags, aliases, facts) onto the canonical page with their tiers unchanged, then soft-deletes the twin; no new text, and a tier difference holds the file instead of merging',
'src/core/repair/ghost-pages.ts': 'retires an owner-approved ghost page (version + soft delete, lifecycle); no new text',
'src/core/repair/ontology-facts.ts': 'owner repair restoring existing ontology rows',
'src/core/repair/stale-atoms.ts': 'retires stale atoms (lifecycle)',