kriya-ephemeris-chart
v0.2.0
Published
Browser-shippable chart-assembly orchestration: sign/degree conversion, house-cusp body assignment, orb-resolved aspect detection, chart pattern (stellium/grand-trine/t-square/etc.) and shape (bundle/bowl/locomotive/etc.) detection, planet-pair aspect int
Readme
kriya-ephemeris-chart
Browser-shippable chart-assembly orchestration, factored out of the
Kriya astrology API engine. Peer-depends on kriya-ephemeris and
kriya-ephemeris-asteroids — this is the layer that turns their raw
math primitives (bare degree numbers, unassembled aspect lists) into
the fully-built, UI-ready chart response Netra's interface already
expects (bodies with sign/degree/house assigned, orb-resolved aspects,
pattern and shape detection, degree-property analysis).
Status
v0.1.0 — full parity with the engine's own natal-chart assembly
pipeline (lib/api/compute.ts + lib/ephemeris/patterns/ +
lib/readings/aspect-matrix.ts + lib/ephemeris/degrees/).
Why this exists
kriya-ephemeris ships raw primitives on purpose — geocentricEcliptic
returns a bare {longitudeDeg, latitudeDeg, distanceAU},
computeHouses returns bare cusp degrees, detectAspects needs orb
definitions handed to it. None of that is what a chart UI actually
renders. The engine's own /api/v1/chart/natal route does real
orchestration work — sign/degree conversion, house-cusp-to-body
assignment, orb resolution, pattern/shape detection, degree-property
analysis — before it ever reaches a response body. Netra's offline
program needs that same orchestration to run in the browser, not just
the raw math underneath it.
Surface
Single entry point (kriya-ephemeris-chart), re-exporting:
- Chart assembly —
computeNatalChart(bodies + houses + aspects- declination parallels, one call),
computePositions(bodies only, no houses — used by transit/progression-style snapshots),computeHousesOnly,computeAspectsOnly.
- declination parallels, one call),
- Pattern detection —
detectChartPatterns(stellium, grand trine, T-square, grand cross, yod, kite, mystic rectangle) +interpretPattern(plain-English readings for each).detectChartShape(Marc Edmund Jones' bundle/bowl/bucket/ locomotive/see-saw/splay/splash classification). - Aspect interpretation —
enrichNatalAspects/interpretAspect: a 225-combination planet × planet × aspect interpretation matrix (10 planets × 5 major aspects, hand-curated overrides for the most-asked-about pairs). - Degree analysis —
analyzeDegree: critical degrees (cardinal/ fixed/mutable), anaretic (29°), sign-boundary warnings, Via Combusta, exaltation/fall degrees, Vedic Gandanta zones. - Datetime parsing —
parseDatetimeToJDUT: ISO-8601-with-timezone string to Julian Day. Deliberate deviation from byte-identical porting (the only one in this package): the engine's ownlib/api/datetime.tsthrows its HTTP-coupledApiError(status code + error code) on bad input, which the engine's route middleware translates into a 400 response. That's meaningless outside an HTTP context, so this package's version throws a plainErrorwith the same message instead. The actual date-parsing and Julian-Day-conversion math is unchanged. Because of this intentional difference,lib/api/datetime.tswas not converted to a bridge — the engine keeps its own original implementation, unrelated to this package's copy.
Out of scope (server-only via the API)
- Everything in
lib/api/compute-extensions.tsandlib/api/compute-phase8b.ts(transit inter-aspects, progression/ return-moment search, composite midpoint assembly, synastry cross-aspects) — these build ON TOP of this package'scomputeNatalChart/computePositions, but their route-specific logic wasn't ported here. Some of it Netra already derives client-side (progression/return inter-aspects, per its ownlib/wheel/inter-aspects.ts); the rest is a case-by-case call for whoever wires up each chart type's offline path.
Engine integration
The engine consumes this package in place of the code that used to
live in lib/api/compute.ts, lib/ephemeris/patterns/{detect,shapes,
interpret}.ts, lib/readings/aspect-matrix.ts, and
lib/ephemeris/degrees/critical-degrees.ts. Bridge files at those
paths re-export the package surface with exact named re-exports (not
export *) — compute.ts alone has 30+ direct importers across the
route surface (KP, Vedic, mundane, ingress, transit-scan, and more)
that expect exactly its original export set. lib/api/datetime.ts is
the one exception — see above.
Parity guarantee
Every export of this package produces byte-identical output to the
engine's pre-carve-out implementation (except the intentional
datetime error-handling difference noted above) — logic is unchanged
arithmetic with only import paths repointed. Parity is locked in by
the engine's full test suite (including lib/ephemeris/__tests__/
golden-chart.test.ts's exact-value assertions), which passes
unchanged against the bridges, plus a standalone registry-style smoke
test computing a real chart (Sun at Capricorn 10.37°, matching the
known J2000.0 Sun longitude of 280.37°) with all three published
packages installed from npm, no workspace symlinks.
