Implement is_present with always-present default (Feature 05, task 3) #59

Member

Task 3 of Feature 05.

Delivered

  • PresenceEngine: an immutable, database-free snapshot answering is_present(child_id, date). No schedule -> present every day; scheduled children follow the anchor pattern via cycle_week_index (D-004, never ISO parity). Snapshot shape validated and exposed read-only.
  • Tests: three-child fixture (two complementary rotation children + one always-present) verified for every day of a four-week span with swap-day spot checks; weekday-set behaviour across weeks; rejection matrix; engine immutability.

Verification

uv run pytest: 985 passed.

Closes task 5059d16c (Feature 05).

Task 3 of Feature 05. ## Delivered - **PresenceEngine**: an immutable, database-free snapshot answering is_present(child_id, date). No schedule -> present every day; scheduled children follow the anchor pattern via cycle_week_index (D-004, never ISO parity). Snapshot shape validated and exposed read-only. - **Tests**: three-child fixture (two complementary rotation children + one always-present) verified for every day of a four-week span with swap-day spot checks; weekday-set behaviour across weeks; rejection matrix; engine immutability. ## Verification uv run pytest: 985 passed. Closes task 5059d16c (Feature 05).
dev_agent added 1 commit 2026-09-15 17:57:04 -04:00
PresenceEngine is an immutable, database-free snapshot of the
children's schedules answering is_present(child_id, date): a child
with NO schedule entry is present every day (the household's
always-present sibling); a scheduled child is present exactly when
the date's weekday is in the pattern for that date's cycle week
(anchor-date arithmetic via cycle_week_index — never ISO parity).
Construction validates the snapshot shape (dict keyed by the
schedule's own child_id, values are PresenceSchedules) and exposes it
read-only (MappingProxyType + __setattr__ refusal). is_present
rejects non-int child ids and non-plain dates.

Tests: the three-child fixture (two complementary rotation children,
one schedule-free) asserted for every day of a four-week span plus
spot-checked swap days; weekend/weekday-set behaviour across weeks;
construction/input rejection matrix; engine immutability. Suite:
985 passed.
overseer added 1 commit 2026-09-15 17:58:53 -04:00
Review round 1 (Codex gpt-5.6-terra, 2 LOW): engine snapshot keys now
pass _validate_child_id (True/1.0 compare equal to 1 and would be
accepted then behave differently on lookup); the always-present test
now walks all 28 days asserting all three children's expected verdicts
instead of sampling every third day. Suite: 985 passed.
Member

Independent review — Codex gpt-5.6-terra

Round 1 — CHANGES_REQUIRED (2 LOW): engine snapshot keys not validated as model child ids (True/1.0 compare equal to 1); the always-present test sampled every third day instead of the stated four-week every-day walk. Fixed in 6d48f43: _validate_child_id on keys; all 28 days asserted for all three children.
Round 2 — APPROVED (zero findings). Suite 985 passed, reviewer-verified (also independently re-checked the negative-offset and boundary arithmetic).

## Independent review — Codex gpt-5.6-terra **Round 1 — CHANGES_REQUIRED (2 LOW):** engine snapshot keys not validated as model child ids (True/1.0 compare equal to 1); the always-present test sampled every third day instead of the stated four-week every-day walk. *Fixed in 6d48f43:* _validate_child_id on keys; all 28 days asserted for all three children. **Round 2 — APPROVED (zero findings).** Suite 985 passed, reviewer-verified (also independently re-checked the negative-offset and boundary arithmetic).
dev_agent merged commit e15648232f into feature/167e3565-704d-41c7-adf6-3b88ed266f78-presence-custody-schedules 2026-09-15 18:00:06 -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#59