miller345 commited on
Commit
f88d59f
·
verified ·
1 Parent(s): dc162da

Add seeded environment data, provenance, statistics, and dataset card

Browse files
LICENSES.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Source licenses and attribution
2
+
3
+ Reuse terms for the original catalogue-derived material have not been established. No blanket data license is assigned to this private release or to its synthetic benchmark fixtures.
4
+
5
+ Course and program structures are derived from the McGill Course Catalogue. The local seed has been adapted to a fictional university, with rewritten program summaries, fictionalized identities and URLs, and generated section schedules and registration scenarios. Repository history records the original catalogue provenance even where current display strings use fictional branding.
6
+
7
+ No blanket license is assigned to components whose reuse terms are undocumented. Source-specific declarations and per-item notices describe their respective content. Synthetic benchmark fixtures are identified separately from source-derived records.
README.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: "Minerva Lite Data"
3
+ tags:
4
+ - webarena-pro
5
+ - web-agents
6
+ - benchmark-environment
7
+ - text
8
+ - tabular
9
+ ---
10
+
11
+ **Minerva Lite Data** provides course, program, and student-registration seed inputs for WebArena-Pro’s Minerva-lite environment, a locally hosted university registration application for evaluating web agents. It supports course searches, add/drop workflows, program planning, billing, and transcript tasks.
12
+
13
+ Course and program structures are derived from the McGill Course Catalogue. The local seed has been adapted to a fictional university, with rewritten program summaries, fictionalized identities and URLs, and generated section schedules and registration scenarios. Repository history records the original catalogue provenance even where current display strings use fictional branding.
14
+
15
+ We prepared the released content for local use in the environment:
16
+
17
+ - Retained catalogue-derived course identifiers, titles, credit structures, and program requirement relationships.
18
+ - Replaced display identities and generated synthetic program summaries and teaching schedules.
19
+ - Projected offerings onto Summer 2026, Fall 2026, and Winter 2027 and constructed benchmark student records.
20
+
21
+ | Statistic | Value |
22
+ |---|---:|
23
+ | Source course definitions | 108 |
24
+ | Program catalog entries | 264 |
25
+ | Course-section rows in local baseline database | 5857 |
26
+ | Programs in local baseline database | 264 |
27
+ | Local release files before documentation | 7 |
28
+ | Local payload size | 6,889,190 bytes (6.89 MB / 6.57 MiB) |
29
+
30
+ JSON seed inputs are under `data/`; catalogue adaptation and seeding code is under `preparation/`. Course definitions and generated section rows are different units.
31
+
32
+ Reuse terms for the original catalogue-derived material have not been established. No blanket data license is assigned to this private release or to its synthetic benchmark fixtures.
33
+
34
+ The application is maintained in the [WebArena-Pro repository](https://github.com/McGill-NLP/webarena-pro).
data/courses_seed.json ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "source": "Seeded from Bolder-Kohn University Course Catalogue course titles and term-offered patterns, projected onto the 2026-2027 registration year. Meeting days and times use Bolder-Kohn University-style class schedule slots so schedule search, add/drop, and weekly view have realistic data.",
3
+ "courses": [
4
+ {"crn": "20001", "subject": "COMP", "number": "202", "title": "Foundations of Programming", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 220, "seats_taken": 146},
5
+ {"crn": "20002", "subject": "COMP", "number": "204", "title": "Computer Programming for Life Sciences", "credits": 3, "days": "TR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 117},
6
+ {"crn": "20003", "subject": "COMP", "number": "206", "title": "Introduction to Software Systems", "credits": 3, "days": "MWF", "time": "12:35-13:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 210, "seats_taken": 171},
7
+ {"crn": "20004", "subject": "COMP", "number": "208", "title": "Computer Programming for Physical Sciences and Engineering", "credits": 3, "days": "TR", "time": "08:35-09:55", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 160, "seats_taken": 87},
8
+ {"crn": "20005", "subject": "COMP", "number": "250", "title": "Introduction to Computer Science", "credits": 3, "days": "TR", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 240, "seats_taken": 203},
9
+ {"crn": "20006", "subject": "COMP", "number": "251", "title": "Algorithms and Data Structures", "credits": 3, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 220, "seats_taken": 188},
10
+ {"crn": "20007", "subject": "COMP", "number": "273", "title": "Introduction to Computer Systems", "credits": 3, "days": "MWF", "time": "13:35-14:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 116},
11
+ {"crn": "20008", "subject": "COMP", "number": "302", "title": "Programming Languages and Paradigms", "credits": 3, "days": "TR", "time": "13:05-14:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 130, "seats_taken": 98},
12
+ {"crn": "20009", "subject": "COMP", "number": "303", "title": "Software Design", "credits": 3, "days": "MW", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 150, "seats_taken": 105},
13
+ {"crn": "20010", "subject": "COMP", "number": "310", "title": "Operating Systems", "credits": 4, "days": "TR", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 150, "seats_taken": 128},
14
+ {"crn": "20011", "subject": "COMP", "number": "330", "title": "Theory of Computation", "credits": 3, "days": "MWF", "time": "08:35-09:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 160, "seats_taken": 92},
15
+ {"crn": "20012", "subject": "COMP", "number": "350", "title": "Numerical Computing", "credits": 3, "days": "MW", "time": "16:05-17:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 100, "seats_taken": 58},
16
+ {"crn": "20013", "subject": "COMP", "number": "360", "title": "Algorithm Design", "credits": 3, "days": "TR", "time": "16:05-17:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 130, "seats_taken": 103},
17
+ {"crn": "20014", "subject": "COMP", "number": "421", "title": "Database Systems", "credits": 3, "days": "MW", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 120, "seats_taken": 76},
18
+ {"crn": "20015", "subject": "COMP", "number": "424", "title": "Artificial Intelligence", "credits": 3, "days": "TR", "time": "09:05-10:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 140, "seats_taken": 112},
19
+ {"crn": "20016", "subject": "COMP", "number": "551", "title": "Applied Machine Learning", "credits": 4, "days": "TR", "time": "13:35-14:55", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 110, "seats_taken": 94},
20
+ {"crn": "20017", "subject": "COMP", "number": "557", "title": "Fundamentals of Computer Graphics", "credits": 4, "days": "MW", "time": "15:05-16:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 90, "seats_taken": 52},
21
+ {"crn": "20018", "subject": "COMP", "number": "558", "title": "Fundamentals of Computer Vision", "credits": 4, "days": "TR", "time": "15:05-16:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 90, "seats_taken": 68},
22
+ {"crn": "20019", "subject": "MATH", "number": "133", "title": "Linear Algebra and Geometry", "credits": 3, "days": "MWF", "time": "08:35-09:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 260, "seats_taken": 184},
23
+ {"crn": "20020", "subject": "MATH", "number": "139", "title": "Calculus", "credits": 4, "days": "MTWR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026"], "seats_total": 220, "seats_taken": 151},
24
+ {"crn": "20021", "subject": "MATH", "number": "140", "title": "Calculus 1", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 300, "seats_taken": 241},
25
+ {"crn": "20022", "subject": "MATH", "number": "141", "title": "Calculus 2", "credits": 4, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 300, "seats_taken": 218},
26
+ {"crn": "20023", "subject": "MATH", "number": "222", "title": "Calculus 3", "credits": 3, "days": "MWF", "time": "12:35-13:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 240, "seats_taken": 179},
27
+ {"crn": "20024", "subject": "MATH", "number": "223", "title": "Linear Algebra", "credits": 3, "days": "TR", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 220, "seats_taken": 155},
28
+ {"crn": "20025", "subject": "MATH", "number": "235", "title": "Algebra 1", "credits": 3, "days": "MWF", "time": "13:35-14:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 160, "seats_taken": 83},
29
+ {"crn": "20026", "subject": "MATH", "number": "240", "title": "Discrete Structures", "credits": 3, "days": "TR", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 130},
30
+ {"crn": "20027", "subject": "MATH", "number": "248", "title": "Honours Advanced Calculus", "credits": 3, "days": "MW", "time": "15:05-16:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 80, "seats_taken": 39},
31
+ {"crn": "20028", "subject": "MATH", "number": "314", "title": "Advanced Calculus", "credits": 3, "days": "TR", "time": "08:35-09:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 130, "seats_taken": 77},
32
+ {"crn": "20029", "subject": "MATH", "number": "315", "title": "Ordinary Differential Equations", "credits": 3, "days": "MWF", "time": "11:35-12:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 160, "seats_taken": 91},
33
+ {"crn": "20030", "subject": "MATH", "number": "323", "title": "Probability", "credits": 3, "days": "TR", "time": "13:05-14:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 170, "seats_taken": 122},
34
+ {"crn": "20031", "subject": "MATH", "number": "324", "title": "Statistics", "credits": 3, "days": "MWF", "time": "14:35-15:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 136},
35
+ {"crn": "20032", "subject": "MATH", "number": "447", "title": "Introduction to Stochastic Processes", "credits": 3, "days": "MW", "time": "16:05-17:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 100, "seats_taken": 61},
36
+ {"crn": "20033", "subject": "STAT", "number": "230", "title": "Mathematical Statistics", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026"], "seats_total": 140, "seats_taken": 84},
37
+ {"crn": "20034", "subject": "STAT", "number": "260", "title": "Introduction to Statistics", "credits": 3, "days": "TR", "time": "12:35-13:55", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 125},
38
+ {"crn": "20035", "subject": "STAT", "number": "400", "title": "Statistical Computing", "credits": 3, "days": "MW", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 100, "seats_taken": 54},
39
+ {"crn": "20036", "subject": "STAT", "number": "437", "title": "Models for Dependent Data", "credits": 3, "days": "TR", "time": "15:05-16:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 90, "seats_taken": 42},
40
+ {"crn": "20037", "subject": "BIOL", "number": "111", "title": "Principles: Organismal Biology", "credits": 3, "days": "MWF", "time": "08:35-09:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 260, "seats_taken": 201},
41
+ {"crn": "20038", "subject": "BIOL", "number": "112", "title": "Cell and Molecular Biology", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 260, "seats_taken": 214},
42
+ {"crn": "20039", "subject": "BIOL", "number": "200", "title": "Molecular Biology", "credits": 3, "days": "TR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 210, "seats_taken": 149},
43
+ {"crn": "20040", "subject": "BIOL", "number": "201", "title": "Cell Biology and Metabolism", "credits": 3, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 210, "seats_taken": 152},
44
+ {"crn": "20041", "subject": "BIOL", "number": "202", "title": "Basic Genetics", "credits": 3, "days": "TR", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 220, "seats_taken": 177},
45
+ {"crn": "20042", "subject": "BIOL", "number": "205", "title": "Biology of Organisms", "credits": 3, "days": "MWF", "time": "12:35-13:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 160, "seats_taken": 88},
46
+ {"crn": "20043", "subject": "BIOL", "number": "301", "title": "Cell and Molecular Laboratory", "credits": 4, "days": "MW", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 90, "seats_taken": 62},
47
+ {"crn": "20044", "subject": "BIOL", "number": "304", "title": "Evolution", "credits": 3, "days": "TR", "time": "13:05-14:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 140, "seats_taken": 91},
48
+ {"crn": "20045", "subject": "BIOL", "number": "306", "title": "Neural Basis of Behaviour", "credits": 3, "days": "MW", "time": "16:05-17:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 120, "seats_taken": 80},
49
+ {"crn": "20046", "subject": "BIOL", "number": "373", "title": "Biometry", "credits": 3, "days": "TR", "time": "15:05-16:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 110, "seats_taken": 66},
50
+ {"crn": "20047", "subject": "CHEM", "number": "110", "title": "General Chemistry 1", "credits": 4, "days": "MWF", "time": "08:35-09:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 300, "seats_taken": 244},
51
+ {"crn": "20048", "subject": "CHEM", "number": "120", "title": "General Chemistry 2", "credits": 4, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 300, "seats_taken": 251},
52
+ {"crn": "20049", "subject": "CHEM", "number": "203", "title": "Survey of Physical Chemistry", "credits": 3, "days": "TR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026"], "seats_total": 150, "seats_taken": 73},
53
+ {"crn": "20050", "subject": "CHEM", "number": "212", "title": "Introductory Organic Chemistry 1", "credits": 4, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026"], "seats_total": 260, "seats_taken": 198},
54
+ {"crn": "20051", "subject": "CHEM", "number": "222", "title": "Introductory Organic Chemistry 2", "credits": 4, "days": "MWF", "time": "11:35-12:25", "campus": "Downtown", "terms": ["Summer 2026", "Winter 2027"], "seats_total": 240, "seats_taken": 168},
55
+ {"crn": "20052", "subject": "CHEM", "number": "273", "title": "Introductory Physical Chemistry", "credits": 3, "days": "TR", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 150, "seats_taken": 79},
56
+ {"crn": "20053", "subject": "CHEM", "number": "302", "title": "Introductory Organic Chemistry 3", "credits": 3, "days": "MW", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 120, "seats_taken": 64},
57
+ {"crn": "20054", "subject": "PHYS", "number": "101", "title": "Introductory Physics - Mechanics", "credits": 4, "days": "MWF", "time": "08:35-09:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 240, "seats_taken": 154},
58
+ {"crn": "20055", "subject": "PHYS", "number": "102", "title": "Introductory Physics - Electromagnetism", "credits": 4, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 240, "seats_taken": 169},
59
+ {"crn": "20056", "subject": "PHYS", "number": "131", "title": "Mechanics and Waves", "credits": 4, "days": "TR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 200, "seats_taken": 138},
60
+ {"crn": "20057", "subject": "PHYS", "number": "142", "title": "Electromagnetism and Optics", "credits": 4, "days": "TR", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 200, "seats_taken": 132},
61
+ {"crn": "20058", "subject": "PHYS", "number": "230", "title": "Dynamics of Simple Systems", "credits": 3, "days": "MWF", "time": "13:35-14:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 120, "seats_taken": 74},
62
+ {"crn": "20059", "subject": "PHYS", "number": "251", "title": "Honours Classical Mechanics 1", "credits": 3, "days": "MW", "time": "15:05-16:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 80, "seats_taken": 43},
63
+ {"crn": "20060", "subject": "PHYS", "number": "257", "title": "Experimental Methods 1", "credits": 3, "days": "TR", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 90, "seats_taken": 56},
64
+ {"crn": "20061", "subject": "ECON", "number": "208", "title": "Microeconomic Analysis and Applications", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 260, "seats_taken": 193},
65
+ {"crn": "20062", "subject": "ECON", "number": "209", "title": "Macroeconomic Analysis and Applications", "credits": 3, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 260, "seats_taken": 188},
66
+ {"crn": "20063", "subject": "ECON", "number": "219", "title": "Current Economic Problems: Topics", "credits": 3, "days": "TR", "time": "08:35-09:55", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 120, "seats_taken": 61},
67
+ {"crn": "20064", "subject": "ECON", "number": "227", "title": "Economic Statistics", "credits": 3, "days": "TR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 116},
68
+ {"crn": "20065", "subject": "ECON", "number": "230", "title": "Microeconomic Theory", "credits": 3, "days": "MWF", "time": "12:35-13:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 200, "seats_taken": 151},
69
+ {"crn": "20066", "subject": "ECON", "number": "330", "title": "Macroeconomic Theory", "credits": 3, "days": "TR", "time": "13:05-14:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 118},
70
+ {"crn": "20067", "subject": "ECON", "number": "347", "title": "Economics of Climate Change", "credits": 3, "days": "MW", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 110, "seats_taken": 69},
71
+ {"crn": "20068", "subject": "ECON", "number": "352", "title": "Macroeconomics: Policy", "credits": 3, "days": "TR", "time": "15:05-16:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 120, "seats_taken": 72},
72
+ {"crn": "20069", "subject": "ECON", "number": "408", "title": "Public Sector Economics", "credits": 3, "days": "MW", "time": "16:05-17:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 100, "seats_taken": 53},
73
+ {"crn": "20070", "subject": "PSYC", "number": "100", "title": "Introduction to Psychology", "credits": 3, "days": "MW", "time": "16:05-17:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 300, "seats_taken": 239},
74
+ {"crn": "20071", "subject": "PSYC", "number": "204", "title": "Introduction to Psychological Statistics", "credits": 3, "days": "TR", "time": "08:35-09:55", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 200, "seats_taken": 133},
75
+ {"crn": "20072", "subject": "PSYC", "number": "211", "title": "Introductory Behavioural Neuroscience", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 180, "seats_taken": 118},
76
+ {"crn": "20073", "subject": "PSYC", "number": "212", "title": "Perception", "credits": 3, "days": "TR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 150, "seats_taken": 88},
77
+ {"crn": "20074", "subject": "PSYC", "number": "213", "title": "Cognition", "credits": 3, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Fall 2026", "Winter 2027"], "seats_total": 160, "seats_taken": 97},
78
+ {"crn": "20075", "subject": "PSYC", "number": "215", "title": "Social Psychology", "credits": 3, "days": "TR", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 119},
79
+ {"crn": "20076", "subject": "PSYC", "number": "305", "title": "Statistics for Experimental Design", "credits": 3, "days": "MW", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 110, "seats_taken": 58},
80
+ {"crn": "20077", "subject": "ENGL", "number": "202", "title": "Departmental Survey of English Literature 1", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026"], "seats_total": 120, "seats_taken": 74},
81
+ {"crn": "20078", "subject": "ENGL", "number": "203", "title": "Departmental Survey of English Literature 2", "credits": 3, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Winter 2027"], "seats_total": 120, "seats_taken": 67},
82
+ {"crn": "20079", "subject": "ENGL", "number": "227", "title": "American Literature 1", "credits": 3, "days": "TR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 90, "seats_taken": 49},
83
+ {"crn": "20080", "subject": "ENGL", "number": "229", "title": "Canadian Literature 1", "credits": 3, "days": "TR", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 90, "seats_taken": 52},
84
+ {"crn": "20081", "subject": "ENGL", "number": "311", "title": "Poetics", "credits": 3, "days": "MW", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 75, "seats_taken": 37},
85
+ {"crn": "20082", "subject": "ENGL", "number": "315", "title": "Shakespeare", "credits": 3, "days": "TR", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 80, "seats_taken": 44},
86
+ {"crn": "20083", "subject": "HIST", "number": "200", "title": "Introduction to History and Historical Methods", "credits": 3, "days": "MWF", "time": "08:35-09:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 100, "seats_taken": 57},
87
+ {"crn": "20084", "subject": "HIST", "number": "202", "title": "Survey: Canada to 1867", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026"], "seats_total": 120, "seats_taken": 68},
88
+ {"crn": "20085", "subject": "HIST", "number": "203", "title": "Survey: Canada Since 1867", "credits": 3, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Winter 2027"], "seats_total": 120, "seats_taken": 63},
89
+ {"crn": "20086", "subject": "HIST", "number": "205", "title": "Ancient Mediterranean History", "credits": 3, "days": "TR", "time": "13:05-14:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 90, "seats_taken": 41},
90
+ {"crn": "20087", "subject": "HIST", "number": "215", "title": "Introduction to East Asian History", "credits": 3, "days": "TR", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 90, "seats_taken": 45},
91
+ {"crn": "20088", "subject": "HIST", "number": "308", "title": "United States Politics and Society", "credits": 3, "days": "MW", "time": "16:05-17:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 70, "seats_taken": 34},
92
+ {"crn": "20089", "subject": "POLI", "number": "210", "title": "Political Science Research Methods", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 126},
93
+ {"crn": "20090", "subject": "POLI", "number": "212", "title": "Government and Politics: Developed World", "credits": 3, "days": "TR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 160, "seats_taken": 101},
94
+ {"crn": "20091", "subject": "POLI", "number": "221", "title": "Government of Canada", "credits": 3, "days": "MWF", "time": "11:35-12:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 160, "seats_taken": 94},
95
+ {"crn": "20092", "subject": "POLI", "number": "227", "title": "Developing Areas: Introduction", "credits": 3, "days": "TR", "time": "13:05-14:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 140, "seats_taken": 78},
96
+ {"crn": "20093", "subject": "POLI", "number": "244", "title": "International Politics: State Behaviour", "credits": 3, "days": "MW", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 160, "seats_taken": 107},
97
+ {"crn": "20094", "subject": "POLI", "number": "341", "title": "Foreign Policy: The United States", "credits": 3, "days": "TR", "time": "15:05-16:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 90, "seats_taken": 48},
98
+ {"crn": "20095", "subject": "SOCI", "number": "210", "title": "Sociological Perspectives", "credits": 3, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 116},
99
+ {"crn": "20096", "subject": "SOCI", "number": "211", "title": "Sociological Inquiry", "credits": 3, "days": "TR", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 130, "seats_taken": 69},
100
+ {"crn": "20097", "subject": "SOCI", "number": "212", "title": "Statistics in Social Research", "credits": 3, "days": "MWF", "time": "12:35-13:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 120, "seats_taken": 63},
101
+ {"crn": "20098", "subject": "SOCI", "number": "230", "title": "Sociology of Ethnic Relations", "credits": 3, "days": "TR", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 110, "seats_taken": 58},
102
+ {"crn": "20099", "subject": "SOCI", "number": "247", "title": "Family and Modern Society", "credits": 3, "days": "MW", "time": "16:05-17:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 110, "seats_taken": 52},
103
+ {"crn": "20100", "subject": "PHIL", "number": "200", "title": "Introduction to Philosophy 1", "credits": 3, "days": "MWF", "time": "08:35-09:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 130, "seats_taken": 82},
104
+ {"crn": "20101", "subject": "PHIL", "number": "201", "title": "Introduction to Philosophy 2", "credits": 3, "days": "MWF", "time": "09:35-10:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 130, "seats_taken": 75},
105
+ {"crn": "20102", "subject": "PHIL", "number": "210", "title": "Introduction to Deductive Logic", "credits": 3, "days": "TR", "time": "10:05-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 150, "seats_taken": 96},
106
+ {"crn": "20103", "subject": "GEOG", "number": "200", "title": "Geographical Perspectives: World Environmental Problems", "credits": 3, "days": "MWF", "time": "10:35-11:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 180, "seats_taken": 122},
107
+ {"crn": "20104", "subject": "GEOG", "number": "203", "title": "Environmental Systems", "credits": 3, "days": "TR", "time": "11:35-12:55", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 150, "seats_taken": 87},
108
+ {"crn": "20105", "subject": "GEOG", "number": "302", "title": "Environmental Management", "credits": 3, "days": "MW", "time": "14:35-15:55", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 100, "seats_taken": 50},
109
+ {"crn": "20106", "subject": "ANTH", "number": "201", "title": "Prehistoric Archaeology", "credits": 3, "days": "MWF", "time": "12:35-13:25", "campus": "Downtown", "terms": ["Fall 2026"], "seats_total": 120, "seats_taken": 64},
110
+ {"crn": "20107", "subject": "ANTH", "number": "202", "title": "Socio-Cultural Anthropology", "credits": 3, "days": "TR", "time": "13:05-14:25", "campus": "Downtown", "terms": ["Summer 2026", "Fall 2026", "Winter 2027"], "seats_total": 140, "seats_taken": 85},
111
+ {"crn": "20108", "subject": "ANTH", "number": "204", "title": "Anthropology of Meaning", "credits": 3, "days": "MW", "time": "15:05-16:25", "campus": "Downtown", "terms": ["Winter 2027"], "seats_total": 90, "seats_taken": 43}
112
+ ]
113
+ }
data/program_catalog.json ADDED
The diff for this file is too large to render. See raw diff
 
data/seed.json ADDED
The diff for this file is too large to render. See raw diff
 
preparation/program_catalog_builder.py ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import pathlib
3
+ from datetime import date
4
+ import re
5
+
6
+ import requests
7
+ from bs4 import BeautifulSoup
8
+
9
+ from common.synthetic_catalog import sanitize_program
10
+
11
+
12
+ ROOT = pathlib.Path(__file__).resolve().parents[1]
13
+ SEED_PATH = ROOT / "data" / "seed.json"
14
+ OUTPUT_PATH = ROOT / "data" / "program_catalog.json"
15
+
16
+
17
+ def _clean(text):
18
+ return " ".join((text or "").replace("\xa0", " ").split())
19
+
20
+
21
+ def _extract_summary(tab):
22
+ if not tab:
23
+ return ""
24
+ paragraphs = []
25
+ capture = False
26
+ for node in tab.find_all(["p", "h2", "h3"], recursive=False):
27
+ text = _clean(node.get_text(" ", strip=True))
28
+ if not text:
29
+ continue
30
+ if node.name in {"h2", "h3"} and "program description" in text.lower():
31
+ capture = True
32
+ continue
33
+ if node.name in {"h2", "h3"} and "degree requirements" in text.lower():
34
+ break
35
+ if capture and node.name == "p":
36
+ paragraphs.append(text)
37
+ return " ".join(paragraphs)
38
+
39
+
40
+ def _extract_courses(table):
41
+ rows = []
42
+ for tr in table.find_all("tr"):
43
+ classes = tr.get("class") or []
44
+ if "bubbledrawer" in classes:
45
+ continue
46
+ cells = tr.find_all("td")
47
+ if len(cells) != 3:
48
+ continue
49
+ code = _clean(cells[0].get_text(" ", strip=True))
50
+ title = _clean(cells[1].get_text(" ", strip=True)).rstrip(".")
51
+ title = re.sub(r"\s+\d+$", "", title).rstrip(".")
52
+ credits = _clean(cells[2].get_text(" ", strip=True))
53
+ if not code or code.lower() == "course":
54
+ continue
55
+ try:
56
+ credit_value = float(credits)
57
+ except ValueError:
58
+ credit_value = None
59
+ rows.append(
60
+ {
61
+ "code": code,
62
+ "title": title,
63
+ "credits": credit_value,
64
+ }
65
+ )
66
+ return rows
67
+
68
+
69
+ def _extract_requirement_sections(tab):
70
+ if not tab:
71
+ return []
72
+ sections = []
73
+ current = None
74
+ pending_note = None
75
+ for child in tab.children:
76
+ if not getattr(child, "name", None):
77
+ continue
78
+ if child.name == "h2":
79
+ if current:
80
+ sections.append(current)
81
+ current = {"heading": _clean(child.get_text(" ", strip=True)), "notes": [], "courses": [], "course_groups": []}
82
+ pending_note = None
83
+ elif child.name == "p" and current:
84
+ text = _clean(child.get_text(" ", strip=True))
85
+ if text:
86
+ current["notes"].append(text)
87
+ pending_note = text
88
+ elif child.name == "div" and "courselist-wrapper" in (child.get("class") or []) and current:
89
+ table = child.find("table", class_="sc_courselist")
90
+ if table:
91
+ courses = _extract_courses(table)
92
+ current["courses"].extend(courses)
93
+ current["course_groups"].append({"note": pending_note or "", "courses": courses})
94
+ pending_note = None
95
+ if current:
96
+ sections.append(current)
97
+ return sections
98
+
99
+
100
+ def build_catalog():
101
+ seed_data = json.loads(SEED_PATH.read_text())
102
+ programs = seed_data.get("programs", [])
103
+ session = requests.Session()
104
+ built = []
105
+ for index, program in enumerate(programs, start=1):
106
+ response = session.get(program["official_url"], timeout=30)
107
+ response.raise_for_status()
108
+ soup = BeautifulSoup(response.text, "html.parser")
109
+ tabs = soup.select("div.tab_content")
110
+ summary = _extract_summary(tabs[1] if len(tabs) > 1 else None)
111
+ sections = _extract_requirement_sections(tabs[2] if len(tabs) > 2 else None)
112
+ flattened = []
113
+ for section in sections:
114
+ flattened.extend(section["courses"])
115
+ merged = dict(program)
116
+ merged["summary"] = summary or program.get("summary", "")
117
+ merged["requirements"] = flattened or program.get("requirements", [])
118
+ merged["requirement_sections"] = sections
119
+ merged["verified_on"] = date.today().isoformat()
120
+ built.append(sanitize_program(merged))
121
+ if index % 25 == 0:
122
+ print(f"Fetched {index}/{len(programs)} programmes")
123
+ OUTPUT_PATH.write_text(json.dumps(built, indent=2))
124
+ return built
125
+
126
+
127
+ if __name__ == "__main__":
128
+ build_catalog()
preparation/seed.py ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import hashlib
2
+ import json
3
+ import os
4
+ import pathlib
5
+ import random
6
+ import sqlite3
7
+
8
+ from werkzeug.security import generate_password_hash
9
+
10
+ from common.seed_utils import init_db, load_json
11
+ from common.synthetic_catalog import synthetic_professor_name
12
+
13
+
14
+ ROOT = pathlib.Path(__file__).parent
15
+ DB_PATH = ROOT / "db" / "minerva.sqlite3"
16
+ SCHEMA = ROOT / "schema.sql"
17
+ SEED_JSON = ROOT / "data" / "seed.json"
18
+ PROGRAM_CATALOG_JSON = ROOT / "data" / "program_catalog.json"
19
+ SEED = int(os.environ.get("APP_SEED", 42))
20
+ random.seed(SEED)
21
+
22
+
23
+ seed = load_json(SEED_JSON)
24
+ program_catalog = load_json(PROGRAM_CATALOG_JSON)
25
+
26
+ TERMS = ["Summer 2026", "Fall 2026", "Winter 2027"]
27
+ TERM_PREFIX = {"Summer 2026": "3", "Fall 2026": "1", "Winter 2027": "2"}
28
+ MEETING_PATTERNS = [
29
+ ("MWF", "08:35-09:25"),
30
+ ("MWF", "09:35-10:25"),
31
+ ("MWF", "10:35-11:25"),
32
+ ("TR", "10:05-11:25"),
33
+ ("TR", "11:35-12:55"),
34
+ ("MW", "14:35-15:55"),
35
+ ("TR", "14:35-15:55"),
36
+ ("MW", "16:05-17:25"),
37
+ ]
38
+
39
+ COMPONENT_SECTIONS = {
40
+ ("COMP", "202"): [("Laboratory", "F", "13:35-15:25"), ("Laboratory", "R", "14:35-16:25")],
41
+ ("COMP", "206"): [("Laboratory", "M", "15:35-17:25"), ("Conference", "F", "10:35-11:25")],
42
+ ("COMP", "250"): [("Conference", "M", "13:35-14:25"), ("Conference", "W", "13:35-14:25")],
43
+ ("MATH", "140"): [("Conference", "T", "15:35-16:25"), ("Conference", "R", "15:35-16:25")],
44
+ ("BIOL", "111"): [("Laboratory", "T", "13:35-16:25"), ("Laboratory", "R", "13:35-16:25")],
45
+ ("BIOL", "200"): [("Laboratory", "M", "14:35-17:25")],
46
+ ("CHEM", "110"): [("Laboratory", "M", "13:35-16:25"), ("Laboratory", "W", "13:35-16:25")],
47
+ ("CHEM", "212"): [("Laboratory", "T", "14:35-17:25")],
48
+ ("PHYS", "101"): [("Laboratory", "W", "14:35-17:25"), ("Conference", "F", "12:35-13:25")],
49
+ ("ECON", "208"): [("Conference", "T", "16:05-16:55"), ("Conference", "R", "16:05-16:55")],
50
+ }
51
+
52
+ SECTION_STATUS_OVERRIDES = {
53
+ ("Fall 2026", "COMP", "421"): "full_waitlist_open",
54
+ ("Fall 2026", "COMP", "206"): "full_waitlist_open",
55
+ ("Fall 2026", "MATH", "203"): "full_waitlist_full",
56
+ ("Winter 2027", "COMP", "250"): "full_no_waitlist",
57
+ ("Winter 2027", "MATH", "204"): "full_no_waitlist",
58
+ }
59
+
60
+
61
+ def _course_code(subject, number):
62
+ return f"{subject} {number}"
63
+
64
+
65
+ def _stable_rng(*parts):
66
+ key = "::".join(str(part) for part in parts)
67
+ digest = hashlib.sha256(key.encode("utf-8")).digest()
68
+ return random.Random(SEED + int.from_bytes(digest[:8], "big"))
69
+
70
+
71
+ def _components_for_course(course):
72
+ return COMPONENT_SECTIONS.get((course["subject"], course["number"]), [])
73
+
74
+
75
+ def _section_status(course, term, course_idx):
76
+ override = SECTION_STATUS_OVERRIDES.get((term, course["subject"], course["number"]))
77
+ if override:
78
+ return override
79
+ rng = _stable_rng(term, course["subject"], course["number"], course_idx)
80
+ p = rng.random()
81
+ if p < 0.10:
82
+ return "full_waitlist_open"
83
+ if p < 0.16:
84
+ return "full_waitlist_full"
85
+ if p < 0.22:
86
+ return "full_no_waitlist"
87
+ if p < 0.36:
88
+ return "nearly_full"
89
+ return "open"
90
+
91
+
92
+ def _section_availability(course, term, seats_total, course_idx):
93
+ status = _section_status(course, term, course_idx)
94
+ rng = _stable_rng("availability", term, course["subject"], course["number"], course_idx)
95
+ if status == "full_waitlist_open":
96
+ waitlist_total = rng.choice([10, 15, 20, 25, 30])
97
+ return seats_total, waitlist_total, rng.randint(1, waitlist_total - 1)
98
+ if status == "full_waitlist_full":
99
+ waitlist_total = rng.choice([5, 10, 15, 20])
100
+ return seats_total, waitlist_total, waitlist_total
101
+ if status == "full_no_waitlist":
102
+ return seats_total, 0, 0
103
+ if status == "nearly_full":
104
+ seats_left = rng.randint(1, min(5, max(1, seats_total // 12)))
105
+ return seats_total - seats_left, rng.choice([0, 5, 10, 15]), 0
106
+ return int(seats_total * rng.uniform(0.35, 0.76)), rng.choice([0, 5, 10, 15, 20]), 0
107
+
108
+
109
+ def _catalog_requirement_courses():
110
+ seen = {
111
+ _course_code(course["subject"], course["number"])
112
+ for course in seed["courses"]
113
+ }
114
+ additions = []
115
+ for program in program_catalog:
116
+ for req in program.get("requirements", []):
117
+ code = str(req.get("code", "")).strip()
118
+ parts = code.split()
119
+ if len(parts) < 2 or not parts[1][:3].isdigit():
120
+ continue
121
+ subject = parts[0].upper()
122
+ number = "".join(ch for ch in parts[1] if ch.isdigit())[:3]
123
+ if len(number) != 3:
124
+ continue
125
+ normalized_code = _course_code(subject, number)
126
+ if normalized_code in seen:
127
+ continue
128
+ title = str(req.get("title", "")).strip().rstrip(".")
129
+ if not title:
130
+ continue
131
+ seen.add(normalized_code)
132
+ additions.append(
133
+ {
134
+ "code": normalized_code,
135
+ "subject": subject,
136
+ "number": number,
137
+ "title": title,
138
+ "credits": float(req.get("credits") or 3),
139
+ }
140
+ )
141
+ return additions
142
+
143
+
144
+ def _forced_terms_by_code():
145
+ forced = {}
146
+ for user in seed["users"]:
147
+ for term, codes in user.get("registrations", {}).items():
148
+ mapped_term = "Fall 2026" if "Fall" in term else "Winter 2027" if "Winter" in term else term
149
+ for code in codes:
150
+ forced.setdefault(code, set()).add(mapped_term)
151
+ for term, codes in user.get("waitlist", {}).items():
152
+ mapped_term = "Fall 2026" if "Fall" in term else "Winter 2027" if "Winter" in term else term
153
+ for code in codes:
154
+ forced.setdefault(code, set()).add(mapped_term)
155
+ return forced
156
+
157
+
158
+ def _terms_for_course(course, idx):
159
+ code = _course_code(course["subject"], course["number"])
160
+ forced = _forced_terms_by_code().get(code, set())
161
+ level = int("".join(ch for ch in course["number"] if ch.isdigit())[:3] or 0)
162
+ if level < 250:
163
+ available = set(TERMS)
164
+ else:
165
+ rng = _stable_rng("terms", code, idx)
166
+ available = {term for term in TERMS if rng.random() < 0.58}
167
+ if not available:
168
+ available = {TERMS[idx % len(TERMS)]}
169
+ if rng.random() < 0.22:
170
+ available.add(TERMS[(idx + 1) % len(TERMS)])
171
+ available.update(forced)
172
+ return [term for term in TERMS if term in available]
173
+
174
+
175
+ def _courses():
176
+ courses = []
177
+ all_courses = list(seed["courses"]) + _catalog_requirement_courses()
178
+ for idx, course in enumerate(all_courses, start=1):
179
+ days, time = MEETING_PATTERNS[idx % len(MEETING_PATTERNS)]
180
+ merged = dict(course)
181
+ merged.setdefault("crn", str(20000 + idx))
182
+ merged.setdefault("days", days)
183
+ merged.setdefault("time", time)
184
+ merged.setdefault("campus", "Downtown")
185
+ merged.setdefault("seats_total", 70 + (idx % 9) * 10)
186
+ merged["terms"] = _terms_for_course(merged, idx)
187
+ courses.append(merged)
188
+ return courses
189
+
190
+
191
+ def expected_course_count():
192
+ return len({(c["subject"], c["number"]) for c in _courses()})
193
+
194
+
195
+ def expected_section_count():
196
+ total = 0
197
+ for course in _courses():
198
+ total += len(course["terms"]) * (1 + len(_components_for_course(course)))
199
+ return total
200
+
201
+
202
+ def _insert_accounts_and_profiles(con):
203
+ advisor_account_ids = {}
204
+ for advisor in seed["advisors"]:
205
+ cur = con.execute(
206
+ "INSERT INTO accounts(login_id,password_hash,name,role) VALUES(?,?,?,?)",
207
+ (
208
+ advisor["login_id"],
209
+ generate_password_hash(advisor["password"]),
210
+ advisor["name"],
211
+ "advisor",
212
+ ),
213
+ )
214
+ account_id = cur.lastrowid
215
+ advisor_account_ids[advisor["advisor_id"]] = account_id
216
+ con.execute(
217
+ """
218
+ INSERT INTO advisors(advisor_id,account_id,name,faculty,department,office)
219
+ VALUES(?,?,?,?,?,?)
220
+ """,
221
+ (
222
+ advisor["advisor_id"],
223
+ account_id,
224
+ advisor["name"],
225
+ advisor["faculty"],
226
+ advisor["department"],
227
+ advisor["office"],
228
+ ),
229
+ )
230
+
231
+ student_ids = {}
232
+ for user in seed["users"]:
233
+ cur = con.execute(
234
+ "INSERT INTO accounts(login_id,password_hash,name,role) VALUES(?,?,?,?)",
235
+ (
236
+ user["login_id"],
237
+ generate_password_hash(user["password"]),
238
+ user["name"],
239
+ "student",
240
+ ),
241
+ )
242
+ account_id = cur.lastrowid
243
+ student_id = int(user["student_id"])
244
+ student_ids[user["student_id"]] = student_id
245
+ con.execute(
246
+ """
247
+ INSERT INTO students(id,account_id,name,faculty,major,minor,major_group,advisor_id,bills_paid,current_balance)
248
+ VALUES(?,?,?,?,?,?,?,?,?,?)
249
+ """,
250
+ (
251
+ student_id,
252
+ account_id,
253
+ user["name"],
254
+ user["faculty"],
255
+ user["major"],
256
+ user.get("minor", ""),
257
+ user["major_group"],
258
+ user.get("advisor_id"),
259
+ int(user.get("bills_paid", 0)),
260
+ float(user.get("current_balance", 0)),
261
+ ),
262
+ )
263
+ for bill in user.get("bills", []):
264
+ con.execute(
265
+ """
266
+ INSERT INTO bills(student_id,term,label,amount,is_paid,method,confirmation)
267
+ VALUES(?,?,?,?,?,?,?)
268
+ """,
269
+ (
270
+ student_id,
271
+ bill["term"],
272
+ bill["label"],
273
+ float(bill["amount"]),
274
+ 1 if bill.get("is_paid") else 0,
275
+ "Seeded payment" if bill.get("is_paid") else "",
276
+ f"MIN-SEED-{student_id}-{len(user.get('bills', []))}",
277
+ ),
278
+ )
279
+ for entry in user.get("classes_taken", []):
280
+ con.execute(
281
+ """
282
+ INSERT INTO transcript_entries(student_id,course_code,term,grade,credits)
283
+ VALUES(?,?,?,?,?)
284
+ """,
285
+ (
286
+ student_id,
287
+ entry["code"],
288
+ entry["term"],
289
+ entry["grade"],
290
+ float(entry.get("credits", 3)),
291
+ ),
292
+ )
293
+ return student_ids
294
+
295
+
296
+ def _insert_programs(con):
297
+ for program in program_catalog:
298
+ con.execute(
299
+ """
300
+ INSERT INTO programs(program_id,slug,title,faculty,major_group,program_type,degree,summary,requirements_json,requirement_sections_json,verified_on,official_url)
301
+ VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
302
+ """,
303
+ (
304
+ program["program_id"],
305
+ program.get("slug", ""),
306
+ program["title"],
307
+ program["faculty"],
308
+ program["major_group"],
309
+ program.get("program_type", ""),
310
+ program.get("degree", ""),
311
+ program.get("summary", ""),
312
+ json.dumps(program.get("requirements", [])),
313
+ json.dumps(program.get("requirement_sections", [])),
314
+ program.get("verified_on", ""),
315
+ program.get("official_url", ""),
316
+ ),
317
+ )
318
+
319
+
320
+ def _insert_courses(con):
321
+ code_to_primary_crn = {}
322
+ course_idx = 0
323
+ for course in _courses():
324
+ for term in course["terms"]:
325
+ course_idx += 1
326
+ base_crn = str(course["crn"])
327
+ crn = f"{TERM_PREFIX[term]}{base_crn}"
328
+ professor = synthetic_professor_name(course["subject"], course["number"], "LEC")
329
+ seats_total = int(course.get("seats_total", 100))
330
+ seats_taken, waitlist_total, waitlist_taken = _section_availability(
331
+ course,
332
+ term,
333
+ seats_total,
334
+ course_idx,
335
+ )
336
+ con.execute(
337
+ """
338
+ INSERT INTO courses(crn,subject,number,title,professor,section_type,parent_crn,credits,days,time,campus,term,seats_total,seats_taken,waitlist_total,waitlist_taken)
339
+ VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
340
+ """,
341
+ (
342
+ crn,
343
+ course["subject"],
344
+ course["number"],
345
+ course["title"],
346
+ professor,
347
+ "Lecture",
348
+ None,
349
+ float(course["credits"]),
350
+ course.get("days", ""),
351
+ course.get("time", ""),
352
+ course.get("campus", "Downtown"),
353
+ term,
354
+ seats_total,
355
+ seats_taken,
356
+ waitlist_total,
357
+ waitlist_taken,
358
+ ),
359
+ )
360
+ code_to_primary_crn.setdefault((term, _course_code(course["subject"], course["number"])), crn)
361
+ for component_idx, (section_type, component_days, component_time) in enumerate(_components_for_course(course), start=1):
362
+ component_crn = f"{crn}{component_idx}"
363
+ component_total = min(seats_total, 35 if section_type == "Laboratory" else 45)
364
+ component_taken = min(seats_taken, int(component_total * (0.42 + component_idx * 0.12)))
365
+ con.execute(
366
+ """
367
+ INSERT INTO courses(crn,subject,number,title,professor,section_type,parent_crn,credits,days,time,campus,term,seats_total,seats_taken,waitlist_total,waitlist_taken)
368
+ VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
369
+ """,
370
+ (
371
+ component_crn,
372
+ course["subject"],
373
+ course["number"],
374
+ course["title"],
375
+ synthetic_professor_name(
376
+ course["subject"],
377
+ course["number"],
378
+ f"{'LAB' if section_type == 'Laboratory' else 'CON'}{component_idx}",
379
+ ),
380
+ section_type,
381
+ crn,
382
+ 0.0,
383
+ component_days,
384
+ component_time,
385
+ course.get("campus", "Downtown"),
386
+ term,
387
+ component_total,
388
+ component_taken,
389
+ 0,
390
+ 0,
391
+ ),
392
+ )
393
+ return code_to_primary_crn
394
+
395
+
396
+ def _insert_seeded_enrolments(con, code_to_primary_crn):
397
+ for user in seed["users"]:
398
+ student_id = int(user["student_id"])
399
+ for term, codes in user.get("registrations", {}).items():
400
+ mapped_term = "Fall 2026" if "Fall" in term else "Winter 2027" if "Winter" in term else term
401
+ for code in codes:
402
+ crn = code_to_primary_crn.get((mapped_term, code))
403
+ if crn:
404
+ con.execute("INSERT OR IGNORE INTO registrations(student_id,crn) VALUES(?,?)", (student_id, crn))
405
+ for term, codes in user.get("waitlist", {}).items():
406
+ mapped_term = "Fall 2026" if "Fall" in term else "Winter 2027" if "Winter" in term else term
407
+ for code in codes:
408
+ crn = code_to_primary_crn.get((mapped_term, code))
409
+ if crn:
410
+ position = con.execute(
411
+ "SELECT COALESCE(MAX(position), 0) + 1 FROM waitlists WHERE crn=?",
412
+ (crn,),
413
+ ).fetchone()[0]
414
+ con.execute(
415
+ "INSERT OR IGNORE INTO waitlists(student_id,crn,position) VALUES(?,?,?)",
416
+ (student_id, crn, position),
417
+ )
418
+ con.execute(
419
+ "UPDATE courses SET waitlist_taken = MAX(waitlist_taken, ?) WHERE crn=?",
420
+ (position, crn),
421
+ )
422
+
423
+
424
+ def seed_database():
425
+ init_db(DB_PATH, SCHEMA)
426
+ with sqlite3.connect(DB_PATH) as con:
427
+ _insert_accounts_and_profiles(con)
428
+ _insert_programs(con)
429
+ code_to_primary_crn = _insert_courses(con)
430
+ _insert_seeded_enrolments(con, code_to_primary_crn)
431
+ con.commit()
432
+
433
+
434
+ if __name__ == "__main__":
435
+ seed_database()
436
+ print("Minerva-lite seeded.")
preparation/synthetic_catalog.py ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import hashlib
2
+ import re
3
+
4
+
5
+ FACULTY_DISPLAY_NAMES = {
6
+ "Arts": "Bolder-Kohn Faculty of Arts and Letters",
7
+ "Arts & Science": "Bolder-Kohn Faculty of Integrated Arts and Sciences",
8
+ "Business & Management": "Bolder-Kohn School of Enterprise and Management",
9
+ "Engineering": "Bolder-Kohn Faculty of Engineering and Design",
10
+ "Science": "Bolder-Kohn Faculty of Natural and Computational Sciences",
11
+ }
12
+
13
+
14
+ SYNTHETIC_GIVEN_NAMES = [
15
+ "Aven",
16
+ "Brial",
17
+ "Caelis",
18
+ "Darian",
19
+ "Elowen",
20
+ "Ferren",
21
+ "Galen",
22
+ "Hollis",
23
+ "Ivara",
24
+ "Joren",
25
+ "Kaelin",
26
+ "Liora",
27
+ "Maren",
28
+ "Neris",
29
+ "Orin",
30
+ "Perrin",
31
+ "Quilla",
32
+ "Riven",
33
+ "Solen",
34
+ "Tavian",
35
+ "Ulric",
36
+ "Veyra",
37
+ "Wren",
38
+ "Xavian",
39
+ "Yara",
40
+ "Zerin",
41
+ ]
42
+
43
+
44
+ TEXT_REPLACEMENTS = (
45
+ ("Bolder-Kohn Faculty of Management", FACULTY_DISPLAY_NAMES["Business & Management"]),
46
+ ("Faculty of Management", FACULTY_DISPLAY_NAMES["Business & Management"]),
47
+ ("Faculty of Engineering", FACULTY_DISPLAY_NAMES["Engineering"]),
48
+ ("Faculty of Science", FACULTY_DISPLAY_NAMES["Science"]),
49
+ ("Faculty of the Arts", FACULTY_DISPLAY_NAMES["Arts"]),
50
+ ("Faculty of Arts", FACULTY_DISPLAY_NAMES["Arts"]),
51
+ ("Downtown campus", "Bluehaven Campus"),
52
+ ("Downtown Campus", "Bluehaven Campus"),
53
+ ("West Campus", "Lakeshore Campus"),
54
+ )
55
+
56
+
57
+ def faculty_display_name(value):
58
+ return FACULTY_DISPLAY_NAMES.get(str(value), str(value))
59
+
60
+
61
+ def sanitize_catalog_text(value):
62
+ text = str(value or "")
63
+ for original, replacement in TEXT_REPLACEMENTS:
64
+ if original.startswith("Faculty of"):
65
+ text = re.sub(rf"(?<!Bolder-Kohn ){re.escape(original)}", replacement, text)
66
+ else:
67
+ text = text.replace(original, replacement)
68
+ text = re.sub(
69
+ r"\b(?:[A-Z][A-Za-z'’-]+\s+){1,4}Building\b",
70
+ "Bluehaven Academic Hall",
71
+ text,
72
+ )
73
+ text = re.sub(
74
+ r"\bProf\.\s+[A-Z][A-Za-z'’-]+(?:\s+[A-Z][A-Za-z'’-]+){1,3}",
75
+ "the Bolder-Kohn program adviser",
76
+ text,
77
+ )
78
+ text = re.sub(
79
+ r"\bcontact\s+[A-Z][A-Za-z'’-]+\s+[A-Z][A-Za-z'’-]+,",
80
+ "contact the Bolder-Kohn program adviser,",
81
+ text,
82
+ )
83
+ text = re.sub(
84
+ r"(Lakeshore Campus)\s+in\s+[A-Z][A-Za-zÀ-ÿ'’-]+(?:-[A-Z][A-Za-zÀ-ÿ'’-]+)+",
85
+ r"\1 in Lakehurst",
86
+ text,
87
+ )
88
+ return text
89
+
90
+
91
+ def synthetic_program_summary(program):
92
+ title = str(program.get("title") or "Undergraduate Program").strip()
93
+ program_type = str(program.get("program_type") or "undergraduate").strip().lower()
94
+ program_article = "an" if program_type[:1] in "aeiou" else "a"
95
+ focus = str(program.get("major_group") or title).strip()
96
+ faculty = faculty_display_name(program.get("faculty", ""))
97
+ degree = str(program.get("degree") or "undergraduate credential").strip()
98
+ requirements = program.get("requirements") or []
99
+ unique_codes = list(
100
+ dict.fromkeys(
101
+ str(requirement.get("code", "")).strip()
102
+ for requirement in requirements
103
+ if str(requirement.get("code", "")).strip()
104
+ )
105
+ )
106
+ course_titles = list(
107
+ dict.fromkeys(
108
+ str(requirement.get("title", "")).strip()
109
+ for requirement in requirements
110
+ if str(requirement.get("title", "")).strip()
111
+ )
112
+ )
113
+ subject_areas = list(
114
+ dict.fromkeys(code.split()[0] for code in unique_codes if " " in code)
115
+ )
116
+ credit_values = [
117
+ float(requirement["credits"])
118
+ for requirement in requirements
119
+ if isinstance(requirement.get("credits"), (int, float))
120
+ ]
121
+ option_count = len(unique_codes)
122
+ listed_credits = sum(credit_values)
123
+ digest = hashlib.sha256(str(program.get("program_id", title)).encode("utf-8")).digest()
124
+ approaches = (
125
+ "close reading, structured inquiry, and independent synthesis",
126
+ "conceptual foundations, collaborative workshops, and applied analysis",
127
+ "comparative study, evidence-led discussion, and reflective projects",
128
+ "sequenced core work, flexible exploration, and integrative assignments",
129
+ "method training, case-based learning, and student-directed investigation",
130
+ "historical context, contemporary questions, and practical experimentation",
131
+ "quantitative reasoning, interpretive work, and cross-field connections",
132
+ "studio-style practice, critical feedback, and cumulative portfolio work",
133
+ "theory building, source evaluation, and problem-centred seminars",
134
+ "foundational breadth, focused electives, and a culminating inquiry",
135
+ "systems thinking, collaborative design, and iterative evaluation",
136
+ "disciplinary technique, ethical reflection, and public-facing communication",
137
+ )
138
+ outcomes = (
139
+ "frame precise questions and communicate well-supported conclusions",
140
+ "connect specialist knowledge with unfamiliar practical settings",
141
+ "assemble an academic pathway that balances depth with useful breadth",
142
+ "evaluate competing explanations and make careful, evidence-based choices",
143
+ "translate foundational ideas into independent analytical work",
144
+ "develop a flexible toolkit for advanced study and related professional work",
145
+ "recognize relationships across methods, scales, and fields of inquiry",
146
+ "turn complex source material into clear arguments and responsible decisions",
147
+ "test ideas iteratively while documenting the reasoning behind each result",
148
+ "build confidence moving between abstract models and concrete problems",
149
+ "combine individual initiative with constructive team-based practice",
150
+ "identify assumptions, examine consequences, and propose defensible responses",
151
+ )
152
+ openers = (
153
+ "At Bolder-Kohn University, {title} offers {article} {program_type} route through {focus}.",
154
+ "{title} is Bolder-Kohn University's {program_type} pathway for focused work in {focus}.",
155
+ "Designed within {faculty}, {title} approaches {focus} as a connected field of study at Bolder-Kohn University.",
156
+ "Bolder-Kohn University created {title} for students seeking {article} {program_type} plan centred on {focus}.",
157
+ "Within the {degree} credential family, {title} gives Bolder-Kohn students a distinct way to investigate {focus}.",
158
+ "The Bolder-Kohn catalog places {title} in {faculty} as a {program_type} exploration of {focus}.",
159
+ "Students entering {title} follow a Bolder-Kohn {program_type} curriculum shaped around {focus}.",
160
+ "{faculty} administers {title}, a Bolder-Kohn University plan devoted to sustained study of {focus}.",
161
+ "As {article} {program_type} offering at Bolder-Kohn University, {title} brings several perspectives to {focus}.",
162
+ "{title} maps a Bolder-Kohn University learning journey across the ideas and practices associated with {focus}.",
163
+ "Bolder-Kohn University's {title} turns interest in {focus} into a deliberately sequenced {program_type} plan.",
164
+ "Housed in {faculty}, {title} is a synthetic Bolder-Kohn curriculum for studying {focus} with purpose and range.",
165
+ )
166
+ method_sentences = (
167
+ "The learning design combines {approach}, helping students {outcome}.",
168
+ "Its academic rhythm moves among {approach}; the aim is to help learners {outcome}.",
169
+ "Students work through {approach} in order to {outcome}.",
170
+ "A mix of {approach} supports a central goal: to {outcome}.",
171
+ "Rather than following a single mode of study, the plan uses {approach} so participants can {outcome}.",
172
+ "The curriculum emphasizes {approach}, creating repeated opportunities to {outcome}.",
173
+ "Across the plan, {approach} provides the groundwork needed to {outcome}.",
174
+ "Its distinctive learning pattern pairs {approach} with the expectation that students will {outcome}.",
175
+ "Through {approach}, learners are invited to {outcome}.",
176
+ "The program's synthetic brief prioritizes {approach} and encourages students to {outcome}.",
177
+ "Work in the plan alternates between {approach}, all directed toward the ability to {outcome}.",
178
+ "Bolder-Kohn frames the experience around {approach}, enabling students to {outcome}.",
179
+ )
180
+ catalog_sentences = (
181
+ "The requirement map lists {count} course choices ({credits:g} listed credits), with examples such as {examples}.",
182
+ "Representative entries include {examples}; together, the local catalog records {count} options worth {credits:g} listed credits.",
183
+ "Among its {count} catalog options are {examples}, illustrating the range available for planning.",
184
+ "The current planning record spans {count} choices and highlights work such as {examples}; its listed entries total {credits:g} credits before substitutions.",
185
+ "Students can orient their choices around requirement examples like {examples}, drawn from a {count}-course local map.",
186
+ "A {count}-option requirement map connects offerings such as {examples} within the broader {degree} pathway.",
187
+ "In Minerva-lite, the plan is represented by {count} course options, including {examples}, across {credits:g} listed credits.",
188
+ "Coursework such as {examples} anchors a local selection map containing {count} distinct options.",
189
+ "Its catalog footprint brings together {examples} and {count_minus_examples} additional choices for individualized sequencing.",
190
+ "The plan's subject mix is visible in offerings such as {examples}; Minerva-lite records {count} available course choices.",
191
+ "Examples from the requirement blocks—{examples}—show how the plan's {count} options can support different routes through the field.",
192
+ "The local course map totals {credits:g} listed credits across {count} choices, ranging from {examples}.",
193
+ )
194
+ planning_sentences = (
195
+ "Minerva-lite is the planning workspace for prerequisites, term sequence, and Bolder-Kohn advising requests.",
196
+ "Learners use Minerva-lite to compare prerequisites and shape the plan with the Bolder-Kohn advising team.",
197
+ "Term-by-term choices are reviewed in Minerva-lite, where advising requests can be attached to the proposed sequence.",
198
+ "Minerva-lite keeps the pathway, prerequisite checks, and Bolder-Kohn guidance in one local workspace.",
199
+ "Planning happens in Minerva-lite so course order and advising questions remain connected to the degree record.",
200
+ "The Minerva-lite record helps students turn these options into a coherent sequence before consulting Bolder-Kohn advisers.",
201
+ "Students document their intended route in Minerva-lite and use it as the basis for Bolder-Kohn advising conversations.",
202
+ "Prerequisite review and term sequencing take place through Minerva-lite's local program-planning tools.",
203
+ "Minerva-lite provides the working view used to organize selections and request guidance when alternatives overlap.",
204
+ "The final route is assembled in Minerva-lite, with Bolder-Kohn advising available for substitutions and sequencing questions.",
205
+ "Students revisit the Minerva-lite plan as their interests develop and use advising requests to resolve constraints.",
206
+ "Minerva-lite turns the catalog outline into a term plan that can be reviewed with the Bolder-Kohn advising team.",
207
+ )
208
+
209
+ approach = approaches[digest[0] % len(approaches)]
210
+ outcome = outcomes[digest[1] % len(outcomes)]
211
+ if course_titles:
212
+ start = digest[2] % len(course_titles)
213
+ ordered_titles = course_titles[start:] + course_titles[:start]
214
+ selected_titles = ordered_titles[:3]
215
+ examples = ", ".join(selected_titles)
216
+ elif subject_areas:
217
+ examples = ", ".join(subject_areas[:3])
218
+ else:
219
+ examples = "individualized study, guided electives, and an integrative project"
220
+
221
+ values = {
222
+ "title": title,
223
+ "program_type": program_type,
224
+ "article": program_article,
225
+ "focus": focus,
226
+ "faculty": faculty,
227
+ "degree": degree,
228
+ "approach": approach,
229
+ "outcome": outcome,
230
+ "count": option_count,
231
+ "credits": listed_credits,
232
+ "examples": examples,
233
+ "count_minus_examples": max(0, option_count - min(3, len(course_titles))),
234
+ }
235
+ sentences = [
236
+ openers[digest[4] % len(openers)].format(**values),
237
+ method_sentences[digest[5] % len(method_sentences)].format(**values),
238
+ catalog_sentences[digest[6] % len(catalog_sentences)].format(**values),
239
+ planning_sentences[digest[7] % len(planning_sentences)].format(**values),
240
+ ]
241
+ if digest[8] % 2:
242
+ sentences[1], sentences[2] = sentences[2], sentences[1]
243
+ return " ".join(sentences)
244
+
245
+
246
+ def sanitize_program(program):
247
+ sanitized = dict(program)
248
+ sanitized["summary"] = synthetic_program_summary(sanitized)
249
+ sections = []
250
+ for section in sanitized.get("requirement_sections", []):
251
+ clean_section = dict(section)
252
+ clean_section["heading"] = sanitize_catalog_text(section.get("heading", ""))
253
+ clean_section["notes"] = [sanitize_catalog_text(note) for note in section.get("notes", [])]
254
+ if section.get("course_groups"):
255
+ clean_section["course_groups"] = [
256
+ {
257
+ **group,
258
+ "note": sanitize_catalog_text(group.get("note", "")),
259
+ }
260
+ for group in section.get("course_groups", [])
261
+ ]
262
+ sections.append(clean_section)
263
+ sanitized["requirement_sections"] = sections
264
+ return sanitized
265
+
266
+
267
+ def synthetic_professor_name(subject, number, section_key="LEC"):
268
+ token = re.sub(r"[^A-Z0-9]+", "", f"{subject}{number}{section_key}".upper())
269
+ digest = hashlib.sha256(token.encode("utf-8")).digest()
270
+ given = SYNTHETIC_GIVEN_NAMES[digest[0] % len(SYNTHETIC_GIVEN_NAMES)]
271
+ return f"Dr. {given} Quenvar-{token}"
preparation/syntheticize_catalog.py ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import json
3
+ import pathlib
4
+ import sqlite3
5
+ import sys
6
+
7
+
8
+ ROOT = pathlib.Path(__file__).resolve().parents[1]
9
+ sys.path.insert(0, str(ROOT))
10
+
11
+ from common.synthetic_catalog import sanitize_program, synthetic_professor_name
12
+
13
+
14
+ PROGRAM_CATALOG_PATH = ROOT / "data" / "program_catalog.json"
15
+ SEED_PATH = ROOT / "data" / "seed.json"
16
+ DB_PATH = ROOT / "db" / "minerva.sqlite3"
17
+
18
+ SYNTHETIC_ADVISORS = {
19
+ "9801001": {
20
+ "name": "Dr. Maren Quenvar-Advising-SCI",
21
+ "office": "Bluehaven Hall 3170",
22
+ },
23
+ "9801002": {
24
+ "name": "Dr. Solen Quenvar-Advising-ARTS",
25
+ "office": "Maplelight Hall 215",
26
+ },
27
+ "9801003": {
28
+ "name": "Dr. Veyra Quenvar-Advising-IAS",
29
+ "office": "Northstar Hall 401",
30
+ },
31
+ }
32
+
33
+
34
+ def write_json(path, data):
35
+ path.write_text(json.dumps(data, indent=2, ensure_ascii=False) + "\n")
36
+
37
+
38
+ def update_json_sources():
39
+ catalog = json.loads(PROGRAM_CATALOG_PATH.read_text())
40
+ catalog = [sanitize_program(program) for program in catalog]
41
+ write_json(PROGRAM_CATALOG_PATH, catalog)
42
+
43
+ seed = json.loads(SEED_PATH.read_text())
44
+ seed["programs"] = [sanitize_program(program) for program in seed.get("programs", [])]
45
+ seed["metadata"]["notes"] = (
46
+ "Program titles and course requirements are retained for local registration tasks. "
47
+ "All institutional descriptions, faculty display names, instructor and adviser labels, "
48
+ "locations, and links use synthetic Bolder-Kohn University data."
49
+ )
50
+ for advisor in seed.get("advisors", []):
51
+ synthetic_advisor = SYNTHETIC_ADVISORS.get(str(advisor.get("advisor_id")))
52
+ if synthetic_advisor:
53
+ advisor.update(synthetic_advisor)
54
+ write_json(SEED_PATH, seed)
55
+ return catalog, seed
56
+
57
+
58
+ def section_key(row):
59
+ if row["section_type"] == "Lecture":
60
+ return "LEC"
61
+ parent = str(row["parent_crn"] or "")
62
+ suffix = str(row["crn"])[len(parent):] if parent else str(row["crn"])
63
+ section_prefix = "LAB" if row["section_type"] == "Laboratory" else "CON"
64
+ return f"{section_prefix}{suffix}"
65
+
66
+
67
+ def update_database(catalog, seed):
68
+ if not DB_PATH.exists():
69
+ return
70
+ with sqlite3.connect(DB_PATH) as con:
71
+ con.row_factory = sqlite3.Row
72
+ for program in catalog:
73
+ con.execute(
74
+ """
75
+ UPDATE programs
76
+ SET summary=?, requirement_sections_json=?
77
+ WHERE program_id=?
78
+ """,
79
+ (
80
+ program["summary"],
81
+ json.dumps(program.get("requirement_sections", []), ensure_ascii=False),
82
+ program["program_id"],
83
+ ),
84
+ )
85
+ for advisor in seed.get("advisors", []):
86
+ con.execute(
87
+ "UPDATE advisors SET name=?, office=? WHERE advisor_id=?",
88
+ (advisor["name"], advisor["office"], advisor["advisor_id"]),
89
+ )
90
+ rows = con.execute(
91
+ "SELECT crn, subject, number, section_type, parent_crn FROM courses"
92
+ ).fetchall()
93
+ for row in rows:
94
+ con.execute(
95
+ "UPDATE courses SET professor=? WHERE crn=?",
96
+ (
97
+ synthetic_professor_name(row["subject"], row["number"], section_key(row)),
98
+ row["crn"],
99
+ ),
100
+ )
101
+ con.commit()
102
+
103
+
104
+ def main():
105
+ catalog, seed = update_json_sources()
106
+ update_database(catalog, seed)
107
+ print(f"Syntheticized {len(catalog)} program descriptions and the active database.")
108
+
109
+
110
+ if __name__ == "__main__":
111
+ main()
release-manifest.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "repo_id": "WebArena-Pro/minerva-lite-data",
3
+ "application_repository": "https://github.com/McGill-NLP/webarena-pro",
4
+ "prepared_at_utc": "2026-11-13T20:57:14.357615+00:00",
5
+ "visibility": "private",
6
+ "source_urls": [
7
+ "https://coursecatalogue.mcgill.ca/"
8
+ ],
9
+ "files": [
10
+ {
11
+ "path": "LICENSES.md",
12
+ "bytes": 854,
13
+ "sha256": "3677d8c18306e815d0889cea5a7177f8fc2b59caf9daa28eb4e9edd1719e9aa6"
14
+ },
15
+ {
16
+ "path": "README.md",
17
+ "bytes": 1981,
18
+ "sha256": "5718543d4dafd7e91f05d32649e18b00fd44e99c202530251ea1b5b6cffc523a"
19
+ },
20
+ {
21
+ "path": "data/courses_seed.json",
22
+ "bytes": 26796,
23
+ "sha256": "e970d76283e769ccd94eee7b9d4182509d8176edf2333a6cdd1470daf4818e22"
24
+ },
25
+ {
26
+ "path": "data/program_catalog.json",
27
+ "bytes": 4514659,
28
+ "sha256": "d65ede3f1e71c140c09bdf493b53a0ed216b9c8d1bb6fc0fbc98183c7fc4d1ad"
29
+ },
30
+ {
31
+ "path": "data/seed.json",
32
+ "bytes": 2309326,
33
+ "sha256": "e24e224514da2a49c9e17b413fa0487f72963ea205adc8daaf1f59f5ba98af6d"
34
+ },
35
+ {
36
+ "path": "preparation/program_catalog_builder.py",
37
+ "bytes": 4286,
38
+ "sha256": "a63aa4d9979900a30e2e6409856eb4447c72b39e0b94858a25316ebf7c213687"
39
+ },
40
+ {
41
+ "path": "preparation/seed.py",
42
+ "bytes": 16541,
43
+ "sha256": "89801677534952b20162d2bb9ce0eec91737f957183b7f4b9aa4b70c0f2ff2f8"
44
+ },
45
+ {
46
+ "path": "preparation/synthetic_catalog.py",
47
+ "bytes": 13987,
48
+ "sha256": "046c40fed1ebfc835a915ffbcf87821bf234db95d20b364b9a064c76c0306d5d"
49
+ },
50
+ {
51
+ "path": "preparation/syntheticize_catalog.py",
52
+ "bytes": 3595,
53
+ "sha256": "b8afadde9a3e6fea3dd707e3c304b54df6f7b46ecee207d2dc6657c3340dc9e5"
54
+ }
55
+ ],
56
+ "remote_media_preserved": false
57
+ }