PresenceEngine(schedules, overrides): is_present consults covering overrides BEFORE the pattern and returns the override's flag — absent-on-present-day → False, present-on-absent-day → True, override on a schedule-free child still applies. Snapshot shape validated (dict of lists, keys matching each override's own child id) and read-only. Overlaps are impossible through the DAO; a hand-built snapshot with overlapping overrides resolves deterministically to the latest start date.
Tests: all three precedence cases, span boundary days, rejection matrix, tie-break determinism.
Verification
uv run pytest: 995 passed.
Closes task 6a1e14aa (Feature 05).
Task 5 of Feature 05.
## Delivered
- **PresenceEngine(schedules, overrides)**: is_present consults covering overrides BEFORE the pattern and returns the override's flag — absent-on-present-day → False, present-on-absent-day → True, override on a schedule-free child still applies. Snapshot shape validated (dict of lists, keys matching each override's own child id) and read-only. Overlaps are impossible through the DAO; a hand-built snapshot with overlapping overrides resolves deterministically to the latest start date.
- Tests: all three precedence cases, span boundary days, rejection matrix, tie-break determinism.
## Verification
uv run pytest: 995 passed.
Closes task 6a1e14aa (Feature 05).
PresenceEngine gains an overrides snapshot (child_id -> list of
PresenceOverride): is_present checks covering overrides BEFORE the
pattern and returns the override's flag as the answer — an absent
override on a normally-present day returns False, a present one on a
normally-absent day returns True, and an override on a child with no
schedule still applies (holidays work for the always-present sibling).
Snapshot validation mirrors the schedules': dict of lists keyed by the
override's own child id, exposed read-only. The DAO layer guarantees
no overlapping overrides per child; a hand-built snapshot that carries
them resolves deterministically to the LATEST start date (documented).
Tests: all three precedence cases, span edges (outside days stay on
the pattern), snapshot rejection matrix, deterministic overlap
tie-break. Suite: 995 passed.
Review round 1 (Codex gpt-5.6-terra, MEDIUM): the overrides mapping
was shallow-copied, leaving caller-owned lists mutable through
_overrides — a later append would change is_present results. Each
validated list is copied into an immutable tuple before wrapping;
tests prove post-construction appends change nothing and the snapshot
refuses mutation. Suite: 996 passed.
Review round 3 (Codex gpt-5.6-terra, LOW): the helper copied the list,
so the mutation could never have affected even a shallow snapshot.
The engine is now constructed directly on the caller's list, making
the freeze regression-proof. Suite green before commit: 997 passed.
R1 — CHANGES_REQUIRED (MEDIUM): the overrides snapshot shallow-copied the mapping, leaving caller-owned lists mutable through _overrides. Fixed in bff2f4f: validated lists copied to immutable tuples. R2 — CHANGES_REQUIRED (HIGH): the freeze test expected TypeError from tuple.append (tuples have no append — AttributeError). Fixed in 830d663. R3 — CHANGES_REQUIRED (LOW): the freeze test used a helper that copies the list, so its mutation could never affect even a shallow snapshot. Fixed in bdf3513: the engine is built directly on the caller's list. R4 — APPROVED (zero findings). Suite 997 passed, reviewer-verified.
## Independent review — Codex gpt-5.6-terra
**R1 — CHANGES_REQUIRED (MEDIUM):** the overrides snapshot shallow-copied the mapping, leaving caller-owned lists mutable through _overrides. *Fixed in bff2f4f:* validated lists copied to immutable tuples.
**R2 — CHANGES_REQUIRED (HIGH):** the freeze test expected TypeError from tuple.append (tuples have no append — AttributeError). *Fixed in 830d663.*
**R3 — CHANGES_REQUIRED (LOW):** the freeze test used a helper that copies the list, so its mutation could never affect even a shallow snapshot. *Fixed in bdf3513:* the engine is built directly on the caller's list.
**R4 — APPROVED (zero findings).** Suite 997 passed, reviewer-verified.
dev_agent
merged commit 221ab2c20b into feature/167e3565-704d-41c7-adf6-3b88ed266f78-presence-custody-schedules2026-09-15 18:17:41 -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 5 of Feature 05.
Delivered
Verification
uv run pytest: 995 passed.
Closes task 6a1e14aa (Feature 05).
Independent review — Codex gpt-5.6-terra
R1 — CHANGES_REQUIRED (MEDIUM): the overrides snapshot shallow-copied the mapping, leaving caller-owned lists mutable through _overrides. Fixed in
bff2f4f: validated lists copied to immutable tuples.R2 — CHANGES_REQUIRED (HIGH): the freeze test expected TypeError from tuple.append (tuples have no append — AttributeError). Fixed in
830d663.R3 — CHANGES_REQUIRED (LOW): the freeze test used a helper that copies the list, so its mutation could never affect even a shallow snapshot. Fixed in
bdf3513: the engine is built directly on the caller's list.R4 — APPROVED (zero findings). Suite 997 passed, reviewer-verified.