Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
verify: run check-postgres-lane-coverage; record the D8/D9 evidence
garrytan795dbdba7256
diff --git a/CLAUDE.md b/CLAUDE.mdindex ab6a17f2de..5df9f81f1c 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -106,10 +106,8 @@ Per-file detail is in `docs/architecture/KEY_FILES.md`.`src/core/model-pricing.ts` (`CANONICAL_PRICING` + `canonicalLookup`). Every other table(`anthropic-pricing.ts`'s `ANTHROPIC_PRICING`, the contradictions/cross-modal/skillopt costviews) is a DERIVED view, never a hand-copied duplicate — so cross-table price drift is- structurally impossible; takes-quality reads `pricing.overrides`, then `canonicalLookup`. Update a- price in `model-pricing.ts` only; each consumer keeps its own miss policy (an unpriced model- warns and runs, and refuses with a register-the-rate fix only under a user-set cap), not its- own numbers. Pinned by `test/model-pricing.test.ts`+ structurally impossible (takes-quality reads `pricing.overrides`, then canonical). Update a+ price in `model-pricing.ts` only; each consumer keeps its own miss policy, not its own numbers. Pinned by `test/model-pricing.test.ts`(drift guard asserts each view equals canonical). Embeddings price separately in`embedding-pricing.ts` (different unit).- **Module-size ratchet.** `scripts/module-size-limits.tsv` pins per-file line ceilingsdiff --git a/docs/test-audit/2026-10-04/implementation/lane-c.md b/docs/test-audit/2026-10-04/implementation/lane-c.mdindex 3bb84a6951..d8b2f7daf1 100644--- a/docs/test-audit/2026-10-04/implementation/lane-c.md+++ b/docs/test-audit/2026-10-04/implementation/lane-c.md@@ -80,3 +80,39 @@ return no claims; press attribution leaks; one strong take typed as a bet)and incomplete archetype labels (valid unlabeled claims count as imprecise).Next: complete the labels per archetype, then fix bio-fact recall andpress-claim attribution, then rerun.++## Postgres arms and blind pins sub-lane (D8, D9)++### D8: unit-lane PostgreSQL arms++`scripts/check-postgres-lane-coverage.ts` (TS AST) found 167 test files outside+`test/e2e/` with a DATABASE_URL-gated arm (`testBackends()` loops and gated+`process.env.DATABASE_URL` reads included, not only arms that report `skip`).+111 were already covered, mostly by `test/e2e` `registerPostgresTests`+wrappers; two of the audit's seven (export-safety via+`test/e2e/export-snapshot-postgres`, symbol-resolver-projection-race via+`projection-recovery-parity`) were among them. 55 ran in no lane; they now run+in persistence-validation's `unit-postgres-arms` job (2 shards: 215 and 242+pass, 0 fail, 0 skip on a fresh pgvector database). One allowlist row:+`test/export-scale.slow.test.ts` (its 100,001-page arm passes but takes 527s).+One real failure, fixed: `persistence-memory-mutations` shared the+`gbrain_test` database and inherited another file's embedding width ("expected+1024 dimensions, not 1536"); it now uses `isolatedPersistencePostgres`.+Guard probe: removing a file from the workflow list fails the guard with the+exact fix line (`test/scripts/postgres-lane-coverage.test.ts`, 10 cases).++### D9: retired blind pins and their behavioral owners++| Deleted / changed test | Probe edit | Result | Surviving owner | Owner result |+|---|---|---|---|---|+| `test/fact-withdrawal-prepare-wiring.test.ts` › import-prepare row | `src/core/persistence/import-prepare.ts:198` `await ready.validate(tx)` -> `if (Date.now() < 0) await ready.validate(tx)` | pin passes 7/7 (blind) | `persistence-file-import` › "publication refuses a fact withdrawn between managed-import preparation and publication" (PGLite and Postgres) | fails (boundaries include `before_publication`, `before_file`) |+| same › sync row | disable validate at `sync-prepare.ts:415` | pin passes (blind); `persistence-sync-failures` also passes | `persistence-managed-sync` › "a fact withdrawn between sync preparation and canonical file writeback" | fails |+| same › connector row | disable validate at `connector-sync.ts:1057` | pin passes (blind); `google-attachment-backfill` also passes | `persistence-connectors` › "a fact withdrawn between bound connector preparation" | fails |+| same › reconcile row | disable validate at `reconcile-prepare.ts:106` | equivalent mutant (the preview's `withdrawals_digest` pin refuses first) | `persistence-reconcile` › "a fact withdrawn between reconciliation preparation" | fails with both the digest check and validate disabled |+| same › page-prepare and coordinator rows | page-prepare:394; coordinator:265 | pin passes (blind) | `withdrawal-publication-file`; two `persistence-file-import` cases | fail (1; 3) |+| same › sync code-file and rename rows | disable validate | equivalent mutants (code imports' validate is a no-op; `applyPrepared` repeats the rename check) | n/a | n/a |+| `think-save-source` pins | clear the save scope in `think.ts`, `ops/takes.ts`, `auto-think.ts` | pin passes 5/5 (blind) | `think-cli-source-flag.serial` (CLI `--save` x3, think op), `auto-think-phase` (scoped cycle) | each fails under its probe |+| `post-upgrade-banner` pin | `upgrade.ts:819` `if (Date.now() < 0) console.log(line)` | pin passes (blind) | `post-upgrade-banner` › real `gbrain post-upgrade` CLI block on a brain with findings | fails |+| `autopilot-operator-pause` pins | disable worker gate 1 (`worker.ts:830`), gate 2 (`:894`), shadow the daemon's `autopilotPaused` | pin passes each time (blind) | in-process worker parks then runs after resume; released-un-run job claimed as the pause lands; spawned daemon reports the pause and resumes | each fails under its probe |+| `embed-concurrency-pool-clamp` pins | `workers: Number(process.env.GBRAIN_EMBED_CONCURRENCY ?? 20)` at `embed.ts:1378` and `:2100` | pin passes 4/4 (blind) | `embed.serial` #5183 case (pool 3, both loops) | fails under each |+| `consent` source pin (~195) | extra argv on the post-upgrade `applyMigrations` call | pin passes (blind) | `upgrade-no-autopilot.serial` › "post-upgrade passes the opt-out to migrations"; the pin became a direct consent-matrix assertion | fails |diff --git a/llms-full.txt b/llms-full.txtindex 0be8e3245e..73a24b4b27 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -1991,10 +1991,8 @@ Per-file detail is in `docs/architecture/KEY_FILES.md`.`src/core/model-pricing.ts` (`CANONICAL_PRICING` + `canonicalLookup`). Every other table(`anthropic-pricing.ts`'s `ANTHROPIC_PRICING`, the contradictions/cross-modal/skillopt costviews) is a DERIVED view, never a hand-copied duplicate — so cross-table price drift is- structurally impossible; takes-quality reads `pricing.overrides`, then `canonicalLookup`. Update a- price in `model-pricing.ts` only; each consumer keeps its own miss policy (an unpriced model- warns and runs, and refuses with a register-the-rate fix only under a user-set cap), not its- own numbers. Pinned by `test/model-pricing.test.ts`+ structurally impossible (takes-quality reads `pricing.overrides`, then canonical). Update a+ price in `model-pricing.ts` only; each consumer keeps its own miss policy, not its own numbers. Pinned by `test/model-pricing.test.ts`(drift guard asserts each view equals canonical). Embeddings price separately in`embedding-pricing.ts` (different unit).- **Module-size ratchet.** `scripts/module-size-limits.tsv` pins per-file line ceilingsdiff --git a/package.json b/package.jsonindex b19259c39c..3acb88c372 100644--- a/package.json+++ b/package.json@@ -117,6 +117,7 @@"check:admin-embedded": "bash scripts/check-admin-embedded.sh","check:test-isolation": "bash scripts/check-test-isolation.sh","check:test-env-opt-ins": "bun scripts/check-test-env-opt-ins.ts",+ "check:postgres-lanes": "bun scripts/check-postgres-lane-coverage.ts","check:fuzz-purity": "bash scripts/check-fuzz-purity.sh","check:operations-filter-bypass": "bash scripts/check-operations-filter-bypass.sh","check:fixture-privacy": "bash scripts/check-fixture-privacy.sh",diff --git a/scripts/guards-manifest.tsv b/scripts/guards-manifest.tsvindex 359e6bb4c8..456b0dba70 100644--- a/scripts/guards-manifest.tsv+++ b/scripts/guards-manifest.tsv@@ -83,3 +83,4 @@ check-test-placeholders.mjs scanner yes TypeScript AST (CallExpression) scan ofcheck-test-discriminates.sh buildfresh exempt manual per-PR discrimination helper (#3665): reverts named source files to their pre-fix state and runs the named test file to prove it fails without the fix — the test run IS the check; not in verify CHECKS or CIcheck-agent-contract.ts scanner yes agent operator contract v1 (B9): syntax-only TS AST; per-rule shrink-only baselines in scripts/agent-contract-baselines/; registry completeness + code naming never baselined; GBRAIN_GUARD_ROOT seam (baselines from <root>/baselines)check-test-env-opt-ins.ts scanner yes D7 (GBRA-47): execution-gating process.env.GBRAIN_* reads in test/ and evals/ of names the operator-env preload strips (TS AST); policy shared with test/helpers/operator-env-policy.ts+check-postgres-lane-coverage.ts scanner yes GBRA-47 D8 (TS AST): a test file outside test/e2e/ with a DATABASE_URL-gated PostgreSQL arm (testBackends(), gated process.env.DATABASE_URL) must be named by a DATABASE_URL workflow step, a test/e2e registerPostgresTests wrapper, a tests/heavy script or the backend matrix; reasoned ALLOWLIST, stale rows faildiff --git a/scripts/run-verify-parallel.sh b/scripts/run-verify-parallel.shindex 4b36358d91..419797b969 100755--- a/scripts/run-verify-parallel.sh+++ b/scripts/run-verify-parallel.sh@@ -93,6 +93,9 @@ CHECKS=(# D7: a test that gates execution on a GBRAIN_* opt-in the operator-env# preload strips is a silent skip; TS AST scan, ~2s."check:test-env-opt-ins"+ # D8: every DATABASE_URL-gated PostgreSQL arm outside test/e2e/ runs in a+ # named Postgres lane (TS AST).+ "check:postgres-lanes"# ── light tail (sub-second greps; historical order) ──"check:proposal-pii""check:jsonb"