Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs: say "every supported Bun version" after the floor move

garrytan1f87d4e30600
diff --git a/docs/architecture/key-files/core-utilities-2.md b/docs/architecture/key-files/core-utilities-2.md
index 6a8c8b0302..b2d938cef5 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.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/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 Bun matrices 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/scripts/persistence/README.md b/scripts/persistence/README.md
index df64fe9e41..dbcda05b3a 100644
--- a/scripts/persistence/README.md
+++ b/scripts/persistence/README.md
@@ -326,8 +326,8 @@ uses one file per activation state to stay within the unchanged per-file cap. Op
`GBRAIN_TEST_RECONCILE_CRASH_MANIFEST_DIR` retains executed-case evidence.
`test/e2e/reconcile-pgbouncer.test.ts` requires the transaction-mode pooler when
`GBRAIN_CI_REQUIRE_PGBOUNCER=1` and proves repair followed by a new private memory
-write. The durable-persistence workflow runs these contracts on both supported
-Bun versions and uploads the crash manifests; local CI runs the slow and E2E lanes.
+write. The durable-persistence workflow runs these contracts on every supported
+Bun version and uploads the crash manifests; local CI runs the slow and E2E lanes.
`test/put-page-persistence.test.ts` and `test/e2e/put-page-persistence-postgres.test.ts`
pin durable page acceptance and ordinary-error publication: native contention
@@ -529,7 +529,7 @@ lock, and actual source deletion/recreation. The reusable persistence lane
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
+on both engines and every supported Bun version. Three independent instances use the
existing 500-page/200-query read-latency corpus, with public `put_page`
mutations and actual in-flight interval coverage of at least 90%. Any read
or write failure invalidates the sample. CI uses `--informational`: the 50%