Phase 3 — fixture and pipeline hygiene#10
Merged
Conversation
Closes C-2, L-1, L-2, L-3, L-5 from FINAL_CLEANUP.md. Verifies M-7 is already complete from Phase 2. - C-2 (pipeline/mod.rs): replace the four opaque FAR_FIELD_* ECI Cartesian constants in the far-field test fixture with a Keplerian derivation — iss_like_elements() + 50 km SMA offset + 0.2 rad mean anomaly offset. δa/a ≈ 7.4e-3 crosses the default roe_threshold of 5e-3, classifying the pair as FarField. δλ is deliberately excluded from dimensionless_norm per Koenig Sec. V, so a pure in-track offset would always classify as Proximity regardless of separation — the SMA bump is the lightest physical component that crosses the threshold. Mirrors the existing proximity_input() idiom. - L-1 (validation/trajectory.rs:249): pre-size eclipse_samples to chief_results.len() when earth_frame.is_some(); leave it as Vec::new() when eclipse validation is disabled so the disabled path stays zero-allocation. - L-2 (validation/trajectory.rs:1071): flip f64::from(u32::try_from(5 + j).unwrap()) to f64::from(5_u32 + u32::try_from(j).unwrap()) so the arithmetic stays in u32 rather than casting a usize sum. - L-3 (validation/statistics.rs): drop four narrative comments that restated what the code does — mechanical "compare candidates" at the binary search, a three-line test-value table, two "leg excluded" / "no input" test narrations. Keep the load-bearing comments (time- sorted input invariant, sum/sum-sq recovery math, +0.0 bit-pattern empty-input contract, all-zero summaries contract). - L-5 (validation/trajectory.rs:1833, 1945): normalize two #[ignore] strings from capital-R "Requires MetaAlmanac" to lowercase-r "requires MetaAlmanac" so all 25 MetaAlmanac ignore sites use the same canonical string. SPICE-kernel-specific strings in nyx_bridge/almanac.rs describe a different prerequisite and are intentionally left alone. - M-7: verified as already complete — Phase 2 named both 709.0 call sites as const MID_COAST_BURN_ELAPSED_S. Verification: 586 passed / 0 failed / 0 ignored across the workspace with --include-ignored (unchanged from Phase 2 baseline). Clippy, docs, and wasm-pack build all clean. rpo-cli mission/validate/mc JSON outputs are byte-identical to the pre-Phase-3 baseline (modulo non-deterministic elapsed_wall_s in MC).
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
Phase 3 of the
FINAL_CLEANUP.mdsweep. Closes C-2, L-1, L-2, L-3, L-5 and verifies M-7 is already complete from Phase 2. Pure hygiene — no algorithmic changes, no public API changes, no new tests.FAR_FIELD_*ECI Cartesian constants infar_field_input()with a Keplerian derivation (iss_like_elements()+ 50 km SMA offset + 0.2 rad mean-anomaly offset).δa/a ≈ 7.4e-3crosses the defaultroe_threshold = 5e-3, classifying the pair asFarField. Note: a pure in-track offset would always classify as Proximity becausedimensionless_normexcludes δλ per Koenig Sec. V — δa is the lightest physical component that crosses the threshold. Mirrors the existingproximity_input()idiom.eclipse_samplestochief_results.len()whenearth_frame.is_some(); leave asVec::new()when eclipse is disabled.f64::from(u32::try_from(5 + j).unwrap())tof64::from(5_u32 + u32::try_from(j).unwrap())so the arithmetic stays inu32.validation/statistics.rs(mechanical binary-search narration, test-value tables, test-case restatements). Keep load-bearing comments (time-sorted invariant, sum/sum-sq recovery math, +0.0 bit-pattern empty-input contract, all-zero summaries contract).#[ignore = "Requires MetaAlmanac …"]to lowercase-r so all 25 MetaAlmanac ignore sites use the canonical string.709.0call sites are named asconst MID_COAST_BURN_ELAPSED_S.Plan:
docs/superpowers/plans/2026-04-11-phase-3-fixture-and-pipeline-hygiene.md(untracked, not in this PR — matches Phase 1/2 convention).Test plan
cargo test --workspace -- --include-ignored— 586 passed / 0 failed / 0 ignored (unchanged from post-Phase-2 baseline)cargo clippy --workspace --all-targets -- -D warnings— cleancargo doc --workspace --no-deps— no missing-docs warningswasm-pack build rpo-wasm --target web— cleancargo run -p rpo-cli -- mission --input examples/mission.json --json— byte-identical to pre-Phase-3 baselinecargo run -p rpo-cli -- validate --input examples/validate.json --auto-drag --json— byte-identical to pre-Phase-3 baselinecargo run -p rpo-cli -- mc --input examples/mc.json --auto-drag --json— byte-identical moduloelapsed_wall_s(non-deterministic wall clock)FAR_FIELD_*Cartesian literals, zero raw709.0outside the named const, zero capital-R"Requires MetaAlmanac"hits