DAO layer for children and admin_users #18

Member

Adds dao_children.py: ChildrenDao (create, get, list_active, list_all, partial update, set_active, transactional reorder via staged negative offsets) and AdminUsersDao (idempotent add, remove, list, exists). All methods async, typed dataclass returns (ChildRecord, AdminUserRecord), all SQL confined to the module (guard test scans the package). No delete path for children per guardrail (deactivate only). 24 new tests; suite 348 passed.

Adds dao_children.py: ChildrenDao (create, get, list_active, list_all, partial update, set_active, transactional reorder via staged negative offsets) and AdminUsersDao (idempotent add, remove, list, exists). All methods async, typed dataclass returns (ChildRecord, AdminUserRecord), all SQL confined to the module (guard test scans the package). No delete path for children per guardrail (deactivate only). 24 new tests; suite 348 passed.
orchestrator-agent added 1 commit 2026-09-14 07:11:25 -04:00
overseer added 1 commit 2026-09-14 07:14:33 -04:00
- AdminUsersDao.add: single INSERT ON CONFLICT DO NOTHING (rowcount-derived
  result), race-safe; concurrent-add test with 5 racing coroutines
- ChildrenDao.reorder: rejects duplicate ids (ValueError); per-instance
  asyncio lock serializes concurrent reorders (the wrapper rejects
  concurrent transactions); rollback test now forces a real finalize-batch
  failure and asserts original order survives
- SQL-leak guard: scans package + tests with FROM/INTO/UPDATE/DELETE FROM/
  JOIN pattern; narrowly justified exclusions (schema DDL, migrations,
  their tests); this test file verified to contain no direct table SQL
overseer added 1 commit 2026-09-14 07:16:50 -04:00
- reorder lock is now per-(connection, loop) via module-level registry
  shared by all ChildrenDao instances over one wrapper, matching the
  migration runner's approach; race test now uses two DAO instances on
  one connection
- SQL-leak guard scans recursively (rglob); self-scan excludes only the
  two guard functions' exact source spans via ast line numbers, so code
  anywhere else in the file is still scanned
overseer added 1 commit 2026-09-14 07:20:08 -04:00
- leak guard allowlists repo-relative paths (not basenames) so a raw
  query in tests/nested/<name>.py cannot slip through
- self-scan removes only the guard functions' spans, then scans the
  remaining source as one blob with a pattern including standalone
  FROM/JOIN, so SQL split across physical lines is caught
overseer added 1 commit 2026-09-14 07:22:49 -04:00
- UPDATE pattern alternative corrected (UPDATE ... children, not
  UPDATE SET)
- allowlist comparison uses as_posix() so Windows separators cannot
  make the DAO itself appear as an offender
overseer added 1 commit 2026-09-14 07:24:58 -04:00
orchestrator-agent merged commit 43b20f2b12 into feature/8940567d-7b50-41ef-a510-8b234fe7290e-sqlite-data-layer 2026-09-14 07:26:34 -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#18