fix(neo_feed): missing-distance false ALERT + UTC feed window - #109
Merged
Conversation
… feed window Addresses two Cursor Bugbot findings on the just-merged NEO feed client: - High: a NEO object with no miss_distance defaulted distance_au/ld to 0, which reads as distance_ld < 1.0 and trips a false ThreatLevel.ALERT. Now: prefer the astronomical value, fall back to deriving AU from kilometres, and skip the object entirely if neither is present (rather than emitting a phantom close pass). - Medium: default feed start_date used local date.today() while the CAD client and all NEO timing are UTC, shifting the window a day near timezone boundaries. Now uses datetime.now(timezone.utc).date(). Adds regression tests: missing-distance is skipped (not alerted); km-only distance derives AU. 65 NEO tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKZMQ755R7q38SKqJsCQsg
1 task
THOClabs
added a commit
that referenced
this pull request
Aug 6, 2026
Explains the 87-branch pileup (a March 2026 NEO/hourly-scan swarm of ~59 near- duplicate AI branches + 15 already-squash-merged-this-session + 12 old reviews + legacy master) and classifies every branch. All are safe to delete; the NEO core was salvaged to main (#108/#109). Flags three distinct un-salvaged features (hourly scanner, event journal, space-weather client) as salvage candidates before the swarm is deleted. scripts/delete_stale_branches.sh is turnkey (remote deletion is blocked from the automation sandbox, so it's run locally). Claude-Session: https://claude.ai/code/session_01SKZMQ755R7q38SKqJsCQsg Co-authored-by: Claude <noreply@anthropic.com>
THOClabs
added a commit
that referenced
this pull request
Aug 7, 2026
…verity (#111) Recovers the four capabilities flagged by docs/BRANCH_CLEANUP.md before the swarm branches are deleted, adapted to the post-#108/#109 API on main: - hourly_scanner.py (from feat/neo-hourly-scanner): autonomous hourly scan of CNEOS fireballs, JPL CAD close approaches, and shower calendar. Adapted to close_approach_client (field renames), rank-preserving THREAT_LEVEL_MAP (JPL WATCH/ALERT -> scanner CLOSE/ALERT), timezone-aware UTC. - event_journal.py (from nightwatch/neo-tracking-and-event-journal): SQLite sky-event journal with Hopi-ring classification; timezone-aware UTC. - space_weather.py (from feat/neo-space-weather-hourly-scan): NOAA SWPC Kp, solar wind, alerts; UTC-aware parsing + warning when the feed is partial so outages cannot masquerade as quiet conditions. - scan_severity.py (from feat/hourly-event-scanner): severity classification with tests. - fireball_client.py: CNEOS lat-dir/lon-dir sign fix (coords are unsigned in the API; S/W must negate) from feat/hourly-event-scanner. - lexicon_prayers.py: generate_prayer_of_approach + status prayer NEO count (from the event-journal branch). - __init__.py: eager event_journal/lexicon exports; lazy loaders for hourly scanner, space weather, scan severity. 142 new unit tests, all passing. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
THOClabs
added a commit
that referenced
this pull request
Aug 7, 2026
#112) Preserves the durable content of three open-PR branches before the v0.1.1 branch purge closes them: - .claude/agents/ (7 review subagents) + .claude/commands/full-review.md from PR #93's branch — repo-state-independent review tooling; the stale July review reports on that branch are intentionally NOT taken. - docs/design/ Claude Design frontend prompt pack (3 files) from PR #92's branch — targets the v0.2 frontend; NEO data-model sections predate #108/#109 and need a refresh before use (noted in its provenance table). - docs/audits/ archive of AUDIT_LANDSCAPE.md + REVIEW_RECONCILIATION.md from PR #90's branch, with HISTORICAL SNAPSHOT headers — findings were fixed by #94-#110; preserved as engineering history. Its STALE_BRANCH_TRIAGE.md is dropped (superseded by #110). Part 1/Step 2 of the v0.1.1 main-only consolidation. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 7, 2026
THOClabs
added a commit
that referenced
this pull request
Aug 7, 2026
…ry tests (#114) Recovered from the legacy master branch before its deletion: a purely additive spiral search-route generator (Waypoint, SearchRoute, generate_spiral_route, destination_point, initial_bearing) for hopi_circles, plus the comprehensive test suites for hopi_circles and trajectory (the only content of master's 8 unique commits not already superseded by #108/#109/#111). All tests pass against current main. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 two correctness issues in the just-merged NEO feed client (#108), both flagged by Cursor Bugbot and independently verified against the source.
_parse_neo_objectdefaulteddistance_au/distance_ldto0whenmiss_distance.astronomicalwas absent. Sincethreat_levelreturnsALERTwhendistance_ld < 1.0, a NEO with unknown distance was mis-classified as a close pass. Now: preferastronomical, fall back to deriving AU fromkilometers, and skip the object if neither is present.start_dateuseddate.today()(local) while the CAD client and all NEO timing are UTC, shifting the query window a day near timezone boundaries. Now usesdatetime.now(timezone.utc).date().Testing
pytest tests/unit/test_neo_feed_client.py tests/unit/test_neo_client.py→ 65 passed🤖 Generated with Claude Code
Generated by Claude Code
Note
Medium Risk
Changes threat classification inputs for NEO feed data; incorrect parsing could still miss real alerts, but the fix removes a known false-positive path in meteor tracking.
Overview
Fixes two correctness bugs in NEO feed parsing that could mis-rank threats or query the wrong date window.
Miss distance handling no longer treats absent
miss_distanceas zero AU/LD. The parser prefersastronomical, derives AU fromkilometerswhen needed, and drops objects with no distance so they cannot hitthreat_levelALERT viadistance_ld < 1.0.Default feed window now anchors
start_dateon UTC (datetime.now(timezone.utc).date()) instead of localdate.today(), aligning with the CAD client and NEO timing.Unit tests cover skipped missing-distance and km-only distance derivation.
Reviewed by Cursor Bugbot for commit 042a089. Bugbot is set up for automated code reviews on this repo. Configure here.