core/ Pure logic

Seven modules of pure domain logic. None import React, call fetch(), or touch localStorage. Every function takes inputs and returns outputs. This makes them trivially testable in Node without a DOM.

Parent
Consumed by
PlannerContext.jsx (exclusively)
Rule
No React, no I/O, no side effects — pure functions only

Children

Inter-module dependencies

graph TD GR["gradRequirements.js"] PE["prereqEval.js"] CM["courseModel.js"] SG["semGrid.js"] PM["planModel.js"] TH["themes.js"] CO["constants.js"] GR -->|"uses NUPATH_LABELS"| CO CM -->|"uses SUBJECT_PALETTE"| CO SG -->|"uses SEMESTER_TYPES"| CO PM -->|"calls loadMajor (via param)"| GR TH -.->|"token values from"| CO style CO fill:#fff8c5,stroke:#9a6700
constants.js is the only internal dependency. All other modules are independent of each other.

How PlannerContext uses core

PlannerContext is the only file that imports from core/. It calls these functions during:

EventCore function called
Courses loadednormalizeCourse() for each, buildCourseMap()
Entry/grad dates changebuildCohortSemesters(), deriveSemMaps()
Any placement changeevalPrereqTree() for all placed courses → violations
User selects majorallocateMajorWithElectives(), getNuPathCoverage()
Course selectedgetConnections() → SVG line positions
PDF export triggeredexportReport()