Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore: bump version and changelog (v0.45.15.0)

Garry Tanf7b8890b8ddc
diff --git a/BOOTSTRAP_FOR_AGENTS.md b/BOOTSTRAP_FOR_AGENTS.md
index 2ccb6e7890..bf78157faf 100644
--- a/BOOTSTRAP_FOR_AGENTS.md
+++ b/BOOTSTRAP_FOR_AGENTS.md
@@ -1,4 +1,4 @@
-<!-- gbrain-runbook-stamp: 0.45.14.0 -->
+<!-- gbrain-runbook-stamp: 0.45.15.0 -->
<!-- This stamp must equal the VERSION file at every release; CI enforces it
(scripts/check-bootstrap-tag.sh). `gbrain bootstrap status` compares it to
the installed binary and warns on skew. -->
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d78d71c6c..9a6b019c9f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,68 @@
All notable changes to GBrain will be documented in this file.
+## [0.45.15.0] - 2026-08-14
+
+**A test run can no longer touch a real brain.** `gbrain init` writes your
+database URL into `~/.gbrain/.env`; anyone who had that sourced and ran a bare
+`bun test` in the repo was one destructive fixture away from their own data
+(#3485 — it has happened). Four independent layers now stand in the way, and
+each one fails loudly instead of silently skipping:
+
+- **The run refuses to start.** A test preload (registered first in
+ `bunfig.toml`) hard-fails any `bun test` invocation while `DATABASE_URL` or
+ `GBRAIN_DATABASE_URL` is ambient, with instructions — it never silently
+ unsets, because a silent unset would turn database-gated e2e tests into
+ green skips. The e2e and heavy lanes opt in at their own wrapper boundary;
+ the unit and slow lanes strip the variables at theirs, so
+ `bun run test:full` with a database URL exported still reaches its e2e leg.
+- **Destructive tests check the database name.** Every test that runs
+ destructive SQL against the ambient URL now calls a shared name floor
+ (moved to a leaf module so unit-directory tests can use it too): the
+ database name must carry "test" as a word segment, or be opted in
+ explicitly, one-shot. This adopts the patch contributed in #3485 by
+ @cheRoma — thank you — extended to two newer files the original audit
+ predates and one raw-client suite it couldn't see.
+- **Shell lanes get the same floor.** The heavy-test scripts (schema drops,
+ parallel syncs, migration replays) share a floor that checks BOTH database
+ URL variables and strips query strings before extracting the name, so a
+ `?host=/tmp/test-sockets` parameter can't smuggle a test-shaped segment
+ past it.
+- **A repo-wide static gate keeps it that way.** A scanner walks every test
+ file bun would collect (all naming patterns, fixtures included), flags any
+ file that reads an ambient database URL, opens a connection, and runs
+ destructive SQL without a guard — and its own classifiers are pinned by
+ positive controls so the gate can never rot into passing vacuously.
+
+### Added
+- Test-run guard preload (`test/helpers/database-url-guard-preload.ts`) with
+ subprocess tests covering every branch: both variables, both-set, override,
+ strict override value, empty-string, and clean runs.
+- Shared destructive-SQL name floor `test/helpers/db-guard.ts` (re-exported
+ from `test/e2e/helpers.ts` for existing call sites) and shell twin
+ `tests/heavy/_db_floor.sh`.
+- Repo-wide destructive-SQL coverage gate `test/db-guard-coverage.test.ts`
+ with classifier self-tests and positive controls.
+
+### Fixed
+- Ten destructive test files now verify the database name before connecting
+ (#3485; patch by @cheRoma, extended).
+- The heavy lane's fixture builder, sync-lock, upgrade-matrix, and wallclock
+ scripts refuse non-test-shaped database names instead of operating on
+ whatever the environment points at.
+- The phantom-redirect engine-parity test's Postgres arm is now carried by
+ the e2e lane and CI's parity job — previously no lane could reach it.
+
+### To take advantage of v0.45.15.0
+
+Nothing to configure. If a bare `bun test` now refuses to start, the message
+tells you exactly why and what to do — usually just unset the database URL
+(unit tests need no database) or use `bun run test:e2e`, which opts in at its
+own boundary. If your e2e database has a non-test-shaped name, opt in one-shot
+with `GBRAIN_E2E_ALLOW_DB=<name>` rather than exporting it in your shell
+profile — a permanent export would disarm the guard for exactly the database
+it protects.
+
## [0.45.14.0] - 2026-08-14
**The box that already has a brain: framework-spawned coding agents get brain access by default.** The bootstrap door built in v0.45.0.0 was for a human at a laptop. A growing share of Claude Code and Codex sessions are spawned by an agent framework — your OpenClaw, or anything that shells out to headless sessions — on a machine that already hosts a brain and a running `gbrain serve --http`. Until now those sessions got nothing unless someone hand-replicated settings writers across every project directory. One command fixes that:
diff --git a/TODOS.md b/TODOS.md
index e33259942f..75a5bf533b 100644
--- a/TODOS.md
+++ b/TODOS.md
@@ -1,5 +1,18 @@
# TODOS
+## Security-process follow-ups (filed with Wave −1 of the fix-wave campaign, 2026-08-14)
+
+- [ ] **P2 — Vulnerability disclosure policy.** **What:** a written disclosure
+ process: advisory ownership, severity ladder, reporter acknowledgment SLA,
+ embargo windows, private patch review, supported-version/backport policy,
+ release timing, post-release rotation guidance. **Why:** private vulnerability
+ reporting is now enabled (#579) and a reporter has a channel, but a channel
+ without a process leaves triage decisions ad-hoc; a public PR diff can still
+ broadcast attack surface mid-embargo. **Context:** filed from the fix-wave
+ campaign's Codex review (CX-11); the campaign deliberately shipped only the
+ toggle + reporter acknowledgment. Start from the responsible-disclosure rules
+ already in CLAUDE.md and docs/RELEASING.md. **Effort:** M. **Priority:** P2.
+
## Truthful-surface wave follow-ups (filed with T14, amendment 35 + D14.5)
Deferred from the MCP consumer-feedback wave (plan at
diff --git a/VERSION b/VERSION
index ce20186d40..4650acc694 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.45.14.0
\ No newline at end of file
+0.45.15.0
diff --git a/docs/TESTING.md b/docs/TESTING.md
index 6a72b85a44..cd5e11a0c7 100644
--- a/docs/TESTING.md
+++ b/docs/TESTING.md
@@ -161,6 +161,26 @@ The quarantine has grown to dozens of files — treat it as debt: every addition
`bun test` runs all tests without a database. E2E tests skip gracefully when `DATABASE_URL` is not set.
+**Database-URL run guard (#3485).** A `bun test` invocation REFUSES to start while
+`DATABASE_URL` or `GBRAIN_DATABASE_URL` is ambient in the environment, because some
+tests run destructive SQL against whatever those URLs point at (a bare `bun test`
+with `~/.gbrain/.env` sourced has wiped a real brain). The guard is a bunfig
+`[test]` preload (`test/helpers/database-url-guard-preload.ts`); it hard-fails with
+instructions rather than silently unsetting (a silent unset would turn
+DATABASE_URL-gated e2e tests into green skips). The e2e wrappers
+(`scripts/run-e2e.sh`, the e2e/heavy workflows) opt in at their own boundary via
+`GBRAIN_TEST_ALLOW_DATABASE_URL=1`; the unit/slow wrappers instead strip both
+URL vars at their boundary (unit tests need no database), which keeps
+`bun run test:full` working with DATABASE_URL exported. Caveat: bun loads
+`bunfig.toml` from the invocation cwd, so the preload layer only applies to
+runs started at the repo root — the per-file name floor below is the layer
+that doesn't care about cwd. Two more layers apply after the opt-in: every
+test that runs destructive SQL on the ambient URL must call
+`assertSafeE2eDatabaseUrl()` (`test/helpers/db-guard.ts` — name floor: the database
+name must contain "test" as a segment, or be opted in via `GBRAIN_E2E_ALLOW_DB`),
+and `test/db-guard-coverage.test.ts` statically scans the suite and fails when a
+file connects to `DATABASE_URL` and runs destructive SQL unguarded.
+
Unit tests and what they cover:
- `test/markdown.test.ts` — frontmatter parsing; `splitBody` sentinel precedence, horizontal-rule preservation, `inferType` wiki subtypes.
diff --git a/openclaw.plugin.json b/openclaw.plugin.json
index 0d68e763f3..f7356369b0 100644
--- a/openclaw.plugin.json
+++ b/openclaw.plugin.json
@@ -1,7 +1,7 @@
{
"id": "gbrain-context-engine",
"name": "gbrain",
- "version": "0.45.14.0",
+ "version": "0.45.15.0",
"description": "Personal knowledge brain with Postgres + pgvector hybrid search",
"family": "bundle-plugin",
"configSchema": {
diff --git a/package.json b/package.json
index faeea8c94c..78a098890f 100644
--- a/package.json
+++ b/package.json
@@ -155,7 +155,7 @@
"bun": ">=1.3.10"
},
"license": "MIT",
- "version": "0.45.14.0",
+ "version": "0.45.15.0",
"overrides": {
"@hono/node-server": "^2.0.5",
"fast-uri": "^3.1.5",
diff --git a/templates/bootstrap/template-repo/README.md b/templates/bootstrap/template-repo/README.md
index 091b543e16..9d12b629dd 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.45.14.0 -->
+<!-- gbrain-template-stamp: 0.45.15.0 -->
This repository is the **"Use this template"** distribution artifact for a
[gbrain](https://github.com/garrytan/gbrain) personal-agent workspace — the same