Broaden OpenSky candidate capture and apply post-enrichment military filter#35
Broaden OpenSky candidate capture and apply post-enrichment military filter#35koala73 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 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".
| 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)) { |
There was a problem hiding this comment.
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 👍 / 👎.
- 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
|
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). |
…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#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
Motivation
Description
getNearbyHotspotinparseOpenSkyResponseand removed the old pre-enrichmentisMilitaryFlightgate insrc/services/military-flights.ts.isConfirmedMilitaryFlightthat combines callsign, hex ranges, WingbitsconfirmedMilitary, WingbitstypeCode(pattern match), and enrichedownerkeywords to decide final military membership insrc/services/military-flights.ts.fetchMilitaryFlights: collect hotspot candidates viafetchFromOpenSky, batch-enrich them withenrichFlightsWithWingbits, then applyisConfirmedMilitaryFlightto produce the finalflightsset and clusters (documented in a comment block inside the function).typecodeinto flight enrichment asenriched.typeCodeand update the type definition insrc/types/index.tsto exposetypeCodefor downstream use.Testing
Codex Task