Feature: multiple presence patterns per child (schema 9) #232

Merged
Member

Feature PR: the multi-pattern presence model, its admin routes and the Admin PWA management UI, plus the request-shape and editor fixes found in review.

Task e63a8e64 (Feature c1f79a07) covers the whole vertical slice because the API replacement and the client conversion cannot land separately without breaking the app (PR #231 round 1 finding F1). Task PR #231 was re-reviewed across three remediation rounds: F1 HIGH (client still called the removed route) fixed; F1 MEDIUM (lax weekday int parsing coerced true/"1"/1.0 to weekday 1) fixed at b91ecbd; F2 MEDIUM (the pattern editor blocked saving an all-empty weekday set, so a migrated all-absent home pattern could not be edited) fixed at 0d76351. Final review: APPROVED at exact head 0d763519a0, squash-merged into this branch as 88b4733.

Checks: TZ=UTC uv run pytest -q = 1985 passed, 0 failed; cd admin && npm test = 15 files, 231 passed; npm run build exit 0. Model: a child has zero or more patterns (name, kind home|away, cycle 1..4, anchor, per-week weekday set; weekday numbering unchanged at Monday=0..Sunday=6). Evaluation first match wins: overrides, then away, then home, then absent when the child has home patterns, else present. Migration 9 copies every presence_schedules row into a home pattern named "Home schedule" and drops the old table; a test proves presence results are unchanged for a pre-migration fixture. Schema 8 -> 9: 0.7.1 refuses a version-9 database, so the rollback step (copy the SQLite file or note the Litestream generation before first start) still needs adding to deploy/RUNBOOK.md - tracked by the docs task da2dd935.

Feature PR: the multi-pattern presence model, its admin routes and the Admin PWA management UI, plus the request-shape and editor fixes found in review. Task e63a8e64 (Feature c1f79a07) covers the whole vertical slice because the API replacement and the client conversion cannot land separately without breaking the app (PR #231 round 1 finding F1). Task PR #231 was re-reviewed across three remediation rounds: F1 HIGH (client still called the removed route) fixed; F1 MEDIUM (lax weekday int parsing coerced true/"1"/1.0 to weekday 1) fixed at b91ecbd; F2 MEDIUM (the pattern editor blocked saving an all-empty weekday set, so a migrated all-absent home pattern could not be edited) fixed at 0d76351. Final review: APPROVED at exact head 0d763519a0a80ad1c83049930e7394ca12b1814a, squash-merged into this branch as 88b4733. Checks: TZ=UTC uv run pytest -q = 1985 passed, 0 failed; cd admin && npm test = 15 files, 231 passed; npm run build exit 0. Model: a child has zero or more patterns (name, kind home|away, cycle 1..4, anchor, per-week weekday set; weekday numbering unchanged at Monday=0..Sunday=6). Evaluation first match wins: overrides, then away, then home, then absent when the child has home patterns, else present. Migration 9 copies every presence_schedules row into a home pattern named "Home schedule" and drops the old table; a test proves presence results are unchanged for a pre-migration fixture. Schema 8 -> 9: 0.7.1 refuses a version-9 database, so the rollback step (copy the SQLite file or note the Litestream generation before first start) still needs adding to deploy/RUNBOOK.md - tracked by the docs task da2dd935.
dev_agent added 2 commits 2026-09-24 20:11:33 -04:00
review_agent left a comment
Member

Independent Codex gpt-5.6-terra review completed for this exact commit.

Independent Codex gpt-5.6-terra review completed for this exact commit.
approver_agent merged commit c313e1c56f into dev 2026-09-24 20:15:27 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#232