Skip to content

Copy the existing course platform verbatim and establish its characterization baseline #30

Description

@alexeygrigorev

Parent epic: #5

Normative spec: 04 — Adoption baseline
Recorded owner decision: #13
Full production-like migration/reconciliation owner: #60

Scope

Adopt the existing course-management platform as code, not as a behavioral reimplementation. Begin from a clean checkout of exact source commit 98a235283904b4ef9ad29e196298540756cf1bcc and use the literal cp command to copy the tracked maintained source into this repository. Integrate only enough project settings/routing/dependencies for the unchanged copied code and characterization suite to run in the new scaffold.

  • Record the source repository and exact commit before copying.
  • Produce an allowlisted inventory of tracked source to copy, including Django apps, original migrations, tests, fixtures, templates/static assets, management commands, compatibility API, cadmin, and app-label metadata.
  • Use literal cp from that clean checkout; do not manually read and recreate files or behavior.
  • Exclude only documented local databases, secrets, virtual environments, caches/build/deploy outputs, unrelated notebooks, and temporary/untracked files.
  • Record a copied-file manifest with source-relative destination, size, and checksum so omissions and later upstream comparison are mechanical.
  • Preserve Django app labels, original migration files, and migration-state identity.
  • Reconcile dependency/settings/URL integration mechanically and minimally, documenting every target-owned or modified-file integration patch as a separately reviewable per-file ledger entry.
  • First make the unchanged copied characterization suite pass. The baseline expected approximately 760 Django test methods plus 48 end-to-end methods; record actual discovered and passing/skip/xfail counts.
  • Copy and verify the complete original migration chain before any later structural change.
  • Retain the original migrations in this adoption baseline. The owner permits later Django-supported squashing/collapse but does not require it now.
  • If a future change proposes a squash, replacement, or removal, it must first prove original-chain and replacement fresh-install parity plus upgrade/import compatibility on a production-like source snapshot. Preserve schema/state/data operations, dependencies, permissions/content types, app labels, stable keys, and behavior. Originals remain until that evidence passes.
  • When no production-like snapshot is available, the required safe result is exactly what this baseline does: keep every original migration and make no squash/removal claim.
  • Leave full source→unified production-like data import, count/key reconciliation, reverse/forward migration-window rehearsal, and Course→Cohort migration evidence to Preserve legacy course HTML/API compatibility and rehearse full data migration #60.
  • Document every excluded, patched, or intentionally unsupported source path/behavior with rationale and owner approval.

Non-goals

  • No Course→Cohort/model refactor, family mapping/backfill, route redesign, authorization redesign, service-layer rewrite, or Studio redesign.
  • No migration squash, replacement, or original-migration removal in this baseline.
  • No claim that production-like snapshot upgrade/import parity was run when no snapshot was supplied; full migration/reconciliation belongs to Preserve legacy course HTML/API compatibility and rehearse full data migration #60.
  • Do not hand-rewrite Django models or business logic as part of any later migration collapse.
  • Do not opportunistically refactor scoring, submissions, peer review, leaderboards, certificates, calendars, API serializers, or cadmin behavior.
  • Do not silently omit failing, inconvenient, deprecated-looking, or poorly documented business behavior. A known failure must remain visible as characterized behavior or an explicitly approved exception.
  • Do not copy secrets, local data, deployment state, or untracked source-worktree changes.

Acceptance criteria

  • A clean source checkout is pinned and verified at 98a235283904b4ef9ad29e196298540756cf1bcc before any copy.
  • Implementation evidence shows the literal cp command copied the allowlisted source; the platform was not manually reconstructed from reading source files.
  • All tracked maintained Django apps, original migrations, tests/fixtures, templates/static, management commands, compatibility APIs, cadmin behavior, and app labels are present unless an explicit reviewed exception names the exact path and behavior.
  • A versioned provenance record contains source repository, commit, copy command/allowlist, and per-file manifest/checksums.
  • Integration patches are separately reviewable and limited to dependency, settings, namespace, routing, filesystem, and test-environment compatibility; every modified copied file and target-owned compatibility shim has an exact per-file ledger entry and rationale, with no business logic silently changed.
  • The unchanged copied characterization suite passes before Course→Cohort or other product/model work begins, with actual Django/E2E collected/pass/skip/xfail counts recorded.
  • Every current course HTML route, compatibility API route, management command, and cadmin route is inventoried and smoke-covered from the copied code.
  • The complete original migration chain is copied, retains its app labels/dependencies/state/data operations, and applies successfully from a fresh database with no migration drift.
  • No squash/replacement/removal is proposed by this baseline. Every original migration remains because no production-like snapshot was supplied; this is the required safe fallback and no snapshot-parity claim is made.
  • A documented/tested gate forbids any future squash/replacement/removal unless original-versus-replacement fresh install and production-like snapshot upgrade/import parity first pass with no unexplained schema/state/data/key/behavior differences. Originals must remain until that evidence passes.
  • Full production-like source→unified import, count/key reconciliation, reverse/forward migration-window rehearsal, and Course→Cohort migration evidence are explicitly assigned to Preserve legacy course HTML/API compatibility and rehearse full data migration #60 and do not block closure of this literal-copy baseline.
  • No Course→Cohort/model refactor or manual business-logic rewrite appears in this issue's diff.
  • No source secret, local database, cache/build output, deployment state, or untracked local change is copied.

Test scenarios

Copy/provenance

  1. Verify the source checkout is clean and at the pinned SHA; compare Git's tracked file list against the allowlist, destination manifest, and checksums.
  2. Delete the adopted destination in an isolated test checkout and repeat the documented literal cp process; the resulting copied-file manifest is identical before integration patches.
  3. Detect an intentionally omitted tracked test/template/migration/command/API/cadmin file and fail the provenance check.
  4. Compare every modified copied file and every target-owned compatibility shim with the integration-patch ledger; a missing exact path or rationale fails this issue.

Django and migrations

  1. Run the copied Django suite unchanged before structural work and record discovered/passed/skipped/xfail tests, including all adopted apps.
  2. Create independent fresh databases through the complete unchanged original migration graph; verify expected app labels, numbered migrations, dependencies, schema state, and no migration drift.
  3. Assert the adoption tree retains every copied original migration and contains no squash/replacement/removal.
  4. Assert the migration safety gate rejects/remains unsatisfied for squash/removal when production-like snapshot parity evidence is absent.
  5. If a later issue proposes a squash/removal, require both fresh-install equivalence and production-like snapshot upgrade/import reconciliation before originals may be removed. That conditional test is not invoked by this no-squash baseline.
  6. Run the full source→unified production-like import, reconciliation, migration-window, and Course→Cohort rehearsal under Preserve legacy course HTML/API compatibility and rehearse full data migration #60 rather than fabricating evidence in Copy the existing course platform verbatim and establish its characterization baseline #30.

Playwright

  1. Run all 48 copied E2E methods (or the actual discovered count) against the integrated copied application and record pass/skip/xfail/failure disposition.
  2. Navigate representative public discovery, registration/login, dashboard/calendar, homework, project/peer review, leaderboard, certificate, API-backed, and cadmin workflows at desktop and mobile widths.
  3. Capture screenshots for representative learner and cadmin pages and verify they render the copied behavior, not 404/debug/error pages.

Behavior inventory

  1. Compare Django URL resolver output and API schemas with the source commit.
  2. Run copied scoring, peer-assignment, certificate, communication/outbox, and management-command tests without altering expected values merely to make them pass.
  3. For every explicit exception, demonstrate the source behavior, rationale, downstream replacement issue, and owner approval.

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must-have or release-blockingcoursesArea: coursesdata-migrationArea: data-migrationfoundationArea: foundation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions