Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge commit '00e659d8c0e3c77cd16dcbe3ac86d934d20ec35b' into w6-gate-282
garrytanc4e97bd02854
diff --cc CHANGELOG.mdindex bfa5c945de,83994dc514..e8a8c50bac--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -10,26 -10,30 +10,50 @@@ credits are retained; no result has beeidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).- ## [0.60.281.0] - 2026-10-17++## [0.60.282.0] - 2026-10-17++**The take grader now has an eval, and you can review what it has graded.** Wave 4b W6: a preregistered take-grading eval measures which judge models may ever auto-resolve a take, the dream cycle's take grader stops counting evidence about a look-alike company, and `gbrain takes grades` lists its cached verdicts. Auto-resolve stays off.++### What you'd see++| Situation | Before | Now |+|---|---|---|+| The take grader's evidence mentions a different company whose name only resembles the one in the claim | the judge could grade the claim on the other company's outcome | prompt `hybrid-evidence-v2` tells it that evidence does not count, so the verdict is `unresolvable` |+| The judge wraps its JSON answer in prose, or repeats an answer that agrees | no verdict ("judge output parse failed"), retried next cycle | the answer parses; two answers that disagree still give no verdict |+| You want to see what the grader concluded | only the database table `take_grade_cache` | `gbrain takes grades [--verdict v] [--min-confidence n] [--applied\|--unapplied] [--limit n] [--json]` lists the newest verdict per take and marks judges the eval has not measured |++### What you need to do++Nothing. Verdicts are cached per prompt version, so the next cycles grade each eligible take once more within the phase's existing budget (`cycle.grade_takes.budget_usd`). No take's resolution changes. `gbrain takes grades` runs on the brain host; thin clients refuse it.++### For contributors++`evals/take-grading/` holds the eval (908 seeded synthetic takes, dev and counted splits, `--check` at $0) and its preregistration. On the counted split (790 takes, $9.25), `gpt-6.1-sol` qualified: 496 applied verdicts, none wrong (95% upper bound 0.6%, bar 1%), so `GRADE_TAKES_MEASURED_MODELS` (`src/core/cycle/grade-takes-measured.ts`) lists it. `claude-sonnet-5-5` (121 applied, 1 wrong) and `claude-opus-5-5` (2 applied: right verdicts, confidence below 0.95) did not. Results are mirrored in gbrain-evals.++ ## [0.60.281.0] - 2026-10-17++ **A PGLite brain that is draining a large effects backlog answers requests sooner, and master CI is green again.** When the write owner starts on a backlog of queued embedding effects, its first tick ran the receipt compaction pass, the reservation sweep and the queue `VACUUM` back to back next to the drain, and each drain pass held the event loop for its whole reservation true-up. PGLite statements run synchronously, so a request (or a timer) waited behind all of it: about 0.3 s on a fast machine and 2.2 s on a slow CI runner, which failed `test/persistence-drain-latency.serial.test.ts` on master. Now each of those steps returns to the event loop before the next one, and a request waits behind one step at most.++ ### What you'd see++ | Situation | Before | Now |+ |---|---|---|+ | longest wait for a tool call while 8,000 no-op embedding effects drain (local PGLite) | 290 to 380 ms | 86 to 120 ms |+ | the same on a host about as slow as the CI runner that failed (statements slowed 4.5x) | 1.9 to 2.1 s (over the 2 s bound in 2 of 3 runs) | 1.0 to 1.2 s |+ | time to drain that backlog (local) | about 2.8 s | about 3.5 s |++ ### What to do++ Nothing. Nothing is rewritten on upgrade and there is no migration. Postgres brains are unaffected apart from the smaller settle batch.++ ### Itemized changes++ - `src/core/persistence/journal.ts`: new `yieldToEventLoop`, which resumes from the timer queue so a timer that came due during the last statement chain runs before the next chain. The consumer's effects drain uses it between passes (it used `setImmediate`, which ran the next pass ahead of due timers). `vacuumPersistenceQueues` vacuums each grown queue table in its own statement with a yield before each.+ - `src/core/persistence/compaction-pass.ts` and `src/core/persistence/consumer.ts`: the compaction pass yields after compacting and after the reservation sweep step, and the consumer's maintenance chains yield between the compaction pass, the segment sweep, the queue vacuum and the planner statistics refresh.+ - `src/core/persistence/embedding-noop-settle.ts`: `NOOP_SETTLE_BATCH` is 50 (was 200), because one pass and its reservation true-up hold the event loop on PGLite.+ - `DRAIN_ANSWER_BOUND_MS` and every assertion of the drain latency test are unchanged.+ - New `test/persistence-maintenance-yield.test.ts`: the queue `VACUUM` runs in a later event-loop turn than the size check, the compaction pass, the sweep and the pass record each run in their own turn, and a yield resumes after a timer that came due before it. All three fail on the previous code.+## [0.60.280.0] - 2026-10-17**A managed brain can now make a commit searchable in seconds, and every managed source reports how long that takes.** Until now a commit reached search only when the next scheduled sync ran, which on a managed brain could be most of an hour. Turn on `sync.on_commit` and `gbrain serve` notices the commit within about 3 seconds, waits 3 more for the commit burst to settle, and runs one managed sync for that source. The setting is off by default, so nothing changes until you turn it on.diff --cc src/core/behavior-change-notice.tsindex 1999091567,91800d993c..bbba27228c--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@@ -766,8 -766,6 +766,8 @@@ export const BEHAVIOR_CHANGES: Readonly{ since: '0.60.278.0', text: '`gbrain extract --stale --source <id>` now refuses with `invalid_params` naming `--source-id <id>` instead of running brain-wide; `--source fs` exits 2 `invalid_params` (it exited 1), and `--source db` refuses as ambiguous when a source is named `db`. Rendered extract fixes pin `--source-id`. The end-of-sync extraction nudge stays silent when doctor `links_extraction_lag` would not warn (attendance-blocked meetings no longer count), names both `gbrain extract --stale` and `gbrain extract --stale --catch-up` with estimates, and becomes a run-it-yourself step above two minutes; `extract --stale` JSON gains `actionable`, `attendance_blocked`, `mention_due` and `complete`; the per-source "still owe extraction" line counts only pages that sync imported; and an owner-delegated plain `extract --stale` keeps the 30-minute budget (`--catch-up` is carried through).' },// #6712 #6887 (DB-only overwrite hotfix).{ since: '0.60.279.0', text: 'On a managed brain an incremental `gbrain sync` no longer publishes a committed file edit over a page that was also edited in the database since its last import (for example a `put_page` with `sync.write_through` off). The file is held `file_drift` (side `both`) and the page keeps its edit; `gbrain repair file-drift --slug <slug>` previews both sides. A page deleted in the database is held the same way instead of being recreated from the file. A database change an import keeps (a tag, say) holds nothing: the edit imports and the tag stays. Before, only a first sync, `--full` or a failed delta guarded this case, and the plain sync overwrote the database edit with no hold.' },+ // Wave 4b W6 take grading. `since` is a placeholder equal to the branch's VERSION until the merge-slot stamp.- { since: '0.60.281.0', text: 'The dream cycle\'s take-grading phase (`grade_takes`) now asks its judge with prompt `hybrid-evidence-v2`: evidence about a different company, person or product whose name only resembles the one in the claim no longer counts toward a verdict. An answer with prose around its JSON, or a repeated answer that agrees, now parses instead of failing (two answers that disagree are still no verdict). Verdicts are cached per prompt version, so the next cycles grade each eligible take once more, within the phase\'s budget (`cycle.grade_takes.budget_usd`, default $3 a run). Auto-resolve stays off, so no take\'s resolution changes. New: `gbrain takes grades` lists the cached verdicts for review and marks judges the take-grading eval has not measured.' },++ { since: '0.60.282.0', text: 'The dream cycle\'s take-grading phase (`grade_takes`) now asks its judge with prompt `hybrid-evidence-v2`: evidence about a different company, person or product whose name only resembles the one in the claim no longer counts toward a verdict. An answer with prose around its JSON, or a repeated answer that agrees, now parses instead of failing (two answers that disagree are still no verdict). Verdicts are cached per prompt version, so the next cycles grade each eligible take once more, within the phase\'s budget (`cycle.grade_takes.budget_usd`, default $3 a run). Auto-resolve stays off, so no take\'s resolution changes. New: `gbrain takes grades` lists the cached verdicts for review and marks judges the take-grading eval has not measured.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */