@zodiacs/engine 0.1.1-rc.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,785 @@
1
+ # @zodiacs/engine
2
+
3
+ Pure TypeScript astrology calculations for browsers and Node.js. The package
4
+ computes tropical planetary positions, natal charts, transit snapshots,
5
+ synastry, secondary progressions, Moon phase, and Saturn-return seasons. It is
6
+ synchronous and ESM-only, has no import-time side effects, and performs no network request from
7
+ its core entry point. Its one runtime side effect is the ΔT it installs in
8
+ astronomy-engine (see ΔT below).
9
+
10
+ **Release candidate: 0.1.1-rc.14.** Public npm lookups for this package returned
11
+ 404 on 2026-09-26. The expansion release remains held for review and operator
12
+ publication authority. Install the exact candidate tarball supplied with the
13
+ review, retaining its SHA-256 receipt:
14
+
15
+ ```sh
16
+ pnpm add ./zodiacs-engine-0.1.1-rc.14.tgz
17
+ ```
18
+
19
+ The package runs in browsers through a bundler, and in Node.js 20.19.0 or a
20
+ later 20.x, or 22.7.0 or later (`"engines": { "node": "^20.19.0 || >=22.7.0" }`).
21
+ Its dependency, astronomy-engine 2.1.19, ships ES modules in a package that does
22
+ not declare `"type": "module"`. Earlier Node versions load that file as
23
+ CommonJS, so a plain Node import of this package fails there with "Named export
24
+ 'Body' not found"; it did on 18.20.8, 20.18.3, 21.7.3 and 22.6.0. Node 22.7.0
25
+ loads it with a harmless `MODULE_TYPELESS_PACKAGE_JSON` warning, which 22.22.2
26
+ no longer prints. Bundlers resolve the dependency's `import` condition
27
+ themselves and are not affected.
28
+
29
+ From a source checkout, run `npm ci` and `npm run build`, then
30
+ `npm pack --ignore-scripts`. Test the packed file in a clean consumer using
31
+ `npm run consumer:smoke -- /absolute/path/to/zodiacs-engine-0.1.1-rc.14.tgz`.
32
+ The smoke check
33
+ downloads the artifact's public dependencies and TypeScript 5.9.3; its output
34
+ records the artifact hash and runtime, and it removes its temporary consumer
35
+ directory, which must have no `node_modules` above it (set `TMPDIR` if
36
+ needed). A packed candidate is not a published release.
37
+
38
+ `artifacts/archives.json` records every carried archive: its digest, size, file
39
+ count and the commit it was packed from. On the history it is given, CI checks
40
+ from git objects alone, never the working tree, that in every commit:
41
+ `artifacts/`, where present, is a real directory holding only archives,
42
+ receipts, the manifest and its README, as regular files, and no two of its
43
+ names, nor another top-level name and `artifacts`, differ only in case; each
44
+ archive and receipt holds only its recorded bytes, the one exception, pinned in
45
+ the check, being rc.11's first packing in commit `00bdae7`; and the manifest
46
+ only ever gains entries. Every recorded version, and `package.json`'s at HEAD,
47
+ must be a strict semantic version, with no `v` prefix and no build metadata,
48
+ and no two carried versions may be equal as npm compares them. It also checks
49
+ that nothing committed under `artifacts/` has been removed; that each archive's
50
+ packed `package.json`, README, CHANGELOG and licence files match its source
51
+ commit's byte for byte, and that it was committed by that commit or a child of
52
+ it; and, once the current version's archive is carried, that a clean worktree
53
+ of HEAD rebuilds it byte for byte (`--rebuild-all` also rebuilds every archive
54
+ from its source commit). Each rebuild installs that commit's locked
55
+ dependencies afresh with `npm ci` and takes nothing from the checkout's
56
+ `node_modules`. It cannot detect history rewritten before CI sees it, and it
57
+ needs merge commits: a squash or rebase merge drops the source commits it
58
+ checks against, and the check then fails.
59
+
60
+ This candidate declares the Node versions that can load its dependency and the
61
+ licence of its ΔT values, refuses instants outside the years astronomy-engine
62
+ tabulates (`EPHEMERIS_SPAN`), reports each declination row's signed margin to
63
+ the out-of-bounds limit, restates the Sun's exemption from that limit as a
64
+ convention, and reduces declination-aspect longitude separations exactly.
65
+ Configured-aspect and declination-parallel decisions stay exact on binary64
66
+ inputs (rc.13).
67
+ Secondary progressions (rc.12) and configurable longitude aspects and chart
68
+ declinations (rc.11) remain separate analyses. Existing natal, transit,
69
+ synastry and receipt conventions remain unchanged. The ephemeris is still
70
+ astronomy-engine 2.1.19. See CHANGELOG.md for the release history and
71
+ `docs/evidence/rc14-20260928/` for this continuation's checks and remaining
72
+ programme gates. Site adoption is reviewed separately.
73
+
74
+ ## Natal chart in 10 lines
75
+
76
+ ```ts
77
+ import { natalChart } from "@zodiacs/engine";
78
+
79
+ const chart = natalChart({
80
+ utc: "1990-06-15T12:30:00Z",
81
+ latitude: 40.7128,
82
+ longitude: -74.006,
83
+ houseSystem: "whole"
84
+ });
85
+
86
+ console.log(chart.bodies, chart.houses);
87
+ ```
88
+
89
+ `utc` must be a resolved instant. If a user enters a local wall time, use the
90
+ optional geo entry point so daylight-saving and historical timezone rules are
91
+ handled before the chart is computed:
92
+
93
+ ```ts
94
+ import { natalChart } from "@zodiacs/engine";
95
+ import { resolveBirth } from "@zodiacs/engine/geo";
96
+
97
+ const birth = resolveBirth({
98
+ date: "1990-06-15",
99
+ time: "08:30",
100
+ timeZone: "America/New_York",
101
+ latitude: 40.7128,
102
+ longitude: -74.006,
103
+ houseSystem: "placidus"
104
+ });
105
+
106
+ const chart = natalChart(birth);
107
+ ```
108
+
109
+ ## Compatibility
110
+
111
+ ```ts
112
+ import { natalChart, synastry } from "@zodiacs/engine";
113
+
114
+ const a = natalChart({ utc: "1990-06-15T12:30:00Z" });
115
+ const b = natalChart({ utc: "1992-11-03T07:15:00Z" });
116
+ const compatibility = synastry(a, b);
117
+
118
+ console.log(compatibility.top);
119
+ console.log(compatibility.elements);
120
+ ```
121
+
122
+ ## Daily transits
123
+
124
+ ```ts
125
+ import { natalChart, transits } from "@zodiacs/engine";
126
+
127
+ const natal = natalChart({ utc: "1990-06-15T12:30:00Z" });
128
+ const today = transits(natal, new Date());
129
+
130
+ for (const aspect of today.aspects) {
131
+ console.log(aspect.a, aspect.type, aspect.b, aspect.orb);
132
+ }
133
+ ```
134
+
135
+ ## API
136
+
137
+ - `positions(date)` returns the Sun, Moon, eight planets, and true Moon nodes.
138
+ - `natalChart(birth)` adds natal aspects and, when coordinates are present,
139
+ angles and houses in any of thirteen systems (see *House systems*).
140
+ - `chartPoints(natal)` returns the mean node, Black Moon Lilith and, with a
141
+ birth time and place, the Vertex, the East Point, the chart's sect and seven
142
+ lots (see *Points*).
143
+ - `findConfiguredAspects(bodies, policy)` calculates aspects under an explicit
144
+ policy from `createAspectPolicy`, including minor and custom angles.
145
+ - `chartDeclinations(natal)` derives right ascension, declination, parallel
146
+ aspects and out-of-bounds flags on the chart's clock.
147
+ - `progressedInstant(birthUtc, target)` maps each elapsed tropical year of
148
+ life to one day after birth.
149
+ - `progressedBodies(birthUtc, target)` returns the twelve ordinary position
150
+ rows at that instant (see *Secondary progressions*).
151
+ - `transits(natal, date)` returns a sky snapshot and moving-to-natal aspects.
152
+ - `synastry(a, b)` returns inter-chart aspects and element/modality balances.
153
+ - `moonPhase(date)` returns elongation, illuminated fraction, and phase name.
154
+ - `saturnReturn(birth)` returns exact-pass seasons through roughly age 92.
155
+ - `findLongitudeCrossings(body, longitude, from, to)` returns the instants a
156
+ body crosses a longitude, and `searchLongitudeCrossings` does the same under
157
+ a sample budget. `@zodiacs/engine/crossings` provides the same solver for a
158
+ longitude function of your own, without the ephemeris.
159
+ - `@zodiacs/engine/geo` provides IANA local-time resolution and a client for a
160
+ separately hosted, sharded GeoNames index.
161
+
162
+ Returned longitudes use degrees in `[0, 360)` and positions include sign and degree
163
+ annotations. Charts use the tropical ecliptic of date. Planetary positions are
164
+ geocentric and corrected for light time and aberration, but not for the Sun's
165
+ gravitational deflection; the Moon's series carries neither correction. This
166
+ package does not calculate topocentric parallax.
167
+
168
+ Positions have been compared with an independent ephemeris from 1800-01-01T00:00Z
169
+ up to 2200-01-01T00:00Z, exported as `REFERENCE_SPAN`. A chart outside that span
170
+ is still computed, and carries the `outside-reference-span` flag. No instant
171
+ outside `EPHEMERIS_SPAN`, the years 1 to 3998 that astronomy-engine tabulates,
172
+ is computed at all (see *Resolved instant inputs*).
173
+
174
+ ### Secondary progressions
175
+
176
+ ```ts
177
+ import {
178
+ progressedInstant, progressedBodies, PROGRESSION_DAYS_PER_YEAR
179
+ } from "@zodiacs/engine";
180
+
181
+ const birthUtc = "1990-06-15T12:30:00Z";
182
+ const target = "2026-09-28T00:00:00Z";
183
+ console.log(progressedInstant(birthUtc, target));
184
+ console.log(progressedBodies(birthUtc, target));
185
+ ```
186
+
187
+ The fixed convention is one **365.2422-day tropical year of elapsed life**
188
+ for one **86,400,000-millisecond day** after birth. `PROGRESSION_DAYS_PER_YEAR`
189
+ exports that constant. Both are counted in UTC milliseconds as JavaScript
190
+ `Date` counts them, 86,400,000 to the day with no leap seconds; they are not
191
+ ephemeris (TT) days. This uses elapsed instants, not calendar anniversaries,
192
+ local-time days or daylight-saving adjustments. Both arguments accept a valid
193
+ `Date`, finite epoch-millisecond timestamp, or ISO calendar date/date-time.
194
+ Date-only strings mean UTC midnight; date-times require an explicit offset.
195
+ Invalid dates and ambiguous local date-times throw `RangeError`. Resolve local
196
+ birth times with the optional geo entry first.
197
+
198
+ Targets before birth are accepted and map backwards with the same signed
199
+ formula. That signed extension is not a converse progression, which takes a
200
+ target after birth to an instant before it; no converse technique is offered.
201
+ Results preserve the site's existing floating-point operation order
202
+ and JavaScript `Date` truncation to integer milliseconds. Neither argument is
203
+ mutated, and the returned Date and position rows are newly allocated.
204
+
205
+ `progressedBodies` returns precisely `positions(progressedInstant(...))`:
206
+ Sun, Moon, eight planets and the true north/south lunar nodes. **Speed is the
207
+ ephemeris longitude rate at the progressed instant, in degrees per day**: a
208
+ central difference over ±0.001 day (±86.4 s), and over ±0.25 day for the true
209
+ nodes, as in every position row. One progressed day stands for one tropical
210
+ year of life, so the same number is the progressed motion in degrees per
211
+ 365.2422-day year of elapsed life. It is not a rate per lived day. No
212
+ progressed angles, houses, extra chart points, solar-arc direction,
213
+ progressed aspect policy or natal-receipt extension is implied.
214
+
215
+ Positions retain the existing ephemeris and its accuracy limits. Reference
216
+ coverage applies to the **progressed instant**, not to the target age or date;
217
+ call `outsideReferenceSpan(progressedInstant(...))` to check it. These APIs
218
+ return an instant or rows, without chart coverage flags. Acceptance of a valid
219
+ Date does not establish physical accuracy for that date. Validation includes a
220
+ constructed mapping to the existing JPL longitude fixture and a rounded
221
+ published date-mapping example; neither establishes predictive validity.
222
+ The year convention and published mapping are cited to Juan Estadella,
223
+ [*Predictive Astrology*, 3rd ed., pp. 84–85](https://juanestadella.com/Predictive_Astrology_Juan-Estadella_3rd_edition.pdf)
224
+ (PDF SHA-256 `bf52656b367ad7d1415a7b021a0a0db3a609bf35c7a40053ff0622e7a3325622`).
225
+ The book's own rounding allows up to 4.73 s, hence the 5 s comparison; from the
226
+ 19.677 h birth time it actually used, the mapping lands within 50 ms of its
227
+ unrounded result. See `docs/evidence/rc12-20260928/sources.md`.
228
+
229
+ ### Configurable aspects
230
+
231
+ ```ts
232
+ import { createAspectPolicy, findConfiguredAspects } from "@zodiacs/engine";
233
+
234
+ const policy = createAspectPolicy({
235
+ aspects: [
236
+ { type: "conjunction", orb: 8, luminaryOrb: 10 },
237
+ { type: "quincunx", orb: { applying: 2, separating: 1, stationary: 0.5 } },
238
+ { type: "quintile", orb: 1 }
239
+ ],
240
+ bodyOrbs: { Moon: 5, Pluto: 1 }
241
+ });
242
+ const analysis = findConfiguredAspects(chart.bodies, policy);
243
+ console.log(analysis.policy, analysis.aspects);
244
+ ```
245
+
246
+ `createAspectPolicy()` returns an immutable snapshot of the five existing
247
+ major-aspect defaults. `CONFIGURED_ASPECT_ANGLES` also names semisextile (30°),
248
+ semisquare (45°), quintile (72°), sesquiquadrate (135°), biquintile (144°) and
249
+ quincunx (150°). Choose their orbs explicitly; custom identifiers require an
250
+ explicit angle. Named angles cannot be redefined.
251
+
252
+ For each pair, the rule's orb applies, replaced by its `luminaryOrb` when
253
+ either body is Sun or Moon. Each selected body's `bodyOrbs` value is an upper
254
+ bound: the smallest of the rule allowance and both body caps wins. A number
255
+ sets all three motion limits; an object sets each separately. Boundaries are
256
+ inclusive. The closest eligible aspect wins, with definition order breaking
257
+ ties. Results sort by exact orb, then input-pair order.
258
+
259
+ `bodies` explicitly selects identifiers; it defaults to Sun, Moon and the
260
+ eight planets. Nodes or other points require selection. Labels, here and in
261
+ the declination analysis, are exact and case-sensitive strings of 1 to 80
262
+ UTF-16 code units (a character outside the Basic Multilingual Plane counts
263
+ two). `String.prototype.trim` must leave a label unchanged, which rules out
264
+ leading or trailing whitespace, including U+3000 and U+FEFF, and a label may
265
+ not contain a C0 control character (U+0000–U+001F) or DEL (U+007F). C1
266
+ controls (U+0080–U+009F), zero-width characters such as U+200B, and lone
267
+ surrogates are not rejected. Other labels throw `RangeError`.
268
+ Positions require finite longitude in `[0,360)` and a finite longitude speed
269
+ in degrees/day
270
+ on the same time basis. Missing or null speed is rejected, including on
271
+ unselected rows. A point whose speed is unknown must not be assigned zero to
272
+ make it pass. Equal speeds, or relative speed below the policy threshold,
273
+ are stationary; an exact moving aspect is separating. The one-sided motion
274
+ at coincident and antipodal longitudes is defined in the returned policy.
275
+
276
+ Policies and results are deeply frozen. Pass the factory's policy object to
277
+ `findConfiguredAspects`; a JSON-deserialized copy must have its input fields
278
+ revalidated through the factory. Its schema and conventions describe the
279
+ calculation; they are not an authenticated receipt. This analysis does not
280
+ replace `chart.aspects`, or configure `synastry` or `transits`.
281
+
282
+ #### Exact binary arithmetic
283
+
284
+ Every longitude, speed, angle, orb and threshold is taken as the exact value
285
+ of its binary64 double. The signed separation a − b is formed exactly, as an
286
+ unrounded sum of doubles, and folded into (−180°, 180°] by exactly 360°. The
287
+ orb |separation − angle|, its inclusive comparison with the limit, the choice
288
+ of the closest rule, the order of results, and the motion (the signs of the
289
+ separation, of the deviation from the angle and of the relative speed, and the
290
+ stationary threshold) are all decided on those exact values. There is no
291
+ epsilon or widened tolerance. Only the reported `orb` is rounded, once, to the
292
+ nearest double with ties to even, so a reported orb never exceeds its
293
+ `maximumOrb`. The policy records this as
294
+ `conventions.arithmetic: "exact-binary64;reported-orb-rounded-half-even"`.
295
+
296
+ Binary values are not decimals. At the default 7° square, 97.00000000000001
297
+ is not rounded into eligibility. 188.86 − 98.86 is exactly 90 + 2⁻⁴⁶, so a
298
+ zero-orb square does not match; 7.6999999999999895 and 359.7 are 8 + 2⁻⁵⁰
299
+ apart, just outside the default 8° conjunction. 6.3 and 314 are exactly 45°
300
+ plus the double 7.3 apart (6.3 carries 7.3's binary error), so a 7.3°
301
+ semisquare orb includes them. Where a decimal boundary matters, use values
302
+ that are exact in binary or allow for the difference in the orb.
303
+
304
+ The historical helper behind `chart.aspects`, `transits`, `synastry` and the
305
+ natal receipt keeps its floating-point arithmetic, so its orbs and its
306
+ boundary decisions can differ from the configured API's at roundoff scale.
307
+
308
+ ### Declinations and parallels
309
+
310
+ ```ts
311
+ import { chartDeclinations, findDeclinationAspects } from "@zodiacs/engine";
312
+
313
+ const equatorial = chartDeclinations(chart);
314
+ console.log(equatorial.utc, equatorial.deltaT, equatorial.trueObliquity);
315
+ console.log(equatorial.rows); // lon, lat, ra, dec, outOfBounds, boundMarginArcsec
316
+ const tightParallels = findDeclinationAspects(
317
+ chart.bodies, equatorial.trueObliquity, { orb: 0.5, luminaryOrb: 1 }
318
+ );
319
+ ```
320
+
321
+ `chartDeclinations` accepts a birth input or an existing chart. It rotates
322
+ the full ecliptic longitude **and latitude** into the true equator and equinox
323
+ of date, using the chart instant and the same pinned or model ΔT. Right
324
+ ascension is in **degrees**, not hours, and is `null` where the horizontal
325
+ unit-vector magnitude is no greater than `RA_POLE_TOLERANCE`; `raDefined`
326
+ then is false. Declination is north-positive in `[-90,90]`.
327
+
328
+ Out-of-bounds means strictly `abs(dec) > trueObliquity`, without an
329
+ uncertainty allowance. Each row also carries `boundMarginArcsec`, the signed
330
+ margin `(abs(dec) − trueObliquity) × 3600`: positive beyond the bound, negative
331
+ inside it. For every row but the exempt Sun below, `outOfBounds` is exactly
332
+ `boundMarginArcsec > 0`. In `chartDeclinations`, `trueObliquity` is
333
+ astronomy-engine's true obliquity of date at the chart instant on the chart's
334
+ clock: the IAU 2006 mean obliquity plus astronomy-engine's five-term truncation
335
+ of the IAU 2000B nutation in obliquity. That is not the full IAU 2000B value:
336
+ it differed from ERFA's `obl06` plus `nut00b` by up to 0.086″ at 20,000
337
+ instants from 1850 to 2150. The pure functions use the obliquity they are given.
338
+
339
+ The flag describes the ephemeris's position, and it agrees with the real sky
340
+ only where the margin exceeds the ephemeris's error in declination. Against
341
+ JPL's DE440s at those 20,000 instants, the largest declination errors were:
342
+
343
+ | Body | Largest error | Body | Largest error |
344
+ | --- | ---: | --- | ---: |
345
+ | Sun | 2.7″ | Jupiter | 16.1″ |
346
+ | Moon | 3.4″ | Saturn | 21.6″ |
347
+ | Mercury | 12.2″ | Uranus | 19.3″ |
348
+ | Venus | 14.7″ | Neptune | 15.4″ |
349
+ | Mars | 14.5″ | Pluto | 4.6″ |
350
+
351
+ These are sample maxima, not bounds, and they grow outside `REFERENCE_SPAN`.
352
+ Within them the flag can be wrong either way: at 2022-10-22T08:11:10.756Z the
353
+ engine puts Mars 1.57″ inside the bound, where DE440s has it 1.05″ beyond.
354
+ Treat a flag as settled only when `abs(boundMarginArcsec)` exceeds the body's
355
+ figure.
356
+
357
+ The Sun's exemption is a convention. At a solstice the size of the Sun's
358
+ declination differs from the true obliquity by exactly its ecliptic latitude,
359
+ which stays within about 1.2″ of zero: computed with ERFA (IAU 2006/2000A), the
360
+ real Sun is beyond the bound at 402 of the 800 solstices from 1800 to 2199, by
361
+ up to 1.09″. The engine's solar declination is off by more than that, up to
362
+ 2.7″ in the comparison above, and its solar latitude drifts from −1.1″ on
363
+ average in the 1800s to +1.1″ in the 2100s, so its margin at a solstice has the
364
+ real sign at only 404 of those 800. Far from J2000 the drift grows to tens of
365
+ arcseconds, −68.3″ at the June solstice of year 2 and +25.8″ at that of 3902,
366
+ while the real Sun's latitude stays within about 1.2″. So `chartDeclinations`
367
+ never flags the chart's own Sun as out of bounds, at any latitude; its margin
368
+ is still reported, and says nothing about the real Sun. (It is the Sun of the
369
+ chart given, which is not recomputed.) `declinationsForBodies` exempts a
370
+ supplied row labelled exactly `Sun` only while its ecliptic latitude is within
371
+ `SUN_BOUND_LATITUDE` (0.001°, 3.6″); a `Sun` row with a larger latitude, such
372
+ as a synthetic input, and every other row keep the strict rule.
373
+
374
+ Every supplied body is eligible, including nodes; filter the input for a
375
+ smaller set. Parallel/contraparallel matches choose the smaller of
376
+ `abs(decA-decB)` and `abs(decA+decB)`, with parallel winning an exact tie.
377
+ Orbs are inclusive, defaulting to 1° or 1.5° when Sun or Moon is involved.
378
+ As with configured aspects, each declination double is taken as exact: the
379
+ choice, the inclusive orb test and the order are decided without rounding, and
380
+ only the reported `orb` is rounded, once. The longitude `separation` is the
381
+ short way round between the two supplied longitudes, reduced exactly modulo
382
+ 360 whatever their size, and rounded once: −0.1 and 0.2 are
383
+ 0.30000000000000004 apart, the exact sum of the doubles 0.1 and 0.2, rounded.
384
+ 13.3 and 12.3 are exactly 1° apart and match at orb 1; 8.3 and 7.3
385
+ (1 + 2⁻⁵⁰ apart), and 1.1 and 0.1 (1 + 3·2⁻⁵⁵), do not. Body labels follow
386
+ the configured-aspect rule. `eclipticToEquatorial` and `declinationsForBodies`
387
+ expose the same geometry with an explicitly supplied obliquity.
388
+
389
+ These are derived coordinates of the existing ephemeris, with its existing
390
+ corrections and limits. They do not establish the programme's 0.01″ physical
391
+ declination target against Swiss Ephemeris. The current natal receipt does
392
+ not include this analysis; the result states that scope explicitly.
393
+
394
+ ### House systems
395
+
396
+ `houseSystem` takes one of thirteen systems. Each is the definition Swiss
397
+ Ephemeris uses, and every one agrees with Swiss's `swe_houses_armc` to within
398
+ 0.0001″ given the same sidereal time, latitude and obliquity (Placidus, which
399
+ iterates, to 0.01″).
400
+
401
+ | `houseSystem` | System | Cusps |
402
+ | --- | --- | --- |
403
+ | `"whole"` | Whole sign | Each sign is a house, the first the ascendant's. The default. |
404
+ | `"placidus"` | Placidus | Semi-arcs of each degree in thirds. |
405
+ | `"koch"` | Koch | Ascendants at thirds of the midheaven degree's semi-arc. |
406
+ | `"porphyry"` | Porphyry | Each quadrant between the angles in three equal arcs of longitude. |
407
+ | `"regiomontanus"` | Regiomontanus | Circles through the horizon's north and south points, every 30° of the equator. |
408
+ | `"campanus"` | Campanus | The same circles, every 30° of the prime vertical. |
409
+ | `"topocentric"` | Topocentric (Polich–Page) | Regiomontanus's ascensions, with pole heights at a third and two thirds of the latitude's tangent. |
410
+ | `"alcabitius"` | Alcabitius | The ascendant's semi-arcs in thirds on the equator, along hour circles. |
411
+ | `"equal"` | Equal | 30° each from the ascendant. |
412
+ | `"equal-mc"` | Equal from the midheaven | 30° each, the 10th from the midheaven; the same at every latitude. |
413
+ | `"vehlow"` | Vehlow | 30° each, with the ascendant in the middle of the first. |
414
+ | `"meridian"` | Meridian (axial rotation) | Right ascensions every 30° from the midheaven's; the 1st cusp is the equatorial ascendant. |
415
+ | `"morinus"` | Morinus | The equator every 30° from the midheaven's right ascension, carried to the ecliptic through its poles. |
416
+
417
+ Placidus and Koch are undefined in polar regions, where |latitude| ≥ 90° − ε,
418
+ with ε the true obliquity of date (about 66.56° today). There the engine falls
419
+ back to whole-sign houses, exported as `POLAR_FALLBACK` (and, as before,
420
+ `PLACIDUS_POLAR_FALLBACK`), and adds `polar-fallback` to the chart flags. Swiss
421
+ Ephemeris falls back to Porphyry instead. Every other system is defined at
422
+ every latitude where the angles are. Inside the polar circle, where the
423
+ ascendant is taken on the eastern half of the horizon, Regiomontanus, Campanus
424
+ and Topocentric cusps turn with it, so their 10th cusp is then the lower
425
+ meridian, as in Swiss Ephemeris. When the birth time is unknown, pass a
426
+ conventional UTC instant with `timeKnown: false`; angles and houses remain
427
+ absent and the chart carries the `no-time` flag.
428
+
429
+ ### Points
430
+
431
+ `chartPoints(natal)` takes a birth or a chart and returns `{ sect, points }`.
432
+ Each point has a longitude, a latitude, a sign and a degree, like a body.
433
+
434
+ | Point | Definition |
435
+ | --- | --- |
436
+ | Mean Node, Mean South Node | The Moon's mean ascending node Ω, and its opposite. |
437
+ | Black Moon Lilith | The mean lunar apogee: the point of the mean orbit 180° from the mean perigee, with the orbit's latitude. |
438
+ | Vertex | Where the prime vertical meets the ecliptic in the west. |
439
+ | East Point | The equatorial ascendant: the ecliptic point at right ascension RAMC + 90°. |
440
+ | Lots of Fortune, Spirit, Eros, Necessity, Courage, Victory and Nemesis | Paulus Alexandrinus's seven lots, reversed by night. |
441
+
442
+ The mean node and Black Moon Lilith come from the Moon's mean elements: the
443
+ IERS Conventions' fundamental arguments (Simon et al. 1994), with a mean
444
+ inclination of 5.1453964°. The nutation in longitude puts them on the true
445
+ equinox of date, like every other longitude here. They are within 0.7″ of Swiss
446
+ Ephemeris's `SE_MEAN_NODE` and `SE_MEAN_APOG` from 1800 to 2199. Both carry a
447
+ speed in degrees per day.
448
+
449
+ Every chart gets those three. The Vertex, the East Point, the sect and the
450
+ lots need a birth time and place.
451
+
452
+ - The Vertex and the East Point come from the instant and the place, not from a
453
+ supplied chart's angles. Given Swiss's sidereal time, latitude and obliquity,
454
+ they agree with its `swe_houses_armc` to within 0.00001″.
455
+ - The sect is day when the Sun is between the descendant and the ascendant
456
+ through the midheaven.
457
+ - The lots use the chart's own ascendant and bodies. Each is the ascendant plus
458
+ the arc between two points, taken as Paulus gives it by day and reversed by
459
+ night. Ptolemy's Fortune, which does not reverse, is `asc + moon − sun`.
460
+
461
+ `antiscion`, `contraAntiscion` and `midpoint` work on any two longitudes.
462
+ `meanNodeLongitude`, `meanApogee`, `lunarMeanArguments`, `hellenisticLots` and
463
+ `sectOf` expose the calculations underneath. The osculating ("true") Lilith is
464
+ not offered: from astronomy-engine's lunar series it would be several
465
+ arcminutes from Swiss's.
466
+
467
+ ### Input flag compatibility
468
+
469
+ Public birth inputs accept all six `ChartFlag` values. Supply an array with at
470
+ most 64 entries; entries must be known string values in ordinary data slots.
471
+ Repeated values collapse in first-occurrence order. Unknown strings, sparse
472
+ slots, accessor slots, non-array iterables and simultaneous `dst-gap`/`dst-fold`
473
+ claims reject with a `RangeError` that does not include supplied flag values.
474
+
475
+ `dst-gap`, `dst-fold` and `lmt` remain caller assertions: a UTC instant alone
476
+ cannot verify a historical local-time resolution. `no-time`,
477
+ `polar-fallback` and `outside-reference-span` may be echoed for compatibility,
478
+ but must agree with the calculation. Set `timeKnown: false` for unknown time; a flag never overrides that
479
+ setting. A fallback assertion requires the actual requested Placidus calculation
480
+ to produce whole-sign houses, including fallback caused by nonconvergence.
481
+
482
+ `natalChart` stores only distinct time-resolution assertions in `chart.input.flags`
483
+ and derives result flags once. This is canonical semantic input, not a lossless
484
+ record of the submitted flag array. Correct derived echoes therefore work with
485
+ the existing draft receipt creator and replay; the receipt schema is unchanged.
486
+
487
+ When `transits`, `synastry` or `saturnReturn` receive a precomputed `Chart`, they
488
+ check flag consistency with its supplied time/settings and house/angle presence.
489
+ Contradictory or missing result claims reject. They do not recompute or verify
490
+ the supplied astronomical result. An already canonical Chart retains object
491
+ identity; compatible duplicate/derived echoes produce a shallow metadata copy,
492
+ preserving numerical arrays and engine version. These checks happen at call
493
+ time and do not freeze caller-owned objects.
494
+
495
+ Ordinary Saturn-return inputs require no extra natal calculation. A raw birth
496
+ input that explicitly asserts `polar-fallback` requires one natal calculation to
497
+ check that assertion before the return scan. A supplied Chart instead receives
498
+ the consistency check above, without natal recomputation. Public birth and
499
+ `resolveBirth` settings are validated once and the captured scalar values are
500
+ used for calculation/resolution. Explicit null settings or local time are
501
+ invalid. These boundaries do not sandbox same-realm getters, proxies or other
502
+ caller-supplied executable code. The unsupported `/internal` computation API is
503
+ unchanged.
504
+
505
+ The shared engine selects the eastern horizon intersection before assembling
506
+ houses, including in either polar hemisphere. At exact geographic poles no
507
+ point physically rises; at ecliptic/horizon coincidence an ascendant is not
508
+ unique. Those degenerate configurations are outside the verified angle scope.
509
+ Near tangencies the selected axis can change by 180 degrees. Placidus uses a
510
+ bounded iteration and falls back if it cannot converge; it never returns the
511
+ last unconverged iterate as a successful construction.
512
+
513
+ See [CHANGELOG.md](CHANGELOG.md) for candidate changes. Reference coverage and
514
+ known limits are recorded in the site [platform evidence ledger](https://github.com/ZodiacsOfficial/site/blob/75ae549c6bcedba67ccce7d467e1b54af0c83070/docs/platform/EVIDENCE.md).
515
+ The date parser's representable range is not a claim of astronomical accuracy
516
+ across that range. Reference cases are finite; broader numerical scope review
517
+ remains a release gate.
518
+
519
+ ### Longitude crossings
520
+
521
+ `findLongitudeCrossings(body, longitude, from, to, stepDays = 5)` returns every
522
+ instant in the half-open window (from, to] when `body` is exactly at
523
+ `longitude`, in time order, each marked `retrograde` when the body was moving
524
+ backward through it. A root exactly at `from` belongs to the window that ends
525
+ there and is not returned; a root exactly at `to` is. There is no sample
526
+ budget, and the call does not throw for the size of a search: its work grows
527
+ with (to − from) / step.
528
+
529
+ `searchLongitudeCrossings(body, longitude, from, to, { stepDays, maxSamples })`
530
+ makes the same search under a budget of ephemeris evaluations, root
531
+ refinements included. It returns `{ status: "complete", crossings, samples }`,
532
+ or `{ status: "refused", reason: "sample-budget", samples, maxSamples,
533
+ crossings: [] }`. It refuses before any sampling when the coarse scan alone
534
+ needs more than `maxSamples`, and otherwise when a refinement would pass the
535
+ budget. It never returns part of a result and never throws for the budget.
536
+ Without `maxSamples` there is no limit.
537
+
538
+ Both run the one solver, exported by `@zodiacs/engine/crossings` as
539
+ `findLongitudeCrossingsWith(longitudeAt, body, longitude, from, to, stepDays)`
540
+ and `searchLongitudeCrossingsWith(longitudeAt, body, longitude, from, to,
541
+ options)`. It takes the longitude function as its first argument and imports
542
+ no ephemeris, so that entry point carries none; the root entry point exports
543
+ the same two functions.
544
+
545
+ The solver samples `from`, every `stepDays` after it and `to`, and bisects each
546
+ sign change of the offset from the target 24 times, to the step divided by
547
+ 2^24: 25.7 ms at 5 days, 1.3 ms at a quarter day. A sample exactly on the
548
+ target is returned once, at that sample, with the direction of the sample
549
+ before it; a sampled plateau on the target is returned where it begins.
550
+ Offsets of 90° or more on either side of a step are the far side of the circle,
551
+ not a crossing.
552
+
553
+ A fixed step alone loses both crossings when a station falls between two
554
+ samples just past the target: at 5 days, a Saturn station within 0.0103° of
555
+ it, or a Jupiter station within 0.0205°. Wherever the sampled motion turns
556
+ without the offset changing sign, and the turning sample is within reach of the
557
+ local curvature, the solver finds the extremum by golden-section search. It
558
+ bisects both crossings when the extremum passes the target, and returns one,
559
+ as direct, when it only touches. A turn in the first or last step is found by
560
+ a probe one minute inside the window, and no sample falls outside [from, to].
561
+ Crossings less than a second apart are returned once. The solver assumes
562
+ smooth motion with at most one station in two steps. That holds for the Sun,
563
+ the Moon and the planets at the steps the site scans with, from a quarter day
564
+ for the Moon to 5 days for Saturn to Pluto, but not for the wobbling true
565
+ node. It is tested on synthetic and real stations, not proven complete.
566
+
567
+ Invalid input throws `RangeError` before any sampling: an invalid `Date`,
568
+ `from` after `to`, a non-finite longitude, a step that is not positive or is
569
+ shorter than a millisecond, or a `maxSamples` that is not a positive integer or
570
+ `Infinity`. A non-finite longitude from the ephemeris throws `RangeError` too.
571
+
572
+ ### Resolved instant inputs
573
+
574
+ `DateInput` values passed to the calculation APIs accept a valid `Date`, a finite
575
+ epoch-millisecond timestamp representable by JavaScript `Date`, or these ISO
576
+ string forms:
577
+
578
+ - `YYYY-MM-DD`, interpreted as midnight UTC using the proleptic Gregorian
579
+ calendar. This convenience does not infer a birthplace's local midnight.
580
+ - `YYYY-MM-DDTHH:mm[:ss[.sss]]Z`, or the same date-time with an explicit
581
+ `+HH:mm` or `-HH:mm` offset. Fractional seconds, when supplied, have one to
582
+ three digits. ISO expanded years use a sign and six digits, such as
583
+ `-000001-01-01T00:00:00Z`; years `0000`–`0099` are not shifted to 1900–1999.
584
+
585
+ Invalid calendar dates, rollovers such as February 30 or `24:00`, leap seconds,
586
+ unresolved local date-times, locale-specific strings, excessive fractional
587
+ precision, non-finite values, and other input types throw `RangeError` before
588
+ calculation. Existing `Date` values cannot reveal whether a caller previously
589
+ normalized an invalid date; pass the original string when validation is needed.
590
+ `Date` and numeric inputs retain JavaScript's millisecond resolution.
591
+
592
+ `Z`, `+00:00`, and `-00:00` identify the same UTC instant. Results normalize to
593
+ `Date` and do not retain the original offset or local-zone provenance; in
594
+ particular, [RFC 3339's `-00:00` convention](https://www.rfc-editor.org/rfc/rfc3339#section-4.3)
595
+ indicating an unknown local offset is not
596
+ preserved. Resolve daylight-saving gaps/folds and historical local-time rules
597
+ before calling these APIs. Accepted date syntax is not an accuracy guarantee
598
+ outside the documented reference coverage.
599
+
600
+ Every valid `Date` is accepted as input, but the ephemeris is evaluated only
601
+ inside `EPHEMERIS_SPAN`: Terrestrial Time from 0001-04-30T12:00 to
602
+ 3998-09-03T12:00, J2000 ± 730,000 days, the years astronomy-engine tabulates.
603
+ Its source says of instants beyond them: "The target time is outside the year
604
+ range 0000..4000. Calculate it by crawling backward from 0000 or forward from
605
+ 4000. FIXFIXFIX - This is super slow." rc.13 still evaluated them: a position
606
+ at year 30,000 took more than 20 s and put the Sun 29° off the ecliptic. Now
607
+ positions, and the charts, transits, synastry, progressions, declinations,
608
+ points, crossings and returns built on them, throw `RangeError` at once for
609
+ such an instant, with a message that names the span. The check is on
610
+ Terrestrial Time, and it covers the speed samples ±0.001 day around the
611
+ instant (±0.25 day for the true nodes), so an instant must lie six hours
612
+ inside. On the model ΔT clock every instant from 0001-05-01T00:00Z to
613
+ 3998-09-02T00:00Z qualifies; a pinned `deltaT` moves TT and is checked as
614
+ given. astronomy-engine reports any other failure by throwing a string, which
615
+ reaches the caller as a `RangeError` whose `cause` is the original value.
616
+
617
+ Inside the span, results are computed but not verified: accuracy was compared
618
+ only within `REFERENCE_SPAN`, and it falls away from it. The Sun's ecliptic
619
+ latitude, which in reality stays within about 1.2″ of zero, comes out as
620
+ −9.9″ on 1000-06-01, +13.3″ on 3000-06-01 and −57.5″ on 3998-09-02.
621
+
622
+ Birth settings accept only a `houseSystem` from the thirteen above and
623
+ a boolean `timeKnown`. Omitting them defaults to `"whole"` and `true`; explicit
624
+ `null` and other unsupported values throw `RangeError`, including when
625
+ coordinates are absent. Latitude and longitude must be supplied together as finite numbers
626
+ within `[-90, 90]` and `[-180, 180]` respectively.
627
+
628
+ ## ΔT
629
+
630
+ Positions are computed in Terrestrial Time, and a birth time is Universal
631
+ Time, so every chart needs ΔT = TT − UT1. From 0.1.1-rc.8 the engine uses its
632
+ own model, `zodiacs-deltat/1`, in place of astronomy-engine's 2004
633
+ polynomial, which was 6.3 s off the observed value in 2026 and 110 s off
634
+ Swiss Ephemeris's prediction for 2100:
635
+
636
+ - up to 1941, the reconstruction of Stephenson, Morrison & Hohenkerk 2016
637
+ (their Table S15, CC BY 4.0);
638
+ - from 1941, observed values from USNO and IERS, then Bulletin A's
639
+ predictions, then a damped extrapolation;
640
+ - a 1-σ band: 0.03 s where observed, growing with the years since the last
641
+ observation (about 12 s by 2050 and 42 s by 2100), and an estimate rather
642
+ than a calibrated band before 1620.
643
+
644
+ It is within 0.031 s of IERS on twelve dated values from 1962 to 2026 and
645
+ within 0.084 s on every IERS day since 1962. Each chart reports the value it
646
+ used as `chart.deltaT`: `{ seconds, sigma, model, table, tableDigest,
647
+ segment }`. The table is part of the release (`DELTA_T_TABLE`, IERS data of
648
+ 2026-09-24) and changes only with a new release. `@zodiacs/engine/deltat`
649
+ exports the model with no dependencies.
650
+
651
+ The instant is read as UT1: UTC is taken as UT1, as Swiss Ephemeris's
652
+ `calc_ut` does; UT1 − UTC stays under 0.9 s. To fix ΔT yourself, pass
653
+ `deltaT` (seconds) in a birth input; the chart reports `model: "pinned"`.
654
+
655
+ astronomy-engine keeps one ΔT for its whole module. Every engine call
656
+ installs the engine's model first, so after any call astronomy-engine carries
657
+ it. Code that calls astronomy-engine directly should install it too:
658
+ `SetDeltaTFunction(deltaT)` with `deltaT` from `@zodiacs/engine/deltat`.
659
+
660
+ ## Accuracy and licensing
661
+
662
+ The ephemeris is powered by the MIT-licensed `astronomy-engine`. Tests compare
663
+ modern and historical positions with public JPL Horizons vectors and exercise
664
+ astronomical and geometric invariants. See [LICENSING.md](LICENSING.md) for the
665
+ full provenance audit and the explicit Swiss Ephemeris exclusion.
666
+
667
+ The package's licence expression is `MIT AND CC-BY-4.0`: the code is MIT
668
+ ([LICENSE](LICENSE)), and the 32 values of Stephenson, Morrison & Hohenkerk's
669
+ Table S15 in the package's ΔT module (`@zodiacs/engine/deltat`, which the build
670
+ places in a shared chunk under `dist/` that `dist/deltat.js` re-exports) are
671
+ CC BY 4.0, attributed in [NOTICE](NOTICE).
672
+
673
+ The npm package contains no place or timezone database. GeoNames attribution
674
+ and the host-ICU historical-timezone caveat are recorded in [NOTICE](NOTICE),
675
+ which downstream users should retain.
676
+
677
+ ## Internal site entry points
678
+
679
+ `@zodiacs/engine/internal` and `@zodiacs/engine/internal/math` are private
680
+ compatibility boundaries for Zodiacs.org. They let the site consume the exact
681
+ package implementation while keeping its scanner-oriented functions and lazy
682
+ bundle boundary intact. They are not covered by semantic-versioning guarantees;
683
+ third-party code must use the documented root and `/geo` entry points.
684
+
685
+ ## GeoNames request recovery
686
+
687
+ The optional geo client shares in-flight requests and keeps validated
688
+ index/shards. A rejected fetch, unsuccessful HTTP response or JSON parsing
689
+ failure is returned to current callers with its original rejection reason. A
690
+ later explicit preload/search call may retry the failed resource. There is no
691
+ automatic retry loop, backoff or per-caller cancellation API. A custom fetch may
692
+ bind its own abort signal; the client does not reset that signal.
693
+
694
+ Parseable JSON must match the compact v1 asset format: index string tables and
695
+ `0`/`a`–`z` shard keys, with eight-field city rows containing valid table indices,
696
+ integer coordinates in hundredths of a degree (including ±90°/±180°), and
697
+ nonnegative integer populations. An invalid index or shard rejects with
698
+ `TypeError("Invalid GeoNames index data.")` or
699
+ `TypeError("Invalid GeoNames shard data.")` and is evicted for a later explicit
700
+ retry. The entire requested shard is checked before returning any results;
701
+ other successful caches remain available. Empty region/country labels and
702
+ Unicode names are retained. Timezone identifiers are checked as nonempty strings,
703
+ without requiring support in the current host's timezone database. Validation
704
+ does not authenticate place facts, check that the advertised count equals all
705
+ shards, or refresh a previously valid index when a shard changes independently.
706
+ In-range indices in a shard from another dataset generation can silently select
707
+ the wrong cached country or timezone; this v1 format has no content or generation
708
+ identity to detect that mismatch. Serve matching index/shards together.
709
+ `preload()` returns metadata snapshots: its arrays do not expose mutable cache
710
+ state.
711
+
712
+ These checks apply to parsed JSON data. A custom fetch implementation is trusted
713
+ code, not a sandbox: accessors or iterators it supplies in non-JSON objects may
714
+ execute during validation.
715
+
716
+ ## Draft natal receipts and local portability
717
+
718
+ The optional `@zodiacs/engine/receipt` entry point is a Zodiacs draft for one
719
+ natal-chart envelope. It preserves full numerical precision and separates a
720
+ requested house system from the actual computed system. It does not calculate
721
+ an ephemeris, fetch an imported URL, execute extensions, save a profile or change
722
+ account sync v1. A valid envelope is a structurally checked claim, not an
723
+ attestation that its positions or provenance are authentic.
724
+
725
+ ```ts
726
+ import { natalChart } from "@zodiacs/engine";
727
+ import {
728
+ createNatalEnvelope,
729
+ serializeNatalEnvelope,
730
+ parseNatalEnvelope,
731
+ natalReplayInput,
732
+ redactNatalEnvelope
733
+ } from "@zodiacs/engine/receipt";
734
+
735
+ const chart = natalChart({
736
+ utc: "2001-12-21T09:00:00Z",
737
+ latitude: 78.2232,
738
+ longitude: 15.6267,
739
+ houseSystem: "placidus"
740
+ });
741
+ const encoded = serializeNatalEnvelope(createNatalEnvelope(chart));
742
+ const decoded = parseNatalEnvelope(encoded);
743
+ if (decoded.ok) {
744
+ // Replay still requests Placidus even though this result used whole-sign.
745
+ const replay = natalChart(natalReplayInput(decoded.envelope));
746
+ console.log(replay.houses?.system);
747
+ console.log(redactNatalEnvelope(decoded.envelope));
748
+ }
749
+ ```
750
+
751
+ Capture original time-resolution and package/runtime facts while they are
752
+ available. Unknown birth time does not establish a noon convention: an explicit
753
+ 08:30 reference remains 08:30, while unavailable historical context remains
754
+ unavailable. Imported package hashes and version strings are untrusted claims.
755
+ Pass the original validated ISO string as `sourceInstant` when available;
756
+ normalization alone cannot recover its original offset spelling. Captured local
757
+ resolution is checked arithmetically, without consulting the current timezone
758
+ database or authenticating the historical claim.
759
+
760
+ Receipts from 0.1.1-rc.8 on name the ephemeris that computed them, as
761
+ `receipt.engine.ephemeris` (`{ name: "astronomy-engine", version: "2.1.19" }`,
762
+ exported as `EPHEMERIS`); the dependency is pinned to that exact version, and
763
+ a current receipt without it is refused. Their conventions say what the
764
+ positions are corrected for (`aberrated-geocentric-ecliptic-of-date;no-deflection`)
765
+ and that the Moon has neither correction. Receipts from rc.3 to rc.7 are still
766
+ read, each under the conventions its engine recorded, and a set is accepted
767
+ only from the engine versions that wrote it.
768
+
769
+ `natalReplayInput` recovers the recorded request. It does not select or install
770
+ the original engine. Recalculation with another engine, ephemeris dependency or
771
+ runtime may differ; verify trusted artifact identity and runtime provenance
772
+ before claiming reproducible results. A matching imported version label alone
773
+ is insufficient. Displaying the stored result does not require recalculation.
774
+
775
+ The redacted diagnostic uses fixed fields; it does not copy birth details,
776
+ numerical positions, arbitrary metadata, extensions, raw parser errors or
777
+ stable hashes. Redacted does not mean anonymous.
778
+
779
+ Imports are limited to one chart and 64 KiB of UTF-8 JSON, with bounded depth,
780
+ node count and data arrays. Unknown required features or schema versions are
781
+ rejected explicitly. Optional data belongs in bounded extensions and is never
782
+ executed or rendered by this codec. Keep encrypted account payloads and legacy
783
+ positions-only links in their existing formats until an explicit adapter and
784
+ safe downgrade policy are reviewed. Do not infer a legacy user's requested
785
+ house system from a stored fallback result.