Skip to content

Audit follow-up: correctness fixes, usability upgrades, and cleanup - #6

Merged
Ben-K-Jordan merged 1 commit into
mainfrom
claude/session-link-generation-SCkSf
Jul 16, 2026
Merged

Audit follow-up: correctness fixes, usability upgrades, and cleanup#6
Ben-K-Jordan merged 1 commit into
mainfrom
claude/session-link-generation-SCkSf

Conversation

@Ben-K-Jordan

Copy link
Copy Markdown
Owner

Implements everything from the second full audit (code bug hunt, leftovers sweep, and a live browser walkthrough of the whole user journey).

Correctness

  • Stable objective identity. Plan generators minted objective ids per block (obj_0, obj_1, ...), so plans with more than 6 objectives had colliding ids across blocks, cross-contaminating spaced-repetition mastery and keying feedback anchors to the wrong topic. Ids are now deterministic slugs of the objective title, identical wherever the objective appears.
  • Error-repair decks and previews are scoped to the session's course (a CS repair session no longer injects chemistry errors).
  • The final-attempt completion path guards its ACTIVE to COMPLETED transition, so racing it against "End Session" can no longer run post-completion effects (SM-2 advance, XP) twice.
  • AI-generated prompt difficulty is sanitized to an integer 1..5 before hitting the Int column.

Usability (from the live walkthrough)

  • Plan page: loads your existing plan on every visit (delete / reschedule / .ics always available), confirms and replaces same-course plans instead of silently stacking duplicates, and shows per-session focus lines, real dates with a Today marker, an exam-day row, and a "N days until exam" header.
  • Session runner: empty materials search persists an explicit no-sources state and the review panel says "Nothing matching in your materials" instead of spinning forever; free-recall prompts reveal the model answer and key points at self-score time; confidence is only recorded when actually rated (calibration no longer reports noise from the untouched default); typed answers and error-log drafts survive a refresh.
  • End screen: follow-up recommendations are one deterministic function of the run's results (no more changing across a refresh), and a "Schedule follow-ups" button inserts the recommended spaced sessions into the active plan, idempotently. "Start New Run" renamed to "Practice this session again".
  • First run: signup auto-signs-in when email verification is off; a muted "Mock AI" badge shows when no real AI provider is configured; the app has a favicon; the timezone field gains a Detect button with a live clock preview.

Cleanup

  • Dropped the orphaned notification-preferences route and model (migration also removes the dead display_name and leaderboard_visible columns; validated with migrate deploy from history plus an empty migrate diff).
  • Deleted orphan reminder email templates, practice-set and evidence zod schemas plus their tests, the sw.js header block, @types/web-push, the asset-manifest orphan, and the phantom CRON_SECRET from setup, env example, compose, and README.
  • Learn and achievements pages moved off the deprecated identity header; getOrCreateUserId is gone.

Verification

  • tsc --noEmit clean
  • 646 unit tests passed (36 new)
  • 137 integration tests passed (11 new)
  • Full e2e after production rebuild: 57 passed, 15 skipped (exact baseline)

Generated by Claude Code

Correctness: objective ids are now stable slugs of the objective title
instead of per-block obj_N indexes, so spaced repetition mastery and
feedback anchors no longer cross-contaminate objectives that happened
to share a position in different plan blocks. Error repair decks and
previews are scoped to the session's course. The final-attempt path
guards its ACTIVE to COMPLETED transition so a race with End Session
cannot run post-completion effects twice. AI prompt difficulty is
sanitized to an integer between 1 and 5.

Plan page: loads your existing plan on every visit with delete,
reschedule, and calendar export always available, replaces same-course
plans with confirmation instead of silently stacking duplicates, and
shows per-session focus lines, real calendar dates with a today marker,
an exam day row, and a days-until-exam header. Availability inputs
prefill from settings.

Session runner: an empty materials search now persists an explicit
no-sources state and the review panel says so honestly instead of
spinning forever; free-recall prompts reveal the model answer and key
points at self-score time; confidence is only recorded when actually
rated so calibration reflects real data; typed answers and error-log
drafts survive a mid-session refresh.

End screen: follow-up recommendations are one deterministic function
of the run's results and no longer change across a refresh, and a
schedule button inserts the recommended spaced sessions into the
active plan idempotently. Start New Run is now Practice this session
again.

First run: signup signs you in automatically when email verification
is off, a small badge shows when the AI provider is the mock, the app
has a favicon, and the timezone field gains a detect button with a
live clock preview.

Cleanup: notification preferences route and model dropped with a
migration that also removes the dead display_name and
leaderboard_visible columns, orphan reminder email templates and
practice-set and evidence schemas deleted, sw.js header block and
@types/web-push removed, phantom CRON_SECRET removed from setup, env
example, compose, and README.
@Ben-K-Jordan
Ben-K-Jordan merged commit 41fcbfd into main Jul 16, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants