import { readFileSync } from "node:fs"; import { birthSkyFromEngine, type BirthSkyOk, type BirthSkyPhase } from "../src/lib/birth-sky/contract.ts"; /** Real engine responses (scripts/generate_birth_sky_golden.py), fictional sample birth. */ export const birthSkyGolden = JSON.parse( readFileSync(new URL("./fixtures/birth-sky-golden.json", import.meta.url), "utf8"), ) as { times: Record; responses: Record> }; export function goldenSky(phase: BirthSkyPhase, timeBasis: BirthSkyOk["timeBasis"] = "reported"): BirthSkyOk { const sky = birthSkyFromEngine(birthSkyGolden.responses[phase], timeBasis); if (!sky) throw new Error(`golden ${phase} does not satisfy the contract`); return sky; }