Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs: point current docs at the serial tests that rejoined the parallel lane (D6 renames)
garrytan5484e2811221
diff --git a/TODOS.md b/TODOS.mdindex 18415220a2..64302551f7 100644--- a/TODOS.md+++ b/TODOS.md@@ -520,7 +520,7 @@ Evidence for each item is in `docs/test-audit/2026-09-29/`.## Community fix wave follow-ups (filed 2026-09-09)- [ ] **P3 — new v0.49/v0.50 tests assume `os.tmpdir()` is already a realpath (macOS `/var` vs `/private/var`).**- **What:** `test/agent-install.test.ts`, `test/harness-install-ownership.test.ts`, `test/harness-onboarding.test.ts`, `test/init-mcp-only.test.ts`, `test/minions-submission-authority.test.ts`, `test/harness-access.serial.test.ts` and `test/harness-delivery-recovery.serial.test.ts` fail on macOS with "Refusing a symlink in managed path: /var" / "Source file escapes registered root" while the same files pass on Linux CI — the fixtures build paths under `os.tmpdir()` (a symlink on macOS) and the managed-path / registered-root guards compare against realpaths. **Why:** every local and Mac-mini run of the suite now carries 19 red tests that are not defects, which hides real regressions (the v0.50.1.0 ship had to classify them by re-running on a clean master checkout). **Fix:** `realpathSync(os.tmpdir())` in those fixtures (the `upgrade-bun-link-arc` e2e has the same gap). **Effort:** S. **Priority:** P3.+ **What:** `test/agent-install.test.ts`, `test/harness-install-ownership.test.ts`, `test/harness-onboarding.test.ts`, `test/init-mcp-only.test.ts`, `test/minions-submission-authority.test.ts`, `test/harness-access.test.ts` and `test/harness-delivery-recovery.serial.test.ts` fail on macOS with "Refusing a symlink in managed path: /var" / "Source file escapes registered root" while the same files pass on Linux CI — the fixtures build paths under `os.tmpdir()` (a symlink on macOS) and the managed-path / registered-root guards compare against realpaths. **Why:** every local and Mac-mini run of the suite now carries 19 red tests that are not defects, which hides real regressions (the v0.50.1.0 ship had to classify them by re-running on a clean master checkout). **Fix:** `realpathSync(os.tmpdir())` in those fixtures (the `upgrade-bun-link-arc` e2e has the same gap). **Effort:** S. **Priority:** P3.- [ ] **P2 — `delta`: fetch facts oldest-first with an overflow flag instead of a newest-first `limit: 50` window.****What:** `src/core/context/turn-context.ts` fetches delta facts with `listFactsSince(..., { limit: 50 })` ordered `created_at DESC` and never sets `has_more` for facts, so more than 50 new facts since the cursor silently drop the OLDEST ones as the page cursor advances past them. **Why:** the v0.50.1.0 pre-landing review found it while simplifying the delta cursor; the fix is an ascending keyset fetch plus `has_more` when the window is full (an engine-options change, so it was left out of the wave). **Effort:** M. **Priority:** P2.- [ ] **P2 — `session_context_state` cursor upsert: GREATEST, not COALESCE.**@@ -3052,7 +3052,7 @@ explicitly scoped OUT with a one-line rationale — none is a bug, all are addit- [ ] **P3 — Extract a shared `seedBrain` test helper.** The keyless-PGLite +tmp-HOME + shimmed-PATH setup is duplicated between`test/autopilot-launchd-lifecycle.serial.test.ts` and- `test/agent-scheduler-contract.serial.test.ts` (review-army maintainability+ `test/agent-scheduler-contract.test.ts` (review-army maintainabilityfinding). A third harness-e2e file (the PR-B tier) should force theextraction into `test/helpers/`; don't extract before then — two instancesis a coincidence, three is a pattern.@@ -3078,12 +3078,12 @@ explicitly scoped OUT with a one-line rationale — none is a bug, all are addit(INSTALL_FOR_AGENTS.md Step 7) runs `gbrain dream` unconditionally, and the cycle'sembed phase hits the same `EmbeddingDisabledError` class that broke the documentedsync-and-embed chain on keyless brains (fixed in `runEmbed` for the `--stale`- spelling; `test/agent-scheduler-contract.serial.test.ts` pins it). Nobody has verified that a+ spelling; `test/agent-scheduler-contract.test.ts` pins it). Nobody has verified that afull keyless dream exits 0 — if any phase surfaces the disabled-embeddings error as aphase failure, the documented nightly cron is broken identically for every`init --no-embedding` install. **Where to start:** `src/core/cycle.ts` embed phase +`src/commands/dream.ts` exit-code handling; test shape mirrors- `test/agent-scheduler-contract.serial.test.ts` (keyless PGLite brain, real CLI spawn, exit-code+ `test/agent-scheduler-contract.test.ts` (keyless PGLite brain, real CLI spawn, exit-codeassertion). Surfaced by the harness-e2e outside-voice review.## BrainBench follow-ups (filed v0.44.0.0, Cathedral 2)@@ -6015,7 +6015,7 @@ contributor traps.- [ ] **NEW-1 (P2) — Per-check leaf unit tests for the 20+ exported doctor check functions.** `src/commands/doctor.ts:169-1492` exports whoknowsHealthCheck, takesWeightGridCheck, childTableOrphansCheck, checkRerankerHealth, checkBrainstormHealth, checkSearchMode, checkEvalDrift, checkSyncFreshness, checkAbandonedThreads, checkCalibrationFreshness, checkGradeConfidenceDrift, checkVoiceGateHealth, checkEmbeddingWidthConsistency, checkSourceRoutingHealth, checkOauthConfidentialHealth, checkAutopilotLockScope, skillBrainFirstCheck. v0.40.8.0 covers them via the orchestrator only. Parameterize a single `test/doctor-leaves.test.ts` over the exported functions; each case seeds the minimum DB state and asserts the returned `Check.status`. Catches per-check render bugs the orchestrator snapshot can't see (codex CMT-2 deep fix). Estimated ~4h CC.- [ ] **NEW-2 (P2) — Cycle-phase wrappers beyond lint + backlinks.** 7 more phases need result-mapping coverage: sync, extract, embed, orphans, extract_facts, resolve_symbol_edges, recompute_emotional_weight. Each adds a describe block to `test/cycle-legacy-phases.test.ts` following the established pattern. ~30min/phase with CC. Mechanical follow-through.- [ ] **NEW-3 (P2) — HTTP-level trust-boundary test that proves serve-http.ts honors the filter at runtime.** v0.40.8.0 ships the source-grep guard at `scripts/check-operations-filter-bypass.sh` plus structural assertions in `test/operations-trust-boundary.test.ts`. The codex CMT-3 strongest defense — runtime proof that a register-OAuth-client → attempt-call-every-localOnly-op flow rejects every one — would extend `test/e2e/serve-http-oauth.test.ts`. Real Postgres dep, ~30s wallclock per case. Closes the bypass class with runtime proof in addition to the existing structural defense.-- [ ] **NEW-4 (P3) — Render function extraction from runDoctor.** v0.40.8.0 uses a subprocess smoke at `test/doctor-cli-smoke.serial.test.ts` to cover the wrapper's render + exit paths. Pulling the human + JSON render code out into pure formatters would let that smoke move back into the parallel fast loop with no subprocess overhead. ~2h CC. Lower priority — the subprocess smoke does its job; this is a wallclock win, not a coverage win.+- [ ] **NEW-4 (P3) — Render function extraction from runDoctor.** v0.40.8.0 uses a subprocess smoke at `test/doctor-cli-smoke.test.ts` to cover the wrapper's render + exit paths. Pulling the human + JSON render code out into pure formatters would let that smoke move back into the parallel fast loop with no subprocess overhead. ~2h CC. Lower priority — the subprocess smoke does its job; this is a wallclock win, not a coverage win.## v0.41+ master flake follow-ups (filed during v0.40.8.0 ship)@@ -6036,7 +6036,7 @@ contributor traps.## Pre-existing flake on master (noticed during v0.40.4 ship)-- [x] **`test/search/embedding-column.test.ts:466,489,522` — `isCacheSafe` returns false when run after gateway-state-mutating siblings in shard 2.** DONE: closed by option (c) — the file was renamed to `test/search/embedding-column.serial.test.ts` in `ca68633f` (v0.41.2.0), giving it its own bun process; entry left open pointed at a filename that no longer exists. If the file is ever un-quarantined, add `beforeEach(() => resetGateway())` (NOT `__unconfigureGatewayForTests` — that falls through to the retired provider/1280 defaults; `resetGateway` re-applies the preload's OpenAI/1536 baseline). Original filing: Confirmed pre-existing on master (`git stash` + `SHARD=2/8 bash scripts/run-unit-shard.sh` reproduces 3 fails on a clean working tree). Symptom: `isCacheSafe(default-named-column, empty-cfg)` expects `gwDims=1536` but reads `1280` (the post-v0.37.11.0 retired hosted provider default). Some test in the shard before embedding-column.test.ts initializes the gateway with the PGLite-default retired hosted provider/1280 config and leaves it that way. Either: (a) embedding-column.test.ts grows a `beforeEach` that calls `__setEmbedTransportForTests`-style reset, (b) the offending sibling adds an `afterAll(reset)`, or (c) embedding-column.test.ts becomes `*.serial.test.ts` to quarantine. Three test files in shard 2 touch gateway state via PGLite engine connects: `restart-sweep.test.ts`, `init-mode-picker.test.ts`, `doctor.test.ts`. Tests pass in isolation (50/50); only fail under shard-2 ordering. v0.40.4 ships through this flake — not introduced by the wave.+- [x] **`test/search/embedding-column.test.ts:466,489,522` — `isCacheSafe` returns false when run after gateway-state-mutating siblings in shard 2.** DONE: closed by option (c) — the file was renamed to `test/search/embedding-column.test.ts` in `ca68633f` (v0.41.2.0), giving it its own bun process; entry left open pointed at a filename that no longer exists. If the file is ever un-quarantined, add `beforeEach(() => resetGateway())` (NOT `__unconfigureGatewayForTests` — that falls through to the retired provider/1280 defaults; `resetGateway` re-applies the preload's OpenAI/1536 baseline). Original filing: Confirmed pre-existing on master (`git stash` + `SHARD=2/8 bash scripts/run-unit-shard.sh` reproduces 3 fails on a clean working tree). Symptom: `isCacheSafe(default-named-column, empty-cfg)` expects `gwDims=1536` but reads `1280` (the post-v0.37.11.0 retired hosted provider default). Some test in the shard before embedding-column.test.ts initializes the gateway with the PGLite-default retired hosted provider/1280 config and leaves it that way. Either: (a) embedding-column.test.ts grows a `beforeEach` that calls `__setEmbedTransportForTests`-style reset, (b) the offending sibling adds an `afterAll(reset)`, or (c) embedding-column.test.ts becomes `*.serial.test.ts` to quarantine. Three test files in shard 2 touch gateway state via PGLite engine connects: `restart-sweep.test.ts`, `init-mode-picker.test.ts`, `doctor.test.ts`. Tests pass in isolation (50/50); only fail under shard-2 ordering. v0.40.4 ships through this flake — not introduced by the wave.## v0.40.4 graph signals — deferred follow-ups (v0.41+)@@ -6204,7 +6204,7 @@ contributor traps.## dreamy-thompson wave follow-ups (v0.36.x)-- [ ] **v0.36.x: runThink full rewrite — drop ThinkLLMClient indirection.** v0.36's fix(think) wave landed a gateway-backed adapter at `src/core/think/index.ts:225-251` so `gbrain config set anthropic_api_key` works over MCP stdio (closed #952). The adapter routes through `gateway.chat()` but `runThink` still carries the `ThinkLLMClient` interface as the test seam — it's the last LLM-using path that doesn't use the canonical `__setChatTransportForTests` seam v0.31.12 established for chat/embed. Cleanup: drop `ThinkLLMClient`, drop the `opts.client` injection point, migrate the 12+ existing tests (`test/think-pipeline.serial.test.ts:144,181,222`, `test/think-gateway-adapter.test.ts`, plus 9+ others that stub the interface) to `__setChatTransportForTests`. Pros: codebase consistency, one fewer test-stub pattern, easier to add provider switching for think once it routes through gateway natively. Cons: 12+ test files need migration. Blocked by: v0.36 wave landing on master (so the adapter exists to lean on while migrating tests). Plan reference: D5 + D7 in `~/.claude/plans/ok-i-spun-up-dreamy-thompson.md`.+- [ ] **v0.36.x: runThink full rewrite — drop ThinkLLMClient indirection.** v0.36's fix(think) wave landed a gateway-backed adapter at `src/core/think/index.ts:225-251` so `gbrain config set anthropic_api_key` works over MCP stdio (closed #952). The adapter routes through `gateway.chat()` but `runThink` still carries the `ThinkLLMClient` interface as the test seam — it's the last LLM-using path that doesn't use the canonical `__setChatTransportForTests` seam v0.31.12 established for chat/embed. Cleanup: drop `ThinkLLMClient`, drop the `opts.client` injection point, migrate the 12+ existing tests (`test/think-pipeline.test.ts:144,181,222`, `test/think-gateway-adapter.test.ts`, plus 9+ others that stub the interface) to `__setChatTransportForTests`. Pros: codebase consistency, one fewer test-stub pattern, easier to add provider switching for think once it routes through gateway natively. Cons: 12+ test files need migration. Blocked by: v0.36 wave landing on master (so the adapter exists to lean on while migrating tests). Plan reference: D5 + D7 in `~/.claude/plans/ok-i-spun-up-dreamy-thompson.md`.- [ ] **v0.36.x: Supabase parity test fixture for `applyForwardReferenceBootstrap`.** v0.36 fixed the underlying bug (bootstrap now uses the DDL connection from `initSchema` so probes run inside the advisory-lock scope) per codex P1 from /ship adversarial review. What remains is the TEST FIXTURE that proves it: the new pre-v18/pre-v34/pre-v60 E2E tests run against local Docker Postgres but not against Supabase-shape pooler topology (transaction pooler + statement_timeout). Real Supabase upgrades have failed multiple times on this exact connection-topology divergence (#699, #820 lineage). Fix: a test fixture that exercises the probe path against deriveDirectUrl + transaction pooler + statement_timeout. Cons: requires Supabase fixture infra OR careful mocking of the connection-selection logic in `db.ts`'s `getDDLConnection` path.@@ -6911,7 +6911,7 @@ The repo already has the right helper: `test/helpers/reset-pglite.ts` exports `rTwo flakes already known and quarantined as `*.serial.test.ts` (run after parallel pass at `--max-concurrency=1`):- `test/brain-registry.serial.test.ts` (was `brain-registry.test.ts`)-- `test/reconcile-links.serial.test.ts` (was `reconcile-links.test.ts`)+- `test/reconcile-links.test.ts` (was `reconcile-links.test.ts`)After the sweep, both should be fixable and renameable back to plain `*.test.ts`.@@ -7231,7 +7231,7 @@ purpose; needs baseline-governance care per the BrainBench gate rules.### Non-tier-1 e2e files run in no required CI lane**Priority:** P2-**What:** Unit shards exclude `test/e2e/*` (`scripts/test-shard.sh`), and `.github/workflows/e2e.yml` runs only explicitly named files (a handful across its jobs — e.g. `test/e2e/mechanical.test.ts`, `test/e2e/mcp.test.ts`, the jsonb-parity pair); there is no glob. Every other `test/e2e/*.test.ts` — including PGLite-only files that need no `DATABASE_URL`, like `init-fresh-pglite.test.ts` — executes only when someone runs `bun run test:e2e` by hand. Decide per file: wire into a required workflow, re-home PGLite-only files to the serial lane (the pattern `test/init-picker-pty.serial.test.ts` uses), or explicitly document them as manual-only.+**What:** Unit shards exclude `test/e2e/*` (`scripts/test-shard.sh`), and `.github/workflows/e2e.yml` runs only explicitly named files (a handful across its jobs — e.g. `test/e2e/mechanical.test.ts`, `test/e2e/mcp.test.ts`, the jsonb-parity pair); there is no glob. Every other `test/e2e/*.test.ts` — including PGLite-only files that need no `DATABASE_URL`, like `init-fresh-pglite.test.ts` — executes only when someone runs `bun run test:e2e` by hand. Decide per file: wire into a required workflow, re-home PGLite-only files to the serial lane (the pattern `test/init-picker-pty.test.ts` uses), or explicitly document them as manual-only.**Status (2026-09-29 test audit):** partly stale. Every `test/e2e` file now runs in the nightly `coverage-full-e2e` glob, and PRs run the diff-selected set (`scripts/select-e2e.ts`, falling back to all files on unmapped changes). What remains is re-homing PGLite-only files so they run on every PR regardless of the diff; that is the test-reduction plan's lane-move pilot (see the PGLite-only lane entry above).@@ -7244,7 +7244,7 @@ purpose; needs baseline-governance care per the BrainBench gate rules.### Ctrl-D during `gbrain init` stalls 60s at the next prompt (readLineSafe does not latch EOF)**Priority:** P2-**What:** Pressing Ctrl-D at the interactive provider picker is detected immediately (keyless fallback in ~200ms), but Bun's stdin never yields another line after EOF while `isTTY` stays true — so the SUBSEQUENT search-mode picker sits its full 60s `readLineSafe` fallback before init completes (probed under a real PTY: keyless notice at 0.2s, mode prompt rendered at 1.2s, exit at 61.1s). Fix: `readLineSafe` (src/commands/init.ts) should latch EOF — once stdin has ended, later calls return their default immediately instead of waiting out the timer. Regression test: extend the EOF case in `test/init-picker-pty.serial.test.ts` to run init to completion and assert exit well under the fallback window (the case currently closes early on purpose to keep the 60s stall out of required CI — see the comment there).+**What:** Pressing Ctrl-D at the interactive provider picker is detected immediately (keyless fallback in ~200ms), but Bun's stdin never yields another line after EOF while `isTTY` stays true — so the SUBSEQUENT search-mode picker sits its full 60s `readLineSafe` fallback before init completes (probed under a real PTY: keyless notice at 0.2s, mode prompt rendered at 1.2s, exit at 61.1s). Fix: `readLineSafe` (src/commands/init.ts) should latch EOF — once stdin has ended, later calls return their default immediately instead of waiting out the timer. Regression test: extend the EOF case in `test/init-picker-pty.test.ts` to run init to completion and assert exit well under the fallback window (the case currently closes early on purpose to keep the 60s stall out of required CI — see the comment there).**Why:** A user who hits Ctrl-D at the first prompt stares at a frozen screen for a full minute before init finishes. Cross-model adversarial review finding (Codex), confirmed by a real-PTY probe.@@ -8789,7 +8789,7 @@ respective shapes. Small, mechanical; pinned by `test/init-embed-check.test.ts`hoist pglite out of gbrain's node_modules on upgrade and the eagerrepo-relative imports crashed every command at module load; tier 2 derivesthe dist dir via module resolution (pinned by- `test/pglite-hoisted-install.serial.test.ts`). Guarded by `scripts/check-pglite-embedded.sh`+ `test/pglite-hoisted-install.test.ts`). Guarded by `scripts/check-pglite-embedded.sh`(compiles a smoketest and asserts a real PGLite query round-trips), wired into`bun run verify` + `check:all` + `check:pglite-embedded`. The real-agent e2eharness (`test/helpers/agent-harness.ts`) now resolves to the fast compileddiff --git a/docs/TESTING.md b/docs/TESTING.mdindex 92c45c4daa..cb10969bad 100644--- a/docs/TESTING.md+++ b/docs/TESTING.md@@ -1,6 +1,6 @@# Testing (gbrain repo)-`test/local-install-lifecycle.serial.test.ts` exercises isolated Bun-link install,+`test/local-install-lifecycle.test.ts` exercises isolated Bun-link install,keyless memory write/read/search, process reopen and migration/post-upgrade withservice-command tripwires. `test/e2e/grandfather-projection-postgres.test.ts`checks guarded metadata-only grandfathering, duplicate source slugs, preserved@@ -1667,7 +1667,7 @@ Four escalating tools; reach for the cheapest one that answers the question:|---|---|---|| Does the TTY/non-TTY branch logic pick right? | Inject `isTTY` into the pure function — no subprocess | `test/init-provider-picker.test.ts`, `test/jobs-watch-mode.test.ts` || Does the real CLI behave right when stdin is NOT a terminal? | Spawn the CLI with piped/ignored stdio | `test/cli-stdin-hang.test.ts` (fast loop); `test/init-fresh-pglite.slow.test.ts` (slow lane) |-| Does the real CLI render menus and read typed input under a REAL terminal? | `launchTty` from `test/helpers/tty-harness.ts` in a `*.serial.test.ts` file | `test/init-picker-pty.serial.test.ts` |+| Does the real CLI render menus and read typed input under a REAL terminal? | `launchTty` from `test/helpers/tty-harness.ts` in a `*.serial.test.ts` file | `test/init-picker-pty.test.ts` || How does the install FEEL (stalls, copy, silence windows)? | `scripts/dx-explore.ts` — instrument, not a test; nothing asserts | transcripts under `.context/dx-runs/` (see `docs/guides/bootstrap.md`) |Real-PTY test rules: put the file in the serial lane (`*.serial.test.ts` — that@@ -1918,12 +1918,12 @@ Unit tests and what they cover:- `test/cli-pipe-truncation.test.ts` — real-CLI pipe completeness, implementation-agnostic: the actual CLI run the way agents run it (piped stdout) produces complete, parseable, byte-stable `--tools-json` output and exits deliberately, well under the teardown backstop. Synthetic flush-mechanism coverage stays in `test/flush-then-exit-harness.test.ts`.- `test/volunteer-context.test.ts` — push-based context core, hermetic in-memory PGLite: `parseWindow` lenient `user:`/`assistant:` parsing, multi-turn window extraction, confidence-gated volunteering (arm confidences, multi-turn/newest-turn boosts, `min_confidence` gate, max-pages cap), slug-only suppression, privacy (rationales are deterministic templates; synopses pass the takes/facts fence), and the approximate usage-stats join.- `test/watch-command.test.ts` — `gbrain watch` push transport: streaming loop, rolling window, session dedupe, `--json` JSONL shape, `channel: 'watch'` event logging, clean EOF return. Hermetic PGLite + injected line/write deps (no subprocess, no real stdin).-- `test/watch-sigint.serial.test.ts` — `gbrain watch` SIGINT lifecycle against a real spawned CLI subprocess with a tmpdir brain. SERIAL: parallel unit shards flake on concurrent subprocess spawns (same rationale as `apply-migrations-pglite-spawn.serial.test.ts`).-- `test/init-picker-pty.serial.test.ts` — the interactive `gbrain init` pickers (embedding-provider + search-mode) driven under a REAL pseudo-terminal via `launchTty`: typed input lands (a NON-default mode choice verified by a follow-up non-TTY config read — bare Enter and the `readLineSafe` timeout both resolve to defaults, so a defaults-asserting test would pass with dead input), prompt-to-acknowledgement gaps bounded well under the fallback window, plus the Ctrl-D/EOF keyless fallback. On CI, missing PTY support fails loud instead of skipping. Hermetic: HOME + GBRAIN_HOME at a temp root, pass-through auth keys stripped via `dropEnv`; `session.close()` in `finally`. Serial: PTY spawn + full PGLite bootstrap, and the serial lane is what runs in required CI.+- `test/watch-sigint.test.ts` — `gbrain watch` SIGINT lifecycle against a real spawned CLI subprocess with a tmpdir brain. SERIAL: parallel unit shards flake on concurrent subprocess spawns (same rationale as `apply-migrations-pglite-spawn.serial.test.ts`).+- `test/init-picker-pty.test.ts` — the interactive `gbrain init` pickers (embedding-provider + search-mode) driven under a REAL pseudo-terminal via `launchTty`: typed input lands (a NON-default mode choice verified by a follow-up non-TTY config read — bare Enter and the `readLineSafe` timeout both resolve to defaults, so a defaults-asserting test would pass with dead input), prompt-to-acknowledgement gaps bounded well under the fallback window, plus the Ctrl-D/EOF keyless fallback. On CI, missing PTY support fails loud instead of skipping. Hermetic: HOME + GBRAIN_HOME at a temp root, pass-through auth keys stripped via `dropEnv`; `session.close()` in `finally`. Serial: PTY spawn + full PGLite bootstrap, and the serial lane is what runs in required CI.- `test/tty-harness.test.ts` — the real-PTY harness's pure helpers (`stripAnsi`, `computeStalls`, `renderStallsReport`, `parseDriveCommand`, `buildClaudeTuiSeed`) with zero subprocesses; the file's live-PTY smokes are `describe.skipIf(!ptySupported())`-gated.- `test/autopilot-launchd-lifecycle.serial.test.ts` — autopilot lifecycle behavior, not generated-string assertions: the full install → self-disable → status → reinstall → uninstall arc with `launchctl` replaced by an argv recorder and the generated wrapper executed by a REAL bash against a genuinely deleted repo (every platform), plus a darwin-only fail-SKIP describe against the real launchd under a per-run unique label (`GBRAIN_AUTOPILOT_LABEL`) so it can never collide with — or tear down — a real install on the host. Serial: spawns subprocesses and pins HOME/GBRAIN_HOME for the whole file.- `test/autopilot-fanout.test.ts` — Autopilot fan-out and policy pins: targeted idempotency keys reopen per dispatch interval while stable doctor/remediate keys remain unchanged; the 60-minute full-cycle floor wins with a remaining small plan, and an all-fresh restart check advances the process-local clock without masking failed stale-source submissions.-- `test/agent-scheduler-contract.serial.test.ts` — the documented external agent-scheduler shell chain (`gbrain sync --repo X && gbrain embed --stale`, live-sync.md / INSTALL_FOR_AGENTS.md Step 7) driven end-to-end through a real `/bin/sh` against a keyless PGLite brain: the `&&` short-circuit IS the contract (argv arrays can't exercise it), the keyless bare stale embed exits 0, and the pull-failure case that must break the chain does. Anti-vacuity: the fixture commits a real page and every read-back asserts pages >= 1. Serial: real spawned CLI + tmpdir HOME.+- `test/agent-scheduler-contract.test.ts` — the documented external agent-scheduler shell chain (`gbrain sync --repo X && gbrain embed --stale`, live-sync.md / INSTALL_FOR_AGENTS.md Step 7) driven end-to-end through a real `/bin/sh` against a keyless PGLite brain: the `&&` short-circuit IS the contract (argv arrays can't exercise it), the keyless bare stale embed exits 0, and the pull-failure case that must break the chain does. Anti-vacuity: the fixture commits a real page and every read-back asserts pages >= 1. Serial: real spawned CLI + tmpdir HOME.- `test/cli-format-volunteer.test.ts` — `formatResult`'s `volunteer_context` human rendering: pointer lines with confidence/arm/rationale, the empty-result message, the approximate stats summary.- `test/config.test.ts` — config redaction.- `test/files.test.ts` — MIME/hash.diff --git a/docs/architecture/pack-upgrade-mechanism.md b/docs/architecture/pack-upgrade-mechanism.mdindex 43ea82889f..2d9b288bd7 100644--- a/docs/architecture/pack-upgrade-mechanism.md+++ b/docs/architecture/pack-upgrade-mechanism.md@@ -113,7 +113,7 @@ that tuple lights up the `pack_upgrade_available` onboard check.Implementation: `_versionRangeMatches(version, range)` in`src/core/schema-pack/load-active.ts`. Pinned by-`test/schema-pack-find-pack-successors.serial.test.ts`.+`test/schema-pack-find-pack-successors.test.ts`.## findPackSuccessors discoverydiff --git a/docs/guides/bootstrap.md b/docs/guides/bootstrap.mdindex 4ed7f2c518..37351f0f41 100644--- a/docs/guides/bootstrap.md+++ b/docs/guides/bootstrap.md@@ -418,7 +418,7 @@ burst with a millisecond timestamp, so unnecessary pauses become a measurableartifact (`computeStalls` → `stalls.md`) instead of a vibe. Same hermetic env as`agent-harness.ts`; pure helpers are unit-tested in `test/tty-harness.test.ts`(zero subprocesses, PTY smokes self-skip where `terminal:` is unavailable).-The harness itself also backs one required-CI test: `test/init-picker-pty.serial.test.ts`+The harness itself also backs one required-CI test: `test/init-picker-pty.test.ts`asserts the interactive `gbrain init` pickers under a real PTY (see theTTY decision table in `docs/TESTING.md`). The DX-exploration layer below staysan instrument — nothing in it asserts.diff --git a/docs/guides/harness-validation.md b/docs/guides/harness-validation.mdindex d2f2f6d314..5a7f261aac 100644--- a/docs/guides/harness-validation.md+++ b/docs/guides/harness-validation.md@@ -92,7 +92,7 @@ Run from a development checkout with dependencies installed:```bashbun test --timeout 60000 test/agent-install-backup.serial.test.ts \- test/harness-access.serial.test.ts test/harness-delivery-recovery.serial.test.ts \+ test/harness-access.test.ts test/harness-delivery-recovery.serial.test.ts \test/harness-install-ownership.test.ts test/harness-verification-uncertainty.test.ts```diff --git a/docs/guides/repair.md b/docs/guides/repair.mdindex 82309026c5..8d1a130a1e 100644--- a/docs/guides/repair.md+++ b/docs/guides/repair.md@@ -586,7 +586,7 @@ safe ones."* or *"After the upgrade my notes source was blocked by one brokenfile. Get it syncing again."*The session below is real output (volatile ids, hashes and times shown as-`<id>`, `<hash>`, `<time>`; `test/held-files-walkthrough.serial.test.ts` runs+`<id>`, `<hash>`, `<time>`; `test/held-files-walkthrough.test.ts` runsthese commands and checks every line shown). Before the upgrade, a generatorcommitted three notes to the `notes` source: `notes/standup.md` with a titlethat continues on an unquoted line, a new `notes/digest.md` with `title:`diff --git a/llms-full.txt b/llms-full.txtindex 73a24b4b27..bf63b87dd2 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -11046,7 +11046,7 @@ safe ones."* or *"After the upgrade my notes source was blocked by one brokenfile. Get it syncing again."*The session below is real output (volatile ids, hashes and times shown as-`<id>`, `<hash>`, `<time>`; `test/held-files-walkthrough.serial.test.ts` runs+`<id>`, `<hash>`, `<time>`; `test/held-files-walkthrough.test.ts` runsthese commands and checks every line shown). Before the upgrade, a generatorcommitted three notes to the `notes` source: `notes/standup.md` with a titlethat continues on an unquoted line, a new `notes/digest.md` with `title:`