Phase 4a: fetch and parse the authoritative Compass learning tasks

The Learning Tasks grid is capped at 20 rows and, on the parent page, mixes
both children, so it cannot answer "what is overdue". The parent home page
reported 6 overdue tasks for Harry while the stored grid held 1.

Fetch the per-child task list (read-only) from
POST /Services/LearningTasks.svc/GetAllLearningTasksByUserId, parse it into
task rows, and refuse to store it when the overdue count disagrees with the
home page summary (FR-12).

- fetcher: store learning-tasks-all.json + meta (userId, status, task count)
- parse: new learning-tasks-all page, JSON parser, home-page reconciliation
- store: drop superseded grid-derived task rows before the upsert
- docs: docs/phase-4a-overdue-tasks.md; close the Phase 3 known gap

Verified with live runs: Harry 70 tasks / 6 overdue, Finn 42 tasks / 2 overdue,
both equal to the home page; a tampered home page stops the parse.

Note: the fetcher and store.go files also carry the per-child session work
that was already uncommitted in this shared workspace (AUD-108).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-10-15 17:38:22 +11:00
parent d7d529eb0f
commit 5d263987dd
8 changed files with 913 additions and 82 deletions

View File

@@ -81,8 +81,9 @@ same row. Second run of the same raw pages: `inserted 0, updated 56`.
- The learning-tasks grid is capped at the most recent 20 tasks
(`Compass.attributes.LearningTask_Default_Records_Count = 20`). The parent
landing page reports more overdue work than the grid contains, so a later
fetch must open the overdue-filtered view. This blocks the dashboard's
"overdue" column, not Phase 3.
landing page reports more overdue work than the grid contains. **Closed by
Phase 4a:** `learning-tasks-all` is now the authoritative per-child list, and
the parser fails loudly when it disagrees with the home page. See
`docs/phase-4a-overdue-tasks.md`.
- Team homework is not parsed here; that is FR-15, a separate source.
- No model is used to classify the Teams source yet.