v0.9.0
Highlights
scythe lintnow runs the canonical audit rule packs by default, dialect-gated by the configured[[sql]].engine. Rules whosedialectslist excludes the engine are silently skipped, so amysqlproject does not see postgres-onlySC-MIG*findings. No CLI flag — the rules ship indefault_registry()and respect the existing[lint]severity overrides.- New
scythe-auditpre-commit hook published via.pre-commit-hooks.yaml. Runs the SC-SEC*/SC-RLS*/SC-MIG*/SC-CHK* packs over staged.sqlfiles without requiring ascythe.toml. Defaults to postgres; override per-hook withargs: [--dialect, mysql]. - Three new audit rule packs land in this release:
- Row Level Security — SC-RLS01 policy-references-user-metadata, SC-RLS02 policy-always-permissive, SC-RLS03 policy-uses-uncached-auth-function. Walks
CreatePolicy.using/.with_checktypedExprASTs; SC-RLS03 stops atExpr::Subqueryboundaries (the safe form). - CHECK quality — SC-CHK01 check-constraint-always-true. Catches column-level, table-level, and
ALTER TABLE ADD CONSTRAINTCHECKs whose expression is a tautology (true,1 = 1,NULL, or parenthesised variants). Lives in a newAntipatterncategory. - Splinter-inspired security/migration ports — SC-SEC12 function-search-path-mutable, SC-MIG19 unsupported-reg-types. Detection logic is clean-room reimplementations against
sqlparserASTs (splinter has no LICENSE file; ATTRIBUTIONS.md documents the courtesy attribution).
- Row Level Security — SC-RLS01 policy-references-user-metadata, SC-RLS02 policy-always-permissive, SC-RLS03 policy-uses-uncached-auth-function. Walks
- Migration safety rule pack extended from SC-MIG01..05 to SC-MIG01..19, covering NULL-contract integrity, column-type preferences, constraint-lock hazards, and reg* OID type bans alongside the original DDL hazards.
- Oracle bindings upgraded to sibyl 0.7. The codegen emitter was rewritten for sibyl 0.7's API breaks:
sibyl::preluderemoved,Varchar::as_str()no longer returnsResult,Date::timestamp()replaced withdate_and_time()tuple + chrono. The integration test selects["tokio", "nonblocking"]because sibyl 0.7'simpl Debug for LOBrequires one of those cfgs to compile at all. Trade-off:decimal → f64in the Oracle manifest because sibyl 0.7 has noToSql/FromSqlforrust_decimal::Decimal. - sqlx 0.8 → 0.9 in the Rust integration test crates. sqlx 0.9 tightened
raw_sql/queryto requireSqlSafeStr; templates wrap runtime strings withsqlx::AssertSqlSafe. - Five
test_enginescodegen test failures resolved. MSSQLDATETIMEOFFSET→datetime_tz, RedshiftSUPER→json, OracleNUMBER(p, s)→decimal(was falling through to the unknown-type fallback). Two stale fixture expectations corrected. - Pre-commit hook chain aligned with the polyrepo's shared source. Nine individual hook repos consolidated to
kreuzberg-dev/pre-commit-hooks v2.1.10for general/markdown/rust/shell/actions/typos/ai-rulez.rustdoc-lint,markdownlint-rumdl-strict, andrust-max-linesare listed but commented out with TODOs covering the gaps (~449 missing-doc errors, 35 long-line MD files, 4 source files over 1,000 LOC) — each is its own focused remediation.
See CHANGELOG.md for the full per-rule, per-matcher breakdown.
Upgrade notes
- Pin pre-commit hooks to
rev: v0.9.0to pick upscythe-audit. - Oracle users on Rust: sibyl 0.7 +
nonblockingfeature is required. The integration test still expects Oracle Instant Client at link time. mysql/sqlite/mssqlprojects:scythe lintwill start running the dialect-agnostic audit rules (SC-SEC01/02/03/06/07/08/09 and SC-CHK01). All postgres-specific rules are silently skipped.