Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore: doctor json golden table count after merging master; CHANGELOG and BEHAVIOR_CHANGES since 0.60.315.0 (GBRA-133 PR 2a)

garrytan987fe3df3cf0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7669046704..113654ae51 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,30 @@ credits are retained; no result has been reassigned to another provider. Origina
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
+## [0.60.315.0] - 2026-10-19
+
+**A commit is searchable within about a second whenever any gbrain process is running, and a sync request is never dropped.** Before this, only `gbrain serve` watched for commits: managed sources only, after a 3 s debounce, and a wake could be lost. Classic sources never synced on commit, a lone `gbrain jobs work` took 5 s, and the autopilot daemon waited for its next wall-clock tick (up to 7 minutes). `sync.on_commit` is still off by default.
+
+### What changed
+
+| Situation (10k pages, n=10) | Before (p50 / p95) | Now (p50 / p95) |
+|---|---|---|
+| `gbrain serve`, managed source, commit to search | 3.7 / 4.1 s | 0.6–0.7 / 0.9–1.1 s |
+| `gbrain serve`, classic source | never synced | 0.6–1.1 / 0.7–1.1 s |
+| only `gbrain jobs work` running (Postgres) | 5.0–5.3 / 5.1–5.5 s | 0.6–0.7 / 0.8 s |
+| only the autopilot daemon (classic, on_commit off) | 266 / 406 s | 84 / 138 s |
+
+The other changes:
+- **One commit notifier per host.** It runs in `gbrain serve` (stdio and http), `gbrain jobs work` and the autopilot daemon, with one owner per host and brain. It watches classic sources this host synced as well as managed ones, and starts a sync as soon as the checkout is quiet.
+- **Retries instead of drops.** A failed or refused sync is retried at 5 s, 15 s, 1 min and 5 min, then reported as `notifier_stalled` with the fix and a trace file.
+- **Requests are recorded first.** `gbrain sync trigger`, webhooks and busy delegated syncs record a wanted marker before they run. Whoever drains the source re-checks it afterwards, so a request is never lost to a sync already running. `sync trigger --json` reports queued, coalesced or nudged, and adds a `no_resident` notice with the fix when no resident runs. A managed push webhook answers 409 `refresh_required`.
+- **HEAD-driven autopilot.** The daemon dispatches when a checkout's HEAD moves past the last synced commit, with the wall-clock rule kept as a backstop. Its `--status` grades from a new heartbeat sidecar (#7003).
+- **Worker boot.** On Postgres, `gbrain jobs work` starts the persistence consumer at boot through the existing election (#7002). An idle worker wakes on a queued sync, using LISTEN on a direct session and a 1 s poll behind a pooler.
+- **Visibility.** `gbrain sync status` and the new doctor check `commit_notifier` name the resident that syncs each source, or say none is running and give the fix. Once a resident has run, or `sync.on_commit` is on, search and query responses carry a per-source `freshness` entry (current, behind, syncing, unknown or not_monitored).
+- **Upgrade.** Migration v261 adds `sync_wanted_markers`, `sync_notifier_sources` and `sync_notifier_leases`.
+
+Docs: `docs/guides/on-commit-sync.md`. `GBRAIN_NOTIFIER=0` turns the notifier off for a process.
+
## [0.60.314.0] - 2026-10-19
**A master-red incident closed by hand stays closed, and a master push that reused a full run is judged by that run.** Nightly-watch opened a false master-red (#7056) after a maintainer closed the real one by hand: the incident's newest block was still red, a re-run-failed-jobs attempt left an incomplete manifest, and pushes that reused a full run carried no manifest of their own, so nothing could ever clear it. A full `ci:ubicloud` gate now runs only in `eu-central-h1`, where test timeouts and shard weights are calibrated.
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index 220cd43fec..dd09e85d37 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -961,12 +961,12 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;
{ since: '0.60.312.0', text: '`MENTION_EXTRACTOR_VERSION` is now 7, so the next `gbrain extract --stale` (or maintenance cycle) rescans every inline-body page\'s mentions once: a Katakana name no longer matches inside a longer Katakana word (#6843), and a page of any type whose whole title is one generic word no longer collects mention links (#6958). Stale plain mention rows are removed by that rescan; `typed_ner` edges are untouched. Entity cards and `get_backlinks` show a mention coverage notice (state `pending`) until it finishes.' },
{ since: '0.60.311.0', text: 'The dream `consolidate` phase no longer promotes a cluster in which two typed facts state the same metric, unit and period for the same effective time (an original amount and its correction recorded on one day, or the same statement twice). It used to keep the higher-confidence one as the take and close the other at its own instant, a zero-length validity that silently marked a real fact superseded. Such a cluster is now left unchanged: the phase reports `warn` with `details.clusters_held_same_instant` and `details.same_instant_clusters`, each with the fact ids and a next step (ask which statement is current, then `gbrain forget` the other). Facts an earlier run closed this way are listed by `gbrain repair consolidate-ties`, which reopens exactly the previewed ones on `--apply --expect <hash>`; nothing changes on upgrade.' },
// GBRA-133 PR 2a (commit triggers that never drop a commit). `since` is restamped at the merge slot.
- { since: '0.60.309.0', text: 'With `sync.on_commit` on, the commit watcher now runs in every resident (gbrain serve, serve --http, gbrain jobs work and the autopilot daemon; one owns it per host), watches classic sources last synced on this host as well as managed ones, starts a sync as soon as a quiet HEAD moves (the fixed 3 s debounce is now a 400 ms trailing window, `GBRAIN_NOTIFIER_QUIET_MS`), and keeps a source due across failed or refused starts with retries at 5 s, 15 s, 1 min and 5 min (`notifier_stalled` after that). `GBRAIN_NOTIFIER=0` turns it off per process; `sync.on_commit.sources` excludes sources.' },
- { since: '0.60.309.0', text: 'A sync request is now recorded before it runs and is never dropped: `gbrain sync trigger` answers queued, coalesced or nudged (with `--json`; still `job_id=N` on stdout when a job is queued, exit 0) and adds the notice `no_resident` with the fix when nothing watches the source, a second GitHub push while the first job waits joins it instead of being ignored for 30 s, and requests are drained by residents even with `sync.on_commit` off. A push for a managed source answers 409 `refresh_required` with the `gbrain sources refresh` fix instead of queueing a sync that cannot import it.' },
- { since: '0.60.309.0', text: 'Search and query responses carry a `freshness` entry per source (current, behind, syncing, unknown or not_monitored, the observed HEAD and time, the detection mode and the held-file count), read from the notifier\'s record without a git call, once `sync.on_commit` is on or a resident has observed a source (otherwise search output is unchanged).' },
- { since: '0.60.309.0', text: 'The autopilot daemon dispatches a freshness sync when a checkout\'s HEAD differs from the commit its source last synced, at the next tick instead of after the 5-minute wall-clock interval (which stays as the backstop), once per HEAD and never in the middle of a rebase or merge; classic and managed sources alike. With `sync.on_commit` on, the daemon also reads every checkout\'s HEAD between ticks (every 3 s, git only; `GBRAIN_AUTOPILOT_HEAD_PROBE_MS`) and queues the sync within seconds.' },
- { since: '0.60.309.0', text: 'On Postgres, `gbrain jobs work` starts a persistence consumer at boot (#7002), so queued persistence effects drain after a `serve` stops even while the worker is idle. It joins the existing election: with `persistence.single_consumer` on it waits beside a live owner and takes over when that owner stops; with the switch off (the default) a worker beside a `serve` runs its own full consumer, as every resident process already does, and doctor `two_consumers_on_host` lists it. A queued sync job now wakes an idle worker at once: LISTEN on a direct session (one extra connection), a 1 s sync-queue read behind a transaction pooler; `GBRAIN_WORKER_SYNC_WAKE=0` turns it off.' },
- { since: '0.60.309.0', text: '`gbrain autopilot --status` grades a running daemon from its own schedule (#7003): the daemon writes `autopilot.heartbeat.json` beside its lock with its next tick, so a healthy daemon on a long adaptive sleep no longer reads `stale` (exit 1); a missing or outdated sidecar falls back to the interval-flag rule. `--status --json` adds `stale_after_source` (`daemon` or `flag`) and `next_tick_at`.' },
+ { since: '0.60.315.0', text: 'With `sync.on_commit` on, the commit watcher now runs in every resident (gbrain serve, serve --http, gbrain jobs work and the autopilot daemon; one owns it per host), watches classic sources last synced on this host as well as managed ones, starts a sync as soon as a quiet HEAD moves (the fixed 3 s debounce is now a 400 ms trailing window, `GBRAIN_NOTIFIER_QUIET_MS`), and keeps a source due across failed or refused starts with retries at 5 s, 15 s, 1 min and 5 min (`notifier_stalled` after that). `GBRAIN_NOTIFIER=0` turns it off per process; `sync.on_commit.sources` excludes sources.' },
+ { since: '0.60.315.0', text: 'A sync request is now recorded before it runs and is never dropped: `gbrain sync trigger` answers queued, coalesced or nudged (with `--json`; still `job_id=N` on stdout when a job is queued, exit 0) and adds the notice `no_resident` with the fix when nothing watches the source, a second GitHub push while the first job waits joins it instead of being ignored for 30 s, and requests are drained by residents even with `sync.on_commit` off. A push for a managed source answers 409 `refresh_required` with the `gbrain sources refresh` fix instead of queueing a sync that cannot import it.' },
+ { since: '0.60.315.0', text: 'Search and query responses carry a `freshness` entry per source (current, behind, syncing, unknown or not_monitored, the observed HEAD and time, the detection mode and the held-file count), read from the notifier\'s record without a git call, once `sync.on_commit` is on or a resident has observed a source (otherwise search output is unchanged).' },
+ { since: '0.60.315.0', text: 'The autopilot daemon dispatches a freshness sync when a checkout\'s HEAD differs from the commit its source last synced, at the next tick instead of after the 5-minute wall-clock interval (which stays as the backstop), once per HEAD and never in the middle of a rebase or merge; classic and managed sources alike. With `sync.on_commit` on, the daemon also reads every checkout\'s HEAD between ticks (every 3 s, git only; `GBRAIN_AUTOPILOT_HEAD_PROBE_MS`) and queues the sync within seconds.' },
+ { since: '0.60.315.0', text: 'On Postgres, `gbrain jobs work` starts a persistence consumer at boot (#7002), so queued persistence effects drain after a `serve` stops even while the worker is idle. It joins the existing election: with `persistence.single_consumer` on it waits beside a live owner and takes over when that owner stops; with the switch off (the default) a worker beside a `serve` runs its own full consumer, as every resident process already does, and doctor `two_consumers_on_host` lists it. A queued sync job now wakes an idle worker at once: LISTEN on a direct session (one extra connection), a 1 s sync-queue read behind a transaction pooler; `GBRAIN_WORKER_SYNC_WAKE=0` turns it off.' },
+ { since: '0.60.315.0', text: '`gbrain autopilot --status` grades a running daemon from its own schedule (#7003): the daemon writes `autopilot.heartbeat.json` beside its lock with its next tick, so a healthy daemon on a long adaptive sleep no longer reads `stale` (exit 1); a missing or outdated sidecar falls back to the interval-flag rule. `--status --json` adds `stale_after_source` (`daemon` or `flag`) and `next_tick_at`.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index a4a83e6f5e..8e2647257c 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -906,7 +906,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 149 table(s) the applied migrations create exist.",
+ "message": "All 152 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index 8ad11a81b0..064d3ecf0c 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -953,7 +953,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 149 table(s) the applied migrations create exist.",
+ "message": "All 152 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},