Task 220: Analysis Reproduction Test Framework
完了 ← タスク一覧
Task 220: Analysis Reproduction Test Framework
Status: DONE
Human directive: Phase 21 addendum, item 26
Problem
Per-episode analysis reproduction commands exist (npm run recalculate) but ship parameters were duplicated across 5 episode analysis files, 2 report modules, and 1 relativistic analysis module. Shared parameter extraction was needed for maintainability and consistency.
What Was Already Done (pre-existing)
npm run test:analyses— 96 golden-file tests pinning all analysis outputs (Task 133)npm run recalculate— per-episode analysis pipeline with--episode Nfiltering- CI integration —
npm testalready runs all*.test.tsincluding analysis reproduction tests analysis-reproduction.test.ts— comprehensive per-transfer test coverage for all 5 episodes
What This Task Added
Shared ship constants module (kestrel.ts)
- Created
ts/src/kestrel.tsas single source of truth for KESTREL ship parameters - Core params: massKg, thrustN, peakThrustN, damagedThrustN, ispS, lengthM, engine, fuel
- Derived constants: EXHAUST_VELOCITY_KMS, THRUST_MN, NOMINAL_MASS_T, AU_KM
- All 5 episode analysis files now import from
kestrel.tsinstead of defining their own cross-episode-analysis.tsSHIP_SPECS derived from shared KESTRELship-kestrel-analysis.tsKESTREL_SPECS derived from shared KESTRELrelativistic-analysis.tsuses shared ISP, thrust, and AU constants
Consistency tests (kestrel.test.ts)
- 10 tests verifying shared constants match expected values
- Cross-module consistency: all 5 episode exports match the shared base
- Report module consistency: SHIP_SPECS and KESTREL_SPECS derive from KESTREL
- Damaged thrust = 65% of normal thrust validation
Files Changed
ts/src/kestrel.ts— new shared constants modulets/src/kestrel.test.ts— new consistency tests (10 tests)ts/src/ep01-analysis.ts— import KESTREL_BASE from kestrel.ts, extend with cargoKgts/src/ep02-analysis.ts— re-export KESTREL from kestrel.tsts/src/ep03-analysis.ts— re-export KESTREL from kestrel.tsts/src/ep04-analysis.ts— re-export KESTREL from kestrel.tsts/src/ep05-analysis.ts— re-export KESTREL from kestrel.tsts/src/cross-episode-analysis.ts— derive SHIP_SPECS from shared KESTRELts/src/ship-kestrel-analysis.ts— derive KESTREL_SPECS from shared KESTRELts/src/relativistic-analysis.ts— import from shared module
Test Results
- 1810 TS tests pass (1800 existing + 10 new)
- 96 analysis reproduction tests unchanged and passing
- TypeScript typecheck clean
- Recalculate pipeline verified (dry-run)