Skip to content

feat: M3 planner & routine — weekly routines, cycle mode, stats and web push - #3

Merged
EliseuSantos merged 3 commits into
feat/m2-student-corefrom
feat/m3-planner
Jul 10, 2026
Merged

feat: M3 planner & routine — weekly routines, cycle mode, stats and web push#3
EliseuSantos merged 3 commits into
feat/m2-student-corefrom
feat/m3-planner

Conversation

@EliseuSantos

Copy link
Copy Markdown
Owner

Stacked on #2 (M2 student core). Merge order: #1#2 → this.

What

Milestone 3 (planner & routine), complete — a week of routine auto-populates Today, and falling behind produces a calm forward replan, never a backlog:

  • Planner (packages/core): weekly RRULE subset (FREQ=WEEKLY;BYDAY=…), schedule-mode allocation in topological order (deps first, per-track cursor), weighted cycle round-robin with persisted pointer, forward-only idempotent replan, and buildToday merging overdue reviews → due reminders → today's blocks → fresh reviews.
  • Stats (packages/core): net seconds per day (zero-filled), streak with yesterday fallback, accuracy by track, ISO-week comparison, weak-topic detector (0.7·low-rating share + 0.3·inverse net time).
  • Repos (packages/db): routines, targets (targetProgress by metric/period incl. track-scoped review joins), reminders, cycle slots (atomic replace-all + local-only pointer), read-only stats feeds, updateTrack.
  • Web push (apps/worker): /push/subscribe, /push/vapid, 5-min cron sending payload-less VAPID pushes (ES256 via WebCrypto — JWT signature verified in tests with a per-run keypair), 404/410 cleanup, gen-vapid.ts + secret format docs.
  • UI: /routines weekly grid; cycle editor with weights on the track view; /stats (12-week amber heatmap, streak, comparison, weak topics); /reminders (local notifications with permission-on-click, push subscribe, .ics export); Today v2 with plan blocks, target progress bars and the replan note; service worker + full header nav.

Tests

  • 133 bun tests across core/db/shared/worker (planner topology, cycle expansion, replan idempotence, streak/ISO-week edges, VAPID JWT verification, targets windows)
  • Cypress 12: new planner-loop.cy.ts (routine → Today block, due reminder → Today, stats after a session, .ics download) + all previous specs green; fixed a cross-spec OPFS contamination in student-loop (shared db across specs)

🤖 Generated with Claude Code

EliseuSantos and others added 3 commits July 10, 2026 02:59
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- core planner: weekly rrule subset, topological schedule allocation,
  weighted cycle round-robin, forward-only replan, buildToday merge
- core stats: net hours per day, streak, accuracy, iso-week comparison,
  weak-topic detector
- db repos: routines, targets (progress by metric/period), reminders,
  cycle slots (atomic replace + local pointer), stats feeds, updateTrack
- worker: /push/subscribe, /push/vapid, 5-min cron sending payload-less
  VAPID web push (ES256 via WebCrypto, jwt signature-verified in tests),
  gen-vapid script and secret format docs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- /routines: weekly grid, day toggles, track binding, delete
- cycle editor on track view (mode toggle, weights, debounced replace-all)
- /stats: 12-week heatmap (heat tokens), streak, iso-week comparison,
  accuracy by track, weak topics
- /reminders: CRUD, local notifications (permission on click), push
  subscribe flow, .ics export
- Today v2: buildToday merge (reviews + plan blocks + reminders with
  data-kind), target progress bars, calm replan note
- service worker (payload-less push -> generic notification) + header nav
- e2e: planner-loop.cy.ts (routine->Today block, due reminder, stats
  after session, ics download)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant