PR #139: staging cleanup, removing only the safe list you confirmed
This PR deletes the dead code, unused assets and stale files you marked safe to remove in the cleanup audit, and nothing else. Every "ask" and "keep" item is still there. No migrations, database, deploy config, workflows, secrets or E2E specs are touched, and nothing was deployed or merged.
REVIEW: PASS An independent reviewer passed it in round 2 with no blocking and no "should" items. Round 1 had raised two blockers and one "should"; all three are fixed. CI is green at head 981ff90f. Only you merge to staging.
Who built and reviewed it
| Builder | Claude Opus 5.5, high effort, in a Cursor cloud agent |
| Reviewer | gpt-5.6-sol, high effort, in a separate Cursor cloud agent (bc-d4beeba4) |
| Verdict | PASS round 2, no blockers |
What the PR changes
- 304 files deleted: unused frontend components and assets (about 18 MB), 3 dead backend files, 5 unused prompt constants, 2 unused npm packages, stale docs, and generated reports (156 files, 32 MB).
- 20 files edited, only to remove the dead code listed in the audit and tidy the imports and comments it left behind.
- One file added:
docs/cleanup-audit.md, which lists every item with its evidence, risk and action.
What changed after the first review
- Report files restored. The four
docs/reports/ducky-prompt-quality-final*files are back, because a kept script (render_ducky_prompt_quality_report.py) names them. They are now an ask item in the audit. The reviewer confirmed they matchstagingbyte for byte. - GraphPanel mention fixed.
knowledge base creation.mdnow marks the oldGraphPanel.tsxmention as historical, since this PR removes that file. - New local video of the branch running on
next dev(the first video below).
The videos
Both are browser screen recordings of this branch, with a 3-second hold at the start and the end. Neither shows a signed-in student. Signing in as a student locally needs WorkOS secrets that agents don't have, and the repo has no dev-only student login. The builder didn't add one or forge a cookie, and the reviewer accepted this. What the videos do prove is that the pages a student goes through still load after the deletions, with no missing images or broken components. Click a timestamp to jump there and pause.
1. Local dev: landing, sign-in, dashboard and lesson
PASS- What this checks
- It runs this branch on
next devon localhost and walks the student path. When the real page needs a signed-in student, it uses the closest existing dev-only page with sample data instead. A caption, added only in the test browser, labels each step as real or stand-in. No backend ran, and nothing reached staging or the database. - Which part of the PR it proves
- The pages that use the most components and assets (landing, sign-in, the learner dashboard, the science roadmap and the lesson screen) still render after 304 files were deleted. If the cleanup had removed something still in use, you'd see a crash, a broken image or a missing component here.
- What to watch for
- Real landing page, held about 3 seconds. The duck art and the partner logos load.
- Real sign-in page.
- Real
/dashboardsends a signed-out visitor back to sign-in, as it should. - Stand-in:
/preview/family/learner, the dev-only learner dashboard with sample data. - Stand-in:
/chapters/roadmap-preview, which renders the real science roadmap with sample progress. - Real lesson URL also sends a signed-out visitor to sign-in.
- Stand-in:
/demo/responsive-session, the lesson screen with sample data ("The water cycle"), then its live mode, held to the end. The stage looks a little clipped under "Start teaching". That happens on staging too, so this PR didn't cause it.
2. Docker image of this branch, signed out
PASS- What this checks
- It builds the frontend Docker image from this branch the same way the staging deploy does, runs it, and opens the sign-in page,
/dashboard, a lesson URL and the landing page while signed out. - Which part of the PR it proves
- The production build, not just dev mode, still works after the deletions. The login redirects that protect the dashboard and lessons still work, and the landing page loads all its images and sections.
- What to watch for
- Sign-in page, held about 3 seconds.
-
/dashboard, then the lesson URL. Both land back on sign-in, because the visitor is signed out. - The landing page scrolls through "See it before you try it" and "What to expect", and all the images load.
- to the end: back on the top of the landing page, held about 3 seconds.
Other checks
CI at 981ff90f | green: 7 jobs passed and 2 deploy jobs skipped, as they should be on a PR. The last commit is empty and only reran CI. |
| Audit vs deletions | The reviewer found 304 deletions expected and 304 made, with nothing missing and nothing extra. Searches for every deleted file and name found nothing that still uses them. |
| Frontend | lint, typecheck and build passed. 1,106 of 1,111 tests passed, with the same 5 skips as staging. |
| Backend pytest | 1,566 passed and 37 skipped. Staging has 1,589 passing; the 23 missing are the tests for the deleted dead module. |
| Docker builds | frontend and backend images both build |
| New-code checker | 325 changed files, 0 findings |
| Critical E2E against staging | 4 passed and 2 skipped. The skips are covered below. |
Non-blocking notes from the reviewer
- A broken path that was already there.
backend/scripts/render_ducky_prompt_quality_report.pylooks for a repo-rootreports/folder that doesn't exist, so it fails withFileNotFoundError. It fails the same way onstagingtoday, and this PR doesn't change the script. - Two E2E skips depend on #136. The "student reaches dashboard" and "Study Ducky session" tests are marked as known failures until #136 fixes students landing on "Choose your plan".
For you
- Fix the broken path in
render_ducky_prompt_quality_report.py? ItsREPORTSsetting points atreports/instead ofdocs/reports/. Should this be fixed in a separate PR, or left alone? - Add a dev-only student login mock? A local-only fake student session (blocked in production) would let E2E tests and future videos show a signed-in student dashboard and lesson. Should one be added?
- Review the ask list in
docs/cleanup-audit.md. That includes 14 routes, some scripts, DB tables and the restored reports, all still untouched. - Merge to
stagingwhen you're happy.