Commit Graph
16 Commits
Author SHA1 Message Date
Joshua King f27c84488d fix: serialize concurrent migration runners with a per-connection lock
NestQuestDatabase rejects a second transaction while one is active, so
two concurrent apply_migrations callers on one connection crashed with
RuntimeError instead of queueing. apply_migrations now holds a
per-(connection, loop) asyncio lock across the whole decide-and-apply
span; the queued runner re-reads the stamped version and applies
nothing. Deterministic concurrent-runner regression test added.
2026-09-14 07:07:46 -04:00
Joshua King c0c540c194 fix: re-read schema version inside each migration transaction; spy on close in setup-failure test
- apply_migrations re-reads the version under the transaction lock
  before applying, so two interleaved runners on one connection cannot
  both apply a non-idempotent migration from a stale read
- setup-failure test now spies on NestQuestDatabase.close and asserts
  it ran and no runtime record was stored (was vacuous)
2026-09-14 07:05:13 -04:00
Joshua King 492c1149f0 fix: address review findings - startup wiring, singleton version table, version guards
- __init__.py now calls apply_migrations() on setup instead of raw DDL
  (HIGH finding: the runner was never invoked at startup); lifecycle
  wiring tests in test_migrations.py cover fresh migrate, reload reuse,
  and close-on-failure
- VERSION_TABLE DDL enforces singleton row (id=1 PRIMARY KEY + CHECK)
  and version >= 1; stamp is INSERT .. ON CONFLICT DO UPDATE keyed on
  the singleton row
- read_schema_version rejects non-integer and sub-1 versions with
  explicit guards (bool excluded)
- no-op test asserts content hash + mtime, not just size
2026-09-14 06:59:30 -04:00
Joshua King c6d42e8277 feat: add versioned schema migration runner (#17) 2026-09-14 06:54:45 -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