You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
F1: registry has no UNIQUE constraint, so the duplicate-upload race guard never fires #81
Found in ART Milestone 0 (#53). Code read at main032b522; not reproduced.
Problem
dynamic_loader.py:321-336 says the duplicate checks are racy and that "the registry's UNIQUE indexes are the real guard". There are no unique indexes on csv_files:
api/db.py:199-208 creates the table with no UNIQUE constraint.
There are no Alembic migrations (F4).
So two concurrent identical uploads can both pass the check-then-act duplicate test and both register. The UniqueViolation handler never fires.
Fix
Add UNIQUE constraints on csv_files(file_hash) and csv_files(file_name), through a migration once F4 lands. Add a concurrency test that sends two identical uploads in parallel and expects exactly one registry row.
Fixed by #87, merged as da18cfd. Migration 0002_registry_unique adds UNIQUE constraints on csv_files.file_hash and csv_files.file_name, and both loaders now turn a UniqueViolation into a clean result instead of an error. The deterministic tests in tests/test_migrations.py cover this. CI on main is green.
Activity
docs(art): Milestone 0 assessment, VCRM draft, ADR-0002 and ADR-0003 (#…
Merge pull request #87 from amar-python/fix/issue-81-84-alembic-regis…
amar-python commentedon Oct 26, 2026
Fixed by #87, merged as da18cfd. Migration
0002_registry_uniqueadds UNIQUE constraints oncsv_files.file_hashandcsv_files.file_name, and both loaders now turn aUniqueViolationinto a clean result instead of an error. The deterministic tests intests/test_migrations.pycover this. CI on main is green.Generated by Claude Code