feat(consult): Rath running MD on every domain card, budget 12,500 / 18,500 (BUG-1221)

Product decision 2026-10-03 (changes the BUG-1160/1161 budget): every
domain card carries the Sanjay Rath Narayana running MD beside the legacy
one, in its short form (label, start sign, MD sign, start / end age).
Card budget 12,000 -> 12,500, with the method checklist 18,000 -> 18,500;
three budget assertions rewritten with old / new / reason notes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
This commit is contained in:
Jesse_Chen
2026-10-03 22:49:30 +08:00
co-authored by Claude Opus 5.5
parent 8ca06c4f20
commit 11225171ee
7 changed files with 117 additions and 54 deletions
+19 -20
View File
@@ -585,15 +585,16 @@ function baseNatal(natal: Record<string, unknown>, gaps: string[]) {
}
/**
* BUG-1218 (T4): domains whose card carries the Sanjay Rath Narayana beside
* the legacy one. Other single-domain cards sit at up to 11,979 of the 12,000
* characters (Jobs / marriage golden) and the Rath MD adds about 174, so it
* rides only on the timing-led cards (own 12,000 / 18,000 budget); the report
* shows the full Rath table for every chart.
* BUG-1218 (T4) / BUG-1221: every domain card carries the Sanjay Rath
* Narayana beside the legacy one, running MD only and in its short form:
* label, start sign, MD sign and its start / end age. The MD lord, its years
* (end_age − start_age), the deciding level and the sub-periods stay in the
* report. Product 2026-10-03: card budget 12,500, with the method checklist
* 18,500 (was 12,000 / 18,000, BUG-1160/1161).
*/
const RATH_NARAYANA_CARD_DOMAINS: ReadonlySet<ConsultationDomain> = new Set(["timing", "annual"]);
const RATH_MD_CARD_KEYS = ["sign", "start_age", "end_age"] as const;
function baseTiming(timing: Record<string, unknown>, gaps: string[], withRath = false) {
function baseTiming(timing: Record<string, unknown>, gaps: string[]) {
const sub = record(timing.dasha_sub_periods);
const current = record(sub.current);
const pratyantar = record(sub.pratyantar_dasha_timeline);
@@ -634,17 +635,16 @@ function baseTiming(timing: Record<string, unknown>, gaps: string[], withRath =
const algorithmLabel = copy(record(timing.narayana_dasha).algorithm_label);
if (narayana.md && typeof algorithmLabel === "string" && algorithmLabel) narayana.algorithm = algorithmLabel;
if (!narayana.md) gaps.push("base.narayana.md");
// BUG-1218 (T4): the Sanjay Rath version rides beside the legacy one — its
// label, start sign, the level that decided it and the running MD only
// (sub-periods stay in the report; 12,000-character card budget).
// BUG-1218 (T4) / BUG-1221: the Sanjay Rath version rides beside the
// legacy one on every card — its label, start sign and the running MD only
// (sub-periods stay in the report; 12,500-character card budget).
const rath = record(record(timing.narayana_dasha).rath);
const rathMd = pickKeys(record(rath.current_dasha).md, NARAYANA_PERIOD_KEYS);
if (withRath && nonEmpty(rathMd) && typeof rath.algorithm_label === "string") {
const narayanaRath: JsonRecord = { algorithm: rath.algorithm_label, md: rathMd };
for (const [from, to] of [["seed_sign", "seed_sign"], ["strength_level_decided", "seed_level"]] as const) {
const value = copy(rath[from]);
if (value !== undefined && value !== null) narayanaRath[to] = value;
}
const rathMd = pickKeys(record(rath.current_dasha).md, RATH_MD_CARD_KEYS);
if (nonEmpty(rathMd) && typeof rath.algorithm_label === "string") {
const narayanaRath: JsonRecord = { algorithm: rath.algorithm_label };
const seedSign = copy(rath.seed_sign);
if (seedSign !== undefined && seedSign !== null) narayanaRath.seed_sign = seedSign;
narayanaRath.md = rathMd;
return { vimshottari, narayana, narayana_rath: narayanaRath };
}
return { vimshottari, narayana };
@@ -1021,10 +1021,9 @@ export function buildEvidenceCard(
if (sources.length === 0) throw new Error("evidence_card_needs_a_domain");
const gaps: string[] = [];
const first = sources[0]!;
const withRath = sources.some((item) => RATH_NARAYANA_CARD_DOMAINS.has(item.domain));
const base = {
natal: baseNatal(claimEvidence(first.packet, "natal_foundation"), gaps),
timing: baseTiming(claimEvidence(first.packet, "timing"), gaps, withRath),
timing: baseTiming(claimEvidence(first.packet, "timing"), gaps),
};
const domainSections: EvidenceCard["domain_sections"] = {};
const domains: ConsultationDomain[] = [];
@@ -1049,7 +1048,7 @@ export function buildEvidenceCard(
const ownGaps: string[] = [];
const candidate = {
natal: baseNatal(claimEvidence(source.packet, "natal_foundation"), ownGaps),
timing: baseTiming(claimEvidence(source.packet, "timing"), ownGaps, withRath),
timing: baseTiming(claimEvidence(source.packet, "timing"), ownGaps),
};
if (JSON.stringify(candidate) !== JSON.stringify(base)) {
own = candidate;
@@ -69,6 +69,8 @@ const domainMethodology: Readonly<Record<ConsultationDomain, { strictRoute: stri
// annual list on a 12,000-character ceiling (BUG-1160/1161). Product decision
// 2026-10-02: they take the career / marriage / wealth budget instead (contract
// + card <= 12,000, total with the checklist <= 18,000), so every turn gets both.
// 2026-10-03 (BUG-1221): every card carries the Rath running MD; the budget is
// now 12,500 / 18,500.
/** Domains whose list was written by the affliction-reading brief rather than condensed from the router. */
const BRIEF_WRITTEN_DOMAINS: ReadonlySet<ConsultationDomain> = new Set([