1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Canonical pipeline stage ordering shared by every JEOD adapter.
//!
//! Adapters that schedule per-stage system calls (the Bevy plugin, the
//! standalone runner, batch tools) all consult [`PIPELINE_ORDER`] for the
//! authoritative sequence so the order cannot drift between adapters.
/// Pipeline stages mirroring JEOD's init/update ordering.
///
/// JEOD's simulation loop runs these stages in strict order every timestep.
/// ECS adapters must schedule their systems to respect this ordering.
/// The `astrodyn_runner::Simulation` struct runs them internally in `step()`.
///
/// Ordering dependencies:
/// - **Time** must be current before frame transforms (GMST, TT for RNP).
/// - **Ephemeris** (planet rotations) must be current before spherical-harmonic gravity.
/// - **Gravity gradient** must be available before gravity torque.
/// - **All forces** must be collected before integration.
/// - **Gravity** is precomputed in Environment but recomputed per RK4 stage during Integration.
// JEOD_INV: DM.04 — system ordering mirrors JEOD init/update pipeline
// JEOD_INV: DM.13 — ephemeris updated before gravity
/// Canonical pipeline execution order.
pub const PIPELINE_ORDER: & = &;