Skip to content

Planner programme requirements#4456

Open
eugenewong22 wants to merge 4 commits into
nusmodifications:masterfrom
eugenewong22:planner-programme-requirements
Open

Planner programme requirements#4456
eugenewong22 wants to merge 4 commits into
nusmodifications:masterfrom
eugenewong22:planner-programme-requirements

Conversation

@eugenewong22

Copy link
Copy Markdown
Contributor

Part of issue #4390

What

Lets students select the specialisations, focus areas and minors they are pursuing in the Course Planner settings, and shows live progress towards each programme's requirements including optimal handling of courses that could count towards more than one requirement, and total units accumulated per programme.

How

  • types/programmes.ts — declarative schema: a Programme is a list of requirement buckets with minModules/minMCs floors and matchers (explicit course lists, or prefix + level ranges such as "CS courses at level 3000–4000"). No functions in the data, so it stays serializable and could move to the API later.
  • data/programmes/ — hand-curated pilot dataset. Every programme records the official source URL it was transcribed from, a lastVerified date, and the cohort it applies to. Dataset invariants are unit-tested.
  • utils/programmes.ts — pure fulfilment checker. Within a programme, each course counts towards at most one requirement; assignment uses maximum bipartite matching (Kuhn's augmenting paths) over requirement slots, so a course matching several buckets is routed to wherever it is needed. Exact when all courses are 4 units (the dominant case); a top-up pass covers smaller-credit courses. Documented in code.
  • Planner state — new persisted programmes: string[] (IDs only, so dataset corrections reach existing users), add/remove actions, redux-persist migration v1→v2, and Zod schema update so import/export round-trips (.strip() would otherwise drop the field).
  • selectors/planner.tsgetProgrammeFulfilments counts scheduled + exempted courses; "Plan to Take" courses are excluded as aspirational (open question on the issue).
  • UI — picker section in the planner settings modal (with a disclaimer that data is community-maintained + link to the official page), and a collapsible progress panel above the year columns with per-requirement progress bars and courses linked via LinkModuleCodes.

Pilot dataset

Programme Source Verified
CS Focus Area: Artificial Intelligence https://www.comp.nus.edu.sg/programmes/ug/focus/ 2026-07-09
CS Focus Area: Software Engineering https://www.comp.nus.edu.sg/programmes/ug/focus/ 2026-07-09
Minor in Computer Science (AY2021/22+) https://www.comp.nus.edu.sg/programmes/ug/minorc/cs-minor/ 2026-07-09

Focus areas are modelled as "1 level-4000 primary + 2 other primaries" per the official rule; the matcher routes courses between the two buckets automatically. The Minor accepts the official variant courses (CS1231S/MA1100/T, CS2030S, CS2040C/S, CS2113, EE4204). More programmes can follow in small data-only PRs — happy to write a short guide for contributors.

Deliberately out of scope for v1

  • Double-counting caps against the major (no major requirement data exists anywhere yet)
  • Grade/preclusion-aware counting and cohort-variant requirement sets
  • Placeholder slots counting towards programmes

Testing

  • TDD throughout: engine (matching, top-up, elective pools, dedupe, level parsing), reducer/migration, Zod round-trip incl. legacy imports, selector (exemptions in, plan-to-take out, custom unit overrides), and component tests for the panel and settings picker
  • pnpm test (796 tests), pnpm typecheck, pnpm lint all pass
  • Verified end-to-end in the browser: select programme → add CS3243/CS3244/CS4243 → 1/1 + 2/2 with CS4243 routed to the level-4000 bucket; partial Minor progress shows 12/20 units; selection persists across reload

Screenshots

settings-picker planner-partial planner-satisfied planner-empty

eugenewong22 and others added 4 commits July 9, 2026 13:23
Adds a declarative schema for specialisation/focus area/minor
requirements, a hand-curated pilot dataset (CS Artificial Intelligence
and Software Engineering focus areas, Minor in Computer Science)
transcribed from official SoC pages, and a pure fulfilment checker.

Double-counting within a programme is resolved with maximum bipartite
matching (Kuhn's augmenting paths) over requirement slots, with a
top-up pass for requirements measured in units rather than courses.

Part of nusmodifications#4390

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a persisted programmes field (programme IDs only, so dataset
fixes reach existing users), add/remove actions, a redux-persist
migration, and the Zod schema field so planner import/export round
trips the selection.

Part of nusmodifications#4390

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Checks scheduled and exempted modules (but not plan-to-take ones)
against each selected programme, resolving unit counts from the
module bank with custom module overrides.

Part of nusmodifications#4390

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a programme picker to the planner settings modal and a progress
panel above the year columns showing per-requirement progress bars,
which courses counted towards each requirement, and total units.

Part of nusmodifications#4390

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

@eugenewong22 is attempting to deploy a commit to the modsbot's projects Team on Vercel.

A member of the Team first needs to authorize it.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.89503% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.77%. Comparing base (988c6fd) to head (02c3e68).
⚠️ Report is 262 commits behind head on master.

Files with missing lines Patch % Lines
website/src/views/planner/PlannerProgrammes.tsx 94.87% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4456      +/-   ##
==========================================
+ Coverage   54.52%   59.77%   +5.24%     
==========================================
  Files         274      321      +47     
  Lines        6076     7475    +1399     
  Branches     1455     1855     +400     
==========================================
+ Hits         3313     4468    +1155     
- Misses       2763     3007     +244     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant