Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge remote-tracking branch 'origin/master' into capy/mpw2-w3-rerank-gate
garrytan363254a1e93b
diff --cc CHANGELOG.mdindex 37af997996,500d276d44..466099a8ba--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -10,15 -10,14 +10,23 @@@ credits are retained; no result has beeidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [Unreleased] - memory proof wave 2 W3, confidence-gated reranking (#6445)++**Search can skip the cross-encoder when retrieval already found the answer. It is off by default; `shadow` measures how often that happens without changing results.**++### Itemized changes++- `search.reranker.gate` (off by default) grades search candidates before the cross-encoder. `shadow` records how often the reranker was paying for an answer retrieval already found, in the response's `rerank_gate` metadata, on `--explain` and in a new `rerank_gate` section of `gbrain search stats`, and leaves results unchanged. `on` skips the cross-encoder when the top result is a strong vector match (cosine at least `search.evidence_cosine_floor` and `search.reranker.gate_min_gap` ahead of every other page); that skip is reported as `rerank_gate.skipped`, not as a degradation. The cache key now includes the gate keys and `search.evidence_cosine_floor`.+- `scripts/bench-rerank-gate-latency.ts` measures the gate's latency: recall plus query per question with the gate off and on, warm-up, alternating arm order and fixed concurrency, reporting the mean saving per skipped query and the p95 change.++ ## [0.60.166.0] - 2026-10-11++ **Fixes a flaky managed-sync governor test that turned master red after v0.60.165.0.**++ ### Itemized changes++ - `test/sync-drain-no-admission.test.ts` "a pass that commits keeps the governor quiet" failed when the event loop stalled 60 ms or more at pass start (or one 25 ms timer fired late), so the governor's 10 ms interval woke first and stopped the pass before the first commit. The drain now takes an injected clock (`DrainInput.clock`, test seam, default `Date.now`), and the test advances it 25 ms per committed page while the governor keeps ticking on real timers. The assertion is unchanged. Two forced probes are now part of the test: an 80 ms synchronous loop stall at pass start (failed the old test 5/5) and an 85 ms real delay before the first page (failed it 3/3). A new control test shows the same governor still stops `no_admission` once the clock passes the window before a commit. The file's two hung-pass tests only wait for a stop, so a late timer cannot fail them.+## [0.60.165.0] - 2026-10-11**Managed sync stops instead of hanging, a database publish that never finishes is cancelled and retried, and managed brains write meeting timelines and extracted entities through the coordinator.**diff --cc src/core/behavior-change-notice.tsindex f1b332e03e,6f593e4d28..6a3ddcb361--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@@ -405,8 -405,6 +405,8 @@@ export const BEHAVIOR_CHANGES: Readonly// Fix wave 13 PR2 (GBRA-57).{ since: '0.60.165.0', text: 'Managed sync: a Postgres publish still running 30 s past `persistence.publication_ceiling_ms` (default 5 min) is cancelled (its connection is discarded, nothing commits, and the write is queued again); one that still does not settle makes its owner report `restart_required`. `gbrain sync` stops `drain_stalled` (`publication_overdue`, or `no_admission` after 5 minutes with nothing admitted) instead of waiting forever, and a source more than 100,000 changes behind catches up in bounded stages instead of refusing. `gbrain migrate` with the legacy copier now forwards each page\'s origin path, kind, provenance, `ingested_at` and aliases, and rebuilds the text projections of pages the source had sealed before it switches the engine; a failed rebuild keeps the old engine active and exits 1.' },{ since: '0.60.165.0', text: '`gbrain extract --stale` and `extract links|all --source db` skip and count a page another writer changed mid-run (`skipped_concurrent_write`) instead of aborting the run; the page stays stale for the next run. `extract all --source db` marks a page extracted only when both its links and its timeline finished at the same revision. On a managed brain, `extract timeline --from-meetings` (and its job) now writes through the coordinator as one `managed_maintenance_meeting_timeline` request per entity page, gated at the meeting\'s trust tier; a refused or pending write fails the job and the command exits 1. An owner on an older build refuses that request kind until it upgrades. On a managed brain, `extract_entities` now writes stubs, timeline rows and backlinks through the coordinator (creating a stub needs permission to write pages); a refusal or pending write returns its error envelope and names the entities already written, instead of a raw `writer_coordinator_required` error or a silently missing timeline row.' },+ // W3 confidence-gated reranking (memory proof wave 2). `since` is a placeholder equal to the branch's VERSION until the merge-slot stamp.- { since: '0.60.165.0', text: '`gbrain search stats --json` and the `search_stats` tool now always include a `rerank_gate` section, all zeros until you set `search.reranker.gate` to `shadow`; search results and ranking are unchanged. The search cache key now includes `search.evidence_cosine_floor` and the new gate keys (the result cache stays disabled).' },++ { since: '0.60.166.0', text: '`gbrain search stats --json` and the `search_stats` tool now always include a `rerank_gate` section, all zeros until you set `search.reranker.gate` to `shadow`; search results and ranking are unchanged. The search cache key now includes `search.evidence_cosine_floor` and the new gate keys (the result cache stays disabled).' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */