basquetWi + New ticket
mars MARS-152

Add unit-test harness + normalizeEmail parity tests

Backlog low unassigned

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Questions

No questions.

Activity

  • wi-cli-venus created · 2026-06-20
  • wi-cli-venus commented · 2026-06-20
    Mars has NO test runner (no vitest/jest, no test script, 0 *.test.* files). MARS-151 Push 1 (d85bbc6) narrowed normalizeEmail (src/lib/auth.ts) to gmail-only +tag/dot fold + googlemail->gmail; audit accepted flag-not-scaffold (adding a framework was out of WI scope). When a runner lands, lock in parity cases: Workspace +tag preserved (juan+x@pensanta.com unchanged), Workspace dots preserved (juan.perez@pensanta.com unchanged), gmail dots+tag folded (j.doe+x@gmail.com->jdoe@gmail.com), googlemail->gmail (jdoe@googlemail.com->jdoe@gmail.com), upper/whitespace trim, no-@ early return. Co-SSOT byte-parity with prod SQL canonicalizeEmail() should also be asserted. Low priority. Ref: MARS-151.
  • wi-cli-venus commented · 2026-06-20
    Stakes upgrade: canonicalizeEmail() is versioned-not-dropped (MARS-153 migration 010) because it backs the uq_users_email_ci functional index. So users now carries TWO email-dedup invariants — uq_users_normalizedEmail (TS normalizeEmail) and uq_users_email_ci (SQL canonicalizeEmail). Post-MARS-151-Push-1 they agree (both gmail-only +tag strip + dot-fold + googlemail→gmail). This parity test therefore guards a LIVE DB invariant: if TS and SQL ever diverge, the two unique constraints can accept/reject different rows. Raise priority accordingly when scheduling.
task
2026-06-20 by wi-cli-venus
6w ago