Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
v0.60.57.0 feat(graph): bi-temporal typed edges — dated relationships, live-by-default graph reads, nightly contradiction check
garrytan400e09ba962a
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 4979f176f1..afbd2670af 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "gbrain",- "version": "0.60.53.0",+ "version": "0.60.57.0","description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.","author": {"name": "Garry Tan",diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.jsonindex b27aa26c18..5d3984604b 100644--- a/.codex-plugin/plugin.json+++ b/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "gbrain",- "version": "0.60.53.0",+ "version": "0.60.57.0","description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.","author": {"name": "Garry Tan",diff --git a/BOOTSTRAP_FOR_AGENTS.md b/BOOTSTRAP_FOR_AGENTS.mdindex b3635fc8af..4beb06d119 100644--- a/BOOTSTRAP_FOR_AGENTS.md+++ b/BOOTSTRAP_FOR_AGENTS.md@@ -1,4 +1,4 @@-<!-- gbrain-runbook-stamp: 0.60.53.0 -->+<!-- gbrain-runbook-stamp: 0.60.57.0 --><!-- This stamp must equal the VERSION file at every release; CI enforces it(scripts/check-bootstrap-tag.sh). `gbrain bootstrap status` compares it tothe installed binary and warns on skew. -->diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2a4c3a1c89..dd5f83b9f6 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,6 +10,99 @@ credits are retained; no result has been reassigned to another provider. Originaidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [0.60.57.0] - 2026-10-05++**gbrain now knows when a relationship was true: a person who left a company stops showing up as working there, "where did Alice work in 2022" answers from dated evidence, and a nightly check closes jobs that cannot both still hold.**++Before this release every typed link was forever. A timeline line saying someone left Acme changed nothing, so "who works at Acme" kept listing former employees and an entity card kept calling them CTO. Now each relationship carries dated stints built from the notes themselves, with no model call on the write path: timeline lines ("Left [Acme] to join [Widget]"), an explicit `Ended works_at [[companies/acme]]` line, frontmatter `since`/`until`, and `add_link` dates. Graph reads return what is true today, and history is one parameter away. On held-out data written by someone other than the implementer, current-employer precision went from 0.38 to 0.94 with no loss of recall and no false closures.++### The numbers that matter++Held-out runs by the evaluation custodian on a phrasing set the implementation never saw (seeds 11, 13, 17):++| What we measured | Before | Now |+| --- | --- | --- |+| "Who works at C now": precision of the people returned | 0.376 | 0.943 |+| Employer on a given date (as-of exact) | 0.208 | 0.678 |+| Employers during a year (set-F1) | 0.455 | 0.653 |+| Stale summary flagged in `context_pack` | 0 | 0.364 |+| Current-employer recall | 0.616 | 0.612 (non-inferior) |+| Traps: advisor roles, investments and alumni meetings at a former employer | n/a | 115 of 115 left alone |+| Same notes written in a different order give the same state | n/a | 240 of 240 |+| Nightly check in apply mode: wrong closures, 5 models × 3 runs | n/a | 0 |++### How to use it++```bash+gbrain doctor --only edge_validity --json # relationship state, lag, open proposals+gbrain edge-proposals list --status all # what the nightly check proposed or applied+gbrain edge-proposals undo <id> # remove a closure line it wrote+gbrain config set dream.edge_contradictions.mode propose # review closures before anything is written+gbrain config set graph.edge_validity off # every edge, as before+```++MCP: `get_links { slug, link_type: "works_at", as_of: "2022-06-30" }`, `get_links { slug, during: "2022" }`, `get_backlinks { slug, status: "all" }`, `add_link { from, to, link_type, valid_until }`.++### Things to watch++- Graph reads (`get_links`, `get_backlinks`, `traverse_graph`, the relational search arm) now hide relationships that ended. A response that hid any carries a `former_relationships_hidden` notice with the exact call that shows them.+- The nightly `edge_contradictions` phase makes one small chat call per changed subject (cap $1.00 per cycle, 200 subjects). With a certified model (the default `claude-haiku-4-5`, `claude-sonnet-5-5`, `claude-opus-5-5`, `claude-fable-5-1`, `gpt-6.1-sol`) it writes each closure as an undoable "(inferred) Ended …" timeline line; other models only propose.+- Closures from the nightly check are often dated late: with only "joined" lines, a gap between jobs closes the earlier job on the next start date. An explicit end line or a "left" line dates it exactly.+- Recall is capped by link typing, not by dates: a line such as "Signed on with [X] as CTO" is not typed `works_at` yet, so there is no relationship to date.+- `traverse_graph` walks live relationships; read history with `get_links` or `get_backlinks`.++## To take advantage of v0.60.57.0++`gbrain upgrade` should do this automatically. If it didn't, or if `gbrain doctor` warns about a partial migration:++1. **Run the orchestrator manually:**+ ```bash+ gbrain apply-migrations --yes+ ```+2. **Your agent reads `skills/migrations/v0.60.57.0.md` the next time you interact with it.** Migration v204 adds the relationship tables; existing pages re-extract over the next dream cycles (no model calls), which records the dated evidence already in their timelines. `gbrain post-upgrade` prints a one-time notice that asks the user to keep live-by-default reads and the nightly check.+3. **Verify the outcome:**+ ```bash+ gbrain doctor --only edge_validity --json+ gbrain stats+ ```+4. **If any step fails or the numbers look wrong,** please file an issue:+ https://github.com/garrytan/gbrain/issues with:+ - output of `gbrain doctor`+ - contents of `~/.gbrain/upgrade-errors.jsonl` if it exists+ - which step broke++ This feedback loop is how the gbrain maintainers find fragile upgrade paths. Thank you.++### Itemized changes++#### Relationship state++- Migration v204: `link_transitions` (dated start/end evidence with its producer), `link_relationships` (stints per relationship and read scope, `recorded_at`, `retired_at`), `link_edge_proposals`, `links.assertion_tense` and a graph generation sequence. Engine graduation carries all three tables; `gbrain migrate-engine` copies manual transitions.+- Relations are state (`works_at`, `advises`, `yc_partner`: can end, can rejoin) or event (`founded`, `invested_in`, `led_round`, `attended`, `discussed_in`, `cited`: happened on a date). Schema packs declare their own with `link_types[].temporal: state | event`; lint rule `link_types_temporal` flags `mentions` (error), a redeclared built-in and a mismatched inverse.+- Evidence is derived on every write with no model call (`src/core/link-temporal-evidence.ts`). A cue moves a relationship only when it is about that relationship: investing, meeting and event lines and qualified references ("[X]'s round", "[X] alumni") move nothing; event relations never close; a dated start stays open until a dated end. "Moved from [A] to [B]" and "Left [A] for [B]" end A and start B. Frontmatter `since`/`until` work with partial dates and rejoins.+- The extract cycle phase sweeps relationships whose state is missing or older than their evidence.++#### Reads++- `get_links` takes `status` (`live`, `ended`, `all`), `as_of`, `during` and `link_type`; `get_backlinks` takes `status` and `as_of`. Default reads keep the existing row shape; history reads add `status`, `stints`, `recorded_at` and `retired_at`. `graph.edge_validity off` restores every edge.+- `entity` and `context_pack` keep every edge with `status`, `since` and `until` and add a `relationship_note` ("now: works_at widget-co (since 2025-03-01); ended: works_at acme-example (2025-03-01); summary may be stale"). The same note reaches ambient turn context and compiled context.+- The relational search arm follows the question's tense: "who works at" reads live relationships, "who worked at" reads history.+- `add_link` takes `valid_from` and `valid_until`.++#### Nightly relationship check++- Dream phase `edge_contradictions`: a chat model judges only whether two live relationships of one subject can both hold; date arithmetic decides which ended and when, and undated pairs ask for a date instead. Modes `apply` (certified models), `propose` (other models) and `off`; settings `dream.edge_contradictions.{mode,max_subjects,max_usd}` and `models.dream.edge_contradictions`.+- `gbrain edge-proposals list|show|accept|reject|undo|date`. Deleting an applied line by hand reopens the relationship and is remembered.+- Doctor check `edge_validity` and a one-time post-upgrade [AGENT] notice.++#### Entity resolution++- The phantom-redirect tier gains a type guard and a name-entropy gate, so short or common names stop merging across types.++#### Evaluation++- Records in `docs/eval/decisions/` (`p1-dev-2026-10-04`, `p1-dev-2026-10-04-r2`, `p1-e2-2026-10-05`): development verdicts, the preregistrations and the held-out results. A first held-out run failed on traps and recall because the cue rules had overfit the development wording; the conservative rules above passed on a fresh held-out set.+## [0.60.53.0] - 2026-10-04**gbrain now crash-tests its own write path on every pull request, notes on a PGLite brain turn into facts without anyone running a command, and new dashboard API keys stop handing out admin access by default.**diff --git a/VERSION b/VERSIONindex 08dbee0a54..02146a61c9 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-0.60.53.0+0.60.57.0diff --git a/openclaw.plugin.json b/openclaw.plugin.jsonindex 0781d24bc9..a7fcefa18b 100644--- a/openclaw.plugin.json+++ b/openclaw.plugin.json@@ -1,7 +1,7 @@{"id": "gbrain-context-engine","name": "gbrain",- "version": "0.60.53.0",+ "version": "0.60.57.0","description": "Personal knowledge brain with Postgres + pgvector hybrid search","family": "bundle-plugin","kind": "context-engine",diff --git a/package.json b/package.jsonindex a85945ddd8..a890a96c63 100644--- a/package.json+++ b/package.json@@ -212,7 +212,7 @@"bun": ">=1.4.0"},"license": "MIT",- "version": "0.60.53.0",+ "version": "0.60.57.0","overrides": {"@ai-sdk/provider-utils": "4.0.56","@hono/node-server": "^2.0.5",diff --git a/plugin-variants/gbrain-coding/.claude-plugin/plugin.json b/plugin-variants/gbrain-coding/.claude-plugin/plugin.jsonindex 1fcc0dc112..22b0fed58f 100644--- a/plugin-variants/gbrain-coding/.claude-plugin/plugin.json+++ b/plugin-variants/gbrain-coding/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "gbrain-coding",- "version": "0.60.53.0",+ "version": "0.60.57.0","description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)","author": {"name": "Garry Tan",diff --git a/plugin-variants/gbrain-coding/.codex-plugin/plugin.json b/plugin-variants/gbrain-coding/.codex-plugin/plugin.jsonindex 7cdefc8eec..a49ead21a4 100644--- a/plugin-variants/gbrain-coding/.codex-plugin/plugin.json+++ b/plugin-variants/gbrain-coding/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "gbrain-coding",- "version": "0.60.53.0",+ "version": "0.60.57.0","description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)","author": {"name": "Garry Tan",diff --git a/plugin-variants/gbrain-coding/README.md b/plugin-variants/gbrain-coding/README.mdindex dfbc30ad53..4df47db601 100644--- a/plugin-variants/gbrain-coding/README.md+++ b/plugin-variants/gbrain-coding/README.md@@ -1,4 +1,4 @@-<!-- gbrain-plugin-tree-stamp: 0.60.53.0 -->+<!-- gbrain-plugin-tree-stamp: 0.60.57.0 --># gbrain-coding (generated persona variant — do not hand-edit)Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant.diff --git a/plugin-variants/gbrain-daily/.claude-plugin/plugin.json b/plugin-variants/gbrain-daily/.claude-plugin/plugin.jsonindex b58e9adcd2..a74cd69ab2 100644--- a/plugin-variants/gbrain-daily/.claude-plugin/plugin.json+++ b/plugin-variants/gbrain-daily/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "gbrain-daily",- "version": "0.60.53.0",+ "version": "0.60.57.0","description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)","author": {"name": "Garry Tan",diff --git a/plugin-variants/gbrain-daily/.codex-plugin/plugin.json b/plugin-variants/gbrain-daily/.codex-plugin/plugin.jsonindex fb0d03fede..2439f33ac6 100644--- a/plugin-variants/gbrain-daily/.codex-plugin/plugin.json+++ b/plugin-variants/gbrain-daily/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "gbrain-daily",- "version": "0.60.53.0",+ "version": "0.60.57.0","description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)","author": {"name": "Garry Tan",diff --git a/plugin-variants/gbrain-daily/README.md b/plugin-variants/gbrain-daily/README.mdindex 00fe3d824b..29722f1bb2 100644--- a/plugin-variants/gbrain-daily/README.md+++ b/plugin-variants/gbrain-daily/README.md@@ -1,4 +1,4 @@-<!-- gbrain-plugin-tree-stamp: 0.60.53.0 -->+<!-- gbrain-plugin-tree-stamp: 0.60.57.0 --># gbrain-daily (generated persona variant — do not hand-edit)Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant.diff --git a/plugin/README.md b/plugin/README.mdindex 0f08ad89d9..66e5b64f5f 100644--- a/plugin/README.md+++ b/plugin/README.md@@ -1,4 +1,4 @@-<!-- gbrain-plugin-tree-stamp: 0.60.53.0 -->+<!-- gbrain-plugin-tree-stamp: 0.60.57.0 --># gbrain plugin skill tree (generated — do not hand-edit)This tree is the curated skill set for the gbrain Codex and Claude Codediff --git a/skills/migrations/v0.60.57.0.md b/skills/migrations/v0.60.57.0.mdnew file mode 100644index 0000000000..42b2e77ad1--- /dev/null+++ b/skills/migrations/v0.60.57.0.md@@ -0,0 +1,43 @@+# Upgrade to v0.60.57.0: relationships with dates, live-by-default graph reads++Graph reads now return relationships that are true today, and a nightly check+closes jobs that cannot both still hold. Both change what the user sees, and the+nightly check makes small paid chat calls.++1. **Finish the upgrade.** `gbrain upgrade` runs it. To be sure, on the brain+ host:+ ```bash+ gbrain apply-migrations --yes --no-autopilot-install+ ```+ Migration v204 adds the relationship tables. Existing pages re-extract on the+ following dream cycles (bounded per cycle, no model calls), which records the+ dated evidence already in their timelines. Restart every `gbrain serve`,+ autopilot and worker.++2. **Relay the post-upgrade notice.** `gbrain post-upgrade` prints a one-time+ [AGENT] block. Show the user its message and ask whether to keep live-by-default+ graph reads and the nightly relationship check. Run its `if_no` commands only+ after they say no.++3. **Know what the nightly check does.** With the default utility model+ (`claude-haiku-4-5`, certified with 0 wrong closures in held-out runs) it writes+ each closure as an "(inferred) Ended <relation> [[target]]" timeline line. Show+ the user what it did and how to undo:+ ```bash+ gbrain edge-proposals list --status all+ gbrain edge-proposals undo <id>+ ```+ `gbrain config set dream.edge_contradictions.mode propose` makes it ask first.++4. **Use the new reads.** When a graph read leaves relationships out it returns a+ `former_relationships_hidden` notice with the exact call that shows them.+ History: `get_links { slug, status: "all" }`; a past date: `as_of: "YYYY-MM-DD"`;+ a period: `during: "2022"`. To record that a relationship ended, write+ `- **YYYY-MM-DD** | note — Ended works_at [[companies/x]]` on the person's+ timeline or call `add_link` with `valid_until`.++5. **Verify.**+ ```bash+ gbrain doctor --only edge_validity --json+ ```+ Guide: `docs/guides/temporal-edges.md`.diff --git a/skills/skills.lock.json b/skills/skills.lock.jsonindex 2382f0465b..8112212ec1 100644--- a/skills/skills.lock.json+++ b/skills/skills.lock.json@@ -166,6 +166,7 @@"migrations/v0.60.5.0.md": "0d3ee19359a2740de08ac9ec388ddc15e7c72d663afe33832e1e54170528acab","migrations/v0.60.52.0.md": "ae49b2f51ba6288e4883d8bfda9f494f821e160e227164aa065a645d4e9ae87b","migrations/v0.60.53.0.md": "0c43dffb7926703d024b4dbe6ed84a87b630b587c84b42c84f931f13f9c089cf",+ "migrations/v0.60.57.0.md": "b97afe1df069b14446a31b41bfd1f24fc76877c13bd2bf55bf6f6371a87e579c","migrations/v0.60.6.0.md": "1cbfca2c899e1348acbd61f0baa4c8e723b5283ff868c710c74e116c0cb6726e","migrations/v0.7.0.md": "97c2740445a10b1c5c7123c17dbd625fa27a94095b85d27c2b278da756c4c59a","migrations/v0.8.0.md": "1919ff8b8f3680612ff888e7cfcc0d86ece5d5304ae19af4497bdf40b050561a",diff --git a/src/core/link-extraction.ts b/src/core/link-extraction.tsindex a89d448cf3..79881d23ed 100644--- a/src/core/link-extraction.ts+++ b/src/core/link-extraction.ts@@ -91,8 +91,8 @@ export { parseInlineCitationTimelineEntries, type InlineCitationTimelineCandidat// PRE-wave code after this date reads as fresh and won't re-extract until// the page is next edited; no fixed watermark can cover code that keeps// running past it.-// 2026-10-02: normalizeBasename collapses hyphen runs (#5623), so [[Backlog - vault]] resolves; re-extract.-export const LINK_EXTRACTOR_VERSION_TS = '2026-10-02T00:00:00Z';+// 2026-10-02: hyphen-run basenames resolve (#5623); 2026-10-05: temporal edges derive dated evidence on extraction. Re-extract.+export const LINK_EXTRACTOR_VERSION_TS = '2026-10-05T00:00:00Z';// ─── Entity references ──────────────────────────────────────────diff --git a/templates/bootstrap/template-repo/README.md b/templates/bootstrap/template-repo/README.mdindex d021eca7ae..92188ba622 100644--- a/templates/bootstrap/template-repo/README.md+++ b/templates/bootstrap/template-repo/README.md@@ -1,6 +1,6 @@# gbrain agent workspace — template-<!-- gbrain-template-stamp: 0.60.53.0 -->+<!-- gbrain-template-stamp: 0.60.57.0 -->This repository is the **"Use this template"** distribution artifact for a[gbrain](https://github.com/garrytan/gbrain) personal-agent workspace — the same