Fix SQL table counting regex
The SQL schema counter under-reports real tables when migrations use schema-qualified quoted identifiers. In Supabase-style SQL, `CREATE TABLE "public"."page"` is counted as `public` instead of `page`, collapsing multiple tables into one set entry. Supabase therefore shows 10 models when the surviving table count should be 14.
verdict PASSscore 12 / 12findings 2 (0 risk · 1 debt · 1 obs)duration 1h 44mrejection cycles 1shipped Jun 3, 2026surface cli
Pipeline timeline
Intent to proven code in 1h 44m across Think, Plan, Build, and Verify.
Think11m
Plan5m
Build47m
Verify30m
Assertion ledger
12 claims, each independently verified. Showing 8 — show all →
| ID | Says | Matcher | |
|---|---|---|---|
| A001 | Quoted schema-qualified Supabase tables are counted by table name | verified | ok |
| A002 | Supabase migrations with sixteen creates and two drops report fourteen surviving tables | verified | ok |
| A003 | Supabase migration detection keeps the migration directory path | verified | ok |
| A004 | Non-public schema prefixes count the table instead of the schema | verified | ok |
| A005 | Quoted public schema prefixes count the table instead of public | verified | ok |
| A006 | Schema-qualified dropped tables are removed from the surviving count | verified | ok |
| A007 | A table dropped and recreated later still survives | verified | ok |
| A008 | Generic SQL fallback uses the same table identifier handling | verified | ok |
Findings 2 total
debtpackages/cli/tests/engine/detectors/detection-overrides.test.ts→ scope
Temp fixture isolation depends on the package-manager detector's current five-level parent walk
obspackages/cli/src/engine/scan-engine.ts→ closed
Lifecycle ordering relies on lexicographic SQL file sorting, which can misorder unpadded migration filenames such as 10 before 2
Integrity seal
scopesha256:a2b5509a4fbc9...
contractsha256:ed2ac00b79c71...
plansha256:a396c33d2b828...
specsha256:22cdcd729fd4d...
build-reportsha256:8ece71a1b10db...
build-datasha256:f8f57f2a1ccc6...
verify-reportsha256:fff28c5e5e49b...
verify-datasha256:ca6a17ab0a4e0...
audit cmd$ ana proof audit fix-sql-table-counting-regex → all hashes match