Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge origin/capy/hnsw-recall-flake (#6441, gate-ahead); v0.60.156.0 chore(release): restamp for the slot after #6441

garrytan3bde55ad307f
diff --cc .claude-plugin/plugin.json
index cd068bb72b,cd068bb72b..29a6cf70c7
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
-- "version": "0.60.155.0",
++ "version": "0.60.156.0",
"description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.",
"author": {
"name": "Garry Tan",
diff --cc .codex-plugin/plugin.json
index 3c4974202e,3c4974202e..2d95980924
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
-- "version": "0.60.155.0",
++ "version": "0.60.156.0",
"description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.",
"author": {
"name": "Garry Tan",
diff --cc BOOTSTRAP_FOR_AGENTS.md
index 125a65d9c5,125a65d9c5..769b3509c5
--- a/BOOTSTRAP_FOR_AGENTS.md
+++ b/BOOTSTRAP_FOR_AGENTS.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-runbook-stamp: 0.60.155.0 -->
++<!-- gbrain-runbook-stamp: 0.60.156.0 -->
<!-- This stamp must equal the VERSION file at every release; CI enforces it
(scripts/check-bootstrap-tag.sh). `gbrain bootstrap status` compares it to
the installed binary and warns on skew. -->
diff --cc CHANGELOG.md
index a2e681a2b5,d4236ca120..e5722b1028
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -10,22 -10,19 +10,35 @@@ credits are retained; no result has bee
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
- ## [0.60.155.0] - 2026-10-10
++## [0.60.156.0] - 2026-10-10
+
+**A database-only `validate: false` stamp no longer refuses every write; lost memory writes are counted and replayable.**
+
+The v0.13.1 grandfather stamped `validate: false` into the database. On an unmanaged brain that migration never wrote the file (by design), so once the brain was managed every page with the stamp looked hand-edited and every coordinated write on it, `remember` included, was refused `source_changed` (#6429: 209k of 304k pages on one brain, 68 facts dropped silently). The stamp is now read as what it is, a mechanical database-side annotation, and the next write publishes it to the file. Nothing needs doing after you upgrade; to recover facts that were refused, run `gbrain repair failed-writes --source <id>` on the brain host and apply the set it prints after you agree.
+
+### Itemized changes
+
+- `prepareFileTarget` (`fileMatchesSnapshot`) treats a stored `validate: false` the way #5943 treats a pack-inferred `subtype`: a canonical file without a `validate:` key keeps the stored stamp instead of counting as an uncoordinated local edit. A file that records its own `validate:` decision is still compared as written. `put_page`, `remember`, maintenance pages, lint and `sources reconcile --audit` all route through it.
+- `gbrain repair failed-writes` also lists and replays caller writes (`remember`, `put_page`, `add_timeline_entry`) that ended `conflict` with `source_changed`, with the same dispositions. A replay refused `source_changed` is classified `file_database_drift` only while the file still differs from the database: a reconcile that rewrites only the file makes the write a candidate again (before, only a change to the page row did).
+- Doctor `lost_caller_writes` (ops) counts, per source, the caller writes whose receipt still holds an intent that never landed and names the `repair failed-writes` preview; a write whose replay or retry committed, or whose page was later deleted, is not counted.
+
+### For contributors
+
+- `test/ingestion/put-page-write-through.test.ts` (#6429 case) proves the stamp carry on PGLite (fails before the fix with `source_changed`); `test/repair-failed-writes-conflict-6429.test.ts` covers the conflict replay and the doctor check on PGLite and Postgres; `test/doctor-lost-caller-writes.test.ts` pins the registry wiring. Doctor goldens were regenerated for the new check.
+
+ ## [0.60.155.0] - 2026-10-10
+
+ **The Postgres E2E test for filtered HNSW recall under iterative scan no longer fails at random. It averages four index builds instead of trusting one.** Product code is unchanged.
+
+ `test/e2e/hnsw-iterative-scan-recall-postgres.test.ts` builds a deliberately sparse HNSW index (m 4, ef_construction 8, 20k vectors) and asserts that default recall stays at or above 0.6. pgvector draws each element's graph level from the server's own unseeded random generator, so every build is a different graph. One build failed on CI with 0.5825.
+
+ | measure (local pg16, pgvector 0.8.7) | one build | mean of four builds |
+ |---|---|---|
+ | default recall: mean / sd / min (200 builds) | 0.714 / 0.037 / 0.629 | 0.714 / 0.018 / 0.674 (50 groups) |
+ | forced probe: runs failing at a 0.67 bar, 30 fresh runs each | 3 / 30 | 0 / 30 |
+
+ Both bounds are unchanged (default ≥ 0.6, default − strict ≥ 0.1). The test takes about 5 s instead of 3 s.
+
## [0.60.154.0] - 2026-10-10
**`gbrain serve` answers while a large effects backlog drains.** A big import followed by `gbrain embed --stale` left tens of thousands of queued page embedding effects whose chunks already had current vectors. The serve consumer ran each one through a claim, a guard, a projection read and a completion, and PGLite resolves its queries as one microtask chain, so stdin waited for the whole drain: on a 47k-page brain the first tool call took 432 to 489 s. It now answers in about 2 s, and the same backlog settles in about 18 s.
diff --cc VERSION
index 972b022299,972b022299..2551fe6862
--- a/VERSION
+++ b/VERSION
@@@ -1,1 -1,1 +1,1 @@@
--0.60.155.0
++0.60.156.0
diff --cc docs/guides/repair.md
index d7409a6a66,9f2a76cf27..3d42ce0495
--- a/docs/guides/repair.md
+++ b/docs/guides/repair.md
@@@ -678,15 -678,10 +678,15 @@@ found
<a id="failed-writes"></a>
### Failed writes
+Two kinds of refusal leave a caller's write with a receipt but nothing landed.
On a managed brain whose `tags`, `timeline_entries` or `takes` table has a
`source_id` column gbrain does not create, the managed writer guard of a
-gbrain older than v0.60.38.0 refuses writes it should allow. Each refused write
-keeps a failed receipt with its full intent until receipt compaction
+gbrain older than v0.60.38.0 refuses writes it should allow. And a write ends
+`conflict` with `source_changed` when the page's canonical file and database
+copy differed at publication, as every write did on a brain whose v0.13.1
+grandfather `validate: false` stamp lived only in the database (#6429, fixed
- in v0.60.154.0: that stamp is no longer read as a file edit). Each refused
++in v0.60.156.0: that stamp is no longer read as a file edit). Each refused
+write keeps a receipt with its full intent until receipt compaction
(`persistence.receipt_retention_days`, 30 days by default). `gbrain repair
failed-writes` submits those writes again. It is explicit-only and
preview-bound, and needs v0.60.38.0 or later (`gbrain doctor --json` reports
diff --cc docs/guides/troubleshooting.md
index 1f19e2b48f,1812789bc5..f991ea2dbe
--- a/docs/guides/troubleshooting.md
+++ b/docs/guides/troubleshooting.md
@@@ -14,7 -14,6 +14,7 @@@
|---|---|---|---|---|
| Recall returns conversation facts like "Date said …", "Attendees said …" or "Summary said …" | `gbrain repair conversation-labels` previews them ([conversation labels](repair.md#conversation-labels)); apply the printed command with `--yes` | agent, after the user agrees | `destructive` | `gbrain doctor --only conversation_label_facts --json` is ok |
| Conversation facts are dated 1970-01-01 | same preview: `gbrain repair conversation-labels` (an undated page's pre-fix facts carry a `segment 1970-01-01` context); add a `date:` to the page frontmatter before re-extracting it | agent, after the user agrees | `destructive` | `gbrain doctor --only conversation_label_facts --json` is ok |
- | `remember` or `put_page` refused `source_changed` "The canonical file contains an uncoordinated local edit" on many pages nobody edited, or doctor `lost_caller_writes` warns | upgrade to v0.60.154.0 or later (a database-only v0.13.1 `validate: false` stamp was read as a file edit, #6429); then `gbrain repair failed-writes --source <id>` previews the refused writes and prints the apply command ([failed writes](repair.md#failed-writes)) | agent; the apply after the user agrees | none to preview | `gbrain doctor --only lost_caller_writes --json` is ok |
++| `remember` or `put_page` refused `source_changed` "The canonical file contains an uncoordinated local edit" on many pages nobody edited, or doctor `lost_caller_writes` warns | upgrade to v0.60.156.0 or later (a database-only v0.13.1 `validate: false` stamp was read as a file edit, #6429); then `gbrain repair failed-writes --source <id>` previews the refused writes and prints the apply command ([failed writes](repair.md#failed-writes)) | agent; the apply after the user agrees | none to preview | `gbrain doctor --only lost_caller_writes --json` is ok |
| A gbrain call failed with a code you don't recognize | follow `fix.next` ([protocol](../protocol/AGENT_OPERATOR_v1.md)); `gbrain errors <code>` | agent | as the fix's `consent` | the fix's `verify` |
| A graph read omits a relationship you know existed, or says someone still works somewhere they left | the default read returns relationships true today: repeat with `status: "all"` or `as_of`; to record an end, add a dated timeline line (`Ended works_at [[companies/x]]`) or `add_link ... valid_until` ([temporal edges](temporal-edges.md)) | agent | none | `gbrain doctor --only edge_validity --json` |
| A command exited 3 (`confirmation_required`) | relay `user_message`; run `fix.command` only after the user agrees | agent, after the user agrees | the payload's `effects` | the fix's `verify` |
diff --cc llms-full.txt
index ad9d2165fa,32492c59d5..906558f052
--- a/llms-full.txt
+++ b/llms-full.txt
@@@ -9789,7 -9789,6 +9789,7 @@@ Source: https://raw.githubusercontent.c
|---|---|---|---|---|
| Recall returns conversation facts like "Date said …", "Attendees said …" or "Summary said …" | `gbrain repair conversation-labels` previews them ([conversation labels](repair.md#conversation-labels)); apply the printed command with `--yes` | agent, after the user agrees | `destructive` | `gbrain doctor --only conversation_label_facts --json` is ok |
| Conversation facts are dated 1970-01-01 | same preview: `gbrain repair conversation-labels` (an undated page's pre-fix facts carry a `segment 1970-01-01` context); add a `date:` to the page frontmatter before re-extracting it | agent, after the user agrees | `destructive` | `gbrain doctor --only conversation_label_facts --json` is ok |
- | `remember` or `put_page` refused `source_changed` "The canonical file contains an uncoordinated local edit" on many pages nobody edited, or doctor `lost_caller_writes` warns | upgrade to v0.60.154.0 or later (a database-only v0.13.1 `validate: false` stamp was read as a file edit, #6429); then `gbrain repair failed-writes --source <id>` previews the refused writes and prints the apply command ([failed writes](repair.md#failed-writes)) | agent; the apply after the user agrees | none to preview | `gbrain doctor --only lost_caller_writes --json` is ok |
++| `remember` or `put_page` refused `source_changed` "The canonical file contains an uncoordinated local edit" on many pages nobody edited, or doctor `lost_caller_writes` warns | upgrade to v0.60.156.0 or later (a database-only v0.13.1 `validate: false` stamp was read as a file edit, #6429); then `gbrain repair failed-writes --source <id>` previews the refused writes and prints the apply command ([failed writes](repair.md#failed-writes)) | agent; the apply after the user agrees | none to preview | `gbrain doctor --only lost_caller_writes --json` is ok |
| A gbrain call failed with a code you don't recognize | follow `fix.next` ([protocol](../protocol/AGENT_OPERATOR_v1.md)); `gbrain errors <code>` | agent | as the fix's `consent` | the fix's `verify` |
| A graph read omits a relationship you know existed, or says someone still works somewhere they left | the default read returns relationships true today: repeat with `status: "all"` or `as_of`; to record an end, add a dated timeline line (`Ended works_at [[companies/x]]`) or `add_link ... valid_until` ([temporal edges](temporal-edges.md)) | agent | none | `gbrain doctor --only edge_validity --json` |
| A command exited 3 (`confirmation_required`) | relay `user_message`; run `fix.command` only after the user agrees | agent, after the user agrees | the payload's `effects` | the fix's `verify` |
diff --cc openclaw.plugin.json
index c202ba0be9,c202ba0be9..6c1f0a3955
--- a/openclaw.plugin.json
+++ b/openclaw.plugin.json
@@@ -1,7 -1,7 +1,7 @@@
{
"id": "gbrain-context-engine",
"name": "gbrain",
-- "version": "0.60.155.0",
++ "version": "0.60.156.0",
"description": "Personal knowledge brain with Postgres + pgvector hybrid search",
"family": "bundle-plugin",
"kind": "context-engine",
diff --cc package.json
index 6ffd3f0b36,6ffd3f0b36..393f0c314d
--- a/package.json
+++ b/package.json
@@@ -231,7 -231,7 +231,7 @@@
"bun": ">=1.4.0"
},
"license": "MIT",
-- "version": "0.60.155.0",
++ "version": "0.60.156.0",
"overrides": {
"@ai-sdk/provider-utils": "4.0.56",
"@hono/node-server": "^2.0.5",
diff --cc plugin-variants/gbrain-coding/.claude-plugin/plugin.json
index 4eb8631fa7,4eb8631fa7..9932756bab
--- a/plugin-variants/gbrain-coding/.claude-plugin/plugin.json
+++ b/plugin-variants/gbrain-coding/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-coding",
-- "version": "0.60.155.0",
++ "version": "0.60.156.0",
"description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-coding/.codex-plugin/plugin.json
index 5a4bd7b120,5a4bd7b120..300da5c8ab
--- a/plugin-variants/gbrain-coding/.codex-plugin/plugin.json
+++ b/plugin-variants/gbrain-coding/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-coding",
-- "version": "0.60.155.0",
++ "version": "0.60.156.0",
"description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-coding/README.md
index d1295231c5,d1295231c5..4b7f03a19f
--- a/plugin-variants/gbrain-coding/README.md
+++ b/plugin-variants/gbrain-coding/README.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-plugin-tree-stamp: 0.60.155.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.156.0 -->
# gbrain-coding (generated persona variant — do not hand-edit)
Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant.
diff --cc plugin-variants/gbrain-daily/.claude-plugin/plugin.json
index 3406a3eece,3406a3eece..8f0058438b
--- a/plugin-variants/gbrain-daily/.claude-plugin/plugin.json
+++ b/plugin-variants/gbrain-daily/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-daily",
-- "version": "0.60.155.0",
++ "version": "0.60.156.0",
"description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-daily/.codex-plugin/plugin.json
index d523b5994e,d523b5994e..720afe2427
--- a/plugin-variants/gbrain-daily/.codex-plugin/plugin.json
+++ b/plugin-variants/gbrain-daily/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-daily",
-- "version": "0.60.155.0",
++ "version": "0.60.156.0",
"description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-daily/README.md
index e19d473977,e19d473977..0e000483c4
--- a/plugin-variants/gbrain-daily/README.md
+++ b/plugin-variants/gbrain-daily/README.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-plugin-tree-stamp: 0.60.155.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.156.0 -->
# gbrain-daily (generated persona variant — do not hand-edit)
Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant.
diff --cc plugin/README.md
index 2bfc8ea542,2bfc8ea542..f4292f7f08
--- a/plugin/README.md
+++ b/plugin/README.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-plugin-tree-stamp: 0.60.155.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.156.0 -->
# gbrain plugin skill tree (generated — do not hand-edit)
This tree is the curated skill set for the gbrain Codex and Claude Code
diff --cc src/core/behavior-change-notice.ts
index 5ef7d13e66,548ebfc68a..7cbb3d1956
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@@ -373,7 -373,6 +373,7 @@@ export const BEHAVIOR_CHANGES: Readonly
{ since: '0.60.147.0', text: 'In a brain folder with the Git durability hook, a write that arrives while the effect worker commits a backlog of Git effects now publishes after the group in flight, inside its 5 s wait, instead of returning pending after the whole backlog; Git effects still commit in order. A write waiting on a busy worktree is reported as `writer_busy` without a stale preparing phase.' },
// `since` is a placeholder equal to the branch's VERSION until the merge-slot stamp.
{ since: '0.60.151.0', text: '`delta` and `context_pack` called without `include_private`, and the per-turn context block that harness hooks inject, now apply to their facts the same page-visibility rule they already apply to their pages. With `include_private` from the local CLI, `delta` and `context_pack` output is unchanged.' },
- { since: '0.60.154.0', text: 'A page whose database frontmatter carries the v0.13.1 grandfather `validate: false` while its canonical file does not is no longer refused `source_changed` on write; the next coordinated write publishes the stamp to the file. `remember` and other caller writes that were refused that way are counted by doctor (`lost_caller_writes`) and replayed by `gbrain repair failed-writes --source <id>` on the brain host, after the user agrees to the previewed set.' },
++ { since: '0.60.156.0', text: 'A page whose database frontmatter carries the v0.13.1 grandfather `validate: false` while its canonical file does not is no longer refused `source_changed` on write; the next coordinated write publishes the stamp to the file. `remember` and other caller writes that were refused that way are counted by doctor (`lost_caller_writes`) and replayed by `gbrain repair failed-writes --source <id>` on the brain host, after the user agrees to the previewed set.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --cc templates/bootstrap/template-repo/README.md
index d1bbfe62da,d1bbfe62da..738f6298ab
--- a/templates/bootstrap/template-repo/README.md
+++ b/templates/bootstrap/template-repo/README.md
@@@ -1,6 -1,6 +1,6 @@@
# gbrain agent workspace — template
--<!-- gbrain-template-stamp: 0.60.155.0 -->
++<!-- gbrain-template-stamp: 0.60.156.0 -->
This repository is the **"Use this template"** distribution artifact for a
[gbrain](https://github.com/garrytan/gbrain) personal-agent workspace — the same