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.

Think
11m
Plan
5m
Build
47m
Verify
30m

Assertion ledger

12 claims, each independently verified. Showing 8 — show all →

IDSaysMatcher
A001Quoted schema-qualified Supabase tables are counted by table nameverifiedok
A002Supabase migrations with sixteen creates and two drops report fourteen surviving tablesverifiedok
A003Supabase migration detection keeps the migration directory pathverifiedok
A004Non-public schema prefixes count the table instead of the schemaverifiedok
A005Quoted public schema prefixes count the table instead of publicverifiedok
A006Schema-qualified dropped tables are removed from the surviving countverifiedok
A007A table dropped and recreated later still survivesverifiedok
A008Generic SQL fallback uses the same table identifier handlingverifiedok

Findings 2 total

debtpackages/cli/tests/engine/detectors/detection-overrides.test.tsscope
Temp fixture isolation depends on the package-manager detector's current five-level parent walk
obspackages/cli/src/engine/scan-engine.tsclosed
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