Task d0b691d8 (Feature 15 — Domain Core Extraction): move schema.py, migrations.py, db.py, store.py, and the dao_* modules into a new Home-Assistant-free core/ package, leaving re-export shims in custom_components/nestquest/ plus make_database(hass)/async_get_db_path(hass) adapters.
core/db.py: NestQuestDatabase now takes an executor callable instead of hass; core/store.py takes a path. Nothing in core/ imports homeassistant.
Tests: 54 NestQuestDatabase(...) call sites pass hass.async_add_executor_job; the 5 cancellation/gating tests in test_db.py use a dynamic executor_for(hass) wrapper so reassigning hass.async_add_executor_job after construction is still observed (fixes the hang at test_cancel_during_open_closes_abandoned_connection).
Source-scan tests retarget core.db; the sqlite3 scan exempts core/db.py; store mkdir now asserts asyncio.to_thread.
grep -r "import homeassistant" core/ is empty; python -c "import core" works; uv run pytest -q is fully green (1496 passed, matching the pre-extraction baseline).
Task d0b691d8 (Feature 15 — Domain Core Extraction): move schema.py, migrations.py, db.py, store.py, and the dao_* modules into a new Home-Assistant-free `core/` package, leaving re-export shims in `custom_components/nestquest/` plus `make_database(hass)`/`async_get_db_path(hass)` adapters.
- `core/db.py`: `NestQuestDatabase` now takes an executor callable instead of `hass`; `core/store.py` takes a path. Nothing in `core/` imports `homeassistant`.
- Tests: 54 `NestQuestDatabase(...)` call sites pass `hass.async_add_executor_job`; the 5 cancellation/gating tests in `test_db.py` use a dynamic `executor_for(hass)` wrapper so reassigning `hass.async_add_executor_job` after construction is still observed (fixes the hang at `test_cancel_during_open_closes_abandoned_connection`).
- Source-scan tests retarget `core.db`; the sqlite3 scan exempts `core/db.py`; `store` mkdir now asserts `asyncio.to_thread`.
- `grep -r "import homeassistant" core/` is empty; `python -c "import core"` works; `uv run pytest -q` is fully green (1496 passed, matching the pre-extraction baseline).
HACS and the manual install copy only custom_components/nestquest, so
the integration shipped with a top-level 'core' package that was never
deployed and failed with ModuleNotFoundError: No module named 'core'.
Move core/ into custom_components/nestquest/core/, repoint the
re-export shims to relative '.core.X' imports, and update tests
(import paths, monkeypatch targets, caplog logger) to the new
'custom_components.nestquest.core.X' location. The integration is now
self-contained: nothing under custom_components/nestquest reaches
outside its own tree, the migrations logger becomes
custom_components.nestquest.core.migrations, and the SQL-leak guard
allowlists point at the new core/ paths.
uv run pytest -q: 1496 passed.
- Point recurrence purity scan at custom_components.nestquest.core.recurrence
(P2.1); the shim only re-exports, so the real model was no longer scanned.
- Make test_const/test_config_flow/test_dao_matrix module scans recursive
(rglob) so custom_components/nestquest/core/ is covered (P2.2, P2.3);
const.py name exclusion retained.
- Add test_core_isolation: AST-scan every core module for homeassistant
imports, relative imports climbing out of core (level > 1), absolute
imports reaching custom_components.nestquest.<not core>, and bare
'import core'/'from core' (P2.4).
- Drop the private re-export of _month_end/_nth_weekday_of_month from the
recurrence shim; those are test-only, so move the two test imports to
custom_components.nestquest.core.recurrence (P2.1/P3.1).
- Fix shim docstrings and core/__init__.py to reference
custom_components.nestquest.core.* instead of the unimportable 'core.*'
paths (P3.2).
- Note the migrations logger namespace move to
custom_components.nestquest.core.migrations in RELEASE_NOTES.md (P3.3).
dev_agent
merged commit 1503774e85 into feature/a9513378-856c-4ced-8722-c99850d3a524-domain-core-extraction2026-09-21 14:48:01 -04:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Task d0b691d8 (Feature 15 — Domain Core Extraction): move schema.py, migrations.py, db.py, store.py, and the dao_* modules into a new Home-Assistant-free
core/package, leaving re-export shims incustom_components/nestquest/plusmake_database(hass)/async_get_db_path(hass)adapters.core/db.py:NestQuestDatabasenow takes an executor callable instead ofhass;core/store.pytakes a path. Nothing incore/importshomeassistant.NestQuestDatabase(...)call sites passhass.async_add_executor_job; the 5 cancellation/gating tests intest_db.pyuse a dynamicexecutor_for(hass)wrapper so reassigninghass.async_add_executor_jobafter construction is still observed (fixes the hang attest_cancel_during_open_closes_abandoned_connection).core.db; the sqlite3 scan exemptscore/db.py;storemkdir now assertsasyncio.to_thread.grep -r "import homeassistant" core/is empty;python -c "import core"works;uv run pytest -qis fully green (1496 passed, matching the pre-extraction baseline).