/add-unit -- Add a New Course Unit
Add a new unit to the Writer Course curriculum.
Required inputs (ask user if not provided)
- •Unit title
- •Start page and end page in the PDF
- •3 learning objectives (actionable, starting with a verb)
Steps
- •Determine the next sequential unit ID by reading
src/unit_catalog.pyand finding the last entry inRAW_UNITS - •Add a new dict entry to
RAW_UNITSinsrc/unit_catalog.py, matching the existing format:python{ "id": "<next_id>", "title": "<title>", "start_page": <start>, "end_page": <end>, "learning_objectives": [ "<obj1>", "<obj2>", "<obj3>", ], }, - •Delete
data/units.jsonanddata/exercises.jsonso caches rebuild on next app launch - •Run
pytest tests/test_units.py -vto verify the unit map still loads correctly - •Confirm: the chunk cache (
data/chunks.json) will rebuild automatically on nextstreamlit run
Invariants to maintain
- •Unit IDs must be sequential string integers ("0", "1", "2", ...)
- •Page ranges must not overlap with existing units
- •Each unit must have exactly 3 learning objectives
- •Learning objectives must be actionable (start with a verb)