Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

think: remove notes-first reading after its development result; record date-frame and fact-key/time-scope dev results

garrytan9d60b218067c
diff --git a/docs/architecture/key-files/core-services-3.md b/docs/architecture/key-files/core-services-3.md
index 39230f17a0..412a365587 100644
--- a/docs/architecture/key-files/core-services-3.md
+++ b/docs/architecture/key-files/core-services-3.md
@@ -5,7 +5,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `src/core/think/index.ts` — `runThink` builds its internal `LLMClient` via a small adapter wrapping `gateway.chat()` from `src/core/ai/gateway.ts` (not `new Anthropic()` directly) so stdio MCP launches (Claude Desktop, Cursor) that don't inherit shell env still find a key set via `gbrain config set anthropic_api_key` (the gateway reads `~/.gbrain/config.json` AND env). Test seam: `opts.client?: ThinkLLMClient` injection works (`test/think-pipeline.serial.test.ts`, `test/think-gateway-adapter.test.ts`); `opts.stubResponse` short-circuits before any LLM call. When neither key nor client is available, the "no LLM available" stub fires with `NO_ANTHROPIC_API_KEY`. Trajectory injection (default ON): `runThink` orchestrates `classifyIntent(question)` → `extractCandidateEntities(question, retrievedSlugs)` → `findTrajectory` (5s `Promise.race` timeout per candidate, concurrency cap 3) → `formatTrajectoryBlock`. `buildThinkUserMessage` (in `src/core/think/prompt.ts`) has a `trajectory?: ThinkTrajectoryBlockOpts` slot honoring BOTH prompt orderings (calibration mode: retrieval → calibration → trajectory → question; default mode: question → retrieval → trajectory → instruction). The MCP `think` op handler maps `sourceScopeOpts(ctx)` onto `RunThinkOpts` via `thinkSourceScopeOpts(ctx)` (operations.ts), and `runThink` threads the scope into `runGather` (`src/core/think/gather.ts`) — so every gather stream (hybrid retrieval, takes keyword + vector via the engines' scoped `searchTakes`/`searchTakesVector`, graph walk via `traversePaths`) AND trajectory resolution stay within the caller's source grant (federated `sourceIds[]` wins over scalar `sourceId`); pinned by `test/e2e/think-source-isolation-pglite.test.ts`. Config key `think.trajectory_enabled` (default `true`). Any error in the trajectory path degrades to "no block injected" + `TRAJECTORY_INJECTION_FAILED` warning — the think call never crashes from trajectory. Production path skips `fallback_slugify` resolutions (avoid querying invented slugs); the LongMemEval harness accepts them. Pinned by `test/think-trajectory-injection.test.ts`. Debug: `GBRAIN_THINK_DEBUG=1 gbrain think "..."` prints the spliced prompt to stderr. System One (`think/decide.ts`, no work when S2 and S4 are off): S2 decides the trajectory-gating intent (regex `classifyIntent` is the fallback and tie source) and hands gather one precomputed search-intent answer; S4 may return an abstention after gather and before synthesis (`ThinkResult.abstained`, warning `DECIDE_ABSTAINED`, `synthesisOk: false`, synthesis call skipped).
-- `src/core/think/temporal-context.ts` + the date-frame and reading-notes parts of `think/{index,prompt,gather}.ts` — `runThink` reads in a date frame: `resolveThinkTemporalContext` returns the reference day (caller `referenceDate` / MCP `reference_date` / CLI `--reference-date`, validated by `parseReferenceDate` as a real past-or-current YYYY-MM-DD, else today) in `brain.timezone` (UTC when unset or invalid); the user message carries `Current date: <day> (<zone>)` just before the question in both message shapes, and the system prompt carries the date-reading rules without the date itself (stable system text). `renderPagesBlock` adds `date="YYYY-MM-DD"` only when `effective_date_source` is a content date (`event_date|date|published|filename`); a midnight-UTC value is a day-only date and renders as written, any other instant renders in the brain zone. Notes-first reading (`think.reading_notes` `off|on|auto`, default `off` until the held-out verdict; per-call `readingNotes` / `reading_notes` / `--reading-notes`; `auto` = temporal or knowledge-update intent, or ≥ 8 gathered pages) appends `THINK_READING_NOTES_INSTRUCTION`, raises the output cap by 512 tokens, and returns the model's `notes` in `reading_notes` — never in `answer`, citations or a saved synthesis. A response cut before its answer takes the failed-synthesis path with `READING_NOTES_TRUNCATED`. `ReferenceDateError` maps to `invalid_params` in the op. Test: `test/think-reading.test.ts`.
+- `src/core/think/temporal-context.ts` + the date-frame parts of `think/{index,prompt,gather}.ts` — `runThink` reads in a date frame: `resolveThinkTemporalContext` returns the reference day (caller `referenceDate` / MCP `reference_date` / CLI `--reference-date`, validated by `parseReferenceDate` as a real past-or-current YYYY-MM-DD, else today) in `brain.timezone` (UTC when unset or invalid); the user message carries `Current date: <day> (<zone>)` just before the question in both message shapes, and the system prompt carries the date-reading rules without the date itself (stable system text). `renderPagesBlock` adds `date="YYYY-MM-DD"` only when `effective_date_source` is a content date (`event_date|date|published|filename`); a midnight-UTC value is a day-only date and renders as written, any other instant renders in the brain zone. `ReferenceDateError` maps to `invalid_params` in the op. Test: `test/think-reading.test.ts`.
- `src/core/think/intent.ts` + `src/core/think/entity-extract.ts` — pure `classifyIntent(question)` returns `'temporal' | 'knowledge_update' | 'other'` (regex-first, no LLM, `'other'` fast path short-circuits with zero SQL). `extractCandidateEntities(question, retrievedSlugs)` pulls high-precision candidates from retrieved entity-prefix slugs (`people/`, `companies/`, `organizations/`) and medium-precision noun phrases. Stop-word boundaries + leading-verb stripper handle "When did I last meet Marco" → `marco`. Both consumed by `runThink` and the LongMemEval harness so the two paths cannot drift. Pinned by `test/think-intent.test.ts` and `test/think-entity-extract.test.ts`.
diff --git a/docs/eval/TIME_AWARE_RETRIEVAL_PREREG.md b/docs/eval/TIME_AWARE_RETRIEVAL_PREREG.md
index 44aedb4c90..13917777e8 100644
--- a/docs/eval/TIME_AWARE_RETRIEVAL_PREREG.md
+++ b/docs/eval/TIME_AWARE_RETRIEVAL_PREREG.md
@@ -10,7 +10,7 @@ code is removed.
| ID | Mechanism | Where it runs |
|---|---|---|
| R1 | `think` date frame: current date line + content dates on page blocks | product (on) |
-| R2 | `think` notes-first reading (`think.reading_notes`) | product (default set by the verdict) |
+| R2 | `think` notes-first reading | development arm (removed after its development result) |
| F1 | Fact keys, benchmark user-turn fact prompt (replication of key expansion) | eval arm `--fact-keys … --fact-extractor paper` |
| F2 | Fact keys, gbrain's production facts extractor as shipped | eval arm `--fact-extractor production` |
| F3 | Fact keys merged into the keyword index instead of embeddings | eval probe |
diff --git a/docs/eval/TIME_AWARE_RETRIEVAL_RESULTS.md b/docs/eval/TIME_AWARE_RETRIEVAL_RESULTS.md
new file mode 100644
index 0000000000..d34a759303
--- /dev/null
+++ b/docs/eval/TIME_AWARE_RETRIEVAL_RESULTS.md
@@ -0,0 +1,89 @@
+# Time-aware retrieval and reading: development results
+
+Development-split results for the mechanisms preregistered in
+[`TIME_AWARE_RETRIEVAL_PREREG.md`](TIME_AWARE_RETRIEVAL_PREREG.md). None of
+these numbers sets a default; held-out verdicts do.
+
+## Setup
+
+- **Retrieval arms:** `gbrain eval longmemeval` with the eval-only
+ `--fact-keys` / `--time-scope` arms, release default `balanced` (reranker on,
+ autocut off), strict `recall_all@5` and NDCG@5 over distinct sessions,
+ `openai:text-embedding-3-large` at 1536 dimensions, paired bootstrap (10,000
+ draws) over questions. All 500 LongMemEval-S questions are development data;
+ LongMemEval-M uses the same question ids with 500-session haystacks.
+- **Reading arms:** the decision kit (`eval:decide`, gbrain-evals) `memory-qa`
+ think lane — production `runThink` over each conversation's sessions, judged
+ with the official LongMemEval prompts — on the LongMemEval-S 150-question
+ stratified dev sample and the three LoCoMo dev conversations. Records:
+ [`decisions/p6-think-dates/`](decisions/p6-think-dates/).
+
+## Results
+
+### Baselines
+
+| Benchmark | Strict R@5 | Notes |
+|---|---:|---|
+| LongMemEval-S | 450/470 (95.7%) | reproduces the published 449/470 release-default row |
+| LongMemEval-M | 367/470 (78.1%) | temporal-reasoning 81/127, multi-session 81/121 |
+
+### Date frame in `think` (current date + page content dates) — passes development
+
+| Source | Baseline | Date frame | Δ (95% CI) |
+|---|---:|---:|---:|
+| LongMemEval-S think, 150 questions | 80.7% | 90.0% | +9.3 pts [+4.0, +15.3] |
+| LoCoMo dev think, 3 conversations | 76.7% | 89.1% | +12.4 pts (3 clusters) |
+| Retrieval (LME-S, LoCoMo, BEAM-100K) | — | identical | 0.0 |
+
+### Time scope — killed
+
+| Arm | Benchmark | Questions with a range | Wins / losses (strict R@5) | NDCG@5 Δ (95% CI) |
+|---|---|---:|---:|---:|
+| reserved slots | LME-S | 59 | 0 / 3 | −0.013 [−0.027, −0.002] |
+| full partition | LME-S | 59 | 0 / 11 | −0.101 [−0.150, −0.056] |
+| reserved slots | LME-M | 59 | 0 / 1 | −0.011 [−0.030, +0.001] |
+
+Questions without an explicit time cue are byte-identical in every arm. The
+range is not selective on these haystacks: 48% of distractor sessions fall
+inside the parsed range, and 39 of 135 gold sessions fall outside it (for
+example "last Saturday" questions whose evidence spans several Saturdays, or
+preference questions about "this weekend" whose evidence predates it).
+
+### Fact keys
+
+| Arm | Benchmark | Strict R@5 | NDCG@5 Δ (95% CI) | Wins / losses (NDCG) |
+|---|---|---:|---:|---:|
+| chunk keys, published user-fact prompt (Haiku 4.5) | LME-S | 451/470 | +0.008 [+0.002, +0.015] | 21 / 8 |
+| page keys, published prompt | LME-S | 435/470 | −0.018 [−0.027, −0.010] | 13 / 41 |
+| chunk keys, gbrain's facts extractor as shipped (Haiku 4.5) | LME-S | 452/470 | +0.005 [+0.0001, +0.011] | 16 / 8 |
+| chunk keys, published prompt | LME-M | pending | pending | pending |
+
+Page keys (every fact on every chunk) are rejected: the shared prefix makes a
+session's chunks look alike and pushes gold sessions down. The published
+prompt extracts 404 facts per question against 174 for gbrain's extractor,
+which reads the first 8,000 characters of a page and keeps notable facts.
+
+### Notes-first reading — no gain, removed
+
+Same build with the date frame on, notes on vs off
+([`decisions/p6-think-notes/`](decisions/p6-think-notes/)):
+
+| Source | Notes off | Notes on | Δ (95% CI) |
+|---|---:|---:|---:|
+| LongMemEval-S think, 150 questions | 88.7% | 88.0% | −0.7 pts [−3.3, +2.0] |
+| LoCoMo dev think, 3 conversations | 89.4% | 87.9% | −1.5 pts [−3.4, 0.0] |
+
+With the date frame in place, asking the reader for notes before its answer
+added output tokens and no accuracy, so the mode was removed rather than kept
+as an unmeasured option. The published reading-notes gain was measured on
+oracle sessions with direct-answer readers; gbrain's `think` already returns a
+structured answer with citations and gaps.
+
+## Deviations
+
+- The preregistered comparison against the `tokenmax` contextual-synopsis
+ bundle was not run: the benchmark harness does not generate per-chunk
+ synopses at import, so `--mode tokenmax` measured the same embeddings as
+ `balanced`.
+- The reading-arm think lane passed each question's date as the reference
+ date through a local harness change pending in gbrain-evals.
diff --git a/docs/eval/decisions/p6-think-dates/decision.json b/docs/eval/decisions/p6-think-dates/decision.json
new file mode 100644
index 0000000000..948e9018e1
--- /dev/null
+++ b/docs/eval/decisions/p6-think-dates/decision.json
@@ -0,0 +1,266 @@
+{
+ "schema_version": 1,
+ "decision_id": "p6-think-dates",
+ "plan": "P6",
+ "title": "P6 R1: think date frame (current date + page content dates), notes off",
+ "verdict_type": "quality",
+ "stage": "dev",
+ "candidate": {
+ "gbrain": "/workspace/gbrain@0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39",
+ "config": {
+ "think.reading_notes": "off"
+ }
+ },
+ "baseline": {
+ "gbrain": "/workspace/gbrain@5bd9e84978126689b11cf65107c0a9aa0e91e11b",
+ "config": {}
+ },
+ "sources": [
+ {
+ "id": "lme-s-dev",
+ "kind": "memory-qa",
+ "benchmark": "lme-s",
+ "split": "dev",
+ "embed": "real",
+ "limit": 150,
+ "search_pins": {
+ "search.mode": "balanced",
+ "search.reranker.enabled": "false",
+ "search.autocut": "false"
+ },
+ "top_k": 10,
+ "id_field": "id",
+ "exclude_when": [
+ "abstention=true"
+ ],
+ "min_clusters": 10,
+ "comparisons": [
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "noninferiority",
+ "direction": "higher",
+ "cluster_by": "conversation",
+ "description": "guardrail: retrieval unchanged by the date frame",
+ "tolerance": 0.01
+ },
+ {
+ "id": "recall-any-5",
+ "metric": "recall_any_at_5",
+ "gate": "noninferiority",
+ "direction": "higher",
+ "tolerance": 0.01,
+ "cluster_by": "conversation",
+ "description": "at least one gold session in the top five"
+ },
+ {
+ "id": "ndcg-10",
+ "metric": "ndcg_at_10",
+ "gate": "exploratory",
+ "direction": "higher",
+ "cluster_by": "conversation"
+ },
+ {
+ "id": "latency",
+ "metric": "latency_ms",
+ "gate": "exploratory",
+ "direction": "lower",
+ "cluster_by": "conversation"
+ }
+ ],
+ "estimate_usd": 24
+ },
+ {
+ "id": "lme-s-dev-think",
+ "kind": "memory-qa",
+ "benchmark": "lme-s",
+ "split": "dev",
+ "embed": "real",
+ "limit": 150,
+ "search_pins": {
+ "search.mode": "balanced",
+ "search.reranker.enabled": "false",
+ "search.autocut": "false"
+ },
+ "top_k": 10,
+ "id_field": "id",
+ "exclude_when": [],
+ "min_clusters": 10,
+ "comparisons": [
+ {
+ "id": "qa-score",
+ "metric": "qa_score",
+ "gate": "superiority",
+ "direction": "higher",
+ "min_effect": 0,
+ "cluster_by": "conversation",
+ "description": "judged answer correctness through production think"
+ },
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "exploratory",
+ "direction": "higher",
+ "cluster_by": "conversation"
+ },
+ {
+ "id": "qa-input-tokens",
+ "metric": "qa_input_tokens",
+ "gate": "exploratory",
+ "direction": "lower",
+ "cluster_by": "conversation"
+ }
+ ],
+ "estimate_usd": 48,
+ "qa": {
+ "mode": "think",
+ "runs": 1,
+ "sessions": 5
+ }
+ },
+ {
+ "id": "locomo-dev",
+ "kind": "memory-qa",
+ "benchmark": "locomo",
+ "split": "dev",
+ "embed": "real",
+ "limit": null,
+ "search_pins": {
+ "search.mode": "balanced",
+ "search.reranker.enabled": "false",
+ "search.autocut": "false"
+ },
+ "top_k": 10,
+ "id_field": "id",
+ "exclude_when": [
+ "abstention=true"
+ ],
+ "min_clusters": 3,
+ "comparisons": [
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "noninferiority",
+ "direction": "higher",
+ "tolerance": 0.01,
+ "cluster_by": "conversation",
+ "description": "guardrail: strict recall does not drop by more than one point"
+ },
+ {
+ "id": "ndcg-10",
+ "metric": "ndcg_at_10",
+ "gate": "exploratory",
+ "direction": "higher",
+ "cluster_by": "conversation"
+ },
+ {
+ "id": "latency",
+ "metric": "latency_ms",
+ "gate": "exploratory",
+ "direction": "lower",
+ "cluster_by": "conversation"
+ }
+ ],
+ "estimate_usd": 2
+ },
+ {
+ "id": "locomo-dev-think",
+ "kind": "memory-qa",
+ "benchmark": "locomo",
+ "split": "dev",
+ "embed": "real",
+ "limit": null,
+ "search_pins": {
+ "search.mode": "balanced",
+ "search.reranker.enabled": "false",
+ "search.autocut": "false"
+ },
+ "top_k": 10,
+ "id_field": "id",
+ "exclude_when": [],
+ "min_clusters": 3,
+ "comparisons": [
+ {
+ "id": "qa-score",
+ "metric": "qa_score",
+ "gate": "superiority",
+ "direction": "higher",
+ "min_effect": 0,
+ "cluster_by": "conversation",
+ "description": "judged answer correctness through production think"
+ },
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "exploratory",
+ "direction": "higher",
+ "cluster_by": "conversation"
+ },
+ {
+ "id": "qa-input-tokens",
+ "metric": "qa_input_tokens",
+ "gate": "exploratory",
+ "direction": "lower",
+ "cluster_by": "conversation"
+ }
+ ],
+ "estimate_usd": 20,
+ "qa": {
+ "mode": "think",
+ "runs": 1,
+ "sessions": 5
+ }
+ },
+ {
+ "id": "beam-100k-dev",
+ "kind": "memory-qa",
+ "benchmark": "beam-100k",
+ "split": "dev",
+ "embed": "real",
+ "limit": null,
+ "search_pins": {
+ "search.mode": "balanced",
+ "search.reranker.enabled": "false",
+ "search.autocut": "false"
+ },
+ "top_k": 10,
+ "id_field": "id",
+ "exclude_when": [
+ "abstention=true"
+ ],
+ "min_clusters": 10,
+ "comparisons": [
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "noninferiority",
+ "direction": "higher",
+ "tolerance": 0.01,
+ "cluster_by": "conversation",
+ "description": "guardrail: strict recall does not drop by more than one point"
+ },
+ {
+ "id": "ndcg-10",
+ "metric": "ndcg_at_10",
+ "gate": "exploratory",
+ "direction": "higher",
+ "cluster_by": "conversation"
+ },
+ {
+ "id": "latency",
+ "metric": "latency_ms",
+ "gate": "exploratory",
+ "direction": "lower",
+ "cluster_by": "conversation"
+ }
+ ],
+ "estimate_usd": 4
+ }
+ ],
+ "alpha": 0.05,
+ "seed": 42,
+ "draws": 10000,
+ "budget_usd": 150,
+ "created_at": "2026-10-04T23:14:00.025Z",
+ "notes": "R1 (date frame) isolates the current-date line and page content dates in think; reading notes stay off. LME-S think on the 150-question stratified sample is the primary; LoCoMo think dev (3 conversations) is supporting; retrieval sources are guardrails (the change also parses chat-export session dates)."
+}
\ No newline at end of file
diff --git a/docs/eval/decisions/p6-think-dates/verdict.json b/docs/eval/decisions/p6-think-dates/verdict.json
new file mode 100644
index 0000000000..9254a5da87
--- /dev/null
+++ b/docs/eval/decisions/p6-think-dates/verdict.json
@@ -0,0 +1,863 @@
+{
+ "decision_id": "p6-think-dates",
+ "plan": "P6",
+ "stage": "dev",
+ "eligible_for_default": false,
+ "eligibility_note": "Dev verdicts come from development data and never set a default. A held-out verdict comes from the custodian after a committed preregistration.",
+ "verdict_type": "quality",
+ "overall": "inconclusive",
+ "decided_at": "2026-10-05T00:47:52.754Z",
+ "sources": [
+ {
+ "source": "lme-s-dev",
+ "verdict": "pass",
+ "arms": {
+ "baseline": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "5f9974dcaa7b13d1077ff6fdad3c24fd2b975cb4536efb4693663d0e4bc3c84c",
+ "loaded_git_head": "5bd9e84978126689b11cf65107c0a9aa0e91e11b"
+ },
+ "candidate": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "7c1796a95adc86aeb9c8b6f5b603b4b3943bd0b508d607a569d75e703590ebe0",
+ "loaded_git_head": "0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39"
+ }
+ },
+ "family": {
+ "family_id": "p6-think-dates:lme-s-dev",
+ "verdict": "pass",
+ "reasons": [],
+ "alpha": 0.05,
+ "holm_family": [
+ "recall-all-5",
+ "recall-any-5"
+ ],
+ "comparisons": [
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "noninferiority",
+ "status": "pass",
+ "reasons": [],
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "n_excluded": 8,
+ "stats": {
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "mean_a": 0.9436619718309859,
+ "mean_b": 0.9436619718309859,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "mcnemar": {
+ "losses": 0,
+ "wins": 0,
+ "both_pass": 134,
+ "both_fail": 8,
+ "discordant": 0,
+ "p_two_sided": 1
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": 6,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher",
+ "p_holm": 0,
+ "tolerance": 0.01,
+ "p_noninferiority": 0
+ },
+ {
+ "id": "recall-any-5",
+ "metric": "recall_any_at_5",
+ "gate": "noninferiority",
+ "status": "pass",
+ "reasons": [],
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "n_excluded": 8,
+ "stats": {
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "mean_a": 0.9788732394366197,
+ "mean_b": 0.9788732394366197,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "mcnemar": {
+ "losses": 0,
+ "wins": 0,
+ "both_pass": 139,
+ "both_fail": 3,
+ "discordant": 0,
+ "p_two_sided": 1
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": 6,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher",
+ "p_holm": 0,
+ "tolerance": 0.01,
+ "p_noninferiority": 0
+ },
+ {
+ "id": "ndcg-10",
+ "metric": "ndcg_at_10",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "n_excluded": 8,
+ "stats": {
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "mean_a": 0.9482427099525481,
+ "mean_b": 0.9482427099525481,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": null,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data"
+ },
+ "direction": "higher"
+ },
+ {
+ "id": "latency",
+ "metric": "latency_ms",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "n_excluded": 8,
+ "stats": {
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "mean_a": 286.23873239436625,
+ "mean_b": 54.86901408450705,
+ "delta": -231.36971830985917,
+ "se_cluster": 7.3034391039028845,
+ "se_iid": 7.303439103902884,
+ "design_effect": 1.0000000000000004,
+ "effective_n": 141.99999999999994,
+ "ci95": [
+ -248.1492957746478,
+ -219.9802816901409
+ ],
+ "p_two_sided": 0.00009999000099990002,
+ "p_greater": 1,
+ "p_less": 0.00009999000099990002,
+ "p_method": "monte-carlo-sign-flip"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": 20.46120704024214,
+ "min_one_sided_discordant": null,
+ "note": "with 142 pairs in 142 clusters, a two-sided 0.05 test has 80% power for an absolute change of about 20.4612; the observed delta is at least that size"
+ },
+ "direction": "lower"
+ }
+ ]
+ }
+ },
+ {
+ "source": "lme-s-dev-think",
+ "verdict": "pass",
+ "arms": {
+ "baseline": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "5f9974dcaa7b13d1077ff6fdad3c24fd2b975cb4536efb4693663d0e4bc3c84c",
+ "loaded_git_head": "5bd9e84978126689b11cf65107c0a9aa0e91e11b"
+ },
+ "candidate": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "7c1796a95adc86aeb9c8b6f5b603b4b3943bd0b508d607a569d75e703590ebe0",
+ "loaded_git_head": "0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39"
+ }
+ },
+ "family": {
+ "family_id": "p6-think-dates:lme-s-dev-think",
+ "verdict": "pass",
+ "reasons": [],
+ "alpha": 0.05,
+ "holm_family": [
+ "qa-score"
+ ],
+ "comparisons": [
+ {
+ "id": "qa-score",
+ "metric": "qa_score",
+ "gate": "superiority",
+ "status": "pass",
+ "reasons": [],
+ "n_pairs": 150,
+ "n_clusters": 150,
+ "n_excluded": 0,
+ "stats": {
+ "n_pairs": 150,
+ "n_clusters": 150,
+ "mean_a": 0.8066666666666666,
+ "mean_b": 0.9,
+ "delta": 0.09333333333333334,
+ "se_cluster": 0.028920421040663936,
+ "se_iid": 0.028920421040663932,
+ "design_effect": 1.0000000000000004,
+ "effective_n": 149.99999999999994,
+ "ci95": [
+ 0.04,
+ 0.15333333333333332
+ ],
+ "p_two_sided": 0.0022997700229977,
+ "p_greater": 0.000999900009999,
+ "p_less": 0.9997000299970003,
+ "p_method": "monte-carlo-sign-flip"
+ },
+ "mcnemar": {
+ "losses": 3,
+ "wins": 17,
+ "both_pass": 118,
+ "both_fail": 12,
+ "discordant": 20,
+ "p_two_sided": 0.0025768280029296875
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": 0.08102302411035046,
+ "min_one_sided_discordant": 6,
+ "note": "with 150 pairs in 150 clusters, a two-sided 0.05 test has 80% power for an absolute change of about 0.0810; the observed delta is at least that size; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher",
+ "p_holm": 0.00029997000299970003,
+ "min_effect": 0,
+ "p_superiority": 0.00029997000299970003
+ },
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "n_excluded": 8,
+ "stats": {
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "mean_a": 0.9436619718309859,
+ "mean_b": 0.9436619718309859,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "mcnemar": {
+ "losses": 0,
+ "wins": 0,
+ "both_pass": 134,
+ "both_fail": 8,
+ "discordant": 0,
+ "p_two_sided": 1
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": 6,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher"
+ },
+ {
+ "id": "qa-input-tokens",
+ "metric": "qa_input_tokens",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 150,
+ "n_clusters": 150,
+ "n_excluded": 0,
+ "stats": {
+ "n_pairs": 150,
+ "n_clusters": 150,
+ "mean_a": 23.213333333333335,
+ "mean_b": 23.213333333333335,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": null,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data"
+ },
+ "direction": "lower"
+ }
+ ]
+ }
+ },
+ {
+ "source": "locomo-dev",
+ "verdict": "pass",
+ "arms": {
+ "baseline": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "5f9974dcaa7b13d1077ff6fdad3c24fd2b975cb4536efb4693663d0e4bc3c84c",
+ "loaded_git_head": "5bd9e84978126689b11cf65107c0a9aa0e91e11b"
+ },
+ "candidate": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "7c1796a95adc86aeb9c8b6f5b603b4b3943bd0b508d607a569d75e703590ebe0",
+ "loaded_git_head": "0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39"
+ }
+ },
+ "family": {
+ "family_id": "p6-think-dates:locomo-dev",
+ "verdict": "pass",
+ "reasons": [],
+ "alpha": 0.05,
+ "holm_family": [
+ "recall-all-5"
+ ],
+ "comparisons": [
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "noninferiority",
+ "status": "pass",
+ "reasons": [
+ "McNemar treats items as independent; the clustered sign-flip p-value is the primary test here"
+ ],
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "n_excluded": 123,
+ "stats": {
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "mean_a": 0.7564655172413793,
+ "mean_b": 0.7564655172413793,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "mcnemar": {
+ "losses": 0,
+ "wins": 0,
+ "both_pass": 351,
+ "both_fail": 113,
+ "discordant": 0,
+ "p_two_sided": 1
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": 6,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher",
+ "p_holm": 0,
+ "tolerance": 0.01,
+ "p_noninferiority": 0
+ },
+ {
+ "id": "ndcg-10",
+ "metric": "ndcg_at_10",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "n_excluded": 123,
+ "stats": {
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "mean_a": 0.7406125386759213,
+ "mean_b": 0.7406125386759213,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": null,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data"
+ },
+ "direction": "higher"
+ },
+ {
+ "id": "latency",
+ "metric": "latency_ms",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "n_excluded": 123,
+ "stats": {
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "mean_a": 231.07262931034472,
+ "mean_b": 21.83879310344827,
+ "delta": -209.23383620689648,
+ "se_cluster": 5.950696173289319,
+ "se_iid": 2.968129301822358,
+ "design_effect": 4.019480453814904,
+ "effective_n": 115.4378047938051,
+ "ci95": [
+ -217.51056910569096,
+ -199.61518324607314
+ ],
+ "p_two_sided": 0.25,
+ "p_greater": 1,
+ "p_less": 0.125,
+ "p_method": "exact-sign-flip"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": 16.671382440935652,
+ "min_one_sided_discordant": null,
+ "note": "with 464 pairs in 3 clusters, a two-sided 0.05 test has 80% power for an absolute change of about 16.6714; the observed delta is at least that size; clustering inflates variance by 4.02x (effective n about 115.4 of 464)"
+ },
+ "direction": "lower"
+ }
+ ]
+ }
+ },
+ {
+ "source": "locomo-dev-think",
+ "verdict": "pass",
+ "arms": {
+ "baseline": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "5f9974dcaa7b13d1077ff6fdad3c24fd2b975cb4536efb4693663d0e4bc3c84c",
+ "loaded_git_head": "5bd9e84978126689b11cf65107c0a9aa0e91e11b"
+ },
+ "candidate": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "7c1796a95adc86aeb9c8b6f5b603b4b3943bd0b508d607a569d75e703590ebe0",
+ "loaded_git_head": "0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39"
+ }
+ },
+ "family": {
+ "family_id": "p6-think-dates:locomo-dev-think",
+ "verdict": "pass",
+ "reasons": [],
+ "alpha": 0.05,
+ "holm_family": [
+ "qa-score"
+ ],
+ "comparisons": [
+ {
+ "id": "qa-score",
+ "metric": "qa_score",
+ "gate": "superiority",
+ "status": "pass",
+ "reasons": [
+ "McNemar treats items as independent; the clustered sign-flip p-value is the primary test here"
+ ],
+ "n_pairs": 587,
+ "n_clusters": 3,
+ "n_excluded": 0,
+ "stats": {
+ "n_pairs": 587,
+ "n_clusters": 3,
+ "mean_a": 0.7666098807495741,
+ "mean_b": 0.8909710391822828,
+ "delta": 0.12436115843270869,
+ "se_cluster": 0.006212078462093329,
+ "se_iid": 0.01652399156017386,
+ "design_effect": 0.14133311663356926,
+ "effective_n": 4153.308254864993,
+ "ci95": [
+ 0.11392405063291139,
+ 0.1368421052631579
+ ],
+ "p_two_sided": 0.25,
+ "p_greater": 0.125,
+ "p_less": 1,
+ "p_method": "exact-sign-flip"
+ },
+ "mcnemar": {
+ "losses": 15,
+ "wins": 88,
+ "both_pass": 435,
+ "both_fail": 49,
+ "discordant": 103,
+ "p_two_sided": 9.654706383228215e-14
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": 0.01740366719771732,
+ "min_one_sided_discordant": 6,
+ "note": "with 587 pairs in 3 clusters, a two-sided 0.05 test has 80% power for an absolute change of about 0.0174; the observed delta is at least that size; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher",
+ "p_holm": 0.00009999000099990002,
+ "min_effect": 0,
+ "p_superiority": 0.00009999000099990002
+ },
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [
+ "McNemar treats items as independent; the clustered sign-flip p-value is the primary test here"
+ ],
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "n_excluded": 123,
+ "stats": {
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "mean_a": 0.7564655172413793,
+ "mean_b": 0.7564655172413793,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "mcnemar": {
+ "losses": 0,
+ "wins": 0,
+ "both_pass": 351,
+ "both_fail": 113,
+ "discordant": 0,
+ "p_two_sided": 1
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": 6,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher"
+ },
+ {
+ "id": "qa-input-tokens",
+ "metric": "qa_input_tokens",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 587,
+ "n_clusters": 3,
+ "n_excluded": 0,
+ "stats": {
+ "n_pairs": 587,
+ "n_clusters": 3,
+ "mean_a": 15,
+ "mean_b": 15,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": null,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data"
+ },
+ "direction": "lower"
+ }
+ ]
+ }
+ },
+ {
+ "source": "beam-100k-dev",
+ "verdict": "inconclusive",
+ "arms": {
+ "baseline": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "5f9974dcaa7b13d1077ff6fdad3c24fd2b975cb4536efb4693663d0e4bc3c84c",
+ "loaded_git_head": "5bd9e84978126689b11cf65107c0a9aa0e91e11b"
+ },
+ "candidate": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "7c1796a95adc86aeb9c8b6f5b603b4b3943bd0b508d607a569d75e703590ebe0",
+ "loaded_git_head": "0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39"
+ }
+ },
+ "family": {
+ "family_id": "p6-think-dates:beam-100k-dev",
+ "verdict": "inconclusive",
+ "reasons": [
+ "recall-all-5: inconclusive"
+ ],
+ "alpha": 0.05,
+ "holm_family": [
+ "recall-all-5"
+ ],
+ "comparisons": [
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "noninferiority",
+ "status": "inconclusive",
+ "reasons": [
+ "McNemar treats items as independent; the clustered sign-flip p-value is the primary test here",
+ "6 clusters is below the family minimum of 10"
+ ],
+ "n_pairs": 108,
+ "n_clusters": 6,
+ "n_excluded": 12,
+ "stats": {
+ "n_pairs": 108,
+ "n_clusters": 6,
+ "mean_a": 0.4537037037037037,
+ "mean_b": 0.4537037037037037,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "mcnemar": {
+ "losses": 0,
+ "wins": 0,
+ "both_pass": 49,
+ "both_fail": 59,
+ "discordant": 0,
+ "p_two_sided": 1
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": 6,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher",
+ "p_holm": 0,
+ "tolerance": 0.01,
+ "p_noninferiority": 0
+ },
+ {
+ "id": "ndcg-10",
+ "metric": "ndcg_at_10",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 108,
+ "n_clusters": 6,
+ "n_excluded": 12,
+ "stats": {
+ "n_pairs": 108,
+ "n_clusters": 6,
+ "mean_a": 0.5676755153728674,
+ "mean_b": 0.5676755153728674,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": null,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data"
+ },
+ "direction": "higher"
+ },
+ {
+ "id": "latency",
+ "metric": "latency_ms",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 108,
+ "n_clusters": 6,
+ "n_excluded": 12,
+ "stats": {
+ "n_pairs": 108,
+ "n_clusters": 6,
+ "mean_a": 279.27592592592583,
+ "mean_b": 61.330555555555534,
+ "delta": -217.94537037037037,
+ "se_cluster": 2.8257944061914877,
+ "se_iid": 4.2480772398609075,
+ "design_effect": 0.442482717747983,
+ "effective_n": 244.07732927890675,
+ "ci95": [
+ -223.2462962962963,
+ -213.1351851851852
+ ],
+ "p_two_sided": 0.03125,
+ "p_greater": 1,
+ "p_less": 0.015625,
+ "p_method": "exact-sign-flip"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": 7.916703839886082,
+ "min_one_sided_discordant": null,
+ "note": "with 108 pairs in 6 clusters, a two-sided 0.05 test has 80% power for an absolute change of about 7.9167; the observed delta is at least that size"
+ },
+ "direction": "lower"
+ }
+ ]
+ }
+ }
+ ]
+}
diff --git a/docs/eval/decisions/p6-think-notes/decision.json b/docs/eval/decisions/p6-think-notes/decision.json
new file mode 100644
index 0000000000..be12234bdd
--- /dev/null
+++ b/docs/eval/decisions/p6-think-notes/decision.json
@@ -0,0 +1,124 @@
+{
+ "schema_version": 1,
+ "decision_id": "p6-think-notes",
+ "plan": "P6",
+ "title": "P6 R2: notes-first reading in think (notes on vs off, same build with the date frame)",
+ "verdict_type": "quality",
+ "stage": "dev",
+ "candidate": {
+ "gbrain": "/workspace/gbrain@0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39",
+ "config": {
+ "think.reading_notes": "on"
+ }
+ },
+ "baseline": {
+ "gbrain": "/workspace/gbrain@0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39",
+ "config": {
+ "think.reading_notes": "off"
+ }
+ },
+ "sources": [
+ {
+ "id": "lme-s-dev-think",
+ "kind": "memory-qa",
+ "benchmark": "lme-s",
+ "split": "dev",
+ "embed": "real",
+ "limit": 150,
+ "search_pins": {
+ "search.mode": "balanced",
+ "search.reranker.enabled": "false",
+ "search.autocut": "false"
+ },
+ "top_k": 10,
+ "id_field": "id",
+ "exclude_when": [],
+ "min_clusters": 10,
+ "comparisons": [
+ {
+ "id": "qa-score",
+ "metric": "qa_score",
+ "gate": "superiority",
+ "direction": "higher",
+ "min_effect": 0,
+ "cluster_by": "conversation",
+ "description": "judged answer correctness through production think"
+ },
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "exploratory",
+ "direction": "higher",
+ "cluster_by": "conversation"
+ },
+ {
+ "id": "qa-input-tokens",
+ "metric": "qa_input_tokens",
+ "gate": "exploratory",
+ "direction": "lower",
+ "cluster_by": "conversation"
+ }
+ ],
+ "estimate_usd": 48,
+ "qa": {
+ "mode": "think",
+ "runs": 1,
+ "sessions": 5
+ }
+ },
+ {
+ "id": "locomo-dev-think",
+ "kind": "memory-qa",
+ "benchmark": "locomo",
+ "split": "dev",
+ "embed": "real",
+ "limit": null,
+ "search_pins": {
+ "search.mode": "balanced",
+ "search.reranker.enabled": "false",
+ "search.autocut": "false"
+ },
+ "top_k": 10,
+ "id_field": "id",
+ "exclude_when": [],
+ "min_clusters": 3,
+ "comparisons": [
+ {
+ "id": "qa-score",
+ "metric": "qa_score",
+ "gate": "superiority",
+ "direction": "higher",
+ "min_effect": 0,
+ "cluster_by": "conversation",
+ "description": "judged answer correctness through production think"
+ },
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "exploratory",
+ "direction": "higher",
+ "cluster_by": "conversation"
+ },
+ {
+ "id": "qa-input-tokens",
+ "metric": "qa_input_tokens",
+ "gate": "exploratory",
+ "direction": "lower",
+ "cluster_by": "conversation"
+ }
+ ],
+ "estimate_usd": 25,
+ "qa": {
+ "mode": "think",
+ "runs": 1,
+ "sessions": 5
+ }
+ }
+ ],
+ "alpha": 0.05,
+ "seed": 42,
+ "draws": 10000,
+ "budget_usd": 100,
+ "created_at": "2026-10-05T00:48:03.645Z",
+ "notes": "R2 isolates notes-first reading: the same build (date frame on) with think.reading_notes on vs off."
+}
\ No newline at end of file
diff --git a/docs/eval/decisions/p6-think-notes/verdict.json b/docs/eval/decisions/p6-think-notes/verdict.json
new file mode 100644
index 0000000000..8ab7377e71
--- /dev/null
+++ b/docs/eval/decisions/p6-think-notes/verdict.json
@@ -0,0 +1,349 @@
+{
+ "decision_id": "p6-think-notes",
+ "plan": "P6",
+ "stage": "dev",
+ "eligible_for_default": false,
+ "eligibility_note": "Dev verdicts come from development data and never set a default. A held-out verdict comes from the custodian after a committed preregistration.",
+ "verdict_type": "quality",
+ "overall": "inconclusive",
+ "decided_at": "2026-10-05T01:39:20.209Z",
+ "sources": [
+ {
+ "source": "lme-s-dev-think",
+ "verdict": "inconclusive",
+ "arms": {
+ "baseline": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "7c1796a95adc86aeb9c8b6f5b603b4b3943bd0b508d607a569d75e703590ebe0",
+ "loaded_git_head": "0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39"
+ },
+ "candidate": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "7c1796a95adc86aeb9c8b6f5b603b4b3943bd0b508d607a569d75e703590ebe0",
+ "loaded_git_head": "0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39"
+ }
+ },
+ "family": {
+ "family_id": "p6-think-notes:lme-s-dev-think",
+ "verdict": "inconclusive",
+ "reasons": [
+ "qa-score: inconclusive"
+ ],
+ "alpha": 0.05,
+ "holm_family": [
+ "qa-score"
+ ],
+ "comparisons": [
+ {
+ "id": "qa-score",
+ "metric": "qa_score",
+ "gate": "superiority",
+ "status": "inconclusive",
+ "reasons": [
+ "an improvement larger than 0 is not shown (Holm p = 0.7486 > 0.05); this is not evidence of a loss"
+ ],
+ "n_pairs": 150,
+ "n_clusters": 150,
+ "n_excluded": 0,
+ "stats": {
+ "n_pairs": 150,
+ "n_clusters": 150,
+ "mean_a": 0.8866666666666667,
+ "mean_b": 0.88,
+ "delta": -0.006666666666666667,
+ "se_cluster": 0.014947085390483146,
+ "se_iid": 0.014947085390483145,
+ "design_effect": 1.0000000000000004,
+ "effective_n": 149.99999999999994,
+ "ci95": [
+ -0.03333333333333333,
+ 0.02
+ ],
+ "p_two_sided": 1,
+ "p_greater": 0.8164183581641836,
+ "p_less": 0.5008499150084992,
+ "p_method": "monte-carlo-sign-flip"
+ },
+ "mcnemar": {
+ "losses": 3,
+ "wins": 2,
+ "both_pass": 130,
+ "both_fail": 15,
+ "discordant": 5,
+ "p_two_sided": 1
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": 0.04187553349481874,
+ "min_one_sided_discordant": 6,
+ "note": "with 150 pairs in 150 clusters, a two-sided 0.05 test has 80% power for an absolute change of about 0.0419; the observed delta is below that size, so a null result here is not evidence of no effect; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher",
+ "p_holm": 0.7486251374862514,
+ "min_effect": 0,
+ "p_superiority": 0.7486251374862514
+ },
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "n_excluded": 8,
+ "stats": {
+ "n_pairs": 142,
+ "n_clusters": 142,
+ "mean_a": 0.9436619718309859,
+ "mean_b": 0.9436619718309859,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "mcnemar": {
+ "losses": 0,
+ "wins": 0,
+ "both_pass": 134,
+ "both_fail": 8,
+ "discordant": 0,
+ "p_two_sided": 1
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": 6,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher"
+ },
+ {
+ "id": "qa-input-tokens",
+ "metric": "qa_input_tokens",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 150,
+ "n_clusters": 150,
+ "n_excluded": 0,
+ "stats": {
+ "n_pairs": 150,
+ "n_clusters": 150,
+ "mean_a": 23.213333333333335,
+ "mean_b": 23.213333333333335,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": null,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data"
+ },
+ "direction": "lower"
+ }
+ ]
+ }
+ },
+ {
+ "source": "locomo-dev-think",
+ "verdict": "inconclusive",
+ "arms": {
+ "baseline": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "7c1796a95adc86aeb9c8b6f5b603b4b3943bd0b508d607a569d75e703590ebe0",
+ "loaded_git_head": "0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39"
+ },
+ "candidate": {
+ "package": "gbrain",
+ "declared_pin": "github:garrytan/gbrain#739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "declared_sha": "739e5cc89ca43b9b9351f0f203c7b12a7c0c571c",
+ "version": "0.60.48.0",
+ "package_sha256": "7c1796a95adc86aeb9c8b6f5b603b4b3943bd0b508d607a569d75e703590ebe0",
+ "loaded_git_head": "0cba0ec9c35612d8652bcdaf55dbdb4f55d32c39"
+ }
+ },
+ "family": {
+ "family_id": "p6-think-notes:locomo-dev-think",
+ "verdict": "inconclusive",
+ "reasons": [
+ "qa-score: inconclusive"
+ ],
+ "alpha": 0.05,
+ "holm_family": [
+ "qa-score"
+ ],
+ "comparisons": [
+ {
+ "id": "qa-score",
+ "metric": "qa_score",
+ "gate": "superiority",
+ "status": "inconclusive",
+ "reasons": [
+ "McNemar treats items as independent; the clustered sign-flip p-value is the primary test here",
+ "an improvement larger than 0 is not shown (Holm p = 1.0000 > 0.05); this is not evidence of a loss"
+ ],
+ "n_pairs": 587,
+ "n_clusters": 3,
+ "n_excluded": 0,
+ "stats": {
+ "n_pairs": 587,
+ "n_clusters": 3,
+ "mean_a": 0.8943781942078365,
+ "mean_b": 0.879045996592845,
+ "delta": -0.015332197614991482,
+ "se_cluster": 0.011104515918088198,
+ "se_iid": 0.009774154610923767,
+ "design_effect": 1.2907461931830273,
+ "effective_n": 454.7756972673586,
+ "ci95": [
+ -0.03347280334728033,
+ 0
+ ],
+ "p_two_sided": 0.5,
+ "p_greater": 1,
+ "p_less": 0.25,
+ "p_method": "exact-sign-flip"
+ },
+ "mcnemar": {
+ "losses": 21,
+ "wins": 12,
+ "both_pass": 504,
+ "both_fail": 50,
+ "discordant": 33,
+ "p_two_sided": 0.16275565745308995
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": 0.03111024765856505,
+ "min_one_sided_discordant": 6,
+ "note": "with 587 pairs in 3 clusters, a two-sided 0.05 test has 80% power for an absolute change of about 0.0311; the observed delta is below that size, so a null result here is not evidence of no effect; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05; clustering inflates variance by 1.29x (effective n about 454.8 of 587)"
+ },
+ "direction": "higher",
+ "p_holm": 1,
+ "min_effect": 0,
+ "p_superiority": 1
+ },
+ {
+ "id": "recall-all-5",
+ "metric": "recall_all_at_5",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [
+ "McNemar treats items as independent; the clustered sign-flip p-value is the primary test here"
+ ],
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "n_excluded": 123,
+ "stats": {
+ "n_pairs": 464,
+ "n_clusters": 3,
+ "mean_a": 0.7564655172413793,
+ "mean_b": 0.7564655172413793,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "mcnemar": {
+ "losses": 0,
+ "wins": 0,
+ "both_pass": 351,
+ "both_fail": 113,
+ "discordant": 0,
+ "p_two_sided": 1
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": 6,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data; an exact McNemar test needs at least 6 wins with zero losses to reach 0.05"
+ },
+ "direction": "higher"
+ },
+ {
+ "id": "qa-input-tokens",
+ "metric": "qa_input_tokens",
+ "gate": "exploratory",
+ "status": "report_only",
+ "reasons": [],
+ "n_pairs": 587,
+ "n_clusters": 3,
+ "n_excluded": 0,
+ "stats": {
+ "n_pairs": 587,
+ "n_clusters": 3,
+ "mean_a": 15,
+ "mean_b": 15,
+ "delta": 0,
+ "se_cluster": 0,
+ "se_iid": 0,
+ "design_effect": null,
+ "effective_n": null,
+ "ci95": [
+ 0,
+ 0
+ ],
+ "p_two_sided": 1,
+ "p_greater": 1,
+ "p_less": 1,
+ "p_method": "degenerate"
+ },
+ "power": {
+ "alpha": 0.05,
+ "power": 0.8,
+ "mde": null,
+ "min_one_sided_discordant": null,
+ "note": "no paired variation was observed, so the detectable effect cannot be estimated from this data"
+ },
+ "direction": "lower"
+ }
+ ]
+ }
+ }
+ ]
+}
diff --git a/docs/guides/time-aware-recall.md b/docs/guides/time-aware-recall.md
index fc970b4ccf..a61566cb9b 100644
--- a/docs/guides/time-aware-recall.md
+++ b/docs/guides/time-aware-recall.md
@@ -4,8 +4,6 @@
timezone, it sees the content date of each page it reads, and it resolves
relative time words against the right one: "last month" in your question
against today, "yesterday" inside a meeting note against that note's date.
-It can also take brief reading notes before answering, which helps when the
-answer is spread across several dated pages.
## Say to your agent
@@ -13,9 +11,6 @@ answer is spread across several dated pages.
`gbrain think "What did I decide about pricing last month?"`; the answer is
grounded in today's date and each page's date.
- *"Answer as if today were March 1, 2024."* — `gbrain think "…" --reference-date 2024-03-01`.
-- *"Show me your reading notes."* — `gbrain think "…" --reading-notes on --json`;
- the notes come back in `reading_notes.notes`.
-- *"Always read with notes for date questions."* — `gbrain config set think.reading_notes auto`.
## What the reader sees
@@ -35,22 +30,13 @@ answer is spread across several dated pages.
`effective_date_source`, so an agent reading `search` or `query` output
directly can apply the same rule.
-## Reading notes
-
-| Setting | Behavior |
-|---|---|
-| `think.reading_notes off` (default) | The reader answers directly. |
-| `think.reading_notes on` | The reader first writes brief notes (the facts and dates each relevant page gives, under 150 words), then answers. |
-| `think.reading_notes auto` | Notes only for time and knowledge-update questions, or when think gathered 8 or more pages. |
-
-Per call: `gbrain think "…" --reading-notes on|off|auto`, or MCP
-`think { reading_notes: "on" }`. Notes add up to 512 output tokens, so they
-cost a little more and take a little longer. They return in
-`reading_notes: { mode, notes }` and never appear in `answer`, citations or a
-saved synthesis (`--save`). If the model's output is cut off before the
-answer, the call reports `synthesis_status: output_truncated` with the warning
-`READING_NOTES_TRUNCATED`, saves nothing, and can be retried with
-`--reading-notes off`.
+## Measured effect
+
+On the LongMemEval-S development sample, `think` answered 90.0% of questions
+correctly with the date frame against 80.7% without it (+9.3 points, 95% CI
+[+4.0, +15.3]); on the LoCoMo development conversations, 89.1% against 76.7%.
+Retrieval is unchanged. Results:
+[`docs/eval/TIME_AWARE_RETRIEVAL_RESULTS.md`](../eval/TIME_AWARE_RETRIEVAL_RESULTS.md).
## Measuring it
diff --git a/llms.txt b/llms.txt
index 33de954ef3..84613830a1 100644
--- a/llms.txt
+++ b/llms.txt
@@ -41,7 +41,7 @@ Repo: https://github.com/garrytan/gbrain
- [docs/guides/scaling-skills.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/scaling-skills.md): Three-tier architecture for agents with 300+ skills: always-loaded, resolver-routed, and dormant. Per-turn token math, the v0.41.7.0 compact list-format resolver, and the `gbrain doctor` safety net. 306 skills, ~21K tokens freed per turn, zero capability loss.
- [docs/guides/life-chronicle.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/life-chronicle.md): Life Chronicle automatic event extraction (on by default): what qualifies, per-page cost and daily ceiling, privacy, the receipt -> `gbrain dream --phase chronicle` -> `gbrain day` check, skip/failure codes with fixes, opt-out `gbrain config set auto_chronicle false`, history backfill.
- [docs/guides/push-context.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/push-context.md): Push-based context: the brain volunteers confidence-gated pages from the rolling conversation window. Three channels (ambient reflex, volunteer_context op, gbrain watch), config knobs, and the volunteered-vs-used feedback loop.
-- [docs/guides/time-aware-recall.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/time-aware-recall.md): Time-aware recall in `gbrain think`: the current date in brain.timezone (or `--reference-date`), content dates on each page block, and notes-first reading (`think.reading_notes off|on|auto`, per-call `--reading-notes`); notes never enter the answer or a saved synthesis.
+- [docs/guides/time-aware-recall.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/time-aware-recall.md): Time-aware recall in `gbrain think`: the current date in brain.timezone (or `--reference-date`) and content dates on each page block, with the measured accuracy gain.
- [docs/evidence-delivery.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/evidence-delivery.md): Evidence delivery (`return_unit`): window / section / page / auto evidence instead of chunks on search, query, recall and think, packed into a token budget; response fields, fallback codes, authorization guarantees, latency, and the frozen-hit `assemble_evidence` interface for evals.
- [docs/guides/github-source.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/github-source.md): Mirror GitHub issues, PRs, comments, reviews and CI checks as brain pages. One key + one registration command to a searchable mirror; webhook-driven instant refresh, poll-sweep fallback, daily reconcile, App-credential option.
- [docs/mcp/DEPLOY.md](https://raw.githubusercontent.com/garrytan/gbrain/master/docs/mcp/DEPLOY.md): MCP server deployment.
diff --git a/scripts/llms-config.ts b/scripts/llms-config.ts
index 6256aee0d2..4f5a1ba30f 100644
--- a/scripts/llms-config.ts
+++ b/scripts/llms-config.ts
@@ -191,7 +191,7 @@ export const SECTIONS: DocSection[] = [
{
title: "docs/guides/time-aware-recall.md",
description:
- "Time-aware recall in `gbrain think`: the current date in brain.timezone (or `--reference-date`), content dates on each page block, and notes-first reading (`think.reading_notes off|on|auto`, per-call `--reading-notes`); notes never enter the answer or a saved synthesis.",
+ "Time-aware recall in `gbrain think`: the current date in brain.timezone (or `--reference-date`) and content dates on each page block, with the measured accuracy gain.",
path: "docs/guides/time-aware-recall.md",
includeInFull: false,
},
diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsv
index ed3d9244b1..9c4e59f6dd 100644
--- a/scripts/module-size-limits.tsv
+++ b/scripts/module-size-limits.tsv
@@ -36,7 +36,7 @@ src/core/embedding-migration.ts 1569 ratchet new row: crossed 1500 in v0.46.25.0
src/core/github-source.ts 1530 ratchet new row: crossed the 1500 unlisted cap in v0.46.23.0 review fix wave (scope-state gating, client hardening, symlink containment); merged reliability/shared-skills source integration; managed sweep lease wrapper; fix wave 3 lane A: config parser peeled to github-source-config.ts (-47), +account pin wiring and pinned-installation refresh
src/commands/hook.ts 1903 ratchet cathedral-5 heartbeat extraction offsets part of the BrainBench-seam growth; grown v0.46.26.0 megawave hooks-ipc (#4245); +108 monthly backup check: banner + gated session-start note + detached spawn (backup/status-file readers); +28 ship-review egress hardening: per-harness capture dispatch (capture-spec), memorable gate + receipt + relay block, fail-closed unscanned/newest-guess skips; +79 ambient-writeback WP4: hookStop bank step (gate -> bankWritebackTurn -> IPC flush; gate/bank logic live in core/facts + corpus-segments); +41 adversarial fix wave: wide-tail retry when the 128KB window misses the user turn, by-design heartbeat outcome classes, source-in-name banking; +11 #5413 session-end skips claude-cli self-transcripts; +11 #5701: hook lanes pass allowOversize so a long session reaches the bounded tail read
src/core/chunkers/code.ts 1588 ratchet new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (decorated-python defs #3821, version-gate + timeout chunker fixes); grown wave-g (#4511): named defs never folded into merged chunks; grown #4669: skip WASM parse for languages without TOP_LEVEL_TYPES; +6 N13-1: CodeChunkMetadata.definesFunction field + merge-guard stamp (predicate lives in def-types.ts)
-src/core/config.ts 1839 ratchet +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured); +1 P6: think.reading_notes key registration
+src/core/config.ts 1838 ratchet +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured)
src/core/bootstrap/harness.ts 2711 ratchet +29 live-PGLite-serve lane: LIVE_SERVE refusal ahead of source resolution + unpinned --token hooks (CI e2e fix); +46 wave review: resolveHookSource dep (serve-parity resolver + federated grant), --source shape validation, loud SOURCE_UNRESOLVED instead of a silent 'default'; +10: #4574 parseCodexBlockBearer http_headers shape + legacy bearer_token fallback; +4 at megawave/wave-k merge; +codex hooks lane: step-7 codex hooks.json + config.toml trust pair, removeHarness arm; +234 ambient-writeback WP3: kind:'instructions' targets (plan/apply/converge-off/remove/status probes, OV-A4 override pre-check) — splice/render mechanics live in instructions-block.ts; +59 adversarial fix wave: registrar-mode block suppression, converge-failure receipt tracking, MCP-confirmed guard before block install; +26 round-3 fixes: codex-lane MCP-confirmed guard + smoke-rollback block strip; master: | merged v0.48.1.0 true-up; +41 #4897 resolveImplicitSource dep + defaultResolveImplicitSource: hooks/token/receipt bind to the serve's implicit default source when --source is omitted; +23 #4586 statusHarness live claude-code mcp verdict (URL mismatch or same-scope non-HTTP registration reads failed, receipt untouched); shared-skills integration on company-ingestion base; +18 #5671: logAmbientPostureNotes helper (registrar note moved out of applyHarness + pre-consent warning when an explicit private facts default meets the HTTP harness; text shared with doctor in facts/writeback-config.ts); +24 #5893: rotation grant carry wiring and its rotationCarry/withheldOperationsNote helpers (carry rules live in token-mint.ts carryLegacyGrant); +6 #5878: --refresh-skills flag and status epoch line (refresh logic lives in harness-skills.ts); +7 #4618 seat: HarnessFlags.seat field, --seat/--no-seat parse via hooks.ts parseSeatFlags, GBRAIN_SEAT in the hook env
src/core/oauth-provider.ts 1236 ratchet new row: crossed the 1500 unlisted cap absorbing #3819 (DCR 400 invalid_client_metadata + scope filtering + custom-scheme redirect_uris + pseudo-scheme guard); merged v0.49: transactional grant enforcement shared with hosted grant policies; +1 #5222 resourceUrl option
src/core/ops/pages.ts 663 ratchet crossed the unlisted 1500 cap in the fix wave: pack-vocabulary enforcement on capture (#4721) + get_page alias follow (#4275) landed together; next growth should peel a pages-ops submodule; +3: alias hop reads the canonical in the owning source (ship-review); +5: explicit source_id liveness check in get_page/list_pages (#4620); +3: #4857 total-order slug sort + list_pages source_id parse; +5: #4620 explicit removed-source id fails loudly; master integration: +4: authenticated delegated private-write boundary and auto-link suppression; #5105: canonical page mutations peeled into persistence modules; +2 v0.50.5.0 purge parameter and shared preflight call; preparation composes through the persistence modules; +7: source-qualified deep-research fetch authorization and ambiguity refusal (codec lives in deep-research-id.ts); +1 #5567: remote get_page keeps materialized markers; +1 #5622: trusted local capture file parameter; +5 #5709: get_page include_timeline_entries (rows via get_timeline's read policy); +8 GBRA-36 security wave: required outputRedaction policy on each pages op; +1 #5154: list_pages passes listColumnsOnly; +17 #5641: list_pages exposes the updated_after_slug keyset cursor and updated_at_iso; +8 agent operator wave A2: every op declares mutating + idempotent (tags only); +7 F3b (#5954): list_pages pagination meta + listing_truncated notice for MCP callers (logic in ops/list-pages-pagination.ts); +4 #5988: get_page file_held (one indexed hold lookup; logic in persistence/held-reads.ts)
diff --git a/src/commands/think.ts b/src/commands/think.ts
index b477ade462..d3e9650f21 100644
--- a/src/commands/think.ts
+++ b/src/commands/think.ts
@@ -65,9 +65,6 @@ Options:
--reference-date YYYY-MM-DD
Date the question's relative time words ("last month")
resolve against (default: today in brain.timezone)
- --reading-notes on|off|auto
- Notes-first reading for this call (default:
- think.reading_notes config); notes print with --json only
--with-calibration Inject the active calibration profile (anti-bias rewrite)
--calibration-holder <h> Holder whose calibration profile to use (default: self)
--json Output as JSON
@@ -92,7 +89,7 @@ prints what would have been the input (exit 0).
// #4508: --source and --calibration-holder were MISSING here — the flag and
// its value joined the positional question, so `think "q" --source X`
// echoed `# --source X q` and silently ignored the scope.
- const flagNames = ['--anchor', '--rounds', '--model', '--since', '--until', '--source', '--calibration-holder', '--reference-date', '--reading-notes'];
+ const flagNames = ['--anchor', '--rounds', '--model', '--since', '--until', '--source', '--calibration-holder', '--reference-date'];
const positional: string[] = [];
for (let i = 0; i < args.length; i++) {
const a = args[i];
@@ -116,12 +113,6 @@ prints what would have been the input (exit 0).
const since = flagValue(args, '--since');
const until = flagValue(args, '--until');
const referenceDate = flagValue(args, '--reference-date');
- const readingNotesFlag = flagValue(args, '--reading-notes');
- if (readingNotesFlag !== undefined && !['on', 'off', 'auto'].includes(readingNotesFlag)) {
- console.error(`--reading-notes must be on, off or auto (got "${readingNotesFlag}").`);
- process.exit(1);
- }
- const readingNotes = readingNotesFlag as 'on' | 'off' | 'auto' | undefined;
// v0.36.1.0 (E1, D22) — anti-bias rewrite mode. Off by default (no
// regression for existing think users). When on, the active calibration
// profile gets injected per D22 placement (after retrieval, before question).
@@ -166,7 +157,6 @@ prints what would have been the input (exit 0).
const raw = await callRemoteTool(cfg!, 'think', {
question, anchor, rounds, model, since, until,
...(referenceDate ? { reference_date: referenceDate } : {}),
- ...(readingNotes ? { reading_notes: readingNotes } : {}),
// save/take intentionally NOT forwarded — server would ignore them;
// we surface the intent above so users know what they lose.
}, { timeoutMs: 180_000 });
@@ -203,7 +193,6 @@ prints what would have been the input (exit 0).
result = await runThink(engine, {
question, anchor, rounds, save, take, model, since, until,
...(referenceDate ? { referenceDate } : {}),
- ...(readingNotes ? { readingNotes } : {}),
// Fail-closed trust: local CLI must say so explicitly, or trajectory
// injection degrades to visibility='world' rows.
remote: false,
diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.ts
index 6ef12e7aa2..381f255ca8 100644
--- a/src/core/cli-flag-registry.generated.ts
+++ b/src/core/cli-flag-registry.generated.ts
@@ -124,7 +124,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'sweep': ['--accept-pending', '--background', '--batch-limit', '--brain', '--budget-ms', '--delete-brain', '--explain', '--follow', '--help', '--home', '--json', '--no-accept-pending', '--no-delegate', '--once', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],
'sync': ['--abbrev-ref', '--abort', '--accept-pending', '--account', '--adopt-columns', '--adopt-permissions', '--all', '--allow-empty', '--apply', '--apply-rewrites', '--auto', '--background', '--batch-size', '--brain', '--branch', '--break-lock', '--by-mention', '--cached', '--catch-up', '--concurrency', '--confirm-destructive', '--content-audit', '--count', '--db-url', '--delete-brain', '--depth', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--expect', '--explain', '--facts', '--fast', '--ff-only', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--git-dir', '--git-path', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--kind', '--lang', '--link-source', '--link-type', '--locks', '--log-noop', '--markdown', '--max-age', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-sources', '--max-usd', '--migrate-legacy', '--migrate-only', '--missing-path', '--multimodal', '--name-only', '--name-status', '--ner', '--no-accept-pending', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-pull', '--no-recurse-submodules', '--no-renames', '--no-schema-pack', '--no-verify', '--older-than', '--only', '--operations', '--others', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--parallel', '--params', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--porcelain', '--prefer-postgres', '--preview', '--priority', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--prune-orphans', '--query', '--queue', '--quiet', '--reauth', '--rebase', '--rebuild', '--refresh', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--replace', '--repo', '--request-id', '--reset', '--reset-checkpoint', '--restore-only', '--resume', '--retry-failed', '--retry-held', '--scope', '--scopes', '--serial', '--short', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip-failed', '--slot', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--stdin', '--strategy', '--supabase', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--timeout', '--to', '--token', '--top-k', '--type', '--url', '--verbose', '--verify', '--version', '--wait', '--watch', '--window', '--workers', '--working-tree', '--yes'],
'takes': ['--accept', '--batch-size', '--brain', '--bucket-size', '--by', '--claim', '--dim', '--dir', '--domain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--evidence', '--expected-revision', '--expired', '--force', '--from-pages', '--help', '--holder', '--include-covered', '--json', '--kind', '--limit', '--max-pages', '--no-embed', '--no-embedding', '--offset', '--outcome', '--path', '--quality', '--reject', '--request-id', '--row', '--semantic', '--since', '--sort', '--source', '--source-id', '--stale', '--status', '--supabase', '--to', '--unit', '--until', '--value', '--weight', '--who', '--yes'],
- 'think': ['--anchor', '--brain', '--calibration-holder', '--help', '--json', '--mcp-only', '--model', '--only', '--reading-notes', '--reference-date', '--rounds', '--save', '--since', '--source', '--take', '--until', '--with-calibration'],
+ 'think': ['--anchor', '--brain', '--calibration-holder', '--help', '--json', '--mcp-only', '--model', '--only', '--reference-date', '--rounds', '--save', '--since', '--source', '--take', '--until', '--with-calibration'],
'transcripts': ['--accept-pending', '--all', '--all-discovery', '--background', '--brain', '--days', '--dry-run', '--embed', '--explain', '--facts', '--follow', '--format', '--full', '--help', '--include-self', '--json', '--limit', '--max-bytes', '--max-cost-usd', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--since', '--source', '--source-id', '--timeout', '--wait'],
'upgrade': ['--acknowledge-no-backup', '--admin-intent', '--all', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--changed', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--only', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],
'waiting': ['--all', '--as-of', '--brain', '--fail-fast', '--help', '--json', '--note', '--source', '--stale-ok', '--status', '--tools-json', '--top', '--type'],
diff --git a/src/core/config.ts b/src/core/config.ts
index cb0565ba14..60c1fb60d9 100644
--- a/src/core/config.ts
+++ b/src/core/config.ts
@@ -1363,7 +1363,6 @@ export const KNOWN_CONFIG_KEYS: readonly string[] = [
'search.return_budget_conversation',
'search.return_budget_max_remote',
'think.return_unit',
- 'think.reading_notes',
// Models tier system (v0.31.12)
'models.default',
'models.tier.utility',
diff --git a/src/core/ops/takes.ts b/src/core/ops/takes.ts
index 83db092046..e738f805e9 100644
--- a/src/core/ops/takes.ts
+++ b/src/core/ops/takes.ts
@@ -218,7 +218,6 @@ const think: Operation = {
since: { type: 'string', description: 'Start of temporal window (YYYY-MM-DD or YYYY-MM)' },
until: { type: 'string', description: 'End of temporal window' },
reference_date: { type: 'string', description: 'YYYY-MM-DD the question\'s relative time words resolve against (default: today in brain.timezone).' },
- reading_notes: { type: 'string', enum: ['on', 'off', 'auto'], description: 'Notes-first reading for this call (default: think.reading_notes). Notes return in reading_notes, never in the answer.' },
},
// Local CLI can persist with save/take; remote/MCP callers are forced
// read-only below before runThink/persistSynthesis sees those flags.
@@ -252,7 +251,6 @@ const think: Operation = {
since: p.since ? String(p.since) : undefined,
until: p.until ? String(p.until) : undefined,
...(typeof p.reference_date === 'string' ? { referenceDate: p.reference_date } : {}),
- ...(p.reading_notes === 'on' || p.reading_notes === 'off' || p.reading_notes === 'auto' ? { readingNotes: p.reading_notes } : {}),
takesHoldersAllowList: readHolders(ctx),
...thinkScope,
excludePrivate: (await readPolicyOpts(ctx)).excludePrivate,
diff --git a/src/core/think/index.ts b/src/core/think/index.ts
index 6c358031da..a2b9e02744 100644
--- a/src/core/think/index.ts
+++ b/src/core/think/index.ts
@@ -147,21 +147,11 @@ export interface RunThinkOpts {
* question date. Invalid or future values throw ReferenceDateError.
*/
referenceDate?: string;
- /** Per-call notes-first reading override; default `think.reading_notes`. */
- readingNotes?: ThinkReadingNotesMode;
}
-export type ThinkReadingNotesMode = 'on' | 'off' | 'auto';
-const THINK_READING_NOTES_CONFIG_KEY = 'think.reading_notes';
-/** Shipped default until the held-out think-lane verdict sets it. */
-const DEFAULT_THINK_READING_NOTES: ThinkReadingNotesMode = 'off';
-/** Output-token allowance added when notes are on, so notes never crowd out the answer. */
-const READING_NOTES_OUTPUT_ALLOWANCE = 512;
/** Structured response from the LLM (matches the schema declared in prompt.ts). */
export interface ThinkResponse {
- /** Notes-first reading scratch work; never part of the answer or persisted. */
- notes?: string;
answer: string;
citations: Array<{ page_slug: string; row_num: number | null; citation_index?: number }>;
gaps: string[];
@@ -239,8 +229,6 @@ export interface ThinkResult {
abstained?: ThinkAbstention;
/** The date frame the synthesis read in (reference date + brain timezone). */
temporal?: { reference_date: string; time_zone: string };
- /** Reading mode applied and the model's notes (null when off or absent). Never persisted. */
- reading_notes?: { mode: 'on' | 'off'; notes: string | null };
}
const DEFAULT_MAX_OUTPUT_TOKENS = 4000;
@@ -750,9 +738,8 @@ export async function runThink(
// SYNTHESIZE
const intent = inferIntent(opts.question, opts.anchor);
- const readingNotes = await resolveReadingNotes(engine, opts, gather.pages.length);
const systemPrompt = buildThinkSystemPrompt({
- currentDate: true, readingNotes, intent, willSave: opts.save, withCalibration: !!calibrationBlockOpts,
+ currentDate: true, intent, willSave: opts.save, withCalibration: !!calibrationBlockOpts,
...(opts.anchor !== undefined ? { anchor: opts.anchor } : {}),
...(opts.since !== undefined ? { since: opts.since } : {}),
...(opts.until !== undefined ? { until: opts.until } : {}),
@@ -846,7 +833,7 @@ export async function runThink(
try {
created = await client.create({
model: modelUsed,
- max_tokens: maxOutputTokensFor(normalizeModelId(modelUsed)) + (readingNotes ? READING_NOTES_OUTPUT_ALLOWANCE : 0),
+ max_tokens: maxOutputTokensFor(normalizeModelId(modelUsed)),
system: systemPrompt,
messages: [{ role: 'user', content: userMessage }],
});
@@ -892,7 +879,6 @@ export async function runThink(
const stop = (created as { stop_reason?: string }).stop_reason;
if (stop === 'max_tokens') {
warnings.push('LLM_OUTPUT_TRUNCATED');
- if (readingNotes) warnings.push('READING_NOTES_TRUNCATED');
synthesisStatus = 'output_truncated';
} else {
warnings.push('LLM_OUTPUT_NOT_JSON');
@@ -984,36 +970,18 @@ export async function runThink(
graphHits: gather.diagnostics.graphHits,
},
temporal: { reference_date: temporal.referenceDate, time_zone: temporal.timeZone },
- reading_notes: { mode: readingNotes ? 'on' : 'off', notes: readingNotes ? response.notes ?? null : null },
};
}
-/** Normalizes the model's parsed JSON envelope; `notes` survives only as a non-empty string. */
+/** Normalizes the model's parsed JSON envelope. */
function toThinkResponse(r: Partial<ThinkResponse>): ThinkResponse {
return {
- ...(typeof r.notes === 'string' && r.notes.trim() ? { notes: r.notes.trim() } : {}),
answer: typeof r.answer === 'string' ? r.answer : '',
citations: Array.isArray(r.citations) ? (r.citations as ThinkResponse['citations']) : [],
gaps: Array.isArray(r.gaps) ? (r.gaps as string[]).filter(g => typeof g === 'string') : [],
};
}
-/**
- * Notes-first reading for this call: per-call override, then
- * `think.reading_notes`, then the shipped default. `auto` turns notes on for
- * temporal / knowledge-update questions and for large gathers, where reading
- * across many pages is the hard part.
- */
-async function resolveReadingNotes(engine: BrainEngine, opts: RunThinkOpts, pagesGathered: number): Promise<boolean> {
- const configured = (await engine.getConfig(THINK_READING_NOTES_CONFIG_KEY).catch(() => null))?.trim().toLowerCase();
- const mode = opts.readingNotes
- ?? (configured === 'on' || configured === 'off' || configured === 'auto' ? configured : DEFAULT_THINK_READING_NOTES);
- if (mode === 'auto') return classifyIntent(opts.question) !== 'other' || pagesGathered >= READING_NOTES_AUTO_MIN_PAGES;
- return mode === 'on';
-}
-
-const READING_NOTES_AUTO_MIN_PAGES = 8;
-
/**
* Strip a "## Gaps" section from an answer body.
*
diff --git a/src/core/think/prompt.ts b/src/core/think/prompt.ts
index b2cb554bd7..37000d13c9 100644
--- a/src/core/think/prompt.ts
+++ b/src/core/think/prompt.ts
@@ -41,13 +41,8 @@ export interface ThinkSystemPromptOpts {
* the system text is stable across days (prompt caching).
*/
currentDate?: boolean;
- /** Notes-first reading: the model writes brief per-page notes before the answer. */
- readingNotes?: boolean;
}
-/** The notes-first output contract appended when reading notes are on. */
-export const THINK_READING_NOTES_INSTRUCTION = `Reading notes: before answering, write brief notes in a "notes" string field placed FIRST in the JSON object, before "answer". For each page that bears on the question, note the facts and dates it gives (with its [slug]); skip pages that do not. Keep the notes under 150 words total, then reason from them to the answer. The notes are scratch work: they are never shown as the answer, so the "answer" field must stand on its own.`;
-
export const THINK_SYSTEM_PROMPT_BASE = `You are gbrain's synthesis engine. You answer questions by reasoning across the user's personal knowledge brain. Your inputs are wrapped in structural tags:
<pages>...</pages> Page-level retrieval hits. Each <page slug="..."> contains an excerpt.
@@ -99,9 +94,6 @@ export function buildThinkSystemPrompt(opts: ThinkSystemPromptOpts = {}): string
if (opts.currentDate) {
lines.push(`\nDates: the user message gives the current date. A <page date="YYYY-MM-DD"> attribute is the date that page's content is about or was written. Resolve relative time words in a page ("yesterday", "last week", "two months ago") against that page's date, and relative time words in the question against the current date. A page without a date attribute has no known content date.`);
}
- if (opts.readingNotes) {
- lines.push(`\n${THINK_READING_NOTES_INSTRUCTION}`);
- }
if (opts.withCalibration) {
lines.push(
`\nCalibration-aware mode (v0.36.1.0): the user's calibration profile is included as <calibration> below the retrieval blocks. Apply it to the QUESTION FRAMING, not the evidence:`,
diff --git a/test/fixtures/goldens/cli/thin-client-cases.json b/test/fixtures/goldens/cli/thin-client-cases.json
index 3441d1a029..b0188d7b0e 100644
--- a/test/fixtures/goldens/cli/thin-client-cases.json
+++ b/test/fixtures/goldens/cli/thin-client-cases.json
@@ -592,9 +592,6 @@
" --reference-date YYYY-MM-DD",
" Date the question's relative time words (\"last month\")",
" resolve against (default: today in brain.timezone)",
- " --reading-notes on|off|auto",
- " Notes-first reading for this call (default:",
- " think.reading_notes config); notes print with --json only",
" --with-calibration Inject the active calibration profile (anti-bias rewrite)",
" --calibration-holder <h> Holder whose calibration profile to use (default: self)",
" --json Output as JSON",
diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.json
index b309d84b35..c8c26e1a42 100644
--- a/test/fixtures/goldens/cli/tools-json.json
+++ b/test/fixtures/goldens/cli/tools-json.json
@@ -2,8 +2,8 @@
"golden": {
"exitCode": 0,
"stderr": "",
- "stdoutBytes": 197396,
- "stdoutSha256": "bab9dd03319eebafdc9dad4120ae80519e7d200b71f661e14b1811ad280fabdc",
+ "stdoutBytes": 197062,
+ "stdoutSha256": "daf41a4dbbcc2aabd577c1e0b5fcbdd877bb7dcdcd3e57f3f3726bfe36838083",
"toolNames": [
"remember",
"entity",
@@ -3608,7 +3608,6 @@
"anchor": "string?",
"model": "string?",
"question": "string",
- "reading_notes": "string?",
"reference_date": "string?",
"rounds": "number?",
"save": "boolean?",
@@ -3631,15 +3630,6 @@
"description": "The question to think about",
"type": "string"
},
- "reading_notes": {
- "description": "Notes-first reading for this call (default: think.reading_notes). Notes return in reading_notes, never in the answer.",
- "enum": [
- "on",
- "off",
- "auto"
- ],
- "type": "string"
- },
"reference_date": {
"description": "YYYY-MM-DD the question's relative time words resolve against (default: today in brain.timezone).",
"type": "string"
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index 84009dc47d..36bfa9e9e2 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -7104,7 +7104,6 @@
"model?: string | undefined",
"modelExplicit?: boolean | undefined",
"question: string",
- "readingNotes?: ThinkReadingNotesMode | undefined",
"referenceDate?: string | undefined",
"remote?: boolean | undefined",
"rounds?: number | undefined",
@@ -7127,20 +7126,12 @@
],
"name": "ThinkLLMClient"
},
- {
- "kind": "type",
- "name": "ThinkReadingNotesMode",
- "signature": [
- "\"on\" | \"off\" | \"auto\""
- ]
- },
{
"kind": "interface",
"members": [
"answer: string",
"citations: { page_slug: string; row_num: number | null; citation_index?: number; }[]",
- "gaps: string[]",
- "notes?: string | undefined"
+ "gaps: string[]"
],
"name": "ThinkResponse"
},
@@ -7159,7 +7150,6 @@
"modelUsed: string",
"pagesGathered: number",
"question: string",
- "reading_notes?: { mode: \"on\" | \"off\"; notes: string | null; } | undefined",
"rounds: number",
"savedSlug?: string | undefined",
"synthesisOk?: boolean | undefined",
diff --git a/test/think-reading.test.ts b/test/think-reading.test.ts
index 5687b3da47..c806215916 100644
--- a/test/think-reading.test.ts
+++ b/test/think-reading.test.ts
@@ -1,22 +1,19 @@
/**
- * think reads in a date frame and can take notes before answering.
+ * think reads in a date frame.
*
* Protects: (1) the reader sees the current/reference date and each page's
* content date, never a fallback row timestamp; (2) relative dates in a page
- * render in the brain's timezone; (3) notes-first reading puts its notes in
- * `reading_notes`, never in the answer or the persisted body, and raises the
- * output allowance; (4) invalid reference dates are refused.
+ * render in the brain's timezone; (3) invalid reference dates are refused.
* Regression it catches: a reader answering "last month" questions with no
- * idea what today is, or notes leaking into saved syntheses.
- * Existing coverage: think-pipeline/think-pages-block tests never assert dates
- * or a notes field.
+ * idea what today is.
+ * Existing coverage: think-pipeline/think-pages-block tests never assert dates.
*/
import { describe, test, expect, beforeAll, afterAll } from 'bun:test';
import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { importFromContent } from '../src/core/import-file.ts';
import { runThink, type ThinkLLMClient } from '../src/core/think/index.ts';
import { renderPagesBlock } from '../src/core/think/gather.ts';
-import { buildThinkSystemPrompt, buildThinkUserMessage, THINK_READING_NOTES_INSTRUCTION } from '../src/core/think/prompt.ts';
+import { buildThinkSystemPrompt, buildThinkUserMessage } from '../src/core/think/prompt.ts';
import { pageContentDate, parseReferenceDate, ReferenceDateError } from '../src/core/think/temporal-context.ts';
import type { SearchResult } from '../src/core/types.ts';
@@ -99,15 +96,14 @@ describe('prompt shape', () => {
calibration: { holder: 'garry', patternStatements: [], activeBiasTags: [] },
});
expect(calibrated).toContain('Current date: 2026-10-04 (UTC)\nQuestion: q?');
- const system = buildThinkSystemPrompt({ currentDate: true, readingNotes: true });
+ const system = buildThinkSystemPrompt({ currentDate: true });
expect(system).toContain('date="YYYY-MM-DD"');
- expect(system).toContain(THINK_READING_NOTES_INSTRUCTION);
expect(system).not.toMatch(/\d{4}-\d{2}-\d{2}/);
});
});
describe('runThink reading', () => {
- test('reference date and page date reach the reader; notes stay off by default', async () => {
+ test('reference date and page date reach the reader', async () => {
const cap: { system?: string; user?: string; maxTokens?: number } = {};
const result = await runThink(engine, {
question: 'What does the enterprise plan cost at acme-example?',
@@ -116,63 +112,7 @@ describe('runThink reading', () => {
});
expect(cap.user).toContain('Current date: 2026-10-01 (UTC)');
expect(cap.user).toContain('date="2026-09-15"');
- expect(cap.system).not.toContain(THINK_READING_NOTES_INSTRUCTION);
expect(result.temporal).toEqual({ reference_date: '2026-10-01', time_zone: 'UTC' });
- expect(result.reading_notes).toEqual({ mode: 'off', notes: null });
- });
-
- test('notes-first reading: notes come back separately, never in the answer, with extra output allowance', async () => {
- const offCap: { maxTokens?: number } = {};
- await runThink(engine, {
- question: 'What does the enterprise plan cost at acme-example?',
- client: stub(JSON.stringify({ answer: 'a', citations: [], gaps: [] }), offCap),
- withTrajectory: false, remote: false, readingNotes: 'off',
- });
- const cap: { system?: string; maxTokens?: number } = {};
- const result = await runThink(engine, {
- question: 'What does the enterprise plan cost at acme-example?',
- client: stub(JSON.stringify({ notes: '[meetings/acme-example-pricing] 2026-09-15: enterprise = 125 credits/month', answer: '125 credits per month.', citations: [], gaps: [] }), cap),
- withTrajectory: false, remote: false, readingNotes: 'on',
- });
- expect(cap.system).toContain(THINK_READING_NOTES_INSTRUCTION);
- expect(cap.maxTokens).toBe((offCap.maxTokens ?? 0) + 512);
- expect(result.answer).toBe('125 credits per month.');
- expect(result.answer).not.toContain('2026-09-15');
- expect(result.reading_notes?.mode).toBe('on');
- expect(result.reading_notes?.notes).toContain('125 credits/month');
- });
-
- test('think.reading_notes=auto turns notes on for temporal questions only', async () => {
- await engine.setConfig('think.reading_notes', 'auto');
- try {
- const temporalCap: { system?: string } = {};
- await runThink(engine, {
- question: 'When did the team ship the invoice flow?',
- client: stub(JSON.stringify({ answer: 'a', citations: [], gaps: [] }), temporalCap),
- withTrajectory: false, remote: false,
- });
- expect(temporalCap.system).toContain(THINK_READING_NOTES_INSTRUCTION);
- const plainCap: { system?: string } = {};
- await runThink(engine, {
- question: 'What does the enterprise plan cost at acme-example?',
- client: stub(JSON.stringify({ answer: 'a', citations: [], gaps: [] }), plainCap),
- withTrajectory: false, remote: false,
- });
- expect(plainCap.system).not.toContain(THINK_READING_NOTES_INSTRUCTION);
- } finally {
- await engine.setConfig('think.reading_notes', 'off');
- }
- });
-
- test('a truncated notes-first response is not a successful synthesis', async () => {
- const result = await runThink(engine, {
- question: 'What does the enterprise plan cost at acme-example?',
- client: stub('{"notes": "[meetings/acme-example-pricing] enterprise plan costs 125 cre', {}, 'max_tokens'),
- withTrajectory: false, remote: false, readingNotes: 'on',
- });
- expect(result.synthesisOk).toBe(false);
- expect(result.warnings).toContain('READING_NOTES_TRUNCATED');
- expect(result.answer).not.toContain('enterprise plan costs');
});
test('a future reference date is refused before any model call', async () => {