Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

guards: self-test fixtures for seven scanner guards; privacy guard covers evals/ and docs/test-audit/ (F9, V-12, E4)

garrytanefe204ec16e6
diff --git a/docs/test-audit/2026-09-29/implementation/rewrites.md b/docs/test-audit/2026-09-29/implementation/rewrites.md
index e12dd9808c..b09e5bdb01 100644
--- a/docs/test-audit/2026-09-29/implementation/rewrites.md
+++ b/docs/test-audit/2026-09-29/implementation/rewrites.md
@@ -220,7 +220,7 @@ Also reported stale but NOT from this slice (already stale at HEAD): `distributi
## Commands run
-- `bash ~/.capy/drive/user-garry-tan/skills/gstack/scripts/install.sh --check` → failed (not installed); installer run → "Claude skills, GPT-6 Astra skills, and Chromium are ready"
+- `bash ~/.capy/drive/<user>/skills/gstack/scripts/install.sh --check` → failed (not installed); installer run → "Claude skills, GPT-6 Astra skills, and Chromium are ready"
- `bun install --frozen-lockfile` → OK
- each touched file alone: handlers 12/0, core/cycle.serial 41/0, phantom-redirect 42/0, asymmetric-encoding-contract 4/0, regression-strict-source-id 5/0, cycle-pack-gating 8/0, cycle-patterns 11/0, cli 20/0, upgrade.serial 25/0, extract-conversation-facts-diagnostics.serial 8/0
- `bun run typecheck` → clean
diff --git a/evals/embedding-provider-eval.json b/evals/embedding-provider-eval.json
deleted file mode 100644
index 65409a2919..0000000000
--- a/evals/embedding-provider-eval.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "version": 1,
- "description": "Embedding provider smoke test — verifies semantic search returns expected results for known brain content. Run after any embedding model change or migration.",
- "queries": [
- {
- "id": "yc-labs-strategy",
- "query": "YC Labs strategy and product team",
- "relevant": [
- "originals/yc-labs-internal-team",
- "originals/harj-yc-labs-strategy-2026-05"
- ]
- },
- {
- "id": "garry-tan-person",
- "query": "Who is Garry Tan",
- "relevant": [
- "people/garry-tan"
- ]
- },
- {
- "id": "gstack-project",
- "query": "GStack open source AI coding framework",
- "relevant": [
- "projects/gstack/gstackbrain"
- ]
- },
- {
- "id": "yc-carry-compensation",
- "query": "GP carry and compensation structure at YC",
- "relevant": [
- "originals/harj-yc-labs-strategy-2026-05"
- ]
- },
- {
- "id": "meeting-search",
- "query": "recent office hours meeting notes",
- "relevant": []
- }
- ]
-}
diff --git a/package.json b/package.json
index 2a7fb8eace..096ab4464b 100644
--- a/package.json
+++ b/package.json
@@ -124,7 +124,6 @@
"check:conversation-parser": "bun src/cli.ts eval conversation-parser test/fixtures/conversation-formats/all.jsonl --no-llm",
"check:eval-chronicle": "bun src/cli.ts eval chronicle",
"check:eval-canary": "bun run scripts/run-eval-canary.ts",
- "check:pagetype-exhaustive": "bash scripts/check-pagetype-exhaustive.sh",
"check:pg-url-redaction": "bash scripts/check-pg-url-redaction.sh",
"check:source-scope-onboard": "bash scripts/check-source-scope-onboard.sh",
"check:getpage-scope": "node scripts/check-getpage-scoped-write.mjs",
diff --git a/scripts/check-batch-audit-site.sh b/scripts/check-batch-audit-site.sh
index 5848f52744..dff2e04bd4 100755
--- a/scripts/check-batch-audit-site.sh
+++ b/scripts/check-batch-audit-site.sh
@@ -14,9 +14,11 @@
# Usage: scripts/check-batch-audit-site.sh
# Exit: 0 when every literal matches the enum, 1 otherwise.
+# Seam: GBRAIN_GUARD_ROOT (fixture tree root).
+
set -euo pipefail
-ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
+ROOT="${GBRAIN_GUARD_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
cd "$ROOT"
RETRY_FILE="src/core/retry.ts"
diff --git a/scripts/check-fixture-privacy.sh b/scripts/check-fixture-privacy.sh
index c2fca76d16..5bd9a2be0e 100755
--- a/scripts/check-fixture-privacy.sh
+++ b/scripts/check-fixture-privacy.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
-# v0.41.13.0 — Privacy guard for test/fixtures/conversation-formats/.
+# v0.41.13.0 — Privacy guard for committed fixtures, eval corpora and audit
+# evidence: test/fixtures/conversation-formats/, test/fixtures/transcripts/,
+# evals/ and docs/test-audit/.
#
# Per CLAUDE.md privacy rule: "Never reference real people, companies,
# funds, or private agent names in any public-facing artifact."
@@ -18,9 +20,19 @@
# - alice-example / bob-example / charlie-example / diana-example
# - widget-co / acme-example
# - fund-a / fund-b / fund-c
+#
+# evals/ and docs/test-audit/ are scanned with the real-entity tokens only:
+# the product and repository names (openclaw, garrytan/gbrain) are
+# legitimate there. evals/ carries generated corpora and qrels, where a real
+# person's brain-page slug once shipped in a public repo; docs/test-audit/
+# carries audit evidence that quotes eval data.
+#
+# Seam: GBRAIN_GUARD_ROOT (fixture tree root, used by scripts/guard-self-test.sh).
set -euo pipefail
+cd "${GBRAIN_GUARD_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
+
# cathedral-4: the transcripts-import fixtures (raw harness/export shapes)
# carry the same placeholder-names-only contract as conversation-formats.
FIXTURE_DIRS=("test/fixtures/conversation-formats" "test/fixtures/transcripts")
@@ -36,7 +48,13 @@ done
for f in "${FIXTURE_FILES[@]}"; do
[ -f "$f" ] && EXISTING_DIRS+=("$f")
done
-if [ ${#EXISTING_DIRS[@]} -eq 0 ]; then
+# Eval corpora and audit evidence: real-entity tokens only (see header).
+SCOPED_DIRS=("evals" "docs/test-audit")
+EXISTING_SCOPED=()
+for d in "${SCOPED_DIRS[@]}"; do
+ [ -d "$d" ] && EXISTING_SCOPED+=("$d")
+done
+if [ ${#EXISTING_DIRS[@]} -eq 0 ] && [ ${#EXISTING_SCOPED[@]} -eq 0 ]; then
echo "[check-fixture-privacy] no fixture dirs exist; nothing to check"
exit 0
fi
@@ -53,25 +71,49 @@ BANNED_TOKENS=(
"ycombinator"
"y combinator"
"garry tan"
+ "garry-tan"
"garrytan"
)
+# Real people, companies and funds (no product or repository names).
+REAL_ENTITY_TOKENS=(
+ "wintermute"
+ "palantir"
+ "sequoia"
+ "andreessen"
+ "founders fund"
+ "founders\\.fund"
+ "ycombinator"
+ "y combinator"
+ "garry tan"
+ "garry-tan"
+)
errors=0
-for token in "${BANNED_TOKENS[@]}"; do
- matches=$(grep -ril "$token" "${EXISTING_DIRS[@]}" 2>/dev/null || true)
+scan() {
+ local token="$1"; shift
+ [ "$#" -gt 0 ] || return 0
+ local matches
+ matches=$(grep -ril -- "$token" "$@" 2>/dev/null || true)
if [ -n "$matches" ]; then
echo "[check-fixture-privacy] BANNED token '$token' found in:"
echo "$matches" | sed 's/^/ - /'
errors=$((errors + 1))
fi
+}
+for token in "${BANNED_TOKENS[@]}"; do
+ scan "$token" ${EXISTING_DIRS[@]+"${EXISTING_DIRS[@]}"}
+done
+for token in "${REAL_ENTITY_TOKENS[@]}"; do
+ scan "$token" ${EXISTING_SCOPED[@]+"${EXISTING_SCOPED[@]}"}
done
if [ "$errors" -gt 0 ]; then
echo ""
- echo "[check-fixture-privacy] FAIL: $errors banned token(s) found in fixtures."
- echo "[check-fixture-privacy] Fixtures must use placeholder names (alice-example, widget-co, fund-a, ...)."
- echo "[check-fixture-privacy] See CLAUDE.md \"Privacy rule\" section."
+ echo "[check-fixture-privacy] FAIL: $errors banned token(s) found in fixtures, eval corpora or audit evidence."
+ echo "Why: these files are public; CLAUDE.md's privacy rule forbids real people, companies and funds in them."
+ echo "Fix: replace each match with a placeholder (alice-example, acme-example, widget-co, fund-a) or delete the file, then re-run: bun run check:fixture-privacy"
+ echo "Docs: CLAUDE.md (Privacy rule)"
exit 1
fi
-echo "[check-fixture-privacy] OK: no banned tokens found in ${EXISTING_DIRS[*]}"
+echo "[check-fixture-privacy] OK: no banned tokens found in ${EXISTING_DIRS[*]-} ${EXISTING_SCOPED[*]-}"
diff --git a/scripts/check-gateway-routed-no-direct-anthropic.sh b/scripts/check-gateway-routed-no-direct-anthropic.sh
index 4801fddecf..634addddd6 100755
--- a/scripts/check-gateway-routed-no-direct-anthropic.sh
+++ b/scripts/check-gateway-routed-no-direct-anthropic.sh
@@ -20,9 +20,11 @@
# Usage: scripts/check-gateway-routed-no-direct-anthropic.sh
# Exit: 0 when clean, 1 when a guarded file imports the SDK as a runtime value.
+# Seam: GBRAIN_GUARD_ROOT (fixture tree root).
+
set -euo pipefail
-ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
+ROOT="${GBRAIN_GUARD_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
cd "$ROOT"
# Files whose contract is "ALL chat calls route through gateway.chat()".
diff --git a/scripts/check-no-pii-in-agent-voice.sh b/scripts/check-no-pii-in-agent-voice.sh
index 33086a0292..67ccf1d630 100755
--- a/scripts/check-no-pii-in-agent-voice.sh
+++ b/scripts/check-no-pii-in-agent-voice.sh
@@ -12,14 +12,16 @@
#
# Exit 0 on no matches; exit 1 on any match. Wired into `bun run verify`.
#
-# Test fixtures under recipes/agent-voice/tests/fixtures/scrub-{dirty,clean}.txt are
-# the deliberate dirty inputs used by test/check-no-pii.test.ts. They contain the
-# token FORBIDDEN_PLACEHOLDER_NAME_1 (NOT real names) and the test sets
-# AGENT_VOICE_PII_BLOCKLIST=FORBIDDEN_PLACEHOLDER_NAME_1 to verify the mechanism.
+# recipes/agent-voice/tests/fixtures/scrub-{dirty,clean}.txt are skipped (they
+# carry the placeholder token FORBIDDEN_PLACEHOLDER_NAME_1, never real names).
+# The guard's own known-bad/known-good trees live under
+# test/fixtures/guards/check-no-pii-in-agent-voice.sh/ (scripts/guard-self-test.sh).
+#
+# Seam: GBRAIN_GUARD_ROOT (fixture tree root).
set -euo pipefail
-ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
+ROOT="${GBRAIN_GUARD_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
cd "$ROOT"
SCAN_PATHS=(
@@ -108,6 +110,9 @@ fi
if [ "$FAILED" -ne 0 ]; then
echo
echo "FAIL: agent-voice privacy guard found leaks. Scrub before commit."
+ echo "Why: the agent-voice recipe is copied into operators' agent repos and is public; contact details, tokens and private paths must not ship in it."
+ echo "Fix: replace each match above with a placeholder (alice-example, 555-0100, /path/to/workspace), then re-run: bun run check:no-pii-agent-voice"
+ echo "Docs: recipes/agent-voice/code/lib/personas/private-name-blocklist.json"
exit 1
fi
diff --git a/scripts/check-pagetype-exhaustive.sh b/scripts/check-pagetype-exhaustive.sh
deleted file mode 100755
index 85aa7975a4..0000000000
--- a/scripts/check-pagetype-exhaustive.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env bash
-# CI guard: every `switch (X.type)` site in src/ that discriminates on a
-# PageType-shaped value MUST use assertNever() in the default branch.
-#
-# Why: extending PageType (e.g. v0.27.1 adding 'image') silently fell through
-# default branches in v0.20 / v0.22 because TypeScript couldn't catch the
-# missing case at type-check time. assertNever() forces the compiler to error
-# when a new PageType lacks a matching case.
-#
-# Today (pre-v0.27.1) the codebase has zero PageType-discriminating switches —
-# it uses the type system for exhaustiveness via union narrowing. This guard
-# is preventive: catches the moment a contributor adds a switch and forgets
-# the assertNever.
-#
-# Pattern: a `switch (x.type)` where the surrounding file imports PageType
-# (heuristic: imports from './types' or '../types') is treated as a
-# PageType-shaped switch and must include assertNever in default.
-#
-# False positives are easy to silence by adding an `// eslint-disable-line
-# pagetype-exhaustive` style comment above the offending switch.
-
-set -euo pipefail
-
-REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
-cd "$REPO_ROOT"
-
-VIOLATIONS=0
-
-# Find every src/**.ts file that imports PageType. Portable across Bash 3.2
-# (macOS default) — no mapfile, no process substitution arrays.
-PAGETYPE_FILES=$(grep -rlE "import.*PageType.*from.*types" src 2>/dev/null || true)
-
-if [ -z "$PAGETYPE_FILES" ]; then
- echo "[check-pagetype-exhaustive] No files import PageType. Skipping."
- exit 0
-fi
-
-while IFS= read -r file; do
- [ -z "$file" ] && continue
- # Look for `switch (X.type)` patterns in the file. Heuristic: any `switch (`
- # followed by a `.type)` within the line.
- if grep -nE 'switch\s*\([^)]*\.type\s*\)' "$file" >/dev/null 2>&1; then
- # File has at least one switch on .type. Verify assertNever is imported
- # AND used somewhere in the file. If both are present, assume the dev
- # wired it correctly — finer-grained per-switch checking is too brittle.
- if ! grep -qE 'assertNever' "$file"; then
- echo "[check-pagetype-exhaustive] FAIL: $file has switch(X.type) but no assertNever() use." >&2
- grep -nE 'switch\s*\([^)]*\.type\s*\)' "$file" >&2 || true
- VIOLATIONS=$((VIOLATIONS + 1))
- fi
- fi
-done <<< "$PAGETYPE_FILES"
-
-if [ "$VIOLATIONS" -gt 0 ]; then
- echo "" >&2
- echo "Fix: import { assertNever } from './types.ts' (or wherever appropriate)" >&2
- echo "and add \`default: return assertNever(x.type);\` to the switch." >&2
- echo "If the switch is intentionally non-exhaustive (e.g. handling only a" >&2
- echo "subset of PageTypes), document why with a comment and add the file" >&2
- echo "to an explicit allow-list at the top of this script." >&2
- exit 1
-fi
-
-echo "[check-pagetype-exhaustive] All PageType-discriminating switches use assertNever() (or none exist)."
diff --git a/scripts/check-skill-brain-first.sh b/scripts/check-skill-brain-first.sh
index d9b3f8546c..c6a67d4bf2 100755
--- a/scripts/check-skill-brain-first.sh
+++ b/scripts/check-skill-brain-first.sh
@@ -21,6 +21,9 @@ set -euo pipefail
ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
cd "$ROOT"
+# Seam: GBRAIN_GUARD_ROOT points the scan at a fixture tree's skills/; the
+# doctor that runs it is always this checkout's CLI.
+SKILLS_ROOT="${GBRAIN_GUARD_ROOT:-$ROOT}"
# Run doctor with this repo's own skills as the explicit target.
#
@@ -39,7 +42,7 @@ TMPOUT="$(mktemp -t gbrain-doctor-XXXXXXXX)"
# shellcheck disable=SC2064
trap "rm -f \"$TMPOUT\"" EXIT
-GBRAIN_SKILLS_DIR="$ROOT/skills" bun run src/cli.ts doctor --fast --json >"$TMPOUT" 2>/dev/null || true
+GBRAIN_SKILLS_DIR="$SKILLS_ROOT/skills" bun run src/cli.ts doctor --fast --json >"$TMPOUT" 2>/dev/null || true
# Extract the skill_brain_first check status. Use python3 (already a
# repo-wide dependency via image-decoders + admin tooling) so we don't
diff --git a/scripts/check-source-scope-onboard.sh b/scripts/check-source-scope-onboard.sh
index fa49a6cf13..3ef7330251 100755
--- a/scripts/check-source-scope-onboard.sh
+++ b/scripts/check-source-scope-onboard.sh
@@ -16,6 +16,9 @@
set -e
+# Seam: GBRAIN_GUARD_ROOT (fixture tree root); default is the repo root.
+cd "${GBRAIN_GUARD_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
+
FILES_TO_CHECK=(
"src/core/onboard/checks.ts"
"src/core/onboard/impact-capture.ts"
diff --git a/scripts/check-trailing-newline.sh b/scripts/check-trailing-newline.sh
index 4c048f9b6a..98a72f9017 100755
--- a/scripts/check-trailing-newline.sh
+++ b/scripts/check-trailing-newline.sh
@@ -5,20 +5,30 @@
#
# Sibling to scripts/check-progress-to-stdout.sh and
# scripts/check-jsonb-pattern.sh per CLAUDE.md's CI guard pattern.
-# Wired into `bun run test` via package.json's `test` script.
+# Wired into `bun run verify` (check:newlines).
+#
+# Guard fixtures under test/fixtures/guards/ are skipped: their known-bad
+# trees deliberately lack the newline. Seam: GBRAIN_GUARD_ROOT scans a fixture
+# tree with find instead of git ls-files.
set -euo pipefail
+cd "${GBRAIN_GUARD_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
+
# Files to check: anything tracked under src/ + test/ that's a code/text file.
# Also the top-level *.yml + *.md the repo controls. Portable to bash 3.2
# (macOS default) — no mapfile, no associative arrays.
-files=$(
- git ls-files \
- 'src/**/*.ts' 'src/**/*.js' 'src/**/*.json' 'src/**/*.sql' 'src/**/*.md' \
- 'test/**/*.ts' 'test/**/*.js' 'test/**/*.json' 'test/**/*.md' \
- 'gbrain.yml' '*.md' \
- 2>/dev/null | sort -u
-)
+if [ -n "${GBRAIN_GUARD_ROOT:-}" ]; then
+ files=$(find . -type f \( -name '*.ts' -o -name '*.js' -o -name '*.json' -o -name '*.sql' -o -name '*.md' -o -name 'gbrain.yml' \) | sed 's#^\./##' | sort -u)
+else
+ files=$(
+ git ls-files \
+ 'src/**/*.ts' 'src/**/*.js' 'src/**/*.json' 'src/**/*.sql' 'src/**/*.md' \
+ 'test/**/*.ts' 'test/**/*.js' 'test/**/*.json' 'test/**/*.md' \
+ 'gbrain.yml' '*.md' \
+ 2>/dev/null | grep -v '^test/fixtures/guards/' | sort -u
+ )
+fi
missing=""
total=0
diff --git a/scripts/guards-manifest.tsv b/scripts/guards-manifest.tsv
index a3c8032d07..d47e8fbbb0 100644
--- a/scripts/guards-manifest.tsv
+++ b/scripts/guards-manifest.tsv
@@ -18,33 +18,32 @@
check-no-double-retry.sh scanner yes regex hole fixed in W0 (could not match `() =>`); perl multi-line pass replaces never-installed pcregrep
check-jsonb-pattern.sh scanner yes nested-paren hole fixed in W0; safe ::text::jsonb spelling stays unflagged
check-jsonb-params.mjs scanner yes positional $N::jsonb AST-lite scanner; argv/env root override; in verify CHECKS (check:jsonb-params) over the real tree
-check-batch-audit-site.sh scanner todo
+check-batch-audit-site.sh scanner yes auditSite literals in src/ must be in BATCH_AUDIT_SITES (src/core/retry.ts); GBRAIN_GUARD_ROOT seam
check-bun-test-timeout.sh scanner todo not in verify CHECKS: runs directly as a test.yml verify-job step
-check-fixture-privacy.sh scanner todo
+check-fixture-privacy.sh scanner yes conversation-formats + transcripts fixtures (all tokens); evals/ and docs/test-audit/ (real-entity tokens, V-12); GBRAIN_GUARD_ROOT seam
check-no-legacy-getconnection.sh scanner yes was reachable from neither verify nor CI pre-W0 (check:all only); GBRAIN_GUARD_ROOT seam; bad-<dir> fixtures prove it scans every refactor-wave-1 module dir
-check-no-pii-in-agent-voice.sh scanner todo
+check-no-pii-in-agent-voice.sh scanner yes shape + private-path regex over the agent-voice recipe surface; operator blocklist via AGENT_VOICE_PII_BLOCKLIST; GBRAIN_GUARD_ROOT seam
check-operations-filter-bypass.sh scanner yes GBRAIN_GUARD_ROOT seam; canonical localOnly filter may live in serve-http.ts or serve-http-mcp.ts; bad-<dir> fixtures cover each refactor-wave-1 module dir
-check-pagetype-exhaustive.sh scanner todo wired into verify CHECKS (v0.45.x test/eval/CI pass; was registered-but-never-executed)
check-pg-url-redaction.sh scanner todo wired into verify CHECKS (v0.45.x test/eval/CI pass; was registered-but-never-executed)
check-privacy.sh scanner todo
check-progress-to-stdout.sh scanner todo
check-proposal-pii.sh scanner todo
check-search-path.sh scanner yes GBRAIN_GUARD_ROOT seam; schema base files incl. the generated PGLite template (pglite-schema.generated.ts, refactor wave 1)
-check-skill-brain-first.sh scanner todo
+check-skill-brain-first.sh scanner yes runs this checkout's doctor skill_brain_first over <root>/skills; GBRAIN_GUARD_ROOT seam
check-skill-refs.mjs scanner todo
check-source-config-leak.sh scanner yes GBRAIN_GUARD_ROOT seam; bad-<dir> fixtures cover serve-http-*.ts, engine-sql/, sync/, doctor/checks/
check-source-id-projection.sh scanner yes GBRAIN_GUARD_ROOT seam; portable word boundaries (mawk has no \b, so the guard matched nothing on Ubuntu before); scans engine façades, module dirs and engine-sql/
-check-source-scope-onboard.sh scanner todo
+check-source-scope-onboard.sh scanner yes onboard SQL sites need source_id scoping or a brain-wide marker; GBRAIN_GUARD_ROOT seam
check-synthetic-corpus-privacy.sh scanner todo
check-system-of-record.sh scanner todo
check-test-real-names.sh scanner todo
check-worker-lock-renewal-shape.sh scanner todo
check-worker-pool-atomicity.sh scanner todo
-check-gateway-routed-no-direct-anthropic.sh scanner todo
+check-gateway-routed-no-direct-anthropic.sh scanner yes no runtime @anthropic-ai/sdk import or new Anthropic() in gateway-routed files; GBRAIN_GUARD_ROOT seam
check-engine-dynamic-import.sh scanner yes .ts companion is its implementation, not a separate guard; scans engine façades, their module dirs, engine-sql/ and schema-migrations/; GBRAIN_GUARD_ROOT seam
check-key-files-current-state.sh scanner todo
check-exports-count.sh scanner todo was reachable from neither verify nor CI pre-W0 (check:all only)
-check-trailing-newline.sh scanner todo was reachable from neither verify nor CI pre-W0 (check:all only)
+check-trailing-newline.sh scanner yes tracked src/test/root text files end with a newline (guard fixtures excluded); GBRAIN_GUARD_ROOT seam scans with find
check-test-isolation.sh scanner todo allowlist data file: check-test-isolation.allowlist
check-compile-autoload.sh scanner yes every `bun build --compile` invocation (CLI one-liners + TS spawn arrays) in package.json/.github/scripts/docs/CLAUDE.md/CONTRIBUTING.md must carry --no-compile-autoload-bunfig (a cwd bunfig.toml preload runs before cli-preflight in a compiled binary); also every curated help record in src/cli/command-table.ts loads its src/cli/help/<name>.ts module through a literal () => import() (D3), and every spec module has a record
check-admin-build.sh buildfresh exempt runs the admin build; the build is the test
diff --git a/scripts/run-verify-parallel.sh b/scripts/run-verify-parallel.sh
index c438b1c592..0535700910 100755
--- a/scripts/run-verify-parallel.sh
+++ b/scripts/run-verify-parallel.sh
@@ -133,7 +133,6 @@ CHECKS=(
"check:exports-count"
"check:no-legacy-getconnection"
# Revived registered-but-never-executed guards (this pass):
- "check:pagetype-exhaustive"
"check:pg-url-redaction"
# Containment sprint: module-size ratchet + structural-suite freshness.
"check:module-size"
diff --git a/test/fixtures/guards/check-batch-audit-site.sh/bad/src/core/extract.ts b/test/fixtures/guards/check-batch-audit-site.sh/bad/src/core/extract.ts
new file mode 100644
index 0000000000..d970b64751
--- /dev/null
+++ b/test/fixtures/guards/check-batch-audit-site.sh/bad/src/core/extract.ts
@@ -0,0 +1 @@
+export const opts = { auditSite: 'extract.links_inc_typo' };
diff --git a/test/fixtures/guards/check-batch-audit-site.sh/bad/src/core/retry.ts b/test/fixtures/guards/check-batch-audit-site.sh/bad/src/core/retry.ts
new file mode 100644
index 0000000000..8491e88286
--- /dev/null
+++ b/test/fixtures/guards/check-batch-audit-site.sh/bad/src/core/retry.ts
@@ -0,0 +1,4 @@
+export const BATCH_AUDIT_SITES = [
+ 'addLinksBatch',
+ 'extract.links_inc',
+] as const;
diff --git a/test/fixtures/guards/check-batch-audit-site.sh/good/src/core/extract.ts b/test/fixtures/guards/check-batch-audit-site.sh/good/src/core/extract.ts
new file mode 100644
index 0000000000..868d49d268
--- /dev/null
+++ b/test/fixtures/guards/check-batch-audit-site.sh/good/src/core/extract.ts
@@ -0,0 +1 @@
+export const opts = { auditSite: 'extract.links_inc' };
diff --git a/test/fixtures/guards/check-batch-audit-site.sh/good/src/core/retry.ts b/test/fixtures/guards/check-batch-audit-site.sh/good/src/core/retry.ts
new file mode 100644
index 0000000000..8491e88286
--- /dev/null
+++ b/test/fixtures/guards/check-batch-audit-site.sh/good/src/core/retry.ts
@@ -0,0 +1,4 @@
+export const BATCH_AUDIT_SITES = [
+ 'addLinksBatch',
+ 'extract.links_inc',
+] as const;
diff --git a/test/fixtures/guards/check-fixture-privacy.sh/bad-evals/evals/qrels/embedding.json b/test/fixtures/guards/check-fixture-privacy.sh/bad-evals/evals/qrels/embedding.json
new file mode 100644
index 0000000000..02dc0cbca9
--- /dev/null
+++ b/test/fixtures/guards/check-fixture-privacy.sh/bad-evals/evals/qrels/embedding.json
@@ -0,0 +1 @@
+{"queries":[{"query":"who is this","relevant":["people/garry-tan"]}]}
diff --git a/test/fixtures/guards/check-fixture-privacy.sh/bad-test-audit/docs/test-audit/2099-01-01/lane.md b/test/fixtures/guards/check-fixture-privacy.sh/bad-test-audit/docs/test-audit/2099-01-01/lane.md
new file mode 100644
index 0000000000..da1d129d17
--- /dev/null
+++ b/test/fixtures/guards/check-fixture-privacy.sh/bad-test-audit/docs/test-audit/2099-01-01/lane.md
@@ -0,0 +1,3 @@
+# Lane report
+
+The qrels quoted a partner at Sequoia.
diff --git a/test/fixtures/guards/check-fixture-privacy.sh/bad/test/fixtures/conversation-formats/chat.txt b/test/fixtures/guards/check-fixture-privacy.sh/bad/test/fixtures/conversation-formats/chat.txt
new file mode 100644
index 0000000000..559bd25994
--- /dev/null
+++ b/test/fixtures/guards/check-fixture-privacy.sh/bad/test/fixtures/conversation-formats/chat.txt
@@ -0,0 +1,2 @@
+user: ping the openclaw agent
+assistant: done
diff --git a/test/fixtures/guards/check-fixture-privacy.sh/good/docs/test-audit/2099-01-01/lane.md b/test/fixtures/guards/check-fixture-privacy.sh/good/docs/test-audit/2099-01-01/lane.md
new file mode 100644
index 0000000000..2f8ba47f29
--- /dev/null
+++ b/test/fixtures/guards/check-fixture-privacy.sh/good/docs/test-audit/2099-01-01/lane.md
@@ -0,0 +1,3 @@
+# Lane report
+
+The qrels name people/alice-example and fund-a.
diff --git a/test/fixtures/guards/check-fixture-privacy.sh/good/evals/qrels/embedding.json b/test/fixtures/guards/check-fixture-privacy.sh/good/evals/qrels/embedding.json
new file mode 100644
index 0000000000..eb2ae0a2b1
--- /dev/null
+++ b/test/fixtures/guards/check-fixture-privacy.sh/good/evals/qrels/embedding.json
@@ -0,0 +1 @@
+{"queries":[{"query":"who runs acme-example","relevant":["people/alice-example","companies/acme-example"],"source":"https://github.com/garrytan/gbrain","harness":"openclaw"}]}
diff --git a/test/fixtures/guards/check-fixture-privacy.sh/good/test/fixtures/conversation-formats/chat.txt b/test/fixtures/guards/check-fixture-privacy.sh/good/test/fixtures/conversation-formats/chat.txt
new file mode 100644
index 0000000000..bfbca7284f
--- /dev/null
+++ b/test/fixtures/guards/check-fixture-privacy.sh/good/test/fixtures/conversation-formats/chat.txt
@@ -0,0 +1,2 @@
+user: ping alice-example
+assistant: done
diff --git a/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad-import/src/core/cycle/synthesize.ts b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad-import/src/core/cycle/synthesize.ts
new file mode 100644
index 0000000000..74d7ac9492
--- /dev/null
+++ b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad-import/src/core/cycle/synthesize.ts
@@ -0,0 +1,2 @@
+import Anthropic from '@anthropic-ai/sdk';
+export type Msg = Anthropic.Message;
diff --git a/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad-import/src/core/think/index.ts b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad-import/src/core/think/index.ts
new file mode 100644
index 0000000000..a46f691dc9
--- /dev/null
+++ b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad-import/src/core/think/index.ts
@@ -0,0 +1,2 @@
+import type Anthropic from '@anthropic-ai/sdk';
+export type Msg = Anthropic.Message;
diff --git a/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad/src/core/cycle/synthesize.ts b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad/src/core/cycle/synthesize.ts
new file mode 100644
index 0000000000..a46f691dc9
--- /dev/null
+++ b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad/src/core/cycle/synthesize.ts
@@ -0,0 +1,2 @@
+import type Anthropic from '@anthropic-ai/sdk';
+export type Msg = Anthropic.Message;
diff --git a/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad/src/core/think/index.ts b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad/src/core/think/index.ts
new file mode 100644
index 0000000000..518ee00217
--- /dev/null
+++ b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/bad/src/core/think/index.ts
@@ -0,0 +1,2 @@
+import type Anthropic from '@anthropic-ai/sdk';
+export const client = new Anthropic();
diff --git a/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/good/src/core/cycle/synthesize.ts b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/good/src/core/cycle/synthesize.ts
new file mode 100644
index 0000000000..a46f691dc9
--- /dev/null
+++ b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/good/src/core/cycle/synthesize.ts
@@ -0,0 +1,2 @@
+import type Anthropic from '@anthropic-ai/sdk';
+export type Msg = Anthropic.Message;
diff --git a/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/good/src/core/think/index.ts b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/good/src/core/think/index.ts
new file mode 100644
index 0000000000..a46f691dc9
--- /dev/null
+++ b/test/fixtures/guards/check-gateway-routed-no-direct-anthropic.sh/good/src/core/think/index.ts
@@ -0,0 +1,2 @@
+import type Anthropic from '@anthropic-ai/sdk';
+export type Msg = Anthropic.Message;
diff --git a/test/fixtures/guards/check-no-pii-in-agent-voice.sh/bad-path/recipes/agent-voice/code/persona.mjs b/test/fixtures/guards/check-no-pii-in-agent-voice.sh/bad-path/recipes/agent-voice/code/persona.mjs
new file mode 100644
index 0000000000..2a3e25f77f
--- /dev/null
+++ b/test/fixtures/guards/check-no-pii-in-agent-voice.sh/bad-path/recipes/agent-voice/code/persona.mjs
@@ -0,0 +1 @@
+export const HOME = '/private/someone/workspace/brain';
diff --git a/test/fixtures/guards/check-no-pii-in-agent-voice.sh/bad/recipes/agent-voice/code/persona.mjs b/test/fixtures/guards/check-no-pii-in-agent-voice.sh/bad/recipes/agent-voice/code/persona.mjs
new file mode 100644
index 0000000000..7e56c7733e
--- /dev/null
+++ b/test/fixtures/guards/check-no-pii-in-agent-voice.sh/bad/recipes/agent-voice/code/persona.mjs
@@ -0,0 +1 @@
+export const CALLBACK = 'call 415-555-1234 after the session';
diff --git a/test/fixtures/guards/check-no-pii-in-agent-voice.sh/good/recipes/agent-voice/code/persona.mjs b/test/fixtures/guards/check-no-pii-in-agent-voice.sh/good/recipes/agent-voice/code/persona.mjs
new file mode 100644
index 0000000000..0eb170ff9c
--- /dev/null
+++ b/test/fixtures/guards/check-no-pii-in-agent-voice.sh/good/recipes/agent-voice/code/persona.mjs
@@ -0,0 +1 @@
+export const GREETING = 'hello alice-example';
diff --git a/test/fixtures/guards/check-skill-brain-first.sh/bad/skills/RESOLVER.md b/test/fixtures/guards/check-skill-brain-first.sh/bad/skills/RESOLVER.md
new file mode 100644
index 0000000000..a443a2b1d6
--- /dev/null
+++ b/test/fixtures/guards/check-skill-brain-first.sh/bad/skills/RESOLVER.md
@@ -0,0 +1,5 @@
+# Resolver
+
+| Trigger | Skill |
+|---|---|
+| look someone up | `skills/lookup/SKILL.md` |
diff --git a/test/fixtures/guards/check-skill-brain-first.sh/bad/skills/lookup/SKILL.md b/test/fixtures/guards/check-skill-brain-first.sh/bad/skills/lookup/SKILL.md
new file mode 100644
index 0000000000..abadd0336f
--- /dev/null
+++ b/test/fixtures/guards/check-skill-brain-first.sh/bad/skills/lookup/SKILL.md
@@ -0,0 +1,8 @@
+---
+name: lookup
+description: Look a person up.
+---
+
+# Lookup
+
+Call web_search for the person's name and summarize the results.
diff --git a/test/fixtures/guards/check-skill-brain-first.sh/bad/skills/manifest.json b/test/fixtures/guards/check-skill-brain-first.sh/bad/skills/manifest.json
new file mode 100644
index 0000000000..d647592105
--- /dev/null
+++ b/test/fixtures/guards/check-skill-brain-first.sh/bad/skills/manifest.json
@@ -0,0 +1,7 @@
+{
+ "name": "fixture",
+ "version": "0.0.0",
+ "skills": [
+ { "name": "lookup", "path": "lookup/SKILL.md", "description": "Look a person up." }
+ ]
+}
diff --git a/test/fixtures/guards/check-skill-brain-first.sh/good/skills/RESOLVER.md b/test/fixtures/guards/check-skill-brain-first.sh/good/skills/RESOLVER.md
new file mode 100644
index 0000000000..a443a2b1d6
--- /dev/null
+++ b/test/fixtures/guards/check-skill-brain-first.sh/good/skills/RESOLVER.md
@@ -0,0 +1,5 @@
+# Resolver
+
+| Trigger | Skill |
+|---|---|
+| look someone up | `skills/lookup/SKILL.md` |
diff --git a/test/fixtures/guards/check-skill-brain-first.sh/good/skills/lookup/SKILL.md b/test/fixtures/guards/check-skill-brain-first.sh/good/skills/lookup/SKILL.md
new file mode 100644
index 0000000000..3604a99d54
--- /dev/null
+++ b/test/fixtures/guards/check-skill-brain-first.sh/good/skills/lookup/SKILL.md
@@ -0,0 +1,10 @@
+---
+name: lookup
+description: Look a person up.
+---
+
+# Lookup
+
+> **Convention:** see conventions/brain-first.md — search the brain before any external lookup.
+
+Run gbrain search for the person first; call web_search only for what the brain lacks.
diff --git a/test/fixtures/guards/check-skill-brain-first.sh/good/skills/manifest.json b/test/fixtures/guards/check-skill-brain-first.sh/good/skills/manifest.json
new file mode 100644
index 0000000000..d647592105
--- /dev/null
+++ b/test/fixtures/guards/check-skill-brain-first.sh/good/skills/manifest.json
@@ -0,0 +1,7 @@
+{
+ "name": "fixture",
+ "version": "0.0.0",
+ "skills": [
+ { "name": "lookup", "path": "lookup/SKILL.md", "description": "Look a person up." }
+ ]
+}
diff --git a/test/fixtures/guards/check-source-scope-onboard.sh/bad/src/core/onboard/checks.ts b/test/fixtures/guards/check-source-scope-onboard.sh/bad/src/core/onboard/checks.ts
new file mode 100644
index 0000000000..accaae84fa
--- /dev/null
+++ b/test/fixtures/guards/check-source-scope-onboard.sh/bad/src/core/onboard/checks.ts
@@ -0,0 +1,5 @@
+export async function countPages(engine: { executeRaw(sql: string, p?: unknown[]): Promise<unknown> }) {
+ return engine.executeRaw(
+ `SELECT count(*) FROM pages WHERE deleted_at IS NULL`,
+ );
+}
diff --git a/test/fixtures/guards/check-source-scope-onboard.sh/good/src/core/onboard/checks.ts b/test/fixtures/guards/check-source-scope-onboard.sh/good/src/core/onboard/checks.ts
new file mode 100644
index 0000000000..6a62f34974
--- /dev/null
+++ b/test/fixtures/guards/check-source-scope-onboard.sh/good/src/core/onboard/checks.ts
@@ -0,0 +1,6 @@
+export async function countPages(engine: { executeRaw(sql: string, p?: unknown[]): Promise<unknown> }, sourceId: string) {
+ return engine.executeRaw(
+ `SELECT count(*) FROM pages WHERE source_id = $1 AND deleted_at IS NULL`,
+ [sourceId],
+ );
+}
diff --git a/test/fixtures/guards/check-trailing-newline.sh/bad/src/no-newline.ts b/test/fixtures/guards/check-trailing-newline.sh/bad/src/no-newline.ts
new file mode 100644
index 0000000000..d852a426b2
--- /dev/null
+++ b/test/fixtures/guards/check-trailing-newline.sh/bad/src/no-newline.ts
@@ -0,0 +1 @@
+export const a = 1;
\ No newline at end of file
diff --git a/test/fixtures/guards/check-trailing-newline.sh/good/src/newline.ts b/test/fixtures/guards/check-trailing-newline.sh/good/src/newline.ts
new file mode 100644
index 0000000000..cc798ff50d
--- /dev/null
+++ b/test/fixtures/guards/check-trailing-newline.sh/good/src/newline.ts
@@ -0,0 +1 @@
+export const a = 1;