Skip to content

feat: describe structures by meaning rather than page layout - #134

Merged
HarryRandall merged 3 commits into
mainfrom
feat/structure-content-by-meaning
Sep 23, 2026
Merged

HarryRandall merged 3 commits into
mainfrom
feat/structure-content-by-meaning

Conversation

@HarryRandall

Copy link
Copy Markdown
Owner

Summary

Follows #133. Structures are described by what their information means, not by how the ANU page lays it out. This is what made the Related list and the Information tab hard to read.

  • Nine fixed sections in reading order, with Coursemap's own headings: Study options, Admission, Careers, First-year advice, Advice, Inherent requirements, Fees and scholarships, More information and Contacts. The set comes from surveying the headings on 60 structure pages. The model files each ANU heading under its meaning ("Career Options" and "Employment Opportunities" become Careers). First-year advice lists recommended courses one per line.
  • Three relationship meanings replace "Mentioned by the ANU page", "Relevant", "Required" and "Other": offered in (the degrees a major, minor or specialisation can be studied in), option (a programme's majors, minors and specialisations) and cannot be combined with. The contract checks each against the kind of record it points at.
  • Taken with is a requirement, not a relationship. "Must be taken in conjunction with the Mathematics major…" becomes a Taken with group holding a structure list, so the Requirements tab shows it and the planner checks it.
  • Readers show only the fixed vocabulary, so retired values in older content are skipped rather than shown or failed on. The admin editor offers sections and relationship kinds through the pinned Select, and a submitted draft outside the vocabulary is refused with a plain message.
  • Onboarding's selectable structures now come from a programme's options and requirement tree only.

Live results with the new prompt:

Page Result
ADMA-SPEC First-year advice (MATH1115, MATH1116), Advice, Contacts; a Taken with group of MATH-MAJ, MECO-MAJ, MFIN-MAJ, MMOD-MAJ and QBIO-MAJ; no flags
AARB-MIN Offered in BARTS and ELANG instead of the long "Mentioned by the ANU page" list

Model choice. On AACOM, the current gemini-3.1-flash-lite mapped the sections but returned a thin requirement tree (1 group, 4 conditions) and no options. I compared models on the same page:

Model Sections Options Requirement tree Cost Time
gemini-3.1-flash-lite 4 none 1 group, 4 conditions $0.007 ~10 s
gemini-3.5-flash-lite 8 5 4 groups, 17 conditions $0.035 66 s
gemini-3.8-flash 8 5 4 groups, 18 conditions $0.062 83 s
deepseek-chat-v3.1 timed out at 150 s

gemini-3.5-flash-lite also took FINM3006 in 14 s for $0.010 with all three fee rows. It is the recommended extraction model; switching is an admin setting, not part of this PR.

Verification

  • pnpm verify (format, lint, types, 524 unit and component tests, production build, 8 access tests, whitespace)
  • Browser smoke test: not run. The student view still uses the old layout and is rebuilt in the next PR of the stack.
  • Supabase migration: not run locally. Docker Desktop was not running; this relies on the PR database gate.

Deployment notes

  • Migration 010_structure_vocabulary.sql adds NOT VALID check constraints for section keys, relationship kinds and target kinds, so sealed older versions are left as they are and every new row is bound. It also narrows private.programme_offers_structure to option.
  • Structure prompt v7, snapshot schema v3 and extraction schema v4: queued structure syncs from the old worker must be started again.

A structure's information is filed under nine fixed sections (study options,
admission, careers, first-year advice, advice, inherent requirements, fees and
scholarships, more information and contacts) with Coursemap's own headings,
whatever ANU called them. Related records carry one of three meanings: the
degrees a structure is offered in, a programme's options, and structures that
cannot be combined. A structure that must be taken alongside becomes a Taken
with group in the requirement tree. Anything merely mentioned on the page is
no longer recorded.

Readers skip retired section and relationship values in older content, the
editor offers the fixed values as choices, and a submitted draft is refused
if it strays outside them.
New rows must use the fixed section keys and relationship meanings. The
constraints do not revalidate sealed older versions. A programme now offers
a structure through its options or its requirement tree only.
A section that merges several ANU headings quotes each passage in turn, so
its wording is checked one paragraph at a time instead of being flagged as
missing from the page. A record link's code is accepted alongside its text,
and a model that leaves out the unmodelled requirement list is read as
having none.
@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
coursemap Ready Ready Preview Sep 23, 2026 7:35am UTC

@HarryRandall
HarryRandall merged commit 29c645c into main Sep 23, 2026
6 checks passed
@HarryRandall
HarryRandall deleted the feat/structure-content-by-meaning branch September 23, 2026 07:38

This branch was successfully deployed

1 active deployment
Preview 07b65201 Deployed Sep 23, 2026 by vercel[bot]
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