basquetWi + New ticket
mars MARS-2

Evidence-route grading: auto-assign stuck noRevisado practicas off zero-review JTPs to active graders (resolver + daily cron + heal)

Done normal unassigned

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Questions

No questions.

Activity

  • wi-cli-venus created · 2026-06-05
  • wi-cli-venus spec · 2026-06-05
    CONVERGED DESIGN (pm+coder+db brainstorm 2026-06-05). PROBLEM: 53 open noRevisado practicas are assigned to a JTP who has NEVER graded anything (never_graded_jtp) - present-but-inert teachers, not missing/departed. 41 of 53 under two: ARIAS Giselle (25, comision C), Yanina Olexen (16, comision E). They sit ungradeable forever; no admin exists to reassign. Elazar directive: assign data-to-data by EVIDENCE, route to active graders, the active teacher (or student) is the feedback loop - he accepts a teacher may grade a student they didn't supervise ('their own lookout; student/teacher will contact me'). TRIGGER: open(noRevisado) practica whose assigned jtpUserId has ZERO lifetime practicaReviews rows (global-zero = conservative; teacher active elsewhere is NOT swept) OR jtpUserId null/departed/soft-deleted (empty today, kept for forward guard). rectificar EXCLUDED (awaits student, teacher already acted). RESOLVER (resolveEvidenceGrader, src/lib/evidence-grader.ts): rung1 continuity = teacher who graded THIS student's prior practica in THIS comision if still active jtp (inline subquery) -> rung2 = comision top-3 active graders (reviews>0) round-robin (TARGET_POOL=top3, avoids dumping C's 26 on one) MINUS exclude-list (Elazar userId + non-person/dept accts) -> rung3 residual = no valid human target -> surface comisiones_orphan / needs-staffing, DO NOT fabricate. comision 2026's 5 (institutional 'Endodoncia FOUBA' acct, only grader=Elazar) collapse to rung3 by construction once Elazar excluded. CONVERGENCE: self-extinguishing predicate (post-route JTP has reviews>0 -> never re-selected) + once-only guard (NOT EXISTS practicasArchive WHERE archiveReason='data-heal:evidence-route'). Both. ARCH: (1) heal-now = first cron run, NO grace (all 53 already 0-review; db confirming all >21d). (2) daily Vercel cron /api/cron/evidence-route-graders, CRON_SECRET auth, graceDays=21 (protects freshly-assigned willing teacher). (3) practica-create guard = null insurance. Audited setArchiveContext data-heal:evidence-route, OPEN-only, never touch graded/closed. KEEP prior brainstorm view fixes as monitoring surface: (A) LEFT-JOIN vPracticasSinEvaluar (nulls visible as 'sin asignar'), (B) vHealthPracticasStale exclude aprobado/desaprobado (drops 108 noise, keeps 16). LANES: coder = src/lib + src/app/api/cron + scripts + vercel.json. db = (A)/(B) view DDL + never_graded_jtp predicate + rung-2 rankings + schema.md re-export. PUSH GATED on Elazar explicit ship-go (prod data-heal 53 rows + new cron). Audit per push-to-done.
  • wi-cli-venus spec · 2026-06-05
    AMENDMENT (coder impl review): (1) DROP the once-only archive-pin originally specced — it would BLOCK a legitimate re-route if a target grader later departs (re-stranding the practica). Convergence guarantee is the self-extinguishing predicate ALONE (post-route jtp has reviews>0 -> never_graded branch false -> not re-selected; only re-enters if target structurally departs, which we DO want to re-route, always to a reviews>0 target -> no A->B->A ping-pong). No archive-pin. (2) CRON AUDIT ACTOR: lean (a) NULL archivedBy + explicit reason data-heal:evidence-route (honest automated, no human actor) pending db confirming the archive trigger tolerates empty app.user_id; fallback (b) dedicated Sistema service-user hard-filtered from vUsers + zero roles. (3) EXCLUDE-LIST: systemSettings key evidenceRouteExcludedGraders (JSON uuid array, default []), adjustable without push; db seeds Elazar + Endodoncia-FOUBA userIds. PUSH gated on Elazar explicit ship-go.
  • wi-cli-venus spec · 2026-06-05
    DATA CORRECTION (db package): (1) COUNT = 44 noRevisado, not 53 — the 9 rectificar excluded per spec (awaiting student, not stuck). Distribution C=26 (ARIAS Giselle 25 + Emilio Manzur 1), E=16 (Yanina Olexen), B=1, F=1. 41 of 44 under two inert teachers. (2) 2026 OUT OF SCOPE — its 5 'stuck' are all rectificar; zero noRevisado; the Endodoncia-FOUBA/route-to-Elazar question is moot. (3) AGE: only 6 of 44 are >21d BUT all inert teachers joined 2026-03-19 (77d ago) — not new — so heal-now = NO grace, all 44 route. GRACE (cron forward-mode only) keys off TEACHER inert-tenure (>21d as 0-review member), NOT práctica age. (4) PREDICATE confirmed global-zero: NOT EXISTS(SELECT 1 FROM practicaReviews pr WHERE pr.reviewedBy = p.jtpUserId). (5) TCM role join: JOIN lookupOptions lo ON lo.id=tcm.roleOptionId AND lo.category='role' AND lo.value IN ('jtp','ayudante'). (6) Exclude-list seed: Elazar userId 24b7e241-35c0-4e58-92f7-9ebf75ed0263 (+FOUBA). B has only 2 valid rung-2 targets after exclude -> TARGET_POOL=min(3,available).
  • wi-cli-venus decision · 2026-06-05
    APPROACH REVERSED by Elazar (2026-06-05 05:58). Auto-route/cron design SCRAPPED before any push (push was gated on ship-go which never came; nothing shipped). Elazar verbatim: '(1) not a data problem, it is a teacher not doing its job. (3) this is an email and whatsapp to client, Titular, Pablo. (5) [cron] keeps doing what?'. NEW DIRECTION: the inert teachers (ARIAS Giselle 25 ungraded/77d, Yanina Olexen 16) are non-performing STAFF, not a data hole. Fix = escalate to the comision Titular (responsible head, e.g. Pablo for comision C) via email+WhatsApp listing their teacher's ungraded practicas. NO reroute, NO cron, NO view DDL. Rationale: auto-routing hides non-performance + overloads diligent teachers. Re-scoping MARS-2 to escalation/comms: db pulls Titular-per-comision + contacts + per-inert-teacher ungraded counts + the 5 comision-2026 practica prod URLs; PM drafts Titular escalation email for Elazar approval (client-facing), WhatsApp text prepped for Elazar to send (no WA channel).
  • wi-cli-venus completed · 2026-06-05
    Reversed from auto-route to escalation (Elazar: non-performing-teacher problem, not a data hole). No code shipped for the auto-router (scrapped, tree cleaned). Outcome: the real backlog (11 inert teachers / 115 prácticas sin calificar across comisiones B-G, surfaced by the MARS-3 grader-attribution fix) was compiled into a numbers-only report by comisión and delivered to the cátedra Titular Dr Pablo Alejandro Rodríguez by Elazar via WhatsApp. Numbers verified 3x (live /informes, db map, coder arithmetic). Contact line corrected (email typo + AR WhatsApp 9-prefix).
task
2026-06-05 by wi-cli-venus
6w ago
2026-06-05 10:18