Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
chore(wave19): CHANGELOG entry and BEHAVIOR_CHANGES rows for #6904, #6910, #6898, #6906; regenerate structural suites
garrytan2af1531fec35
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0311e864cc..0a8b778a12 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,6 +12,32 @@ identifiers and attribution are available in the pre-removal Git revision## [Unreleased] - 2026-10-17+**Writes on a brain whose schema is behind are refused up front, `repair ghost-pages` works on a source with a shared skillpack, and large fact batches no longer stall a managed brain.** Fix wave 19 (#6910, #6904, #6898, #6906, plus two test-infra flakes).++### What changed++| Situation | Before | Now |+|---|---|---|+| A managed write while the brain's schema is behind this gbrain build (#6904) | admitted, used up the request id, then failed at publication with `42703`/`42P01` | refused before admission with `migrations_pending` (reason `schema_behind`, not retryable as is) and one fix, `gbrain apply-migrations --yes` as the role that owns the gbrain tables; the same request id commits afterwards, and a replay of an accepted id still reconciles |+| A publication that fails on a missing table or column | recorded as `owner_exception`, read as a code defect | `storage_error` reason `schema_missing` with a migrate (schema behind) or repair (schema at head: doctor `schema_missing_tables`) next step |+| `gbrain repair ghost-pages` on a source with an adopted skillpack (#6910) | one `skill_bundle_required` refusal aborted the whole apply | legacy ghosts under `skills/` that no pack skill owns are retired from the database like any other ghost; ghosts on files the pack owns are listed as `ghost_skill_pack_member` with the command that restores their file; one refused page is recorded `refused` and the rest still apply |+| Preparing many facts for an entity page with a large `## Facts` table (#6898) | the table was re-parsed and re-rendered once per fact: 200 facts on an 8,000-row (1.6 MB) page took 15–22 s, 1,000 facts took minutes, and every later write on that source waited | parsed and rendered once per request: the same 200 facts take 5.6–7.6 s |+| One batch that gives an entity more than 50 facts | one publication held the brain-wide counter row for every fact (1.75 s for 800 facts on Postgres, past the 1 s lock timeout) | published in parts of at most 50, each its own `extract_facts` request with a part receipt (`publication: partial` or `final_part`); the batch's completion receipt still covers the whole group |+| Conversation fact extraction | could suggest a retired alias page to the model | suggests the page it redirects to, or nothing |+| OpenClaw gateways running the context engine under Node (#6906) | the turn-context envelope import failed silently and a hand-kept copy of the line was used | the envelope lives in an import-free module, byte-identical everywhere; a module on the per-turn context path that fails to load prints one stderr line naming it and the error code |++### What you need to do++Nothing. If a write is refused with `migrations_pending`, run `gbrain apply-migrations --yes` (as the role that owns the gbrain tables) and retry the same request.++### For contributors++- `test/child-job-descendants.test.ts`: every fixture process is reaped after each case, so a failed case can no longer hold the runner's stdout pipe open and hang the shard.+- The #5762 lock-timeout contention case stops the persistence consumer before lifting the injected fault, so a retry after the fault no longer commits under the assertion.+- `test/openclaw-assemble-node-loadable.test.ts` walks the OpenClaw import graph and fails if it reaches a Bun-only import.++## [Unreleased] - 2026-10-17+**A brain that lost its `query_cache` table can finish its nightly purge again.** On a brain where `query_cache` was missing although the schema was at head, every coordinated page purge failed with `42P01`, so the dream cycle's purge phase failed every night with `managed_purge_failed` and the tombstone was never purged (#6911). `apply-migrations` and `db-repair` both reported healthy, because the schema version said the table's migration had run.### What changeddiff --git a/scripts/structural-suites.tsv b/scripts/structural-suites.tsvindex d06a2467fd..1d003c4f24 100644--- a/scripts/structural-suites.tsv+++ b/scripts/structural-suites.tsv@@ -246,6 +246,7 @@ test/model-pricing.test.ts DRIFT GUARD — derived views stay equal to canonicaltest/model-pricing.test.ts no heavy import (cycle guard) 1 readFileSynctest/native-locks-package-boundary.test.ts native/locks package boundary (#6026) 2 readFileSynctest/ocr-run-budget.test.ts doctor ocr_health surfaces the budget-skip counter (#3973) 1 doctor-source-helper+test/openclaw-assemble-node-loadable.test.ts (file-level) 4 readFileSynctest/openclaw-plugin-manifest.test.ts bundled-skill reference closure (nothing bundled points at a non-bundled skill) 1 readFileSynctest/openclaw-plugin-manifest.test.ts plugin membership curation (skills = plugin ∪ exclusions, disjoint) 9 readFileSynctest/openclaw-plugin-manifest.test.ts root OpenClaw plugin manifest 2 readFileSyncdiff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex f3a8e297ef..072ea22407 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -849,6 +849,11 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText }{ since: '0.60.287.0', text: 'The managed purge (autopilot purge phase, the purge job and `gbrain pages purge-deleted`) submits only while the writer has outstanding-request room (a background run stops at `persistence.capacity.background_pause_pct` of the cap). The rest is reported as `write_capacity_deferred` and counted in `capacity_deferred` (cycle: `purged_pages_capacity_deferred`, phase status warn) and is submitted by the next run, where it used to fail each page with `queue_capacity` (`managed_purge_failed`) and count each failure toward parking it.' },{ since: '0.60.288.0', text: 'On a managed brain `gbrain sync --dry-run --json` adds a `convergence` object: a read-only shadow of the level-triggered sync (#6712 PR 4a) that classifies every path of the source the way the coming pass will (matched, import, held, drift and the other classes, each tagged with who acts: none, owner or repair), with predicted file_drift decisions after a read-only screen, `legacy_unverified` counts, deletes with the mass-delete valve verdict and up to 20 sample paths per class. `--redact-paths` turns the sample paths into sha256 prefixes and drops slugs, so the counts can be shared. `gbrain sync status --detail --json` adds the same object (`convergence`, `dry_run: true`) and `convergence_read`; a plain `sync status` skips that heavy read. Nothing is written or admitted, existing keys keep their meaning, and sync behaves exactly as before.' },{ since: '0.60.289.0', text: 'A coordinated page purge or fact purge on a brain whose `query_cache` table is missing (schema at head) no longer fails with 42P01 (`managed_purge_failed` every night): the missing rebuildable cache is skipped, the page purge receipt lists it in `purge.missing_caches` and the store report shows `query_cache` `not_present` with reason `table_missing`. A missing table that holds user data still fails the purge. `gbrain doctor` adds `schema_missing_tables` (warn for a missing rebuildable cache or a table without user data, fail for a missing user-data table; below head it checks the rebuildable caches, whose absence wedges apply-migrations), and the explicit-only, preview-bound `gbrain repair missing-tables` recreates a missing rebuildable cache empty in its head shape after `--apply --expect <hash>`, once per preview. The PGLite `--vacuum` receipt now says whether the VACUUM ran.' },+ // Fix wave 19 (#6904, #6910, #6898, #6906).+ { since: '0.60.289.0', text: 'While the brain\'s schema is behind this gbrain build, a managed write is refused `migrations_pending` (reason `schema_behind`, class caller, not retryable as is) before its request id is admitted, with one fix: `gbrain apply-migrations --yes` as the role that owns the gbrain tables (`tell_user_to_run` when this connection does not own them); the same request_id commits afterwards, a replay of an already accepted id still reconciles, and apply-migrations\' own orchestrators holding the lock are not refused. A publication that fails on a missing table or column (42P01/42703) is recorded as `storage_error` reason `schema_missing` (category `schema_missing`, public category storage) with a migrate or repair verdict instead of `owner_exception`.' },+ { since: '0.60.289.0', text: '`gbrain repair ghost-pages` now retires legacy knowledge ghosts under `skills/` that no live pack skill owns, as a database-only soft delete, and lists ghosts on files the adopted skillpack owns apart as `ghost_skill_pack_member` with a restore step; a per-item caller refusal is recorded `refused` instead of aborting the run.' },+ { since: '0.60.289.0', text: 'Managed fact extraction that gives one entity more than 50 facts in one batch now publishes them as parts of at most 50, each its own extract_facts request published in queue order, so one publication no longer holds the brain-wide write counters for every fact. Each part\'s receipt says so (publication: partial or final_part, part.index/of, part.deferred_facts, part.follow_up); the batch\'s completion receipt still counts the whole group. Conversation entity hints never name a retired alias page (canonical: false, superseded_by/merged_into, alias or redirect status): its canonical page is hinted instead, or nothing when the redirect cannot be followed.' },+ { since: '0.60.289.0', text: 'OpenClaw context engine: when a module that assemble() loads lazily fails to load (for example, a host runtime that rejects Bun-only imports), it now prints one stderr line per module, `[gbrain] context engine: failed to load <module> (<error code>); brain context is degraded`, instead of failing silently. Context assembly still fails open, and nothing else changes.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */