fix(military): narrow ICAO hex ranges to stop civilian false positives#627
Merged
Conversation
…false positives (#462) MILITARY_HEX_RANGES used entire country ICAO allocations instead of military-specific sub-ranges (sourced from tar1090-db/ranges.json). This flagged ALL commercial aircraft from Italy, Spain, Japan, India, South Korea, etc. as military activity. Key changes: - Remove A00000-A3FFFF (US civilian N-numbers) — military starts at ADF7C8 - Italy 300000-33FFFF → 33FF00-33FFFF (top 256 codes only) - Spain 340000-37FFFF → 350000-37FFFF (upper 3/4 confirmed military) - Japan 840000-87FFFF removed (no confirmed JASDF sub-range) - France narrowed to 3AA000-3AFFFF + 3B7000-3BFFFF - Germany narrowed to 3EA000-3EBFFF + 3F4000-3FBFFF - India 800000-83FFFF → 800200-8002FF (256 codes) - Canada C00000-C0FFFF → C20000-C3FFFF (upper half) - Remove unconfirmed: South Korea, Sweden, Singapore, Pakistan - Add confirmed: Austria, Belgium, Switzerland, Brazil - Drop overly broad /^[A-Z]{4,}\d{1,3}$/ callsign regex from server
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Move ambiguous 2-letter prefixes (AE, RF, TF, PAT, SAM, OPS, CTF, IRG, TAF) to SHORT_MILITARY_PREFIXES — these now only match when followed by a digit (e.g. AE1234=military, AEE123=Aegean Airlines). Add 97-case test suite covering: - Military callsign detection (19 known patterns) - Short prefix digit gating (6 cases) - Civilian airline non-detection (26 airlines) - Short prefix letter rejection (6 cases) - Military hex range boundaries (7 confirmed ranges) - Civilian hex non-detection (19 codes) - Boundary precision (ADF7C8 start, 33FF00 start, etc.) - No-full-allocation guard (10 countries)
koala73
added a commit
that referenced
this pull request
Mar 1, 2026
#627) * fix(military): narrow hex ranges and callsign regex to stop civilian false positives (#462) MILITARY_HEX_RANGES used entire country ICAO allocations instead of military-specific sub-ranges (sourced from tar1090-db/ranges.json). This flagged ALL commercial aircraft from Italy, Spain, Japan, India, South Korea, etc. as military activity. Key changes: - Remove A00000-A3FFFF (US civilian N-numbers) — military starts at ADF7C8 - Italy 300000-33FFFF → 33FF00-33FFFF (top 256 codes only) - Spain 340000-37FFFF → 350000-37FFFF (upper 3/4 confirmed military) - Japan 840000-87FFFF removed (no confirmed JASDF sub-range) - France narrowed to 3AA000-3AFFFF + 3B7000-3BFFFF - Germany narrowed to 3EA000-3EBFFF + 3F4000-3FBFFF - India 800000-83FFFF → 800200-8002FF (256 codes) - Canada C00000-C0FFFF → C20000-C3FFFF (upper half) - Remove unconfirmed: South Korea, Sweden, Singapore, Pakistan - Add confirmed: Austria, Belgium, Switzerland, Brazil - Drop overly broad /^[A-Z]{4,}\d{1,3}$/ callsign regex from server * fix(military): constrain short prefixes + add classification tests Move ambiguous 2-letter prefixes (AE, RF, TF, PAT, SAM, OPS, CTF, IRG, TAF) to SHORT_MILITARY_PREFIXES — these now only match when followed by a digit (e.g. AE1234=military, AEE123=Aegean Airlines). Add 97-case test suite covering: - Military callsign detection (19 known patterns) - Short prefix digit gating (6 cases) - Civilian airline non-detection (26 airlines) - Short prefix letter rejection (6 cases) - Military hex range boundaries (7 confirmed ranges) - Civilian hex non-detection (19 codes) - Boundary precision (ADF7C8 start, 33FF00 start, etc.) - No-full-allocation guard (10 countries) * fix: use charAt() instead of bracket indexing for strict TS
matthewvecchione1-ops
pushed a commit
to matthewvecchione1-ops/worldmonitor
that referenced
this pull request
Mar 4, 2026
koala73#627) * fix(military): narrow hex ranges and callsign regex to stop civilian false positives (koala73#462) MILITARY_HEX_RANGES used entire country ICAO allocations instead of military-specific sub-ranges (sourced from tar1090-db/ranges.json). This flagged ALL commercial aircraft from Italy, Spain, Japan, India, South Korea, etc. as military activity. Key changes: - Remove A00000-A3FFFF (US civilian N-numbers) — military starts at ADF7C8 - Italy 300000-33FFFF → 33FF00-33FFFF (top 256 codes only) - Spain 340000-37FFFF → 350000-37FFFF (upper 3/4 confirmed military) - Japan 840000-87FFFF removed (no confirmed JASDF sub-range) - France narrowed to 3AA000-3AFFFF + 3B7000-3BFFFF - Germany narrowed to 3EA000-3EBFFF + 3F4000-3FBFFF - India 800000-83FFFF → 800200-8002FF (256 codes) - Canada C00000-C0FFFF → C20000-C3FFFF (upper half) - Remove unconfirmed: South Korea, Sweden, Singapore, Pakistan - Add confirmed: Austria, Belgium, Switzerland, Brazil - Drop overly broad /^[A-Z]{4,}\d{1,3}$/ callsign regex from server * fix(military): constrain short prefixes + add classification tests Move ambiguous 2-letter prefixes (AE, RF, TF, PAT, SAM, OPS, CTF, IRG, TAF) to SHORT_MILITARY_PREFIXES — these now only match when followed by a digit (e.g. AE1234=military, AEE123=Aegean Airlines). Add 97-case test suite covering: - Military callsign detection (19 known patterns) - Short prefix digit gating (6 cases) - Civilian airline non-detection (26 airlines) - Short prefix letter rejection (6 cases) - Military hex range boundaries (7 confirmed ranges) - Civilian hex non-detection (19 codes) - Boundary precision (ADF7C8 start, 33FF00 start, etc.) - No-full-allocation guard (10 countries) * fix: use charAt() instead of bracket indexing for strict TS
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.
Summary
Fixes #462 — commercial aircraft (Alitalia, JAL, Air India, etc.) were being flagged as military activity.
Root cause:
MILITARY_HEX_RANGESinsrc/config/military.tsused entire country ICAO allocations instead of the actual military-specific sub-ranges. For example, Italy's full block300000-33FFFFwas marked as military — this includes ALL Italian commercial aircraft. Same issue for Japan (840000-87FFFF), India (800000-83FFFF), Spain (340000-37FFFF), and the US civilian rangeA00000-A3FFFF.Additionally, the server-side
isMilitaryCallsign()had an overly broad regex/^[A-Z]{4,}\d{1,3}$/that matched any 4+ letter prefix with 1-3 trailing digits — catching GA callsigns and foreign registrations.Fix: Replaced all ranges with verified military sub-ranges from tar1090-db/ranges.json (the authoritative ADS-B community database):
Also removed unconfirmed ranges (South Korea, Sweden, Singapore, Pakistan) and added confirmed military ranges (Austria, Belgium, Switzerland, Brazil).
Test plan