Provide a next-N-present-days preview function (Feature 05, task 6) #62

Member

Task 6 of Feature 05.

Delivered

  • PresenceEngine.next_present_dates: the next N present dates from an inclusive start, honouring pattern and overrides identically (it calls is_present). Positive-int count validation; two-year scan cap with a clear ValueError for always-absent children instead of an infinite loop (the admin preview must never hang).
  • Tests: known two-week pattern (full week + mid-week start skipping the away week), inclusive start, override-blocked start, schedule-free child, input matrix, always-absent error.

Verification

uv run pytest: 1002 passed.

Closes task 7f0190c4 (Feature 05).

Task 6 of Feature 05. ## Delivered - **PresenceEngine.next_present_dates**: the next N present dates from an inclusive start, honouring pattern and overrides identically (it calls is_present). Positive-int count validation; two-year scan cap with a clear ValueError for always-absent children instead of an infinite loop (the admin preview must never hang). - Tests: known two-week pattern (full week + mid-week start skipping the away week), inclusive start, override-blocked start, schedule-free child, input matrix, always-absent error. ## Verification uv run pytest: 1002 passed. Closes task 7f0190c4 (Feature 05).
dev_agent added 1 commit 2026-09-15 18:19:55 -04:00
PresenceEngine.next_present_dates(child_id, start_date, count):
walks forward from the INCLUSIVE start date through is_present, so
overrides and the pattern are honoured identically — this is the
preview the admin Schedule tab renders before a parent saves a
custody pattern. Count must be a positive int; the scan is capped at
two years (MAX_PREVIEW_SCAN_DAYS) and an always-absent child raises
a clear ValueError instead of looping forever. Tests: known two-week
pattern (straight five-day week, mid-week start skipping the absent
week), inclusive start, override blocking the preview start,
schedule-free child, input validation, always-absent error. Suite:
1002 passed.
overseer added 1 commit 2026-09-15 18:20:46 -04:00
The six-day preview expectation missed that Jan 10-11 are still in
the present week (the away week starts Jan 12). Suite green before
commit: 1003 passed.
Member

Independent review — Codex gpt-5.6-terra

Round 1 — CHANGES_REQUIRED (MEDIUM): flagged the _overrides snapshot as retaining mutable caller lists. Stale finding: the fix landed on the base branch in PR #61 (bff2f4f — validated lists copied to immutable tuples at construction; test_engine_override_lists_are_frozen builds the engine on the caller's list and asserts post-construction appends change nothing). Round 2 re-verified against the current file.
Round 2 — APPROVED (zero findings). Suite 1003 passed, reviewer-verified (independently re-checked floor-division offsets, boundary indices, and 2020 = ISO week 53).

## Independent review — Codex gpt-5.6-terra **Round 1 — CHANGES_REQUIRED (MEDIUM):** flagged the _overrides snapshot as retaining mutable caller lists. Stale finding: the fix landed on the base branch in PR #61 (bff2f4f — validated lists copied to immutable tuples at construction; test_engine_override_lists_are_frozen builds the engine on the caller's list and asserts post-construction appends change nothing). Round 2 re-verified against the current file. **Round 2 — APPROVED (zero findings).** Suite 1003 passed, reviewer-verified (independently re-checked floor-division offsets, boundary indices, and 2020 = ISO week 53).
dev_agent merged commit 6551a87bd6 into feature/167e3565-704d-41c7-adf6-3b88ed266f78-presence-custody-schedules 2026-09-15 18:23:36 -04:00
Sign in to join this conversation.
No Reviewers
No labels
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#62