Audit template
data
Audits whether your data can become wrong, lost, or leaked — and proves it with queries.
Maps to: ACID/CAP · RLS
How this audit works
An engine-agnostic swarm reviews the data layer across eleven dimensions: schema and normalization, data types and precision, constraints and referential integrity, keys and identity, migration safety, transactions and concurrency, integrity in practice, data protection, lifecycle and deletion, pipelines, and backup/recovery. The lens is correctness, not query speed — every place the database allows invalid, orphaned, or inconsistent state is a finding, cited to a migration file, a constraint, or a redacted row pattern. P0/P1 findings name a concrete data-loss, corruption, or leak path and survive adversarial verification before they ship.
Use it when
Before a risky production migration
You're about to add a NOT NULL column, rewrite a large table, or run a destructive backfill. The audit checks each migration for locking and blocking risk, reversibility, and a rollback path, and flags any destructive operation with no safety net — sequencing the fix as an expand/contract plan with backfill and rollback.
After bad rows show up in reporting
Billing reconciliation breaks or a join returns rows that shouldn't exist. The audit reasons about — and with read-only access spot-checks for — orphans, duplicates, and nulls in required fields, traces them to a missing FK, UNIQUE, or NOT NULL constraint, and ships the cleanup query plus the constraint that stops it recurring.
Multi-tenant SaaS handling PII
Before a compliance push or a security review, the audit checks that tenant isolation is enforced in the data layer rather than trusted to app code, that sensitive columns aren't stored in plaintext, and that a GDPR right-to-erasure can actually delete a user everywhere — including backups, logs, and analytics.
What you get
A scorecard graded per dimension plus prioritized GitHub issues, each with evidence, severity, a before/after fix, and migrations sequenced with their safety plan.
