Plan context: CI run 34189057638 (87fd3f4) is the first completed django verdict on main since Sep 5 (earlier runs were cancelled by the container/quality failures fixed in #337/#319/#341/#343): quality, container, playwright and screenshots now pass, but the django job fails and ci-gate reports failure. Dozens of tests ERROR at setup with sqlite3.IntegrityError: NOT NULL constraint failed: courses_course.archive_commit_sha. Introduced by the shared-curriculum merge (#320).
Symptom
- Failing modules include courses.tests.test_course_list_ordering, courses.tests.test_course_list_metadata, courses.tests.test_course_list_assignments, courses.tests.test_homework_optional_fields, courses.tests.test_local_question_seed, courses.tests.test_local_project_review_seed, studio_courses.tests (course/homework/project views), core.tests.test_course_platform_vendor_assets, review_import.tests.test_workflow.
- The model field (courses/models/cohort.py:192) declares
default="", and the visible 0005 AddField declares default="" too, yet some INSERT into courses_course omits the column entirely.
- The visible AddField in courses/migrations/0005_shared_current_curriculum.py names model
cohort, while the failing table is courses_course; a missing or default-less AddField for the course model is the prime suspect.
Direction
- Inventory every archive field AddField in migration 0005 and which model each targets; run the migration-drift check.
- Identify the creation path that bypasses the model default (missing AddField, bulk/raw insert, or fixture) and fix it at the root per the model's documented semantics: empty string for current cohorts, full 40-hex commit SHA for github_archive cohorts; the archive identity check constraint stays intact.
Scope
- The smallest change that makes Course creation safe everywhere the model default was assumed. No product behavior changes beyond what the model already specifies. No workflow or quality-contract edits.
Acceptance criteria
Plan context: CI run 34189057638 (87fd3f4) is the first completed django verdict on main since Sep 5 (earlier runs were cancelled by the container/quality failures fixed in #337/#319/#341/#343): quality, container, playwright and screenshots now pass, but the django job fails and ci-gate reports failure. Dozens of tests ERROR at setup with
sqlite3.IntegrityError: NOT NULL constraint failed: courses_course.archive_commit_sha. Introduced by the shared-curriculum merge (#320).Symptom
default="", and the visible 0005 AddField declaresdefault=""too, yet some INSERT into courses_course omits the column entirely.cohort, while the failing table iscourses_course; a missing or default-less AddField for the course model is the prime suspect.Direction
Scope
Acceptance criteria