test(consult): regenerate consultation goldens from the real engine; card shadbala rows (T1-T9)
consult-evidence-card-golden.json and consult-biography-backtest-golden.json re-captured with their capture scripts (JYOTISH_API_CHART_CACHE_TTL_SECONDS=0, PYTHONHASHSEED=0). Differences are the batch's own: Sodhita chain and house_scores sav_sodhita (BUG-1209), shadbala minimum fields (BUG-1208), varshesha_basis (BUG-1212), traditional_yogas names (BUG-1205/1207: Neecha Bhanga with conditions, Mahapurusha with 部分减弱, Taylor's trikona Hamsa gone), chart.yogas Kemadruma rows (BUG-1206), Rahu/Ketu status and D9 dignity and fixed-lord rule hits in the health sieve (BUG-1211). Card: shadbala rows are rupas / minimum_check / level (the engine's other three fields restate them; keeps the 12,000-character card budget). Changed assertions (three columns in PROGRESS): career 10H SAV keys, annual chart keys, Obama traditional-yoga names. 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:
co-authored by
Claude Opus 5.5
parent
eb00b0f70f
commit
0d6af77cea
@@ -481,6 +481,25 @@ function rolePlanetRow(base: EvidenceCard["base"], name: string): JsonRecord | u
|
||||
return klass ? { ...row, functional: klass } : row;
|
||||
}
|
||||
const ARUDHA_KEYS = ["sign", "lord"] as const;
|
||||
/**
|
||||
* BUG-1208 (ruling 甲13): per planet the rupas, the BPHS minimum check first,
|
||||
* then the band already labelled 「(网站分档)」 by the engine. The engine's
|
||||
* `min_required` / `meets_minimum` / `level_source` restate the same two facts
|
||||
* and are left off the card to keep it within its size budget.
|
||||
*/
|
||||
const SHADBALA_CARD_KEYS = ["rupas", "minimum_check", "level"] as const;
|
||||
|
||||
function shadbalaCardRows(shadbala: Json): Json {
|
||||
const rows = record(shadbala);
|
||||
if (!Object.keys(rows).length) return shadbala;
|
||||
const out: JsonRecord = {};
|
||||
for (const [planet, row] of Object.entries(rows)) {
|
||||
const picked = pickKeys(row, SHADBALA_CARD_KEYS);
|
||||
out[planet] = nonEmpty(picked) ? picked : (copy(row) ?? null);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** BUG-1209: reduced SAV first, raw SAV beside it (labels: EVIDENCE_CARD_LABELS.savColumns). */
|
||||
const SAV_HOUSE_KEYS = ["sign", "sav_sodhita", "sav_score", "level"] as const;
|
||||
/** The engine writes the Arudha Lagna as pada A1 (its own name: "Arudha Lagna (AL)"). */
|
||||
@@ -820,7 +839,7 @@ function domainSection(
|
||||
}
|
||||
if (rule.shadbala) {
|
||||
const shadbala = copy(chart.shadbala);
|
||||
if (shadbala !== undefined && shadbala !== null) section.shadbala = shadbala;
|
||||
if (shadbala !== undefined && shadbala !== null) section.shadbala = shadbalaCardRows(shadbala);
|
||||
else gaps.push(`${domain}.shadbala`);
|
||||
}
|
||||
if (rule.savHouses.length) {
|
||||
|
||||
@@ -66,10 +66,15 @@ test("traditional yogas: fixed label, engine names, general / career / wealth on
|
||||
}
|
||||
});
|
||||
|
||||
test("Obama carries Sasa and Neecha Bhanga Raja; Jobs and Taylor carry Gajakesari (engine names)", () => {
|
||||
// BUG-1205 / BUG-1207 (astrologer rulings 2026-10-03): the Neecha Bhanga row is
|
||||
// 「落陷取消(Neecha Bhanga)」 with the conditions that hold, never "Raja Yoga";
|
||||
// a Pancha Mahapurusha yoga carries its 部分减弱 reasons. Was: exact names
|
||||
// "Sasa Yoga" and "Neecha Bhanga Raja Yoga".
|
||||
test("Obama carries Sasa and Neecha Bhanga (conditions, no Raja); Jobs and Taylor carry Gajakesari (engine names)", () => {
|
||||
const general = (id: string) => (card(chartById(id).workflow, "general").domain_sections.general!.traditional_yogas as Json).names as string[];
|
||||
assert.ok(general("barack_obama").includes("Sasa Yoga"));
|
||||
assert.ok(general("barack_obama").includes("Neecha Bhanga Raja Yoga"));
|
||||
assert.ok(general("barack_obama").some((name) => name.startsWith("Sasa Yoga")));
|
||||
assert.ok(general("barack_obama").some((name) => name.startsWith("落陷取消(Neecha Bhanga)(") && name.includes("成立条件:")));
|
||||
assert.ok(general("barack_obama").every((name) => !/raja/i.test(name)));
|
||||
assert.ok(general("steve_jobs").includes("Gajakesari Yoga"));
|
||||
assert.ok(general("elizabeth_taylor").includes("Gajakesari Yoga"));
|
||||
});
|
||||
|
||||
@@ -129,7 +129,10 @@ test("career: AL, 10H SAV and the SAV of the Jupiter / Saturn transit signs join
|
||||
assert.deepEqual(section.arudha?.AL, pick(padas.A1, ["sign", "lord"]), `${chart.id} AL is pada A1`);
|
||||
assert.deepEqual(section.arudha?.A10, pick(padas.A10, ["sign", "lord"]), `${chart.id} A10`);
|
||||
const house10 = dig(modules(chart.workflow), "ashtakavarga", "house_scores", "house_10");
|
||||
assert.deepEqual(section.sav_by_house?.["10"], pick(house10, ["sign", "sav_score", "level"]), `${chart.id} 10H SAV`);
|
||||
// BUG-1209: Sodhita SAV (sav_sodhita) before the raw sav_score; was ["sign", "sav_score", "level"].
|
||||
assert.deepEqual(section.sav_by_house?.["10"], pick(house10, ["sign", "sav_sodhita", "sav_score", "level"]), `${chart.id} 10H SAV`);
|
||||
assert.equal(typeof (section.sav_by_house?.["10"] as Json).sav_sodhita, "number", `${chart.id} 10H Sodhita SAV`);
|
||||
assert.equal(section.sav_columns, EVIDENCE_CARD_LABELS.savColumns);
|
||||
const current = dig(native(chart.workflow), "slow_transits", "current") as Json;
|
||||
for (const body of ["Jupiter", "Saturn"]) {
|
||||
assert.deepEqual((section.slow_transits as Json)[body], pick(current[body], ["sign", "natal_house", "sav"]), `${chart.id} ${body}`);
|
||||
@@ -205,7 +208,8 @@ test("annual: the annual chart verbatim, AD-lord and transit houses, key dates o
|
||||
const annual = layers.annual_tajika as Json;
|
||||
const where = chart.id;
|
||||
assert.deepEqual(section.annual_chart, pick(annual, [
|
||||
"status", "varsha_year", "annual_lagna", "varshesha", "muntha", "mudda_dasha", "tajika_aspects", "boundary",
|
||||
// BUG-1212: + varshesha_basis (year lord is the Muntha lord for now; Panchavargiya pending).
|
||||
"status", "varsha_year", "annual_lagna", "varshesha", "varshesha_basis", "muntha", "mudda_dasha", "tajika_aspects", "boundary",
|
||||
]), `${where} annual chart`);
|
||||
assert.equal(dig(section.annual_chart, "status"), "parameter_sensitive");
|
||||
// Houses: 1, the running and next AD lords' houses, the year's Jupiter / Saturn transit houses.
|
||||
@@ -358,3 +362,18 @@ test("size: contract + card stay under 12,000 characters without the checklist,
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("shadbala on the card: BPHS minimum check first, band labelled as the site's (BUG-1208)", () => {
|
||||
for (const chart of golden.charts) {
|
||||
const section = card(chart.workflow, "career").domain_sections.career!;
|
||||
const engine = (chart.workflow.chart as Json).shadbala as Record<string, Json>;
|
||||
const rows = section.shadbala as Record<string, Json>;
|
||||
assert.deepEqual(Object.keys(rows).sort(), Object.keys(engine).sort(), chart.id);
|
||||
for (const [planet, row] of Object.entries(rows)) {
|
||||
assert.deepEqual(Object.keys(row), ["rupas", "minimum_check", "level"], `${chart.id} ${planet}`);
|
||||
assert.match(row.minimum_check as string, /^(达到|未达到) BPHS 最低要求$/);
|
||||
assert.match(row.level as string, /(网站分档)$/);
|
||||
assert.equal(row.minimum_check === "达到 BPHS 最低要求", engine[planet].meets_minimum, `${chart.id} ${planet}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user