…scriptions
Marine events carry no station object: ais_message.created has the station
UUID and voyage-position.created the vessel position. Join them on the
voyage id so each AIS message becomes one reception, with the vessel's last
known position standing in for messages without one. Flight events name no
station and matched nothing, so their subscriptions and parser are removed.
MARINE_COVERAGE_ENABLED=false leaves the marine subjects unsubscribed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PS44Q7WRmAzMJLhi44dzdo
Requested by Kevin · project thread
Why
Marine coverage has been empty in production. The marine parsers expected a
stationobject on every event, but the aggregation server does not publish one for marine:v1.marine.ais_message.createdis{ source, ais_message }, whereais_message.station_idis the station UUID and there is no position.v1.marine.voyage-position.createdis{ source, voyage_position }, with latitude and longitude but no station.So every marine event was dropped at the parser. Separately, the
v1.aircraft.ingest.*.flight.*subscriptions match nothing (flights are published onv1.aircraft.flight.*), and those events name no station, so they cannot contribute to coverage.What changes
MarineCorrelator(service/src/nats/marine-correlator.ts) joins the two marine events onmarine_voyage_id. The aggregator publishes the AIS message first and its position right after, so an AIS message waits up to 5 s for its position. Each AIS message becomes exactly one reception:parseAircraftFlight, the old marine parsers and the voyage created/updated subscriptions are removed./api/v1/healthgains amarineblock:paired,fromLastPosition,withoutPosition,unknownStation,pending,trackedVoyages.MARINE_COVERAGE_ENABLED=falseleaves the marine subjects unsubscribed, as an off switch that needs no new image.Load
Marine is the busiest feed (about 600 events a second across the two subjects). Measured locally:
Worth watching
cellsInMemoryand themarineblock on/api/v1/healthafter deploy. IfunknownStationis high, the station sync is not returning UUIDs for those stations.Testing
npm run typecheckandnpm testpass (35 tests; 7 new for the correlator, using payloads in the aggregation server's shape).ais_message.g.dart,voyage_position.g.dart) and the publish order fromaiscatcher_json_message_importer.dart.Screenshot
The map's Marine filter, fed by the real store, API and correlator with synthetic AIS payloads (demo stations, blank basemap because the basemap host is not reachable from the build container; the "NATS disconnected" banner is because the demo has no NATS):
Generated by Claude Code
Summary by CodeRabbit