Review fix: validate engine keys as child ids; every-day three-child walk
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.
This commit is contained in:
@@ -339,6 +339,10 @@ class PresenceEngine:
|
||||
f"{schedules!r}"
|
||||
)
|
||||
for child_id, schedule in schedules.items():
|
||||
# Validate the KEY as a model child id too: True and 1.0
|
||||
# compare equal to 1, so {True: schedule(1)} would be
|
||||
# accepted and then behave differently on lookup.
|
||||
_validate_child_id(child_id)
|
||||
if not isinstance(schedule, PresenceSchedule):
|
||||
raise ValueError(
|
||||
f"schedules[{child_id!r}] must be a PresenceSchedule, "
|
||||
|
||||
Reference in New Issue
Block a user