mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-08 18:01:20 -05:00
[PR #1598] [MERGED] refactor(staffml): retire prod static-fallback; opt-in dev-only #9210
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?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1598
Author: @profvjreddi
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @profvjreddi
Base:
dev← Head:cleanup/retire-static-fallback📝 Commits (1)
fd873ecrefactor(staffml): retire prod static-fallback; opt-in dev-only📊 Changes
18 files changed (+177 additions, -1778 deletions)
View changed files
📝
.github/workflows/staffml-publish-live.yml(+12 -14)📝
interviews/staffml/.env.example(+12 -5)➖
interviews/staffml/scripts/DEPRECATED.md(+0 -36)📝
interviews/staffml/scripts/validate-vault.py(+21 -220)📝
interviews/staffml/src/app/plans/page.tsx(+7 -1)📝
interviews/staffml/src/app/practice/page.tsx(+10 -1)📝
interviews/staffml/src/lib/corpus-provider.tsx(+11 -8)➖
interviews/staffml/src/lib/corpus-source.ts(+0 -56)➖
interviews/staffml/src/lib/corpus-vault.ts(+0 -161)📝
interviews/staffml/src/lib/corpus.ts(+54 -49)📝
interviews/staffml/src/lib/hooks/useFullQuestion.ts(+49 -27)➖
interviews/staffml/src/lib/hooks/useVaultQuestion.ts(+0 -49)📝
interviews/staffml/src/lib/taxonomy.ts(+1 -1)➖
interviews/staffml/src/lib/vault-fallback.ts(+0 -22)➖
interviews/vault-cli/docs/CUTOVER_QA.md(+0 -210)➖
interviews/vault/docs/RESUME_PLAN_2026-04-25.md(+0 -331)➖
interviews/vault/docs/RESUME_PLAN_PHASE_D.md(+0 -273)➖
interviews/vault/docs/RESUME_PLAN_RELEASE.md(+0 -314)📄 Description
Summary
corpus.jsonstatic-fallback path as a production safety net. The Cloudflare Worker is now the only data source for full question details in prod; on Worker error, the UI shows a "details unavailable" banner.NEXT_PUBLIC_VAULT_FALLBACK=staticand runvault build --legacy-jsonto materializecorpus.jsonon disk for offline work.corpus-source.ts,corpus-vault.ts,useVaultQuestion.ts,vault-fallback.ts) and 5 stale planning docs.Why
Post-cutover the Worker has been serving prod for ~1 week. The static fallback wasn't actually a usable safety net —
corpus.jsonis a generated artifact whose prosedetails(common_mistake,realistic_solution,napkin_math) are blank incorpus-summary.json, so a Worker outage that triggered the fallback would silently degrade content rather than preserve it. Better to make the failure visible.Changes
Behavior:
staffml-publish-live.ymlno longer runsvault build --legacy-json; smoke tests rewritten againstcorpus-summary.json.corpus.ts:getQuestionFullDetailno longer falls back to static on Worker error — throws souseFullQuestioncan surface the error state.shouldUseStaticDetails()no longer auto-triggers onlocalhost— explicit env var only.useFullQuestionsignature changed:Question | undefined→{ question, status: 'loading' | 'ready' | 'error' }. Practice and plans pages updated to render an amber banner whenstatus === 'error'.taxonomy.tsnow importscorpus-summary.json(wascorpus.json).validate-vault.pycollapsed to sparse-only (per-question validation lives invault check --strict).Deletions (code, dead post-cutover):
interviews/staffml/src/lib/vault-fallback.tsinterviews/staffml/src/lib/corpus-source.tsinterviews/staffml/src/lib/corpus-vault.tsinterviews/staffml/src/lib/hooks/useVaultQuestion.tsDeletions (stale docs):
interviews/staffml/scripts/DEPRECATED.mdinterviews/vault-cli/docs/CUTOVER_QA.mdinterviews/vault/docs/RESUME_PLAN_2026-04-25.mdinterviews/vault/docs/RESUME_PLAN_PHASE_D.mdinterviews/vault/docs/RESUME_PLAN_RELEASE.mdTest plan
npx tsc --noEmitcleannpm test— 37/37 passingnpm run build— all 15 static routes generatedNEXT_PUBLIC_VAULT_FALLBACK=static+ runningvault build --legacy-jsonstill produces a working offline dev build🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.