mars
MARS-663
Editar práctica: permitir quitar una pieza ya cargada (SOP-MARS-46)
Done normal
cmcoder-mars-cc
SOP-MARS-46 (Varela, /mi-cursada/<id>/editar): the edit form has no control to remove a pieza; student can only alter its data or request deletion of the whole práctica. Add remove-pieza in edit with whole-chain soft-delete (pieza -> conductos -> images) + setArchiveContext reason, guarded by the same edit-eligibility as the rest of the form (not corregida). Answer to the student already sent via db-mars-cc.
Activity
-
pushed 35ef640 (minor). Remove-pieza in /mi-cursada/[id]/editar: explicit deletedToothIds payload (never inferred from absent fields), whole-chain soft-delete pieza -> conductos -> practicaImages inside the existing tx (archive reason public:edit), last-pieza floor enforced twice (pre-tx for the friction toast, again under the FOR UPDATE row lock as LastToothRemovalError). Decision logic extracted to tooth-removals.ts, 11 tests. review-depth DEEP (CHECK=2c). PTD + audit ask pending.
-
PTD complete on 35ef640: deploy dpl_4Mf7gkoBNG8yqehsairKH6L3VsyA READY/production, live /api/app-version 2.76.0 == remote package.json on main 2.76.0 (deploymentId matches this SHA's build), zero runtime errors project-wide in the 1h window. Coverage limit: no authed browser verify reachable from venus, so the removal path itself is NOT exercised in prod - the tx body is argued from the code path. Deep review asked of audit-mars-ca (tag coder-mars-cc-mt47vp3v9loc).
-
SHIPPED 35ef640, v2.76.0 live. Audit verdict PASS:35ef640 deep (audit-mars-ca, tag audit-mars-ca-mt47wrs4lgby), no findings. Remove-a-pieza in /mi-cursada/[id]/editar: explicit deletedToothIds payload validated against this practica's live piezas (never inferred from absent form fields); whole-chain soft-delete images -> conductos -> piezas inside the existing edit tx, each re-validating ownership via practicaId; last-pieza floor checked pre-tx (friction toast) and again under the FOR UPDATE set (LastToothRemovalError) to close the concurrent-removal race; survivor-only tooth maps so a same-save rx cannot resolve to a removed pieza; decision logic in tooth-removals.ts with 11 tests. Archive attribution rides the tx-wide public:edit reason. PTD: deploy dpl_4Mf7gkoBNG8yqehsairKH6L3VsyA READY/production, live /api/app-version 2.76.0 == remote package.json on main 2.76.0, deploymentId matches this SHA's build, zero runtime errors in the 1h window. COVERAGE LIMIT, closed with the item rather than dropped: the removal path itself was never exercised against prod - no authed browser verify is reachable from venus. Verified = the deploy is live and the pure decision function holds under unit test; the tx body is argued from the code path. Audit's PASS explicitly carries the same disclosure. SOP-MARS-46 (Varela) can now be answered and closed.
feature
7w ago by wi-cli-venus
7w ago
2026-08-22 10:11