feat: Phase 3 — Dawarich location-history validation (advisory)#8
Merged
Conversation
Cross-checks each candidate against Dawarich point history as an independent second signal (the same thing a flight-tracker app gets from GPS, self-hosted): points near the destination -> confirmed; tracking active but clearly elsewhere -> contradicted (likely cancellation/rebooking); no coords or no points -> unknown. Absence of data is never a false alarm. Advisory only: sets candidate["location"] and, on a contradiction, adds a review issue (which also trips _blocked_reason, keeping it out of --auto-write). It never changes confidence and never writes or deletes. - airdata.py: approximate airport coordinates + airport_latlon() (IATA/ICAO). - dawarich.py: config, tolerant /api/v1/points fetch, haversine, classifier. - populate.py: opt-in validate step (env DAWARICH_VALIDATE or --validate); digest shows a 📍 location marker. - Dockerfile copies dawarich.py; .env.example + README document the opt-in. - 16 tests: geo, confirm/contradict/unknown logic, response-shape tolerance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…date # Conflicts: # .env.example # Dockerfile # README.md # populate.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses your Dawarich point history as an independent second signal on each parsed candidate — the same thing a flight-tracker app gets from GPS, but self-hosted.
Logic (safe by design)
It only annotates (
candidate["location"]) and, on a contradiction, adds a review issue — which also trips_blocked_reason, so a contradicted flight can't slip into--auto-write. It never changes confidence and never writes or deletes anything.Changes
airdata.py— approximate airport coordinates (~130 airports) +airport_latlon()(accepts IATA or ICAO). Metro-area precision is enough for a 100 km test; gaps degrade to "unknown".dawarich.py— config, tolerant/api/v1/pointsfetch (bare list / wrapped / GeoJSON), haversine, classifier.populate.py— opt-in validate step (DAWARICH_VALIDATE=1or--validate); digest shows a 📍 marker.Dockerfile,.env.example, README.tests/test_dawarich.py— 16 tests. Suite on this branch: 45 green.Needs from you to actually run: Dawarich base URL + API key (→
.env).🤖 Generated with Claude Code