terraCirugias needs nullable requierePieza/requiereRegion so the zona pickers render per cirugia instead of showing both always
ELAZAR DIRECTIVE 2026-08-22: "i want the diagrams to show based on what kind of choices the user makes". Today the practica form renders the odontogram AND the region chips side by side for every cirugia, with a flat at-least-one rule. For the common case - one lower-right molar - the region axis is pure screen noise, which is the objection. THE CLASSIFIER IS THE CIRUGIA, NOT A USER-CHOSEN MODE. Ruled against a three-option mode selector by all three fleet coders (coder-venus-cc mt46w0uecnph, coder-mars-cc mt46wx0oc9hj, coder-pluto-cc mt46wct422xx): a mode is form state, not clinical state, it asks the user to classify their own description before making it, and its safe implementation (never clear on switch, refuse submit on hidden non-empty values) is elaborate enough to be its own argument against. Venus already solved this the right way and has for months: cirugiasCategorias.requierePieza/.requiereRegion, read SERVER-SIDE in practica-actions before validation, per surgical category, with both-required a legal combination - which is how venus keeps the full-arch case (implants at named piezas across a whole arch) expressible without anyone declaring a mode. Terra has no equivalent: terraCirugias is (id, moduloId, nombre, isActive, isConfirmedByClient, createdAt, deletedAt). ASK: add "requierePieza" bool NULL and "requiereRegion" bool NULL to terraCirugias, expose both through vTerraCirugias, and SEED NOTHING - every row stays NULL. NULL IS LOAD-BEARING AND IS NOT "false": it means "the catedra has not told us", and the app renders BOTH axes with the current at-least-one rule for a NULL row, i.e. today behaviour exactly, zero regression on all 35 rows. Nullable rather than NOT NULL DEFAULT false because a default of false asserts a clinical fact about 35 rows nobody has confirmed, and false/false would be unsatisfiable against at-least-one. WHY NOTHING IS SEEDED: the 35 cirugias are a provisional seed the CLIENT HAS ALREADY SAID IS WRONG (TERRA-75 - Puia supplied a corrected mapping, Drive source not in hand), so filling these flags today means guessing clinical rules for rows about to be replaced. The flags get their values from Puia in the same round as the corrected cirugia list; that is one extra column on a request already outstanding, not a new round trip. ACCEPTANCE: (1) both columns added, both NULL on all existing rows, asserted at apply time by count; (2) vTerraCirugias exposes them - check whether the view is SELECT * (terra_1:108) and therefore picks them up automatically, and say which; (3) no enamel-visible change - terraCirugias is terra-owned, state that measurement rather than assuming it; (4) cite the tag in-file per the gate. App half is mine, same round: the zona section renders odontogram-only / region-only / both from the selected cirugia flags, with an "Agregar region" escape in piezas-only mode because a wrong flag must not make a real case unexpressible.
Activity
-
parent=#2717
-
Applied 2026-08-22 ~07:38 ART, supabase_migrations version 20260822102849. Checksum verified: md5(stored)=300ab3e25fddee474bb69d5bad5f59db len=7982, matched raw md5sum of reconstructed submitted text byte-for-byte. Live: 35/35 rows NULL on requierePieza/requiereRegion, vTerraCirugias exposes both (view was NOT SELECT * - explicit col list, recreated). No enamel-visible change: pg_class.relacl (aclexplode) shows only postgres+service_role on terraCirugias and vTerraCirugias, PUBLIC/anon/authenticated absent. Citation gate PASS rc=0. audit-terra-ca PASS audit-terra-ca-mt48iwh7n49p (rev3, sha256 77fb151c0d07e33c267d093ed75e57cfb26a7be5a9b615d479d4797cf9e44643) after 2 BLOCKs on arm3 (filtered information_schema view, then INNER JOIN dropping PUBLIC oid 0) both fixed. File in db/migrations/applied/terra_34_cirugias_zone_flags.sql. Handing to coder-terra-cc for push; not closing until push SHA confirmed.
-
Pushed 091a572 (0.24.20), confirmed by coder-terra-cc. Independently re-verified before commit: 2 flag cols on vTerraCirugias, 35/35 both-NULL, zero column_default.
-
completed