# TailWatch 20 — Radar & aircraft intelligence

Deploy the ENTIRE unzipped folder to your existing Cloudflare Pages project. Keep your existing project name and server secrets. `_worker.js` supplies the APIs; opening index.html directly or hosting only static assets cannot run the live services.

Example (replace the directory and project name with yours):

    npx wrangler pages deploy "/path/to/unzipped/TailWatch" --project-name YOUR_EXISTING_PROJECT

## New main screen
- Flight number + departure date visible immediately, with support for airline IATA / ICAO identifiers. Bare numbers default to Delta.
- Live aircraft within 150 nautical miles of the map center, refreshed every 30 seconds while visible. Move the map and click Refresh area.
- Street and satellite maps, US NOAA weather radar, undated reference route, and session-only observed trails.
- Filter traffic by tail, callsign, aircraft type; airborne-only toggle; click aircraft to open profile.
- Dated flight leg selection when a schedule provider is connected. A free route reference is explicitly undated and can differ from your travel-day leg.
- Registration-matched photos with photographer credit; manufacturer, type, owner, serial where available, approximate build-year age only when reported; live telemetry; locally saved observation history.
- Watchlist, shareable URL, auto refresh, candidate changes and evidence export.
- Existing tools and data preserved at v19-dashboard.html. Previous standalone legacy.html is also retained. V20 does not use the old hardcoded trip candidates or screenshot weights.

## What works without a paid key
ADSB.lol live area traffic and current callsign checks; ADSBdb route and aircraft metadata; Planespotters photo lookup; available tracking metadata; map layers and saved browser observations. Public feeds can be unavailable, stale, or missing aircraft. Regional flights can use an operating callsign different from the marketed number: no automatic guessed SkyWest/Endeavor mapping is presented as fact.

## Dated assignments / future predictions
The existing optional AEROAPI_KEY Cloudflare secret enables FlightAware dated flight records and up to two pages of recent historical operations. API usage can incur provider charges; no account or subscription is created by this update. Free current broadcasts alone cannot determine an airline's future aircraft assignment. Without dated evidence, predictions intentionally say insufficient evidence.

The new score uses unique completed operations on the same origin/destination before the requested date, decayed by exp(-days/14), plus weight 8 for the selected provider-reported assignment, with weight 3 reserved for other aircraft. Percentages total 100 including Other, but are experimental evidence shares, NOT calibrated outcome probabilities. Future calibration requires independently verified results. No 100% guarantee is offered. Live matches never count as future assignment evidence. Cancelled flights show no prediction.

History is bounded by provider availability (up to two pages from a seven-day window), not comprehensive service or maintenance history. Missing photos or birth/build dates are not invented. Session trails and browser history are not full historical flight tracking. Continuous updates run only while this page is open and visible. This is not Flightradar24's proprietary feed or a replacement with identical worldwide coverage.

## Verification and sources
- ADSB.lol API: https://api.adsb.lol/docs — https://www.adsb.lol/docs/open-data/api/
- ADSBdb: https://www.adsbdb.com/
- Optional FlightAware AeroAPI: https://www.flightaware.com/commercial/aeroapi/
- NOAA radar endpoint: https://opengeo.ncep.noaa.gov/geoserver/conus/conus_bref_qcd/ows
- Aircraft photos remain credited to their photographers; source links accompany thumbnails.

Run `npm test` for model and API regression tests. `node scripts/build-worker.mjs` updates the two V20 API handlers in the deployment worker from their Pages Function sources. Retain the worker in deployment.
