feat(practice): add an explicit month-anchor step to Guided Solve (#10) - #30
Merged
Conversation
Guided Solve taught a four-part method but only asked three picks — the month
anchor (the linchpin from Learn Stage 3) was never checked, surfacing only as a
read-only StepTrace row. Add a fourth step that asks for the anchor's
day-of-month (a number), between the year's doomsday and the final weekday.
- useGuided: 5-state machine (century → yearDoom → monthAnchor(number) → final →
graded); new pickAnchor() for the number step (pick() handles the weekday steps).
- drill.ts/db.ts: GuidedAnswers.monthAnchorDay; Attempt.monthAnchorCorrect (0|1|null);
gradeGuided grades it against trace.monthAnchorDay INDEPENDENTLY — a wrong anchor
never cascades into the final weekday grade (still absolute g.final === t.result).
The three non-guided grade helpers backfill null; ~10 fixtures updated.
- GuidedSolve: NumberPad (ANCHOR_DAYS) for the anchor step; a 4th summary row;
per-step chime/haptic fires for the anchor too; graded === step 4.
- stats.ts: surface the new dimension in the Progress step breakdown ("Month anchor").
We ask for the anchor DATE, not its weekday — the anchor's weekday IS the year's
doomsday already picked (monthAnchorWeekday === yearDoomsday), so a weekday re-pick
would be redundant. No leap-year hint, so it stays a genuine Stage 2+3 check.
Tests: drill.test.ts (independent grading, no cascade); GuidedSolve.test.tsx (4-step
flow incl. the NumberPad); a direct useGuided step-machine test. 295 tests, typecheck,
lint, build all green. Adversarial review of the diff: 0 Critical/Important.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Cleanup from /simplify + /code-review on the Guided month-anchor step: - Add a shared ordinal() helper (format.ts) and use it for the month-anchor row — fixes "the 3th" (a January common-year anchor is day 3, so the row literally rendered "the 3th ✓"). - Make PickRow generic so the three weekday rows pass weekdayName directly, dropping the wd wrapper and its `as Weekday` cast and restoring compile-time Weekday typing the diff had widened away. typecheck ✓ · lint --max-warnings 0 ✓ · tests ✓ Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to the new ordinal() helper: the inline `${n}th` template in
StepTrace and the three workedExample step lines had the same grammar bug
the Guided row did. Worst case was workedExample's `The ${day}th`, where
day is any 1–31, so it rendered "The 1th / 21th / 31th"; StepTrace showed
"the 3th" for January common years. All now use ordinal(), so the helper
has zero remaining inline copies.
typecheck ✓ · lint --max-warnings 0 ✓ · 296 tests ✓
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10. Roadmap item 6/7 (the heaviest).
Guided Solve teaches a four-part method but only asked three picks — the month anchor (the linchpin from Learn Stage 3) was never checked; it surfaced only as a read-only StepTrace row. This adds a fourth step asking for the anchor's day-of-month (a number), between the year's doomsday and the final weekday.
Changes
useGuided— 5-state machine:0 century → 1 yearDoom → 2 monthAnchor(number) → 3 final → 4 graded. NewpickAnchor(n)for the number step;pick(w)handles the weekday steps.drill.ts/db.ts—GuidedAnswers.monthAnchorDay;Attempt.monthAnchorCorrect: 0 | 1 | null.gradeGuidedgrades it againsttrace.monthAnchorDayindependently — no cascade: a wrong anchor never changes the final weekday grade (still absoluteg.final === t.result). The three non-guided grade helpers backfillnull; ~10 fixtures updated.GuidedSolve— renders aNumberPad(reusingANCHOR_DAYS) at step 2; adds a 4th summary row; per-step chime/haptic fires for the anchor too;graded === step 4.stats.ts— surfaces the new dimension in the Progress step breakdown ("Month anchor"), so a step the user can now get wrong actually appears in their weakness rows (caught by the diff review as the one loose end).Design notes (for review)
monthAnchorWeekday === yearDoomsday), so a weekday re-pick would just re-ask the prior answer.Verification
typecheck ✓ · lint
--max-warnings 0✓ · 295 tests ✓ · build ✓. Tests: independent/no-cascade grading (drill.test.ts), the 4-step flow incl. the NumberPad (GuidedSolve.test.tsx), and a direct 5-stepuseGuidedmachine test. Adversarial review of the diff surfaced 0 Critical/Important (3 Minor, all fixed in this PR).🤖 Generated with Claude Code