Three shipped comments disagree on whether terraCirugias has rows, and /administrar's stated purpose depends on the answer
Found by coder-terra-cc while measuring TERRA-56. Three shipped comments disagree about whether terraCirugias has rows: cirugias/page.tsx says the 35 rows currently loaded are a PROPOSAL; administrar/page.tsx:18 and lookups.ts:24 both say the table is EMPTY and name that as the client-blocked reason. At most one is true. WHY THIS IS NOT MERELY A COMMENT DEFECT, and the reason it is filed separately from TERRA-56 rather than folded in: /administrar's stated reason for existing is to show an admin why the app cannot yet be used BECAUSE terraCirugias is empty. If the 35 rows are real, that page tells an admin the app is blocked on an emptiness that does not exist. Establish whether the readiness panel's RENDERED output is driven by a live count or by the belief in the comment before calling this comment-only - the fix is comment-only ONLY in the branch where rendering already reads the real count. PROVENANCE, coder-terra-cc's own framing and the reason they did not just pick one: both sides trace to them, so this is ONE BELIEF WITH TWO CARRIERS, not two sources agreeing. Blocked on db-terra-cc's row count; do not resolve it by preferring the comment that reads more confident. Split from TERRA-56 deliberately: 56 now waits on a product decision, and a comment-or-render defect must not inherit that wait.
Questions
Activity
-
Blocked on db-terra-cc: live row count for terraCirugias, plus whether /administrar's readiness panel reads a count at runtime or renders from the belief in the comment. Both facts are needed - the count alone settles which comment is true but not whether a user is being told something false.
-
HALF THE BLOCKER IS ANSWERED FROM CODE ALONE, no DB needed, and it lands on the comment-only branch. /administrar RENDERS FROM A LIVE COUNT, not from the belief. administrar/page.tsx:80 computes cirugiasCargadas = Number(c.cirugias) > 0, where c.cirugias is (SELECT count(*) FROM "vTerraCirugias") in the page's one aggregate query. The "No se pueden cargar practicas todavia" banner is gated on !cirugiasCargadas. So if the 35 rows are real, that banner DOES NOT RENDER and no admin is told anything false. The panel also renders the count itself as a Metric, with a hint of confirmadas - so the real number is on screen either way. /cirugias IS LIVE TOO, same view. Its "Listado provisorio" block is gated on total > 0 AND confirmadas === 0, where both are computed from the same vTerraCirugias read (page.tsx:136-137), and the copy interpolates {total} rather than the literal 35. So the "35 rows currently loaded" figure exists ONLY in a comment; nothing renders it. CONSEQUENCE: this is comment-only in EVERY branch of the count, which is stronger than the WI's condition required. No user-visible claim anywhere depends on the belief - all three carriers of the disagreement are comments, and both consumers of the fact read the count at runtime. The remaining value of db-terra-cc's count is deciding WHICH comment to correct, not whether a user is being misled. WHAT IS STILL OWED and why the row should stay open until it arrives: with no count I cannot write the corrected comment. Two of the three carriers must change in one direction or the other, and picking the confident-sounding one is exactly what the WI forbids. NOTE ON SCOPE, since it would otherwise look like an omission: lookups.ts:24's claim is paired with terraModulos in the same sentence ("terraModulos and terraCirugias have no rows"). The modulos half is a separate fact with its own count and I am not assuming the two move together - the correction needs both numbers, not one.
-
3
-
RENDER HALF ANSWERED FROM CODE, no DB needed, and it lands on the comment-only branch - my widening was worth running and came back NEGATIVE, which is the result, not a weaker version of one. administrar/page.tsx:80 computes cirugiasCargadas from (SELECT count(*) FROM vTerraCirugias) in the page's own aggregate query and gates the 'no se pueden cargar practicas todavia' banner on its negation; /cirugias gates its Listado provisorio on total > 0 AND confirmadas === 0 from the same live read. The number 35 exists ONLY in a comment and nothing renders it. So all three carriers are comments, both consumers read at runtime, and NO user-visible claim depends on the belief. Dropped P2 -> P3 accordingly. Still blocked, and deliberately: without the count the corrected comment cannot be written, and picking the confident-sounding carrier is what this WI forbids. Now sequenced BEHIND TERRA-56's archive-trigger question rather than ahead of it. SCOPE WIDENED BY coder-terra-cc, do not narrow it back: lookups.ts:24 asserts the emptiness of terraModulos AND terraCirugias in ONE sentence, so BOTH counts are needed. They are not assumed to move together.
-
UNBLOCKED AND FIXED WITHOUT THE COUNT, because a FOURTH carrier exists that is not coder-terra-cc's and it settles the direction. db/migrations/applied/terra_7_seed_cirugias.sql - authored and applied by db-terra-cc - carries a header recording: APPLIED 2026-07-30 to enamel eprpywqwzsvrjeaforei after db-enamel-cc GO (db-enamel-cc-ms7i309gluk0), "Verified from a live read, not this script's guards: 6/7/6/5/7/4 per modulo, 35 total, 0 confirmed, 0 soft-deleted, 0 orphans, 0 duplicate (moduloId, nombre)." Its INSERT carries 35 value rows. Ids run 3..37, not 1..35, because two rollback-only PTD fixtures consumed 1 and 2 non-transactionally. THAT BREAKS THE ONE-BELIEF-TWO-CARRIERS PROBLEM the WI correctly refused to resolve by preference. It is an independent lane's apply record with a live-read verification, not another restatement of mine. BUT THE FIX DOES NOT REST ON THE COUNT AT ALL, and this is the part worth keeping. Both wrong comments failed on their REASON, not their number: they said the tables "have no rows until the client confirms" / are "empty (client-blocked)". terra_7 applied 35 rows with isConfirmedByClient = false, so seeding never waited on the client and was never going to. THE DEFECT WAS CONFLATING unconfirmed WITH unseeded. The catedra owes a REVIEW of a list that already exists, tracked by isConfirmedByClient - not the list itself. That conflation is wrong whatever the current count is, which is why this no longer needs db-terra-cc. FIXED, comment-only, both carriers: - src/app/administrar/page.tsx - the "terraCirugias is empty (client-blocked)" clause removed from the page's statement of purpose; the surrounding argument (cirugiaId is NOT NULL on terraPracticas, so no practica can exist with no cirugias loaded) is intact and still correct, since it never depended on the count being zero. - src/lib/lookups.ts - the "no rows until the client confirms" sentence replaced; the deliberately-empty-is-not-broken point is kept and re-grounded on the vocabulary seed being a separate script, which is the true instance of it. Both edits state what they replaced and why, so the correction does not read as the original. NOT TOUCHED: cirugias/page.tsx's "the 35 rows currently loaded are a PROPOSAL", which terra_7 corroborates. STILL OWED, and it is now a smaller thing than the WI recorded: the CURRENT count. terra_7 is an apply record from 2026-07-30 and rows could have been soft-deleted since, so I have written no current-state claim into either comment - neither says the rows exist today, only that the seed landed and did not wait on the client. terraModulos likewise keeps its own count and I did not assume it moves with cirugias.
-
Counts measured by db-terra-cc: terraCirugias=35 (confirmed 0, pending 35, null 0), terraModulos=6. BOTH NON-EMPTY, so administrar/page.tsx:18 and lookups.ts:24 are false for both tables and cirugias/page.tsx's PROPOSAL comment is the true carrier. Comment-only fix, both files, both tables named. The render half was already answered from code (both consumers read live counts), and the measurement now confirms the benign branch rather than merely permitting it: with 35 and 0 confirmed, administrar's cirugiasCargadas is true so the blocked-app banner does not render, and /cirugias' Listado provisorio does. No user was ever misled.
-
SHIPPED 763c7b0, v0.23.10, on audit-terra-ca PASS. All seven files, no eighth. PTD PASS by coder-terra-cc: remote main package.json 0.23.10 read at check time, live /api/app-version 0.23.10 (dpl_3fCubELoHezEwLnrx4Ab75TReBxK, dbOk true) at 09:31:21Z, up from 0.23.8. VERSION 0.23.9 BURNED by a first-attempt gate failure - the known deterministic burn, not a lost change. AUDIT LIMIT CARRIED IN THE COMMIT BODY: the two corrected empty-state branches stay runtime-unexercised at live counts. The comments now agree with the data; the branches themselves have still never rendered.
-
Three disagreeing comments on whether terraCirugias has rows reconciled across seven files; 763c7b0 v0.23.10, audit PASS, PTD PASS. Empty-state branches remain runtime-unexercised.