Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge remote-tracking branch 'origin/capy/mpw-integration' into capy/mpw2-w3-rerank-gate

garrytan376cedfed1ce
diff --cc CHANGELOG.md
index 1d5f3393f9,c2369c622d..0e3422d732
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -22,10 -22,8 +22,10 @@@ A fact you save with `remember` used t
- `remember` takes `valid_from`, so a correction can carry the date it became true instead of the day it was saved.
- Fact supersession uses a threshold measured for the brain's embedding model. The default voyage-4 at 1024 dimensions keeps 0.95 and decides as before. Any other model no longer replaces a similar fact by cosine: both stay active and conflict review judges the pair, and exact-text duplicates still merge. Doctor `supersession_calibration` names a command that measures a threshold on synthetic text (about a cent), and `facts.supersession_thresholds` registers one.
- Pinned questions: `gbrain questions pin|list|status|refresh|unpin` and MCP `questions_*`. Answers live in their own private tables with per-sentence evidence, never in search results, exports or git. A sentence whose evidence changed is flagged stale when you read it, and `context_pack` gains optional `pinned_questions` and `withheld` fields. A pin made over MCP stays inactive until the owner activates it. The dream cycle's `standing_questions` phase refreshes active pins under `cycle.standing_questions.budget_usd` (default $1.00 per run). Guide: `docs/guides/pinned-questions.md`.
- - Pinned questions replace `dream.auto_think`. On upgrade, its questions become pins with their budget, cooldown, model and commit setting, inactive when auto_think was off or its budget was 0. `gbrain config get|set dream.auto_think.*` names where each key went.
+ - Pinned questions replace `dream.auto_think`. On upgrade, its questions become inactive pins with their budget, cooldown, model and commit setting, so nothing starts spending; `gbrain questions pin --id <id>` turns one on. `gbrain config get|set dream.auto_think.*` names where each key went.
- Opt-in retrieval settings, each off by default: `search.evidence_date_header` (each delivered evidence block starts with its observation date), `search.entity_anchoring` (a current-state question that names one entity puts that entity's page and the pages about it first), `search.temporal_fact_reserve` (a question about when things happened reserves part of the token budget for dated facts) and `facts.candidate_fusion interleave` (a keyword arm for supersession candidates).
+- `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.
- `GOOGLE_GENERATIVE_AI_BASE_URL` (or `provider_base_urls.google`) routes Gemini chat, expansion and embeddings through a proxy.
- Fixes:
- `put_pages` accepts a byte-identical repeated slug as one write; differing repeats are refused page by page instead of failing the batch. Slow fenced code no longer stalls a batch.
diff --cc src/core/behavior-change-notice.ts
index 3f6f492c4a,c41c28c797..aa50a44422
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@@ -383,9 -383,7 +383,9 @@@ export const BEHAVIOR_CHANGES: Readonly
// Memory proof wave (#6066). `since` is a placeholder equal to the branch's VERSION until the merge-slot stamp.
{ since: '0.60.159.0', text: '`query` now adds saved facts that match the question as rows of their own, at most 3, only in row and token capacity the pages left free, so no page row is pushed out. A fact row has `result_type: "fact"`, `fact_id` and a `follow_up` recall call, and never a page slug or id; a page row whose claim a newer saved fact replaced carries `superseded_claim`. It adds up to three database lookups per query and no model call. Remote callers see only facts whose source pages they could read. `gbrain config set search.query_facts_arm false` restores the previous results.' },
{ since: '0.60.159.0', text: 'A saved fact now replaces a similar older fact by embedding similarity only when the brain\'s embedding model has a measured threshold. The default voyage-4 at 1024 dimensions keeps 0.95 and decides as before. With any other model, both facts stay active and the conflict review sweep judges the pair where it is on; exact-text duplicates are still merged. Doctor `supersession_calibration` names the command that measures a threshold (about a cent of synthetic text, no brain content), and `gbrain config set facts.supersession_thresholds \'{"<provider:model@dims>": <threshold>}\'` registers one.' },
- { since: '0.60.159.0', text: 'Pinned questions replace `dream.auto_think`. On upgrade, each question in `dream.auto_think.questions` becomes a pinned question, with its budget, cooldown, model and commit setting; it is inactive when auto_think was off or its budget was 0. An active pin is refreshed by the dream cycle\'s new `standing_questions` phase, which spends from `cycle.standing_questions.budget_usd`; auto_think never ran in the cycle. `gbrain questions list` shows the pins, `gbrain questions unpin <id>` stops one, and `gbrain config set cycle.standing_questions.enabled false` stops the phase. `gbrain dream --phase auto_think` now exits with a usage error naming the replacement.' },
+ { since: '0.60.159.0', text: 'Pinned questions replace `dream.auto_think`, which never ran in the dream cycle. On upgrade, each question in `dream.auto_think.questions` becomes an inactive pinned question that keeps its cooldown, model and commit setting, and a positive `dream.auto_think.budget` becomes `cycle.standing_questions.budget_usd`; nothing refreshes or spends until you activate a pin. `gbrain questions list` shows the ids, and `gbrain questions pin --id <id>` activates one, after which the dream cycle\'s `standing_questions` phase refreshes it under that budget. `gbrain dream --phase auto_think` now exits with a usage error naming the replacement.' },
+ // 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.159.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. */