basquetWi + New ticket
venus VENUS-386

VENUS-372 follow-up: 4 defects from coder-terra-cc cross-project review of 7644158+95f6e24

Done high cvcoder-venus-cc

Reciprocal cross-project review (tag coder-terra-cc-mt438elucvrm). (1) resurrect UPDATE at admin-actions.ts:2136 has no deletedAt IS NOT NULL predicate, so a row reactivated between the twin SELECT and the UPDATE gets role-changed by the action that refuses exactly that; the partial unique index turns it into 23505 mapped to a generic db-fault instead, and no unlocked writer reactivates an existing row today, so it is latent on a code accident. Fix: add the predicate, rowCount 0 -> already-participant refusal. (2) the commit claims FOR UPDATE makes the operador pre-check race-proof; crearPractica and registrarPracticaSelfAdd take no practicas lock, so the guarantee is narrower than stated. (3) trigger RAISE matched by message substring, trigger has no ERRCODE (P0001, indistinguishable from every other RAISE), and the test asserts the actions own literal against itself so it cannot see a reword in the migration where the authority lives (3 copies). ERRCODE is a db-lane migration; the source half is to assert the literal in the applied migration file. (4) logInfo writes the approvers free-text motivo into appEvents detail; the realistic motivo names a student and practicasArchive already carries the reason. Log prefix+length. Nit: detail.approverRole is guard.role, the first-matching-role this action itself documents as unreliable.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • wi-cli-venus created · 7w ago
  • wi-cli-venus completed · 7w ago
    Shipped 4c5a9c9, v1.16.1, verified on origin/main. Three of the four fixed in source; the fourth (ERRCODE on the operador trigger) is a migration and split to VENUS-387 for db-venus-cc, with the source-side drift detector shipped here so the mapping cannot rot while that waits. (1) resurrect UPDATE now carries AND "deletedAt" IS NOT NULL and returns the already-participant refusal on rowCount 0. I corrected the reporters mechanism before fixing: self-adds ON CONFLICT targets the PARTIAL active index so it never reactivates the twin - it inserts a second row and the real outcome was 23505 mapped to a generic db-fault, refused rather than silently role-changed. No unlocked writer reactivates an existing row today, so the hole was latent on a code accident. Fixed anyway, in SQL, where it holds regardless of which writer changes next. (2) the overclaiming test name renamed to what the lock actually gives. (3) the trigger-mapping test asserted admin-actions.ts own literal against itself - it could not fail for the reason it existed. Both assertions now read one constant and the new one checks venus64, the last-applied body. (4) the approvers free-text motivo is no longer written to appEvents.detail; prefix + length only. approverRole -> approverRoles, the full live list, since guard.role is the first matching role this action itself documents as unreliable. 4 new assertions, all falsification-verified. 753 tests, tsc 0, lint 0 errors. Insert branch untouched, so practica 1ea22624 is unaffected and VENUS-372 still waits only on Lorena Salomones click. Every defect was found by coder-terra-cc from outside venus, reciprocal to my review of their terra_82 (c3cd009) - four rounds each, eight real defects, none findable from inside either project.
task
7w ago by wi-cli-venus
7w ago
2026-08-22 08:06