pluto
PLUTO-528
Operador may create práctica with 'Sin asistente' (null asistente); null-safe all KPIs/queries/reports/filters
Done high
cpcoder-pluto-cc
Client business-rule change (Elazar 2026-07-06): when an operador creates a práctica, they may choose 'Sin asistente' (no assistant student). GOAL: (1) surface the 'Sin asistente' option in práctica creation for operadores; (2) NULL-SAFETY sweep — a null/absent asistente must NOT break any KPI, query, report, filter, export, or join. Null-in-asistente has caused unexpected bugs before (Elazar). Class-A: likely asistente-nullability DDL + multi-surface read audit -> full team (db owns any DDL, audit does adversarial null-consumer sweep, pre-impl design ping + diff review). Open design forks for PM: representation (NULL vs sentinel value) + KPI semantics for an asistente-less práctica. Investigate-then-propose before wide fix.
Questions
No questions.
Activity
-
Phase-1 complete (db + audit independent sweeps, cross-confirmed). Decisions locked: asistenteId->NULLABLE (NULL storage, not -1 sentinel); sinAsistente = STORED generated boolean (=asistenteId IS NULL), Elazar's calc-field, first-class aggregatable + partial index; natural-key unique idx rebuilt NULLS NOT DISTINCT (dup-guard holds for sin-asistente); vPracticasCompletas+vPracticasList INNER->LEFT JOIN (root-cause: today a null-asistente práctica VANISHES app-wide); vPracticaParticipantFacts + opAsAst null-guards. Partition: db=T0 (migration 054, one archive txn) + verify getStudentKpis/getTeacherReportStats fn bodies; coder=T1 validation (teacher-mode decouple from !!asistenteId + form 'Sin asistente' option) / T2 op-asist-balance / T3 render, types/db.ts string|null flip first as compiler lever; T4 do-not-touch. Landing: migration applies FIRST then code push. Gate before apply: audit pre-apply PASS + my go.
-
SCOPE confirmed by Elazar: 'Sin asistente' gated on the 'Tu rol' selector in the student self-log práctica-creation form. rol=Operador -> asistente optional, 'Sin asistente' available -> asistenteId null (student did procedure solo). rol=Asistente -> operador REQUIRED, not nullable. Only asistenteId is ever null; operadorId always NOT NULL (matches schema). Coder's earlier teacher-created-path read dropped as inverted. Coder building full impl against this; still gated on migration 054 apply + audit diff review before push.
-
Sin asistente: students self-logging as operador may now create a práctica with no asistente (null). Migration 054 (asistenteId nullable + sinAsistente STORED gencol + NULLS-NOT-DISTINCT dup-guard + partial KPI index + INNER->LEFT view joins + fn guards) applied & verified; app-side null-safe create/render/KPIs + per-student sinAsistente KPI column. v2.4.0 SHA 74bae7b, audit PASS.
bug
6w ago by wi-cli-venus
6w ago
2026-07-06 13:25