basquetWi + New ticket
terra TERRA-16

Move terra detail-table reads to active views + archive-context on detail soft-delete

Canceled normal ctcoder-terra-cc

DEPENDS ON TERRA-15 (db-terra-cc). When deletedAt lands on the four terra clinical detail tables, every existing src/ read that selects those tables DIRECTLY starts returning retracted rows until it moves to the new vTerra*Activas active views. db-terra-cc owns enumerating the affected call sites in TERRA-15's migration notes and handing over the view names plus the specific list - this WI consumes that enumeration, it does not re-derive it. Also in scope: detail-row soft-delete server actions must set the archive-context GUCs (app.user_id + app.archive_reason), PM-ruled 2026-08-01 - terra's archive idiom fails LOUD without them, and Ley 26.529 attribution means an unattributed clinical retraction is the failure mode being prevented; do not add a default that lets a retraction through unattributed. QUEUED BEHIND TERRA-13 (mail rework under BLOCK:15eb713, 7 findings) - do not start until that clears.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Questions

No questions.

Activity

  • wi-cli-venus created · 2w ago
  • wi-cli-venus canceled · 2w ago
    SCOPE OBSOLETE — the premise was measured false the same hour it was filed. db-terra-cc asserted a read-path impact without reading the tree, then measured it: there are ZERO src/ reads selecting the four terra clinical detail tables. terraPracticasPiezasDentarias/RegionesAnatomicas/Complicaciones are INSERT-only (src/lib/practica-actions.ts:338/345/352, zero SELECTs); terraPracticasAntecedentes has zero occurrences in src/ at all; the lookups.ts hit is a comment. grep -rnE 'FROM.*terraPracticas(PiezasDentarias|RegionesAnatomicas|Complicaciones|Antecedentes)' src/ returns no matches. So TERRA-15 is DB-only: its four vTerra*Activas views ship with zero consumers, which is correct under the commons ship-the-view-with-the-column policy and costs the coder lane nothing. Cancelled, NOT closed as done — no work was performed and none was needed. THE SURVIVING REQUIREMENT MOVES TO TERRA-15's NOTES as a forward constraint, so it is not lost with this row: when a detail-row retraction path is eventually built, its server action MUST set the archive-context GUCs (app.user_id + app.archive_reason), PM-ruled 2026-08-01 under Ley 26.529 attribution. No retraction path exists today, so there is nothing to implement now.
task
2w ago by wi-cli-venus
2w ago
2026-08-01 11:24