Commit Graph
5 Commits
Author SHA1 Message Date
Joshua King df6285f3d7 test: fix self-scan UPDATE alternative and POSIX path joining
- 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
2026-09-14 07:22:47 -04:00
Joshua King 0fc3fbeed8 test: exact-path SQL-leak allowlist; blob-mode self-scan catches multiline SQL
- 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
2026-09-14 07:20:05 -04:00
Joshua King 98e342df17 fix: connection-scoped reorder serialization; recursive SQL-leak scan with span-exact self-exclusion
- 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
2026-09-14 07:16:47 -04:00
Joshua King f00ec03c78 fix: address review findings - atomic admin add, reorder validation and serialization, honest rollback test, stronger SQL-leak guard
- 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
2026-09-14 07:14:30 -04:00
Joshua King c5b4885cc0 feat: add typed DAO layer for children and admin_users (#18) 2026-09-14 07:11:22 -04:00