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).
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).
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.
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.
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-schedules2026-09-15 18:23:36 -04:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Task 6 of Feature 05.
Delivered
Verification
uv run pytest: 1002 passed.
Closes task 7f0190c4 (Feature 05).
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).