Skip to content

fix(index/coordinator): address code review findings on index integrity and logging - #17

Closed
Pascal-ZeGerman wants to merge 6 commits into
release/v3.1.0-rc14from
fix/code-review-index-coordinator-260706
Closed

Pascal-ZeGerman wants to merge 6 commits into
release/v3.1.0-rc14from
fix/code-review-index-coordinator-260706

Conversation

@Pascal-ZeGerman

Copy link
Copy Markdown
Owner

Summary

  • _async_ensure_index now also checks _index_has_graph_file() so a missing or decayed graph file with intact segments files triggers a re-download instead of silently disabling Level-4 street-graph routing.
  • Arm the GPS stale watchdog in async_start() so the "GPS Signal Lost" notification can fire even if GPS never reports after a restart.
  • 311 suspension poll failure logs now reflect whether the fallback actually fails open or fails closed (retains an active suspension), instead of always claiming "failing open".
  • _sync_verify_index no longer scans the entire rtree dataset on every setup/reload; it now touches only the first result to prove the file is readable.
  • Import dt_util at module level in binary_sensor.py instead of locally inside is_on(), consistent with coordinator.py/sensor.py.

Found via a workflow-backed code review of the open PR (5 findings, all confirmed).

Test plan

  • .venv/bin/pytest targeted subset (index/gps_stale/watchdog/suspension_poll/binary_sensor) — 39 passed
  • Full suite — 909 passed, 6 pre-existing failures in test_sign_retrieval.py unrelated to this change (blocked sockets, present before this branch)

…ty and logging

- _async_ensure_index now also checks _index_has_graph_file() so a missing
  or decayed graph file with intact segments files triggers a re-download
  instead of silently disabling Level-4 routing.
- Arm the GPS stale watchdog in async_start() so the "GPS Signal Lost"
  notification can fire even if GPS never reports after a restart.
- 311 suspension poll failure logs now reflect whether the fallback
  actually fails open or fails closed (retains an active suspension).
- _sync_verify_index no longer scans the entire rtree dataset on every
  setup/reload; it now touches only the first result to prove the file
  is readable.
- Import dt_util at module level in binary_sensor.py instead of locally
  inside is_on(), consistent with coordinator.py/sensor.py.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Pascal-ZeGerman

Copy link
Copy Markdown
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

Pascal-ZeGerman and others added 5 commits July 7, 2026 14:44
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- codeql, hacs, hassfest: revert to ubuntu-latest (Docker/ARM64 not supported)
- vendor-guard: downgrade Python 3.14 → 3.13 (3.14 has no ARM64 build for Debian 13)
- pytest, release, vendor-guard: remain on self-hosted (ARM64 compatible)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
actions/setup-python has no prebuilt binaries for ARM64 + Debian 13.
pytest.yml: drop setup-python, create venv from system python3.
vendor-guard.yml: revert to ubuntu-latest (simpler than venv approach).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each job creates a fresh venv but now restores ~/.cache/pip so wheels
are not re-compiled from source on every run. Cache key is keyed on
pyproject.toml hash; falls back to any prior pip cache on miss.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clear the pipeline-error health flag on the two remaining clean-resolution
failure paths (outside coverage, no matching segment), surface a failed
pipeline run as sensor unavailability instead of serving stale retained
data as current, and make update_checker fail open (and use the correct
build_info.json path) instead of silently reporting "up to date" on
fetch errors or a missing rowsUpdatedAt field.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant