Description Goal
Get back to ~100% test coverage (practical: keep ignores minimal + justified)
Remove as many mocks as possible; prefer integration-style tests like test-int/ (real DB + real filesystem/tmp projects + real in-process API client)
Concrete issues found (quick wins)
Mutable default args in MCP tools (e.g. types: List[str] = [], entity_types: List[str] = []) → shared state across calls.
Pydantic defaults in WatchServiceState: start_time=datetime.now() and recent_events=[] are evaluated/shared at import time.
WatchService list mutation during iteration : iterating adds while removing from it can skip items / behave nondeterministically.
Architecture/quality follow-ups
Ensure cloud-mode startup runs required DB init/migrations reliably (even if project reconciliation is skipped).
Consider telemetry credential optics (client secret in repo), even if “write-only”.
Testing plan
Baseline coverage on SQLhen Postgres if needed).
Inventory mock-heavy tests in tests/ (mocker/patch/unittest.mock).
Replace with integration tests under test-int/ or real ASGI client + temp project dirs.
Add missing tests for the quick-win bugs above.
Acceptance criteria
Coverage returns to ~100% (with minimal, well-justified excludes).
Reduced mocking surface; key user flows covered by integration tests.
Fixes shipped for the 3 correctness footguns above.
Reactions are currently unavailable
You can’t perform that action at this time.
Goal
test-int/(real DB + real filesystem/tmp projects + real in-process API client)Concrete issues found (quick wins)
types: List[str] = [],entity_types: List[str] = []) → shared state across calls.WatchServiceState:start_time=datetime.now()andrecent_events=[]are evaluated/shared at import time.addswhile removing from it can skip items / behave nondeterministically.Architecture/quality follow-ups
Testing plan
tests/(mocker/patch/unittest.mock).test-int/or real ASGI client + temp project dirs.Acceptance criteria