Courseplan’s requirement data lives in TypeScript files rather than raw JSON, which gives contributors full type safety and the ability to express complex logic with plain functions. When a requirement definition changes, a code-generation step compiles those TypeScript files into a JSON artifact that the runtime loads at startup.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cornell-dti/course-plan/llms.txt
Use this file to discover all available pages before exploring further.
Where requirement files live
Major<CollegeOrMajorRequirement> or the equivalent college type.
The CollegeOrMajorRequirement type
Every single requirement in the system is described by CollegeOrMajorRequirement, defined in src/requirements/types.ts:
RequirementCommon contributes fields such as name, description, source, and optional allowCourseDoubleCounting. RequirementFulfillmentInformation adds fulfilledBy, perSlotMinCount, and slotNames.
How checker functions work
ARequirementChecker is a plain TypeScript predicate:
req-gen build step, every checker is run against the full Cornell course roster to produce a pre-computed list of eligible course IDs. At runtime, the graph builder uses those lists — not the functions themselves — for performance.
The src/requirements/checkers.ts module provides composable helpers:
includesWithSingleRequirement(...courseCodes)— course must match one of the given codesincludesWithSubRequirements(...slotCodes[])— multi-slot requirement; each inner array is one slotcourseMatchesCodeOptions(course, codes)— boolean test against a list of subject+number stringsifCodeMatch(value, pattern)— glob-style match ('CS','4***', etc.)
A real example: CS Introductory Programming
Fromsrc/data/majors/cs.ts:
includesWithSubRequirements creates two slots. The student must place at least one course in each slot (perSlotMinCount: [1, 1]). allowCourseDoubleCounting: true lets these courses also count toward Engineering college requirements.
Handling year-based requirement changes with RequirementMigration
Cornell sometimes changes requirements for students who entered before a specific year. Model this with RequirementMigration:
migrations array to the major or college object:
entranceYear.
Regenerating the JSON artifact
After any change to a requirement file, regeneratedecorated-requirements.json:
src/requirements/requirement-json-generator.ts via ts-node. It evaluates every RequirementChecker against the full course roster and writes the resulting eligible-course-ID lists into the JSON file.