mars
MARS-377
pg_trgm fuzzy-match infra for access-request matching (MARS-376 S3 dep)
Done normal
unassigned
Add pg_trgm extension + GIN trgm indexes on users(displayName,email,legajo) so getMatchCandidates can do scored/tiered fuzzy matching (typo-tolerant, find a returning user without an exact key hit) per Elazar directive 2026-07-03. Exact DDL spec supplied by coder-mars-cc (owns the getMatchCandidates rewrite). Reversible (drop ext+indexes). Audit pre-apply DDL review required (matching-logic + PII surface). Blocks MARS-376 S3.
Questions
No questions.
Activity
-
APPLIED 2026-07-03 (db-mars, audit PASS): pg_trgm extension in extensions schema + 2 GIN trgm indexes users_displayName_trgm + users_email_trgm, built CONCURRENTLY over direct-5432 (non-txn), schema-qualified gin_trgm_ops per audit. Both indisvalid=true. Full-table (non-partial, no deletedAt filter) BY DESIGN — MARS-181 resurrect needs soft-deleted twins visible; leak-control is NOT the index, it's the S3 getMatchCandidates WHERE + fullAccess/view-as gate (audit reviews at scored-rewrite diff). legajo trgm dropped (ID not free-text). pnpm db:export re-run locally (schema.md + reference-data.sqlite); db has no push authority → coder-mars-cc folds db/schema.md into S1/S2 push. WI closes when schema.md lands in git.
-
CLOSURE-ARTIFACT CORRECTION (coder flagged): schema.md does NOT record index DDL (tables/views/counts only), so folding it does NOT reflect the trgm indexes — that was the wrong artifact. Real repo-of-record = a numbered migration file under db/migrations/applied/ (the MARS-373-lint-scanned DDL SSOT), authored by db-mars, capturing CREATE EXTENSION pg_trgm + the 2 CONCURRENTLY GIN trgm indexes (apply-noted since CONCURRENTLY can't run in a txn migration). db-mars authors → coder folds into a push → THAT landing closes MARS-377. schema.md + reference-data.sqlite = routine export refresh, pushed SEPARATELY from S1 (keeps the Class-A code-review diff clean), non-gating.
-
pg_trgm + 2 GIN trgm indexes (users_displayName_trgm, users_email_trgm) applied CONCURRENTLY, indisvalid=true; migration-of-record db/migrations/applied/018 landed via dc16762 (audit PASS:dc16762, live 2.23.19). Unblocks MARS-376 S3 fuzzy matching.
db
6w ago by wi-cli-venus
6w ago
2026-07-03 06:23