Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge origin/master (#6022 engine graduation, v0.60.52.0) into the GBRA-47 wave; restamp v0.60.56.0

garrytan3eb6d18ecced
diff --cc .claude-plugin/plugin.json
index a802a40f7a,2727716b60..9419522a2e
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
- "version": "0.60.50.0",
- "version": "0.60.52.0",
++ "version": "0.60.56.0",
"description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.",
"author": {
"name": "Garry Tan",
diff --cc .codex-plugin/plugin.json
index ad41b8976f,01301db9b2..475d56f05d
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
- "version": "0.60.50.0",
- "version": "0.60.52.0",
++ "version": "0.60.56.0",
"description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.",
"author": {
"name": "Garry Tan",
diff --cc .github/workflows/e2e.yml
index 155e1201f7,22038fbf6a..a8bc321604
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@@ -273,6 -222,22 +273,20 @@@ jobs
--health-interval 10s
--health-timeout 5s
--health-retries 5
- # Transaction-mode pooler for the backend-matrix step (same settings as
- # docker-compose.ci.yml and persistence-validation.yml).
+ pgbouncer:
+ image: edoburu/pgbouncer:latest
+ env:
+ DB_HOST: postgres
+ DB_PORT: '5432'
+ DB_USER: postgres
+ DB_PASSWORD: postgres
+ POOL_MODE: transaction
+ AUTH_TYPE: plain
+ MAX_CLIENT_CONN: '200'
+ DEFAULT_POOL_SIZE: '10'
+ IGNORE_STARTUP_PARAMETERS: extra_float_digits,statement_timeout,idle_in_transaction_session_timeout,search_path
+ ports:
+ - 55433:5432
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
@@@ -332,7 -296,39 +346,24 @@@
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/gbrain_test
GBRAIN_TEST_ALLOW_DATABASE_URL: '1'
- - name: Run backend matrix (direct Postgres, then PgBouncer)
- # scripts/e2e-backend-matrix.txt: the E5 executor binding matrix and the
- # engine parity files, each run on direct Postgres and again through the
- # transaction-mode pooler with an explicit prepare mode (the 6543
- # auto-detect port is not used here). run-e2e.sh fails a file whose
- # executed-test counts differ between the two backends.
- shell: bash
- run: |
- export DATABASE_URL="postgresql://postgres:${PGPASSWORD}@localhost:5432/gbrain_test"
- export GBRAIN_PGBOUNCER_E2E_URL="postgresql://postgres:${PGPASSWORD}@localhost:55433/gbrain_test?prepare=false"
- export GBRAIN_PGBOUNCER_DIRECT_URL="$DATABASE_URL"
- mapfile -t files < <(grep -v -e '^#' -e '^!' -e '^$' scripts/e2e-backend-matrix.txt | cut -f1)
- bash scripts/run-e2e.sh "${files[@]}"
- env:
- PGPASSWORD: postgres
- GBRAIN_CI_REQUIRE_PGBOUNCER: '1'
- GBRAIN_TEST_DB: '1'
- GBRAIN_TEST_ALLOW_DATABASE_URL: '1'
+ GBRAIN_TEST_RECEIPT_DIR: ${{ runner.temp }}/receipts
+ - name: Run engine graduation suites (direct Postgres and PgBouncer)
+ # PGLite -> Postgres graduation (docs/guides/move-to-postgres.md): the
+ # agent flow, stale clients and respawned serves, SIGKILL at every
+ # custody boundary, faults, and the legacy copier. Every PR, with the
+ # transaction-mode pooler as a second target route (pooledUrl).
+ # Excluded from the selected matrix (scripts/e2e-matrix.ts) so they
+ # run once. Named files only, no glob.
+ shell: bash
+ run: bash scripts/run-e2e.sh test/e2e/graduation-cli.test.ts test/e2e/graduation-clients.test.ts test/e2e/graduation-crash.test.ts test/e2e/graduation-faults.test.ts test/e2e/graduation-legacy-copy.test.ts
+ env:
+ DATABASE_URL: postgresql://postgres:postgres@localhost:5432/gbrain_test
+ GBRAIN_PGBOUNCER_URL: postgresql://postgres:postgres@localhost:55433/gbrain_test?prepare=false
+ GBRAIN_TEST_ALLOW_DATABASE_URL: '1'
+ GBRAIN_TEST_DB: '1'
+ E2E_FILE_TIMEOUT_SECS: '900'
++ GBRAIN_TEST_RECEIPT_DIR: ${{ runner.temp }}/receipts
++ GBRAIN_TEST_RECEIPT_LANE: tier1
- name: Run multi-agent serve suite
# cathedral-6 (T7): multi-agent continuity + isolation over a real
# `gbrain serve --http`. Own invocation line (engine-parity
diff --cc .github/workflows/persistence-validation.yml
index 5bb8f2cffc,4623f21cc2..1a79f4eb98
--- a/.github/workflows/persistence-validation.yml
+++ b/.github/workflows/persistence-validation.yml
@@@ -160,128 -160,6 +160,137 @@@ jobs
path: .context/persistence-runtime-matrix.json
if-no-files-found: error
+ # Unit-lane suites whose PostgreSQL arm is gated on DATABASE_URL: the unit,
+ # serial and slow lanes unset it, so these arms run only here (both arms per
+ # file; the PGLite arm also runs in the unit lane). scripts/check-postgres-lane-coverage.ts
+ # fails a new DATABASE_URL-gated arm until it is listed here or wrapped in a
+ # test/e2e registerPostgresTests file. The two shards are balanced by measured runtime.
+ unit-postgres-arms:
+ name: Unit-lane PostgreSQL arms ${{ matrix.shard }}/2 / Bun ${{ matrix.bun }}
+ runs-on: ubicloud-standard-4-ubuntu-2404
+ timeout-minutes: 30
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2]
+ bun: ['1.4.0', '1.4.2']
+ # Pull requests run the primary Bun version; pushes, schedules and
+ # manual runs keep every supported version.
+ exclude: ${{ fromJSON((github.event_name == 'pull_request' || github.event_name == 'merge_group') && '[{"bun":"1.4.0"}]' || '[]') }}
+ services:
+ postgres:
+ image: pgvector/pgvector:pg16
+ env:
+ POSTGRES_USER: gbrain_test
+ POSTGRES_PASSWORD: gbrain_test
+ POSTGRES_DB: gbrain_test
+ ports: ['5432:5432']
+ options: >-
+ --health-cmd "pg_isready -U gbrain_test -d gbrain_test"
+ --health-interval 5s --health-timeout 5s --health-retries 20
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
+ with:
+ bun-version: ${{ matrix.bun }}
+ - run: bun install --frozen-lockfile --ignore-scripts
+ - name: Require PostgreSQL arms of unit-lane suites
+ timeout-minutes: 20
+ shell: bash
+ env:
+ DATABASE_URL: postgres://gbrain_test:[email protected]:5432/gbrain_test
+ GBRAIN_TEST_ALLOW_DATABASE_URL: '1'
+ SHARD: ${{ matrix.shard }}
+ run: |
+ : "${DATABASE_URL:?unit-lane PostgreSQL arms require the explicit test database}"
+ case "$SHARD" in
+ 1) files=(
+ test/colon-slug-windows-5032.test.ts
+ test/decide/conflict-proposals-managed.test.ts
+ test/declared-lineage-visibility.test.ts
+ test/extract-endpoint-revision.serial.test.ts
++ test/graduation-digest.test.ts
++ test/graduation-drain.test.ts
++ test/graduation-inventory.test.ts
++ test/graduation-state.test.ts
+ test/grandfather-managed.test.ts
+ test/harness-skills-epoch.test.ts
+ test/links-attendance-blocked.test.ts
+ test/managed-cycle-pull-upstream.test.ts
+ test/managed-lint.test.ts
+ test/managed-maintenance-links.test.ts
+ test/managed-sync-drain.test.ts
+ test/pack-relation-direction-engine.test.ts
+ test/page-state-engine.test.ts
+ test/persistence-commit-durability.test.ts
+ test/persistence-deactivate.test.ts
+ test/persistence-file-import.test.ts
+ test/persistence-graph-publication.test.ts
+ test/persistence-managed-lifecycle.test.ts
+ test/persistence-managed-sync.test.ts
+ test/persistence-memory-mutations.test.ts
+ test/persistence-page-authority.test.ts
+ test/persistence-skill-bundles.serial.test.ts
+ test/shared-content-freshness.test.ts
+ test/shared-skills-writer-boundary.test.ts
+ test/source-retire-missing-checkout.test.ts
+ test/sync-legacy-holds.test.ts
+ test/takes-vector-lifecycle-5885.serial.test.ts
+ test/withdrawal-overlay-concurrency.test.ts
+ ) ;;
+ 2) files=(
+ test/alias-source-cascade-5094.test.ts
+ test/company-brain-policy.test.ts
+ test/company-brain-runtime.test.ts
+ test/derived-link-reconciliation.test.ts
+ test/doctor-frontmatter-holds.test.ts
+ test/embedding-completion-atomic.serial.test.ts
++ test/graduation-copy.test.ts
++ test/graduation-rollback.test.ts
++ test/graduation-target.test.ts
++ test/graduation-verify.test.ts
+ test/held-read-signals.test.ts
+ test/import-frontmatter-key-order-5158.test.ts
+ test/import-revision-concurrency.test.ts
+ test/managed-sweep-corpus-windows.test.ts
+ test/managed-sync-bulk.test.ts
+ test/managed-sync-chunker-version.test.ts
+ test/persistence-diagnostics.test.ts
+ test/persistence-git-subdir-origin.test.ts
++ test/persistence-history-fixture.test.ts
+ test/persistence-image-import.serial.test.ts
+ test/persistence-physical-root-device.test.ts
+ test/persistence-skill-crash.slow.test.ts
+ test/persistence-sync-cursor-options.test.ts
+ test/persistence-sync-holds.test.ts
+ test/persistence-writer-fences.test.ts
+ test/repair-embedding-effects.test.ts
+ test/repair-frontmatter.test.ts
+ test/shared-skills-catalog.test.ts
+ test/shared-skills-retention-capacity.test.ts
+ test/stats-health-source-scope.test.ts
+ test/sync-frontmatter-recovery.test.ts
+ test/sync-frontmatter-slug-conflict.test.ts
+ test/withdrawal-publication-file.test.ts
+ ) ;;
+ *) echo "::error::unknown shard $SHARD" >&2; exit 1 ;;
+ esac
+ # One bun process per file: *.serial.test.ts files require their own
+ # process, and a test that fails while its body keeps running would
+ # otherwise leak process.env into every later file (one such leak
+ # deleted DATABASE_URL for the rest of a shard and silently dropped
+ # those files' PostgreSQL arms).
+ failed=()
+ for file in "${files[@]}"; do
+ echo "::group::$file"
+ bun --no-env-file test --timeout=120000 "$file" || failed+=("$file")
+ echo "::endgroup::"
+ done
+ for file in ${failed[@]+"${failed[@]}"}; do
+ echo "::error file=$file::PostgreSQL arm failed. Reproduce: DATABASE_URL=<pgvector test database> GBRAIN_TEST_ALLOW_DATABASE_URL=1 bun test --timeout=120000 $file"
+ done
+ [ "${#failed[@]}" -eq 0 ]
+
invariants:
name: ${{ matrix.engine }} / Bun ${{ matrix.bun }}
# The soak uses 1.3-1.8 busy cores: the 2,500-write PGLite soak took 523s on
diff --cc BOOTSTRAP_FOR_AGENTS.md
index cf1aa303c2,6aec89e070..9383f77304
--- a/BOOTSTRAP_FOR_AGENTS.md
+++ b/BOOTSTRAP_FOR_AGENTS.md
@@@ -1,4 -1,4 +1,4 @@@
- <!-- gbrain-runbook-stamp: 0.60.50.0 -->
-<!-- gbrain-runbook-stamp: 0.60.52.0 -->
++<!-- gbrain-runbook-stamp: 0.60.56.0 -->
<!-- This stamp must equal the VERSION file at every release; CI enforces it
(scripts/check-bootstrap-tag.sh). `gbrain bootstrap status` compares it to
the installed binary and warns on skew. -->
diff --cc CHANGELOG.md
index 750b8bf7e1,453fa8ccdc..cb210bca97
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -10,110 -10,87 +10,191 @@@ credits are retained; no result has bee
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
- ## [0.60.50.0] - 2026-10-04
++## [0.60.56.0] - 2026-10-05
+
+**`gbrain sources add` no longer crashes when Git cleans up mid-registration, big PGLite brains stop freezing in long write and timeline passes, and every test CI claims to run now proves it ran, by name.**
+
+This is a test, eval and CI fix wave. For you it fixes three real bugs the test suite had been flaking on. For anyone changing gbrain, CI stops crying wolf: flaky tests are fixed at the root, red nightly runs open an issue instead of going unseen, coverage that never executed now executes, and pull-request CI is faster.
+
+### What changes for you
+
+- **`gbrain sources add` survives `git gc`.** Registering a source walks its directory to check for overlapping brains and measure its size. When Git pruned `.git/objects` during that walk, a vanished subdirectory made the command fail with `internal_error`. Both walks now skip a subdirectory that disappears or turns into a file mid-walk; errors on the root itself and permission errors still stop the command.
+- **PGLite writes outside a transaction take the WAL checkpoint guard.** Raw autocommit writes (bulk vector updates, for one) skipped the guard that `engine.transaction()` already had, so once the write-ahead log crossed its automatic checkpoint trigger, PGLite ran the checkpoint inside the crossing write and spun at 100% CPU. A 64 MB-WAL brain writing 200 MB of autocommit WAL hung before and finishes in about 3 s now. Statement order is unchanged.
+- **`extract timeline --source db` refreshes planner statistics as it goes.** PGLite has no autovacuum, so a timeline walk that grew `timeline_entries` from empty kept planning every read against an empty table and slowed with each row (655 s at 20,000 pages). It now refreshes statistics on the `import.analyze_every_pages` cadence, like import and managed sync. The 20,000-page PGLite scale run finishes import, extract and vectors in about 6 minutes.
+- **`gbrain eval run-all` tells the truth.** A bare run runs only the suites it can run (BrainBench). Naming a suite it does not run (`--suites longmemeval,replay`) exits 1 with `eval_suite_unwired` and the per-suite commands as the fix, and a failed suite exits 1 instead of 0.
+- **`gbrain eval takes-quality` prices every model the canonical pricing table knows.** The private six-model allowlist is gone. An unpriced model warns and runs; under a `--budget-usd` cap it refuses with `no_pricing` and the `gbrain pricing set` command to register its rate.
+
+The three runtime fixes are folded from GBRA-40 Foundations 2 Lane F, along with the scale harness's `find_orphans` known-answer fix. Thank you.
+
+### What changes for contributors
+
+| Pull-request CI (`test.yml` + `e2e.yml`) | Before | Now |
+| --- | --- | --- |
+| Time to green | 1010-1067 s | 696-874 s (median 743 s) |
+| Ubicloud vCPU-minutes per run | 899-940 | 739-755 |
+| Critical path | Selected E2E | a unit shard (Test) |
+| Selected E2E shard max / mean | 904 / 721 s (4 workers) | 365-451 / 323-345 s (8 workers) |
+| Unit shard max / mean | 762 / 542 s | 614-732 / 544-567 s |
+| Tests that ran in no lane | 55 PostgreSQL arms and 12 dead opt-in gates (the compile smoke among them) | 0 (one allowlisted arm with a TODO) |
+
+Before: the three baseline runs of the master tree on 2026-10-04. Now: the three acceptance runs of this branch on the re-mined weights. Both sets of run ids are in `docs/test-audit/2026-10-04/baseline.md`, and every run executes the baseline's test identities or declares the change in `expected-deltas.tsv`.
+
+### Things to watch
+
+| Change | What to do |
+| --- | --- |
+| Test opt-ins under the old names stop the run with the rename command | `GBRAIN_BASH32_REQUIRE` → `GBRAIN_TEST_BASH32_REQUIRE`, `GBRAIN_PERF_BUDGET_MULTIPLIER` → `GBRAIN_TEST_PERF_BUDGET_MULTIPLIER`, `GBRAIN_SKIP_SUBPROCESS_TESTS` → `GBRAIN_TEST_SKIP_SUBPROCESS`, `GBRAIN_REQUIRE_LAUNCHD` → `GBRAIN_TEST_REQUIRE_LAUNCHD`, `GBRAIN_SKIP_LAUNCHD_E2E` → `GBRAIN_TEST_SKIP_LAUNCHD`, `GBRAIN_ENFORCE_E5_BUDGET` → `GBRAIN_TEST_ENFORCE_E5_BUDGET`, `GBRAIN_REQUIRE_COMPILE` → `GBRAIN_TEST_REQUIRE_COMPILE`. Under the old names the test preload deleted them, so they never worked. |
+| A new `*.serial.test.ts` file needs a row in `scripts/serial-files.tsv` | run `bash scripts/check-test-isolation.sh --as-parallel <file>` first; if it passes and the file touches no process-wide state, name it `*.test.ts` instead |
+| A test file with a `DATABASE_URL`-gated arm needs a Postgres lane | `bun run check:postgres-lanes` names the file and the workflow list to add it to |
+| A stale generated artifact fails `verify` | `bun run regen:all` regenerates everything and lists what changed |
+| `docs/TESTING.md` has a 120 KB cap that only goes down | move subsystem detail next to its code instead of growing the file |
+| E2E narrowing is retired | doc-only changes skip E2E; every other change runs the whole E2E corpus |
+| Removed modules | `src/core/chunkers/semantic.ts`, `src/core/chunkers/llm.ts`, `src/core/search/keyword.ts` and `src/core/search/vector.ts` had no importer (use `src/core/search/hybrid.ts`); the forward-reference bootstrap facade (import `src/core/engine-sql/bootstrap.ts`); `scripts/check-exports-count.sh` (`test/public-exports.test.ts` owns the contract); the skillopt judge and reflect evals |
+| The eval ledger `.gbrain-evals/eval-results.jsonl` is local | it is gitignored; `--record` modes keep appending to your local copy |
+
- ## To take advantage of v0.60.50.0
++## To take advantage of v0.60.56.0
+
+`gbrain upgrade` should do this automatically. If it didn't, or if `gbrain doctor` warns about a partial migration:
+
+1. **Run the orchestrator manually:**
+ ```bash
+ gbrain apply-migrations --yes --no-autopilot-install
+ ```
+2. **Nothing else to migrate.** There is no schema change; the fixes apply to the next `gbrain sources add`, PGLite write and `extract timeline` run.
+3. **Verify:**
+ ```bash
+ gbrain doctor --json
+ ```
+4. **If any step fails,** file an issue at https://github.com/garrytan/gbrain/issues with the output of `gbrain doctor` and `~/.gbrain/upgrade-errors.jsonl` if it exists.
+
+### Itemized changes
+
+#### Fixes
+
+- `gbrain sources add`: the physical-root overlap walk and the directory-size count skip a subdirectory that vanishes or becomes a file mid-walk; root errors and EACCES still throw; `.git` is still walked (`test/physical-root-walk.test.ts`, including a 20,000-file walk in about 0.9 s).
+- PGLite: an autocommit statement that may write WAL issues the checkpoint-guard probe right behind itself and queues a needed `CHECKPOINT` before the caller's next statement.
+- `extract timeline --source db` refreshes stale planner statistics every `import.analyze_every_pages` pages on PGLite.
+- `gbrain eval run-all`: bare runs run wired suites only; `eval_suite_unwired` (exit 1, with `gbrain errors eval_suite_unwired`); a failed suite exits 1.
+- `gbrain eval takes-quality`: canonical pricing for every model, registered overrides first; unpriced models warn and run; `no_pricing` under a user cap.
+- Scale harness: the `find_orphans` known answer reads the op's maximum page and compares with `total_orphans`.
+
+#### Flakes fixed at the root
+
+- The `sources add` race above (B1); a leaked `check-update --refresh-cache` child in the self-upgrade breadcrumb test; facts-queue tests wait on queue counters instead of fixed sleeps; the child-readiness test requires the confirmed timeout message (tini contract documented); a `persistence-deactivate` race where an `await` inside a `.rejects` matcher let Postgres reject before the handler attached and leaked env into later files; the gateway baseline is restored after `gateway-chat.test.ts`, folded from community PR #5907, contributed by @nezovskii. Thank you.
+- `waitFor` deadlines scale with `GBRAIN_TEST_WAIT_MULTIPLIER` (1 to 4; coverage lanes set 2), capped at 50 s.
+- Verify's fallback watchdog (hosts without `timeout`) no longer leaves orphaned `sleep` processes holding the caller's pipes.
+
+#### Every claimed test now runs
+
+- Executed-test receipts: every Bun invocation in CI writes a receipt and a JUnit report; `scripts/ci-executed-counts.ts` compares runs by (lane, file, test, backend arm) and fails on an undeclared drop or an incomplete run. Verify records each check as pass, fail, timeout or skip (`GBRAIN_CHECK_SKIPPED:`) and keeps its logs on failure. A red job's step summary lists the failing tests with a reproduce command.
+- 55 unit-file PostgreSQL arms that ran in no lane run in persistence-validation's `unit-postgres-arms` job, one Bun process per file; `check:postgres-lanes` keeps it that way.
+- 12 dead opt-in gates renamed under `GBRAIN_TEST_*`; the compiled self-update smoke runs unconditionally; `check:test-env-opt-ins` fails on a test gated on a name the preload strips.
+- The agent-voice recipe's unit suite runs in CI (`bun run test:agent-voice`); `check:jsonb-params` and `check:image-decoders` run in `verify`; scripts/ is typechecked; guard self-test fixtures cover seven more guards; the privacy guard scans `evals/` and `docs/test-audit/`; `test/docs-repo-paths.test.ts` fails on a doc naming a missing repo path; the skill-refs allowlist fails on stale rows.
+- Blind source pins in six suites (each passed with its behavior broken) are replaced by behavioral owners; probes are in `docs/test-audit/2026-10-04/implementation/lane-c.md`.
+
+#### Red nightlies become issues
+
+- `nightly-watch.yml` opens, updates, reopens and closes one `Nightly red: <workflow>` issue per scheduled workflow, with the failing jobs, the last green commit and the next step; `.github/nightly-known-red.tsv` holds at most three known-red or known-skipped rows, each owned by a TODO.
+- A weekly `ci-health.yml` report lists first-attempt pass rates and the most-failing test files.
+- Heavy Tests: the Docker image copies `patches/`; `postinstall.ts` exits 0 without `src/`; every heavy script runs and prints a rerun command per failure; the Claude door runs even when the Codex door fails.
+- Missing provider secrets are a visible warning (Hermes, real-agent doors, publish-template, key-gated E2E), never a silent green.
+- The scale tier runs under an out-of-process phase watchdog that names the stalled phase; the vectors phase prints one line per batch.
+
+#### Faster and cheaper pull-request CI
+
+- E2E selection is one rule: doc-only changes select nothing, everything else selects the whole corpus, read from the pull request files API on a shallow checkout and failing closed on a truncated list. Up to eight Selected E2E workers on 2 vCPU; the E2E backend matrix moves to its own two 4 vCPU shards and stops running a second time in Selected E2E; serial tests on 4 vCPU; the longmemeval slow file joins the unit shards; unit shards stay on 4 vCPU (2 vCPU raised the shard mean from 542 s to 608 s).
+- 92 serial files that pass the isolation lint and touch no process-wide state rejoin the parallel lane; `scripts/serial-files.tsv` lists the remaining serial files with a class and reason.
+- Shorter test waits through production-default seams (connector fixture, maintenance publish wait, effect renewal interval), and `test/helpers/brain-template.ts` clones initialized disk brains instead of replaying migrations.
+- Shard weights re-mined from this branch's green run; `check:weight-coverage` fails on stale entries and warns on unweighted shares.
+- `merge_group` triggers (inert until the merge queue is enabled) use the PR profile; a version-only `package.json` diff no longer widens the native test scope; dependency audit blocks only when dependencies change or on master, schedules and dispatches; Semgrep uploads SARIF weekly.
+
+#### Docs and tooling
+
+- `bun run regen:all` regenerates every generated artifact; `check:regen-all` in verify.
+- `docs/TESTING.md` opens with a quick start, drops the test inventories and moves subsystem detail beside its code (120 KB ratchet cap).
+- Removed: unreferenced chunkers and search modules, the forward-reference facade, dead test seams, finished one-off scripts, a broken benchmark, the skillopt judge and reflect evals, a fixture naming a real person, and the exports-count and pagetype-exhaustive guards.
+
+ ## [0.60.52.0] - 2026-10-04
+
+ **A PGLite brain that has saved memory can now move to Postgres with nothing lost: one command shows the plan, one confirmation moves it, and the move proves the copy matches before it switches.**
+
+ PGLite is the zero-setup local database a new brain starts on. When a brain outgrows it (thousands of pages, several machines, a hosted server), the next step is Postgres. Until now `gbrain migrate --to postgres` refused almost every real brain: anything an agent had saved through the write coordinator carried history the old copier could not move, such as which saves already happened, which facts you told it to forget, who wrote what, and which keys can get in. Now the move carries all of it, row for row, with the same IDs.
+
+ The move locks the old brain so nothing can write to it, finishes saves that are still in flight, copies every table, and then checks the copy: row counts and a fingerprint of every table, a replay of a saved request to show it is not done twice, and a health check on the new brain. Only after that passes does gbrain point at Postgres. The old folder becomes a small "this brain moved" file that tells any gbrain (old or new, including a restarted `gbrain serve`) where the brain went, and the old data is kept beside it. At every moment at most one of the two databases accepts writes, including after a crash; `--resume` picks up from the last finished step.
+
+ ### How to use it
+
+ ```bash
+ export GBRAIN_TARGET_URL='postgresql://...' # the empty Postgres database
+ gbrain migrate --to postgres --url-env GBRAIN_TARGET_URL --json # shows the plan, exits 3, changes nothing
+ gbrain migrate --to postgres --url-env GBRAIN_TARGET_URL --yes --expect <plan_hash> --json
+ gbrain doctor --no-migrate --json
+ ```
+
+ `--status` and `--plan` are read-only. `--resume` continues an interrupted move, and `--rollback-to-source` goes back to PGLite (it refuses once you have withdrawn facts or revoked a key on Postgres, because going back would undo that). Existing access tokens, OAuth clients and local writer credentials keep working on Postgres. Full guide: [Move a PGLite brain to Postgres](docs/guides/move-to-postgres.md). To keep the old copier, run `gbrain config set migrate.graduation false`.
+
+ ### The numbers that matter
+
+ Measured with the history fixture (real write history: requests, withdrawals, versions, takes, tokens, embedded chunks), a resident `gbrain serve` holding the brain, and a local Postgres 16:
+
+ | Brain | Commands | Wall time, plan to green doctor | Copy | Verify | Target doctor |
+ | --- | --- | --- | --- | --- | --- |
+ | 1,000 pages (1,737 requests, 4,702 effects, 1,168 embedded chunks) | 2 plus 1 doctor | 16.4 s | 2.9 s | 4.3 s | no failing check |
+ | 10,000 pages (17,344 requests, 46,986 effects, 11,668 embedded chunks) | 2 plus 1 doctor | 47.4 s | 15.9 s | 13.3 s | no failing check |
+
+ Search latency, PGLite then Postgres: at 1,000 pages p50 5.3 ms / 8.4 ms and p95 9.0 ms / 9.9 ms; at 10,000 pages p50 37.4 ms / 30.5 ms and p95 41.8 ms / 58.9 ms.
+
+ ### Things to watch
+
+ - A move to a hosted Postgres where the role is not a superuser needs the `vector` extension installed, `BYPASSRLS`, and the row-level-security event trigger owned by the role. The plan names the exact SQL your database admin runs. Supabase's `postgres` role already qualifies.
+ - On Windows a brain with write history still cannot move; brains without history keep the old copier.
+ - The kept PGLite copy (`<path>.graduated-<run_id>`) still holds private memory and token hashes. `gbrain doctor` reports it; deleting it is your call.
+
+ ### Behavior changes for scripts and agents
+
+ | Area | Before | Now | What to change |
+ | --- | --- | --- | --- |
+ | `gbrain migrate --to postgres` (or `--to supabase`) on a PGLite brain | copied at once, or exit 1 `writer_coordinator_required` for a brain with write history | exit 3 `confirmation_required` with the plan and `plan_hash`; the move runs with `--yes --expect <plan_hash>` | relay the plan to the user, then run `fix.argv` after they agree; `gbrain config set migrate.graduation false` keeps the old copier |
+ | `gbrain serve` started while a move runs | waited on the lock or started status-only | exit 75 `graduation_in_progress` | let the supervisor retry after the move |
+ | A CLI or MCP config that still points at a moved PGLite path | opened or recreated the PGLite folder | `engine_graduated` with the one-step fix | run `fix.argv`, restart the MCP client |
+ | `doctor` `pglite_scale` fix | `gbrain migrate --to supabase` | `gbrain migrate --to postgres --plan --json` | none |
+
+ ## To take advantage of v0.60.52.0
+
+ `gbrain upgrade` should do this automatically. If it didn't, or if `gbrain doctor` warns about a partial migration:
+
+ 1. **Run the orchestrator manually:**
+ ```bash
+ gbrain apply-migrations --yes --no-autopilot-install
+ ```
+ Migration v201 adds the `persistence_graduation` table; no existing rows change.
+ 2. **Your agent reads `skills/migrations/v0.60.52.0.md` the next time you interact with it.** Nothing moves until you ask for a move and confirm the plan.
+ 3. **Verify:**
+ ```bash
+ gbrain doctor --json
+ gbrain migrate --status --json
+ ```
+ 4. **If any step fails or the numbers look wrong,** please file an issue: https://github.com/garrytan/gbrain/issues with:
+ - output of `gbrain doctor`
+ - contents of `~/.gbrain/upgrade-errors.jsonl` if it exists
+ - which step broke
+
+ ### Itemized changes
+
+ #### Engine graduation (`gbrain migrate --to postgres`)
+
+ - Every table is classified in one versioned inventory: 94 copied verbatim with IDs, 2 re-checked for this machine (brain identity, worktree host bindings), 2 caches rebuilt, 6 transient or unused tables (PGLite planner statistics, cycle locks, an unused reservation table, rate leases, one-time OAuth codes) dropped. A schema with an unclassified table refuses the move, and a test fails when a migration adds one without a classification.
+ - The copy runs with database triggers bypassed for the copy transaction only, so stored attribution, revisions and generations land unchanged; leases on queued jobs and effects are reset so the new database's workers pick them up, and delayed effects keep their schedule.
+ - Verify compares row counts (twice: by a plain count and by the batched fingerprint read), a canonical per-table fingerprint computed the same way on both engines, sequence positions, every foreign key, trigger state and the relation set, replays a drained request through admission inside a rolled-back transaction, and runs the target doctor.
+ - Custody: the PGLite kernel lock is held from the start of the move until routing flips; an intent marker beside the brain and a database fence on Postgres refuse every other writer; the old folder is renamed and replaced by an exclusive-create tombstone before Postgres takes authority. A stray brain created at the old path by an older gbrain is detected and refused (`graduation_split_brain`).
+ - New error codes, each with a reason, an exact fix and a read-only verify command: `graduation_source_writer_held`, `graduation_unclassified_table`, `graduation_embedding_dimension_mismatch`, `graduation_drain_timeout`, `graduation_target_not_empty`, `graduation_foreign_host_binding`, `graduation_verify_failed`, `graduation_interrupted`, `graduation_in_progress`, `graduation_split_brain`, `graduation_rollback_writes_lost`, `graduation_target_auth_failed`, `graduation_target_ddl_unreachable`, `graduation_target_unsupported`, `graduation_unsupported_platform`, `engine_graduated`.
+ - `gbrain engine status --json` shows the graduation state; `pglite_leftovers` reports the kept PGLite copy; a dead interrupted move is a doctor failure with the resume command.
+
+ #### Tests
+
+ - A hand-built legacy brain with independently written expected outcomes, plus 1,000- and 10,000-page history brains, graduate end to end on Postgres 16 and through a transaction-mode PgBouncer.
+ - Crash tests kill the move at every step of the move and of rollback, including around the routing flip and the first write on Postgres; a restarted `gbrain serve`, older released binaries against the tombstone, stale CLI and MCP configs, a full target disk and a rotated target password are each tested.
+
## [0.60.49.0] - 2026-10-04
**Automatic event extraction now records only what happened. On the independent lift eval that failed it, wrong or premature events drop from 1.11 per judged page to 0.07 and 0.11 (gate: 0.20), and recall rises from 35/38 to 38/38.**
diff --cc CONTRIBUTING.md
index f579fd7b0b,174344d9d6..c21c6fa9e4
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@@ -276,12 -273,55 +276,58 @@@ on host (`brew install gitleaks`). Over
uncommitted edits included; see "Ubicloud fan-out" in
[`docs/TESTING.md`](docs/TESTING.md).
-Fail-closed selector: an unmapped `src/` change runs ALL E2E files. Hand-tune
-narrower mappings via `scripts/e2e-test-map.ts`.
+E2E selection runs every E2E file for any change that is not doc-only; diff
+narrowing is retired because a typical E2E file imports most of `src/`. A
+doc-only diff still runs llms freshness, the KEY_FILES byte caps, documented
+paths, skill references and the privacy guards (`scripts/ci-doc-checks.sh`).
+See [E2E selection](docs/TESTING.md#e2e-selection).
+ ### Local graduation smoke (PGLite → Postgres)
+
+ A five-minute end-to-end check of `gbrain migrate --to postgres` on the E2E
+ container conventions from [`docs/TESTING.md`](docs/TESTING.md) (pinned
+ `pgvector/pgvector:pg16`, a database name carrying "test", tear down when done).
+ It uses its own container name and port so it never touches `gbrain-test-pg`,
+ and an isolated `GBRAIN_HOME` so it never touches your brain. Unset
+ `DATABASE_URL` and `GBRAIN_DATABASE_URL` first: the plan lists either one as a
+ blocker when it points anywhere but the target.
+
+ ```bash
+ # 1. Target database
+ docker run -d --name gbrain-graduation-pg \
+ -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres \
+ -e POSTGRES_DB=gbrain_graduation_test \
+ -p 5436:5432 pgvector/pgvector:pg16
+ until docker exec gbrain-graduation-pg pg_isready -U postgres; do sleep 1; done
+
+ # 2. Source brain with write history, in a throwaway home
+ export GBRAIN_HOME="$(mktemp -d)"
+ bun run src/cli.ts init --pglite --no-embedding
+ echo "Alice Example runs the acme-example pilot." | bun run src/cli.ts put people/alice-example
+
+ # 3. Plan (exit 3, nothing changes), then run with the plan hash
+ export GBRAIN_TARGET_URL=postgresql://postgres:postgres@localhost:5436/gbrain_graduation_test
+ bun run src/cli.ts migrate --to postgres --url-env GBRAIN_TARGET_URL --json > plan.json; echo "exit $?"
+ bun run src/cli.ts migrate --to postgres --url-env GBRAIN_TARGET_URL --yes --expect "$(jq -r .plan_hash plan.json)"
+
+ # 4. The brain answers from Postgres
+ bun run src/cli.ts doctor --no-migrate --json
+ bun run src/cli.ts get people/alice-example
+ bun run src/cli.ts migrate --status --json
+
+ # 5. Clean up (always, pass or fail)
+ docker rm -f gbrain-graduation-pg
+ rm -rf "$GBRAIN_HOME" plan.json
+ unset GBRAIN_HOME GBRAIN_TARGET_URL
+ ```
+
+ Expected: step 3 prints `exit 3` and then a run that ends with the target's
+ doctor result, `get` returns the page, and `ls "$GBRAIN_HOME/.gbrain"` before
+ cleanup shows `brain.pglite` as a tombstone file next to the retained
+ `brain.pglite.graduated-<run_id>` copy. For rollback,
+ run `bun run src/cli.ts migrate --rollback-to-source` before step 5 and check
+ that `get` answers from PGLite again.
+
### PR-side security checks
Besides the test gate, PRs may trigger three security workflows: Semgrep CE
diff --cc TODOS.md
index 6b81b2c84a,acf4bcdb8d..3a1a358052
--- a/TODOS.md
+++ b/TODOS.md
@@@ -1,42 -1,16 +1,53 @@@
# TODOS
+## Test, eval and CI fix wave follow-ups (filed 2026-10-04, GBRA-47)
+
+Context: `.github/nightly-known-red.tsv` rows point here; nightly-watch keeps their incidents open until the row is deleted. Scale-tier evidence: per-batch `vectors` lines and the phase watchdog in `scripts/scale/`.
+
+- [ ] **P2 — PGLite bulk-embedding cost at 20k+ chunks.**
+ **What:** the 36-minute PGLite `vectors` stall at 20k pages (nightly run 37196223708) no longer reproduces with the WAL checkpoint guard on autocommit writes: branch dispatch 37221090928 finished PGLite 20k `vectors` in 173 s (40 batches of 500 pages, dimension 1024, RSS ~2.5 GiB), against 56 s on Postgres. Per-batch time still grows from 2.1 s to 6.3 s across the phase. **Why:** a default PGLite brain that embeds 50k+ chunks at once may hit the superlinear part. **Fix:** read the per-batch `vectors` lines on the 50k promotion runs; if the batch time keeps climbing, measure through the shipped `gbrain embed` path and decide the engine fix (HNSW maintenance around bulk updates, PGLite memory settings). **Effort:** M. **Priority:** P2.
+- [ ] **P1 — PR time to green is 696-874 s against the ~650 s target.**
+ **What:** the wave cut PR CI from 1010-1067 s to 696-874 s (median 743 s over three acceptance runs) and from 899-940 to 739-755 Ubicloud vCPU-minutes (`docs/test-audit/2026-10-04/baseline.md`). The unit shards are the critical path: max 614-732 s against a 544-567 s mean on the re-mined weights; the spread comes from single files (`claw-test.slow`, `persistence-large-manifest`) running slower than their one-run weights. **Fix:** mine weights from several runs (median per file) instead of one, then add unit shards or split the heaviest unit files before revisiting runner sizes; recompute the 30-PR median two weeks after merge. **Effort:** M. **Priority:** P1.
+- [ ] **P2 — Clone initialized homes for CLI-spawn and agent-journey fixtures (D5 adoption).**
+ **What:** `test/helpers/brain-template.ts` clones initialized disk brains for in-process fixtures, but the CLI-spawn and agent-journey helpers still run `gbrain init` per test. An initialized `GBRAIN_HOME` holds identity tied to its own paths (managed-roots files named by a hash of the data-dir path, the owner record, `content/<brain_id>`), so a copied home cannot be rebased. **Fix:** a production re-identity path for a copied home, then adopt the template in `cli-spawn` and the journey helpers. **Effort:** M. **Priority:** P2.
+- [ ] **P2 — Executed-test receipts for the remaining lanes.**
+ **What:** the security-regressions matrix (Windows runs PowerShell), the nightly `coverage-full-slow` inline `bun test` calls and `persistence-validation.yml` write no receipts, so the ledger (`scripts/ci-executed-counts.ts`) cannot prove their identities. **Fix:** route each through `scripts/run-with-receipt.sh` (a PowerShell twin for Windows), upload `receipts-<lane>` artifacts and add them to `executed-receipts`. **Effort:** M. **Priority:** P2.
+- [ ] **P2 — Give the export-scale Postgres arm a scheduled lane.**
+ **What:** `test/export-scale.slow.test.ts`'s 100,001-page Postgres arm passes but takes about 527 s, so it is the one `ALLOWLIST` row in `scripts/check-postgres-lane-coverage.ts`. **Fix:** a nightly job with a pgvector service and a 20-minute budget that names the file, then delete the allowlist row. **Effort:** S. **Priority:** P2.
+- [ ] **P2 — Build the nightly coverage report from Test's own artifacts (C7).**
+ **What:** the nightly runs the unit, serial and slow corpus twice: `e2e.yml`'s `coverage-full-{unit,serial,slow}` at 06:00 and `test.yml`'s coverage lanes at 07:23 (about 314 vCPU-min a night). **Fix:** move `coverage-full-e2e` and `coverage-full-report` into `test.yml`'s scheduled run so producers and merger share one SHA and attempt; fail with the missing lane and the dispatch command on a missing producer or mismatched SHA; keep a `reconcile-crash.slow` coverage producer; keep artifact namespaces distinct; compare the lane inventory and line percentage before and after. **Effort:** M. **Priority:** P2.
+- [ ] **P2 — Move the remaining PGLite-only files out of the Postgres E2E lane (C9).**
+ **What:** about 87 files in `test/e2e/` construct PGLite only and run sequentially on the Postgres runner on every PR. **Fix:** continue the 2026-09-29 pilot's method (`docs/test-audit/2026-09-29/implementation/lane-pilot.md`): move by suffix to unit, serial or slow, with per-file executed-count evidence and `move` rows for the ledger. **Effort:** M. **Priority:** P2.
+- [ ] **P3 — One test-multiplier knob.**
+ **What:** `GBRAIN_TEST_TIMEOUT_MULTIPLIER` scales Bun's `--timeout` in `run-unit-shard.sh` while `GBRAIN_TEST_WAIT_MULTIPLIER` scales `waitFor` deadlines. **Fix:** derive both from one variable (coverage lanes set 2), keeping the 50 s scaled-deadline ceiling. **Effort:** S. **Priority:** P3.
+- [ ] **P3 — One mulberry32 for eval statistics (E9).**
+ **What:** `src/core/eval/paired-bootstrap.ts` (`seededRandom`) and `src/eval/shared/bootstrap.ts` (`mulberry32`) each carry the same PRNG, plus eight copies in scripts/ and test/. **Fix:** export one `mulberry32` from `src/eval/shared/bootstrap.ts` and import it; keep both bootstrap algorithms. `test/eval-paired-bootstrap.test.ts` and `test/longmemeval-judge.test.ts` pass unchanged. **Effort:** S. **Priority:** P3.
+- [ ] **P3 — PostgreSQL contract tests in one Bun process per file.**
+ **What:** persistence-validation's "PostgreSQL contract tests" step runs its whole list in one Bun process; a failing file can leak env into later files, the class that hit `unit-postgres-arms`. **Fix:** the same per-file loop with `::error file=` lines. **Effort:** S. **Priority:** P3.
+- [ ] **P3 — Skip `.git` in the physical-root walk with a registration refusal.**
+ **What:** the root-overlap and size walks tolerate vanishing subdirectories but still walk `.git`. **Fix:** skip `.git` and refuse a registration nested inside another brain's `.git` explicitly. **Effort:** S. **Priority:** P3.
+- [ ] **P3 — Regenerate artifacts on PR branches automatically.**
+ **What:** `bun run regen:all --check` fails a stale artifact in verify, and the contributor reruns `regen:all`. **Fix:** an opt-in workflow that pushes the regenerated artifacts to same-repo PR branches. **Effort:** S. **Priority:** P3.
+- [ ] **P3 — Coverage-derived E2E selection.**
+ **What:** E2E narrowing is retired (a file-to-test import map selected every file). **Fix:** measure, from the nightly fullCorpus lcov, what share of recent PRs a coverage-derived file-to-test map would narrow; build the selector only if that share is large. **Effort:** M. **Priority:** P3.
+- [ ] **P3 — `bun run doctor:dev` and an example-PR walkthrough.**
+ **What:** a contributor has no one-command check of Bun, Docker and Python before running the gate, and no worked example PR. **Fix:** a `doctor:dev` script that checks prerequisites and runs `bun run test` and `verify`, plus a CONTRIBUTING walkthrough of one small PR. **Effort:** S. **Priority:** P3.
+- [ ] **P3 — Fold the remaining opt-in prefixes into `GBRAIN_TEST_*`.**
+ **What:** `GBRAIN_REAL_*`, `GBRAIN_E2E_*`, `GBRAIN_CI_*`, `GBRAIN_TRIAGE_CALIBRATION_LIVE` and `GBRAIN_LIVE_TYPESAFE` survive the scrub as compatibility exceptions. **Fix:** rename them under `GBRAIN_TEST_` with `RENAMED` rows in `test/helpers/operator-env-policy.ts` and fail-fast on old names. **Effort:** S. **Priority:** P3.
+- [ ] **P3 — Dead scripts/ and test/ references in TODOS.md.**
+ **What:** about 25 TODOS.md entries name scripts or tests that no longer exist; `test/docs-repo-paths.test.ts` does not scan TODOS.md. **Fix:** sweep them, then add TODOS.md to the scan with a historical marker for completed entries. **Effort:** S. **Priority:** P3.
+
+ ## Engine graduation follow-ups (filed 2026-10-04, GBRA-50)
+
+ Context: `docs/guides/move-to-postgres.md`, `docs/ENGINES.md#engine-migration-refused`.
+
+ - [ ] **P2 — Postgres → PGLite graduation.**
+ **What:** `gbrain migrate --to pglite` uses the legacy copier, which refuses any brain with write history, withdrawals or worktree ownership. **Why:** a brain that moved to Postgres (or started there) cannot come back to a single-machine PGLite brain without losing its history. **Fix:** a reverse adapter (Postgres source, PGLite target) for the graduation inventory, copier and verify in `src/core/persistence/engine-graduation.ts`, with the same plan, fence, verify, cutover and crash tests. **Effort:** L. **Priority:** P2.
+ - [ ] **P3 — `gbrain migrate --discard-source`.**
+ **What:** after a verified graduation the PGLite copy stays at `<path>.graduated-<run_id>` and the user deletes it by hand (doctor's `pglite_leftovers` names the command). **Why:** the copy still holds private memory and token hashes. **Fix:** a confirmation-gated command that deletes the retained copy and the tombstone only when the run is `graduated` and no rollback is pending, with `--yes --expect` and a dry run. **Effort:** S. **Priority:** P3.
+ - [ ] **P2 — Windows graduation.**
+ **What:** on Windows a PGLite brain with history gets `graduation_unsupported_platform` (history-free brains use the legacy copier). **Why:** the tombstone, kernel-lock retention and SIGKILL crash tests have not run on a Windows runner, so custody across a crash is unproven there. **Fix:** run the tombstone, older-binary and crash suites on a Windows CI runner, fix what fails, then lift the platform refusal. **Effort:** M. **Priority:** P2.
+
## Held files follow-ups (filed 2026-10-04, follow-up from v0.60.47.0)
Context: `docs/guides/repair.md#held-files`, `docs/guides/write-refusals.md#held-files-and-content-refusals`.
diff --cc VERSION
index 219ef83297,081b46bce2..6146500f73
--- a/VERSION
+++ b/VERSION
@@@ -1,1 -1,1 +1,1 @@@
- 0.60.50.0
-0.60.52.0
++0.60.56.0
diff --cc docs/TESTING.md
index 1f918be685,4a97179ffa..bfd374c67b
--- a/docs/TESTING.md
+++ b/docs/TESTING.md
@@@ -560,9 -725,101 +560,13 @@@ nested transaction confinement and the
### Durable persistence schedules and process crashes
-`test/persistence-consumer-scheduling.test.ts` pins completion wake-ups,
-including a wake-up arriving during an active tick, without lowering the idle
-poll interval. Per-root deadlines preserve blocked/retryable backoff even while
-another root keeps committing; expired deadlines permit retries. Shutdown drains
-active preparation without starting another request.
-`test/persistence-root-refresh.test.ts` checks that unchanged root registrations
-do not replace their durable files while unbound, moved and original bound paths
-all remain fenced.
-
-`test/e2e/persistence-http-liveness.test.ts` drives real authenticated HTTP MCP
-with legacy and source-bound OAuth credentials against an isolated PostgreSQL
-database. It covers pending page/fact writes, lost acknowledgments, owner
-interruption, exact canonical readback, 44 pages over three clients, and current
-receipt authorization. Set `GBRAIN_TEST_OLD_BINARY` to a retained compatible
-executable to additionally exercise old/new owner handoffs in both directions
-for queued, actually claimed and recovery-bearing rows. Interrupted owners are
-reaped and native exclusion is verified before their successors start; only the
-abandoned running lease is advanced by the fixture. An omitted executable skips
-these compatibility cases, not proves them.
-`test/e2e/persistence-phase-liveness.test.ts` holds real table/row locks and
-ordinary/direct pool slots to verify phase cancellation (including capacity
-marking), tracked queued `BEGIN`, renewal, expired-head FIFO and shutdown fences.
-A loopback TCP gate separately delays or rejects cold direct initialization,
-checking retained work through shutdown and same-ID completion after retry.
-The memory-mutation tests use a
-deterministic loopback embedding transport for slow and aborted preparation;
-they do not contact a paid provider. Receipt contract, MCP parser, IPC and CLI
-tests pin the same nested allowlist and advisory age policy. Diagnostic tests
-exercise both fresh/index-upgrade parity and a genuinely interrupted PostgreSQL
-concurrent index build when a PostgreSQL fixture is supplied.
-
-`test/persistence-chaos.slow.test.ts` and `test/e2e/persistence-chaos.test.ts`
-execute real journal/coordinator schedules and eight SIGKILL publication
-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.
-See [`scripts/persistence/README.md`](../scripts/persistence/README.md) for
-workloads, reruns, performance measurements and the process-crash scope.
-
-`test/e2e/persistence-runtime-matrix.test.ts` additionally requires the real
-transaction-mode PgBouncer fixture. Its 24 cells exercise direct/pooler
-connections, enforced RLS under a non-bypass role, ordinary pool sizes 1/2/3,
-and shared pools or a separate one-connection direct route. It verifies
-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.
-
-The required persistence lane also runs `scripts/persistence/performance.ts`
-on both engines and Bun versions. 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%
-loaded-versus-idle p99 threshold is advisory, not a merge blocker. Loaded
-reads compete with additional write work, so this ratio alone is not evidence
-of a change regressing the same workload. Manifests retain the original
-threshold verdict, each sample, admission/commit latency, queue age, RSS,
-recovery bytes and pool activity.
-The CLI without `--informational` still enforces the threshold. The original
-heavy shell entry invokes this harness; its optional `STRICT_LATENCY=1`
-flag affects only the latency threshold, never validity requirements.
+Persistence suites (native-matrix publication, managed writers, schedules, crash boundaries, the runtime
+matrix and read latency) are described in [scripts/persistence/README.md](../scripts/persistence/README.md#test-suites).
+ ### Engine graduation
+
-Graduation (`gbrain migrate --to postgres`) is tested against two fixtures.
-`test/fixtures/graduation/legacy-brain.ts` builds a small brain by hand-written
-SQL on a fresh schema, and its expected outcomes live in `expected.json`
-beside it (`test/graduation-legacy-fixture.test.ts` proves the build matches
-and that the target checker discriminates).
-`scripts/persistence/graduation-fixture.ts` wraps `buildHistoryFixture` for
-the 1k and 10k history brains, builds keylessly in a child process, and
-caches each build as a tarball keyed by the fixture sources, schema version,
-seed and size (`GBRAIN_GRADUATION_FIXTURE_CACHE`, default
-`~/.cache/gbrain-graduation-fixtures`). A restore re-homes paths and owner
-stamps and marks sources synced, so the source doctor stays green.
-
-The E2E suites drive the real CLI in child processes:
-`graduation-crash` (SIGKILL at every run and rollback boundary),
-`graduation-faults` (ENOSPC on a tmpfs tablespace, which needs Docker;
-password rotation; DDL route mismatch), `graduation-clients` (older
-releases, respawned and resident serve, stale CLI and MCP configs) and
-`graduation-cli` (agent flow, zero-mutation `--plan`/`--status`, `--force`,
-PgBouncer through `GBRAIN_PGBOUNCER_URL`, a NOSUPERUSER role, the 1k round
-trip). Kill and pause points come from `graduationBoundary()` hooks that only
-`test/helpers/graduation-hooks-preload.ts` registers. Older release binaries
-are built once per tag under `GBRAIN_OLDER_RELEASE_DIR`. The crash suite takes
-about 40 seconds per case, so run it with `GBRAIN_E2E_FILE_TIMEOUT=3600`.
-`scripts/persistence/graduation-ttv.ts` records the commands and wall time
-from the first plan to a green doctor, the run's phase timings and query
-p50/p95 on both engines. The 1k-page gate is five minutes;
-`tests/heavy/graduation_10k.sh` reports the 10k run.
++Graduation fixtures and suites: [scripts/persistence/README.md](../scripts/persistence/README.md#engine-graduation-tests).
+
### PGLite schema snapshot (default-on)
`scripts/build-pglite-snapshot.ts` (`bun run build:pglite-snapshot`) bakes a
diff --cc docs/guides/error-codes.md
index 69b9000eed,5d9e1ae679..29cde36682
--- a/docs/guides/error-codes.md
+++ b/docs/guides/error-codes.md
@@@ -685,14 -685,16 +685,24 @@@ More: [docs/guides/write-refusals.md#em
|---|---|---|---|---|---|---|
| The embedding model cannot produce the width of the brain's vector column; nothing was changed. | The request itself was wrong or no longer matches the brain; nothing was changed. | Correct the request using the message above, then retry. | agent | `repeat the read that failed` | 1 | no |
+ ### engine_graduated
+
+ <a id="engine_graduated"></a>
+
+ | Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+ |---|---|---|---|---|---|---|
+ | A client opened a PGLite brain that moved to Postgres; its old path holds a tombstone. | The request itself was wrong or no longer matches the brain; nothing was changed. | Correct the request using the message above, then retry. | agent | `repeat the read that failed` | 1 | no |
+
+ More: [docs/guides/move-to-postgres.md#graduated-datastore](../../docs/guides/move-to-postgres.md#graduated-datastore)
+
+### eval_suite_unwired
+
+<a id="eval_suite_unwired"></a>
+
+| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+|---|---|---|---|---|---|---|
+| `gbrain eval run-all` was asked for a suite it does not run in-process (longmemeval or replay); nothing ran. | run-all runs only wired suites (brainbench). Recording a skipped run and exiting 0 would read as a completed sweep with no numbers behind it. | Run each requested suite with its own command (`gbrain eval longmemeval <dataset.jsonl> --mode <mode> --record`, `gbrain eval replay --mode <mode>`), once per mode, or drop it from --suites. | agent | `repeat the read that failed` | 1 | no |
+
### export_limit
<a id="export_limit"></a>
diff --cc openclaw.plugin.json
index 6116d08ee7,e01e5f1097..90d4cf3289
--- a/openclaw.plugin.json
+++ b/openclaw.plugin.json
@@@ -1,7 -1,7 +1,7 @@@
{
"id": "gbrain-context-engine",
"name": "gbrain",
- "version": "0.60.50.0",
- "version": "0.60.52.0",
++ "version": "0.60.56.0",
"description": "Personal knowledge brain with Postgres + pgvector hybrid search",
"family": "bundle-plugin",
"kind": "context-engine",
diff --cc package.json
index e460f3e628,ccc4cbd1bc..55ca248057
--- a/package.json
+++ b/package.json
@@@ -218,7 -212,7 +218,7 @@@
"bun": ">=1.4.0"
},
"license": "MIT",
- "version": "0.60.50.0",
- "version": "0.60.52.0",
++ "version": "0.60.56.0",
"overrides": {
"@ai-sdk/provider-utils": "4.0.56",
"@hono/node-server": "^2.0.5",
diff --cc plugin-variants/gbrain-coding/.claude-plugin/plugin.json
index 129b347ebe,1fd0f221cd..87e4bce8c7
--- a/plugin-variants/gbrain-coding/.claude-plugin/plugin.json
+++ b/plugin-variants/gbrain-coding/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-coding",
- "version": "0.60.50.0",
- "version": "0.60.52.0",
++ "version": "0.60.56.0",
"description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-coding/.codex-plugin/plugin.json
index 181181db5b,df2e4866b2..05c6e09df6
--- a/plugin-variants/gbrain-coding/.codex-plugin/plugin.json
+++ b/plugin-variants/gbrain-coding/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-coding",
- "version": "0.60.50.0",
- "version": "0.60.52.0",
++ "version": "0.60.56.0",
"description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-coding/README.md
index f62f8c729f,7663aa2538..32d53fe156
--- a/plugin-variants/gbrain-coding/README.md
+++ b/plugin-variants/gbrain-coding/README.md
@@@ -1,4 -1,4 +1,4 @@@
- <!-- gbrain-plugin-tree-stamp: 0.60.50.0 -->
-<!-- gbrain-plugin-tree-stamp: 0.60.52.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.56.0 -->
# gbrain-coding (generated persona variant — do not hand-edit)
Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant.
diff --cc plugin-variants/gbrain-daily/.claude-plugin/plugin.json
index 6bd48d28bb,5698c8dcbf..58523cd9cc
--- a/plugin-variants/gbrain-daily/.claude-plugin/plugin.json
+++ b/plugin-variants/gbrain-daily/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-daily",
- "version": "0.60.50.0",
- "version": "0.60.52.0",
++ "version": "0.60.56.0",
"description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-daily/.codex-plugin/plugin.json
index 57840ab75f,a65b2b39eb..be0cb996df
--- a/plugin-variants/gbrain-daily/.codex-plugin/plugin.json
+++ b/plugin-variants/gbrain-daily/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-daily",
- "version": "0.60.50.0",
- "version": "0.60.52.0",
++ "version": "0.60.56.0",
"description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-daily/README.md
index 8d5cb6a0ee,45310f7183..021aad621e
--- a/plugin-variants/gbrain-daily/README.md
+++ b/plugin-variants/gbrain-daily/README.md
@@@ -1,4 -1,4 +1,4 @@@
- <!-- gbrain-plugin-tree-stamp: 0.60.50.0 -->
-<!-- gbrain-plugin-tree-stamp: 0.60.52.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.56.0 -->
# gbrain-daily (generated persona variant — do not hand-edit)
Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant.
diff --cc plugin/README.md
index 48b7fb1118,25dc09133e..1c8c5f7cde
--- a/plugin/README.md
+++ b/plugin/README.md
@@@ -1,4 -1,4 +1,4 @@@
- <!-- gbrain-plugin-tree-stamp: 0.60.50.0 -->
-<!-- gbrain-plugin-tree-stamp: 0.60.52.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.56.0 -->
# gbrain plugin skill tree (generated — do not hand-edit)
This tree is the curated skill set for the gbrain Codex and Claude Code
diff --cc scripts/e2e-matrix.ts
index ddfa4303c1,703da6166d..a2a8044b31
--- a/scripts/e2e-matrix.ts
+++ b/scripts/e2e-matrix.ts
@@@ -41,8 -31,13 +41,14 @@@ export const E2E_EXCLUSIONS = new Set(
'test/e2e/skills.test.ts',
'test/e2e/voyage-rerank-live.test.ts',
'test/e2e/voyage-multimodal.test.ts',
+ // Engine graduation: run once by tier1's graduation step (direct Postgres + PgBouncer).
+ 'test/e2e/graduation-cli.test.ts',
+ 'test/e2e/graduation-clients.test.ts',
+ 'test/e2e/graduation-crash.test.ts',
+ 'test/e2e/graduation-faults.test.ts',
+ 'test/e2e/graduation-legacy-copy.test.ts',
...PERSISTENCE_VALIDATION_OWNED,
+ ...BACKEND_MATRIX_OWNED,
]);
export interface E2ERow { shard: number; files: string[]; empty: boolean }
function validatePath(file: unknown): asserts file is string {
diff --cc scripts/module-size-limits.tsv
index a650ed96ab,a5363702a5..a62c14217d
--- a/scripts/module-size-limits.tsv
+++ b/scripts/module-size-limits.tsv
@@@ -20,8 -20,8 +20,8 @@@ src/core/engine.ts 2678 ratchet grown v
src/core/import-file.ts 2178 ratchet +2: pre-publication withdrawal validation; grown v0.46.26.0 megawave: OCR budget + image import + embed-retry rewire (#3973 #3374); grown wave-g (#4530): per-model chunk-token cap wiring; +24 #4548: row-level visibility-aware fence merge on remote write-back (replaces the #2044 whole-block swap + #4553/#4555 warn-only paths); +7 #4546: merge extended to the timeline-embedded fence; +5 #4107: maybeOcr gates on the OCR model's provider; +3 #3893; +7: #4702 disabled_patterns pass-through to the sanity gate; composition true-up (fix-wave multi-train); +8 #4903: importCodeFile writes source_path so the full-sync reconcile can see code pages; -11: wave review — local fence append replaced by facts-fence.replaceOrInsertFactsFence (#4756 rule); security: durable queued authority and confined filesystem dispatch; master integration: grown v0.46.26.0 megawave: OCR budget + image import + embed-retry rewire (#3973 #3374); grown wave-g (#4530): per-model chunk-token cap wiring; +24 #4548: row-level visibility-aware fence merge on remote write-back (replaces the #2044 whole-block swap + #4553/#4555 warn-only paths); +7 #4546: merge extended to the timeline-embedded fence; +5 #4107: maybeOcr gates on the OCR model's provider; +3 #3893; +7: #4702 disabled_patterns pass-through to the sanity gate; composition true-up (fix-wave multi-train); +8 #4903: importCodeFile writes source_path so the full-sync reconcile can see code pages; -11: wave review — local fence append replaced by facts-fence.replaceOrInsertFactsFence (#4756 rule); harness support: boundary wiring to shared grants, isolated setup, withdrawal and delegated guards; merged v0.49: withdrawal preservation after data-only frontmatter parsing; #5105: small legacy writer/refusal and shared revision CAS delegates; #5105: +8 prepared contextual retrieval policy and retry boundary wiring; upstream integration: preserve independently reviewed master additions with branch facade extraction; #5252 wave: shared provider-free Markdown and code preparation; merged company ingestion/schema routing changes; master retrieval/projection integration with company ingestion; shared content: prepare managed image imports without bypassing canonical publication; +29 write-path wave: identity move/collision wiring (logic in import-identity.ts), deferred embedding on provider failure, image index completeness, file-time date anchor; +22 fw3 A13: markdown re-import reuses unchanged chunk vectors under the seal/wrapper/signature/protected-fence gate; +2 fw3 A12: importFromFile firstCommitAt option; +3 fw3 A14: managed imports keep add-only tags; +4 #5675: record the file origin move inference binds to (logic in import-identity.ts); fw3 integration: A12/A13/A14 (+27) and #5675 (+4) compose; +17 wave-2 W4: safe-chunk re-seal of unchanged legacy markdown/code pages (#5050 #5247) and embedding-input provenance on inline imports (#5553); -1 fix wave 2 (v0.60.5.0) integration: W4 delta re-summed over the merged master line count; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +16 at the merge; +11 #4616: markdown and code imports keep the usable vectors of a partially refused batch and leave refused chunks for embed --stale; lowered to 2230: #5621 contextual-mode resolution peeled to core/import-contextual-mode.ts (shared with gbrain repair contextual-mode); +2 wave 8 lane D1 #5158: key-order fallback equality call (comparison lives in page-state/import-guard.ts); +1 F1c: direct imports run in maintenanceTransaction (write attribution; helper in persistence/attribution.ts); lowered to 2178: #5988 content screen and content-sanity config peeled to core/import-screen.ts
src/core/migrate.ts 602 ratchet schema-migration runner only; migrations live in src/core/schema-migrations/ (W3); +3 #5216: resumable page revision backfill runs after every migration pass while pages.knowledge_revision is nullable
src/core/operations.ts 336 ratchet peel target: containment sprint C4-C7; grown v0.46.26.0 megawave op wiring; +chat-connectors wiring (master merge); +5 v0.47 gmail-loops: loopsOperations spread + OP_AREAS; #5105: receipt operation registry wiring; shared-skills integration on company-ingestion base; +2 security wave: withOutputRedaction applied at op registration; +1 #5616: pageEditOperations import (spread shares the pages line); +1 Foundations 1 F1b: attributionOperations import (spread shares the admin line); +1 agent operator wave A6: ops/notices.ts import (mute_notice); +2 agent operator closeout A1: registerOpRoutes import + call (routing logic in fix-routing.ts)
- src/core/pglite-engine.ts 2930 ratchet +4 Foundations 2 Lane F: autocommit write statements take the WAL checkpoint guard (classifier writesWal in pglite-engine/checkpoint-guard.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts)
- src/core/postgres-engine.ts 2917 ratchet +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); ceiling rationale: docs/architecture/key-files/engines-2.md entry for src/core/postgres-engine.ts; evidence delivery: getChunkWindows scoped-read delegate + type import (+5; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +10 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3242 #5824: searchVector SQL moved to search/vector-statement.ts, +explainVectorSearch/runVectorAttempt (-156); +6 #5730: onpoisoned wiring on the instance/module/connection-manager pools + poisonedDiscards in getPoolDiagnostics (counter in pool-gauge.ts); +5 #5801: onCheckout observer seam (fires after reserve resolution / transaction-callback entry; listeners in pool-gauge.ts); lowered to 3119 #5889: searchTitles SQL moved to engine-sql/titles.ts (-133); lowered to 2914 F4a: getHealth SQL moved to engine-sql/health.ts (-216); +2 #5984: transactions track held page guards like PGLite (withHeldPageKeys), so repeated guards in one transaction cost no round trips; +1 #5984: traceSqlOptions import for the env-gated GBRAIN_SQL_TRACE bench hook (src/core/sql-trace.ts); v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (2917 measured)
-src/core/pglite-engine.ts 2978 ratchet +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move)
++src/core/pglite-engine.ts 2982 ratchet +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move); +4 Foundations 2 Lane F: autocommit write statements take the WAL checkpoint guard (classifier writesWal in pglite-engine/checkpoint-guard.ts); GBRA-47 x engine graduation merge: re-summed
+ src/core/postgres-engine.ts 2919 ratchet +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); ceiling rationale: docs/architecture/key-files/engines-2.md entry for src/core/postgres-engine.ts; evidence delivery: getChunkWindows scoped-read delegate + type import (+5; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +10 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3242 #5824: searchVector SQL moved to search/vector-statement.ts, +explainVectorSearch/runVectorAttempt (-156); +6 #5730: onpoisoned wiring on the instance/module/connection-manager pools + poisonedDiscards in getPoolDiagnostics (counter in pool-gauge.ts); +5 #5801: onCheckout observer seam (fires after reserve resolution / transaction-callback entry; listeners in pool-gauge.ts); lowered to 3119 #5889: searchTitles SQL moved to engine-sql/titles.ts (-133); lowered to 2914 F4a: getHealth SQL moved to engine-sql/health.ts (-216); +2 #5984: transactions track held page guards like PGLite (withHeldPageKeys), so repeated guards in one transaction cost no round trips; +1 #5984: traceSqlOptions import for the env-gated GBRAIN_SQL_TRACE bench hook (src/core/sql-trace.ts); v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (2917 measured); +2 engine graduation (GBRA-50 G2a): initSchema sizing parameter (the source embedding layout sizes a fresh target)
src/core/search/hybrid.ts 1584 ratchet +2 System One v1: HybridSearchOpts.decide (search/decide-stage.ts); refactor wave 1 split target (W4 hybrid, cut line); ceiling rationale: docs/architecture/key-files/core-search-1.md entry for src/core/search/hybrid.ts; +10 #5691: per-request embedding_query_prefix read once and threaded to the embeds and cache key
src/core/types.ts 2124 ratchet +5 System One v1 retrieval lane: SearchResult injection_p/injection_suspected, HybridSearchMeta answerability, egress_denied degraded reason; +4 System One v1: SearchResult rerank_score_kind/decide_evidence, HybridSearchMeta decide/rerank; +3 wave review: PAGE_SORT_SQL.updated_asc source_id + id tiebreakers (total order under federated scopes); +5 #4881: OntologyReadOpts extends PageReadScope doc; +3 #4857: PAGE_SORT_SQL.slug total-order tiebreaker comment; grown v0.46.26.0 megawave: EvidenceOpts, pacing/usage result fields, PageFilters growth (#4352 #4218); wave-k: +9 SalienceOpts/AnomaliesOpts source scope (#3867); +20 2026-09 adversarial batch 2: keyword_relaxed_carried stage + relaxed_dropped meta field docs; +16 2026-09 fix wave: SearchResult.keyword_relaxed field + full fusion-demotion doc; (#3867); +9: #4648 rerank_passthrough degraded stage + empty_result_set/malformed_shape reasons | merged v0.48.1.0 true-up; +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); corrective release: shared internal PageReadScope and PageReadPolicy; ranker wave v0.48.4.0: HybridSearchMeta relational_rerank_pin / keyword_arm_confidence / metadata_boost_gate + SearchResult.relational_pinned (+48 over master's peel); +12: #4681 Page.updated_at_iso + keyset cursor precision docs; #5105: canonical page state shared module and transaction/snapshot delegates; #5105: public page revision fields; upstream integration: preserve independently reviewed master additions with branch facade extraction; #5252 wave: typed vector pool and readiness metadata; merged company ingestion/schema routing changes; retired provider integration removed; +1 write-path wave: 'created' effective-date source; +3 read-path wave: rerank_failed degraded stage + budget reason (closed vocabularies) and its recall classification note; +8 fw3-search: SearchOpts.source_boosts + keyword_arm_failed/title_arm_failed stages; +2 wave-2 W4: ChunkInput.embedding_input_hash (#5553); fix wave 3 x fix wave 2 (v0.60.5.0) composition: +2 at the merge; evidence delivery: optional SearchResult.delivered (+2; shape in search/evidence-delivery.ts); +2 eval wave N1-3: OntologyReadOpts.visibility (remote world-only ontology reads); +4 #5827: GraphNode.source_id and GraphPath from_source_id/to_source_id; +2 #5824: SearchOpts.vectorLegacyGuard rollback switch; +7 #5154: PageFilters.listColumnsOnly (interface field); +11 Foundations 1 F1b: WriteAttributionView + AttributedPageVersion (get_versions / get_write_attribution read shapes); +1 #5988: SearchResult.stale carries the held-file detail (interface field)
src/core/minions/queue.ts 2522 ratchet grown #4078 + megawave probe-liveness unlatch (#4310) + master private-queue lifecycle: recovery classifier + monotonic lease; security: durable queued authority and confined filesystem dispatch; master integration: grown #4078 + megawave probe-liveness unlatch (#4310) + master private-queue lifecycle: recovery classifier + monotonic lease; harness support: boundary wiring to shared grants, isolated setup, withdrawal and delegated guards; merged v0.49: durable authority and delegated admission both enforced; typed readiness, configuration-blocked lifecycle and bounded release; +9: prune archives completed dream synthesis keys
diff --cc scripts/persistence/README.md
index af96dc01e6,35a35c9c48..2ed68d8c68
--- a/scripts/persistence/README.md
+++ b/scripts/persistence/README.md
@@@ -184,236 -184,3 +184,266 @@@ over the 50% threshold exits successful
Invalid samples, failed reads/writes and insufficient overlap still fail CI.
Omit `--informational` to enforce the threshold locally; the threshold value
and measurement workload have not changed.
+
+## Test suites
+
+These suites own the durable-persistence contracts. `test:full` alone does not run the complete
+native, runtime, crash, soak, deployment-matrix and read-latency gates; tie each result to its tested
+revision and disclose skipped cells.
+
+### Canonical reconciliation and accepted writes
+
+`test/persistence-reconcile-merge.test.ts` pins loss-preserving field choices.
+`test/persistence-reconcile.test.ts` runs the guarded repair and replay contracts
+on PGLite and, with an explicit safe `DATABASE_URL`, isolated PostgreSQL databases.
+It covers stale preconditions, current/original grants, private facts, retained
+backups, ordinary mutations after repair, and competing publications.
+`test/reconcile-owner-journey.serial.test.ts` drives real CLI requests through
+HTTP and stdio PGLite owners before and after activation, restarts the owner, and
+independently reads the newly remembered private fact and provenance.
+
+`test/reconcile-crash.slow.test.ts` and `test/e2e/reconcile-crash*.test.ts` kill real
+processes at all eight publication boundaries with activation off/on. PostgreSQL
+uses one file per activation state to stay within the unchanged per-file cap. Optional
+`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.
+
+`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
+returns an accepted pending receipt without changing the page, and replay of its
+original UUID commits exactly once after release. Filesystem or required
+source-path failure rolls back the database transaction. Embedding failure
+preserves the canonical receipt; a delayed result superseded by another revision
+cannot install vectors. The PGLite suite also covers scoped physical file paths,
+unchanged-content no-ops, legacy hashes, deletion/recreation, and sanitized
+diagnostics. Actual process-death boundaries belong to the crash suites below.
+
+`test/subagent-required-writes.test.ts` and
+`test/subagent-put-page-rejection.serial.test.ts` distinguish a persisted write
+from prose-only completion, rejected imports, and historical rejected ledger
+envelopes across the Anthropic, gateway, and oneshot lanes. Unchanged saves,
+optional-write jobs, and saved pages with failed enrichment are positive controls.
+`test/cycle/global-freshness-postcondition.serial.test.ts` exercises the registered
+maintenance handler with failed phases, incomplete children, budget deferrals,
+abort/lock loss, and successful warning-only controls.
+
+### Native-matrix publication and managed writers
+
+The glibc Linux, macOS and Windows matrix also runs
+`persistence-publication-native.serial.test.ts`,
+`persistence-git-publication.test.ts`,
+`persistence-sync-origin-native.test.ts` and
+`backup-portability-native.serial.test.ts` in separate Bun processes. These
+exercise real Git publication, historical source origins and backup restoration
+with fresh-process reopen. macOS and Windows set
+`GBRAIN_TEST_REQUIRE_CASE_INSENSITIVE=1`; a case-sensitive fixture must fail
+rather than silently skip the publication regression. Inspect executed test
+counts before claiming native coverage; a configured lane alone is not evidence.
+
+The publication, sync-origin, processing-option and company-sync suites also
+run separately with an explicit PostgreSQL URL in the persistence deployment
+matrix. `test/e2e/persistence-publication-parity.test.ts` and
+`test/e2e/persistence-sync-{origin,options,company}-parity.test.ts` include them
+in the full local E2E gate; the keyless serial runner alone cannot exercise
+their PostgreSQL branches.
+
+Focused safety coverage: `test/apply-migrations-safety.serial.test.ts` checks
+force dry-run previews before DB/ledger access and failed-phase partial exit;
+`test/real-home-guard-preload.test.ts` pins the test-home fingerprint backstop
+(detection, not prevention). Managed retry, durable diagnostics, restart and
+PGLite/Postgres parity are covered by `test/persistence-sync-failures.serial.test.ts`
+and `test/e2e/managed-sync-failures.test.ts`. Backup remote readback and fsync
+fault cases run in `test/backup-verification.serial.test.ts` and
+`test/backup-fsync.serial.test.ts`; `test/e2e/backup-coverage-parity.test.ts`
+covers PGLite/Postgres page/fact/config parity. Output redaction uses
+`test/search/output-redaction.serial.test.ts` and
+`test/search/output-redaction.test.ts`, including unchanged internal capture.
+
+Managed writer fixtures use isolated PGLite and guarded disposable Postgres:
+`test/e2e/fact-vector-repair-parity.test.ts`,
+`test/e2e/fact-embedding-backfill-parity.test.ts`, and
+`test/fact-backfill-resident.test.ts` cover preserved vectors, bounded
+NULL-only fact backfill, selected-config refusal and owner-held PGLite IPC;
+`test/ai/google-embed-batch-items.test.ts` pins 100-item provider batches.
+`test/persistence-embedding-effects.test.ts`,
+`test/persistence-effect-retry.test.ts`, and
+`test/embedding-completion-atomic.serial.test.ts` cover partial vector
+completion, exhausted durable attempts and state-bound explicit retry.
+`test/managed-extract-atoms.test.ts`, `test/managed-facts-backstop.test.ts`
+and their `test/e2e/` counterparts exercise admitted atom/fact replay,
+including fresh-process facts authority. `test/persistence-connectors.test.ts`
+covers managed bound/unbound Google/GitHub sources, API pagination and
+source-scoped deletions. `test/persistence-connector-retry.test.ts` covers
+explicit retry, compaction, checkpoint dependency identity, concurrent approval
+and lost acknowledgements. Each suite creates its own home, engines and
+lifecycle through `test/helpers/connector-fixture.ts`; the helper shares no
+live engine or mutable suite state. Their separate E2E entry points,
+`test/e2e/managed-connector-routing.test.ts` and
+`test/e2e/managed-connector-retry.test.ts`, retain the runner's default
+180-second per-file cap without duplicating the base cases in the retry lane.
+Linux root runners execute the complete EACCES case in an isolated `setpriv`
+child and assert UID 65534 before testing permissions. This needs a readable
+checkout, not changes to the parent process identity or checkout permissions;
+the CI runner image supplies `setpriv`.
+`test/managed-maintenance.test.ts` and
+`test/helpers/maintenance-restart.ts` cover local synthesize/patterns/
+consolidation, restart replay, retired takes and semantic snapshots;
+`test/managed-unsupported-preflight.serial.test.ts` checks that the managed
+facts-family bulk lanes refuse an unaccepted writer before spend, and
+`test/managed-facts-writers.test.ts` proves each of them (fence reconcile,
+phantom redirect, fence writes, loops extraction, bulk conversation facts)
+publishes through the coordinator on PGLite and Postgres. These use synthetic provider/API transports, not
+paid model calls or production connectors. PGLite dream/job CLI with an active
+owner is **not** proven delegated by the live fact-backfill IPC test.
+
+`test/facts-worker-config.test.ts` and its PostgreSQL E2E counterpart dispose
+the original consumer before executing a real facts-absorb job. They verify the
+worker passes trusted selected configuration, ignores job-supplied configuration
+and settles the entity-page effect with zero fact or chunk embedding calls when
+disabled. Fact extraction still captures the generated fact with a NULL embedding.
+
+`test/managed-facts-embedding.test.ts` and its PostgreSQL counterpart bind retained
+fact vectors to the selected brain's model and dimensions, including equal-width
+host/mount mismatches, keyless capture, policy changes and replay without new spend.
+`test/managed-atom-regressions.test.ts` and its PostgreSQL counterpart preserve
+later target edits through explicit retries and honor database-only storage policy
+without relaxing source authority. `test/managed-synthesis-postprocess.test.ts`
+and its E2E wrapper verify that completed quote/provenance work never rewrites a
+later user edit, while unfinished work resumes against its original revision.
+The synthesis suite also preserves the existing same-date summary on replay and
+rebuilds a complete index after partial recovery. `test/managed-atom-compaction.test.ts`
+and its PostgreSQL counterpart age and compact real receipts: permanent completion
+identity still prevents repeated extraction, while expired retry payloads produce
+an explicit refusal without changing terminal outcomes or compaction accounting.
+`test/managed-facts-compaction.test.ts` and its PostgreSQL counterpart cover the
+same lifetime boundary for explicit and derived fact-batch identities, including
+failed or partially committed batches and successful replay without new spend.
+Connector sweep fencing and physical-path normalization have separate parity
+coverage in `test/persistence-connector-fencing.test.ts`. Standalone crash/recovery
+cases live in `test/persistence-connector-recovery.test.ts` and their own E2E
+wrapper so they do not share the routing file's wall-clock budget; their original
+assertions, child watchdogs and per-file timeout are unchanged.
+
+`test/managed-atoms-cli.slow.test.ts` exercises real disk-backed PGLite CLI
+recovery with a loopback provider: live-owner refusal, graceful owner stop,
+malformed extraction, explicit same-input retry, idempotent replay and owner
+restart. Fresh-process readback checks the private canonical file, searchable
+chunk, retained failure receipt, committed completion and released leases.
+`test/managed-connector-routing.serial.test.ts` pins actual activation and
+`performSync` routing for API sources; the maintenance suite also drives
+`runCycle` with eligible facts in two sources and proves the other source is
+unchanged. The E2E wrapper files ensure these optional PostgreSQL arms execute
+in the database lane rather than only passing their PGLite controls.
+
+The persistence invariant jobs run the complete `scripts/persistence/validate.ts`
+gate (10,000-write soak) on pushes to master and manual dispatches. Pull requests
+run the same schedules and crash boundaries with a 2,500-write soak; the full
+PGLite soak alone takes 15-28 minutes and would otherwise set every PR's wall
+time. `test/scripts/data-safety-native-workflow.test.ts` pins the split.
+
+For platform-only feedback, dispatch
+`gh workflow run test.yml --ref <branch> -f native_only=true`. This explicit manual option uses a separate concurrency
+group so it does not cancel an ongoing full persistence soak. Its
+`native-only-validation-scope` artifact records the exact commit and
+`full_ci: false`; it never emits the required `test-status` check for unrun full
+CI. Omitting the option preserves every normal PR, push and full manual gate.
+
+### Schedules and process crashes
+
+`test/persistence-consumer-scheduling.test.ts` pins completion wake-ups,
+including a wake-up arriving during an active tick, without lowering the idle
+poll interval. Per-root deadlines preserve blocked/retryable backoff even while
+another root keeps committing; expired deadlines permit retries. Shutdown drains
+active preparation without starting another request.
+`test/persistence-root-refresh.test.ts` checks that unchanged root registrations
+do not replace their durable files while unbound, moved and original bound paths
+all remain fenced.
+
+`test/e2e/persistence-http-liveness.test.ts` drives real authenticated HTTP MCP
+with legacy and source-bound OAuth credentials against an isolated PostgreSQL
+database. It covers pending page/fact writes, lost acknowledgments, owner
+interruption, exact canonical readback, 44 pages over three clients, and current
+receipt authorization. Set `GBRAIN_TEST_OLD_BINARY` to a retained compatible
+executable to additionally exercise old/new owner handoffs in both directions
+for queued, actually claimed and recovery-bearing rows. Interrupted owners are
+reaped and native exclusion is verified before their successors start; only the
+abandoned running lease is advanced by the fixture. An omitted executable skips
+these compatibility cases, not proves them.
+`test/e2e/persistence-phase-liveness.test.ts` holds real table/row locks and
+ordinary/direct pool slots to verify phase cancellation (including capacity
+marking), tracked queued `BEGIN`, renewal, expired-head FIFO and shutdown fences.
+A loopback TCP gate separately delays or rejects cold direct initialization,
+checking retained work through shutdown and same-ID completion after retry.
+The memory-mutation tests use a
+deterministic loopback embedding transport for slow and aborted preparation;
+they do not contact a paid provider. Receipt contract, MCP parser, IPC and CLI
+tests pin the same nested allowlist and advisory age policy. Diagnostic tests
+exercise both fresh/index-upgrade parity and a genuinely interrupted PostgreSQL
+concurrent index build when a PostgreSQL fixture is supplied.
+
+`test/persistence-chaos.slow.test.ts` and `test/e2e/persistence-chaos.test.ts`
+execute real journal/coordinator schedules and eight SIGKILL publication
+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;
+the sections above cover workloads, reruns, performance measurements and the
+process-crash scope.
+
+`test/e2e/persistence-runtime-matrix.test.ts` additionally requires the real
+transaction-mode PgBouncer fixture. Its 24 cells exercise direct/pooler
+connections, enforced RLS under a non-bypass role, ordinary pool sizes 1/2/3,
+and shared pools or a separate one-connection direct route. It verifies
+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.
+
+The required persistence lane also runs `scripts/persistence/performance.ts`
+on both engines and Bun versions. 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%
+loaded-versus-idle p99 threshold is advisory, not a merge blocker. Loaded
+reads compete with additional write work, so this ratio alone is not evidence
+of a change regressing the same workload. Manifests retain the original
+threshold verdict, each sample, admission/commit latency, queue age, RSS,
+recovery bytes and pool activity.
+The CLI without `--informational` still enforces the threshold. The original
+heavy shell entry invokes this harness; its optional `STRICT_LATENCY=1`
+flag affects only the latency threshold, never validity requirements.
++
++## Engine graduation tests
++
++Graduation (`gbrain migrate --to postgres`) is tested against two fixtures.
++`test/fixtures/graduation/legacy-brain.ts` builds a small brain by hand-written
++SQL on a fresh schema, and its expected outcomes live in `expected.json`
++beside it (`test/graduation-legacy-fixture.test.ts` proves the build matches
++and that the target checker discriminates).
++`scripts/persistence/graduation-fixture.ts` wraps `buildHistoryFixture` for
++the 1k and 10k history brains, builds keylessly in a child process, and
++caches each build as a tarball keyed by the fixture sources, schema version,
++seed and size (`GBRAIN_GRADUATION_FIXTURE_CACHE`, default
++`~/.cache/gbrain-graduation-fixtures`). A restore re-homes paths and owner
++stamps and marks sources synced, so the source doctor stays green.
++
++The E2E suites drive the real CLI in child processes:
++`graduation-crash` (SIGKILL at every run and rollback boundary),
++`graduation-faults` (ENOSPC on a tmpfs tablespace, which needs Docker;
++password rotation; DDL route mismatch), `graduation-clients` (older
++releases, respawned and resident serve, stale CLI and MCP configs) and
++`graduation-cli` (agent flow, zero-mutation `--plan`/`--status`, `--force`,
++PgBouncer through `GBRAIN_PGBOUNCER_URL`, a NOSUPERUSER role, the 1k round
++trip). Kill and pause points come from `graduationBoundary()` hooks that only
++`test/helpers/graduation-hooks-preload.ts` registers. Older release binaries
++are built once per tag under `GBRAIN_OLDER_RELEASE_DIR`. The crash suite takes
++about 40 seconds per case, so run it with `GBRAIN_E2E_FILE_TIMEOUT=3600`.
++`scripts/persistence/graduation-ttv.ts` records the commands and wall time
++from the first plan to a green doctor, the run's phase timings and query
++p50/p95 on both engines. The 1k-page gate is five minutes;
++`tests/heavy/graduation_10k.sh` reports the 10k run.
diff --cc scripts/serial-files.tsv
index 730cd477d9,0000000000..61e29dacdd
mode 100644,000000..100644
--- a/scripts/serial-files.tsv
+++ b/scripts/serial-files.tsv
@@@ -1,345 -1,0 +1,347 @@@
+# Every *.serial.test.ts file outside test/e2e, with the reason it cannot share a bun process.
+# class: R1 (process.env mutation) | R2 (mock.module) | global-state (other process-wide state) | exclusive (EXCLUSIVE_FILES in scripts/run-serial-tests.sh).
+# Before adding a row, run: bash scripts/check-test-isolation.sh --as-parallel <file> (docs/TESTING.md#when-to-quarantine-instead-of-fix)
+path class reason
+test/admin-grant-outcome.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; binds local servers/ports
+test/advisor-backup-coverage.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK)
+test/agent-error-surfaces.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/agent-harness-seed.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/agent-injection-http-view.serial.test.ts global-state global-state: binds local servers/ports
+test/agent-install-backup.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; spyOn fs.renameSync, PGLiteEngine.prototype.connect, console.log
+test/agent-install-follow-setup.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/agent-journey-recovery.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/agent-journey-tier2.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/agent-journey-upgrade.serial.test.ts global-state global-state: binds local servers/ports
+test/agent-journey.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/agent-operator-gate-fixes.serial.test.ts global-state global-state: binds local servers/ports
+test/agent-recovery-consent-journeys.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/ai/gateway-ledger-records.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests, __setEmbedTransportForTests, __setRerankTransportForTests; configureGateway changes the process-wide AI gateway
+test/ai/gateway-model-sources.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
+test/ai/header-transport.serial.test.ts global-state global-state: process-wide test seams __setRerankTransportForTests; configureGateway changes the process-wide AI gateway
+test/ai/no-batch-cap-suppression.serial.test.ts global-state global-state: process-wide test seams __setTestRecipesForTests; configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
+test/ambient-recall-hooks.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_HOOKS)
+test/ambient-writeback-lifecycle.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/apply-migrations-safety.serial.test.ts R2 R2: mock.module(dynamic specifier) replaces modules for every file in the process
+test/attendance-repair-cli.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; binds local servers/ports
+test/audit-parser-probe.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)
+test/audit-slug-fallback.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)
+test/audit-synopsis.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)
+test/auth-rescope-token.serial.test.ts global-state global-state: binds local servers/ports
+test/autopilot-cycle-connector.serial.test.ts R2 R2: mock.module(../src/core/cycle.ts) replaces modules for every file in the process
+test/autopilot-fanout-clamp.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)
+test/autopilot-launchd-lifecycle.serial.test.ts exclusive exclusive: launchd/cron lifecycle arc: install → self-disable → reinstall → uninstall ordering against (PATH-shimmed) launchctl; the arc asserts machine-level sequencing and is the flake-class canary.
+test/backfill-concurrency-clamp.serial.test.ts R1 R1: mutates process.env (GBRAIN_DIRECT_POOL_SIZE)
+test/backup-cli.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK)
+test/backup-coverage.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BRAIN_ID)
+test/backup-fsync.serial.test.ts global-state global-state: spyOn fs.fsyncSync, fs.openSync, privacy.protectNewBackupPath, childProcess.execFile
+test/backup-invalidation.serial.test.ts R1 R1: mutates process.env (HOME, GBRAIN_HOME, GBRAIN_GIT_ALLOW_FILE_TRANSPORT, GBRAIN_ALLOW_UNVERIFIED_REMOTE (+2 more))
+test/backup-portability-native.serial.test.ts R1 R1: mutates process.env (SystemRoot)
+test/backup-status-file.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK_DAYS, GBRAIN_BACKUP_CHECK, GBRAIN_FORCE_BACKUP_NAG (+2 more))
+test/backup-verification.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/binary-self-update-compiled.serial.test.ts global-state global-state: compile smoke gated by GBRAIN_SELFUPDATE_COMPILE_SMOKE
+test/bootstrap-dispatcher.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, CODEX_HOME, HOME, CLAUDE_CONFIG_DIR)
+test/bootstrap-harness-lifecycle.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/bootstrap-harness.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/bootstrap-hook-under-serve.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_SOURCE, GBRAIN_DATABASE_URL, DATABASE_URL (+3 more))
+test/bootstrap-interview.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/bootstrap-opencode-door.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, XDG_CONFIG_HOME)
+test/bootstrap-plugin-lane.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, CODEX_HOME, CLAUDE_CONFIG_DIR, HOME)
+test/bootstrap-seat.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/bootstrap-status.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GB_FAKE_RECORD, PATH, GB_FAKE_GH_ANSWER)
+test/bootstrap-subcommand-help.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/bootstrap-uninstall.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/bootstrap-verify.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/brain-durability-hook.serial.test.ts exclusive exclusive: hardenBrainRepo({installCron:true}) executes REAL launchctl/crontab (src/core/brain-repo-durability.ts) — a concurrent or killed run could strand a real scheduled job on the machine.
+test/brain-flag-routing.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/brain-registry.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/brain-repo-durability.serial.test.ts exclusive exclusive: hardenBrainRepo's own scaffolding commit fires the just-installed post-commit hook (background push) which races the synchronous push-probe on the same bare remote ("cannot lock ref" → needs_attention non-empty). The race is intra-call; pooled CPU contention widens the window past what the assertions tolerate (observed on a 4-vCPU CI runner, never locally). Sequential lane restores master-era timing until the probe learns to retry ref-lock contention.
+test/brainstorm/checkpoint.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/check-update-refresh.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/checkpoint-harvest.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, CLAUDE_CONFIG_DIR)
+test/cli-dispatch-lifecycle.serial.test.ts R2 R2: mock.module(../src/core/engine-factory.ts, ../src/commands/orphans.ts, ../src/commands/salience.ts, ../src/commands/serve.ts (+4 more)) replaces modules for every file in the process
+test/code-callers-pin.serial.test.ts global-state global-state: spyOn console.log, console.error, process.exit; process.chdir changes the shared cwd
+test/code-def-refs-pin.serial.test.ts global-state global-state: spyOn console.log, console.error, process.exit; process.chdir changes the shared cwd
+test/company-brain-connect-cli.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/company-brain-recovery.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/config-db-plane.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_DATABASE_URL, DATABASE_URL)
+test/connection-manager.serial.test.ts R1 R1: mutates process.env (GBRAIN_DISABLE_DIRECT_POOL, GBRAIN_DIRECT_POOL_SIZE, GBRAIN_DIRECT_DATABASE_URL)
+test/connectors-credentials.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/consent-table.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/context-engine-checkpoint.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_MEMORABLE_CONFIG, MEMORABLE_BIN, GBRAIN_MEMORABLE)
+test/context-pack-wb-lane.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/contextual-retrieval-doctor.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)
+test/contextual-synopsis-model.serial.test.ts global-state global-state: process-wide test seams __setGenerateTextTransportForTests; configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
+test/core/audit-week-file.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)
+test/core/cycle.serial.test.ts R2 R2: mock.module(../../src/commands/lint.ts, ../../src/commands/backlinks.ts, ../../src/commands/sync.ts, ../../src/commands/extract.ts (+3 more)) replaces modules for every file in the process
+test/core/remediation-checkpoint.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/creds-vault.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/cross-modal-hybrid-integration.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway
+test/cycle-lock-release-diagnostic.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/cycle-lock-steal.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_CYCLE_LOCK_REFRESH_MS)
+test/cycle-patterns-completed-outcome.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts, ../src/core/cycle/synthesize.ts, ../src/core/minions/wait-for-completion.ts) replaces modules for every file in the process
+test/cycle-patterns-evidence-gate.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts, ../src/core/cycle/synthesize.ts, ../src/core/minions/wait-for-completion.ts) replaces modules for every file in the process
+test/cycle-pglite-lock-ordering.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/cycle-start-recovery-throw.serial.test.ts R2 R2: mock.module(../src/core/minions/queue.ts) replaces modules for every file in the process
+test/cycle/cycle-sync-uncommitted-warn.serial.test.ts R2 R2: mock.module(../../src/commands/sync.ts) replaces modules for every file in the process
+test/cycle/global-freshness-postcondition.serial.test.ts R2 R2: mock.module(../../src/commands/embed.ts, ../../src/core/ai/gateway.ts, ../../src/core/cycle/inline-drain.ts) replaces modules for every file in the process
+test/db-repair.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_DATABASE_URL, DATABASE_URL, GBRAIN_BRAIN_ID (+1 more))
+test/decide/cli.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/decide/conflict-proposals.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
+test/decide/conflict-relink-handoff.serial.test.ts global-state global-state: process-wide test seams __setDecideTransportForTests, __setEmbedTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gateway
+test/decide/conflict-sweep.serial.test.ts global-state global-state: process-wide test seams __setDecideTransportForTests, __setEmbedTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
+test/decide/eval-flags.serial.test.ts R1 R1: mutates process.env (GBRAIN_DECIDE_SLOTS)
+test/decide/evidence-copack-calibration.serial.test.ts global-state global-state: process-wide test seams __setDecideTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gateway; spyOn console.log, console.error
+test/decide/grounding-slot.serial.test.ts global-state global-state: process-wide test seams __setDecideTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gateway
+test/decide/judge-agreement-cli.serial.test.ts R1 R1: mutates process.env (TYPESAFE_API_KEY, JEV_TYPESAFE_API_KEY)
+test/decide/quickstart-doc.serial.test.ts R2 R2: mock.module(../../src/core/interaction.ts) replaces modules for every file in the process
+test/decide/retrieval-search.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/decide/retrieval-think.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/decide/search-slots.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/decide/status-no-entity.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/decide/triage-slot.serial.test.ts global-state global-state: process-wide test seams __setDecideTransportForTests, __setChatTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gateway
+test/decide/turn-context-s6.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/decide/writepath-datasets.serial.test.ts global-state global-state: process-wide test seams __setDecideTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gateway; spyOn console.log, console.error, process.stdout.write
+test/decide/writepath-phase.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests, __setDecideTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gateway
+test/dispatch-response-meta.serial.test.ts R2 R2: mock.module(../src/core/search/hybrid.ts) replaces modules for every file in the process
+test/dispatch-vector-incomplete.serial.test.ts R2 R2: mock.module(../src/core/search/hybrid.ts) replaces modules for every file in the process
+test/doctor-autopilot-fanout-concurrency.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)
+test/doctor-backup-coverage.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK)
+test/doctor-connection-classified.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/doctor-early-stop-golden.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, HOME, GBRAIN_AUDIT_DIR, GBRAIN_SYNC_FAILURES_DIR (+3 more))
+test/doctor-engine-fit.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/doctor-eval-drift-branches.serial.test.ts R2 R2: mock.module(../src/core/eval/drift-watch.ts) replaces modules for every file in the process
+test/doctor-keyless.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway
+test/doctor-mode-matrix.serial.test.ts R1 R1: mutates process.env (HOME, GBRAIN_HOME, GBRAIN_AUDIT_DIR, GBRAIN_SYNC_FAILURES_DIR (+1 more))
+test/doctor-remediation-plan-observational.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/doctor-remote.serial.test.ts global-state global-state: binds local servers/ports
+test/doctor-report-remote.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/dream-drain-failure-summary.serial.test.ts R2 R2: mock.module(../src/core/cycle/extract-atoms-drain.ts) replaces modules for every file in the process
+test/dream-owner-id-threading.serial.test.ts R2 R2: mock.module(../src/core/cycle.ts) replaces modules for every file in the process
+test/dream-postgres.serial.test.ts global-state global-state: spyOn process.exit, console.error
+test/dream-synthesize-chunking.serial.test.ts R1 R1: mutates process.env (ANTHROPIC_API_KEY)
+test/embed-backfill-cli-admission.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; patches process stdout/stderr/console
+test/embed-exit-code-3037.serial.test.ts global-state global-state: binds local servers/ports
+test/embed-input-type-wire.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway
+test/embed-lock-skipped.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/embed-null-signature-warning-5527.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway; spyOn console.error
+test/embed-oversize-heal-drain.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/embed-partial-failure-3037.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/embed-quarantine.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/embed-stale-chunkless-pages.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/embed-stale-dry-run-restamp-5289.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/embed-stale-signature-pagination.serial.test.ts R1 R1: mutates process.env (GBRAIN_EMBED_CONCURRENCY)
+test/embed-stale-unavailable-snapshot.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/embed.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/embedding-completion-atomic.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests, __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/embedding-identity-companions.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; process-wide test seams __setEmbedTransportForTests, __setRerankTransportForTests; configureGateway changes the process-wide AI gateway; spyOn globalThis.fetch
+test/embedding-migration-settle.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway; spyOn console.log, console.error
+test/embedding-recovery.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/embedding-rejection-refund.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/embedding-truth-predicates.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/embedding-zero-norm-4616.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/eval-brainbench-decide.serial.test.ts R1 R1: mutates process.env (GBRAIN_DECIDE_SLOTS)
+test/eval-longmemeval-decide.serial.test.ts R1 R1: mutates process.env (GBRAIN_DECIDE_SLOTS)
+test/eval-retrieval-quality-decide.serial.test.ts R1 R1: mutates process.env (GBRAIN_DECIDE_SLOTS)
+test/eval-run-all-outcome.serial.test.ts R2 R2: mock.module(../src/commands/eval-brainbench.ts) replaces modules for every file in the process; spyOn process.stderr.write
+test/eval-takes-quality-runner.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts) replaces modules for every file in the process
+test/extract-conversation-facts-diagnostics.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests, __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway; spyOn console.log, process.exit, concurrency.resolveWorkersWithClamp, console.error (+2 more)
+test/extract-cross-source-links-db.serial.test.ts R1 R1: mutates process.env (bracket or computed key)
+test/extract-endpoint-revision.serial.test.ts global-state global-state: spyOn console.error, process.exit
+test/extract-facts-embed-unavailable.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts) replaces modules for every file in the process
+test/extract-facts-embed-warn.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts) replaces modules for every file in the process
+test/extract-include-frontmatter-config.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/facts-backstop-outcome.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, OPENAI_API_KEY, ANTHROPIC_API_KEY)
+test/facts-context-injection.serial.test.ts global-state global-state: process-wide test seams __resetHotMemoryCacheForTests
+test/facts-valid-from-context.serial.test.ts R2 R2: mock.module(../src/core/facts/extract.ts) replaces modules for every file in the process
+test/filing-rules-resolution.serial.test.ts R1 R1: mutates process.env (HOME, GBRAIN_HOME, GBRAIN_GIT_ALLOW_FILE_TRANSPORT)
+test/fix-wave-3-connector-loops.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests; configureGateway changes the process-wide AI gateway
+test/fix-wave-3-managed-embedding.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/fix-wave-5-mounted.serial.test.ts global-state global-state: binds local servers/ports
+test/foreground-chat-gateway-init.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, OPENAI_API_KEY)
+test/fresh-init-db-extract.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; patches process stdout/stderr/console
+test/fresh-install-pglite.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, VOYAGE_API_KEY, OPENAI_API_KEY)
+test/friction-diff.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_FRICTION_RUN_ID)
+test/fts-language-cache-isolation.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/fts-language-migration.serial.test.ts R1 R1: mutates process.env (bracket or computed key)
+test/fts-language-schema-replay.serial.test.ts R1 R1: mutates process.env (GBRAIN_PGLITE_SNAPSHOT)
+test/fts-language.serial.test.ts R1 R1: mutates process.env (bracket or computed key)
+test/gateway-reconfigure-clobber.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/git-remote-durable.serial.test.ts R1 R1: mutates process.env (GBRAIN_GIT_ALLOW_FILE_TRANSPORT)
+test/git-remote-pull-file-transport.serial.test.ts R1 R1: mutates process.env (GBRAIN_GIT_ALLOW_FILE_TRANSPORT)
+test/google-connect-cmd.serial.test.ts global-state global-state: spyOn console.error; patches process stdout/stderr/console
+test/google-loops-recovery.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests; configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
++test/graduation-serve-guard.serial.test.ts global-state global-state: spawns real gbrain serve children and holds GBRAIN_HOME (withEnv) across awaited CLI runs
+test/graph-query-thin-client-source-flag.serial.test.ts R2 R2: mock.module(../src/core/config.ts, ../src/core/mcp-client.ts) replaces modules for every file in the process
+test/guarded-http-tls.serial.test.ts global-state global-state: binds local servers/ports
+test/harness-delivery-recovery.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/hook-backup-notice.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK)
+test/hook-command.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_HOOKS, GBRAIN_HOOK_LANE, GBRAIN_SOURCE (+3 more))
+test/hook-writeback-stop.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_SOURCE)
+test/hybrid-adaptive-dedup-cache-plane.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/hybrid-cache-hit-limit-honors-mode.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/hybrid-cache-scope-poison.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/hybrid-cached-hit-budget-meta.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/hybrid-degraded-cache-meta.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/hybrid-exclude-private-cache-fold.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/hybrid-meta.serial.test.ts R1 R1: mutates process.env (OPENAI_API_KEY)
+test/hybrid-pool-floor.serial.test.ts R1 R1: mutates process.env (OPENAI_API_KEY)
+test/hybrid-reranker-skipped.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_AUDIT_DIR, VOYAGE_API_KEY)
+test/hybrid-salvage.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/hybrid-search-lite.serial.test.ts R1 R1: mutates process.env (OPENAI_API_KEY)
+test/hybrid-search-single-mode-read.serial.test.ts R2 R2: mock.module(../src/core/search/mode.ts) replaces modules for every file in the process
+test/hybrid-since-relative.serial.test.ts R1 R1: mutates process.env (OPENAI_API_KEY)
+test/hybrid-types-cache-skip.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/import-cancellation.serial.test.ts R2 R2: mock.module(../src/core/postgres-engine.ts) replaces modules for every file in the process
+test/import-configured-root-guard.serial.test.ts global-state global-state: spyOn engine.executeRaw
+test/import-connection-budget.serial.test.ts R2 R2: mock.module(../src/core/postgres-engine.ts) replaces modules for every file in the process
+test/import-signature-stamp.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/import-source-cr-mode.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/internal-breadth-callers.serial.test.ts R2 R2: mock.module(../src/core/search/hybrid.ts) replaces modules for every file in the process
+test/jobs-child-readiness.serial.test.ts global-state global-state: spyOn console.error
+test/jobs-embed-background-dryrun.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/jobs-embed-background-parity.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/jobs-embed-stall-wiring.serial.test.ts R2 R2: mock.module(../src/commands/embed.ts) replaces modules for every file in the process
+test/jobs-gateway-refresh.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, ANTHROPIC_API_KEY, OPENAI_API_KEY)
+test/jobs-list-get-json.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/jobs-stats-backpressure.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/jobs-stats-divergence.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/jobs-stats-private-queue.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/keyword-relaxed-fusion.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/link-reads-thin-client-5827.serial.test.ts R2 R2: mock.module(../src/core/config.ts, ../src/core/mcp-client.ts) replaces modules for every file in the process
+test/llm-intent-hybrid-integration.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests; configureGateway changes the process-wide AI gateway
+test/loops-close-fact.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests; configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
+test/loops-extract-run.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts) replaces modules for every file in the process
+test/managed-connector-routing.serial.test.ts global-state global-state: spyOn globalThis.fetch
+test/managed-unsupported-preflight.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts) replaces modules for every file in the process
+test/mcp-admin-cli.serial.test.ts global-state global-state: spyOn console.log, globalThis.fetch
+test/mcp-backup-nag.serial.test.ts R2 R2: mock.module(../src/core/search/hybrid.ts, ../src/core/search/projection-readiness.ts) replaces modules for every file in the process
+test/memorable-relay.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, MEMORABLE_BIN, GBRAIN_MEMORABLE_CONFIG, GBRAIN_MEMORABLE)
+test/memory-safety-wave.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway; binds local servers/ports
+test/migrate-embeddings-ann-deferred-5088.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/migrate-embeddings-boundary.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/migrate-embeddings-dry-run-split-5226.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway; spyOn console.log, console.error
+test/migrate-embeddings-flow.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/migrate-embeddings-hardening.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_EMBEDDING_MODEL, GBRAIN_EMBEDDING_DIMENSIONS, GBRAIN_EMBED_LOCK_HEARTBEAT_MS (+3 more))
+test/migrate-embeddings-op-contract.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_EMBEDDING_MODEL, GBRAIN_EMBEDDING_DIMENSIONS)
+test/migrate-embeddings-recovery-cli.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; process-wide test seams __setEmbedTransportForTests
+test/migrate-engine-completeness.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, DATABASE_URL, GBRAIN_DATABASE_URL)
+test/migrate-engine-page-copy-failure.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, DATABASE_URL, GBRAIN_DATABASE_URL)
+test/migrate-engine-pagination.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, DATABASE_URL, GBRAIN_DATABASE_URL)
++test/migrate-graduation-cli.serial.test.ts global-state global-state: withEnv holds GBRAIN_HOME at a temp dir (withEnv) across awaited runMigrateGraduation calls that read the file-plane opt-out
+test/migrate-quiet-replay.serial.test.ts R1 R1: mutates process.env (GBRAIN_MIGRATE_VERBOSE, GBRAIN_PGLITE_SNAPSHOT)
+test/migration-in-process.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/migration-v0-29-1.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/migrations-fresh-install-audit.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/minions/delegated-execution.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests
+test/model-config.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_MODEL, OPENAI_API_KEY)
+test/models-newer-hint.serial.test.ts R1 R1: mutates process.env (GBRAIN_MODEL)
+test/models-per-task-extract-atoms.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/models-probe-max-output-tokens.serial.test.ts global-state global-state: binds local servers/ports
+test/native-base-url-fold.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, OPENAI_BASE_URL)
+test/oauth-client-setup.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/observational-startup.serial.test.ts R2 R2: mock.module(../src/cli/commands/repair.ts) replaces modules for every file in the process
+test/openai-latest.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_MODEL_DISCOVERY)
+test/openclaw-context-engine-native.serial.test.ts global-state global-state: binds local servers/ports
+test/ops-run-onboard-scope-gate.serial.test.ts R2 R2: mock.module(../src/core/onboard/checks.ts, ../src/core/remediation/index.ts, ../src/core/onboard/render.ts) replaces modules for every file in the process
+test/page-summary-length.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)
+test/pending-write-exit.serial.test.ts global-state global-state: binds local servers/ports
+test/persistence-image-import.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/persistence-publication-native.serial.test.ts global-state global-state: platform-gated (darwin) machine integration
+test/persistence-reconnect.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/persistence-skill-bundles.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/persistence-sync-company.serial.test.ts global-state global-state: spyOn globalThis.fetch
+test/persistence-sync-failures.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; patches process stdout/stderr/console
+test/persistence-sync-options.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; process-wide test seams __setPackLocatorForTests; spyOn globalThis.setInterval
+test/pglite-engine-disconnect.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/pglite-in-memory-create-retry.serial.test.ts R2 R2: mock.module(@electric-sql/pglite) replaces modules for every file in the process
+test/pglite-reconnect.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/pglite-repair-command.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; patches process stdout/stderr/console
+test/pglite-snapshot-timezone.serial.test.ts R1 R1: mutates process.env (GBRAIN_PGLITE_SNAPSHOT)
+test/pglite-wal-repair.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; patches process stdout/stderr/console
+test/projections-drain-cli.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/put-page-push-reporting.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/query-cache-knobs-hash.serial.test.ts R1 R1: mutates process.env (GBRAIN_FTS_LANGUAGE)
+test/query-image-date-readiness.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts) replaces modules for every file in the process
+test/query-image-flag.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts) replaces modules for every file in the process
+test/query-image-mode-limit.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts) replaces modules for every file in the process
+test/query-op-limit-mode-4356.serial.test.ts R2 R2: mock.module(../src/core/search/hybrid.ts) replaces modules for every file in the process
+test/readiness-embedding-enablement.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/recall-budget-policy-thin.serial.test.ts R2 R2: mock.module(../src/core/config.ts, ../src/core/mcp-client.ts) replaces modules for every file in the process
+test/recall-thin-client-fallback.serial.test.ts R2 R2: mock.module(../src/core/config.ts, ../src/core/mcp-client.ts) replaces modules for every file in the process
+test/reconcile-owner-journey.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; binds local servers/ports
+test/reindex-code-max-cost.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway
+test/reindex-code-model-source.serial.test.ts R1 R1: mutates process.env (GBRAIN_NO_CODE_MODEL_NUDGE)
+test/reindex-code-nudge.serial.test.ts R1 R1: mutates process.env (GBRAIN_NO_CODE_MODEL_NUDGE)
+test/reindex-search-vector.serial.test.ts R1 R1: mutates process.env (bracket or computed key)
+test/reindex-trace-transparency.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/remediation-run-extras.serial.test.ts R2 R2: mock.module(../src/core/minions/queue.ts, ../src/core/minions/wait-for-completion.ts) replaces modules for every file in the process
+test/remediation-run-loop.serial.test.ts R2 R2: mock.module(../src/core/minions/queue.ts, ../src/core/minions/wait-for-completion.ts, ../src/core/remediation-checkpoint.ts, ../src/core/ai/gateway.ts) replaces modules for every file in the process
+test/remote-privacy-journeys.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; configureGateway changes the process-wide AI gateway; binds local servers/ports
+test/repair-contextual-mode-5621.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/rerank-no-key.serial.test.ts global-state global-state: process-wide test seams __setRerankTransportForTests; configureGateway changes the process-wide AI gateway
+test/schema-cli-database-path.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/schema-engine-isolation.serial.test.ts global-state global-state: spyOn engine.getConfig, engine.searchKeyword, engine.searchVector
+test/schema-pack-load-active.serial.test.ts global-state global-state: process-wide test seams __setPackLocatorForTests
+test/search-multimodal-no-embed.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway
+test/search-telemetry-cache-wiring.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/search/autocut-integration.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/search/crag-escalation-limit.serial.test.ts R2 R2: mock.module(dynamic specifier) replaces modules for every file in the process
+test/search/hybrid-reranker-integration.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_AUDIT_DIR)
+test/search/operation-expansion-contract.serial.test.ts global-state global-state: spyOn hybrid.hybridSearchCached, console.log
+test/search/output-redaction.serial.test.ts R2 R2: mock.module(../../src/core/eval-capture.ts, ../../src/core/search/hybrid.ts, ../../src/core/ai/gateway.ts, ../../src/core/think/index.ts) replaces modules for every file in the process
+test/search/relational-rerank-pin-hybrid.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/seed-pglite.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/self-upgrade-checkonly.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/serve-http-mcp-dispatch-context.serial.test.ts R2 R2: mock.module(../src/mcp/dispatch.ts) replaces modules for every file in the process
+test/serve-http-run-teardown.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/serve-idle-sweep-source.serial.test.ts R2 R2: mock.module(../src/core/sweep.ts) replaces modules for every file in the process
+test/serve-source-guard.serial.test.ts R1 R1: mutates process.env (GBRAIN_SOURCE)
+test/serve-status-mode.serial.test.ts global-state global-state: binds local servers/ports
+test/serve-sync-embed-drain.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; process-wide test seams __setEmbedTransportForTests, __resetDelegatedSyncForTests; configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
+test/serve-sync-ipc-killswitch.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; patches process stdout/stderr/console
+test/serve-sync-runner.serial.test.ts global-state global-state: process-wide test seams __resetDelegatedSyncForTests
+test/session-seat-capture.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_SEAT)
+test/shared-skills-export.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/shared-skills-init.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/shared-skills-migration-cli.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect
+test/shared-skills-optimizer.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests; spyOn fs.readFileSync, fs.lstatSync, fs.realpathSync
+test/shared-skills-restore.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll
+test/skillopt/cycle-phase-caps.serial.test.ts R2 R2: mock.module(../../src/core/skillopt/orchestrator.ts, ../../src/core/repo-root.ts) replaces modules for every file in the process
+test/skillopt/models-four-paths.serial.test.ts R2 R2: mock.module(../../src/core/skillopt/orchestrator.ts, ../../src/core/repo-root.ts) replaces modules for every file in the process
+test/skillopt/models-plan.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
+test/skillopt/run-skillopt-op.serial.test.ts R2 R2: mock.module(../../src/core/skillopt/orchestrator.ts, ../../src/core/repo-root.ts) replaces modules for every file in the process
+test/sources-push-cli.serial.test.ts R1 R1: mutates process.env (HOME, GBRAIN_HOME, GBRAIN_GIT_ALLOW_FILE_TRANSPORT)
+test/stdio-stderr-redirect.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/subagent-put-page-rejection.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests; configureGateway changes the process-wide AI gateway; spyOn putPage.handler
+test/sync-cost-gate.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console
+test/sync-default-write-guard.serial.test.ts global-state global-state: spyOn console.error, console.log, process.exit
+test/sync-delete-trailing-hyphen.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/sync-failure-ledger.serial.test.ts R1 R1: mutates process.env (HOME, GBRAIN_SYNC_AUTOSKIP_AFTER)
+test/sync-index-matches-tree.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/sync-pull-failed-anchor.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/sync-rename-reconcile.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/sync-resumable-import.serial.test.ts R1 R1: mutates process.env (GBRAIN_SYNC_CHECKPOINT_EVERY, GBRAIN_MAX_CONNECTIONS)
+test/sync-run-ordering.serial.test.ts R1 R1: mutates process.env (GBRAIN_SYNC_CHECKPOINT_EVERY, GBRAIN_SYNC_STALL_ABORT_SECONDS, GBRAIN_SYNC_CHECKPOINT_SECONDS)
+test/sync-soft-delete.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/takes-vector-lifecycle-5885.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway
+test/thin-client-write-errors.serial.test.ts global-state global-state: binds local servers/ports
+test/think-cli-source-flag.serial.test.ts R2 R2: mock.module(../src/core/think/index.ts, ../src/core/config.ts, ../src/core/source-resolver.ts) replaces modules for every file in the process
+test/think-embed-question-wiring.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts, ../src/core/think/index.ts) replaces modules for every file in the process
+test/think-extractive.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests, __setEmbedTransportForTests, __setUsageLogPathForTests
+test/think-gather-adaptive-return.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process
+test/think-gather-autocut.serial.test.ts R2 R2: mock.module(../src/core/search/hybrid.ts) replaces modules for every file in the process
+test/think-temporal-window.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests
+test/unified-multimodal.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway
+test/unsupported-embedding-identity.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnect; process-wide test seams __setEmbedTransportForTests, __setRerankTransportForTests; configureGateway changes the process-wide AI gateway
+test/upgrade-bun-link-arc.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/upgrade-no-autopilot.serial.test.ts R2 R2: mock.module(dynamic specifier) replaces modules for every file in the process
+test/upgrade-zero-provider-calls.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; configureGateway changes the process-wide AI gateway; binds local servers/ports
+test/upgrade.serial.test.ts R2 R2: mock.module(${repoRoot}src/core/binary-self-update.ts) replaces modules for every file in the process
+test/v0_28_5-fix-wave.serial.test.ts R1 R1: mutates process.env (GBRAIN_PGLITE_SNAPSHOT)
+test/v0_37_fix_wave.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_EMBEDDING_MODEL, GBRAIN_EMBEDDING_DIMENSIONS, OPENAI_API_KEY (+4 more))
+test/v0_37_gap_fill.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_NON_INTERACTIVE)
+test/worker-lock-renewal-e2e.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)
+test/worker-registry.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)
+test/workspace-push.serial.test.ts R1 R1: mutates process.env (HOME, GBRAIN_HOME, GBRAIN_GIT_ALLOW_FILE_TRANSPORT, PATH (+1 more))
+test/writeback-nudge.serial.test.ts global-state global-state: patches process stdout/stderr/console
+test/writeback-review-fixes.serial.test.ts global-state global-state: process-wide test seams __resetCheckpointHarvestForTests; patches process stdout/stderr/console
diff --cc src/core/error-registry.ts
index b9b5e635a8,f39bc9c625..b6e1a0e617
--- a/src/core/error-registry.ts
+++ b/src/core/error-registry.ts
@@@ -124,7 -124,7 +124,8 @@@ export const CODES =
embedding_unavailable: { class: 'unavailable', summary: "The provider returned an incomplete embedding batch." },
embedding_unconfigured: { class: 'host_only', summary: "The selected brain has no verifiable text embedding model and dimensions." },
embedding_width_mismatch: { class: 'caller', summary: "The embedding model cannot produce the width of the brain's vector column; nothing was changed." },
+ engine_graduated: { class: 'caller', summary: "A client opened a PGLite brain that moved to Postgres; its old path holds a tombstone.", docs: 'docs/guides/move-to-postgres.md#graduated-datastore' },
+ eval_suite_unwired: { class: 'caller', summary: "`gbrain eval run-all` was asked for a suite it does not run in-process (longmemeval or replay); nothing ran.", why: "run-all runs only wired suites (brainbench). Recording a skipped run and exiting 0 would read as a completed sweep with no numbers behind it.", suggestion: 'Run each requested suite with its own command (`gbrain eval longmemeval <dataset.jsonl> --mode <mode> --record`, `gbrain eval replay --mode <mode>`), once per mode, or drop it from --suites.' },
export_limit: { class: 'caller', summary: "This migration is bounded to 5,000 active pages per source; split or use a reviewed bulk export." },
extraction_failed: { class: 'server', summary: "The accepted atom extraction produced malformed output." },
extractor_identity_mismatch: { class: 'server', summary: "The approved extractor differs from the installed extractor; this receipt cannot resume or admit another revision." },
diff --cc templates/bootstrap/template-repo/README.md
index aa4e3f6f48,0e239d5943..54d59d26fd
--- a/templates/bootstrap/template-repo/README.md
+++ b/templates/bootstrap/template-repo/README.md
@@@ -1,6 -1,6 +1,6 @@@
# gbrain agent workspace — template
- <!-- gbrain-template-stamp: 0.60.50.0 -->
-<!-- gbrain-template-stamp: 0.60.52.0 -->
++<!-- gbrain-template-stamp: 0.60.56.0 -->
This repository is the **"Use this template"** distribution artifact for a
[gbrain](https://github.com/garrytan/gbrain) personal-agent workspace — the same
diff --cc test/fixtures/goldens/exports/types.json
index 825397963a,7b2ba02b50..83f6bc236b
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@@ -5628,7 -5629,7 +5629,7 @@@
{
"kind": "class",
"members": [
- "canonical?: \"unknown\" | \"projection_pending\" | \"timeout\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambiguous_id\" | \"ambiguous_skill\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_disabled\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"facts_absorb_write_refused\" | \"facts_payload_expired\" | \"fetch_failed\" | \"file_too_large\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graph_incomplete\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_client\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"managed_pull_skipped\" | \"method_not_allowed\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pending_writes\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"redirect_uri_mismatch\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"source_binding_required\" | \"source_id_taken\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_in_progress\" | \"sync_parser_regression\" | \"target_escape\" | \"topology_change_required\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | undefined",
- "canonical?: \"unknown\" | \"projection_pending\" | \"timeout\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambiguous_id\" | \"ambiguous_skill\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_disabled\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"facts_absorb_write_refused\" | \"facts_payload_expired\" | \"fetch_failed\" | \"file_too_large\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"graph_incomplete\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_client\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"managed_pull_skipped\" | \"method_not_allowed\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pending_writes\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"redirect_uri_mismatch\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"source_binding_required\" | \"source_id_taken\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_in_progress\" | \"sync_parser_regression\" | \"target_escape\" | \"topology_change_required\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | undefined",
++ "canonical?: \"unknown\" | \"projection_pending\" | \"timeout\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambiguous_id\" | \"ambiguous_skill\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_disabled\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"facts_absorb_write_refused\" | \"facts_payload_expired\" | \"fetch_failed\" | \"file_too_large\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"graph_incomplete\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_client\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"managed_pull_skipped\" | \"method_not_allowed\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pending_writes\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"redirect_uri_mismatch\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"source_binding_required\" | \"source_id_taken\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_in_progress\" | \"sync_parser_regression\" | \"target_escape\" | \"topology_change_required\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | undefined",
"canonicalCode: string",
"cause?: unknown",
"code: ErrorCode",
diff --cc test/helpers/operator-env-policy.ts
index e493c02a00,0000000000..ca5fc2abb9
mode 100644,000000..100644
--- a/test/helpers/operator-env-policy.ts
+++ b/test/helpers/operator-env-policy.ts
@@@ -1,78 -1,0 +1,80 @@@
+/**
+ * The operator-env scrub policy, shared by test/helpers/operator-env-preload.ts
+ * (which applies it before any test file loads) and
+ * scripts/check-test-env-opt-ins.ts (which fails on a test that gates
+ * execution on a GBRAIN_* name this policy strips). Side-effect free.
+ *
+ * Naming rule for test opt-ins: `GBRAIN_TEST_<AREA>_<WHAT>`; paid ones
+ * `GBRAIN_TEST_LIVE_<WHAT>`. The `GBRAIN_TEST_` prefix survives the scrub, so a
+ * test opt-in under it can never be silently stripped. Documented exceptions
+ * kept for compatibility: the `GBRAIN_REAL_*`, `GBRAIN_E2E_*`, `GBRAIN_CI_*`
+ * prefixes and the two `*_LIVE*` exact rows below.
+ */
+
+/** Operator/agent workspace prefixes with no test-machinery tenants. */
+export const STRIP_PREFIX = /^(CONDUCTOR_|MCP_|OPENCLAW_)/;
+
+export const KEEP_EXACT: ReadonlySet<string> = new Set([
+ 'GBRAIN_HOME', // per-run HOME isolation — gbrain-home-preload and run-e2e.sh both respect a pre-set value
+ 'GBRAIN_DATABASE_URL', // e2e DB target; database-url-guard-preload (registered first) already vetoed un-opted runs
+ 'GBRAIN_MODEL_DISCOVERY', // operator override provider-keys-preload deliberately respects
+ 'GBRAIN_PGLITE_SNAPSHOT', // schema-snapshot fast path exported by every unit runner (scripts/lib/test-env.sh)
+ 'GBRAIN_NO_SNAPSHOT', // cold-path opt-out must survive this preload and reach CLI children
+ 'GBRAIN_PGBOUNCER_URL', // explicit pooled test target supplied by ci-local
+ 'GBRAIN_PGBOUNCER_DIRECT_URL', // admin connection used to create the isolated pooler test DB
+ 'GBRAIN_COMPILED_BIN', // heavy-lane compile-once binary (agent-harness.ts ensureCompiledGbrain)
+ 'GBRAIN_AUDIT_DIR', // audit-dir-preload honors a wrapper pre-set (inspect audit output after a run)
+ 'GBRAIN_SYNC_FAILURES_DIR', // same wrapper pre-set contract in sync-failures-preload
+ 'GBRAIN_DEBUG_PRELOAD', // the preload stack's own logging hatch
++ 'GBRAIN_GRADUATION_FIXTURE_CACHE', // cache directory for the 1k/10k graduation history fixtures (scripts/persistence/graduation-fixture.ts); a location, not a behavior gate
++ 'GBRAIN_OLDER_RELEASE_DIR', // per-tag older-release binaries the graduation-clients suite builds once (test/helpers/graduation-e2e.ts)
+ // Documented exception to the GBRAIN_TEST_LIVE_* rule: paid live layer of
+ // cycle-synthesize-triage-calibration.
+ 'GBRAIN_TRIAGE_CALIBRATION_LIVE',
+ // Documented exception: opt-in keyed System One wire test
+ // (test/live/decide-typesafe.live.test.ts).
+ 'GBRAIN_LIVE_TYPESAFE',
+]);
+
+// GBRAIN_TEST_*: test-control opt-ins (ALLOW_DATABASE_URL, KEEP_PROVIDER_KEYS,
+// shard/memory knobs) must survive their own scrub or every escape hatch is a
+// dead end. GBRAIN_CI_*: ci-local.sh port plumbing. GBRAIN_E2E_*: db-guard's
+// name-floor opt-in (its error message tells operators to set it) + e2e
+// runner knobs. GBRAIN_REAL_*: heavy-lane real-agent door-suite opt-ins read
+// in-process by test/e2e/install-real-*.serial.test.ts.
+export const KEEP_PREFIX = /^GBRAIN_(TEST_|CI_|E2E_|REAL_)/;
+
+/**
+ * Test opt-ins renamed into the GBRAIN_TEST_ namespace. Under their old names
+ * the scrub deleted them before any test read them, so every opt-in below was
+ * a silent no-op. Setting an old name now stops the run with the rename line
+ * instead of skipping silently. Shell readers (scripts/check-bash32.sh) carry
+ * the same check for the names they read.
+ */
+export const RENAMED: Readonly<Record<string, string>> = {
+ GBRAIN_BASH32_REQUIRE: 'GBRAIN_TEST_BASH32_REQUIRE',
+ GBRAIN_PERF_BUDGET_MULTIPLIER: 'GBRAIN_TEST_PERF_BUDGET_MULTIPLIER',
+ GBRAIN_SKIP_SUBPROCESS_TESTS: 'GBRAIN_TEST_SKIP_SUBPROCESS',
+ GBRAIN_REQUIRE_LAUNCHD: 'GBRAIN_TEST_REQUIRE_LAUNCHD',
+ GBRAIN_SKIP_LAUNCHD_E2E: 'GBRAIN_TEST_SKIP_LAUNCHD',
+ GBRAIN_ENFORCE_E5_BUDGET: 'GBRAIN_TEST_ENFORCE_E5_BUDGET',
+ GBRAIN_REQUIRE_COMPILE: 'GBRAIN_TEST_REQUIRE_COMPILE',
+};
+
+/** Whether the scrub deletes `name` from a test process's environment. */
+export function isStripped(name: string): boolean {
+ if (STRIP_PREFIX.test(name)) return true;
+ return name.startsWith('GBRAIN_') && !KEEP_EXACT.has(name) && !KEEP_PREFIX.test(name);
+}
+
+/** The fail-fast message for an old opt-in name, or null when `name` was not renamed. */
+export function renamedOptInMessage(name: string, value: string): string | null {
+ const next = RENAMED[name];
+ if (!next) return null;
+ return [
+ `${name} was renamed to ${next}.`,
+ 'Why: test opt-ins must survive the operator-env scrub (test/helpers/operator-env-preload.ts), which deletes GBRAIN_* names outside GBRAIN_TEST_*; under the old name this opt-in was silently ignored.',
+ `Fix: unset ${name} && export ${next}=${value}`,
+ 'Docs: docs/TESTING.md#test-isolation-lint-and-helpers',
+ ].join('\n');
+}