Commit Graph

16 Commits

Author SHA1 Message Date
Matt Edholm 8d05c67a48 feat(3-2): add recovery tests and story file for automatic recovery on fresh decode
Two-cycle stale→recovery tests confirm that a non-empty fetch after timeout or
empty-list correctly resets is_stale=False; no changes to main.py or aircraft.py
required as recovery logic was already correct from story 3-1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:53:14 -04:00
Matt Edholm 833a7f0917 feat(3-1): stale state detection and dimmed display
When fetch times out or returns empty after prior data, retain last aircraft
with is_stale=True and render them as black outlines so the display stays
informative rather than blank or crashing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:47:04 -04:00
Matt Edholm 9f6d442df8 feat(2-7): operational radar loop, startup screen, and systemd wiring
Implements story 2-7: full main.py with _make_startup_screen(),
_run_one_cycle() with per-phase timing and slow-render warning, and
main() connecting config → bounds → fetcher → renderer → display.
Adds provision.py early-exit when already provisioned. Adds User=root
to both systemd service files. Adds tests/test_main.py (3 new tests,
99 total). Updates scaffold test to allow provisioning.config import
from main.py. All quality gates pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:40:37 -04:00
Matt Edholm 25076dc1f3 feat(2-6): stateful Renderer, DisplayInterface, and pipeline smoke test
Implements story 2-6: Renderer class with per-aircraft trail history
(deque capped at TRAIL_MAX_DOTS=5), NullDisplay with DEBUG logging,
WaveshareDisplay stub, and end-to-end pipeline smoke test. All 96
tests pass; ruff check and format clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:33:36 -04:00
Matt Edholm f530185e31 feat(renderer): implement per-aircraft drawing — story 2-5
Implements draw_aircraft() with heading arrow (filled/outlined for MLAT),
callsign+altitude label, and a 5-dot fade trail. Adds 5 tests covering
all ACs; all 94 tests pass, ruff lint and format clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:27:36 -04:00
Matt Edholm 2c86ffd422 feat(2-4): implement altitude colour bands and aircraft type icons
Implements altitude_to_colour() mapping altitude bands to the 6 e-ink
palette colours, and classify_aircraft_type() resolving ADS-B category,
callsign prefix, and altitude fallback to AircraftType enum. Adds 21
new tests (13 parametrised boundary cases + 8 icon classification);
89 tests total, all quality gates green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:21:50 -04:00
Matt Edholm e8ce0602a4 feat(story-2.3): implement home marker and airspace outline rendering
Adds draw_home_marker() in overlay.py (red cross at projected home
position) and draw_airspace() in airspace.py (GeoJSON Polygon
boundaries in blue, graceful FileNotFoundError handling). Includes
airspace fixture and three tests covering all acceptance criteria.
All 70 tests pass; ruff check and format clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:16:03 -04:00
Matt Edholm 037ce3e193 Implement story 2.2: coordinate projection and base map loading
Add MapBounds dataclass and equirectangular project() function in
projection.py, basemap.load() forcing pixels into memory via .copy(),
and full test coverage for both modules (4 new tests). All quality
gates pass: 67 tests, ruff clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:10:38 -04:00
Matt Edholm 6208134a1c Implement story 2.1: aircraft data model and fetcher
Add HttpFetcher and FileFixtureFetcher with shared _parse_aircraft helper,
DUMP1090_URL constant, realistic fixture data, and full test coverage for
all acceptance criteria (AC1–AC5).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:03:20 -04:00
Matt Edholm 4aeeefb488 Implement story 1.5: provisioning execution tile download cache validation wifi kill
Add tiles.py, airspace.py, wifi.join_home_wifi, portal /submit route, and rewire
provision.py main loop; all tasks and quality gates pass (56 tests, ruff clean).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:54:34 -04:00
Matt Edholm 6231e3157e Implement story 1.4: location resolution ICAO and address
Adds location.resolve() with ICAO CSV lookup and Nominatim geocoding,
POST /find-location portal route with inline confirmation/error display,
and full test coverage with mocked network calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:46:31 -04:00
Matt Edholm 563b0d4665 Implement story 1.3: WiFi hotspot and captive portal form
Implement wifi.py (start_ap/stop_ap/kill_wifi with subprocess and ProvisioningError),
portal.py (Flask captive portal with Android/iOS/Windows probe redirects and 404 catch-all),
updated provision.py provisioning loop, and full test suite (38 passing).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:41:05 -04:00
Matt Edholm 826f1d98fa Implement story 1.2: config read/write/wipe
Add provisioning/config.py with read/write/wipe functions, update
conftest.py with autouse CONFIG_PATH patch fixture, write 7 tests
covering all acceptance criteria, and extend pyproject.toml
per-file-ignores so conftest.py may import from provisioning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:35:11 -04:00
Matt Edholm 1ff68512f9 QA: add structural and model tests for story 1.1 scaffold
Replaces placeholder stubs in test_models.py, test_gpio_ctrl.py, and
provisioning/test_provision_loop.py with real assertions. Adds new
test_scaffold.py covering AC3 file-presence, importlib.resources
airports.csv load, constants completeness, and main.py provisioning
import guard. Extends ruff per-file-ignores so tests/provisioning/*.py
may import from planemapper.provisioning. All 22 tests pass; ruff
check and format --check both clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:31:55 -04:00
Matt Edholm 3afb7f5f1e Add .gitignore to exclude __pycache__ and egg-info artifacts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:27:02 -04:00
Matt Edholm 85c8acf767 Implement story 1.1: project scaffold and verified entry points
Creates the complete src/planemapper/ layout with all module stubs,
provisioning and renderer subpackages, airports.csv data bundle,
systemd unit files, and full test scaffold. All three quality gates
pass: pytest 12/12, ruff check zero violations, ruff format clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:26:53 -04:00