Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
1.3 KB
Raw Blame

Raw SQL outside the database engines can no longer grow unseen: two new checks count it per file, and a count goes up only with a written reason.

For contributors

  • bun run check:engine-raw-sql-ratchet (in bun run verify) counts, per file under src/ outside the engines, executeRaw / executeRawDirect / executeRawJsonb calls, SQL tagged templates and direct driver calls with SQL text. The baseline is scripts/engine-raw-sql-baseline.tsv (5,606 sites in 1,205 files at this commit). A new site fails; call or add a typed engine method instead, with its SQL in src/core/engine-sql/<domain>.ts. When a count falls, lower its row (--prune). When a fix must add a site before its area moves into the engines, raise the row in the same pull request with a note saying why.
  • bun run check:engine-kind-branches (in bun run verify) does the same for two-way 'pglite' / 'postgres' comparisons on an engine kind (397 in 223 files), so a third engine never falls silently into one of them. Ask a capability question, or switch over every engine kind with a default clause that opens with a never check on the switched value (such a switch does not count).
  • Both checks share one runner, scripts/lib/count-ratchet.ts. See docs/ci-guards.md, "Engine raw-SQL ratchet" and "Engine-kind branches".