Skip to content

Broaden OpenSky candidate capture and apply post-enrichment military filter#35

Closed
koala73 wants to merge 1 commit into
mainfrom
codex/adjust-opensky-pipeline-for-enrichment
Closed

Broaden OpenSky candidate capture and apply post-enrichment military filter#35
koala73 wants to merge 1 commit into
mainfrom
codex/adjust-opensky-pipeline-for-enrichment

Conversation

@koala73

@koala73 koala73 commented Jan 27, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Allow Wingbits enrichment to evaluate more hotspot-bound candidates so additional signals (type code/owner) can identify military aircraft that initial heuristics miss.
  • Keep OpenSky query volume unchanged by bounding candidates to configured hotspots while avoiding overly strict pre-enrichment filtering.
  • Persist Wingbits type code so it can be used when applying a stricter military filter after enrichment.

Description

  • Change the OpenSky parsing logic to accept any flight inside hotspot bounds by using getNearbyHotspot in parseOpenSkyResponse and removed the old pre-enrichment isMilitaryFlight gate in src/services/military-flights.ts.
  • Add a post-enrichment classifier isConfirmedMilitaryFlight that combines callsign, hex ranges, Wingbits confirmedMilitary, Wingbits typeCode (pattern match), and enriched owner keywords to decide final military membership in src/services/military-flights.ts.
  • Implement an explicit two-stage flow in fetchMilitaryFlights: collect hotspot candidates via fetchFromOpenSky, batch-enrich them with enrichFlightsWithWingbits, then apply isConfirmedMilitaryFlight to produce the final flights set and clusters (documented in a comment block inside the function).
  • Persist Wingbits typecode into flight enrichment as enriched.typeCode and update the type definition in src/types/index.ts to expose typeCode for downstream use.

Testing

  • No automated tests were executed during this change (none requested); commit contains only code modifications and updated type definitions.
  • The patch compiles in-place during development and commit succeeded locally (no test suite run).

Codex Task

@vercel

vercel Bot commented Jan 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
worldmonitor Ready Ready Preview, Comment Jan 27, 2026 5:21am
worldmonitor-startup Ready Ready Preview, Comment Jan 27, 2026 5:21am
worldmonitor-test Ready Ready Preview, Comment Jan 27, 2026 5:21am

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89be87c240

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +216 to +219
const typeCode = flight.enriched?.typeCode || flight.aircraftModel || '';
const normalizedType = typeCode.toUpperCase();
const militaryTypePattern = /^(B|C|E|F|KC|RC|RQ|MQ|P|U|VC|V|A)\d+/;
if (normalizedType && militaryTypePattern.test(normalizedType)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Narrow type-code regex to avoid civilian matches

The new isConfirmedMilitaryFlight treats any typeCode/aircraftModel matching /^(B|C|E|F|KC|RC|RQ|MQ|P|U|VC|V|A)\d+/ as military. Because Wingbits typecode values for common civilian aircraft are things like A320, B738, or C172, this pattern will classify large numbers of non‑military flights within hotspots as military now that pre‑enrichment filtering is removed. This will inflate results and corrupt clusters in any hotspot with normal commercial/GA traffic. Consider limiting to known military type prefixes (e.g., KC, RC, MQ, etc.) or whitelisting known military ICAO type codes instead of single letters.

Useful? React with 👍 / 👎.

koala73 added a commit that referenced this pull request Jan 27, 2026
- PR #33: Disambiguate NAVY callsign by origin country (US vs UK)
- PR #34: Use typecode fallback in determineAircraftInfo + Wingbits
  enrichment (guarded: only when type is still 'unknown')
- PR #35: Persist typeCode in enriched data (skip the broken
  pre-filter removal and false-positive regex from original PR)

Closes #33, #34, #35
@koala73

koala73 commented Jan 27, 2026

Copy link
Copy Markdown
Owner Author

Cherry-picked typeCode persistence into main (commit 283d05a). Did NOT merge: pre-filter removal (would flood Wingbits with civilian flights) and false-positive regex (matches B737, A320 etc as military).

@koala73 koala73 closed this Jan 27, 2026
@koala73
koala73 deleted the codex/adjust-opensky-pipeline-for-enrichment branch February 15, 2026 08:06
@SebastienMelki SebastienMelki added the area: military Military flights, vessel tracking label Feb 17, 2026
facusturla pushed a commit to facusturla/worldmonitor that referenced this pull request Feb 27, 2026
…with fixes

- PR koala73#33: Disambiguate NAVY callsign by origin country (US vs UK)
- PR koala73#34: Use typecode fallback in determineAircraftInfo + Wingbits
  enrichment (guarded: only when type is still 'unknown')
- PR koala73#35: Persist typeCode in enriched data (skip the broken
  pre-filter removal and false-positive regex from original PR)

Closes koala73#33, koala73#34, koala73#35
@koala73 koala73 mentioned this pull request Mar 26, 2026
8 tasks
scorphx pushed a commit to scorphx/sauron that referenced this pull request Apr 6, 2026
- koala73#34: Remove isProUser() guard from setupAuthWidget(). New users now
  see the sign-in button and can create accounts. The guard was
  intentionally deferred; removing it is the stated end-state.

Close stale todos whose fixes already landed in prior PRs:
- koala73#10: inferEntityClassFromName word-boundary regex (already in code)
- koala73#11: entity key collision fix using candidateStateId (already in code)
- koala73#12: priorWorldState threading to writeSimulationPackage (already in code)
- koala73#13: sanitizeForPrompt on simulation builder strings (already in code)
- koala73#14: allForecastIdSet Set-based lookup (already in code)
- koala73#35: algorithms:['RS256'] in jwtVerify (already in auth-session.ts)
- koala73#41: frameworkHash in deduct-situation cache key (already in code)
- koala73#42: isCallerPremium server-side premium gate (already in code)
- koala73#43: SSRF — ALLOWED_AGENTSKILLS_HOSTS + redirect:manual (already fixed)
- koala73#44: sanitizeForPrompt on systemAppend before LLM (already in code)
- koala73#45: systemAppend included in getCacheKey (already in code)
- koala73#49: shippingStress/diseaseOutbreaks/socialVelocity in BOOTSTRAP_KEYS

https://claude.ai/code/session_015fz1MvRuBJGYbgHubGEabA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: military Military flights, vessel tracking codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants