Skip to content

Fix missing prerequisite edges for units using enrolment_rules#6

Open
coldfinity wants to merge 1 commit into
monashcoding:mainfrom
coldfinity:main
Open

Fix missing prerequisite edges for units using enrolment_rules#6
coldfinity wants to merge 1 commit into
monashcoding:mainfrom
coldfinity:main

Conversation

@coldfinity
Copy link
Copy Markdown

@coldfinity coldfinity commented May 21, 2026

Summary

  • 211 units (MTH2021, MTH2010, and others across Science, Pharmacy, and Education) store their PREREQUISITE and PROHIBITION relationships as HTML prose in enrolment_rules rather than the structured requisites field. This left requisite_refs empty for those units, so the tree graph showed no edges and "what does X unlock" views omitted them entirely.
  • Fixed the ingest pipeline to extract unit code refs from enrolment_rules descriptions that carry a <strong>PREREQUISITE</strong> or <strong>PROHIBITION</strong> label with handbook unit links.
  • Added migration 0007 to backfill all existing years — inserting 4,496 new prerequisite refs and 1,683 prohibition refs.
  • Fixed a bug in requisite-tree-view where the units map title lookup was computed but leaf.academic_item_name was still rendered instead of the resolved name.

Test plan

  • Navigate to /tree?unit=MTH1030&direction=downstream — MTH2021 and MTH2010 now appear as nodes
  • Click MTH2021 or MTH2010 in the tree — side panel shows MTH1030/MTH1035/ENG1005 as prerequisites in the enrolment rules section
  • Switching between 2025 and 2026 handbook years both show edges correctly (restart dev server to clear Next.js data cache after migration)

…ent_rules

211 units (MTH2021, MTH2010, and others across Science, Pharmacy, and
Education) store their PREREQUISITE and PROHIBITION relationships as HTML
prose in enrolment_rules rather than the structured requisites field.
This left requisite_refs empty for those units, so the tree graph showed
no edges and "what does X unlock" views omitted them entirely.

Fix the ingest pipeline to also extract unit code refs from enrolment_rules
descriptions that carry a <strong>PREREQUISITE</strong> or
<strong>PROHIBITION</strong> label with handbook unit links. Add a data
migration (0007) to backfill all existing years — inserting 4,496 new
prerequisite refs and 1,683 prohibition refs.

Also fix a bug in requisite-tree-view where the units map title lookup
was computed but leaf.academic_item_name was still rendered instead of
the resolved name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

@coldfinity is attempting to deploy a commit to the monash-coding's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coldfinity coldfinity marked this pull request as draft May 21, 2026 11:29
@coldfinity coldfinity closed this May 21, 2026
@coldfinity coldfinity reopened this May 21, 2026
@coldfinity coldfinity marked this pull request as ready for review May 21, 2026 11:51
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