review:locked-by-student strands práctica ungradeable on abandoned student edit (no lock TTL/override)
Live bug, Elazar actively reproducing (blocked 20:07Z 2026-07-20 on v2.51.0). review:locked-by-student guard strands a práctica permanently ungradeable when a student abandons an edit session. Evidence (db-mars diag): práctica 4ab46a3d — student Cande Ambrosino clicked editar 19:36:14 then ZERO further activity; two reviewers (JTP María Sol ×6 19:48-19:56, Elazar ×2 19:57+20:07) blocked across 31min with the nudge 'No se puede calificar: el alumno está editando la práctica', no resolution, no grade landed. Suspected root: student edit-lock releases ONLY on explicit student save/exit, no TTL/heartbeat auto-release nor reviewer override — so an abandoned/stale student edit locks the práctica forever. Investigate the lock-acquire+release path (do NOT pre-assume the fix); likely needs a TTL/heartbeat auto-release and/or a reviewer/admin break-stale-lock affordance. App-logic, not a DB-data patch. Class-A (grading/permission gate): audit-mars-ca design-ping pre-impl + diff review pre-push + full PTD. Reversible. Stop/ask if the lock model forks meaningfully.
Questions
Activity
-
Design decided (PM): BOTH, B-first. Premise corrected by coder02 — lock is 2h TTL not permanent, but 2h is far too long for a waiting reviewer; real gap = no presence signal (active-vs-abandoned) + no manual escape. B (interim, ship first): reviewer/admin 'liberar y calificar' break-stale-lock, confirm-gated showing lock age, gated to grade-capability+admin, setArchiveContext; accepts bwi#294 race as deliberate staff override. A (structural): separate lastSeenAt column (db-mars, Class-A — NOT lockedAt, preserves Push B 2h budget) + ~60s heartbeat via existing isRefresh path, staleness→~3min, auto-resolves abandoned edits, keeps bwi#294 anti-clobber. Both Class-A: audit design review + diff review + PTD. Separate commits/PTDs, B lands first.
-
B leg shipped: atomic 'liberar y calificar' reviewer override folds break-lock into reviewPractica as one tx + updatedAt optimistic-concurrency fence on both updatePractica/reviewPractica closing WF1/WF2. @fef46ed/v2.54.6, audit PASS, Class-A PTD clean.