Uh oh!
There was an error while loading. Please reload this page.
db/academics-code: rewire app onto courses/offerings/terms/enrollments (epic slice PR2) - #268
Conversation
…rollments (epic slice PR2) Code-only slice against the already-landed academics split (migrations 0019-0027). The public API keeps the abstract `course_id`; the term/semester becomes a real second axis; enrollment resolves to a per-term offering internally. - services/academics.py (new): term/offering/enrollment resolver — current_term (date-derived, latest-term fallback), list_terms, resolve_offering (current term, create-if-missing so new enrollments land in the real current semester), offering_course_id, user_offering_ids_for_course, term_for_offering. - graph_service: enrollments→course_offerings→courses/terms join reshaped to the legacy flat shape; graph stays keyed on the ABSTRACT course_id; add/color/nickname/ delete resolve offerings; get_courses now surfaces `term`. - course_context_service: offering-scoped analytics (offering_concept_stats/ offering_summary); resolves offering→abstract course for graph_nodes; semester gone. - graph_read: misconceptions read offering_concept_stats by offering_id. - onboarding/graph routes: enroll into the current-term offering; GET /api/semesters (routes/academics.py) from terms; learn/profile course resolution via enrollments. `gradebook.py` is intentionally left to db/gradebook-code (PR3, with curve+drop-lowest). Other-slice callers (documents/quiz) degrade gracefully until their slices land. Tests: +test_academics; updated graph_service/shared_course_context/graph_read_tools/ onboarding/learn suites. Full backend suite 724 passed; ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with |
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs | frontend-staging | 788e8df | Commit Preview URL Branch Preview URL | Jun 24 2026, 07:50 AM |
Code-only slice (PR2, the spine) of the DB modular redesign. Rewires the application onto the already-landed academics split (migrations 0019–0027 from #264) — no migrations here. Targets the epic branch.
Locked contract (decided with the user)
course_id. No section/instructor in any contract.GET /api/semesters(fromterms);get_coursesreturns each course's term.section = NULL), created if the catalog lacks it so new enrollments land in the real current semester (not legacySpring 2026).course_id(cumulative); resolved viaenrollment.offering_id → course_offerings.course_id.What changed
services/academics.py(new): the term/offering/enrollment resolver everything builds on.graph_service: enrollments→course_offerings→courses/terms join reshaped to the legacy flat shape; enroll/color/nickname/delete resolve offerings; analytics refresh resolves abstract→offerings.course_context_service: offering-scoped analytics (offering_concept_stats/offering_summary); resolves offering→abstract course forgraph_nodes; free-textsemestergone.graph_read: misconceptions readoffering_concept_statsbyoffering_id.onboardingenrolls into the current-term offering; newroutes/academics.pyexposesGET /api/semesters;learn/profilecourse resolution viaenrollments.Scope decisions
gradebook.pydeliberately excluded → goes whole todb/gradebook-code(PR3, with curve + drop-lowest, Rewire bell-curve + drop-lowest grading onto the redesigned gradebook (post-redesign) #266), built on this slice's enrollment-by-semester resolver.course_context_serviceanalytics absorbed here (the migrated offering tables force offering-keying, inseparable from the spine) → PR4 shrinks tosocial.py.documents/quiz) degrade gracefully (empty reads / no-op) until their slices land — expected for the WIP-red epic.schoolis""/None for now (free-textcourses.schoolretired;schoolsunpopulated) — frontend/seed follow-up.Verification
ruff check .clean.tests/test_academics.py; updated graph_service / shared_course_context / graph_read_tools / onboarding / learn suites.Plan:
docs/superpowers/plans/2026-06-24-db-academics-code.md. Spec:docs/superpowers/specs/2026-06-23-db-modular-redesign-design.md.Unblocks the parallel code slices (graph / analytics / gradebook / identity / study / ops).