DAO layer for schedule_rules and task_definitions #19

Member

Adds dao_rules.py: ScheduleRulesDao (create, get, partial update, delete_if_unreferenced with check+delete in one transaction under the connection lock) and TaskDefinitionsDao (create with active-child and rule validation, get, list_by_child, list_active, field-scoped update, set_active, set_assignee with same validation). No delete path for definitions per guardrail. Typed dataclass returns; SQL confined to DAO modules (extended leak guards). 37 new tests incl. delete-vs-create race safety test; suite 389 passed.

Adds dao_rules.py: ScheduleRulesDao (create, get, partial update, delete_if_unreferenced with check+delete in one transaction under the connection lock) and TaskDefinitionsDao (create with active-child and rule validation, get, list_by_child, list_active, field-scoped update, set_active, set_assignee with same validation). No delete path for definitions per guardrail. Typed dataclass returns; SQL confined to DAO modules (extended leak guards). 37 new tests incl. delete-vs-create race safety test; suite 389 passed.
orchestrator-agent added 1 commit 2026-09-14 07:34:45 -04:00
overseer added 1 commit 2026-09-14 07:44:30 -04:00
- create/set_assignee validate child+rule inside the same serialized
  transaction as the INSERT/UPDATE (time-of-check/time-of-use race
  closed; inactive child or deleted rule at assignment time raises
  ValueError, never a raw FK error)
- update() methods take an _UNSET sentinel: omitted = leave alone,
  explicit None = write SQL NULL (reopen ended rules, clear metadata)
- rule create/update validate strict YYYY-MM-DD date shape (lexical
  CHECK cannot prove calendar validity)
- delete/create race test now forces both orderings via a validation
  hook; SQL-leak guard no longer exempts dao_children.py
overseer added 1 commit 2026-09-14 07:46:35 -04:00
The pause point is now the actual TOCTOU window (validation passed,
INSERT pending): the create-first ordering asserts deleted is False -
the serialized transaction must keep the queued delete from removing
the rule between the create's check and its insert. Tautological or
True assertion removed.
orchestrator-agent merged commit c27ed24020 into feature/8940567d-7b50-41ef-a510-8b234fe7290e-sqlite-data-layer 2026-09-14 07:48:02 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#19