Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge origin/master into capy/fence-adoption-unmanaged-widening
garrytan4cf29997d629
diff --cc CHANGELOG.mdindex afd991ed72,f7fa2502d4..c3b8029649--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -10,16 -10,17 +10,27 @@@ credits are retained; no result has beeidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [Unreleased]++**The v0.60.218.0 notes now say where a private fact could become world.** Before v0.60.218.0, fencing a legacy fact into a leftover fence row with a different visibility was refused on a managed brain. An unmanaged brain had no such check, so a private fact could be published as world, in the page file and in the database. The `BEHAVIOR_CHANGES` row and `docs/guides/write-refusals.md#fence_unrenderable` claimed the refusal held everywhere; both now describe the two paths. Code is unchanged: v0.60.218.0 already closed the unmanaged path.++### Itemized changes++- **Docs**: the v0.60.218.0 fact-fence row in `src/core/behavior-change-notice.ts` (wording only) and the `fence_unrenderable` entry in `docs/guides/write-refusals.md` name the unmanaged path.+- **Regression test**: `test/fact-fence-adoption-exits.test.ts` covers an unmanaged brain (PGLite and Postgres): a leftover world cell plus a private legacy fact with the same claim and source keeps the fact private in the file and the database after `extract_facts`. It fails on the build before v0.60.218.0 and passes now.+- **Flake fix**: the #6007 put_page statement-budget e2e test could count 26 or 27 statements against the preparation budget of 25 on a measured write. The consumer's idle no-op embedding settle pass runs two statements on its own connection (the embedding config read and its effect probe). They normally land before the claim commit; when one lands after it, the classifier counted it as preparation. Both now count as a consumer scan, and only when the probe follows the read on that connection, because write paths share the config read. Budgets are unchanged. A synthetic-trace test fails before the change and passes after.++ ## [0.60.238.0] - 2026-10-15++ **`gbrain status --funnel` shows how far your install has come, from clean install to a week of use. It is off until you turn it on, and nothing leaves your machine.** `gbrain status --funnel --enable` starts recording to `~/.gbrain/funnel.jsonl`, `gbrain status --funnel` (or `--json`) reports the counts, and `--delete` removes the file, which turns recording off. Each line holds an event name, a timestamp and the process start time: no page content, queries, slugs or names. There is no network path, no database table and no migration, and with no file every recorder is a single file-exists check. The secret-scan performance tests also stop failing on busy CI machines: they now time CPU work instead of wall-clock time.++ ### Itemized changes++ - **Funnel stages** (`src/core/funnel.ts`, `src/commands/status-funnel.ts`): the report shows counts, not rates, for six stages. `clean_install` is `gbrain init` creating a new brain. `import_useful_data` is an import or full sync that saves at least one page. `recall_new_session` is a `search`, `query` or `recall` that returns results in a later session than a save, import or correction (counted once per session). `correction_applied` is a committed `remember` that supersedes, or `takes_supersede`. `withdrawal_applied` is `forget` or `forget_fact`. `use_after_seven_days` counts distinct days of activity at least seven days after the clean install, or after enabling the funnel when there was no clean install. Saves and recalls are written once per process, so the file grows with sessions, not calls.+ - **Works anywhere** (`src/cli/main.ts`): `status --funnel` runs before any database connection, so it works before `gbrain init` and on a thin client. Plain `gbrain status` output is unchanged. Guide: `docs/guides/adoption-funnel.md`.+ - **Secret-scan perf tests time CPU work** (`test/secret-scan-perf.test.ts`): a busy CI machine took a 400 ms bound to 409 ms. Each case that guards linear work now times the same input at two sizes 10x apart in the same process, and the larger must cost less than 30x the smaller (linear code reads about 10x, the quadratic forms it guards against about 100x). The echo-pass and `high_entropy_assignment` cases keep their absolute bounds, because their inputs are capped. Every timing is process CPU time, which measures the work rather than how long the scheduler made it wait. Under 6 busy loops at nice 10, the same input pair read 0x to 376x on wall clock and 5x to 18x on CPU time. Correctness asserts are unchanged.+ - **Probe results for the tests:** an injected quadratic in `scanText`, `redactFindings` and `privateKeySpans` fails all 34 converted case patterns, both in the old wall-clock file and the new one. A per-character busy loop fails each of the 7 absolute bounds in both files. Under 6 busy loops at nice 10, the old file failed 5 of 5 runs, on 8 cases including the 10k-row table and the 8 MB-tail echo case. The new file passed 45/45 tests in all 5 runs.+## [0.60.237.0] - 2026-10-15**Sync, reconcile and repair loops that used to go round forever now end, or tell you exactly what ends them (#6696).** A sync handed to a running `gbrain serve` refused to resume an unfinished run unless you retyped its options, and flags a managed source can't honor failed late with an unrelated error. A run that had finished could still report itself blocked. A wedged migration printed "WEDGED" and then "All migrations up to date". Writes to a page whose file is gone were told to retry a sync that can never import that file. Hundreds of derived pages that disagreed with their files could only be reconciled one at a time. Each of these now finishes, or names the one command that finishes it. And `gbrain doctor --tier ops` now shows what is wrong in seconds on a brain of any size, with anything it could not finish reported as unknown instead of clear.