Skip to content

Service: name the stations behind out-of-range positions - #44

Merged
kevinelliott merged 1 commit into
mainfrom
claude/project-thread-xlxhmp
Nov 21, 2026
Merged

kevinelliott merged 1 commit into
mainfrom
claude/project-thread-xlxhmp

Conversation

@kevinelliott

@kevinelliott kevinelliott commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Kevin · project thread

Why

Twelve minutes after the 2026-11-21 00:48 UTC deploy, production had discarded 27,742 positions as out of range, 5.3% of events. By radio family (near / far, where far is beyond twice the limit):

Family Near Far
ais 7,103 18,923
vdl 102 1,180
acars 5 354
hfdl 27 48

So almost all of it is AIS far outside any plausible VHF range, and it is not the imported area feeds: NCT, FINTRAFFIC and AISSTREAM record no range at all. A receiver cannot hear a vessel 200 km away, so the likely causes are stations placed in the wrong spot (GeoIP) or stations that relay someone else's feed. The per-family totals cannot tell a handful of such stations from a general problem.

What changes

/api/v1/health gains coverage.outOfRangeStations: the 20 stations with the most out-of-range discards since the service started, worst first.

{ "stationId": 22, "ident": "TEST-22", "sourceType": "ais", "near": 1, "far": 1, "maxDistanceKm": 6034 }

It carries the station ident and counts only, no coordinates. Nothing about which positions are kept or discarded changes, and getStats() (which the Prometheus metrics read) is untouched.

Cost: one small map entry per station that has had a discard.

After deploy

Read the list. A few stations with large far counts means fixing those stations' locations, or adding relays to AREA_FEED_STATIONS. A long flat list would point at the vessel position pairing instead.

Testing

  • npm run typecheck and npm test pass (48 tests); the out-of-range test now also checks the station entry.

No screenshots: health output only, no UI change.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • The coverage summary now lists up to 20 stations with the most out-of-range discards, including near and far counts and the greatest distance recorded.
  • Documentation
    • Architecture documentation clarifies the meaning of “far” and describes the out-of-range station information.

Health gains coverage.outOfRangeStations: the 20 stations with the most
discarded out-of-range positions since start, split near/far, with the
furthest distance seen. In production 5% of positions are discarded this
way, almost all AIS beyond twice the limit, and the per-family totals
cannot say whether that is a few mislocated stations or many.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PS44Q7WRmAzMJLhi44dzdo
@kevinelliott kevinelliott self-assigned this Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The coverage store now records out-of-range counts and maximum distance per station. The /health response includes up to 20 ranked station records, and the ingestion test checks the reported values.

Changes: Station-level out-of-range reporting

Layer / File(s) Summary
Track and rank station out-of-range events
service/src/aggregation/coverage-store.ts
Ingestion passes the station ID to out-of-range counting. The store classifies events as near or far, records each station’s maximum distance, and returns records ranked by total count.
Expose and verify the station report
service/src/api/routes/health.ts, service/test/ingest.test.ts, service/CLAUDE.md
The /health response includes the station report. The test checks station metadata, counts, and maximum distance. The architecture documentation describes the report.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Ingest
  participant CoverageStore
  participant HealthRoute
  Ingest->>CoverageStore: ingest event with station ID
  CoverageStore->>CoverageStore: update near/far counts and maximum distance
  HealthRoute->>CoverageStore: getOutOfRangeStations()
  CoverageStore-->>HealthRoute: ranked station records
Loading

Possibly related PRs

  • airframesio/coverage#42: Adds the per-family out-of-range counters and discard path that this change extends with per-station reporting.

Suggested reviewers: claude

Merge Risk: Minimal · up to e4085

The health endpoint gains a ranked list of the stations behind out-of-range discards, which helps diagnose position-pairing issues. Ingestion behavior and existing metrics are unchanged, and no merge-blocking risk was established.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the service now reports the stations behind out-of-range positions. The raw summary shows the new getOutOfRangeStations method and the /health outOfRangeStations field…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the service now reports the stations behind out-of-range positions. The raw summary shows the new getOutOfRangeStations method and the /health outOfRangeStations field, which match the title. The title is specific, concise, and free of vague terms.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2538e5d5-4295-440b-ba9f-d9a2fa00e7a1
Commits

Reviewing files that changed from the base of the PR and between f1a7052 and e408526.

Files selected for processing: 4

  • service/CLAUDE.md
  • service/src/aggregation/coverage-store.ts
  • service/src/api/routes/health.ts
  • service/test/ingest.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying airframes-coverage with  Cloudflare Pages  Cloudflare Pages

Latest commit: e408526
Status: ✅  Deploy successful!
Preview URL: https://23af1867.airframes-coverage.pages.dev
Branch Preview URL: https://claude-project-thread-xlxhmp.airframes-coverage.pages.dev

View logs

@kevinelliott
kevinelliott merged commit f13017f into main Nov 21, 2026
9 checks passed
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.

2 participants