AGENTS.md — astronomy/ (':astronomy')
Scoped supplement. Global rules in root AGENTS.md apply. Stay inside astronomy/ + allowed shared modules. Do not root-scan.
Install: ./install astronomy (dev by default).
- Gradle: :astronomy / dir: astronomy/
- Package roots present: ui, data, domain, platform, intents
- Entry files: MainActivity.kt, Route.kt, Navigation.kt
- Deps: (none declared — bundled catalogs, Rust ephemeris)
- Metadata: metadata_data/astronomy.md (present)
- Rust: yes / screenshotTest: yes
Overview
Purpose: Offline AR night-sky viewer — sensor-tracked sky map, camera passthrough, time scrubber, bundled star/planet catalogs, rise/set search. 100% offline. Key features: ui/SkyCanvas + grid/art layers over domain/projection/ (stereographic) fed by domain/engine/ calculators (solar/lunar/planetary/rise-set/time) with a Rust core (domain/AstronomyNative); catalogs in data/ validated at build time by scripts/ generators. The sky view pinches to zoom and drags to pan (domain/projection/ViewTransform.kt, FOV clamped to ViewState 10-120 degrees, shared with the Settings slider): while device orientation drives the center, pinch zoom changes only the field of view and never takes manual control (the Settings slider's setFov path behaves the same); a pan whose accumulated movement crosses the touch slop (GesturePanGate in ViewTransform.kt) takes manual control from the sensors, and a phone rotation of 45 degrees or more from the takeover orientation (platform/ManualViewArbitration.kt) hands the center back to the sensors (the zoomed FOV is kept). Entry points: Route → MainActivity.kt → Navigation.kt → ui/SkyMapPage.kt → platform/AstronomyViewModel.kt → domain/engine/TimeEngine.kt. Assistant entry: intents/TonightIntent (OpenAssistant astronomy_get_tonight) returns one capped tonight summary (Sun/Moon times, Moon phase, brightest visible planets) computed by the domain calculators; DTOs in library/intents/astronomy/, signature-permission gated. Gotchas: Catalog data is generated (scripts/ DB generators) — never hand-edit; sensor + location drive the sky, test with movement, not static.
Key files
Root — entry + navigation
- com/vayunmathur/astronomy/MainActivity.kt
- com/vayunmathur/astronomy/Navigation.kt
- com/vayunmathur/astronomy/Route.kt
data/ — bundled catalogs
- com/vayunmathur/astronomy/data/CatalogRepository.kt
- com/vayunmathur/astronomy/data/model/Models.kt
domain/ — ephemeris + projection (Rust core + Kotlin math)
- com/vayunmathur/astronomy/domain/AstronomyNative.kt — Rust bridge
- com/vayunmathur/astronomy/domain/engine/TimeEngine.kt
- com/vayunmathur/astronomy/domain/engine/CoordinateTransforms.kt
- com/vayunmathur/astronomy/domain/engine/SolarCalculator.kt
- com/vayunmathur/astronomy/domain/engine/LunarCalculator.kt
- com/vayunmathur/astronomy/domain/engine/PlanetaryCalculator.kt
- com/vayunmathur/astronomy/domain/engine/RiseSetCalculator.kt
- com/vayunmathur/astronomy/domain/projection/SkyProjection.kt
- com/vayunmathur/astronomy/domain/projection/StereographicProjection.kt
- com/vayunmathur/astronomy/domain/projection/ViewState.kt
- com/vayunmathur/astronomy/domain/projection/ViewTransform.kt — pinch-zoom-about-centroid and pan transforms over
ViewState
intents/ — assistant IPC
- com/vayunmathur/astronomy/intents/TonightIntent.kt — validated
TonightQuery→ cappedAstronomyTonightDatasummary; explicit location pair or saved observer fallback - com/vayunmathur/astronomy/intents/TonightSummary.kt — location validation + pure tonight-summary builder over the domain calculators
platform/ — ViewModel + location
- com/vayunmathur/astronomy/platform/AstronomyViewModel.kt
- com/vayunmathur/astronomy/platform/ManualViewArbitration.kt — manual-vs-sensor view arbitration (45-degree re-engagement)
- com/vayunmathur/astronomy/platform/AstronomyUiContract.kt
- com/vayunmathur/astronomy/platform/sensor/LocationProvider.kt
ui/ — sky map + detail + search
- com/vayunmathur/astronomy/ui/SkyMapPage.kt
- com/vayunmathur/astronomy/ui/SkyCanvas.kt
- com/vayunmathur/astronomy/ui/SkyCanvasGestures.kt — transform-gesture channels (zoom-only vs pan takeover) for
SkyCanvas - com/vayunmathur/astronomy/ui/DrawDeepSkyObjects.kt
- com/vayunmathur/astronomy/ui/SkyGrid.kt
- com/vayunmathur/astronomy/ui/SkyArt.kt
- com/vayunmathur/astronomy/ui/ObjectDetailPage.kt
- com/vayunmathur/astronomy/ui/ObjectDetailScreen.kt
- com/vayunmathur/astronomy/ui/SearchPage.kt
- com/vayunmathur/astronomy/ui/SettingsPage.kt
- com/vayunmathur/astronomy/ui/components/CameraBackground.kt
Verify (this module only)
./gradlew :astronomy:compileDevKotlin
./gradlew :astronomy:lint
./gradlew :astronomy:checkMetadata