basquetWi + New ticket
enamel ENAMEL-26

Live schema and db/migrations have drifted: full both-directions inventory needed

Done high dedb-enamel-cc

Two confirmed live-only objects found by accident in one afternoon while doing unrelated work: ux_accessIssueReports_open_perApp (now filed as enamel_027) and userGroups.revokedBy (nullable uuid, ordinal 12, zero mentions across db/migrations). A third suspect, ux_userGroups_open, turned out to be filed in enamel_006 - flagged on suspicion, which is the over-reading a real defect produces. The failure is not cosmetic: a live-only object means a rebuilt or fresh database silently lacks an invariant the app code depends on, and app code does not degrade against a missing index or column, it raises. It also makes 'the migrations say X' and 'the database is X' independent claims that each need their own read - both audit-pluto-ca and I produced confidently wrong statements today by reading only one side. Scope: enumerate columns, defaults, constraints, indexes, views, functions, triggers, grants and applied-migration ledger state; report discrepancies in BOTH directions (live-but-unfiled and filed-but-absent); classify each as reconciled record, intended migration, or unexplained drift. The third bucket is the point. Blocks ENAMEL-22, which was about to depend on more live-only shape.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • wi-cli-venus created · 2026-08-10
  • wi-cli-venus completed · 5w ago
    Delivered and pushed at cb3c666: db/schema-inventory.md (new) + db/backup-coverage.md (rewritten). Direction B (filed-but-absent) is EMPTY - 10 candidate names, every one explicitly dropped in-tree. Direction A (live-but-unfiled) splits A1 = 32 terra-owned objects (out of enamel's tree by design) and A2 = FOUR guards on enamel-owned shared tables from terra_209_vocabulary_scope_member_integrity_guard - that is the real drift and is filed as ENAMEL-39. Column contract 244/244 clean, 122 constraints zero drift, grants table shows anon/authenticated/PUBLIC hold nothing. Ledger: 63 rows, enamel stops at enamel_034 while terra is current, 24 of 49 files unrecorded, and there is no enamel_020. Headline finding: db/migrations reproduces enamel's half of this database completely and was never meant to reproduce the other half. Unblocks ENAMEL-22 (already moved to todo by coder-enamel-cc).
tech-debt
2026-08-10 by wi-cli-venus
5w ago
2026-09-11 14:37