Skip to content

Add async TLE fetch/parse pipeline with hot-reloadable orbital state#82

Merged
seanwevans merged 2 commits intomainfrom
codex/implement-automated-tle-fetching-pipeline
Apr 1, 2026
Merged

Add async TLE fetch/parse pipeline with hot-reloadable orbital state#82
seanwevans merged 2 commits intomainfrom
codex/implement-automated-tle-fetching-pipeline

Conversation

@seanwevans
Copy link
Copy Markdown
Owner

Motivation

  • The propagator needs up-to-date, real-world TLE data so the "Live orbital map" doesn't drift from reality.
  • Avoid relying on static files by introducing an automated, periodic fetch and parse pipeline for public TLEs.
  • Allow orbital parameters to be updated in-place without restarting the daemon or dropping active frontend WebSocket connections.

Description

  • Add a new tle module at daemon/openastrovizd/src/tle.rs exposing fetch_tle_catalog (async reqwest download) and parse_tle_catalog (3-line catalog parser) plus an OrbitalRecord wrapper that builds openastroviz_core::Sgp4Propagator instances and epoch StateVectors.
  • Wire an async refresh loop into the service by initializing a Tokio runtime inside daemon::run_service in daemon/openastrovizd/src/daemon.rs, spawning tle_refresh_loop and storing the catalog in a shared Arc<RwLock<Vec<OrbitalRecord>>> for hot-reloadable state.
  • Register the new module in the binary entrypoint (mod tle; in daemon/openastrovizd/src/main.rs) and add runtime/HTTP dependencies in daemon/openastrovizd/Cargo.toml (openastroviz-core, reqwest, tokio).
  • Document the new live refresh behavior in daemon/openastrovizd/README.md and include unit tests in the tle module for valid and malformed catalogs.

Testing

  • Ran cargo test -p openastrovizd and cargo test -p openastrovizd --quiet, and all daemon unit and integration tests completed successfully.
  • During tests the daemon logged outbound fetch errors (container/CI blocked network to CelesTrak), but these errors are non-fatal and the refresh loop is resilient; test suite still passed.
  • cargo fmt was not run in this environment because rustfmt is not installed (error: install rustfmt via rustup component add).

Codex Task

@seanwevans seanwevans merged commit 1498d6e into main Apr 1, 2026
@seanwevans seanwevans deleted the codex/implement-automated-tle-fetching-pipeline branch April 1, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant