Commit Graph
22 Commits
Author SHA1 Message Date
Joshua King c3e7c0d3d6 fix: immutable=1 probe URI (no sidecar creation guaranteed), fs work inside executor job, WAL-header corruption test case
- probe URI adds immutable=1: SQLite's documented guarantee that the
  read-only connection performs no writes and creates no -wal/-shm
  sidecars, even against a WAL-header database
- exists/stat/resolve and URI construction moved inside the executor
  job with the probe (no event-loop disk I/O)
- new WAL-header corruption test asserts byte-identical file and no
  -shm creation from the probe
2026-09-14 08:45:48 -04:00
Joshua King 5b5aa7c789 fix: non-ok integrity verdicts are corruption, escaped file URIs, proven no-WAL-transition test
- a non-ok integrity_check verdict raises DatabaseError carrying the
  NOTADB marker so it classifies as corruption unconditionally; ANY
  DatabaseError escaping the probe propagates (no more swallowing
  structural problems as non-corruption)
- file URI built via Path.resolve().as_uri() so #/?/% in paths cannot
  mis-target the probe
- migration-stage test now spies on NestQuestDatabase.open and asserts
  the read-write open was NEVER reached: the whole-file preflight
  rejecting corruption before the WAL transition is the mechanism
  under test, and the byte-identical + no-sidecar assertions prove it
- store guard permits SELECT + PRAGMA integrity_check on the ro-conn
2026-09-14 08:43:08 -04:00
Joshua King 5db49b3d29 fix: whole-file read-only integrity preflight on the executor, rollback-journal fixture
- preflight now runs PRAGMA integrity_check (whole-file validation,
  not just sqlite_master) over a mode=ro connection, dispatched via
  hass.async_add_executor_job so the event loop never blocks
- migration-stage corruption test fixture is now a ROLLBACK-JOURNAL
  file created with plain sqlite3 (default journal mode), so the WAL
  transition the guardrail protects against actually happens in the
  test instead of being masked by an already-WAL fixture
2026-09-14 08:39:58 -04:00
Joshua King 0281b51676 fix: read-only corruption preflight, early-return safety path, errorcode classification, sidecar snapshot test
- _preflight_existing_file probes an EXISTING file with a mode=ro URI
  connection before the read-write open, so a corrupt file is detected
  BEFORE WAL mode persists or sidecars appear; the preflight is inside
  the same ConfigEntryNotReady classification as open()/migrations
- corruption classification now prefers sqlite_errorcode (SQLITE_CORRUPT/
  SQLITE_NOTADB primary-byte match, locale-independent, Python 3.11+)
  with message fallback including 'database disk image is malformed'
- the early-return path (existing runtime record) routes through
  _async_open_database and reopens when db is None OR not connected
- new migration-stage corruption test: valid header + damaged page
  4096+, asserts main file byte-identical AND no -wal/-shm sidecars
  left behind; vacuous test replaced with pytest.raises form
2026-09-14 08:37:07 -04:00
Joshua King c5cebc9f49 feat: handle missing, valid, and corrupt databases on startup (#22) 2026-09-14 08:32:39 -04:00
orchestrator-agent 12bb4d58b4 DAO layer for task_instances and append-only completion_events (#21) 2026-09-14 08:28:00 -04:00
orchestrator-agent 29c058a045 DAO layer for presence schedules and overrides (#20) 2026-09-14 08:08:39 -04:00
orchestrator-agent c27ed24020 DAO layer for schedule_rules and task_definitions (#19) 2026-09-14 07:48:01 -04:00
orchestrator-agent 43b20f2b12 DAO layer for children and admin_users (#18) 2026-09-14 07:26:34 -04:00
orchestrator-agent 2c8c90a24e Implement the versioned migration runner (#17) 2026-09-14 07:10:23 -04:00
orchestrator-agent e98642e236 Schema v1: task_instances and completion_events tables (#16) 2026-09-14 06:53:14 -04:00
dev_agent 01905ec9ee feat: add schema v1 ddl for presence schedules and overrides (#15) 2026-09-13 21:59:59 -04:00
dev_agent 30748f786a feat: add schema v1 ddl for schedule_rules and task_definitions (#14) 2026-09-13 21:50:18 -04:00
dev_agent 3dae2eadd7 feat: add schema v1 ddl for children and admin_users (#13) 2026-09-13 21:39:18 -04:00
dev_agent eaf2e45e9a feat: add async sqlite connection wrapper with executor-backed queries (#12) 2026-09-13 21:35:36 -04:00
dev_agent b854013f1a test: wire pytest test harness with standard hass fixture (#9) 2026-09-13 19:18:10 -04:00
dev_agent c75de71f37 feat: add executor-backed SQLite path resolver helper (#8) 2026-09-13 18:26:23 -04:00
dev_agent e5cda26e11 feat: implement options flow for post-setup settings (#7) 2026-09-13 18:26:09 -04:00
dev_agent 3b9ffa383f feat: implement setup/unload lifecycle with options-reload listener (#5) 2026-09-13 15:02:42 -04:00
dev_agent f787d04a6b feat: implement UI config flow with single-instance enforcement (#4) 2026-09-13 14:52:06 -04:00
dev_agent 8d04c95314 feat: define shared constants in const.py (#2) 2026-09-11 16:39:41 -04:00
dev_agent 5c354c1ff5 feat: create custom_components/nestquest package structure and manifest.json (#1) 2026-09-10 16:50:59 -04:00