Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge origin/master (449483cc7, v0.60.203.0) into capy/w1-question-followup
garrytan58bd67a203f4
diff --cc CHANGELOG.mdindex 158edd62d2,7ab713e9d9..60cbdfc2cc--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -10,16 -10,18 +10,28 @@@ credits are retained; no result has beeidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [Unreleased] - recall: relative `since` phrases and `question` with `include_expired` (W1 follow-up)++**`recall` takes `since: "6 weeks ago"` or `"last month"`, and ranks expired facts for a `question` when you pass `include_expired: true`. Both used to be refused.**++### Itemized changes++- `since` on `recall` (MCP and `gbrain recall --since`) falls back to relative phrases after its existing grammar: `"N weeks|months|years ago"`, `"a week ago"`, `"an hour ago"`, compact `"3w"`, `"2mo"`, `"1y"`, and `"last month"`, `"past 2 weeks"`, `"the last 6 weeks"`. Months and years step the UTC calendar and clamp the day. Every value that parsed before gives the same instant (`src/core/facts/since-parse.ts`). In the dev-only A12 agent smoke, an agent's `since: "6 weeks ago"` was refused and it fell back to a less precise call.+- `question` with `include_expired: true` ranks expired, superseded and lapsed facts alongside active ones, under the same read policy and filters, instead of returning `invalid_params`. Each row keeps its `expired_at` and `valid_until`. Without `include_expired`, ranking covers active facts only, as before. `question` with `supersessions` is still refused.+- The `include_expired` and `since` parameter descriptions say how they now behave; no parameter was added, renamed or made required.++ ## [0.60.203.0] - 2026-10-13++ **`gbrain setup claude-code` and `gbrain setup codex` no longer end the install on a question: the first-run settings are relayed as settings in effect in the reply that reports the install.** The wave 2 Cat 41 setup run (gbrain-evals v0.10.80) missed its 60 s wired-recall target at 83.8 s because each install session wired gbrain and then asked about search mode or automatic saving; the reply session cost 13 to 33 s while the agent applied a setting the fresh session did not need. Setup had passed `gbrain init`'s standalone output through unchanged: the search-mode "ask which mode they want" banner, a stale `harness_wiring` decision, "Reply 'defaults' to keep the recommended settings" and a `claude mcp add` quickstart for a step setup had just done. The user still sees the search-mode cost matrix and still chooses; only when and how it is asked changed. No setting, default, CLI flag or MCP schema changed.++ ### Itemized changes++ - **Setup's init call** (`src/commands/setup.ts`): runs `gbrain init --json` in both output modes and prints `Brain ready at <path>`, never init's banner, quickstart or `[AGENT]` block.+ - **`setupFirstRunNotices`** (`src/core/init-first-run.ts`): setup's form of the first-run bundle drops `harness_wiring` (setup just did it), keeps `search_mode` with the cost matrix, `writeback` and `skills_scaffold` with their option commands, and frames them as settings in effect that the agent relays in the install reply without holding the install open. Human output renders the block after `Next:`; `--json` puts it under `notices`. Disclosed in BEHAVIOR_CHANGES.+ - **Docs:** AGENTS.md step 3, INSTALL_FOR_AGENTS.md and `docs/guides/setup.md` ("First-run settings") say the same for the setup path; the plain-`init` rule to stop and confirm is unchanged.+ - **Tests:** two fail-first setup tests (on the old `setup.ts` the human output carried `Do this next`, `claude mcp add` and `Reply 'defaults'`, and `--json` carried `harness_wiring`), four unit cases in `test/init-first-run.test.ts`, and a Cat 41 install-text smoke ($0.55) whose install session ended with "Settings in effect (no answer needed)" and whose fresh session recalled the fact.+ - **Flake fix:** `test/chronicle-auto-decision.test.ts` no longer fails when a run crosses midnight UTC between computing the expected date and writing the receipt; a forced clock probe across midnight fails the old test and passes the new one.+## [0.60.202.0] - 2026-10-13**A page-unit call with its own budget now gets whole pages that fill that budget instead of many partial ones, and search can grade its candidates before the cross-encoder to report how often the reranker was paying for an answer retrieval already found. The page cut is on by default (`gbrain config set search.page_rank_cut off` restores the old path); the grade is off by default and never changes results.**diff --cc src/core/behavior-change-notice.tsindex 23c93dc381,24897a3400..38beba89c9--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@@ -528,8 -528,8 +528,10 @@@ export const BEHAVIOR_CHANGES: Readonly{ since: '0.60.202.0', text: '`recall` with `budget_tokens` and a `return_unit` now fills its budget: saved facts are packed first and the delivered evidence gets the budget they leave, so the same parameters return more evidence (up to about 16% more on long conversations). Before, delivered blocks were dropped after the facts and re-counted with a rougher estimate. `budget_policy: "query_first"` is unchanged.' },// W5 adaptive page-unit cut, default on after memory proof wave 2 (gbrain-evals #126). `since` is the VERSION placeholder.{ since: '0.60.202.0', text: 'A `return_unit: "page"` call that passes its own budget (`token_budget` on `search` and `query`, `budget_tokens` on `recall`) now stops adding pages once their whole delivered pages fill 1.5 times that budget (`search.page_rank_cut: whole_pages`, `search.page_rank_cut_factor: 1.5`), and the search mode\'s chunk-token cut no longer limits it: you get fewer pages, more of them whole, filling the budget, instead of many partial ones. On 72 BEAM conversations (regression evidence, not held-out) accuracy moved -0.25 points against the cut off (lower bound -1.00, non-inferior at the -3 margin) with delivered context at budget. The response reports it as `delivery.page_rank_cut`. `gbrain config set search.page_rank_cut off` restores the old behavior.' },+ // Cat 41 wave 2 TTHW (GBRA-60). `since` is a placeholder equal to the branch's VERSION until the merge-slot stamp.+ { since: '0.60.203.0', text: '`gbrain setup claude-code` and `gbrain setup codex` no longer print `gbrain init`\'s standalone output when they create the brain: no search-mode banner, no "Do this next" quickstart (`claude mcp add` and the install-check round trip) and no `harness_wiring` question, since setup has just wired the harness. They print `Brain ready at <path>`, then the first-run settings once, after `Next:` (an agent block, or `notices` in `--json` without `harness_wiring`): the applied search mode with the cost matrix and automatic saving, framed as settings in effect that the agent relays in the install reply and the user can change at any time, instead of "Reply \'defaults\'". No setting or default changed.' },+ // W1 follow-up (memory proof wave 2). `since` is a placeholder equal to the branch's VERSION until the merge-slot stamp.- { since: '0.60.202.0', text: '`recall` now accepts relative `since` phrases it used to refuse (`"6 weeks ago"`, `"a month ago"`, `"last month"`, `"the past 2 years"`; months and years step the calendar), and `question` with `include_expired: true` now ranks expired and superseded facts alongside active ones instead of refusing the call. Every `since` value that parsed before gives the same window, and calls without `include_expired` rank active facts only, as before.' },++ { since: '0.60.203.0', text: '`recall` now accepts relative `since` phrases it used to refuse (`"6 weeks ago"`, `"a month ago"`, `"last month"`, `"the past 2 years"`; months and years step the calendar), and `question` with `include_expired: true` now ranks expired and superseded facts alongside active ones instead of refusing the call. Every `since` value that parsed before gives the same window, and calls without `include_expired` rank active facts only, as before.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */