Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(runtime): raise the Bun floor to 1.4.4 (TLS postgres.js leak, Brotli CVE)

garrytanda31e3e4a8fc
diff --git a/.github/workflows/convergence-nightly.yml b/.github/workflows/convergence-nightly.yml
index 3cc4c961e3..ef25799058 100644
--- a/.github/workflows/convergence-nightly.yml
+++ b/.github/workflows/convergence-nightly.yml
@@ -35,7 +35,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
services:
postgres:
image: pgvector/pgvector:pg16
diff --git a/.github/workflows/native-locks.yml b/.github/workflows/native-locks.yml
index 94501ba3a0..bb49e5a50a 100644
--- a/.github/workflows/native-locks.yml
+++ b/.github/workflows/native-locks.yml
@@ -9,8 +9,8 @@ on:
# smoke: the Linux x64 glibc cell on the primary Bun version (other PRs).
# scripts/ci-native-scope.sh classifies pull requests.
# Named exception (docs/TESTING.md#event-parity): every `inputs.scope`
- # condition below (the openclaw/musl/Windows `if`s and the Bun 1.4.0 and
- # cross-target excludes) narrows pull requests and merge-queue runs only;
+ # condition below (the openclaw/musl/Windows `if`s and the cross-target
+ # excludes) narrows pull requests and merge-queue runs only;
# every push to master and the nightly Test schedule run scope=full.
scope:
type: string
@@ -70,12 +70,12 @@ jobs:
strategy:
fail-fast: false
matrix:
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
target: [linux-x64-glibc, linux-arm64-glibc, darwin-arm64, darwin-x64, win32-x64, win32-arm64]
# Pull requests: primary Bun on every target (native paths changed) or
# the Linux x64 glibc smoke cell. Runners map from the target above.
# Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).
- exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || inputs.scope == 'primary' && '[{"bun":"1.4.0"}]' || '[{"bun":"1.4.0"},{"target":"linux-arm64-glibc"},{"target":"darwin-arm64"},{"target":"darwin-x64"},{"target":"win32-x64"},{"target":"win32-arm64"}]') }}
+ exclude: ${{ fromJSON(inputs.scope == 'smoke' && '[{"target":"linux-arm64-glibc"},{"target":"darwin-arm64"},{"target":"darwin-x64"},{"target":"win32-x64"},{"target":"win32-arm64"}]' || '[]') }}
steps:
# The data-safety step stops its suites before this job's timeout: a timeout cancel keeps no log.
- name: Record the job deadline
@@ -249,9 +249,7 @@ jobs:
fail-fast: false
matrix:
runner: [windows-2022, windows-11-arm]
- bun: ['1.4.0', '1.4.4']
- # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).
- exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || '[{"bun":"1.4.0"}]') }}
+ bun: ['1.4.4']
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
timeout-minutes: 2
@@ -285,9 +283,7 @@ jobs:
fail-fast: false
matrix:
runner: [windows-2022, windows-11-arm]
- bun: ['1.4.0', '1.4.4']
- # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).
- exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || '[{"bun":"1.4.0"}]') }}
+ bun: ['1.4.4']
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
timeout-minutes: 2
@@ -320,10 +316,8 @@ jobs:
strategy:
fail-fast: false
matrix:
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
target: [linux-x64-musl, linux-arm64-musl]
- # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).
- exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || '[{"bun":"1.4.0"}]') }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
diff --git a/.github/workflows/persistence-validation.yml b/.github/workflows/persistence-validation.yml
index d96a7612d0..34f1068ce3 100644
--- a/.github/workflows/persistence-validation.yml
+++ b/.github/workflows/persistence-validation.yml
@@ -26,9 +26,9 @@ jobs:
fail-fast: false
matrix:
engine: [pglite, postgres]
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
# Event parity: every event, pull requests and merge-queue runs
- # included, runs both supported Bun versions (docs/TESTING.md#event-parity).
+ # included, runs every supported Bun version (docs/TESTING.md#event-parity).
services:
postgres:
image: pgvector/pgvector:pg16
@@ -72,9 +72,9 @@ jobs:
strategy:
fail-fast: false
matrix:
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
# Event parity: every event, pull requests and merge-queue runs
- # included, runs both supported Bun versions (docs/TESTING.md#event-parity).
+ # included, runs every supported Bun version (docs/TESTING.md#event-parity).
services:
postgres:
image: pgvector/pgvector:pg16
@@ -195,7 +195,7 @@ jobs:
# doubled for a slow runner, must end a minute inside the step's 20 minutes
# (ARM_SHARD_BUDGET_MS). The Bun 1.4.4 cell runs only the PostgreSQL side of
# testBackends() suites (--postgres-only); their PGLite side runs in the unit
- # and serial lanes on Bun 1.4.4, and the Bun 1.4.0 cell keeps both sides.
+ # and serial lanes on Bun 1.4.4.
# Event parity (docs/ci-event-parity.md#full-ci-on-pull-requests): full profile only; a
# pull request (cheap tier) runs only the crash robot and convergence here. The
# full-ci dispatch on its head, every push and the nightly run this lane.
@@ -208,9 +208,9 @@ jobs:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
# Event parity: every event, pull requests and merge-queue runs
- # included, runs both supported Bun versions (docs/TESTING.md#event-parity).
+ # included, runs every supported Bun version (docs/TESTING.md#event-parity).
services:
postgres:
image: pgvector/pgvector:pg16
@@ -280,9 +280,9 @@ jobs:
fail-fast: false
matrix:
engine: [pglite, postgres]
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
# Event parity: every event, pull requests and merge-queue runs
- # included, runs both supported Bun versions (docs/TESTING.md#event-parity).
+ # included, runs every supported Bun version (docs/TESTING.md#event-parity).
services:
postgres:
image: pgvector/pgvector:pg16
@@ -335,9 +335,9 @@ jobs:
fail-fast: false
matrix:
engine: [pglite, postgres]
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
# Event parity: every event, pull requests and merge-queue runs
- # included, runs both supported Bun versions (docs/TESTING.md#event-parity).
+ # included, runs every supported Bun version (docs/TESTING.md#event-parity).
services:
postgres:
image: pgvector/pgvector:pg16
@@ -426,9 +426,9 @@ jobs:
fail-fast: false
matrix:
engine: [pglite, postgres]
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
# Event parity: every event, pull requests and merge-queue runs
- # included, runs both supported Bun versions (docs/TESTING.md#event-parity).
+ # included, runs every supported Bun version (docs/TESTING.md#event-parity).
services:
postgres:
image: pgvector/pgvector:pg16
@@ -488,9 +488,9 @@ jobs:
strategy:
fail-fast: false
matrix:
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
# Event parity: every event, pull requests and merge-queue runs
- # included, runs both supported Bun versions (docs/TESTING.md#event-parity).
+ # included, runs every supported Bun version (docs/TESTING.md#event-parity).
services:
postgres:
image: pgvector/pgvector:pg16
diff --git a/.github/workflows/promote-stable.yml b/.github/workflows/promote-stable.yml
index 8099812392..484b64f275 100644
--- a/.github/workflows/promote-stable.yml
+++ b/.github/workflows/promote-stable.yml
@@ -67,7 +67,7 @@ jobs:
fetch-depth: 0
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
- bun-version: 1.4.3
+ bun-version: 1.4.4
- name: Promote the release to stable
env:
GH_TOKEN: ${{ github.token }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 7ac58bfb49..6b47413685 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -71,8 +71,8 @@ jobs:
# native target on the primary Bun version; other pull requests run the Linux
# x64 smoke cell. Pushes, schedules and manual runs always run the full matrix.
# Named exception (docs/TESTING.md#event-parity): the native-locks scope
- # reduction on pull requests and merge-queue runs (Bun 1.4.0 and cross-target
- # cells) is covered by every push to master and the nightly Test schedule,
+ # reduction on pull requests and merge-queue runs (cross-target cells) is
+ # covered by every push to master and the nightly Test schedule,
# which both run scope=full.
changes:
runs-on: ubicloud-standard-2-ubuntu-2404
@@ -241,9 +241,9 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-26, windows-latest]
- bun: ['1.4.0', '1.4.4']
+ bun: ['1.4.4']
# Event parity: every event, pull requests and merge-queue runs
- # included, runs both supported Bun versions on every OS
+ # included, runs every supported Bun version on every OS
# (docs/TESTING.md#event-parity).
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
diff --git a/BOOTSTRAP_FOR_AGENTS.md b/BOOTSTRAP_FOR_AGENTS.md
index 64402925e1..e68e4bee05 100644
--- a/BOOTSTRAP_FOR_AGENTS.md
+++ b/BOOTSTRAP_FOR_AGENTS.md
@@ -43,7 +43,7 @@ read it and relay it to the human in plain language. Never work around a refusal
⛔ **VERIFY BEFORE CLAIMING DONE.** The install is done when `gbrain bootstrap
verify` exits 0 — not when the transcript looks good. Paste its report to the human.
-⛔ **RESPECT THE TOOLCHAIN TRUST RULES.** GBrain needs Bun 1.4.0 or newer (`bun upgrade`
+⛔ **RESPECT THE TOOLCHAIN TRUST RULES.** GBrain needs Bun 1.4.4 or newer (`bun upgrade`
updates an older Bun). Install bun via a platform package manager
when available (`brew install oven-sh/bun/bun`); the only permitted fallback is the
checksum-verified variant: download the pinned release to a file, verify it against
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3f4c999126..671373e419 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -12,7 +12,7 @@ bun install --frozen-lockfile && bun run test && bun run verify
battery. [`docs/TESTING.md`](docs/TESTING.md#quick-start) covers E2E, failure
logs and the lanes.
-Requires Bun 1.4.0 or newer, matching `package.json`.
+Requires Bun 1.4.4 or newer, matching `package.json`.
### Windows
@@ -299,7 +299,7 @@ See [E2E selection](docs/TESTING.md#e2e-selection).
### Memory-trust smoke (trust tiers, write gate, purge)
Touching trust tiers, the write gate, owner confirmation or `forget --purge`?
-Run `bun run trust:smoke` first (Bun >= 1.4.0, zero keys, in-memory PGLite,
+Run `bun run trust:smoke` first (Bun >= 1.4.4, zero keys, in-memory PGLite,
about ten seconds). It drives the four seams through real write paths: the tier
stamp, the gate verdict, the owner confirm (and an agent's refusal) and purge
with no residual or resurrection, and prints one line per check. The script
diff --git a/INSTALL_FOR_AGENTS.md b/INSTALL_FOR_AGENTS.md
index 0480a38f7d..d928ddc015 100644
--- a/INSTALL_FOR_AGENTS.md
+++ b/INSTALL_FOR_AGENTS.md
@@ -46,7 +46,7 @@ If you fetched this file by URL without cloning yet, the companion files live at
> garrytan/gbrain` + `/plugin install gbrain@gbrain`). Details:
> docs/mcp/CODEX.md and docs/mcp/CLAUDE_CODE.md.
-Default path (Bun 1.4.0 or newer is required — gbrain is a Bun + TypeScript runtime; on an older Bun, run `bun upgrade` first):
+Default path (Bun 1.4.4 or newer is required — gbrain is a Bun + TypeScript runtime; on an older Bun, run `bun upgrade` first):
```bash
curl -fsSL https://bun.sh/install | bash
diff --git a/README.md b/README.md
index 970bd0bb9f..dbbcc80d93 100644
--- a/README.md
+++ b/README.md
@@ -88,7 +88,7 @@ This is the difference between a search engine and a brain. Search finds the pag
## Install
-Requires **Bun 1.4.0 or newer**. Existing worker installations should follow the
+Requires **Bun 1.4.4 or newer**. Existing worker installations should follow the
[authorization and queue upgrade guide](docs/guides/authorization-upgrade.md)
before restarting services with this version.
diff --git a/SECURITY.md b/SECURITY.md
index a76eeb11eb..ae0ddb28b7 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -387,7 +387,7 @@ clients in the existing Agents page.
Queued work also retains its submitting authority and is revalidated before
execution. Worker upgrades require a stopped-service cutover; see the
[authorization and worker upgrade guide](docs/guides/authorization-upgrade.md)
-before migrating an existing queue. That guide also covers the Bun 1.4.0
+before migrating an existing queue. That guide also covers the Bun 1.4.4
minimum and guarded outbound connections.
```bash
diff --git a/docs/TESTING.md b/docs/TESTING.md
index 1e9577c092..a02cce0ea2 100644
--- a/docs/TESTING.md
+++ b/docs/TESTING.md
@@ -7,7 +7,7 @@ history lives in `CHANGELOG.md`, per-file detail in the tests and
## Quick start
-Prerequisites: Bun 1.4.0 or newer (CI pins 1.4.4), Git, and bash. E2E needs
+Prerequisites: Bun 1.4.4 or newer (CI pins 1.4.4), Git, and bash. E2E needs
Docker for a `pgvector/pgvector:pg16` container and Python 3 on `PATH` (the E2E
runner validates Bun's JUnit reports with the standard-library XML parser).
@@ -235,7 +235,7 @@ Recorded ownership changes:
- `test/e2e/reconcile-crash.test.ts` and `test/e2e/reconcile-crash-unactivated.test.ts`:
the PR owner is `persistence-validation.yml`, called from `test.yml` on every
- PR on both supported Bun versions against pg16. Its "Require all
+ PR on every supported Bun version against pg16. Its "Require all
reconciliation crash boundaries" step runs both files by name and uploads the
crash manifests, unchanged. Both files are in `E2E_EXCLUSIONS`
(`PERSISTENCE_VALIDATION_OWNED` in `scripts/e2e-matrix.ts`), so PR
@@ -1771,7 +1771,7 @@ existing fence and timeline suites.
`test/guarded-http.test.ts` and `test/guarded-http-tls.serial.test.ts` cover DNS,
TLS identity and ports, redirects, deadlines, body limits, and cleanup. CI runs
-these boundaries on Bun 1.4.0 and 1.4.4, audits root and admin dependencies, and
+these boundaries on Bun 1.4.4, audits root and admin dependencies, and
executes `scripts/test-gitleaks-config.sh` to prove fixture exceptions still
report an unrelated secret in the same file. `scripts/scan-worktree-secrets.sh`
scans tracked files plus new files eligible for commit; tracked ignored files
diff --git a/docs/architecture/key-files/ci-health-and-test-guards.md b/docs/architecture/key-files/ci-health-and-test-guards.md
index a237b2f80f..772d74b782 100644
--- a/docs/architecture/key-files/ci-health-and-test-guards.md
+++ b/docs/architecture/key-files/ci-health-and-test-guards.md
@@ -22,7 +22,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `scripts/check-test-env-opt-ins.ts` + `test/helpers/operator-env-policy.ts` — the opt-in naming rule. The policy (`STRIP_PREFIX`, `KEEP_EXACT`, `KEEP_PREFIX`, `RENAMED`, `isStripped`) is shared by `test/helpers/operator-env-preload.ts`, which deletes stripped `GBRAIN_*` names before any test loads and stops the run with the rename command when an old opt-in name is set, and by the guard (`check:test-env-opt-ins`, in `verify`), which parses test files and fails on a test that gates execution on a stripped name. Test opt-ins are `GBRAIN_TEST_<AREA>_<WHAT>`, paid ones `GBRAIN_TEST_LIVE_<WHAT>`. The same guard fails `test_env_snapshot_module_scope`: a `delete` of or assignment to `process.env.GBRAIN_PGLITE_SNAPSHOT` outside every function body in a file the unit matrix loads (`*.serial.test.ts`, `test/e2e/` and `*-preload.ts` are exempt: own process, or process-wide by design). `scripts/test-shard.sh` runs a whole shard in one bun process, so such a change persists for every later file and each of their PGLite engines cold-boots (~3 s); the accepted shape is save+delete in `beforeAll`, restore in `afterAll`, or `test/helpers/with-snapshot.ts` per test. Tests: `test/scripts/test-env-opt-ins-guard.test.ts`, `test/operator-env-preload.test.ts`.
- `scripts/check-postgres-lane-coverage.ts` — `check:postgres-lanes` (in `verify`). TypeScript-AST scan of every `test/` file outside `test/e2e/` and `test/fixtures/` for a `DATABASE_URL`-gated PostgreSQL arm (zero-argument `testBackends()`, or a `DATABASE_URL` read used as a condition, connection argument or `database_url` value; `withEnv`-supplied URLs excluded) and a lane that runs it (a workflow step with `DATABASE_URL` naming the file, a `test/e2e/` importer, a `tests/heavy/` script, or a `scripts/e2e-backend-matrix.txt` row). `ALLOWLIST` rows name a reason and TODO; stale rows fail. A `test/postgres-unit-arms.txt` row is a lane; a malformed, duplicate, unsorted, missing-file or arm-less row fails (`postgres_arm_list_invalid`, `postgres_arm_list_stale`). `postgresArm`, `postgresLanes` and `armedFiles` are exported for the stress runner. Tests: `test/scripts/postgres-lane-coverage.test.ts`.
- `scripts/check-item-allowlist-catches.ts` + `scripts/item-allowlist-catches-baseline.tsv` — `check:item-allowlist-catches` (in `verify`). TypeScript-AST scan of `src/**/*.ts` (no `*.generated.ts`, `.d.ts`) for catch clauses in a per-item loop (a for/for-of/for-in/while/do-while body, or a `.forEach`/`.map` callback, up to the nearest function boundary) whose block tests the caught error's code against a set, list or literal (direct, cast, aliased or destructured) and rethrows the caught error. Per-file counts only shrink: growth, a new file, a count under its row, a row with no sites or no file, and malformed, duplicate or unsorted rows fail, pointing at `classifyItemFailure` / `ItemRun` (`src/core/item-failure.ts`) and `test/pathological/`. `--update` rewrites the baseline after a shrink. `findAllowlistCatches` and `compareBaseline` are exported for `test/scripts/check-item-allowlist-catches.test.ts`; self-test fixtures under `test/fixtures/guards/check-item-allowlist-catches.ts/`.
-- `test/postgres-unit-arms.txt` + `scripts/postgres-unit-arms.ts` + `scripts/postgres-arm-weights.json` — the one list of unit-lane files whose PostgreSQL arm has no other owner (sorted, one path per line, `#` comments). Read by persistence-validation.yml's `unit-postgres-arms` job (`ARM_SHARDS` = 12 shards, `shard <n> <m>`: LPT over the mined per-file weights, p75 fallback; `run <n> <m> [--postgres-only]`: `ARM_WORKERS` = 2 files at a time, one Bun process per file, each worker on its own URL from `GBRAIN_ARM_DATABASE_URLS`, output buffered per file and printed in queue order in `::group::` blocks ending in an `ARM_FILE … ms=…` line, one receipt triple per file; `--postgres-only` (Bun 1.4.3 cell) sets `GBRAIN_TEST_BACKEND=postgres` and reads `ARM_WEIGHTS_POSTGRES_ONLY` when it exists; each shard's two-worker makespan at most `ARM_SHARD_BUDGET_MS`, 570 s, so twice that still ends a minute inside the 20-minute `ARM_STEP_TIMEOUT_MS` step; no machine-exclusive serial file may be listed), the scheduled race hunt and the lane guard. `mine [--postgres-only] <job.log>…` rewrites the cell's weights from a green run's `ARM_FILE` lines (older logs: `##[group]<file>` to the next group or endgroup). Tests: `test/scripts/postgres-unit-arms.test.ts`.
+- `test/postgres-unit-arms.txt` + `scripts/postgres-unit-arms.ts` + `scripts/postgres-arm-weights.json` — the one list of unit-lane files whose PostgreSQL arm has no other owner (sorted, one path per line, `#` comments). Read by persistence-validation.yml's `unit-postgres-arms` job (`ARM_SHARDS` = 12 shards, `shard <n> <m>`: LPT over the mined per-file weights, p75 fallback; `run <n> <m> [--postgres-only]`: `ARM_WORKERS` = 2 files at a time, one Bun process per file, each worker on its own URL from `GBRAIN_ARM_DATABASE_URLS`, output buffered per file and printed in queue order in `::group::` blocks ending in an `ARM_FILE … ms=…` line, one receipt triple per file; `--postgres-only` (Bun 1.4.4 cell) sets `GBRAIN_TEST_BACKEND=postgres` and reads `ARM_WEIGHTS_POSTGRES_ONLY` when it exists; each shard's two-worker makespan at most `ARM_SHARD_BUDGET_MS`, 570 s, so twice that still ends a minute inside the 20-minute `ARM_STEP_TIMEOUT_MS` step; no machine-exclusive serial file may be listed), the scheduled race hunt and the lane guard. `mine [--postgres-only] <job.log>…` rewrites the cell's weights from a green run's `ARM_FILE` lines (older logs: `##[group]<file>` to the next group or endgroup). Tests: `test/scripts/postgres-unit-arms.test.ts`.
- `scripts/serial-files.tsv` + `scripts/lib/serial-manifest.ts` — the serial manifest: every `*.serial.test.ts` outside `test/e2e/` with its class (`R1`, `R2`, `global-state`, `exclusive`) and a reason. `checkSerialManifest` (pure) requires the manifest to match the tree exactly, classes to match what the file does (env mutation, `mock.module`, `EXCLUSIVE_FILES`) and reasons to be specific; each failure prints Why/Fix/Docs with `bash scripts/check-test-isolation.sh --as-parallel <file>` as the first step. Tests: `test/scripts/serial-files.test.ts`.
- `test/helpers/brain-template.ts` — disk-backed PGLite brains cloned from one initialized template per process and embedding shape. The template is captured right after `initSchema` with no source, writer or physical-root reservation (asserted); only the data directory is copied; each clone regenerates `brain_id`, the default source incarnation and the shared-skill token secret and serving epoch. Used by `test/helpers/connector-fixture.ts`. Tests: `test/helpers/brain-template.test.ts`.
- `scripts/test-agent-voice.sh` — `bun run test:agent-voice`: the agent-voice recipe's vitest unit suite (`recipes/agent-voice/tests/unit`), with pinned vitest and ws installed into a temporary prefix linked as the recipe's `node_modules`. Needs node, npm and registry access; CI runs it in test.yml's verify job.
diff --git a/docs/architecture/key-files/core-persistence-continued.md b/docs/architecture/key-files/core-persistence-continued.md
index b6dfaeb406..f431c38713 100644
--- a/docs/architecture/key-files/core-persistence-continued.md
+++ b/docs/architecture/key-files/core-persistence-continued.md
@@ -37,7 +37,7 @@ The #6188 fence check and fence repair live in [fence repair](core-fence-repair.
- `src/core/persistence/graduation-copy.ts` — engine graduation copier (in process). `copyTable` reads source rows through the digest's own plan (`digestPlan` with inventory transforms, `rowFilter`, `::text` values, COLLATE "C" keyset batches) and writes them in one target transaction per table that sets `gbrain.graduation_run`, bypasses user triggers (`session_replication_role = replica`, or DISABLE/ENABLE TRIGGER by name in the same transaction, never the `gbrain_graduation_fence` triggers), deletes the target's rows (seed rows included) and inserts byte-sized batches as one `$1::text::jsonb` array cast back per column type. The per-column contract (`columnContract`) refuses missing, retyped, target-only or differently generated columns outside the entry's `columnAllowlist`; generated columns are never inserted. Self-FKs take a second update pass under DISABLE TRIGGER. `copySequences` applies each source sequence's exact position, raised to the target column maximum. `deferIndexes`/`buildDeferredIndexes` drop and rebuild HNSW (through `buildDeferredAnnIndexes`) and GIN indexes, keeping the pending list in the target-owned `graduation.deferred_indexes` config row. Tests: `test/graduation-copy.test.ts`, `test/e2e/graduation-copy.test.ts`.
- `src/core/persistence/root-metadata.ts` — engine-free ownership-marker names. `isPhysicalRootMetadata` matches `.gbrain-owner.json`, `.gbrain-owner-<sha256>.json` (reservation) and `.gbrain-owner.json.<uuid>.tmp` (`physical-root-record.ts` re-exports it and `PHYSICAL_ROOT_MARKER`). `OWNERSHIP_MARKER_GLOBS` (#5186) are those names in gitignore dialect: `physical-root-record.ts` `excludeOwnershipMarkers` appends them to `<gitdir>/info/exclude` (`git rev-parse --git-path`, idempotent, best effort) after `writePhysicalRootStamp` / `adoptTransferredRootStamp`, for the stamped directory, the root and the reservation's parent. `PUSH_DENY_GLOBS` denies them with `.gbrain-bootstrap.lock/**`; the bootstrap `.gitignore` template has them; doctor `tracked_ownership_marker` warns when a source checkout's index has one. `withoutPhysicalRootMetadata` drops `git status --porcelain` entries made only of such metadata (doctor `bootstrap_push_health`, stop-hook dirty probes): a stamp-only tree is clean, a real change beside the stamp, a rename across it and a quoted path still count. Test: `test/persistence-root-metadata.test.ts`.
- `src/core/persistence/automatic-sync-policy.ts` — `automaticSyncPull(engine, source)`: whether an automatic sync (autopilot freshness `sync` job, per-source fanout cycle) may request a Git pull. It needs a parsed `remote_url`, exactly one boolean `persistence_brain` state that is off, and no worktree binding; a managed brain or claimed source syncs local HEAD with `pull: false`. Missing, duplicated or non-boolean persistence metadata throws `storage_error` (why, read-only `gbrain sources writer status --probe --json` fix) instead of granting a pull, so the caller queues nothing. Clone, immutable and federation flags grant nothing. Pinned by `test/automatic-sync-pull-policy.test.ts`.
-- `src/core/persistence/native-lock.ts` + `native/locks/` — lazy portable Node-API v3 kernel locks (`flock` / `LockFileEx`) with opaque handles, retained stable lock files, cancellable asynchronous waiting and fail-closed capability errors. Eight vendored prebuilds support script-disabled source installs; pinned Zig recipes and source/artifact hashes live in `scripts/native/`. Actual competing-process, crash-handoff and compiled-executable tests run across eight platform/architecture targets and Bun 1.4.0 / 1.4.2. The compiled smoke waits for child exit before cleanup; `scripts/native/compiled-smoke-cleanup.ts` bounds retries to transient Windows `EBUSY` errors, with persistent and permission failures pinned by `test/scripts/native-compiled-cleanup.test.ts`. Windows-only `windows-ipc.h` supplies opaque Global mutex claims (same-thread recursion refused, abandoned owner handoff) and exact-handle stale AF_UNIX deletion after a verified reparse tag under a retained binding claim. CNG hashing and native casing make pipe identities independent of homes and logon sessions. Build and ownership contract: `native/locks/README.md`. `native/locks/package.json` (private, no entry points, outside `buildInputs` and `prebuilds/`) is a package boundary so plugin hosts that namespace native addons by the nearest package.json do not treat the whole checkout as one package (#6026; guard `test/native-locks-package-boundary.test.ts`). #6305: a failure to create or open the lock file is a `NativeLockUnavailableError` with `stage: 'open'` and `osError` (node:fs code, or the addon's `(OS error N)` as its errno name); `isLockOpenFailure` matches only that typed shape, never message text. `publishMutation` (`coordinator.ts`) and the Postgres single-write group path (`group-publish.ts` `publishGroup`, falling through to `publishMutation`) release such a write as `queued` / `writer_lock_unavailable` instead of the terminal owner-exception path; the consumer holds that root for `INSPECT_OWNER_RETRY_MS` (30 s, `health.ts`) so it doesn't re-prepare every poll; `ownerExceptionFailure` reports `osError` as the owner-only errno; a Git effect counts it as a dependency wait and never parks on it. An EISDIR or EACCES on the brain path itself stays terminal (`persistence-lock-open-failure.test.ts`, both engines).
+- `src/core/persistence/native-lock.ts` + `native/locks/` — lazy portable Node-API v3 kernel locks (`flock` / `LockFileEx`) with opaque handles, retained stable lock files, cancellable asynchronous waiting and fail-closed capability errors. Eight vendored prebuilds support script-disabled source installs; pinned Zig recipes and source/artifact hashes live in `scripts/native/`. Actual competing-process, crash-handoff and compiled-executable tests run across eight platform/architecture targets on Bun 1.4.4. The compiled smoke waits for child exit before cleanup; `scripts/native/compiled-smoke-cleanup.ts` bounds retries to transient Windows `EBUSY` errors, with persistent and permission failures pinned by `test/scripts/native-compiled-cleanup.test.ts`. Windows-only `windows-ipc.h` supplies opaque Global mutex claims (same-thread recursion refused, abandoned owner handoff) and exact-handle stale AF_UNIX deletion after a verified reparse tag under a retained binding claim. CNG hashing and native casing make pipe identities independent of homes and logon sessions. Build and ownership contract: `native/locks/README.md`. `native/locks/package.json` (private, no entry points, outside `buildInputs` and `prebuilds/`) is a package boundary so plugin hosts that namespace native addons by the nearest package.json do not treat the whole checkout as one package (#6026; guard `test/native-locks-package-boundary.test.ts`). #6305: a failure to create or open the lock file is a `NativeLockUnavailableError` with `stage: 'open'` and `osError` (node:fs code, or the addon's `(OS error N)` as its errno name); `isLockOpenFailure` matches only that typed shape, never message text. `publishMutation` (`coordinator.ts`) and the Postgres single-write group path (`group-publish.ts` `publishGroup`, falling through to `publishMutation`) release such a write as `queued` / `writer_lock_unavailable` instead of the terminal owner-exception path; the consumer holds that root for `INSPECT_OWNER_RETRY_MS` (30 s, `health.ts`) so it doesn't re-prepare every poll; `ownerExceptionFailure` reports `osError` as the owner-only errno; a Git effect counts it as a dependency wait and never parks on it. An EISDIR or EACCES on the brain path itself stays terminal (`persistence-lock-open-failure.test.ts`, both engines).
- `src/core/persistence/switches.ts` + `preadmit-cache.ts` + `config-snapshot.ts` — the single-write fast path for foreground page writes on Postgres. `switches.ts` reads every write-path kill switch (`persistence.single_write_group` / `GBRAIN_SINGLE_WRITE_GROUP`, `persistence.preadmit_cache` / `GBRAIN_PREADMIT_CACHE`, `sync.waive_batch` / `GBRAIN_SYNC_WAIVE_BATCH`, `sync.foreground_priority` / `GBRAIN_SYNC_FOREGROUND_PRIORITY`, and `persistence.preparation_deadlines` / `GBRAIN_PREPARATION_DEADLINES` (#6278: off restores the old preparation predicate, see persistence-stalls.md); on by default, `0`/`false` off, env over config) in one `SELECT key,value FROM config WHERE key = ANY(...)` per engine, kept 5 s (the consumer tick reads it under its phase deadline), together with the four preparation budget keys (`readWriteSwitchSnapshot` returns `{ switches, preparation }`; `readPreparationPolicy` is the budgets alone); read-through views register their engine (`registerEngineView`) to share it. With `single_write_group` on: the consumer publishes an eligible single page write (put_page, capture, edit/delete/restore/revert without an internal `intent.kind` or group key) as a group of one through `publishGroup` (`publishSingleWrite`; its intent carries no group marker, its effects queue without `deferBatchReconcile`, and a group that does not commit falls back to `publishMutation`, reclaiming a claim its file restoration released); PGLite and refused shapes keep `publishMutation`. The waiter's own wake (`wake(true)`) claims without the periodic scans (recovery records still block the claim through `claimableWriteSql`); preparation reads the config table once (`config-snapshot.ts`) and sends its independent reads together; the coordinated (`coordinated: true`) put_page apply reuses the publisher's locked read as the import base, pipelines its follow-up statements and reads the page once after its last write for the read-back check, seal, core notice and receipt. Publication, the own admission and the recovery transactions run on the consumer's reserved lane (`onLane`: the idle-probe connection, taken while two other pool connections stay free and kept across writes; never lent while an idle probe runs on it, and probes skip it while lent), so their prepared statements stay warm; the waiter is told of the commit before the recovery record is cleared. `preadmit-cache.ts` (with `preadmit_cache` on, Postgres) answers the brain id, source row, worktree binding and local-writer reads of `submitPageMutation` from a per-engine cache (30 s, keyed by brain id; absences never cached); admission rechecks each under lock and the brain id against its protocol statement, and a refusal the cache could explain (`source_changed`, `permission_denied`, a changed brain) drops the cache and runs the whole preparation once more uncached. Pinned by `test/e2e/single-write-fast-path-postgres.test.ts` (switches, cache rechecks, replay, restoration after a failure past the file rename, the recovery-blocked direct claim) and `test/single-write-group-parity.test.ts` + `test/e2e/single-write-group-parity-postgres.test.ts` (row-for-row parity with the switches off); measured by `scripts/bench/foreground-put-page.ts`.
diff --git a/docs/architecture/key-files/core-utilities-2.md b/docs/architecture/key-files/core-utilities-2.md
index bf10249e2f..6a8c8b0302 100644
--- a/docs/architecture/key-files/core-utilities-2.md
+++ b/docs/architecture/key-files/core-utilities-2.md
@@ -26,7 +26,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `src/core/restore-target.ts` -- `resolveRestoreTarget(engine, source, repo)`: the source and repo `gbrain export --restore-only` restores, shared with `gbrain storage status` so its printed restore command restores exactly the files it lists. An explicit source (already resolved) wins; a repo without a source selects the one active source registered at that exact path, refuses a repo registered only to an archived source, else selects the only active source; neither selects the flagless resolver chain's source and its `local_path` (the legacy `sync.repo_path` answers for `default` only). `restoreFilePath(repo, slug, sourcePath, sourcePathBytes, slugRootMode)` is the file whose absence makes the restore write a page: the recorded `source_path` resolved in the repo in the source's slug-root mode (`scannerSlugRootMode`), else `<slug>.md`; an over-long or unsafe recorded path throws. Refusals throw `RestoreTargetError`; resolver and database errors propagate unchanged.
-- `src/core/runtime-version.ts` — Bun 1.4.0 minimum (`MINIMUM_BUN_VERSION`; the lowest 1.4 release, carrying the Linux child-exit fix oven-sh/bun#30301). `unsupportedBunMessage` names the found and required versions and the fix (`bun upgrade`, restart, `gbrain post-upgrade` for an interrupted upgrade). `exitOnUnsupportedBun` is the CLI entrypoint gate: every command below the floor exits 1 before dispatch (`--version` still prints, exit 0, so an older gbrain's upgrade can verify the swap; `autopilot` also writes the refusal to stdout, its service log); `scripts/postinstall.ts` prints it when an install lands on an older Bun; the guarded HTTP transport asserts it; doctor reports it as `bun_runtime`. Package engines, runtime checks and the CI minimum-version lanes share the same floor (`test/scripts/ci-pr-scope.test.ts`). `compareBunVersions`/`bunVersionMeets` order Bun versions by semver (a `-canary` prerelease sits below its release; `+revision` metadata is ignored), shared with the upgrade floor gate. `SECURE_BUN_VERSION` (1.4.4) is the first Bun with the Brotli fix for CVE-2026-111497 (#7373): doctor's `bun_runtime` warns below it with the upgrade path for how gbrain runs (`gbrain upgrade` for a standalone binary, which embeds its Bun; `bun upgrade` for a bun install), the 1.4.0 floor still starts, and the CI primary pin may not drop below it (`test/scripts/ci-pr-scope.test.ts`).
+- `src/core/runtime-version.ts` — Bun 1.4.4 minimum (`MINIMUM_BUN_VERSION`; 1.4.0-1.4.2 leak every chunk a postgres.js TLS connection reads, #7644 #7596). `unsupportedBunMessage` names the found and required versions and the fix (`bun upgrade`, restart, `gbrain post-upgrade` for an interrupted upgrade). `exitOnUnsupportedBun` is the CLI entrypoint gate: every command below the floor exits 1 before dispatch (`--version` still prints, exit 0, so an older gbrain's upgrade can verify the swap; `autopilot` also writes the refusal to stdout, its service log); `scripts/postinstall.ts` prints it when an install lands on an older Bun; the guarded HTTP transport asserts it; doctor reports it as `bun_runtime`. Package engines, runtime checks and the CI minimum-version lanes share the same floor (`test/scripts/ci-pr-scope.test.ts`). `compareBunVersions`/`bunVersionMeets` order Bun versions by semver (a `-canary` prerelease sits below its release; `+revision` metadata is ignored), shared with the upgrade floor gate. `SECURE_BUN_VERSION` (1.4.4) is the first Bun with the Brotli fix for CVE-2026-111497 (#7373): the floor is not below it, so a runtime without the fix is refused; doctor's `bun_runtime` warns (`gbrain upgrade` for a standalone binary, `bun upgrade` for a bun install) only for a supported runtime below it, and the CI primary pin may not drop below it (`test/scripts/ci-pr-scope.test.ts`).
- `src/core/self-upgrade-swap.ts` — autopilot swap settlement (#6828): `prepareSwapReceipt`/`settleAutopilotSwap` read the receipt `gbrain upgrade --swap-only` writes (`GBRAIN_SWAP_RECEIPT`; one from another run is ignored, none falls back to `gbrain --version`). Unchanged version, or exit 0 with nothing newer confirmed: hold, no known-bad, `self_upgrade.last_check_ts` (24 h retry). Failure: known-bad names the installed version; when that is not the checked one, also throttle and drop the update cache. Floor refusal (78): hold. Real swap: breadcrumb on the installed version. Tests: `autopilot-unpublished-target-6828.test.ts`, `autopilot-bun-floor.test.ts`.
- `src/core/self-upgrade-recovery.ts` — #6828 known-bad recovery: `neverInstalledFailedVersions` (pure) lists `self_upgrade.failed_versions` entries proven never installed: the no-op swap's own `last_upgrade` (`from` == `to` == running) is timestamped inside that entry's swap window, the entry has one failure (`crash-on-launch` after `swapped`, same running version), and no audit row ran it. Audit rows alone are not proof. `findNeverInstalledFailures` reads config, every audit file (`readAllSelfUpgrades`) and `last_upgrade`; used by `gbrain self-upgrade --clear-never-installed [--apply]` and the `self_upgrade_health` fix. Tests: `self-upgrade-never-installed-6828.test.ts`.
diff --git a/docs/architecture/key-files/entrypoints-and-docs.md b/docs/architecture/key-files/entrypoints-and-docs.md
index c7aeaad728..113abcb089 100644
--- a/docs/architecture/key-files/entrypoints-and-docs.md
+++ b/docs/architecture/key-files/entrypoints-and-docs.md
@@ -13,7 +13,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `admin/` — React 19 + Vite + TypeScript admin SPA embedded in the binary via `admin/dist/` served by `serve-http.ts`. Views: Login (bootstrap token or single-use link → session cookie, preserving pending OAuth consent), Dashboard (metrics + SSE feed + token health), Agents (client table + registration), Register (machine/public PKCE/confidential PKCE with permission preview), Client Setup (method-aware instructions + explicit recoverable private download), Request Log (filterable paginated), Agent Detail drawer (setup, permission review, request activity, and token invalidation/revocation/deletion). Design tokens: `#0a0a0f` bg, Inter for UI, JetBrains Mono for data, 4-32px spacing scale, rounded pill badges. HTTP-only SameSite=Strict cookie auth. About 79KiB gzip for JS/CSS assets. Build: `cd admin && bun install && bun run build`; output at `admin/dist/` is committed for self-contained binaries.
-- `docker-compose.ci.yml` + `scripts/ci-local.sh` — Local CI gate. `bun run ci:local` spins up four `pgvector/pgvector:pg16` services (postgres-1..4) + `oven/bun:${GBRAIN_CI_BUN_TAG:-1.4.2}` with named volumes (`gbrain-ci-pg-data-{1..4}`, `gbrain-ci-node-modules`, `gbrain-ci-admin-node-modules`, `gbrain-ci-admin-dist`, `gbrain-ci-bun-cache`; #6756: the runner mounts the worktree's `admin/dist` read-only at `/ci-src/admin-dist` and `scripts/ci-hydrate-admin-dist.sh` makes the `gbrain-ci-admin-dist` volume an exact copy of it, stale hashed files removed, before `bun run build`, refusing only when a file `git ls-files admin/dist` tracks cannot be read from the worktree (the message names the file and `bun run build:admin`); pinned by `test/scripts/ci-hydrate-admin-dist.test.ts`), runs gitleaks on host, smoke-tests `scripts/run-e2e.sh` argv handling, runs the authoritative `bun run verify` once plus the explicit Bun test-timeout guard, then the complete serial and slow lanes before 4-shard parallel unit + E2E (`xargs -P4`, one Postgres per shard; unit phase keeps `DATABASE_URL` unset). `--no-shard` runs unit/E2E sequentially (debug aid); `--diff` narrows E2E selection without changing the chosen shard mode. The doc-only `--diff` fast path runs only the host secrets scans. Also runs a `pgbouncer` service (`edoburu/pgbouncer`, `POOL_MODE: transaction`, `AUTH_TYPE: plain` — pg16 stores SCRAM verifiers, so the userlist must hold the plaintext password; `IGNORE_STARTUP_PARAMETERS` whitelists gbrain's `statement_timeout`/`idle_in_transaction_session_timeout` startup params the way the Supabase pooler does) fronting postgres-1 on host port `GBRAIN_CI_PGBOUNCER_PORT` (default 6543); every E2E invocation exports `GBRAIN_PGBOUNCER_URL` (pooled; dedicated `gbrain_pgbouncer_test` database so it never races the `gbrain_test` TRUNCATE fixtures) + `GBRAIN_PGBOUNCER_DIRECT_URL`, consumed by `test/e2e/pgbouncer-teardown.test.ts` — which reproduces the transaction-mode teardown failure in the local gate. `--no-pull` skips upstream pulls; `--clean` nukes named volumes. Postgres host port defaults to 5434; override with `GBRAIN_CI_PG_PORT=NNNN`. Full persistence and native runtime matrices run separately; see `docs/TESTING.md`.
+- `docker-compose.ci.yml` + `scripts/ci-local.sh` — Local CI gate. `bun run ci:local` spins up four `pgvector/pgvector:pg16` services (postgres-1..4) + `oven/bun:${GBRAIN_CI_BUN_TAG:-1.4.4}` with named volumes (`gbrain-ci-pg-data-{1..4}`, `gbrain-ci-node-modules`, `gbrain-ci-admin-node-modules`, `gbrain-ci-admin-dist`, `gbrain-ci-bun-cache`; #6756: the runner mounts the worktree's `admin/dist` read-only at `/ci-src/admin-dist` and `scripts/ci-hydrate-admin-dist.sh` makes the `gbrain-ci-admin-dist` volume an exact copy of it, stale hashed files removed, before `bun run build`, refusing only when a file `git ls-files admin/dist` tracks cannot be read from the worktree (the message names the file and `bun run build:admin`); pinned by `test/scripts/ci-hydrate-admin-dist.test.ts`), runs gitleaks on host, smoke-tests `scripts/run-e2e.sh` argv handling, runs the authoritative `bun run verify` once plus the explicit Bun test-timeout guard, then the complete serial and slow lanes before 4-shard parallel unit + E2E (`xargs -P4`, one Postgres per shard; unit phase keeps `DATABASE_URL` unset). `--no-shard` runs unit/E2E sequentially (debug aid); `--diff` narrows E2E selection without changing the chosen shard mode. The doc-only `--diff` fast path runs only the host secrets scans. Also runs a `pgbouncer` service (`edoburu/pgbouncer`, `POOL_MODE: transaction`, `AUTH_TYPE: plain` — pg16 stores SCRAM verifiers, so the userlist must hold the plaintext password; `IGNORE_STARTUP_PARAMETERS` whitelists gbrain's `statement_timeout`/`idle_in_transaction_session_timeout` startup params the way the Supabase pooler does) fronting postgres-1 on host port `GBRAIN_CI_PGBOUNCER_PORT` (default 6543); every E2E invocation exports `GBRAIN_PGBOUNCER_URL` (pooled; dedicated `gbrain_pgbouncer_test` database so it never races the `gbrain_test` TRUNCATE fixtures) + `GBRAIN_PGBOUNCER_DIRECT_URL`, consumed by `test/e2e/pgbouncer-teardown.test.ts` — which reproduces the transaction-mode teardown failure in the local gate. `--no-pull` skips upstream pulls; `--clean` nukes named volumes. Postgres host port defaults to 5434; override with `GBRAIN_CI_PG_PORT=NNNN`. Full persistence and native runtime matrices run separately; see `docs/TESTING.md`.
- `docs/UPGRADING_DOWNSTREAM_AGENTS.md` — Patches for downstream agent skill forks to apply when upgrading. Each release appends a new section; includes diffs for brain-ops, meeting-ingestion, signal-detector, enrich.
diff --git a/docs/architecture/key-files/security.md b/docs/architecture/key-files/security.md
index e669f30c2c..e620047160 100644
--- a/docs/architecture/key-files/security.md
+++ b/docs/architecture/key-files/security.md
@@ -12,7 +12,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `src/core/grants/lifecycle.ts` + `src/commands/serve-http-clients.ts` — owner-authenticated client inspection, setup, export and lifecycle endpoints. Token invalidation/revoke/delete lock the OAuth client row, require reviewed revisions and explicit application, and commit an audit record atomically. Deletion records a tombstone while preserving request history and spending reservations/settlement; missing clients become terminal delegated denials while transient lookup failures remain retryable.
- `src/commands/serve-http-api-keys.ts` — owner-dashboard legacy API keys (`/admin/api/api-keys`). Mint validates the request (`parseApiKeyMintRequest`: name 1-128 printable characters, registered scopes, active source ids, holder grammar) and goes through `mintLegacyToken`, so keys are born on the unified grant columns; omitted fields take the `gbrain auth create` defaults (scopes `read,write`, never `admin` unless listed; no source grant; holders `['world']`), reported in `defaults_applied` beside the effective grant. Refusals are `invalid_params` agent envelopes with `why` and a `fix`; nothing is minted. The token appears only in the mint response, never in logs or SSE. The list returns ids, scopes, sources and holders through `grantFromTokenRow`; revoke takes the row id (`revokeLegacyTokenById`) and refuses a name. Pinned by `test/serve-http-api-keys.test.ts`.
-- `src/core/guarded-http.ts` + `src/core/ssrf-validate.ts` — DNS answer classification, validated-address connections with original TLS/HTTP hostname and port, shared deadline/redirect policy, header-only probes, and bounded gzip/deflate/Brotli decoding. Ambient proxies fail closed with restart guidance. Consumers: URL reachability, remote images, and HTTP integration checks. Real TLS fixtures run on Bun 1.4.0 and 1.4.2.
+- `src/core/guarded-http.ts` + `src/core/ssrf-validate.ts` — DNS answer classification, validated-address connections with original TLS/HTTP hostname and port, shared deadline/redirect policy, header-only probes, and bounded gzip/deflate/Brotli decoding. Ambient proxies fail closed with restart guidance. Consumers: URL reachability, remote images, and HTTP integration checks. Real TLS fixtures run on Bun 1.4.4.
- `src/core/guardrails.ts` — vendor-neutral content guardrail seams (`registerGuardrailProvider`, `classify`). `loadGuardrailProvidersFromEnv(env = process.env, opts?: { cwd, skipCwdCheck })` accepts ONLY an absolute path or a `~/` path for `GBRAIN_GUARDRAILS_MODULE`; cwd-relative specs (`./`, `../`, bare `.`) and bare package specifiers (`pkg`, `@scope/pkg`, `pkg/sub` — in the compiled binary Bun's module walk-up starts at the cwd, so a hostile checkout's `node_modules/<name>/` would load) throw `GuardrailLoadError` before any import, and when `env` is `process.env` (or `opts.cwd` is given) a spec that a cwd .env file assigns is refused via `cwdDotenvAssignsKey` (message composed from env-trust's `CWD_DOTENV_REMEDIATION`) unless `opts.skipCwdCheck` (preflight's cwd == config-dir case). node:path/url/os are static imports. Registration is counted by EVENTS against a pre-import baseline so import-time side-effect registration and same-id replacement are accepted (#3688 residual). Pinned by `test/guardrails.test.ts` + `test/guardrails-env-load.test.ts`.
diff --git a/docs/ci-event-parity.md b/docs/ci-event-parity.md
index 18dd78adf4..149be398ff 100644
--- a/docs/ci-event-parity.md
+++ b/docs/ci-event-parity.md
@@ -17,7 +17,7 @@ checks ([below](#full-ci-on-pull-requests)), never per-cell matrix names.
| Workflow | Condition | Class | Covered by |
| --- | --- | --- | --- |
-| `test.yml` | `security-regressions` Bun matrix | Parity: both Bun versions on every OS, every event | — |
+| `test.yml` | `security-regressions` Bun matrix | Parity: every supported Bun version on every OS, every event | — |
| `test.yml` | `changes` native scope (`smoke`/`primary`/`full`) | Named exception | Every push to master and the nightly Test schedule (`full`) |
| `test.yml` | `gitleaks` commit range by event | Parity: each event scans the range it introduces | — |
| `test.yml` | `dependency-audit` blocking scope | Named exception with a rule ([below](#dependency-audit-rule)) | Every push to master and the nightly Test schedule (always blocking) |
@@ -26,7 +26,7 @@ checks ([below](#full-ci-on-pull-requests)), never per-cell matrix names.
| `test.yml` | `race-hunt` | Named exception: schedule and dispatch only, outside `test-status` | Itself (nightly Test schedule) |
| `e2e.yml` | `order-hunt` | Named exception: schedule and `order_hunt` dispatch only, outside `e2e-status` | Itself (nightly E2E schedule) |
| `test.yml` | `native_only`, `race_hunt`, `stress_*` dispatch inputs; concurrency suffixes | Parity: manual modes and run grouping, never applied to PR, push or schedule events | — |
-| `persistence-validation.yml` | Bun matrix of read latency, deployment matrix, unit-lane PostgreSQL arms, soak, crash robot, reconciliation, convergence | Parity: both Bun versions on every event that runs the lane | — |
+| `persistence-validation.yml` | Bun matrix of read latency, deployment matrix, unit-lane PostgreSQL arms, soak, crash robot, reconciliation, convergence | Parity: every supported Bun version on every event that runs the lane | — |
| `test.yml`, `persistence-validation.yml` | Cheap tier on pull requests: no unit shards, serial, slow, BrainBench, admin-browser, shared-skills, coverage or `test-status`; of the persistence lanes only the crash robot and convergence, and those and the native cells only when the diff selects them | Named exception ([below](#full-ci-on-pull-requests)) | The full-ci dispatch on the head before merge (merge-train requires `full-suite`), every push to master, the merge queue and the nightly Test schedule |
| `e2e.yml` | No `pull_request` trigger | Named exception ([below](#full-ci-on-pull-requests)) | The full-ci dispatch on the head before merge (merge-train requires `e2e-full-suite`), every push to master, the merge queue and the nightly E2E schedule |
| `test.yml`, `e2e.yml` | A push to master skips its full lanes when it reuses a passed full-suite run of its exact tree | Named exception ([below](#master-push-reuse)) | The reused run (same tree, full profile); schedules never reuse |
@@ -34,7 +34,7 @@ checks ([below](#full-ci-on-pull-requests)), never per-cell matrix names.
| `convergence-nightly.yml` | The convergence gate's nightly cell (2,000 pages, 50 ms, 20 kills, run-id seed): schedule and dispatch only, outside `test-status`; the PR cell (200 pages, 10 ms, 6 kills, seed 6650) runs in `persistence-validation.yml` | Named exception | Itself (nightly Convergence schedule) |
| `persistence-validation.yml` | `SOAK_OPERATIONS` 2,500 vs 10,000 | Named exception | Every push to master and the nightly Test schedule |
| `persistence-validation.yml` | Crash robot `--robot-scope=pr` (Postgres lease-bound seams skipped, 820 s PGLite and 620 s Postgres ceilings) vs `full` (1200 s PGLite, 880 s Postgres; [ceilings](#crash-robot-ceilings)); the nightly adds that day's exploration seeds | Named exception | The full-ci dispatch, every push to master (same fixed list, so it may reuse that run) and the nightly Test schedule |
-| `native-locks.yml` | `inputs.scope` (OpenClaw, musl, Windows probes, Bun 1.4.0 and cross-target cells) | Named exception | Every push to master and the nightly Test schedule (`full`) |
+| `native-locks.yml` | `inputs.scope` (OpenClaw, musl, Windows probes, cross-target cells) | Named exception | Every push to master and the nightly Test schedule (`full`) |
| `e2e.yml` | Doc-only merge-queue entry selects no E2E file | Named exception | Every push to master (whole corpus) and the nightly E2E schedule |
| `e2e.yml` | Full-corpus coverage lanes and their `e2e-status` checks | Named exception | Nightly E2E schedule (or a `full_corpus` dispatch) |
| `heavy-tests.yml` | Label-gated jobs on pull requests | Named exception | Nightly Heavy Tests schedule |
diff --git a/docs/eval/hnsw-scale-bench.md b/docs/eval/hnsw-scale-bench.md
index e85281fc0a..0602bc9b0a 100644
--- a/docs/eval/hnsw-scale-bench.md
+++ b/docs/eval/hnsw-scale-bench.md
@@ -603,7 +603,7 @@ What the table shows:
## Reproduce
```bash
-# VM (Ubicloud standard-16, 320 GB): bootstrap Docker, Bun 1.4.2 and a tuned pgvector/pg16 on 127.0.0.1:5434
+# VM (Ubicloud standard-16, 320 GB): bootstrap Docker, Bun 1.4.4 and a tuned pgvector/pg16 on 127.0.0.1:5434
UBI_OWNER=<thread> scripts/ubicloud/ubi-runner.sh up -s standard-16 -S 320
scripts/ubicloud/ubi-runner.sh sync <vm> . && scripts/ubicloud/ubi-runner.sh ssh <vm> 'cd work/gbrain && bash scripts/bench/hnsw-scale-vm-setup.sh'
export DATABASE_URL=postgresql://postgres:[email protected]:5434/postgres
diff --git a/docs/eval/managed-sync-catchup.md b/docs/eval/managed-sync-catchup.md
index d79a0c69f0..93c1fbe804 100644
--- a/docs/eval/managed-sync-catchup.md
+++ b/docs/eval/managed-sync-catchup.md
@@ -28,7 +28,7 @@ in CI.
## Rerun
Needs Docker on Linux (toxiproxy runs with host networking and every
-listener binds 127.0.0.1) and Bun 1.4+. Make no provider calls: the
+listener binds 127.0.0.1) and Bun 1.4.4+. Make no provider calls: the
effects row uses a loopback stub for `/v1/embeddings`.
```bash
diff --git a/docs/guides/authorization-upgrade.md b/docs/guides/authorization-upgrade.md
index 24ab1a99bc..9c90025b4a 100644
--- a/docs/guides/authorization-upgrade.md
+++ b/docs/guides/authorization-upgrade.md
@@ -10,7 +10,7 @@ uses `gbrain jobs authorize-legacy` to preview selected work for review.
## Runtime and outbound requests
-Use Bun **1.4.0 or newer**; run `bun upgrade` on an older Bun. CI covers 1.4.0 and the build runtime, 1.4.4.
+Use Bun **1.4.4 or newer**; run `bun upgrade` on an older Bun. CI covers 1.4.4, which is also the build runtime.
Compiled distributions include their Bun runtime.
URL reachability checks, HTTP integration checks, and remote image loading use
diff --git a/llms-full.txt b/llms-full.txt
index 0e6a669bae..3e3bb1e36e 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -2698,7 +2698,7 @@ If you fetched this file by URL without cloning yet, the companion files live at
> garrytan/gbrain` + `/plugin install gbrain@gbrain`). Details:
> docs/mcp/CODEX.md and docs/mcp/CLAUDE_CODE.md.
-Default path (Bun 1.4.0 or newer is required — gbrain is a Bun + TypeScript runtime; on an older Bun, run `bun upgrade` first):
+Default path (Bun 1.4.4 or newer is required — gbrain is a Bun + TypeScript runtime; on an older Bun, run `bun upgrade` first):
```bash
curl -fsSL https://bun.sh/install | bash
@@ -5069,7 +5069,7 @@ This is the difference between a search engine and a brain. Search finds the pag
## Install
-Requires **Bun 1.4.0 or newer**. Existing worker installations should follow the
+Requires **Bun 1.4.4 or newer**. Existing worker installations should follow the
[authorization and queue upgrade guide](docs/guides/authorization-upgrade.md)
before restarting services with this version.
diff --git a/native/locks/README.md b/native/locks/README.md
index 18a27285a2..c2f52ae957 100644
--- a/native/locks/README.md
+++ b/native/locks/README.md
@@ -42,7 +42,7 @@ All eight addons are checked in, so source installs work with
`bun install --frozen-lockfile --ignore-scripts`. They support x64 and arm64
on Linux glibc (2.17 ABI baseline), Linux musl, macOS (13.0 deployment
target), and Windows. The required CI matrix covers the repository's minimum
-Bun 1.4.0 and the release compiler, Bun 1.4.3. OS compatibility
+Bun, 1.4.4, which is also the release compiler. OS compatibility
also requires the selected Bun version's own platform minimums.
Node-API headers and their upstream license are vendored from Node
@@ -181,12 +181,12 @@ checks real process exclusion, crash handoff, retained files, cancellation,
missing-addon failure and source/binary manifest integrity. Tests use isolated
temporary paths and never open an operator datastore. The required
`native-locks.yml` lane rebuilds and executes all eight OS/architecture/libc
-targets on Bun 1.4.0 and 1.4.3, including native musl Docker userspace.
+targets on Bun 1.4.4, including native musl Docker userspace.
Every pair also runs `bun scripts/native/compiled-smoke.ts` to prove compiled
process locking. Release CI verifies the shipped CLI embeds the matching
addon and runs the compiled smoke on its two release platforms. Rebuild
instructions and the precise packaging/runtime distinction are above.
-Release compilation uses Bun 1.4.3; strict Darwin codesign verification must
+Release compilation uses Bun 1.4.4; strict Darwin codesign verification must
pass before publication. The native macOS 26.2 smoke is not macOS 27
certification, and Linux fault injection is not a full native Windows backup
create/restore test.
diff --git a/package.json b/package.json
index 8b8c249403..f9eef3537a 100644
--- a/package.json
+++ b/package.json
@@ -243,7 +243,7 @@
"@electric-sql/pglite"
],
"engines": {
- "bun": ">=1.4.0"
+ "bun": ">=1.4.4"
},
"license": "MIT",
"version": "0.60.465.0",
diff --git a/scripts/bench/efficiency/README.md b/scripts/bench/efficiency/README.md
index 705dd1ce79..f7b79c6f4b 100644
--- a/scripts/bench/efficiency/README.md
+++ b/scripts/bench/efficiency/README.md
@@ -5,7 +5,7 @@ Brain data (pulled pages, synthetic brains, PGLite files, results) lives under
`$BENCH_WORK` (default `~/.capy/work/brain`) and must never be committed. Result rows hold
counts, sizes and timings only.
-Requires Bun >= 1.4 (the repo's `engines.bun`) and Docker for the Postgres engine.
+Requires Bun >= 1.4.4 (the repo's `engines.bun`) and Docker for the Postgres engine.
| File | What it does |
|---|---|
diff --git a/scripts/bench/efficiency/run-all.sh b/scripts/bench/efficiency/run-all.sh
index f6a47f7456..4222e96b91 100755
--- a/scripts/bench/efficiency/run-all.sh
+++ b/scripts/bench/efficiency/run-all.sh
@@ -12,7 +12,7 @@
# BENCH_MAX_USD per-embed cap passed to gbrain embed --max-usd (default 2)
# BENCH_PG_PORT host port of the pgvector container (default 5440)
# BENCH_PG_CONTAINER pgvector container name (default gbrain-bench-pg)
-# BUN bun >= 1.4 binary (default: bun on PATH)
+# BUN bun >= 1.4.4 binary (default: bun on PATH)
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
BUN="${BUN:-bun}"
diff --git a/scripts/bench/hnsw-scale-vm-setup.sh b/scripts/bench/hnsw-scale-vm-setup.sh
index 2c26bf283b..996bc3ba06 100644
--- a/scripts/bench/hnsw-scale-vm-setup.sh
+++ b/scripts/bench/hnsw-scale-vm-setup.sh
@@ -13,7 +13,7 @@
# DATABASE_URL=postgresql://postgres:[email protected]:5434/postgres bun scripts/bench/hnsw-iterative-scan.ts --corpus latent ...
set -euo pipefail
-BUN_VERSION="${BUN_VERSION:-1.4.2}"
+BUN_VERSION="${BUN_VERSION:-1.4.4}"
PG_IMAGE="${PG_IMAGE:-pgvector/pgvector:pg16}"
t0=$(date +%s)
step() { echo "[hnsw-scale-setup +$(( $(date +%s) - t0 ))s] $*"; }
diff --git a/scripts/bench/production-soak/vm-setup.sh b/scripts/bench/production-soak/vm-setup.sh
index f1f7dd539a..31374a3785 100755
--- a/scripts/bench/production-soak/vm-setup.sh
+++ b/scripts/bench/production-soak/vm-setup.sh
@@ -8,7 +8,7 @@
# scripts/ubicloud/ubi-runner.sh run --setup scripts/bench/production-soak/vm-setup.sh -- 'bash scripts/bench/production-soak/run.sh ...'
set -euo pipefail
-BUN_VERSION="${BUN_VERSION:-1.4.3}"
+BUN_VERSION="${BUN_VERSION:-1.4.4}"
t0=$(date +%s)
step() { echo "[soak-setup +$(( $(date +%s) - t0 ))s] $*"; }
diff --git a/scripts/bench/stall-repro-vm-setup.sh b/scripts/bench/stall-repro-vm-setup.sh
index 7ceae0ce43..c27215ec5c 100755
--- a/scripts/bench/stall-repro-vm-setup.sh
+++ b/scripts/bench/stall-repro-vm-setup.sh
@@ -11,7 +11,7 @@
# --env RELEASE_COMMIT=8e11aa1f -- 'bun scripts/bench/managed-sync-stall-repro.ts --cli-repo ../gbrain-release ...'
set -euo pipefail
-BUN_VERSION="${BUN_VERSION:-1.4.2}"
+BUN_VERSION="${BUN_VERSION:-1.4.4}"
RELEASE_COMMIT="${RELEASE_COMMIT:-}"
t0=$(date +%s)
step() { echo "[stall-repro-setup +$(( $(date +%s) - t0 ))s] $*"; }
diff --git a/scripts/capture-test-log.ts b/scripts/capture-test-log.ts
index 240332681d..be8c27d3d9 100644
--- a/scripts/capture-test-log.ts
+++ b/scripts/capture-test-log.ts
@@ -6,6 +6,7 @@ import { dirname } from 'node:path';
import { once } from 'node:events';
import { constants } from 'node:os';
import type { Readable, Writable } from 'node:stream';
+import { bunVersionMeets } from '../src/core/runtime-version.ts';
const MAX_PENDING_CHARS = 64 * 1024;
const SUMMARY_FAILURES = 50;
@@ -23,9 +24,12 @@ export interface CapturedFailure { file: string; test: string; arm: string; erro
* output. Once it starts, the rest of the shard's sync-spawning tests time
* out one after another, in files that have nothing to do with each other.
* A spawn that passed a `timeout` comes back `spawnSync <cmd> ETIMEDOUT`
- * instead, often minutes before the first kill (#6586).
+ * instead, often minutes before the first kill (#6586). Every supported Bun
+ * (MINIMUM_BUN_VERSION) carries the fix, so the signature is named only for a
+ * run whose `bun test` banner is older than BUN_SPAWNSYNC_FIXED or missing.
*/
export const BUN_SPAWNSYNC_POISONED = 'bun_spawnsync_poisoned';
+const BUN_SPAWNSYNC_FIXED = '1.4.3';
/**
* Reads the live test output line by line and keeps the last 50 failures
@@ -97,12 +101,17 @@ export class FailureCollector {
* killed at a test deadline, and from then on nothing but timeouts, at least
* three of them, in at least two files. One hung test with a dangling child,
* a run of timeouts with no killed child, or any non-timeout failure after
- * the kill is some other hang and is left for its own diagnosis.
+ * the kill is some other hang and is left for its own diagnosis, as is the
+ * same shape on a Bun that carries the fix.
*/
poisoned(): boolean {
- return this.danglingKills > 0 && this.timeoutsSinceKill >= 3
+ return this.onAffectedBun() && this.danglingKills > 0 && this.timeoutsSinceKill >= 3
&& this.timeoutsSinceKill === this.failuresSinceKill && this.filesSinceKill.size >= 2;
}
+ /** Whether this run's Bun can carry oven-sh/bun#34069: older than the fix, or not named by the log. */
+ private onAffectedBun(): boolean {
+ return bunVersionMeets(this.bunVersion, BUN_SPAWNSYNC_FIXED) !== true;
+ }
/** The one-paragraph verdict for a poisoned run, Markdown; empty otherwise. */
poisonedNote(): string {
if (!this.poisoned()) return '';
@@ -119,7 +128,7 @@ export class FailureCollector {
takeLiveNotes(): string[] {
const notes: string[] = [];
const bun = this.bunVersion ? `Bun v${this.bunVersion}` : 'this Bun';
- if (this.spawnTimeout && !this.announced.spawnTimeout) {
+ if (this.spawnTimeout && !this.announced.spawnTimeout && this.onAffectedBun()) {
this.announced.spawnTimeout = true;
notes.push(`> **${BUN_SPAWNSYNC_POISONED}?** ${this.spawnTimeout.file || '(before the first test file)'} printed \`${this.spawnTimeout.line.replace(/`/g, "'")}\`. `
+ `On ${bun}, a synchronous child spawn that times out is the first sign of oven-sh/bun#34069 (fixed in Bun 1.4.3): if \`killed N dangling process\` and timeouts in unrelated files follow, the shard is poisoned and the failures say nothing about the tests.`);
diff --git a/scripts/ci-executed-counts.ts b/scripts/ci-executed-counts.ts
index c0073632ea..eee466bf96 100644
--- a/scripts/ci-executed-counts.ts
+++ b/scripts/ci-executed-counts.ts
@@ -488,7 +488,7 @@ export function compare(head: Side, base: Side | undefined, deltas: { rows: Delt
/**
* Whether head identity `to` executes what base identity `from` did: the same
- * arm, or another arm when the test's name pins its backend. The Bun 1.4.3
+ * arm, or another arm when the test's name pins its backend. The Bun 1.4.4
* PostgreSQL-arm cell runs only the PostgreSQL side of testBackends() suites,
* so their PGLite tests leave that lane (arm postgres) for the unit and serial
* lanes (no arm) and still run on PGLite there. A PostgreSQL test may change
diff --git a/scripts/ci-ubicloud.ts b/scripts/ci-ubicloud.ts
index 373768057e..d55b1dbc37 100755
--- a/scripts/ci-ubicloud.ts
+++ b/scripts/ci-ubicloud.ts
@@ -570,7 +570,7 @@ async function main() {
// The pg-arms lane's proof that unit-postgres-arms fits: each shard of the
// workflow's own partition, its ARM_WORKERS workers' makespan over this run's
- // measured file durations (both arms, as the Bun 1.4.0 cell runs them).
+ // measured file durations (both arms, as this lane runs them).
const armShardReport = opts.lanes.has("pg-arms")
? armShards(ROOT, arms.files, ARM_SHARDS).map((files, i) => ({
shard: i + 1,
diff --git a/scripts/e2e-matrix.ts b/scripts/e2e-matrix.ts
index 159c6d4d76..2a2a0a0ec7 100644
--- a/scripts/e2e-matrix.ts
+++ b/scripts/e2e-matrix.ts
@@ -6,7 +6,7 @@ import { resolve, relative, isAbsolute } from "node:path";
import { loadWeights, partition, type WeightMap } from "./sharding.ts";
// PR owner of the reconciliation crash suites is persistence-validation.yml
-// (called from test.yml on every PR; postgres x Bun 1.4.0/1.4.2; crash
+// (called from test.yml on every PR; postgres x every supported Bun; crash
// manifests uploaded). Nightly full-corpus E2E still runs them.
export const PERSISTENCE_VALIDATION_OWNED = new Set([
'test/e2e/reconcile-crash.test.ts',
diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsv
index c72765f528..1947b52854 100644
--- a/scripts/module-size-limits.tsv
+++ b/scripts/module-size-limits.tsv
@@ -47,4 +47,4 @@ src/commands/doctor/checks/extraction-sync.ts 1500 ratchet +7 GBRA-130 A-1: link
src/core/search/evidence-delivery.ts 1733 ratchet +5 W5: EvidencePlan.rankCut resolved with the plan (logic in search/page-rank-cut.ts); +20 W5 whole_pages: wholeCost prices a block as delivery would emit it whole (needs the private Block/enrichBlock internals) and the cut is wired before allocate (cutWholePages lives in search/page-rank-cut.ts); new row: crossed the 1500 unlisted cap at the #6367 merge (master 1479, its explicit-budget cap) by the C1 date header threaded through every block path, cap included; pagePlanHits (search/page-plan-hits.ts) and the header loader (evidence-date.ts blockDateHeaders) were peeled first; peel candidate: allocateCapped; +8 at the #6396 merge: page evidence text cut through the fence-chunk trust overlay and the caller minTrust floor (re-summed: our 1504 + master +8); +119 Cat 40 next wave F2: the search.long_page_unit policy (withLongPagePolicy, selectLongPages size preflight with page/byte/deadline limits) and the long-page fetch and fallback in deliverEvidence, kept in the shared seam the plan names (gbrain-evals docs/plans/2026-10-11-cat40-next-wave, F2); +17 F2 rework to the frozen-comparison policy: search.long_page_min_chars (rendered-body characters, default 20,000) read in withLongPagePolicy, a character count in the preflight, the rendered-body confirmation in deliverEvidence, and the long-page row exemption in capDeliveredSnippets (re-summed at the 0.60.225.0 merge: master 1537 + F2 136); +39 Wave B PR 2 lane 2b: planSegmentedBlock joins the windows search/segmented-evidence.ts reads around a segmented page's hits into one run-marked document (needs the private Doc/Piece/buildDoc/locateAnchor internals), planBlock's unit cut split into blockFromDoc for both, sections bounded by their run, selectionCost counts a gap between runs, and the fetch skips the whole-body fence overlay for a segmented page; +4 segmented pages read at once before planning (segmentedReads; the read is search/segmented-evidence.ts, the statements page-body/read-range.ts); +17 GBRA-156: tail trim plan flag, DeliverOptions.query, DeliveryMeta.tail_trim, the trim call and the frozen-hit score/query library fields (logic in search/evidence-tail-trim.ts; interface fields cannot move)
src/commands/config.ts 1523 ratchet new row: crossed the 1500 unlisted cap in wave 15 P7.4 #5461: set-time validation of think.pages_budget_chars / think.excerpt_ceiling_chars (range + parser live in core/think/pages-budget.ts), mirroring the cycle.consolidate.cluster_threshold hook; +1 wave 16 G5.1 (#6495): set-time refusal hook for search.keyword_statement_timeout_ms (check lives in commands/config/keyword-timeout-value.ts); +1 wave 18b lane 5 (#5012 item 6): search.contextual_retrieval prints the existing-pages hint after the write (text lives in commands/config/contextual-mode-hint.ts); +1 #6712 PR 2: retired/rollback sync key dispatch line (logic in core/sync-config-keys.ts handleSyncKeyConfig); +1 #6865: sync.slug_conflicts.auto_remove boolean validation at set time (refusal text in repair/slug-autoheal.ts); +1 #6948: sync.origin_twins.auto_resolve boolean validation at set time (refusal text in repair/origin-twins-heal.ts); +2 #6795: config set chat_model/expansion_model help line and the model-pin import (shadow report and file-pin unset live in commands/config/model-pin-shadow.ts); +1 #6712 PR 4b: sync.admission set-time hook (value logic in commands/config/sync-admission-value.ts); +4 #7130: set-time refusal hook for sync.max_deletes / sync.max_delete_ratio (and .source.<id>) / purge.retention_hours (check lives in core/sync-reconcile.ts deleteSafetyConfigRefusal); +1 GBRA-150: sync.metafile_pages set-time route (body in config/sync-metafile-pages-value.ts); re-summed at the v0.60.330.0 merge (1520 measured); +2 #7242 minions.terminal_hook file-plane key and its set branch (logic in minions/terminal-hook.ts); +1 GBRA-161: generations.* set-time route (refusal in commands/config/generations-values.ts)
src/commands/mcp-expose.ts 1512 ratchet hosted_option: Session carries the gbrain.io coaching notice on the first-receipt run and Tailscale/service friction exits (copy, refs and gating live in core/onboard/hosted-option.ts)
-src/core/behavior-change-notice.ts 1506 ratchet the BEHAVIOR_CHANGES table grows by one row per disclosed change: the GBRA-95 RLS backfill row (+2), +3 rows for #7596 pass_interrupted, #7599 read-only serve and the --access=read-only ceiling, and +1 G5 lane C trust_release row; the behavior-change table split (#7607) retires this row
+src/core/behavior-change-notice.ts 1508 ratchet the BEHAVIOR_CHANGES table grows by one row per disclosed change: +2 Bun floor 1.4.4 row (#7644), the GBRA-95 RLS backfill row (+2), +3 rows for #7596 pass_interrupted, #7599 read-only serve and the --access=read-only ceiling, and +1 G5 lane C trust_release row; the behavior-change table split (#7607) retires this row
diff --git a/scripts/persistence/README.md b/scripts/persistence/README.md
index 5e83d23dbd..df64fe9e41 100644
--- a/scripts/persistence/README.md
+++ b/scripts/persistence/README.md
@@ -217,7 +217,7 @@ never a connection URL. Keep the retained directory private: its original
the diagnostic manifest. Successful runs retain no fixtures.
`persistence-validation.yml` runs the full gate on Linux x64 for both engines
-under Bun 1.4.0 and 1.4.2 and uploads every manifest. Native OS/architecture
+under Bun 1.4.4 and uploads every manifest. Native OS/architecture
coverage is separately required by `native-locks.yml`; its configured matrix
must not be mistaken for locally executed runtime evidence.
@@ -296,7 +296,7 @@ PGLite keeps the original in-memory read-latency storage model; the separate
recorded as `full_gate: false`. `tests/heavy/read_latency_under_sync.sh`
retains its optional `STRICT_LATENCY=1` interface and now runs the same
three-sample harness; sample validity always fails closed. CI passes
-`--informational` on both Bun versions and both engines: a valid workload
+`--informational` on every supported Bun version and both engines: a valid workload
over the 50% threshold exits successfully, but the manifest keeps its
`verdict: "fail"`, `status: "failed"` and `full_gate: false` threshold result.
Invalid samples, failed reads/writes and insufficient overlap still fail CI.
@@ -514,7 +514,7 @@ boundaries, followed by a small multi-process soak. The Postgres test creates
and drops fresh test databases, requiring CREATEDB on the explicit test URL.
It never truncates the shared E2E database. The reusable
`persistence-validation.yml` gate runs 1,000 schedules and 10,000 writes per
-engine under Bun 1.4.0 and 1.4.2 and uploads actual executed-case manifests;
+engine under Bun 1.4.4 and uploads actual executed-case manifests;
the sections above cover workloads, reruns, performance measurements and the
process-crash scope.
@@ -526,7 +526,7 @@ reserved short control capacity while bulk connections remain held, then
drains and commits the original request. Ownership cases cover mismatched
successor manifests, stale owners, root replacement under a held kernel
lock, and actual source deletion/recreation. The reusable persistence lane
-runs this matrix on both supported Bun versions and uploads its manifest.
+runs this matrix on every supported Bun version and uploads its manifest.
The required persistence lane also runs `scripts/persistence/performance.ts`
on both engines and Bun versions. Three independent instances use the
@@ -639,7 +639,7 @@ every mode not skipped), `NOTES` (default 200; the large page is always there),
client, serve and writer log per scenario) and `PGBOUNCER_CONTAINER` (mode (f)).
CI: the `convergence` job of `.github/workflows/persistence-validation.yml`, on
-both supported Bun versions with the deployment matrix's pgvector and
+every supported Bun version with the deployment matrix's pgvector and
transaction-mode PgBouncer services. Pull requests run it when
`scripts/ci-convergence-scope.sh` selects their diff (persistence, sync,
projections, storage, the harness and its workflow; never `package.json`
diff --git a/scripts/postgres-unit-arms.ts b/scripts/postgres-unit-arms.ts
index 13de884c66..18a381994c 100644
--- a/scripts/postgres-unit-arms.ts
+++ b/scripts/postgres-unit-arms.ts
@@ -18,7 +18,7 @@
* order inside a `::group::` block that ends with an `ARM_FILE` line carrying
* its measured duration. With GBRAIN_TEST_RECEIPT_DIR set, each file writes its
* own executed-test receipt (scripts/lib/test-env.sh describes the format).
- * `--postgres-only` (the Bun 1.4.3 cell) sets GBRAIN_TEST_BACKEND=postgres, so
+ * `--postgres-only` (the Bun 1.4.4 cell) sets GBRAIN_TEST_BACKEND=postgres, so
* testBackends() suites run only their PostgreSQL side; their PGLite side runs
* in the unit and serial lanes, and files that read DATABASE_URL directly keep
* both arms.
diff --git a/scripts/trust-smoke.ts b/scripts/trust-smoke.ts
index 95e53beff6..c14dac1b4b 100644
--- a/scripts/trust-smoke.ts
+++ b/scripts/trust-smoke.ts
@@ -18,7 +18,7 @@
* bun test test/write-gate.test.ts test/import-write-gate.test.ts # gate verdict
* bun test test/trust-owner-actions.test.ts test/trust-guarded-supersession.test.ts # owner confirm
* bun test test/purge-fact.test.ts test/forget-purge-cli.test.ts # purge
- * Needs Bun >= 1.4.0 (docs/guides/memory-trust.md).
+ * Needs Bun >= 1.4.4 (docs/guides/memory-trust.md).
*/
import { createTrustBrain, probeStores, resolveStepRow, rowTier, runTrustSteps, type TrustFixtureRun } from '../src/eval/brainbench/trust-scenario.ts';
import type { BrainBenchFixture } from '../src/eval/brainbench/types.ts';
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index df9e1b5142..3a69d696ec 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -1308,6 +1308,8 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;
{ since: '0.60.464.0', text: 'Security: `gbrain serve --access=read-only` (the `=` form) now sets the read-only ceiling. It passed flag validation before but started the serve with full write access, because only `--access read-only` was read. A config that used the `=` form now gets the read-only tool set and refused mutations it asked for; a repeated `--access` never widens a read-only value, and an invalid value in either form refuses. `--surface=<v>` likewise now sets the serve surface (it was ignored, leaving the full surface), and a repeated `--surface` takes the narrowest value.' },
{ since: '0.60.464.0', text: 'A managed sync pass whose process was killed or crashed now reads `resumable` / `pass_interrupted` in `gbrain sync status` (with an `interrupted` block naming the pass and the dead holder) instead of `pass_unfinished`, and a second killed pass reads `blocked` / `pass_abandoned` at once. `gbrain doctor` `managed_sync_blocked` lists both (warn, fail after an hour). A live pass still committing is no longer counted abandoned because its row is old.' },
{ since: '0.60.465.0', text: 'On a managed brain, `gbrain trust release h<id>` of a held fact whose entity page exists now writes the fact into that page\'s `## Facts` fence through the page-write door (a `trust_release` page write) and flips the hold in the same publication, so the released fact lives in the page\'s file and a re-import keeps it. Before, the release inserted a database-only row the file never held; a fence-guard hold that names an existing fence row created a database-only twin of it, and now indexes that row and leaves the file unchanged. The row is stamped `user_confirmed` with origin `trust_release` and the page keeps its trust tier. A hold decided after the release was accepted fails `preview_changed` and writes nothing; a remote request, or a deleted or private entity page, refuses and the fact stays held. A hold with no entity page, and unmanaged brains, release database-only as before.' },
+ // Bun floor 1.4.4 (#7644, #7596). `since` is stamped at the merge slot.
+ { since: 'TBD', id: 'bun_floor_1_4_4', text: 'GBrain now requires Bun 1.4.4 or newer (previously 1.4.0). On Bun 1.4.0 to 1.4.3 every command exits 1 before it starts with `GBrain requires Bun 1.4.4 or newer (found Bun <version>)` and the fix (`bun upgrade`, then restart GBrain; `gbrain post-upgrade` finishes an interrupted upgrade), and doctor\'s `bun_runtime` fails the same way. On Bun 1.4.0 to 1.4.2 a postgres.js connection over TLS keeps every chunk it receives, so a full sync or conversion pass over a TLS Postgres or pooler grew by about the bytes it read until memory guards killed it (#7644, #7596); 1.4.4 also carries the Brotli fix for CVE-2026-111497. Standalone gbrain binaries already embed Bun 1.4.4; a source or `bun install` install runs `bun upgrade` first, and `gbrain upgrade` on an older host Bun stops (autopilot holds) with the same fix.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --git a/src/core/runtime-version.ts b/src/core/runtime-version.ts
index 257dd09813..bc32b86f11 100644
--- a/src/core/runtime-version.ts
+++ b/src/core/runtime-version.ts
@@ -1,13 +1,19 @@
/**
- * Lowest supported Bun: contains the Linux child-exit fix (oven-sh/bun#30301)
- * and the guarded transport's explicit TLS serverName support.
+ * Lowest supported Bun. On Bun 1.4.0 to 1.4.2 a postgres.js connection over
+ * TLS keeps every chunk it receives, so RSS grows by about the total bytes
+ * read from Postgres and a full sync over a TLS Postgres or pooler is killed
+ * by memory guards (#7644, #7596); 1.4.3 fixed that, and 1.4.4 also carries
+ * the Brotli fix below. Also contains the Linux child-exit fix
+ * (oven-sh/bun#30301) and the guarded transport's explicit TLS serverName
+ * support.
*/
-export const MINIMUM_BUN_VERSION = '1.4.0';
+export const MINIMUM_BUN_VERSION = '1.4.4';
/**
* First Bun with the Brotli decoder fix for CVE-2026-111497 (oven-sh/bun#46392),
* reachable through fetch() with `Content-Encoding: br` and the decompression
- * APIs (#7373). Older supported runtimes still start; doctor warns.
+ * APIs (#7373). A supported runtime below it would still start and doctor
+ * would warn; MINIMUM_BUN_VERSION is not below it today.
*/
export const SECURE_BUN_VERSION = '1.4.4';
diff --git a/templates/bootstrap/cloud-setup-script.sh b/templates/bootstrap/cloud-setup-script.sh
index dc46884c1c..4f4d470067 100644
--- a/templates/bootstrap/cloud-setup-script.sh
+++ b/templates/bootstrap/cloud-setup-script.sh
@@ -5,11 +5,11 @@
# reused by later sessions). Printed by: gbrain bootstrap cloud-setup-script
set -eu
-# 1. Bun runtime, at least GBrain's minimum (1.4.0; older Bun is refused).
+# 1. Bun runtime, at least GBrain's minimum (1.4.4; older Bun is refused).
# Installed VIA npm — bun's own package fetching is proxy-incompatible in
# cloud sandboxes; npm's is not. A preinstalled older Bun stays untouched.
GBRAIN_BUN=$(command -v bun || true)
-if [ -z "$GBRAIN_BUN" ] || ! "$GBRAIN_BUN" -e 'process.exit(Bun.semver.satisfies(Bun.version, ">=1.4.0") ? 0 : 1)'; then
+if [ -z "$GBRAIN_BUN" ] || ! "$GBRAIN_BUN" -e 'process.exit(Bun.semver.satisfies(Bun.version, ">=1.4.4") ? 0 : 1)'; then
npm install -g bun
GBRAIN_BUN="$(npm prefix -g)/bin/bun"
fi
diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.json
index dfdde2465c..309cc2e51c 100644
--- a/test/fixtures/goldens/doctor/content-pglite-human.json
+++ b/test/fixtures/goldens/doctor/content-pglite-human.json
@@ -37,7 +37,7 @@
" [OK] dream_paid_loop: No dream key died 3+ times in 24h",
" [INFO] minions_migration: 5 setup migration(s) not run yet on this new brain (pending_fresh_install: 0.11.0, 0.14.0, 0.22.4, 0.28.0, 0.53.0). Expected after gbrain init, not a failed upgrade.",
" [OK] self_upgrade_health: mode=notify",
- " [OK] bun_runtime: Bun <bun-version> (minimum 1.4.0)",
+ " [OK] bun_runtime: Bun <bun-version> (minimum 1.4.4)",
" [OK] nightly_quality_probe_health: disabled (opt-in). Enable with: gbrain config set autopilot.nightly_quality_probe.enabled true",
" [OK] extract_health: no extractions in last 7 days",
" [OK] conversation_facts_backlog: disabled (opt-in). Enable with: gbrain config set cycle.conversation_facts_backfill.enabled true",
diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.json
index 4122135ad0..34128e88d6 100644
--- a/test/fixtures/goldens/doctor/content-pglite-json.json
+++ b/test/fixtures/goldens/doctor/content-pglite-json.json
@@ -297,7 +297,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/early-stop-connection-failure.json b/test/fixtures/goldens/doctor/early-stop-connection-failure.json
index baf1eb4a4d..9acd1a21eb 100644
--- a/test/fixtures/goldens/doctor/early-stop-connection-failure.json
+++ b/test/fixtures/goldens/doctor/early-stop-connection-failure.json
@@ -206,7 +206,7 @@
},
{
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json b/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json
index 75d3e56207..fcd278db5a 100644
--- a/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json
+++ b/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json
@@ -157,7 +157,7 @@
},
{
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json b/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json
index 9a42e6ae7c..c4e6c6c6af 100644
--- a/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json
+++ b/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json
@@ -157,7 +157,7 @@
},
{
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json b/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json
index 187d94f25d..98f70d47a7 100644
--- a/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json
+++ b/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json
@@ -157,7 +157,7 @@
},
{
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index 88066b738b..2c63895aa8 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -298,7 +298,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
@@ -5033,7 +5033,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index 2e94746121..9b25c70e4d 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -285,7 +285,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
@@ -5021,7 +5021,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index e0d52042c0..49ac9933f5 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -294,7 +294,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-pglite-fast.json b/test/fixtures/goldens/doctor/json-pglite-fast.json
index e41b800cec..4d1ca44ac2 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fast.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fast.json
@@ -243,7 +243,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index 77340d704a..2bd69e90e8 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -297,7 +297,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index feaf1fa688..64a68b9c61 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -284,7 +284,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json b/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json
index 670a3155d3..070b59a802 100644
--- a/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json
+++ b/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json
@@ -188,7 +188,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-postgres-unreachable.json b/test/fixtures/goldens/doctor/json-postgres-unreachable.json
index a5dda76785..e116f0916e 100644
--- a/test/fixtures/goldens/doctor/json-postgres-unreachable.json
+++ b/test/fixtures/goldens/doctor/json-postgres-unreachable.json
@@ -187,7 +187,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "Bun <bun-version> (minimum 1.4.0)",
+ "message": "Bun <bun-version> (minimum 1.4.4)",
"name": "bun_runtime",
"status": "ok"
},
diff --git a/test/guarded-http.test.ts b/test/guarded-http.test.ts
index fceb1aed08..c53067151a 100644
--- a/test/guarded-http.test.ts
+++ b/test/guarded-http.test.ts
@@ -14,10 +14,10 @@ afterEach(() => __setDnsLookupForTests(undefined));
const probe = { headerOnly: true };
test('unsupported runtime refuses guarded operations with upgrade guidance', () => {
- for (const version of ['', '1.3.10', '1.2.99', '1.3.11', '1.3.14', '1.4.0-canary']) {
+ for (const version of ['', '1.3.10', '1.2.99', '1.3.11', '1.3.14', '1.4.0-canary', '1.4.0', '1.4.2', '1.4.3']) {
expect(() => assertSupportedBun(version)).toThrow('run `bun upgrade`');
}
- for (const version of ['1.4.0', '1.4.2', '2.0.0']) {
+ for (const version of ['1.4.4', '1.4.5', '2.0.0']) {
expect(() => assertSupportedBun(version)).not.toThrow();
}
});
diff --git a/test/runtime-version.test.ts b/test/runtime-version.test.ts
index 815c8a265f..687c3bda50 100644
--- a/test/runtime-version.test.ts
+++ b/test/runtime-version.test.ts
@@ -18,12 +18,12 @@ import { MINIMUM_BUN_VERSION, SECURE_BUN_VERSION, assertSupportedBun, exitOnUnsu
import { checkBunRuntime } from '../src/commands/doctor/checks/upgrade-health.ts';
const root = join(import.meta.dir, '..');
-const OLD_BUN_REFUSAL = 'GBrain requires Bun 1.4.0 or newer (found Bun 1.3.14).\n'
+const OLD_BUN_REFUSAL = 'GBrain requires Bun 1.4.4 or newer (found Bun 1.3.14).\n'
+ 'Fix: run `bun upgrade`, then restart GBrain. If a `gbrain upgrade` stopped here, finish it with `gbrain post-upgrade`.';
describe('Bun runtime floor', () => {
test('an older Bun is refused with the found version, the floor and the fix', () => {
- expect(MINIMUM_BUN_VERSION).toBe('1.4.0');
+ expect(MINIMUM_BUN_VERSION).toBe('1.4.4');
expect(unsupportedBunMessage('1.3.14')).toBe(OLD_BUN_REFUSAL);
let error: unknown;
try { assertSupportedBun('1.3.14'); } catch (caught) { error = caught; }
@@ -33,42 +33,46 @@ describe('Bun runtime floor', () => {
});
test('every release below the floor, prereleases and a missing runtime are refused', () => {
- for (const version of ['1.3.11', '1.3.13', '1.3.14', '1.2.99', '1.4.0-canary.1', '']) {
+ for (const version of ['1.3.11', '1.3.13', '1.3.14', '1.2.99', '1.4.0-canary.1', '1.4.4-canary.1', '']) {
expect(unsupportedBunMessage(version)).toContain('Fix: run `bun upgrade`');
}
- expect(unsupportedBunMessage('')).toStartWith('GBrain requires Bun 1.4.0 or newer (found no Bun runtime).');
+ expect(unsupportedBunMessage('')).toStartWith('GBrain requires Bun 1.4.4 or newer (found no Bun runtime).');
+ });
+
+ test('Bun 1.4.0 to 1.4.3 are refused: postgres.js over TLS keeps every chunk it reads on 1.4.0-1.4.2, and 1.4.4 carries the Brotli fix', () => {
+ for (const version of ['1.4.0', '1.4.1', '1.4.2', '1.4.2+5a1b2c3', '1.4.3']) {
+ expect(unsupportedBunMessage(version)).toBe(`GBrain requires Bun 1.4.4 or newer (found Bun ${version}).\n`
+ + 'Fix: run `bun upgrade`, then restart GBrain. If a `gbrain upgrade` stopped here, finish it with `gbrain post-upgrade`.');
+ expect(() => assertSupportedBun(version)).toThrow('GBrain requires Bun 1.4.4 or newer');
+ }
});
test('the floor and newer releases start', () => {
- for (const version of ['1.4.0', '1.4.2', '1.5.0', '2.0.0', '1.4.2+abc123', '1.5.0-canary.3+abc123']) {
+ for (const version of ['1.4.4', '1.4.5', '1.5.0', '2.0.0', '1.4.4+abc123', '1.5.0-canary.3+abc123']) {
expect(unsupportedBunMessage(version)).toBeNull();
expect(() => assertSupportedBun(version)).not.toThrow();
}
});
test('doctor reports the running Bun against the floor, with the fix on failure', () => {
- expect(checkBunRuntime('1.4.4')).toEqual({ name: 'bun_runtime', status: 'ok', message: 'Bun 1.4.4 (minimum 1.4.0)' });
- expect(checkBunRuntime('1.5.0+abc123')).toEqual({ name: 'bun_runtime', status: 'ok', message: 'Bun 1.5.0+abc123 (minimum 1.4.0)' });
+ expect(checkBunRuntime('1.4.4')).toEqual({ name: 'bun_runtime', status: 'ok', message: 'Bun 1.4.4 (minimum 1.4.4)' });
+ expect(checkBunRuntime('1.5.0+abc123')).toEqual({ name: 'bun_runtime', status: 'ok', message: 'Bun 1.5.0+abc123 (minimum 1.4.4)' });
expect(checkBunRuntime('1.3.14')).toEqual({ name: 'bun_runtime', status: 'fail', message: OLD_BUN_REFUSAL.replace('\n', ' ') });
+ expect(checkBunRuntime('1.4.2')).toEqual({ name: 'bun_runtime', status: 'fail', message: 'GBrain requires Bun 1.4.4 or newer (found Bun 1.4.2). '
+ + 'Fix: run `bun upgrade`, then restart GBrain. If a `gbrain upgrade` stopped here, finish it with `gbrain post-upgrade`.' });
expect(checkBunRuntime().status).toBe(Bun.semver.order(Bun.version, SECURE_BUN_VERSION) >= 0 ? 'ok' : 'warn');
});
- test('#7373: a supported Bun without the Brotli fix warns with the CVE and the upgrade path for how gbrain is installed', () => {
+ test('#7373: the floor carries the Brotli fix, so a Bun without it is refused however gbrain is installed', () => {
expect(SECURE_BUN_VERSION).toBe('1.4.4');
+ expect(Bun.semver.order(MINIMUM_BUN_VERSION, SECURE_BUN_VERSION)).toBeGreaterThanOrEqual(0);
for (const version of ['1.4.0', '1.4.3', '1.4.4-canary.2']) {
- const standalone = checkBunRuntime(version, '/usr/local/bin/gbrain');
- expect(standalone.status).toBe('warn');
- expect(standalone.message).toStartWith(`Bun ${version} carries the Brotli decoder flaw CVE-2026-111497, fixed in Bun 1.4.4`);
- expect(standalone.message).toContain('This gbrain binary embeds that Bun: install the latest gbrain binary (`gbrain upgrade`)');
- expect(standalone.fix).toMatchObject({ argv: ['gbrain', 'upgrade'], actor: 'user', verify: { argv: expect.arrayContaining(['doctor']) } });
- for (const runtime of ['/home/alice-example/.bun/bin/bun', 'C:\\Users\\alice-example\\.bun\\bin\\bun.exe', '/opt/bun-1.4.3/bun-linux-x64']) {
- const viaBun = checkBunRuntime(version, runtime);
- expect(viaBun.status).toBe('warn');
- expect(viaBun.message).toEndWith('Run `bun upgrade`, then restart GBrain services.');
- expect(viaBun.fix).toMatchObject({ argv: ['bun', 'upgrade'], actor: 'user' });
+ for (const runtime of ['/usr/local/bin/gbrain', '/home/alice-example/.bun/bin/bun', 'C:\\Users\\alice-example\\.bun\\bin\\bun.exe', '/opt/bun-1.4.3/bun-linux-x64']) {
+ const row = checkBunRuntime(version, runtime);
+ expect(row.status).toBe('fail');
+ expect(row.message).toStartWith(`GBrain requires Bun 1.4.4 or newer (found Bun ${version}).`);
}
}
- expect(MINIMUM_BUN_VERSION).toBe('1.4.0');
});
});
@@ -101,11 +105,16 @@ describe('CLI entrypoint gate', () => {
expect(exitCode).toBe(1);
expect(stderr).toEqual([OLD_BUN_REFUSAL]);
expect(stdout).toHaveLength(1);
- expect(stdout[0]).toMatch(/^\d{4}-\d{2}-\d{2}T[\d:.]+Z \[autopilot\] GBrain requires Bun 1\.4\.0 or newer \(found Bun 1\.3\.14\)\./);
+ expect(stdout[0]).toMatch(/^\d{4}-\d{2}-\d{2}T[\d:.]+Z \[autopilot\] GBrain requires Bun 1\.4\.4 or newer \(found Bun 1\.3\.14\)\./);
});
test('a supported Bun passes through silently', () => {
- expect(runGate('doctor', '1.4.0')).toEqual({ exitCode: undefined, stderr: [], stdout: [] });
+ expect(runGate('doctor', '1.4.4')).toEqual({ exitCode: undefined, stderr: [], stdout: [] });
+ });
+
+ test('Bun 1.4.2 exits 1 before any command runs', () => {
+ expect(runGate('sync', '1.4.2')).toEqual({ exitCode: 1, stderr: [`GBrain requires Bun 1.4.4 or newer (found Bun 1.4.2).\n`
+ + 'Fix: run `bun upgrade`, then restart GBrain. If a `gbrain upgrade` stopped here, finish it with `gbrain post-upgrade`.'], stdout: [] });
});
});
diff --git a/test/scripts/capture-test-log.test.ts b/test/scripts/capture-test-log.test.ts
index d7ae00baca..7e70eed847 100644
--- a/test/scripts/capture-test-log.test.ts
+++ b/test/scripts/capture-test-log.test.ts
@@ -328,6 +328,19 @@ await new Promise(() => setInterval(() => {}, 1000));`);
expect(await new Response(proc.stderr).text()).toContain(`capture-test-log: ${BUN_SPAWNSYNC_POISONED}?`);
}, 30000);
+ it('on a Bun that carries the upstream fix (1.4.3 or newer) the same shape is some other hang, so nothing names the Bun defect', () => {
+ const onFixedBun = (bun: string, lines: string[]) => [`bun test v${bun} (abc)`, ...lines.slice(1)];
+ for (const bun of ['1.4.3', '1.4.4', '1.5.0']) {
+ const c = feed(onFixedBun(bun, poisonedRun));
+ expect(c.poisoned()).toBe(false);
+ expect(c.render('test (7)', '/tmp/unit.log', 1)).not.toContain(BUN_SPAWNSYNC_POISONED);
+ const live = new FailureCollector();
+ const notes: string[] = [];
+ for (const line of onFixedBun(bun, cancelledRun)) { live.feed(line); notes.push(...live.takeLiveNotes()); }
+ expect(notes).toEqual([]);
+ }
+ });
+
it('a non-timeout failure after the kill, or timeouts confined to one file, is left for its own diagnosis', () => {
const mixed = feed([
...poisonedRun,
diff --git a/test/scripts/ci-pr-scope.test.ts b/test/scripts/ci-pr-scope.test.ts
index fd89f32793..e0047d5b32 100644
--- a/test/scripts/ci-pr-scope.test.ts
+++ b/test/scripts/ci-pr-scope.test.ts
@@ -25,6 +25,9 @@ function cells(job: Job, context: Record<string, unknown>): string[] {
}
const native = load('native-locks.yml').jobs;
+/** The primary (pinned) Bun and the oldest supported one: matrices run both, or one cell when the floor is the primary. */
+const PRIMARY_BUN = '1.4.4';
+const SUPPORTED_BUN = [...new Set([MINIMUM_BUN_VERSION, PRIMARY_BUN])];
const nativeCells = (scope: string) => ({
native: cells(native.native, { inputs: { scope } }),
musl: cells(native.musl, { inputs: { scope } }),
@@ -42,10 +45,10 @@ function classify(files: string): string {
describe('pull-request CI scope', () => {
test('pushes, schedules and manual runs keep every Bun version on every native target', () => {
const full = nativeCells('full');
- expect(full.native).toHaveLength(12);
- expect(full.musl).toHaveLength(4);
- expect(full.console).toHaveLength(4);
- expect(full.dotnet).toHaveLength(4);
+ expect(full.native).toHaveLength(6 * SUPPORTED_BUN.length);
+ expect(full.musl).toHaveLength(2 * SUPPORTED_BUN.length);
+ expect(full.console).toHaveLength(2 * SUPPORTED_BUN.length);
+ expect(full.dotnet).toHaveLength(2 * SUPPORTED_BUN.length);
expect(full.openclaw).toBe(true);
});
@@ -166,9 +169,9 @@ esac
expect(cells(job, { github: { event_name }, inputs: {} })).toEqual(push);
}
expect(cells(job, { github: { event_name: 'pull_request' }, inputs: {} })).toEqual(cheap.includes(job) ? push : []);
- expect(push.filter(cell => cell.split('/').includes(MINIMUM_BUN_VERSION)).length).toBe(push.length / 2);
+ expect(push.filter(cell => cell.split('/').includes(MINIMUM_BUN_VERSION)).length).toBe(push.length / SUPPORTED_BUN.length);
}
- expect(cells(security, { github: { event_name: 'pull_request' }, inputs: {} })).toHaveLength(6);
+ expect(cells(security, { github: { event_name: 'pull_request' }, inputs: {} })).toHaveLength(3 * SUPPORTED_BUN.length);
});
// Every event-conditional behavior in a test workflow is classified beside
@@ -272,7 +275,7 @@ esac
expect(Object.keys(raw.on).sort()).toEqual(['schedule', 'workflow_dispatch']);
expect(raw.concurrency).toEqual({ group: '${{ github.workflow }}-${{ github.ref }}', 'cancel-in-progress': false });
const nightly = raw.jobs.convergence!;
- expect(nightly.strategy!.matrix.bun).toEqual([MINIMUM_BUN_VERSION, '1.4.4']);
+ expect(nightly.strategy!.matrix.bun).toEqual(SUPPORTED_BUN);
expect(nightly.name).toContain('seed ${{ inputs.seed || github.run_id }}');
expect(cell(nightly)).toEqual({ NOTES: '2000', LATENCY_MS: '50', KILLS: '20', SEED: '${{ inputs.seed || github.run_id }}' });
// Outside test-status: no workflow calls it, and test.yml's aggregator never names it.
@@ -290,7 +293,7 @@ esac
// #4479: a local gate or VM on a different Bun than CI produced
// runtime-only skew, so every single-version pin moves together.
test('every single-version Bun pin matches the primary, and matrices keep the oldest supported version', () => {
- const primary = '1.4.4';
+ const primary = PRIMARY_BUN;
// #7373: release binaries embed this Bun, so it never drops below the first release with the CVE-2026-111497 fix.
expect(Bun.semver.order(primary, SECURE_BUN_VERSION)).toBeGreaterThanOrEqual(0);
const read = (path: string) => readFileSync(join(root, path), 'utf8');
@@ -308,9 +311,9 @@ esac
const matrices = [load('test.yml').jobs['security-regressions'], ...Object.values(load('persistence-validation.yml').jobs)]
.map(job => job.strategy?.matrix.bun).filter(Boolean);
expect(matrices).toHaveLength(8);
- for (const bun of matrices) expect(bun).toEqual([MINIMUM_BUN_VERSION, primary]);
+ for (const bun of matrices) expect(bun).toEqual(SUPPORTED_BUN);
for (const job of ['native', 'musl', 'windows-backup-console', 'windows-backup-dotnet']) {
- expect(native[job].strategy!.matrix.bun).toEqual([MINIMUM_BUN_VERSION, primary]);
+ expect(native[job].strategy!.matrix.bun).toEqual(SUPPORTED_BUN);
}
});
});
diff --git a/test/scripts/data-safety-native-workflow.test.ts b/test/scripts/data-safety-native-workflow.test.ts
index 2a0b1a6062..06bae2a07f 100644
--- a/test/scripts/data-safety-native-workflow.test.ts
+++ b/test/scripts/data-safety-native-workflow.test.ts
@@ -80,7 +80,7 @@ describe('data-safety native CI coverage', () => {
expect(job['runs-on']).toBe('${{ matrix.runner }}');
expect(job.strategy['fail-fast']).toBe(false);
expect(job.strategy.matrix.runner).toEqual(['windows-2022', 'windows-11-arm']);
- expect(job.strategy.matrix.bun).toEqual(['1.4.0', '1.4.4']);
+ expect(job.strategy.matrix.bun).toEqual(['1.4.4']);
expect(job.steps.some(entry => entry.run === 'bun scripts/native/verify.ts')).toBe(true);
const step = job.steps.find(entry => entry.name === 'Compare native hidden-window launch behavior');
expect(step).toBeDefined();
@@ -109,12 +109,12 @@ describe('data-safety native CI coverage', () => {
} finally { rmSync(temporary, { recursive: true, force: true }); }
});
- test('the direct dotnet program comparison has its own four-cell opt-in Windows job', () => {
+ test('the direct dotnet program comparison has its own two-cell opt-in Windows job', () => {
const job = workflow.jobs['windows-backup-dotnet'];
expect(job['runs-on']).toBe('${{ matrix.runner }}');
expect(job.strategy['fail-fast']).toBe(false);
expect(job.strategy.matrix.runner).toEqual(['windows-2022', 'windows-11-arm']);
- expect(job.strategy.matrix.bun).toEqual(['1.4.0', '1.4.4']);
+ expect(job.strategy.matrix.bun).toEqual(['1.4.4']);
expect(job.steps.some(entry => entry.run === 'bun scripts/native/verify.ts')).toBe(true);
const step = job.steps.find(entry => entry.name === 'Compare cmdlet and direct dotnet ACL programs');
expect(step).toBeDefined();
diff --git a/test/scripts/native-lock-prebuilds.test.ts b/test/scripts/native-lock-prebuilds.test.ts
index 4498bf5386..7baa0b9bd3 100644
--- a/test/scripts/native-lock-prebuilds.test.ts
+++ b/test/scripts/native-lock-prebuilds.test.ts
@@ -95,7 +95,7 @@ describe('native lock distribution integrity', () => {
continue;
}
const matrix = job.strategy.matrix;
- expect(matrix.bun).toEqual(['1.4.0', '1.4.4']);
+ expect(matrix.bun).toEqual(['1.4.4']);
const script = job.steps.map(step => step.run ?? '').join('\n');
expect(script).toContain('bun scripts/ci-bun-install.ts --frozen-lockfile --ignore-scripts');
const lockTests = script.split('\n').find(line => /\bbun test\b/.test(line) && line.includes('test/native-lock.test.ts'));
@@ -112,7 +112,7 @@ describe('native lock distribution integrity', () => {
}
}
expect(pairs.sort()).toEqual(Object.keys(manifest.artifacts)
- .flatMap(target => ['1.4.0', '1.4.4'].map(bun => `${target}/${bun}`)).sort());
- expect(new Set(pairs).size).toBe(16);
+ .flatMap(target => ['1.4.4'].map(bun => `${target}/${bun}`)).sort());
+ expect(new Set(pairs).size).toBe(8);
});
});