fix(consult): keep career row hints off the planet nature

Career significator and house-lord rows now carry one presentation sentence. Values stay the same. A second three-repeat biography run still has one field conflict, so this is not accepted.

Not pushed.
This commit is contained in:
jesse-ux
2026-10-09 16:25:59 +08:00
parent 85c3030e96
commit d6eb0cfec1
6 changed files with 104 additions and 35 deletions
@@ -16,8 +16,20 @@ export const JUDGMENT_TABLE_LABELS = {
relationOccupant: "落入",
relationAspect: "照",
relationConjunctLord: "与宫主同宫",
careerSignificatorReading: "这行只看力量与受冲,不按这颗星的本性写职业类型、做事方式或方向。",
} as const;
const CAREER_JAIMINI_ROLES = new Set(["AmK", "DK", "PK", "MK", "PiK"]);
/** Presentation only. Career significator rows keep their copied values. */
function careerSignificatorReading(domain: string, role: string | null): { reading: string } | Record<string, never> {
if (domain !== "career" || !role) return {};
const dasha = role.startsWith("Vimshottari");
const named = role === "natural" || role === "lord" || role === "Narayana MD lord" || CAREER_JAIMINI_ROLES.has(role);
if (!dasha && !named) return {};
return { reading: JUDGMENT_TABLE_LABELS.careerSignificatorReading };
}
const MALEFIC_BODIES = ["Saturn", "Mars", "Rahu", "Ketu"] as const;
const ASPECT_MALEFICS = ["Saturn", "Mars"] as const;
const DUSTHANA = new Set([6, 8, 12]);
@@ -247,6 +259,7 @@ export function assembleJudgmentTable(facts: unknown): JsonRecord {
const body = record(facts);
const planets = record(body.planets);
const houses = record(body.houses);
const domain = typeof body.domain === "string" ? body.domain : "";
const rows: Json[] = [];
const factors = Array.isArray(body.factors) ? body.factors : [];
for (const factor of factors) {
@@ -276,6 +289,7 @@ export function assembleJudgmentTable(facts: unknown): JsonRecord {
role: "lord",
citation,
...planetColumns(lord, planets, houses, "lord"),
...careerSignificatorReading(domain, "lord"),
});
} else {
rows.push({ id: `${id}:lord`, kind: "gap", citation, path: leaf(house.lord).path ?? null });
@@ -283,12 +297,14 @@ export function assembleJudgmentTable(facts: unknown): JsonRecord {
continue;
}
if (item.kind === "planet" && typeof item.planet === "string") {
const role = typeof item.role === "string" ? item.role : null;
rows.push({
id,
kind: "planet",
role: typeof item.role === "string" ? item.role : null,
role,
citation,
...planetColumns(item.planet, planets, houses, typeof item.role === "string" ? item.role : undefined),
...planetColumns(item.planet, planets, houses, role ?? undefined),
...careerSignificatorReading(domain, role),
});
continue;
}
@@ -312,7 +328,7 @@ export function assembleJudgmentTable(facts: unknown): JsonRecord {
}
return {
header_note: typeof body.header_note === "string" ? body.header_note : JUDGMENT_TABLE_LABELS.rahuNote,
domain: typeof body.domain === "string" ? body.domain : "",
domain,
domain_varga: typeof body.domain_varga === "string" ? body.domain_varga : "",
rows,
};
@@ -374,6 +390,7 @@ function compactPlanetRows(rows: Json[]): Json[] {
const repeat: JsonRecord = { id: row.id, kind: row.kind, planet: row.planet };
if (typeof row.role === "string") repeat.role = row.role;
if (typeof row.citation === "string") repeat.citation = row.citation;
if (typeof row.reading === "string") repeat.reading = row.reading;
if (row.affliction !== undefined) repeat.affliction = row.affliction;
return repeat;
});