Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs: time-aware recall guide, key-files entries and eval-arm flags
garrytancf99a72d2614
diff --git a/docs/architecture/key-files/core-search-2.md b/docs/architecture/key-files/core-search-2.mdindex 06cef30bb4..94428934f0 100644--- a/docs/architecture/key-files/core-search-2.md+++ b/docs/architecture/key-files/core-search-2.md@@ -28,3 +28,8 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL- `src/core/search/vector-legacy-guard.ts` — one-release rollback for the #5824 statement change. `readVectorLegacyGuard(cfg, env)` reports the setting (`GBRAIN_VECTOR_LEGACY_GUARD` wins over `search.vector_legacy_guard`); `resolveVectorLegacyGuard(cfg)` latches it once per process for `hybrid/request.ts`, which passes `SearchOpts.vectorLegacyGuard` to the engines (they never read config), and prints `[gbrain] vector legacy guard active` to stderr once when on. A changed setting takes effect when the owning service restarts.- `src/core/search/internal-breadth.ts` — `INTERNAL_BREADTH_SEARCH_OPTS` (`autocut: false, adaptiveReturn: false`), the one option object internal callers spread into `hybridSearch` when they need the full ranked set rather than a reader-trimmed one (#5890): think gather (both legs), brainstorm close-set, grade-takes evidence, whoknows and enrich. Pinned by `test/internal-breadth-callers.serial.test.ts`; `eval-contradictions/runner.ts` still inherits both trims.++- `src/core/temporal-grammar.ts` + `src/core/search/time-range.ts` + `src/core/event-dates.ts` + `src/core/search/hybrid/time-scope.ts` — deterministic time expressions (no LLM). `findTimeMentions(text, refDay, direction)` resolves explicit cues only (ISO and written dates, `in/during <Month>`, capitalized bare months, `Qn YYYY`, `in YYYY`, yesterday/today/tomorrow, last/this/next week|weekend|month|year, rolling "past month", seasons, last/this <weekday>, `N units ago`, `in N units`) to inclusive day ranges; quoted spans, plural weekdays and modal "may" never resolve; overlapping matches keep the longest. `parseQueryTimeRange(query, refDay)` returns one range or abstains with `no_cue`, `duration_question` ("how long", "how many days ago/passed/before…") or `multi_role` (two times not joined by and/or/to/through). `extractEventDates(text, observationDay)` returns the observation day plus mentioned dates, resolving relative phrases only against a known observation day and skipping code fences, inline code and URLs. `applyTimeScope(results, range, datesOf, {mode, k, slackDays=2})` is a permutation: `reserved` keeps the top ⌈k/2⌉ in place and fills the rest of k with in-range results; `partition` moves every in-range result first. These are used by the eval-only `--time-scope` arm; no production search path calls them yet. Tests: `test/time-range-parse.test.ts` (published LongMemEval time-range examples as goldens), `test/time-scope-stage.test.ts`.++- `src/core/fact-keys.ts` — fact keys merged into a chunk's embedding input. `assignFactKeys(items, chunks, 'chunk'|'page')` (chunk = each fact on the chunk sharing the most content words, page = all facts on every chunk; code/image chunks never keyed; 800-char cap; `<context>` tags stripped) and `factKeyedEmbeddingInput(chunkText, title, keys)` (`<context>{title}\nFacts: {keys}\n</context>\n{chunk}`; null keys reproduce today's title-wrapped or raw input byte-for-byte). `chunk_text` is never changed. Used by the eval-only `--fact-keys` arm. Test: `test/fact-keys.test.ts`.+diff --git a/docs/architecture/key-files/core-services-3.md b/docs/architecture/key-files/core-services-3.mdindex dc2a68ff38..39230f17a0 100644--- a/docs/architecture/key-files/core-services-3.md+++ b/docs/architecture/key-files/core-services-3.md@@ -5,6 +5,8 @@ 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/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`.- `src/core/transcripts/` (directory) — the transcript-adapter seam. `types.ts`: the `TranscriptAdapter` contract — `parse(path): AsyncGenerator<ParsedSession, FileDiagnostics>` (one FILE may hold many sessions; the generator RETURN value carries bytes/skipped-lines/zero-session diagnostics so an empty file explains itself), format-specific byte caps (JSONL 50MB hard cap — the 10MB default in `claude-code-jsonl.ts` belongs to the hook-lane tail reader, not imports; monolithic export JSON rejects-not-truncates at 200MB), and the ONE `buildTranscriptSlug` helper (per-provider dirs matching the conversation-archive layout; id suffixes are sha256 prefixes of the session id — hash12 in slugs, hash16 for the dedup identity — never a cleaned prefix of the source id, which would let same-prefix session ids collide). `detect.ts`: adapter registry + head-sample detection (explicit format wins; symlinks lstat-rejected) + injectable `harnessRoots` (the confined discovery surface). Adapters, each with a DATED `SPEC_TARGET` + scrubbed fixture + `bytes>0 && sessions==0` drift alarm: `claude-code.ts` (thin wrapper over the shipped `claude-code-jsonl.ts`, which also exposes the full-file `parseClaudeSessionFile` with real per-message timestamps — hook-lane `parseTranscript` output is pinned byte-identical; owns `isClaudeCodeSubagentFile` (a literal `subagents` path segment at ANY depth + `agent-*.jsonl` basename — both `<session>/subagents/agent-*.jsonl` and the workflow-nested `<session>/subagents/workflows/<wf>/agent-*.jsonl` are all-sidechain, zero-turn files carrying the PARENT session id; a project slug containing "subagents" is one segment and never matches) and `isClaudeCodeWorkflowArtifactFile` (everything under `<session>/subagents/workflows/<wf>/` — the agent logs plus the `journal.jsonl` run log that matches no adapter format; a UUID-named session directly under `subagents/` stays discoverable); `discover.ts` and the CLI's `expandPaths` skip both, so they never read as gap-table backlog, drift, or `unknown format` errors that hold the since-last watermark frozen; the adapter sets `expectedEmpty` when zero accepted turn-shaped records and zero skipped lines remain after root metadata/sidechain and explicit non-human user-text filtering. Metadata-only, non-human-text-only, and all-subagent files are understood empties and do not freeze the watermark; accepted turn records that yield no text and unparseable lines still signal drift. Pinned by `test/claude-code-jsonl-origin.test.ts`), `codex.ts` (turn selection is STRUCTURAL: user turns from `event_msg` user_message, assistant from `response_item` output_text; role user/developer response_items are injected preambles and never leak; identity is `payload.id` — the per-thread id codex embeds in the rollout filename — with `payload.session_id` (the ROOT session shared by every forked/subagent thread) only as the legacy fallback, and the FIRST `session_meta` header wins because a child rollout carries its inherited parent header later in the file; the hook lane's `parseCodexHookTranscript` follows the same two rules), `openclaw.ts` (session header + message lines; `.checkpoint.*.jsonl` snapshots rejected), `hermes.ts` (COPY-THEN-READ of state.db + wal/shm sidecars — readonly WAL opens need -shm write access and lock against a live writer; schema from the installed hermes-agent source; PROVISIONAL), `grok.ts` (Grok Build session dirs — structural turn selection, sidecar-aware discovery; see its own entry), `chatgpt-export.ts` (the `mapping`-tree current_node walk; branches dropped by design, orphaned parents terminate quietly, latest-leaf fallback; extracted conversations.json only) + `claude-export.ts` (flat chat_messages); both export adapters load through the shared `export-json.ts` (monolithic JSON over the cap REJECTS with a split hint; a zip or wrong-shape file gets the unzip-first hint) and give id-less conversations content-derived fallback ids so two id-less exports cannot dedup-skip or overwrite each other. `render.ts`: session → part pages — imessage-slack line format with the regex IMPORTED from `conversation-parser/builtins.ts` (round-trip pinned), REAL timestamps (missing ones carry forward; zero-timestamp sessions refused — provenance is never fabricated), anchor-shaped BODY lines backslash-escaped (hostile message content cannot forge speakers), quoted facts/takes fence-marker tokens backslash-escaped at the same per-message seam (`gbrain\:facts:begin` — a session that read another page cannot plant a live or unbalanced fence on the transcript page; every fence consumer is a substring matcher, so the escape lands inside the token), fail-closed redaction (secret-scan + `harvest-private-patterns.txt` user patterns, slack-channel default excluded because it eats issue refs; imperatives COUNTED into hash-covered `transcript_import` frontmatter, never content_flag), ~300KB message-boundary splitting with 2-message overlap (under the embed-skip threshold), part 1 keeps the base slug, `frontmatter.id` unique per part. `ingest.ts`: the engine-facing core — a session whose part-1 `frontmatter.id` already has a live page imports at that page's slug (a renamed or re-dated conversation updates in place instead of being skipped as a cross-slug duplicate), SESSION atomicity (failed sessions skip; integrity failures abort the run), stale-part reconciliation (deletes `part > of` leftovers), session metadata banked in the base page's raw_data as the REDACTED copy and healed by content-compare even on hash-skipped re-runs (a run that died before `putRawData`, or a private pattern added after first import, repairs on the next pass), `cleanScan`/`maxSessionTs` for the watermark. `ingest-facts.ts`: ONE `runExtractConversationFactsCore` invocation (batch `slugs` selector) inside ONE `withBudgetTracker`, `isFactsExtractionEnabled` pre-checked. Pinned by `test/transcript-adapters.test.ts`, `test/transcript-render.test.ts`, `test/transcripts-retitle.test.ts`, `test/transcripts-ingest-pglite.test.ts`, `test/e2e/transcripts-writeback-fidelity.test.ts` (raw files through the adapters into the gold-extractor facts path).diff --git a/docs/architecture/key-files/evaluation.md b/docs/architecture/key-files/evaluation.mdindex 16e19c7d5e..cce65f81e0 100644--- a/docs/architecture/key-files/evaluation.md+++ b/docs/architecture/key-files/evaluation.md@@ -50,3 +50,6 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL- `src/eval/shared/embed-cache.ts` — content-addressed embedding cache for fixed-corpus evals (dataset-agnostic; the LongMemEval harness is its first consumer). INVARIANT: a cached vector is served ONLY for the exact `(model@dims, text, side)` it was computed for, and every row is integrity-checked on read (declared dims == stored bytes / 4 == vector length); a mismatch is a HARD `EmbedCacheIntegrityError` naming the file and the key — never a silent re-embed, because a silently corrupted cache makes every arm's vectors non-comparable. Key = `${model}@${dims}` (+ `#query` for query-side asymmetric embeds, so asymmetric query vectors can never be served a document-side row) + `:` + sha256(text). Storage: `bun:sqlite`, WAL journal + `synchronous=NORMAL`, busy retry; local filesystem only. A question's writes are buffered in memory (reads see them) and written in one short `BEGIN IMMEDIATE` transaction when its `withTransaction` unit ends, so no SQLite lock is held across embed round-trips and concurrent runs sharing one cache file neither lose writes to `SQLITE_BUSY_SNAPSHOT` nor stall behind each other's questions. `installEmbedCache` installs it through the gateway's `__setEmbedTransportForTests` seam (gateway.ts sits at its module-size ceiling; a named `setEmbedTransport()` hook is a filed follow-up) and restores the caller-supplied `realTransport ?? null` on uninstall. Stats: `hits`, `misses` (genuine misses PLUS every value of a batch that fell open on an infrastructure fault), `bypassed` (SDK model id ≠ the installed model — never cached), `infra_faults` (file deleted mid-run / table dropped / disk error → uncached re-embed or lost write-back, so a run that lost its cache can never show a clean `misses: 0`). The canonical hash (`PRAGMA wal_checkpoint(TRUNCATE)` then sha256 over the sorted `(key, dims, sha256(vector))` rows) goes into `run_config.cache.canonical_sha256` so two runs can prove they saw the same vectors. Pinned by `test/longmemeval-embed-cache.test.ts`.- `src/eval/shared/judge-runner.ts` + `src/eval/shared/bootstrap.ts` — dataset-agnostic judge mechanics shared by the LongMemEval lane and any later judged eval. **judge-runner.ts** owns the chat-client seam (`JudgeChatFn` — the gateway `chat` in production, a canned fn in tests), bounded retries with exponential backoff (default 2 retries, base 500 ms, `sleep` seam), the closed `judge_error` vocabulary (`timeout | rate_limit | empty | refusal | malformed | provider_error`, exported as `JUDGE_ERROR_CLASSES`), usage summed over every attempt, per-call cost through the ONE canonical pricing table (`canonicalLookup`; an unpriced model yields `cost_usd: null`, never 0, and `isJudgeModelPriced` lets a budget refuse it), and the `BudgetLedger` (`maxUsd === null` = no cap; `canAfford(next)` is PROJECTED so a run never overshoots by more than the calls already in flight; unpriced calls are counted, not summed; `snapshot()` for receipts). INVARIANT: a judge malfunction is an error outcome, never a `verdict: 'incorrect'` — `runJudge` never throws on a transport failure (only an already-aborted `AbortSignal` or a bug in the caller's `parse` can), classifies 429 / rate-limit prose → `rate_limit`, abort / timeout → `timeout`, everything else → `provider_error`, and maps a `refusal` / `content_filter` stop, an empty completion and a null from `parse` to `refusal` / `empty` / `malformed`; the caller decides how the headline scores them. It passes `temperature` and `maxTokens` through `ChatOpts` and records `ChatResult.responseModel` as `response_model`. **bootstrap.ts**: `bootstrapMeanCi(xs, {resamples = 10000, seed = 42, alpha = 0.05})` is a seeded (mulberry32) percentile bootstrap of the mean, byte-reproducible; n = 0 → nulls, n = 1 → a degenerate `[x, x]`. INVARIANT: every block carries `label: 'question-sampling only'` — the interval quantifies how much the number would move under a different draw of questions and says nothing about reader / judge nondeterminism, dataset revision or prompt drift. Pinned by `test/longmemeval-judge.test.ts`.++- `src/eval/longmemeval/retrieval-arms.ts` — eval-only retrieval arms for `gbrain eval longmemeval`, flags spread into the harness flag table. `--fact-keys chunk|page` extracts each imported session's facts (`--fact-extractor paper` = the benchmark's published user-turn fact prompt, `production` = `extractFactsFromTurnWithOutcome` as shipped; `--fact-keys-model`, `--fact-keys-max-usd` cap on uncached spend, default 20) through a content-hash JSONL cache under `~/.cache/gbrain-eval/`, then re-embeds that session's chunks with `factKeyedEmbeddingInput` inside the embed-cache transaction (row field `fact_keys`). `--time-scope reserved|partition` widens the search limit to `--time-scope-pool` (default 50), parses the question against `question_date`, re-orders by each session's observation + mentioned dates, and records `time_scope` plus the unscoped top-k's `unscoped_recall_all_hit` / `unscoped_recall_any_hit` from the same pool (a paired control inside one run). Active arms fold into `retrieval_config_hash` as `retrieval_arms`; with no arm on the hash is unchanged. Test: `test/fact-keys.test.ts`.+diff --git a/docs/eval-bench.md b/docs/eval-bench.mdindex 5ec258468a..aa54c33a84 100644--- a/docs/eval-bench.md+++ b/docs/eval-bench.md@@ -854,6 +854,23 @@ of `recall_any_hit`, kept for v1 readers), `abstention`,instead); with `--judge`, the `judge_*` fields listed under "Judged answeraccuracy".+### Fact-key and time-scope arms (`--fact-keys`, `--time-scope`)++Eval-only arms for time-aware retrieval (`src/eval/longmemeval/retrieval-arms.ts`);+nothing in production search calls them. Mechanism choices are made on the+frozen development split only.++| Flag | Default | Purpose |+|---|---|---|+| `--fact-keys chunk\|page` | off | Merge each session's extracted facts into its chunks' embedding input and re-embed (chunk = each fact on its best-matching chunk; page = all facts on every chunk). Retrieval still returns raw sessions; rows carry `fact_keys` |+| `--fact-extractor paper\|production` | paper | `paper` = the benchmark's published user-turn fact prompt; `production` = gbrain's facts extractor as shipped (8,000-character input) |+| `--fact-keys-model M` | utility tier (haiku); production extractor: `facts.extraction_model` | Extraction model |+| `--fact-keys-max-usd N` | 20 | Cap on uncached extraction spend; extractions are cached by content hash under `~/.cache/gbrain-eval/fact-keys-*.jsonl` |+| `--time-scope reserved\|partition` | off | Re-order a widened pool by the question's explicit time range (resolved against `question_date`) using each session's date and the dates it mentions. `reserved` keeps the top half of k in place; `partition` moves every in-range session first |+| `--time-scope-pool N` | 50 | Pool depth for `--time-scope`; rows carry `time_scope` and the same pool's unscoped top-k (`unscoped_recall_all_hit`), a paired control inside one run |++Active arms fold into `retrieval_config_hash` as `retrieval_arms`.+### System One arms (`--decide`)`gbrain eval longmemeval`, `gbrain eval brainbench` and `gbrain evaldiff --git a/docs/guides/time-aware-recall.md b/docs/guides/time-aware-recall.mdnew file mode 100644index 0000000000..fc970b4ccf--- /dev/null+++ b/docs/guides/time-aware-recall.md@@ -0,0 +1,62 @@+# Time-aware recall++`gbrain think` answers in a date frame. It knows today's date in your brain's+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++- *"What did I decide about pricing last month?"* — your agent runs+ `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++- **Current date.** The user message carries `Current date: YYYY-MM-DD (<zone>)`+ just before the question. The zone is `brain.timezone`+ (`gbrain config set brain.timezone America/Los_Angeles`); unset means UTC.+ `--reference-date` / MCP `reference_date` replaces today with a past or+ current YYYY-MM-DD; a malformed or future date is refused with+ `invalid_params` before any model call.+- **Page dates.** Each `<page>` block carries `date="YYYY-MM-DD"` when the page+ has a content date: frontmatter `event_date`, `date` or `published`, or a+ dated filename. A page whose date fell back to when the file or row was+ created carries no date, because that time says nothing about the content.+ A day-only frontmatter date renders as written; a timestamp renders in the+ brain's timezone.+- **Search results** already carry each page's `effective_date` and+ `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`.++## Measuring it++The LongMemEval harness carries eval-only arms for the next steps of+time-aware retrieval — fact keys merged into chunk embeddings and a soft time+scope driven by the question's explicit time words. They run only inside+`gbrain eval longmemeval` (`--fact-keys`, `--time-scope`); see+[`docs/eval-bench.md`](../eval-bench.md) and the+[evaluation key files](../architecture/key-files/evaluation.md).diff --git a/llms.txt b/llms.txtindex 15a9d7e9c0..33de954ef3 100644--- a/llms.txt+++ b/llms.txt@@ -41,6 +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/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.tsindex bd4c9b4f40..6256aee0d2 100644--- a/scripts/llms-config.ts+++ b/scripts/llms-config.ts@@ -188,6 +188,13 @@ export const SECTIONS: DocSection[] = ["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.",path: "docs/guides/push-context.md",},+ {+ 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.",+ path: "docs/guides/time-aware-recall.md",+ includeInFull: false,+ },{title: "docs/evidence-delivery.md",description:diff --git a/src/commands/think.ts b/src/commands/think.tsindex 83350f6c64..b477ade462 100644--- a/src/commands/think.ts+++ b/src/commands/think.ts@@ -78,6 +78,9 @@ the synthesis page is persisted AND printed. If --save is given but no synthesiswas produced (no LLM available, or empty result), nothing is saved and the commandexits non-zero.+Dates: the reader sees today's date in brain.timezone and each page's content+date; see docs/guides/time-aware-recall.md.+Set ANTHROPIC_API_KEY (or run: gbrain config set anthropic_api_key ...) to runreal synthesis. Without it AND without --save, the gather phase still runs andprints what would have been the input (exit 0).