mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-17 08:28:07 -05:00
[GH-ISSUE #1822] StaffML: link each question to recommended textbook reading (topic → chapter) #19827
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @profvjreddi on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1822
Idea
When a StaffML question is shown, offer a "want to learn more about this?" pointer back into the textbook — a go-deeper link tied to the question's topic, not an answer key. The textbook is where StaffML's content is sourced, so this closes the loop from practice back to the book (Vol 1 + Vol 2). Future versions could broaden to other sources; v1 is book-only.
Key finding — the plumbing is already dormant
A
Resourcetype and adetails.resourcesfield already exist in the question schema, the TS types, and the corpus bundle — but 0 of the ~10,700 questions populate it and nothing renders it.Footer.tsxdocuments the reason it was parked: "Per-question book links are deferred until mlsysbook.ai URLs stabilize." This issue is to un-defer it.Approach (low-effort, high-coverage)
Don't hand-author a reference per question. Every question already carries a
topic(one of 87 curated) andcompetency_area(one of 13). Map the 87 topics → chapters once and derive each question's reference automatically at build time.topic_chapter_map.yaml(~87 rows: topic → primary chapter + optional "also see").book_refsinto the summary bundle (renders synchronously, no extra fetch).details.resourcesstays available for per-question overrides later.URL stability (the original blocker — resolved)
The live chapter URL pattern is stable and verified (HTTP 200):
https://mlsysbook.ai/vol{N}/contents/vol{N}/{chapter}/{chapter}.htmlLink at chapter granularity for v1 — section anchors carry auto-generated hash suffixes that regenerate on rebuild. Add a build-time link-checker so a mapped chapter that doesn't exist fails the build (turns "wait until URLs stabilize" into "URLs are enforced valid").
Pedagogy
Show the reading after the attempt, not before — a "Learn more" card below the revealed solution. Optionally, on a wrong answer, surface the prerequisite topic's chapter (the taxonomy already encodes prerequisite edges).
Phasing
topic_chapter_map.yaml+ build join + chapter-level "Learn more" card + link-checker.resourcesoverrides.Filed as a future enhancement; a first-pass 87-row topic→chapter draft already exists to seed step 1.