भारत · ग्रहगणित
स्थान उज्जयिनी Ujjayinī · change it on a tool⌕ search the कोश ⌘Kप्रहर — · —:—:—ours, from sunriseउज्जयिनी —:—:—UTC + λ/15 h, λ = 75.7682° E (D13)IST Error −26.9 minlocal mean time − IST = 4λ − 330 min (K12)engine 3f94072the site ↗

yantra/patha/parampara.js

परम्परा: the tradition's own records as data, and the correction they yield.

328 lines · 0 exports

लेख · the header

The header, as the file states it

parampara.js — परम्परा: the tradition's own records as data, and the correction they yield. The owner, 2026-10-08: "Do not make observation mandatory; India has observed for centuries — use those observations as data." This module loads and checks the paramparā registry (corpus/parampara/registry.json, format "parampara/1"), the time-unit registry (corpus/sources/time-units.json, "time-units/1"), the graha naming layer (corpus/parampara/graha.json, "graha-names/1"), the e-text lines they quote (corpus/parampara/etext-lines.json) and the generated saṃskāra record (corpus/parampara/samskara.json, "parampara-samskara/1"), and exposes them: const P = Parampara.load({ registry, samskara, timeUnits, graha, etextLines }) // the parsed JSON files; all but // registry are optional P.records({ class, observer, status, tag, source }) the registry's records, filtered (each frozen) P.record(id), P.sources, P.sites P.timeUnits.unit(id), P.timeUnits.units, P.timeUnits.spandasOf(id), P.timeUnits.canonical, .ladders, .conflicts P.graha.layer(name), P.graha.of(graha) P.samskaraParameshvara(opts) → { epochKali, julian, moonArcmin, nodeArcmin, sigma: { moon, node }, padas, records, label, labelSa, default, choices, corrects, leaveOneOut, sensitivity, tag, caption, source } THE SAṂSKĀRA. samskaraParameshvara() is not a table of numbers kept here: it reads the record that the fit code writes (scripts/parampara-samskara.cjs --write, which runs samskara.js's robust fit on the JM rows named by the registry), and parampara.test.js re-runs that fit and fails if the record differs by a byte. In Node a caller may pass the fit itself, samskaraParameshvara({ fit }), fit being the script's exported result function, and get the same answer computed afresh. Owner, 2026-10-08 (decision a): this correction is the primary default of the text tier, labelled "Sūrya-Siddhānta + Parameśvara's saṃskāra"; the plain Sūrya-Siddhānta is the secondary labelled choice; the saṃskāra moves only the Moon and the node. THE RULES the loader enforces (a registry that breaks one does not load): every record has a source named in registry.sources; a record that is not the owner's statement has a locus and at least one verbatim quote with the file and line it was read from; a record of class owner-statement has source "owner", status "awaiting edition", the tag [owner-statement] and no [text] tag — no record exists without a source or that explicit class; classes, statuses and tags are from the registry's own vocabulary; an excluded, gate or cross-check record says why. Exact arithmetic only (BigInt rationals); no trigonometry, no clock, no network; imports nothing. Browser: window.Parampara; node: module.exports.
आवश्यक · requires

What it loads

nothing

required by
निर्यात · exports

What it exports

पाठ · the verses it cites

SS verses named in the header

none in the registry

नलिका · channels

The channels it runs in

not on a channel
कार्य · the functions

Every function, what it calls, who calls it

21 top-level functions read from the source; the doc line is the comment above each; calls and callers are resolved across the registry’s modules by name. Line numbers are the file’s at engine 3f94072.

isStr(s)lines 53–53
deepFreeze(o)lines 54–54
calls nothing in the registry
called by samskaraFrom, load
clone(o)lines 55–55
calls nothing in the registry
called by load
parseFrom(from)lines 58–65exported

Which kind of place a 'from' names: { kind: "etext"|"file"|"verse", … } or null.

calls nothing in the registry
gcd(a, b)lines 68–68

── exact rationals (for the time-unit ratios) ─────────────────────────────────────────────────────────

calls nothing in the registry
called by rat
ratOf(v)lines 71–75exported

A number or "n/d" string → a rational.

ratMul(a, b)lines 76–76
calls rat
ratAdd(a, b)lines 77–77
calls rat
called by nothing in the registry
ratEq(a, b)lines 78–78
calls nothing in the registry
ratStr(a)lines 79–79exported
calls nothing in the registry
bhutasankhya(values)lines 83–86exported

bhūtasaṅkhyā: the words' values, first word the units; a word worth more than 9 gives its digits as written (tithi 15 then viśva 13 → 1315).

calls nothing in the registry
evalExpr(expr, words)lines 89–98exported

An expression over number words (time-units.json 'expr') → a rational: a stem; {"×": [...]} product; {"+": [...]} sum; {"bh": [...]} bhūtasaṅkhyā of the stems, first the units.

── validation ─────────────────────────────────────────────────────────────────────────────────────────

validateRegistry(reg)lines 109–153exported

The registry's shape and provenance rules (see the header). Returns the list of errors (empty when it holds).

called by load
validateTimeUnits(tu, opts)lines 157–207exported

The time-unit registry: its chain multiplies out, every attestation is tagged and placed, each stated ratio is derived from its number words, and each unit's spandas follow from the unit it is measured by.

validateGraha(g)lines 210–231exported

The graha layer: each layer quotes its verses, and each japa count is the bhūtasaṅkhyā of its words × 1000.

validateSamskara(s)lines 233–245exported
calls isStr
called by load
recordOfRow(id)lines 248–248

── the saṃskāra ───────────────────────────────────────────────────────────────────────────────────────

calls nothing in the registry
called by nothing in the registry
samskaraFrom(s, reg)lines 249–274
called by load
load(data, opts)lines 277–324exported

Load the parsed corpus files. Throws if the registry (or any other file given) breaks its rules.