CC Worker 1671518ca8 FX-1: auto-map re-run must not PK-collide with confirmed ghosts
_refresh_ai_rows deleted only unconfirmed AI rows, then bulk-inserted freshly
generated rows keyed by a deterministic uuid5 of (template_id, semantic key).
A confirmed ghost keeps that id, so a re-run re-emitted it → primary-key
conflict that failed the whole insert batch (reachable: auto-map is blocked only
when marks exist, not when ghosts are confirmed).

Fix: after the delete, read the ids that survived (confirmed-AI + manual) and
skip re-inserting any freshly generated row whose id matches — preserving the
teacher's curated row and making the insert PK-safe.

Adds test_auto_map_rerun_after_confirm_does_not_pk_collide, which confirms a
ghost at its REAL generated id (the prior test used an arbitrary id that never
collided) and asserts the row survives exactly once with confirmed=True.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 21:02:10 +00:00
2026-05-28 17:55:37 +01:00
2026-05-27 22:55:01 +01:00
2025-11-14 14:47:19 +00:00
2025-11-19 20:02:34 +00:00
2025-11-19 20:02:34 +00:00
2025-07-11 13:52:19 +00:00
2025-11-14 14:47:19 +00:00
2025-11-14 14:47:19 +00:00
2025-11-14 14:47:19 +00:00
2025-11-14 14:47:19 +00:00
2025-11-14 14:47:19 +00:00
Description
FastAPI + Python 3.12 backend for Classroom Copilot — auth, document processing, transcription sessions, LLM integration, Supabase-backed
62 MiB
Languages
Python 98.9%
Shell 0.8%
Jupyter Notebook 0.3%