GENERIC_PHENOMENA_SOLAR_CONDITIONS_BACKEND_STANDARD - TheDaniel166/moira GitHub Wiki
Generic Phenomena And Solar Conditions Backend Standard
Version: 0.2 Date: 2026-06-14 Status: implemented backend standard for P-GAP-04 REST admission Scope: generic planetary phenomena, proximity threshold events, and classical solar-condition truth
This standard governs the generic phenomena and solar-condition surfaces that are public through the Python engine and candidates for P-GAP-04 REST admission:
moira.phenomena.PhenomenonEventmoira.phenomena.PlanetPhenomenamoira.phenomena.ProximityEventmoira.phenomena.planet_phenomena_atmoira.phenomena.greatest_elongationmoira.phenomena.perihelionmoira.phenomena.aphelionmoira.phenomena.proximity_events_in_rangemoira.phenomena.solar_condition_atmoira.phenomena.solar_condition_events_in_rangeMoira.phenomenaMoira.proximity_eventsMoira.solar_condition_atMoira.solar_condition_events
This standard does not govern rise/set phenomena, heliacal visibility, eclipses, occultations, lunar phases, stations, transits, orbital elements, or dignity profile interpretation. Those are already owned by their own route families or backend standards.
1. Governing Objects
P-GAP-04 has four distinct governing objects.
Planet Phenomena Snapshot
Owned by:
moira.phenomena.PlanetPhenomenamoira.phenomena.planet_phenomena_at
Meaning:
- instantaneous photometric/geometric state for one body at one
jd_ut - includes phase angle, illuminated fraction, elongation, angular diameter, and apparent magnitude
- does not search for events
- does not return rise/set, heliacal visibility, station, or transit status
Admitted fields:
bodyjd_utphase_angle_degilluminated_fractionelongation_degangular_diameter_arcsecapparent_magnitude
Generic Orbital Phenomenon Event
Owned by:
moira.phenomena.PhenomenonEventmoira.phenomena.greatest_elongationmoira.phenomena.perihelionmoira.phenomena.aphelionMoira.phenomena
Meaning:
- discrete heliocentric or geocentric orbital event in a bounded date range
- greatest elongation is admitted only for Mercury and Venus
- perihelion and aphelion are heliocentric distance-curve events
- event
valuesemantics depend on event kind and must be labeled
Admitted event kinds:
greatest_eastern_elongationgreatest_western_elongationperihelionaphelion
Admitted event fields:
bodyevent_kindlabeljd_utdatetime_utcvaluevalue_unit
Proximity Threshold Event
Owned by:
moira.phenomena.ProximityEventmoira.phenomena.proximity_events_in_rangeMoira.proximity_events
Meaning:
- ingress/egress crossing of an angular separation threshold between two bodies around conjunctions
- threshold is caller supplied and explicit
- event direction is ingress when separation is decreasing at the crossing
- this is not an aspect search, transit interpretation, or recommendation
Admitted fields:
body1body2jd_utdatetime_utcthreshold_degthreshold_abs_degbody1_longitudebody2_longitudebody2_latitudebody2_retrogradeis_ingresslabel
Solar Condition Truth
Owned by:
moira.dignities_types.SolarConditionTruthmoira.phenomena.solar_condition_atmoira.phenomena.solar_condition_events_in_rangeMoira.solar_condition_atMoira.solar_condition_events
Meaning:
- classical solar proximity condition for one non-luminary planet
- conditions are threshold bands around the Sun
- luminaries return absent truth for instant checks
- event search returns ingress/egress threshold crossings for one named band
Admitted solar condition bands:
cazimi:17 / 60degreescombust:8degreesunder_sunbeams:17degrees
Admitted instant fields:
bodyjd_utpresentconditionlabelscoredistance_from_sun
Admitted event fields:
- same fields as proximity events, with condition label and threshold policy preserved
2. Route Admission Boundary
P-GAP-04 admits a bounded synchronous REST family under two explicit prefixes:
/v1/phenomena/*/v1/solar-condition/*
Stage 1 routes are limited to:
POST /v1/phenomena/planetPOST /v1/phenomena/orbital-eventsPOST /v1/phenomena/proximityPOST /v1/solar-condition/instantPOST /v1/solar-condition/events
The split is intentional:
/v1/phenomena/planetis an instantaneous physical snapshot./v1/phenomena/orbital-eventsis a bounded event search over admitted event kinds./v1/phenomena/proximityis a generic threshold-crossing search./v1/solar-condition/*is classical solar-condition doctrine and should not be hidden inside a vague generic event label.
3. Body Admission
Planet phenomena snapshot:
- admit bodies supported by
planet_phenomena_at - reject empty body names
- reject unsupported body names through the engine/server validation path
Orbital event search:
greatest_eastern_elongationandgreatest_western_elongation: Mercury and Venus onlyperihelionandaphelion: major planets admitted by the live engine- reject Sun and Moon for perihelion/aphelion public transport
- reject small bodies unless a separate small-body orbital event standard is admitted
Proximity events:
- Stage 1 should admit major planetary bodies and luminaries supported by the
ordinary
planet_atpath - reject empty body names
- reject equal body pairs
- reject unsupported small-body/catalog identities
Solar condition:
- instant route accepts named bodies but returns absent truth for Sun and Moon, matching engine truth
- event route rejects Sun and Moon because solar-condition ingress/egress is not meaningful for luminaries
- event route admits non-luminary major planets supported by the live engine
4. Time And Search Bounds
Every Stage 1 request uses jd_ut, matching the engine entrypoints.
Transport must validate:
- all JD values are finite
jd_end >= jd_start- bounded event/proximity/search span
- positive finite
max_days, where exposed - positive finite proximity threshold
Initial public bounds:
- maximum orbital-event search span:
5000days - maximum proximity search span:
1200days - maximum solar-condition event search span:
1200days - proximity threshold range:
(0, 30]degrees
The span limits protect synchronous REST behavior. Larger ephemeris sweeps require a separate async or batch admission packet.
5. Event Taxonomy And Value Semantics
Transport must not return an unlabeled value field without a unit.
Generic orbital event values:
- greatest elongation:
value_unit = "degrees" - perihelion:
value_unit = "AU" - aphelion:
value_unit = "AU"
Proximity values:
threshold_degpreserves signed threshold truth from the engine eventthreshold_abs_degpreserves the caller's positive threshold magnitude- ingress/egress is explicit through
is_ingress
Solar condition:
- instant
distance_from_sunis in degrees - event threshold is in degrees
scoreis the engine's current classical dignity score contribution, not a recommendation or probability
6. Provenance Requirements
Every response must state:
source_module:moira.phenomenaengine_entrypointreader_ownertime_scale:UT_JDevent_taxonomystage_sequence
Planet snapshot provenance must state:
product_kind:instantaneous_planet_phenomena_snapshotsearch_performed:falsephase_photometry_source:moira.phase
Orbital event provenance must state:
product_kind:bounded_orbital_event_searchadmitted_event_kindsvalue_units_by_kindsearch_span_days
Proximity provenance must state:
product_kind:angular_proximity_threshold_crossingthreshold_unit:degreesevent_direction_model:ingress_when_separation_decreasingconjunction_search_owner:moira.phenomena
Solar condition provenance must state:
product_kind:classical_solar_condition_truththresholds_degluminary_policydignity_interpretation:not_returnedrecommendation_language:not_returned
7. Non-Goals
P-GAP-04 does not admit:
- catch-all
/v1/eventsroutes - arbitrary phenomenon names
- arbitrary predicates or scorers
- astrological recommendations
- dignity profile/network outputs
- aspect searches
- station searches
- lunar phase routes
- rise/set or heliacal visibility routes
- eclipse or occultation routes
- conjunction routes beyond proximity's internal ownership
- heliocentric conjunction routes
- dense ephemeris/event tables
- async jobs
- small-body proximity sweeps
- catalog-wide searches
- kernel path mutation
8. Verification Requirements
Before REST admission, tests must cover:
- planet phenomena instant route parity with
planet_phenomena_at - orbital event route parity with
Moira.phenomenaor direct admitted engine calls - proximity route parity with
proximity_events_in_range - solar-condition instant route parity with
solar_condition_at - solar-condition events route parity with
solar_condition_events_in_range - invalid event kind rejection
- unsupported greatest-elongation body rejection
- invalid solar condition rejection
- non-finite JD rejection
- reversed range rejection
- oversized range rejection
- non-positive threshold rejection
- equal proximity body rejection
- provenance truth for product kind, event taxonomy, thresholds, and non-recommendation boundary
- route registry audit confirming the admitted route set
9. Admission Decision
P-GAP-04 is admitted through:
POST /v1/phenomena/planetPOST /v1/phenomena/orbital-eventsPOST /v1/phenomena/proximityPOST /v1/solar-condition/instantPOST /v1/solar-condition/events
Reason:
- the engine surfaces already exist
- facade methods expose the key searches and instant solar-condition query
- the transport keeps instant phenomena, orbital events, proximity events, and solar-condition truth separate
- focused server tests cover adapter truth, validation rejection, provenance, and route method boundaries
The admitted status does not broaden the engine doctrine. Dense sweeps, small-body proximity searches, catch-all event routes, interpretive text, and recommendation language remain outside this standard.