Packages1 MIN READ83 / 116

Internal module guide. This module is now part of @astrology/vedic; use the public package README for application setup.

contracts module

Shared Vedic identities, result envelopes, feature contract and upstream ports. Public imports use the package root. See the package specification and task plan (V-16).

Run pnpm --filter @astrology/vedic build, check, and test after building dependencies (pnpm build:vedic builds all).

Contract

The root exports types plus one runtime value, VedicError, a side-effect-free error class so every Vedic package fails with the same code (LAYER_UNSUPPORTED, FACTOR_UNAVAILABLE, REFERENCE_VERSION_MISMATCH, …) and structured detail such as { gate, owner }.

VedicFeature is the registration shape every calculator returns from create*Feature(rules): layer id, the admitted rule family and its hash, requirements (snapshot need, required and optional upstream gates, required and optional dependency layers), a profile-only inspect, and an always asynchronous evaluate. FeatureRequest/FeatureResult infer types from a registered feature, so the engine needs no import of calculator DTOs.

upstream.ts declares the ports for astronomy the engine cannot get from Composer today: RiseSetPort (B-01 → C-05), DeclinationPort and MeanLongitudePort: rising and setting times, declination (angle north or south of the celestial equator) and mean longitude. Declaring them here lets a host connect them later without changing any calculator.