Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(TESTING): fold P8's model guards into one section within the doc cap
garrytan7a079a8a1861
diff --git a/docs/TESTING.md b/docs/TESTING.mdindex f5b10929f7..c423b99964 100644--- a/docs/TESTING.md+++ b/docs/TESTING.md@@ -867,33 +867,19 @@ generative model: it embeds via `src/core/embedding.ts` and queues model work. F`test/fixtures/guards/check-layering.ts/`; forms are driven in`test/scripts/layering.test.ts`.-#### AI SDK importer guard--`scripts/check-ai-sdk-importers.ts` (`bun run check:ai-sdk-importers`, in-`bun run verify`) fails when a file under `src/` or `scripts/` outside-`scripts/ai-sdk-importers.allowlist` imports a provider SDK (`ai`, `@ai-sdk/*`,-`@anthropic-ai/sdk`, `openai`) as a runtime value, in any import form.-Type-only imports pass. A stale allowlist line fails, so the list only-shrinks. Every model call routes through `invokeAI`-(`src/core/ai/invocation-guard.ts`), which the write-inference tests and-`GBRAIN_AI_CALL_LOG` observe. Fixtures:-`test/fixtures/guards/check-ai-sdk-importers.ts/`; forms are driven in-`test/scripts/ai-sdk-importers.test.ts`.--#### Write-inference tests--Every mutating operation has a write-inference class-(`src/core/ops/write-inference.ts`: inline `writeInference`, else-`OP_WRITE_INFERENCE`, else `none`). `test/write-path-zero-llm.serial.test.ts`-runs each covered write surface on PGLite with chat and embedding keys set and-asserts no generative call before commit, keyword-queryability at commit, none-after commit with `facts.extraction_enabled` false, and, with it true, that-every generative call is attributed to facts extraction for the originating-request. It prints zero-generative operations that lack a runtime case.-`test/write-path-no-egress.serial.test.ts` runs real CLI writes on a keyless-brain behind a recording `HTTP(S)_PROXY` and asserts zero connections (its-first case proves the recorder works). Helper: `test/helpers/ai-tripwire.ts`-records model calls and blocks outbound fetches; tests assert on the records.+#### Write-path model guards++`scripts/check-ai-sdk-importers.ts` (in `bun run verify`) fails when a file+outside `scripts/ai-sdk-importers.allowlist` imports a provider SDK (`ai`,+`@ai-sdk/*`, `@anthropic-ai/sdk`, `openai`) as a value; stale allowlist lines+fail too, so every model call goes through `invokeAI`. Each mutating op has a+write-inference class (`src/core/ops/write-inference.ts`).+`test/write-path-zero-llm.serial.test.ts` runs the covered write surfaces with+keys set and asserts no generative call before commit, keyword recall at+commit, and only attributed facts extraction after it.+`test/write-path-no-egress.serial.test.ts` asserts keyless CLI writes open no+connection. Fixtures: `test/fixtures/guards/check-ai-sdk-importers.ts/`,+`test/helpers/ai-tripwire.ts`.#### Durable-flush guard