fix: report and synastry reader text loses its last backstage wording (BUG-2038)
A pronoun whose planet was in a removed sentence takes that planet; only a planet back in its natal sign is given to the reading; the 现在这几年 section leads with the stage of life and dates only the main dasha; the health reminder is one fixed program sentence; the synastry appendix no longer doubles 所以 and shows the technical summary with names, no machine tags, minutes as 分 and 秒. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
This commit is contained in:
@@ -27380,3 +27380,15 @@
|
||||
- 验证与防复发:该测试通过。上限仍在,事实包再明显变大时会再次报出来,届时先查冗余再议上限。
|
||||
- 关联记录:BUG-2013、BUG-2019、BUG-2021、BUG-2024、BUG-2028。
|
||||
- 修复版本:`claude/report-facts-budget-2036`。
|
||||
|
||||
## BUG-2038 | 个人报告与合盘附录里读者看到的零碎后台写法(复测第九轮)
|
||||
|
||||
- 状态:fixed-pending-verify(待测试环境重新生成报告确认)。
|
||||
- 首次发现 / 最近更新:2026-11-20 / 2026-11-20。
|
||||
- 触发与现象:测试环境复测第九轮。个人报告:性格一节有一段以「它与落陷的木星互换了星座」开头,「它」没有所指;「现在这几年」大半是几套大运的日期清单,并写出「行运木星……不在同一个星座」;开篇时间线带算法版本出处;正文出现「这套结果还没有完成外部核对」「双行运只查了第7宫,没有激活」「六力值 6.0765 Rupa」「按规则筛选出来的候选里」;健康一节连着两句提醒。合盘附录:每条「所以:」都读成「所以:所以……」;「技术依据摘要」里仍有带下划线机器名的括注、甲方 / 乙方和「前 6.5 分钟」。
|
||||
- 触发条件:生成个人报告;打开合盘报告的附录。
|
||||
- 根因:(1) 程序按句去掉越界引用(BUG-2019)时,被删句的下一句以代词开头,主语跟着丢了。(2) 报告事实把不同座的行运也列成一行,规则没有说「现在这几年」先讲什么、哪些体系不在正文列日期。(3) 中文开篇照抄了算法标签。(4) 规则没有禁止这几种后台说明进各节正文。(5) 健康一节的提醒交给模型写,规则只限「每节最多一句」。(6) 合盘存下来的句子自己以「所以」开头,页面又加了一次标签;BUG-2034 的显示处理只用在「分析逻辑」,没用到「技术依据摘要」。
|
||||
- 修复:被删句之后紧跟的句子若以指代行星的代词开头,换成被删句最先点名的行星;事实里只列回到本命星座的行星;规则写明「现在这几年」先说处在什么阶段,正文只给 Vimshottari 的日期、Narayana 至多一句;中文开篇不带算法标签;三种后台说明在各节正文里去掉(「依据与边界」不动),规则同步;候选格局在正文用日常话;健康一节里模型写的提醒去掉,由程序在节末补一句固定的话(历史人物回放不补);合盘显示时去掉句首重复的「所以」,「技术依据摘要」同样换称呼、去机器括注、分钟写成几分几秒。计算、等级、保存的合盘文字都没有改。
|
||||
- 验证与防复发:`frontend/tests/reader-leftovers-2038.test.tsx`、`tests/test_reader_leftovers_2038.py`,用的是复测第九轮存下的句子;公开盘重新生成一次个人报告,九节一次通过,各节正文里这些写法为 0,健康一节只有程序补的一句。合盘两处只有显示层测试,没有重新生成合盘。
|
||||
- 关联记录:BUG-2019、BUG-2021、BUG-2024、BUG-2028、BUG-2034。
|
||||
- 修复版本:`claude/reader-leftovers-2038`。
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { ReportBirthNotices } from "@/components/personal-report/report-birth-notices";
|
||||
import { readReportBirthScenarios } from "@/lib/report-birth-marking";
|
||||
import { buildSynastryExportBlocks, synastryParagraphs } from "@/lib/synastry-report-export";
|
||||
import { synastryAnalysisReaderText } from "@/lib/synastry-analysis-reader";
|
||||
import { synastryAnalysisReaderText, synastrySoReaderText, synastryTechnicalReaderText } from "@/lib/synastry-analysis-reader";
|
||||
import { ReportExportButton } from "@/components/personal-report/report-actions";
|
||||
import { ReportExportDrawer } from "@/components/personal-report/report-export-drawer";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -79,7 +79,8 @@ function chartLine(language: "zh" | "en", basis: string | undefined, names?: { a
|
||||
}
|
||||
|
||||
function soLine(language: "zh" | "en", plain: string | undefined, names?: { a?: string; b?: string }) {
|
||||
const text = synastryAnalysisReaderText(plain, names, language);
|
||||
// BUG-2038: the stored sentence opens with 「所以」 itself; the label is not doubled.
|
||||
const text = synastrySoReaderText(plain, names, language);
|
||||
return language === "zh" ? `所以:${text}` : `So: ${text}`;
|
||||
}
|
||||
|
||||
@@ -162,6 +163,8 @@ export function SynastryReportView(props: {
|
||||
if (!body) return null;
|
||||
const names = snapshot.names ?? {};
|
||||
const reportNames = { a: names.a || "甲", b: names.b || "乙" };
|
||||
// BUG-2038: 「技术依据摘要」 is shown with the two names, without machine tags, minutes as 分 / 秒.
|
||||
const technical = (value: string) => synastryTechnicalReaderText(value, names, language);
|
||||
const birthScenarios = readReportBirthScenarios(snapshot.birthScenarios);
|
||||
const structure = body.structure ?? snapshot.structure;
|
||||
const order = synastrySectionOrder(structure);
|
||||
@@ -360,20 +363,20 @@ export function SynastryReportView(props: {
|
||||
<h3>{block.title}</h3>
|
||||
{block.precision?.map(({ title, disclosure, summary, rows }) => (
|
||||
<section key={title}>
|
||||
<h4>{title}</h4>
|
||||
{disclosure ? <p>{disclosure}</p> : null}
|
||||
<h4>{technical(title)}</h4>
|
||||
{disclosure ? <p>{technical(disclosure)}</p> : null}
|
||||
{rows.length ? (
|
||||
<div className="annual-table-box" onPointerDown={dragScroll}>
|
||||
<table className="annual-table">
|
||||
<thead><tr><th scope="col">项目</th><th scope="col">档案时刻</th><th scope="col">候选时刻</th></tr></thead>
|
||||
<tbody>{rows.map((row) => <tr key={row.item}>
|
||||
<th scope="row">{row.item}</th><td>{row.reference}</td>
|
||||
<td>{row.branches.map((branch) => <div key={branch}>{branch}</div>)}</td>
|
||||
<td>{row.branches.map((branch) => <div key={branch}>{technical(branch)}</div>)}</td>
|
||||
</tr>)}</tbody>
|
||||
</table>
|
||||
</div>
|
||||
) : null}
|
||||
{summary ? <p>{summary}</p> : null}
|
||||
{summary ? <p>{technical(summary)}</p> : null}
|
||||
</section>
|
||||
))}
|
||||
{block.audit?.map(({ title, rows }) => (
|
||||
@@ -390,7 +393,7 @@ export function SynastryReportView(props: {
|
||||
</section>
|
||||
))}
|
||||
<ul>
|
||||
{block.lines.map((line) => <li key={line}>{block.id === "timing" ? currentSynastryEventStatus(line) : line}</li>)}
|
||||
{block.lines.map((line) => <li key={line}>{technical(block.id === "timing" ? currentSynastryEventStatus(line) : line)}</li>)}
|
||||
</ul>
|
||||
{block.ramanComparison?.length ? (
|
||||
<>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* BUG-2038 (staging 复测第九轮, 2026-11-20; 产品负责人 2026-11-16「不写推责的话」): the health section
|
||||
* ended with two reminders of the model's own (「这些是结构上的条件,不是身体的结论。」「以上是传统结构上的
|
||||
* 读法,不构成医疗判断;有具体不适要找医生。」). One medical reminder is right for this section; it is now
|
||||
* the program's: the model's are taken out, and one fixed sentence closes the section. The wording follows
|
||||
* the report notice already in use (「……不构成医疗、法律或投资建议」, personal-report-generation.ts).
|
||||
*/
|
||||
export const HEALTH_NOTICE_ZH = "这一节不构成医疗建议,身体有具体不适请找医生。";
|
||||
|
||||
const SENTENCES = /[^。!?\n]+[。!?]*\n*|\n+/gu;
|
||||
// A sentence whose job is the reminder: it disclaims medical meaning or sends the reader to a doctor.
|
||||
const REMINDER = /不构成医疗|不是医疗(?:意见|判断|建议|诊断)|不属于医疗|不是身体的结论|不是(?:对)?身体(?:状况)?的(?:判断|诊断|结论)|不(?:能|可)?(?:代替|替代)(?:医生|医疗|诊断|就医)|(?:请|要|应|需要|记得|及时)(?:去)?(?:找|看|咨询)医生|(?:请|及时|尽快)就医/u;
|
||||
/** Longer sentences carry content of their own and are left to the ordinary checks. */
|
||||
const REMINDER_MAX_CHARS = 60;
|
||||
|
||||
/** The paragraph without reminder sentences; "" when it was nothing else. */
|
||||
export function stripHealthReminders(text: string): string {
|
||||
const sentences = text.match(SENTENCES) ?? [text];
|
||||
return sentences
|
||||
.filter((sentence) => !(sentence.trim().length <= REMINDER_MAX_CHARS && REMINDER.test(sentence)))
|
||||
.join("")
|
||||
.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* The fixed sentence at the end of the paragraph. A program line that must stay last (the other-scenario
|
||||
* line, BUG-2013) keeps its place: `tail` is that line, already part of `text`.
|
||||
*/
|
||||
export function withHealthNotice(text: string, tail: string, maxChars: number): string | null {
|
||||
const body = tail && text.endsWith(tail) ? text.slice(0, text.length - tail.length) : text;
|
||||
const end = body === text ? "" : tail;
|
||||
const joiner = /[。!?]$/.test(body.trimEnd()) ? "" : "。";
|
||||
const combined = `${body.trimEnd()}${joiner}${HEALTH_NOTICE_ZH}${end}`;
|
||||
return combined.length <= maxChars ? combined : null;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import type { ReadingSectionTransform, ReadingTransformLog } from "./personal-re
|
||||
// 原值: 6;新值: 7;原因: BUG-2021,正文里的内部状态词(参数敏感、双体系确认、命中候选……)在检查前换成读者说法;财富两类结论可引用 AL 起第 2、11 宫。
|
||||
// 原值: 7;新值: 8;原因: BUG-2024,正文里抄出的四句规则话(同一句要并读、只作这一天观察不外推、被路由分给、用途稳定性没有评估)换成读者说法;落陷取消的标签括注不算尊贵状态。
|
||||
// 原值: 8;新值: 9;原因: BUG-2028,段末的出生时间说明改用日常话(不写分盘和秒数);正文里的开发用词(具名规则、证据链、方法版本)换成读者说法。
|
||||
export const REPORT_READING_POSTCHECK_VERSION = 10; // 原值 9;BUG-2034 正文的写法收尾(建议句后的说明、日期写法、窗口级引子)
|
||||
export const REPORT_READING_POSTCHECK_VERSION = 11; // 原值 10;BUG-2038 被删句之后的代词补主语、健康一节的提醒改由程序补、三处后台说明不进各节正文
|
||||
|
||||
function record(value: unknown): Record<string, unknown> {
|
||||
return value !== null && typeof value === "object" && !Array.isArray(value) ? value as Record<string, unknown> : {};
|
||||
|
||||
@@ -89,6 +89,25 @@ function textWithinAllowed(text: string, allowed: ReadonlySet<string>, catalog:
|
||||
}
|
||||
|
||||
const SENTENCES = /[^。;!?\n]+[。;!?]*\n*|\n+/g;
|
||||
const PLANET_NAMES_ZH = ["太阳", "月亮", "火星", "水星", "木星", "金星", "土星", "罗睺", "计都"] as const;
|
||||
const LEADING_PRONOUN = /^(\s*)(?:它(?!们)|这颗行星|这颗星|该星)/u;
|
||||
|
||||
/**
|
||||
* BUG-2038 (staging 复测第九轮, 2026-11-20): 「它与落陷的木星互换了星座……」 opened a paragraph with nothing
|
||||
* for 「它」 to point at, because the sentence before it (which named the planet) had been removed for
|
||||
* citing a technique outside the claim. When the sentence right after a removed one opens with a pronoun
|
||||
* for a planet, the pronoun is replaced by the planet the removed sentence named first. Nothing else of
|
||||
* the removed sentence comes back; with no planet in it the sentence is left as written.
|
||||
*/
|
||||
export function withSubjectOf(sentence: string, removed: string): string {
|
||||
const lead = LEADING_PRONOUN.exec(sentence);
|
||||
if (!lead) return sentence;
|
||||
const first = PLANET_NAMES_ZH
|
||||
.map((name) => ({ name, at: removed.indexOf(name) }))
|
||||
.filter(({ at }) => at >= 0)
|
||||
.sort((left, right) => left.at - right.at)[0];
|
||||
return first ? `${lead[1]}${first.name}${sentence.slice(lead[0].length)}` : sentence;
|
||||
}
|
||||
|
||||
/**
|
||||
* BUG-2019 (占星师 2026-11-19 第 8 条:「程序应拦截不受支持的具体断言,避免因一句引用问题扣掉整节」).
|
||||
@@ -121,11 +140,16 @@ export function dropOutsideReferences(
|
||||
const keptRefs = refs.filter((id) => allowed.has(id) && catalog.states.has(id));
|
||||
const kept: string[] = [];
|
||||
let removed = false;
|
||||
let justDropped: string | null = null;
|
||||
for (const sentence of text.match(SENTENCES) ?? []) {
|
||||
if (textWithinAllowed(sentence, allowed, catalog)) kept.push(sentence);
|
||||
else {
|
||||
if (!sentence.trim()) kept.push(sentence);
|
||||
else if (textWithinAllowed(sentence, allowed, catalog)) {
|
||||
kept.push(justDropped === null ? sentence : withSubjectOf(sentence, justDropped));
|
||||
justDropped = null;
|
||||
} else {
|
||||
dropped.push(sentence.trim());
|
||||
removed = true;
|
||||
justDropped = sentence;
|
||||
}
|
||||
}
|
||||
if (!removed && keptRefs.length === refs.length) break;
|
||||
|
||||
@@ -75,6 +75,18 @@ const ADVICE_LABEL_LEAD = /(^|[。!?;]\s*)一般建议[::]\s*/gu;
|
||||
const ADVICE_LABEL_CLAUSE = /(?:——)?这(?:一点|一条|条)?(?:同样|也)?(?:只)?是一般(?:性的?)?建议(?:[,,]\s*不涉及[^;。,,]*)?[,,]?/gu;
|
||||
const SENTENCES = /[^。!?]+[。!?]?/gu;
|
||||
|
||||
/**
|
||||
* BUG-2038 (staging 复测第九轮, 2026-11-20; 占星师分层答复): three backstage notes in the sections that
|
||||
* give conclusions. Rules R-03 / R-05 now say not to write them; this catches what is still written.
|
||||
* 「依据与边界」 is where execution status belongs, so that section is left alone.
|
||||
*/
|
||||
// 「……,但这套结果还没有完成外部核对,不作为事件先后的依据」: whether an outside check was done.
|
||||
const EXTERNAL_CHECK = /[,,;;]?\s*(?:但|不过|只是)?(?:这套结果|这一套|这套|它)?(?:目前)?还?没有完成外部(?:核对|核验|验证)/gu;
|
||||
// 「观察日这一天的双行运只查了第7宫,没有激活;」: a check that found nothing.
|
||||
const DOUBLE_TRANSIT_IDLE = /(?:观察日)?(?:这一天)?(?:的)?(?:双行运|Double Transit)[^,。;]{0,16}只(?:查|检查|看)了?第\s*\d+\s*宫[,,]\s*(?:结论是)?没有激活[;;,,]?\s*/gu;
|
||||
// 「……入「极友」,六力值 6.0765 Rupa,同时受……」: the raw Shadbala total as an aside between commas.
|
||||
const SHADBALA_ASIDE = /[,,]\s*(?:六力值|六力|Shadbala)(?:([^)]{0,30}))?\s*(?:为|是)?\s*\d+(?:\.\d+)?\s*Rupa(?=[,,。;;])/gu;
|
||||
|
||||
/** Drops a sentence that only labels the advice; a paragraph that is nothing else is left alone. */
|
||||
function withoutAdviceMeta(text: string): string {
|
||||
const sentences = text.match(SENTENCES) ?? [text];
|
||||
@@ -83,8 +95,10 @@ function withoutAdviceMeta(text: string): string {
|
||||
}
|
||||
|
||||
/** Reader wording for one paragraph; text without these phrases comes back unchanged. */
|
||||
export function readerWording(text: string): string {
|
||||
const replaced = withoutAdviceMeta(text)
|
||||
export function readerWording(text: string, section?: string): string {
|
||||
const conclusions = section === "basis" ? text
|
||||
: text.replace(EXTERNAL_CHECK, "").replace(DOUBLE_TRANSIT_IDLE, "").replace(SHADBALA_ASIDE, "");
|
||||
const replaced = withoutAdviceMeta(conclusions)
|
||||
.replace(ADVICE_LABEL_LEAD, "$1")
|
||||
.replace(ADVICE_LABEL_CLAUSE, "")
|
||||
.replace(YOGA_CANDIDATE, YOGA_CANDIDATE_READER)
|
||||
|
||||
@@ -42,6 +42,7 @@ import {
|
||||
type BoundaryDependence,
|
||||
} from "./personal-report-boundary-line";
|
||||
import { readerWording } from "./personal-report-reading-wording";
|
||||
import { stripHealthReminders, withHealthNotice } from "./personal-report-health-notice";
|
||||
|
||||
export {
|
||||
REPORT_READING_BASIS_LABEL,
|
||||
@@ -421,6 +422,14 @@ function checkSection(
|
||||
allowExtraParagraphs = false,
|
||||
boundary: BoundaryDependence | null = null,
|
||||
): Checked {
|
||||
// BUG-2038: the health section's medical reminder is the program's (added below); the model's own are removed.
|
||||
if (section.id === "health") {
|
||||
const kept = section.paragraphs.flatMap((paragraph) => {
|
||||
const stripped = stripHealthReminders(paragraph.text);
|
||||
return stripped ? [stripped === paragraph.text.trim() ? paragraph : { ...paragraph, text: stripped }] : [];
|
||||
});
|
||||
if (kept.length) section = { ...section, paragraphs: kept };
|
||||
}
|
||||
const inferredRefs: string[][] = [];
|
||||
let text = "";
|
||||
const snippetFor = (matches?: (sentence: string) => boolean) => {
|
||||
@@ -449,7 +458,7 @@ function checkSection(
|
||||
// BUG-2013: the other-scenario line is the program's; it is taken off before the wording checks
|
||||
// and put back below on the first paragraph of the section that uses a boundary-dependent varga (BUG-2019).
|
||||
// BUG-2021: internal status words are put in reader wording before the checks, so the stored text has them too.
|
||||
text = readerWording(stripBoundaryLine(raw.text.trim(), boundary).trim());
|
||||
text = readerWording(stripBoundaryLine(raw.text.trim(), boundary).trim(), section.id);
|
||||
if (!text) return withheld("too_short");
|
||||
if (text.length > MAX_PARAGRAPH_CHARS) return withheld("too_long");
|
||||
const fieldName = (sentence: string) => /[_={}<>#*|`]/.test(sentence);
|
||||
@@ -511,6 +520,14 @@ function checkSection(
|
||||
if (stored === null) return withheld("too_long");
|
||||
paragraphs.push({ text: stored, claims: types, grade: paragraph.grade, refs: [...refs], refs_from_text: addedRefs });
|
||||
}
|
||||
// BUG-2038: one fixed medical reminder closes the health section (not in a replay of a historical figure,
|
||||
// where current advice is not given). It goes in front of a trailing other-scenario line, which stays last.
|
||||
const last = paragraphs[paragraphs.length - 1];
|
||||
if (section.id === "health" && facts?.current_advice_allowed !== false && last) {
|
||||
const tail = boundary ? last.text.slice(stripBoundaryLine(last.text, boundary).length) : "";
|
||||
const noticed = withHealthNotice(last.text, tail, MAX_PARAGRAPH_CHARS);
|
||||
if (noticed) paragraphs[paragraphs.length - 1] = { ...last, text: noticed };
|
||||
}
|
||||
if (disclaimers > 1) {
|
||||
text = section.paragraphs.flatMap(({ text }) => text.split(SENTENCE_END))
|
||||
.filter((sentence) => (sentence.match(DISCLAIMER)?.length ?? 0) > 0).join("。");
|
||||
|
||||
@@ -24,3 +24,36 @@ export function synastryAnalysisReaderText(text: string | undefined, names: Name
|
||||
const escaped = own.map((name) => name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
||||
return cleaned.split(new RegExp(`(${escaped})`, "u")).map((part) => (own.includes(part) ? part : relabel(part))).join("");
|
||||
}
|
||||
|
||||
/**
|
||||
* BUG-2038 (staging 复测第九轮, 2026-11-20): every 「所以:」 line read 「所以:所以……」, because the stored
|
||||
* sentence already opens with 「所以」 and the page adds the label. The label stays; the sentence's own
|
||||
* opening connective is taken off where it is shown.
|
||||
*/
|
||||
export function synastrySoReaderText(text: string | undefined, names: Names | undefined, language: "zh" | "en"): string {
|
||||
const shown = synastryAnalysisReaderText(text, names, language);
|
||||
return language === "zh" ? shown.replace(/^\s*所以[,,::]?\s*/u, "") : shown.replace(/^\s*so[,:]?\s+/iu, (lead) => (/^\s*so\s+that\b/iu.test(shown) ? lead : ""));
|
||||
}
|
||||
|
||||
// 「前 6.5 分钟」「偏晚 2.23 分钟」: minutes with a decimal part, written the way the personal report writes them (BUG-2034).
|
||||
const DECIMAL_MINUTES = /(\d+)\.(\d+)\s*分钟/gu;
|
||||
|
||||
/** 「6.5 分钟」 → 「6 分 30 秒」, 「0.5 分钟」 → 「30 秒」; whole minutes and other text are unchanged. */
|
||||
export function synastryMinutesReaderText(text: string): string {
|
||||
return text.replace(DECIMAL_MINUTES, (_match, whole: string, fraction: string) => {
|
||||
const total = Math.round(Number(`${whole}.${fraction}`) * 60);
|
||||
const minutes = Math.floor(total / 60);
|
||||
const seconds = total % 60;
|
||||
if (minutes === 0) return `${seconds} 秒`;
|
||||
return seconds === 0 ? `${minutes} 分钟` : `${minutes} 分 ${seconds} 秒`;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A line of 「技术依据摘要」 as a reader sees it: the same naming and tag removal as 「分析逻辑」, plus the
|
||||
* minute wording. Stored blocks are unchanged.
|
||||
*/
|
||||
export function synastryTechnicalReaderText(text: string | undefined, names: Names | undefined, language: "zh" | "en"): string {
|
||||
const shown = synastryAnalysisReaderText(text, names, language);
|
||||
return language === "zh" ? synastryMinutesReaderText(shown) : shown;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 2026-11-16 owner: the synastry report gets the same plain-text .md export as the annual report.
|
||||
import type { BirthInputState } from "./birth-input-revision";
|
||||
import { synastryAnalysisReaderText } from "./synastry-analysis-reader";
|
||||
import { synastryAnalysisReaderText, synastrySoReaderText, synastryTechnicalReaderText } from "./synastry-analysis-reader";
|
||||
import { reportBirthExportPreamble, type ReportBirthScenarios } from "./report-birth-marking.ts";
|
||||
import { withExportBirthInputState, type ReportExportBlock } from "./report-export-blocks";
|
||||
|
||||
@@ -83,8 +83,10 @@ export function buildSynastryExportBlocks(input: SynastryExportInput): ReportExp
|
||||
if (!section) continue;
|
||||
// BUG-2034: the analysis lines name the two people and drop machine tags, as on the page.
|
||||
const read = (value: unknown) => synastryAnalysisReaderText(text(value), input.names, input.language);
|
||||
const so = (value: unknown) => synastrySoReaderText(text(value), input.names, input.language);
|
||||
const reasons = rows(section.reasons).map((reason) => (
|
||||
zh ? `- 盘面:${read(reason.basis)}\n 所以:${read(reason.plain)}` : `- Chart: ${read(reason.basis)}\n So: ${read(reason.plain)}`
|
||||
// BUG-2038: the stored sentence opens with 「所以」 itself; the label is not doubled.
|
||||
zh ? `- 盘面:${read(reason.basis)}\n 所以:${so(reason.plain)}` : `- Chart: ${read(reason.basis)}\n So: ${so(reason.plain)}`
|
||||
));
|
||||
blocks.push(block(`body:${id}`, "body", title, [
|
||||
...synastryParagraphs(section.text),
|
||||
@@ -93,7 +95,9 @@ export function buildSynastryExportBlocks(input: SynastryExportInput): ReportExp
|
||||
}
|
||||
for (const item of rows(input.technical)) {
|
||||
const source = zh ? item : { ...item, ...record(item.english) };
|
||||
const lines = Array.isArray(source.lines) ? source.lines.map(text).filter(Boolean).map((line) => `- ${line}`) : [];
|
||||
// BUG-2038: technical lines read as on the page (two names, no machine tags, minutes as 分 / 秒).
|
||||
const lines = Array.isArray(source.lines)
|
||||
? source.lines.map(text).filter(Boolean).map((line) => `- ${synastryTechnicalReaderText(line, input.names, input.language)}`) : [];
|
||||
if (!text(source.title) || lines.length === 0) continue;
|
||||
blocks.push(block(`table:${text(item.id)}`, "table", text(source.title), [lines.join("\n")]));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
// BUG-2038 (staging 复测第九轮, 2026-11-20): small reader-text leftovers in the personal report and
|
||||
// the synastry appendix. Texts are the ones saved from that run.
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import test from "node:test";
|
||||
|
||||
import { HEALTH_NOTICE_ZH, stripHealthReminders, withHealthNotice } from "../src/lib/personal-report-health-notice";
|
||||
import { acceptReportReadingDraft } from "../src/lib/personal-report-reading";
|
||||
import { REPORT_READING_POSTCHECK_VERSION } from "../src/lib/personal-report-reading-audit";
|
||||
import {
|
||||
EVIDENCE_GRADE_CONTRACT, REPORT_READING_SECTIONS, type ReportReadingSectionId,
|
||||
} from "../src/lib/personal-report-reading-contract";
|
||||
import { withSubjectOf } from "../src/lib/personal-report-reading-rebind";
|
||||
import { readerWording } from "../src/lib/personal-report-reading-wording";
|
||||
import { productContractBlock } from "../src/lib/product-runtime-contract";
|
||||
import {
|
||||
synastryMinutesReaderText, synastrySoReaderText, synastryTechnicalReaderText,
|
||||
} from "../src/lib/synastry-analysis-reader";
|
||||
|
||||
const SKILL = { name: "reading", version: "test", loaded: [{ path: "SKILL.md", sha256: "0".repeat(64) }] };
|
||||
const NEUTRAL = "本段复述虚构记录中的顺序、参与者位置以及需要核对的几条线索。读者可对照各行说明追溯原记录。".repeat(3);
|
||||
const SUFFIX = "另一种情况下的结论还没有评估。";
|
||||
|
||||
function claim(cap: string, sections: string[], required: string[], checked: string[] = []) {
|
||||
return { cap, sections, required: required.map((id) => ({ id })), checked: checked.map((id) => ({ id })), auxiliary: [] };
|
||||
}
|
||||
|
||||
function facts(extra: Record<string, unknown> = {}, boundary?: unknown) {
|
||||
return {
|
||||
...extra,
|
||||
evidence_grades: {
|
||||
contract: EVIDENCE_GRADE_CONTRACT,
|
||||
claims: {
|
||||
character_structure: claim("C", ["character"], ["v:D1"], ["s:shadbala"]),
|
||||
health_pressure: claim("C", ["health"], ["v:D1", "v:D6"], ["s:shadbala"]),
|
||||
},
|
||||
dependency_catalog: {
|
||||
"v:D1": { state: "clear_at_tolerance", aliases: ["本命盘"] },
|
||||
"v:D6": { state: boundary ? "boundary_sensitive" : "clear_at_tolerance", aliases: ["D6"] },
|
||||
"p:marriage:UL": { state: "executed", aliases: ["UL"] },
|
||||
"s:shadbala": { state: "executed", aliases: ["六力"] },
|
||||
},
|
||||
...(boundary ? { boundary } : {}),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function draft(overrides: Partial<Record<ReportReadingSectionId, Record<string, unknown>[]>>) {
|
||||
return { sections: REPORT_READING_SECTIONS.map(({ id }) => ({
|
||||
id, paragraphs: [{ text: NEUTRAL, kind: "fact" }, { text: NEUTRAL, kind: "fact" }, ...(overrides[id] ?? [])],
|
||||
})) };
|
||||
}
|
||||
|
||||
function check(id: ReportReadingSectionId, paragraphs: Record<string, unknown>[], evidence = facts()) {
|
||||
const result = acceptReportReadingDraft(draft({ [id]: paragraphs }), evidence, SKILL);
|
||||
assert.ok(result.ok, JSON.stringify(result.diagnostics));
|
||||
const section = result.reading.sections.find((entry) => entry.id === id)!;
|
||||
return { section, stored: section.status === "ok" ? section.paragraphs.map(({ text }) => text) : [] };
|
||||
}
|
||||
|
||||
test("a pronoun left without its planet takes the planet the removed sentence named", () => {
|
||||
// Round nine, 性格 paragraph 3: 「它与落陷的木星互换了星座……」 after the sentence naming Saturn was removed.
|
||||
assert.equal(
|
||||
withSubjectOf("它与落陷的木星互换了星座——木星在土星掌管的摩羯座。", "土星落在第九宫双鱼座,UL 的位置由它照看。"),
|
||||
"土星与落陷的木星互换了星座——木星在土星掌管的摩羯座。",
|
||||
);
|
||||
assert.equal(withSubjectOf("这颗星的相位落在第三宫。", "月亮受土星相位,UL 在旁。"), "月亮的相位落在第三宫。");
|
||||
// No planet in the removed sentence, a plural, or no pronoun: left as written.
|
||||
for (const sentence of ["它与落陷的木星互换了星座。", "它们一起落在第三宫。", "木星在第七宫。"]) {
|
||||
assert.equal(withSubjectOf(sentence, sentence.startsWith("它与") ? "这一层没有取值。" : "土星落在第九宫。"), sentence);
|
||||
}
|
||||
const { stored } = check("character", [{
|
||||
text: "土星落在第九宫,UL 的位置由它照看。它与落陷的木星互换了星座,耐力够、成就感来得慢。",
|
||||
claims: ["character_structure"], grade: "C", refs: ["v:D1"],
|
||||
}]);
|
||||
assert.equal(stored.at(-1), "土星与落陷的木星互换了星座,耐力够、成就感来得慢。");
|
||||
});
|
||||
|
||||
test("backstage notes stay out of the sections that give conclusions; 依据与边界 keeps them", () => {
|
||||
assert.equal(
|
||||
readerWording("另一套大运(Narayana)只作参考,它同样把金星放在主导位置,但这套结果还没有完成外部核对,不作为事件先后的依据。"),
|
||||
"另一套大运(Narayana)只作参考,它同样把金星放在主导位置,不作为事件先后的依据。",
|
||||
);
|
||||
assert.equal(
|
||||
readerWording("观察日这一天的双行运只查了第7宫,没有激活;另一套大运(Narayana)只作参考,但不作为婚期依据。"),
|
||||
"另一套大运(Narayana)只作参考,但不作为婚期依据。",
|
||||
);
|
||||
assert.equal(
|
||||
readerWording("月亮这颗上升主星落在处女座第3宫,入「极友」,六力值 6.0765 Rupa,同时受木星与土星相位。"),
|
||||
"月亮这颗上升主星落在处女座第3宫,入「极友」,同时受木星与土星相位。",
|
||||
);
|
||||
const status = "Double Transit 只查了第 7 宫,没有激活;月亮六力值 6.0765 Rupa,达到本方法的最低线。";
|
||||
assert.equal(readerWording(status, "basis"), status);
|
||||
// A sentence that uses the value as its subject is not an aside and is left to the rule.
|
||||
const subject = "月亮的六力值 6.0765 Rupa 高于本方法的最低线。";
|
||||
assert.equal(readerWording(subject), subject);
|
||||
});
|
||||
|
||||
test("the health section closes with one fixed reminder; the model's own are taken out", () => {
|
||||
// Round nine: two reminders in a row at the end of 健康.
|
||||
assert.equal(stripHealthReminders("第六宫主落在第七宫,要多留意的是长期消耗。这些是结构上的条件,不是身体的结论。"), "第六宫主落在第七宫,要多留意的是长期消耗。");
|
||||
assert.equal(stripHealthReminders("以上是传统结构上的读法,不构成医疗判断;有具体不适要找医生。"), "");
|
||||
const content = "金星小运到 2027 年 5 月 15 日,这段时间作息容易乱,要多留意恢复。";
|
||||
assert.equal(stripHealthReminders(content), content);
|
||||
assert.equal(withHealthNotice("要多留意恢复。", "", 650), `要多留意恢复。${HEALTH_NOTICE_ZH}`);
|
||||
assert.equal(withHealthNotice(`要多留意恢复。出生时间前后几分钟,会影响这部分判断;${SUFFIX}`, `出生时间前后几分钟,会影响这部分判断;${SUFFIX}`, 650),
|
||||
`要多留意恢复。${HEALTH_NOTICE_ZH}出生时间前后几分钟,会影响这部分判断;${SUFFIX}`);
|
||||
assert.equal(withHealthNotice("长".repeat(640), "", 650), null);
|
||||
|
||||
const { stored } = check("health", [
|
||||
{ text: "第六宫主落在第七宫,长期消耗是要留意的地方。这些是结构上的条件,不是身体的结论。", claims: ["health_pressure"], grade: "C", refs: ["v:D1"] },
|
||||
{ text: "以上是传统结构上的读法,不构成医疗判断;有具体不适要找医生。", kind: "fact" },
|
||||
]);
|
||||
assert.equal(stored.length, 3);
|
||||
assert.equal(stored.at(-1), `第六宫主落在第七宫,长期消耗是要留意的地方。${HEALTH_NOTICE_ZH}`);
|
||||
assert.equal(stored.join("").split("医生").length - 1, 1);
|
||||
// Checked again (a stored reading, or a repair round), the sentence is not doubled.
|
||||
const again = check("health", [{ text: stored.at(-1)!, claims: ["health_pressure"], grade: "C", refs: ["v:D1"] }]);
|
||||
assert.equal(again.stored.at(-1), stored.at(-1));
|
||||
// A replay of a historical figure gives no current advice, so no reminder to see a doctor either.
|
||||
const replay = check("health", [{ text: "第六宫主落在第七宫。", kind: "fact" }], facts({ report_mode: "historical_replay", current_advice_allowed: false }));
|
||||
assert.ok(!replay.stored.join("").includes(HEALTH_NOTICE_ZH));
|
||||
// Other sections are untouched.
|
||||
assert.ok(!check("character", [{ text: "本命盘的上升在巨蟹座。", kind: "fact" }]).stored.join("").includes(HEALTH_NOTICE_ZH));
|
||||
});
|
||||
|
||||
test("the other-scenario line stays last when the health reminder is added", () => {
|
||||
const boundary = {
|
||||
contract: "report_boundary_dependence_v1", other_side_line_zh: SUFFIX,
|
||||
vargas: { D6: { kind: "sensitivity_range", label_zh: "D6", direction: "earlier", birth_time_seconds: 15 } },
|
||||
refs: { "v:D6": ["D6"] },
|
||||
};
|
||||
const { stored } = check("health", [
|
||||
{ text: "D6 里第六宫的压力偏重,长期消耗是要留意的地方。", claims: ["health_pressure"], grade: "C", refs: ["v:D6"] },
|
||||
], facts({}, boundary));
|
||||
assert.equal(stored.at(-1), `D6 里第六宫的压力偏重,长期消耗是要留意的地方。${HEALTH_NOTICE_ZH}出生时间前后几分钟,会影响这部分判断;${SUFFIX}`);
|
||||
});
|
||||
|
||||
test("the rules say what the 「现在这几年」 section leads with and what stays out of the body", () => {
|
||||
const contract = readFileSync(new URL("../../references/product_runtime_contract.md", import.meta.url), "utf8");
|
||||
const rules = productContractBlock("report-reading", { CLAIM_TYPES: "x" }, contract);
|
||||
assert.match(rules, /现在这几年:先用两三句说当事人这几年处在什么阶段/);
|
||||
assert.match(rules, /其他大运体系(Yogini、Kalachakra、Tribhagi、Shattimshatsama、Shastihayani、年盘的 Mudda 等)不在正文逐个列日期/);
|
||||
assert.match(rules, /transit_natal_sign 只列回到出生时所在星座的行星/);
|
||||
assert.match(rules, /没有列出的行星不写它「不在同一个星座」/);
|
||||
assert.match(rules, /Shadbala 的 Rupa 数值不写进各节正文/);
|
||||
assert.match(rules, /这一节的医疗提醒由系统在节末补一句固定的话/);
|
||||
assert.match(rules, /它没有激活时,各节正文不提它/);
|
||||
assert.match(rules, /不写它「还没有完成外部核对」/);
|
||||
assert.match(rules, /这一点目前还不能明确判断」,不写「候选」「筛出」「检出」/);
|
||||
assert.equal(REPORT_READING_POSTCHECK_VERSION, 11);
|
||||
});
|
||||
|
||||
test("synastry appendix: the 「所以」 label is not doubled", () => {
|
||||
const names = { a: "岳辰", b: "林瑶" };
|
||||
// Round nine: 「所以:所以岳辰在关系里要的是可靠……」 ×20.
|
||||
assert.equal(synastrySoReaderText("所以甲在关系里要的是可靠、能一起规划生活的伴侣。", names, "zh"), "岳辰在关系里要的是可靠、能一起规划生活的伴侣。");
|
||||
assert.equal(synastrySoReaderText("所以,乙把喜欢放在明面上。", names, "zh"), "林瑶把喜欢放在明面上。");
|
||||
assert.equal(synastrySoReaderText("甲更看重稳定,所以节奏慢。", names, "zh"), "岳辰更看重稳定,所以节奏慢。");
|
||||
assert.equal(synastrySoReaderText("So they settle slowly.", names, "en"), "they settle slowly.");
|
||||
assert.equal(synastrySoReaderText("So that both can plan, they talk first.", names, "en"), "So that both can plan, they talk first.");
|
||||
});
|
||||
|
||||
test("synastry technical summary: names, no machine tags, minutes as 分 and 秒", () => {
|
||||
const names = { a: "岳辰", b: "林瑶" };
|
||||
assert.equal(
|
||||
synastryTechnicalReaderText("乙方的月亮落甲方的第4宫(person_b_to_person_a,recipient_house 4);第4宫关联熟悉感。", names, "zh"),
|
||||
"林瑶的月亮落岳辰的第4宫;第4宫关联熟悉感。",
|
||||
);
|
||||
assert.equal(synastryTechnicalReaderText("甲的七宫主 土星 落第 9 宫 双鱼座", names, "zh"), "岳辰的七宫主 土星 落第 9 宫 双鱼座");
|
||||
assert.equal(
|
||||
synastryTechnicalReaderText("甲方按生时纠正选定的区间(前 6.5 分钟、后 1.7 分钟)", names, "zh"),
|
||||
"岳辰按生时纠正选定的区间(前 6 分 30 秒、后 1 分 42 秒)",
|
||||
);
|
||||
assert.equal(synastryMinutesReaderText("偏晚 2.23 分钟:天蝎座"), "偏晚 2 分 14 秒:天蝎座");
|
||||
assert.equal(synastryMinutesReaderText("偏早 0.5 分钟"), "偏早 30 秒");
|
||||
assert.equal(synastryMinutesReaderText("偏早 3.0 分钟;按前后各 30 分钟试算"), "偏早 3 分钟;按前后各 30 分钟试算");
|
||||
// English stays as stored apart from the machine tag.
|
||||
assert.equal(synastryTechnicalReaderText("Selected range (6.5 minutes before)", names, "en"), "Selected range (6.5 minutes before)");
|
||||
});
|
||||
@@ -186,13 +186,19 @@ test("the page's fact tables name a known planet from the product's table, not t
|
||||
test("the report rules ask for the natal-sign return and keep status words out of the body", () => {
|
||||
const contract = readFileSync(new URL("../../references/product_runtime_contract.md", import.meta.url), "utf8");
|
||||
const block = contract.slice(contract.indexOf("<!-- product-block:report-reading -->"), contract.indexOf("<!-- /product-block:report-reading -->"));
|
||||
assert.match(block, /transit_natal_sign 里 same_sign 为 true 的行,要写明这颗星回到了出生时它所在的星座/);
|
||||
// 原值: /transit_natal_sign 里 same_sign 为 true 的行,要写明这颗星回到了出生时它所在的星座/
|
||||
// 新值: 事实里只列回到本命星座的行星,规则照此写
|
||||
// 原因: BUG-2038,复测第九轮正文把不同座的一行写成「不在同一个星座」
|
||||
assert.match(block, /transit_natal_sign 只列回到出生时所在星座的行星:列出的要写明这颗星回到了出生时它所在的星座/);
|
||||
// 原值: /saturn_from_moon 写出行运土星在本命月亮起第几宫/(规则让模型「同一句里照 saturn_from_moon 写出」)
|
||||
// 新值: 规则指向事实包里成句的 summary_zh
|
||||
// 原因: BUG-2024,复测第六轮正文把「同一句要并读」抄了出来;怎么并列由程序写成事实句
|
||||
assert.match(block, /用 transits\.sade_sati\.summary_zh 给出的事实/);
|
||||
assert.match(block, /行运土星在本命月亮起第几宫、是否属于 Kantaka 或 Ashtama Shani/);
|
||||
assert.match(block, /state 为 candidate 的只说它是按规则筛出的候选/);
|
||||
// 原值: /state 为 candidate 的只说它是按规则筛出的候选/
|
||||
// 新值: 候选格局各节正文不拿它下判断,提到时用日常话
|
||||
// 原因: BUG-2038(占星师 2026-11-19 分层答复:读者看到的是「这一点目前还不能明确判断」);复测第九轮正文写「按规则筛选出来的候选里……被检出」
|
||||
assert.match(block, /state 为 candidate 的不说成已经形成,各节正文不拿它下判断/);
|
||||
assert.doesNotMatch(block, /现实里是否应验另说;/);
|
||||
assert.doesNotMatch(block, /参数敏感的层/);
|
||||
});
|
||||
|
||||
@@ -138,7 +138,11 @@ test("a section with field names, fate, disease, investment or stacked disclaime
|
||||
["love:banned_phrase", draft({ love: [`${PARAGRAPH}明年一定会结婚。`] })],
|
||||
// #192 eval 2026-11-12: the draft wrote that web and case calibration were not done (BUG-1794: backstage only).
|
||||
["basis:banned_phrase", draft({ basis: [`${PARAGRAPH}全球网络资料采集与真实案例校准在本次都未完成。`] })],
|
||||
["health:disclaimer", draft({ health: [`${PARAGRAPH}仅供参考。`, `${PARAGRAPH}不构成医疗意见。`] })],
|
||||
// 原值: ["health:disclaimer", draft({ health: [`${PARAGRAPH}仅供参考。`, `${PARAGRAPH}不构成医疗意见。`] })]
|
||||
// 新值: 同一条检查放在事业一节
|
||||
// 原因: BUG-2038,健康一节里模型自己写的医疗提醒由程序去掉、节末补一句固定的话,不再因此扣下整节;
|
||||
// 其他各节叠两句免责仍然扣下
|
||||
["career:disclaimer", draft({ career: [`${PARAGRAPH}仅供参考。`, `${PARAGRAPH}不能替代专业判断。`] })],
|
||||
// 原值:PARAGRAPH.repeat(5)(690 字,超过旧上限 420);新值:repeat(6)(828 字,超过新上限 700)
|
||||
// 原因:产品 2026-11-07 占星师方案:段落上限随专业写法放宽
|
||||
["career:too_long", draft({ career: [PARAGRAPH.repeat(6)] })],
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
type ReportReadingSectionId,
|
||||
} from "../src/lib/personal-report-reading-contract";
|
||||
import { buildReportExportBlocks } from "../src/lib/report-export-blocks";
|
||||
import { HEALTH_NOTICE_ZH } from "../src/lib/personal-report-health-notice";
|
||||
|
||||
const SKILL = { name: "reading", version: "test", loaded: [{ path: "SKILL.md", sha256: "0".repeat(64) }] };
|
||||
const NEUTRAL = "本段复述虚构记录中的顺序、参与者位置以及需要核对的几条线索。读者可对照各行说明追溯原记录。".repeat(3);
|
||||
@@ -199,7 +200,12 @@ test("rebind adds a permitted dependency and timing claim, converts a fact, and
|
||||
assert.ok(sections.every(({ status }) => status === "ok"));
|
||||
for (const section of sections) {
|
||||
assert.ok(section.status === "ok");
|
||||
assert.deepEqual(section.paragraphs.map(({ text }) => text), body.sections.find(({ id }) => id === section.id)!.paragraphs.map(({ text }) => text));
|
||||
// 原值: 各节保存的正文与草稿逐段相同
|
||||
// 新值: 健康一节最后一段末尾多一句程序补的医疗提醒
|
||||
// 原因: BUG-2038,健康一节的提醒由程序补一句固定的话,模型不写
|
||||
const written = body.sections.find(({ id }) => id === section.id)!.paragraphs.map(({ text }) => text);
|
||||
assert.deepEqual(section.paragraphs.map(({ text }) => text),
|
||||
section.id === "health" ? [...written.slice(0, -1), `${written.at(-1)}${HEALTH_NOTICE_ZH}`] : written);
|
||||
}
|
||||
assert.deepEqual(log.auto_rebound?.map(({ section, rule, added_claims, grade_from, grade_to }) =>
|
||||
[section, rule, added_claims, grade_from, grade_to]), [
|
||||
|
||||
@@ -104,7 +104,7 @@ test("the stored snapshot binds the selected raw response and records a failed r
|
||||
system_prompt_sha256: reportReadingSha256("原始提示"),
|
||||
raw_response_sha256: canonicalReportReadingSha256(rawResponse),
|
||||
stored_sha256: canonicalReportReadingSha256(stored),
|
||||
rules: { evidence_grade_contract: EVIDENCE_GRADE_CONTRACT, postcheck_version: 10, git_commit: COMMIT }, // 原值 9;新值 10;原因: BUG-2034 正文写法收尾(建议句后的说明、日期写法、窗口级引子);此前各次见 personal-report-reading-audit.ts
|
||||
rules: { evidence_grade_contract: EVIDENCE_GRADE_CONTRACT, postcheck_version: 11, git_commit: COMMIT }, // 原值 9;新值 10;原因: BUG-2034 正文写法收尾(建议句后的说明、日期写法、窗口级引子);此前各次见 personal-report-reading-audit.ts;BUG-2038 再由 10 改为 11
|
||||
});
|
||||
assert.equal(stored.transform_log.selected_attempt, 1);
|
||||
assert.equal(stored.transform_log.retries, 1);
|
||||
|
||||
@@ -53,5 +53,6 @@ test("developer words the reading picked up are put in reader words before the c
|
||||
assert.equal(readerWording("这条具名规则成立,但证据链还不完整,两种方法版本结论不同。"), "这条规则成立,但依据还不完整,两种算法结论不同。");
|
||||
assert.equal(readerWording("木星落陷,不过不利影响有缓解。"), "木星落陷,不过不利影响有缓解。");
|
||||
// 原值 8;新值 9;原因: BUG-2028
|
||||
assert.equal(REPORT_READING_POSTCHECK_VERSION, 10); // 原值 9;新值 10;原因: BUG-2034 正文写法收尾(建议句后的说明、日期写法、窗口级引子)
|
||||
// 原值 9;新值 10;原因: BUG-2034 正文写法收尾(建议句后的说明、日期写法、窗口级引子)
|
||||
assert.equal(REPORT_READING_POSTCHECK_VERSION, 11); // 原值 10;新值 11;原因: BUG-2038 代词补主语、健康提醒由程序补、后台说明不进各节正文
|
||||
});
|
||||
|
||||
@@ -293,6 +293,8 @@ evidence_card.backstage records, for the backend only, that global web evidence
|
||||
|
||||
<!-- 产品公告 G-6(BUG-2034,2026-11-19 测试环境复测第八轮;占星师 2026-11-19 分层答复、产品负责人 2026-11-16「不写推责的话」):原值为「几条建议」里一般性的建议要写明「一般建议」;离换座点的距离写成出生时间相差多少秒;Sade Sati 照 summary_zh 写。新值为建议只写有依据的、直接写做什么,不在句后说明来历或性质,没有依据的一般建议不写;距离照分盘 summary_zh 的几分几秒写,不写小数分钟;Sade Sati 的事实写进自己的句子,不整句照抄,日期写成「2027 年 5 月 20 日」;不写「应期只到窗口级」「本次只按候选记录,不作结论」这类引子。原因:复测里四条建议每条末尾都拖一句说明,「依据与边界」出现「提前 5.017 分钟」「相差 301 秒」,「Sade Sati 的说法是:…2027-05-20…」照抄事实句。事实字段的含义和计算不变。 -->
|
||||
|
||||
<!-- 产品公告 G-7(BUG-2038,2026-11-20 测试环境复测第九轮;占星师 2026-11-19 分层答复、产品负责人 2026-11-16「不写推责的话」):原值为「现在这几年」逐个体系列日期,并写出「行运木星……不在同一个星座」;格局候选写成「按规则筛出的候选」;健康一节由模型自己写提醒(复测里连写两句);正文出现「六力值 6.0765 Rupa」「双行运只查了第7宫,没有激活」「这套结果还没有完成外部核对」。新值为「现在这几年」先说这几年处在什么阶段,正文只给主运 Vimshottari 的日期,Narayana 至多一句,其他大运体系和逐颗行运度数留在后面的章节;事实里只列回到本命星座的行星;候选格局用日常话说「这一点目前还不能明确判断」;健康一节的医疗提醒由系统在节末补一句固定的话,模型不写;Shadbala 的 Rupa 数值、没有激活的 Double Transit、外部核对有没有做,都不写进各节正文。原因:读者要看的是结论和会改变结论的条件;这些是后台信息。事实字段的含义和计算不变。 -->
|
||||
|
||||
<!-- product-block:report-reading -->
|
||||
<!-- 产品规则,不是占星师的方法:R-01 输入边界。 -->
|
||||
你在给一份个人星盘报告写开头的「解读」。用户消息里的盘面事实(report-reading-facts-v3)是引擎已经算好的全部材料,只用这些,不编数据,不另起算法,不凭印象重算尊贵度、宫位或日期。事实里没有的层就当没有。
|
||||
@@ -301,10 +303,10 @@ evidence_card.backstage records, for the backend only, that global web evidence
|
||||
<!-- 产品规则,不是占星师的方法:R-03 九节职责。她 §5.1。 -->
|
||||
九节固定,按顺序:总评、性格、事业、财富、感情、健康、现在这几年、几条建议、依据与边界。
|
||||
- 总评:先用三到六句回答这张盘最突出的地方,再简短给依据。原始数值和逐项技法放在后面的计算依据里,正文不必每段先列一长串依据,但用到的数值必须照事实原值写。
|
||||
- 性格:只写静态结构(上升、月亮、上升主等),不要求每项性格都配大运。
|
||||
- 性格:只写静态结构(上升、月亮、上升主等),不要求每项性格都配大运。Shadbala 的 Rupa 数值不写进各节正文(数值在后面的计算依据里)。
|
||||
- 事业、财富、感情、健康:先结论,再简短依据。讲时间时按「本命承诺 → 激活 → 落地 → 应期」推理;落地的依据不足时,只写条件窗口,并把条件直接写进这句判断里(例如「这段时间更有利于争取岗位调整,是否形成实际变动还取决于……」),不在句前句后另加「应期只到窗口级」「只到窗口级」「不写成已经落地」这类说明。财富分开写「能不能挣到」和「能不能留下」。感情先分清是心动、成对还是法律婚,不把所有关系需求都当成婚姻。
|
||||
- 健康:只写有依据的传统条件和要多留意的时段,不从 6、8、12 宫直接推出免疫、睡眠这类具体身体事实,不写病名。D30 能不能用看 birth_precision 和 evidence_grades,不只看 minute_confirmed。
|
||||
- 现在这几年:写明实际覆盖哪几年。行运写成「observation_date 这一天的行运位置」,只当作那一天的位置来写,不由它推出几个月或几年的结论,也不在正文里解释这条限制;时间粒度由证据决定。transits.transit_natal_sign 里 same_sign 为 true 的行,要写明这颗星回到了出生时它所在的星座,并照写 end 给出的离开日期(已有的换座记录;end 为 not_available 就不写日期),只陈述位置和日期,不由此另加推断。写到 Sade Sati 时,用 transits.sade_sati.summary_zh 给出的事实(Sade Sati 是否启动,以及行运土星在本命月亮起第几宫、是否属于 Kantaka 或 Ashtama Shani、哪一天离开),不只写「未启动」;把它写进自己的句子里,不整句照抄,也不用「Sade Sati 的说法是」这类引子,同一件事全篇说一次就够。正文里的日期一律写成「2027 年 5 月 20 日」这种形式。
|
||||
- 健康:只写有依据的传统条件和要多留意的时段,不从 6、8、12 宫直接推出免疫、睡眠这类具体身体事实,不写病名。这一节的医疗提醒由系统在节末补一句固定的话,正文不要自己写「不构成医疗判断」「不是身体的结论」「有不适要找医生」这类提醒。D30 能不能用看 birth_precision 和 evidence_grades,不只看 minute_confirmed。
|
||||
- 现在这几年:先用两三句说当事人这几年处在什么阶段、主题落在生活的哪一块(主运 Vimshottari 当前大运、小运的主星在这张盘上管什么),再写明实际覆盖哪几年。正文里的日期只给 Vimshottari 的大运、小运和接下来一两个小运;Narayana 至多一句并说明只作参考;其他大运体系(Yogini、Kalachakra、Tribhagi、Shattimshatsama、Shastihayani、年盘的 Mudda 等)不在正文逐个列日期,它们在后面的计算依据里。行运写成「observation_date 这一天的行运位置」,只写正文用到的那几颗星,不逐颗罗列度数;只当作那一天的位置来写,不由它推出几个月或几年的结论,也不在正文里解释这条限制;时间粒度由证据决定。transits.transit_natal_sign 只列回到出生时所在星座的行星:列出的要写明这颗星回到了出生时它所在的星座,并照写 end 给出的离开日期(已有的换座记录;end 为 not_available 就不写日期),只陈述位置和日期,不由此另加推断;没有列出的行星不写它「不在同一个星座」。写到 Sade Sati 时,用 transits.sade_sati.summary_zh 给出的事实(Sade Sati 是否启动,以及行运土星在本命月亮起第几宫、是否属于 Kantaka 或 Ashtama Shani、哪一天离开),不只写「未启动」;把它写进自己的句子里,不整句照抄,也不用「Sade Sati 的说法是」这类引子,同一件事全篇说一次就够。正文里的日期一律写成「2027 年 5 月 20 日」这种形式。
|
||||
- 几条建议:两到四条,每条只能落在前面已经有依据的主题上,直接写要做什么、为什么值得做;前面没有依据的一般建议不写。不在句后说明这条建议的来历或性质(是不是从星盘来的、算不算一般建议、具体还要看现实条件、不宜下确定结论这类话都不写;依据在文末的「逐条依据」里);不从数值门槛推出具体作息时刻、贷款或资产安排。
|
||||
- 依据与边界:功能吉星、功能凶星及与自然吉凶的冲突;实际用到的技法;没有使用的层及原因(按 participation 的 state 和 reason_code 写:not_routed 是这一层放在别的章节里使用,这里不重复,正文写成「已放在某某部分使用」,不写「路由」;not_in_domain_route 是占星师这一领域的必查模块没有列它,带 computed 的已经算出数值,要写「已算出,本报告不用它下结论」,不能说参考资料里没有、没有来源或没有计算;not_computed 才是没有计算);只作参考的层(事实里 state 为 parameter_sensitive 的层,正文写成「只作参考」,不写「参数敏感」);出生时间精度与 birth_precision 里接近边界的分盘;岁差、交点、宫制。
|
||||
各层的执行状态(已算出但不用、没有取值、内容为空、没有路由、没有计算)只写在「依据与边界」一节;其他各节只写用上的依据和结论,不叙述某一层有没有算、有没有取值。
|
||||
@@ -313,11 +315,11 @@ evidence_card.backstage records, for the backend only, that global web evidence
|
||||
九节逐段区分判断和纯事实。判断段填写 claims 和 grade,claims 至少一类。evidence_grades.claims 列出各类的上限 cap(A 最高,D 最低)及 required、checked。混合多类判断可拆段,也可合写并取最严格的上限。refs 可选,列出主要依据即可,只能从所列各类的 required 和 checked 并集中取。正文点名的层由系统按 dependency_catalog 自动绑定到这些结论允许的依赖,并计入等级判断。引用的依赖缺失或未评估,等级只能是 D。evidence_grades.boundary.vargas 列出在另一种出生情景下上升星座会不同的分盘(本命盘 D1 不在其中,D1 跨边界时相关结论仍是 D):这不让整节停写。不用这些分盘的判断照常写、照常分级;用到其中某个分盘的上升、宫位或宫主的判断,按当前这一侧的盘面写出结论,等级不因此降为 D,段末由系统补一句出生时间的说明(「出生时间前后几分钟,会影响这部分判断;另一种情况下的结论还没有评估」),正文不要自己再写这句,也不要把整节写成暂不能判断。说到离换座点多近时,照 birth_precision 里该分盘 summary_zh 的写法(出生时间提前或推后几分几秒),不写带小数的分钟,也不写成角度的分。分盘代号不加书名号。判断段提到四位年份、数字连写的月份、大运、小运、次小运或窗口时,claims 必须含 timing_window。总评和建议只能引用本稿性格、事业、财富、感情、健康、现在这几年六节已经分级的判断,沿用其中最严格的等级。只复述盘面事实、交代方法或给一般操作说明时,填 kind 为 fact,正文不夹带「意味着」「适合」等推断,省略 claims、grade 和 refs。
|
||||
等级含义:C 是有星盘来源和可计算的依据、还没有经过案例校准;D 是这条结论需要的关键依据缺失或无法判别。D 的段落用日常话写「这一点目前还不能明确判断」,再说缺了什么,不写结果。不要在正文里写「置信度:」或「证据等级:」,也不写 A、B、C、D 这些字母;等级只在后台保存,不给读者看。must_disclose 里的缺口和只作参考的层,在「依据与边界」一节各说一次;其中某一项会改变某条结论的方向或时间时,在那条结论的句子里把这个条件说出来,其他段落不重复。只有某类结论的必需依据全部可用时,才能说它「没有关键阻塞」。
|
||||
<!-- 产品规则,不是占星师的方法:R-05 不把不同体系的不同当冲突。她 §5.1、§6 P1。 -->
|
||||
两套大运(Vimshottari、Narayana)的主星或星座不同,本身不是冲突;同名主星也不自动算一致。只有对应同一件事、同一段时间、同一个判断方向时,才比较是否一致。KP 与整宫制结果不同,写成方法差异。Double Transit 只对 checked_houses 里的宫位有结论,不推到别的宫或别的领域。
|
||||
两套大运(Vimshottari、Narayana)的主星或星座不同,本身不是冲突;同名主星也不自动算一致。只有对应同一件事、同一段时间、同一个判断方向时,才比较是否一致。KP 与整宫制结果不同,写成方法差异。Double Transit 只对 checked_houses 里的宫位有结论,不推到别的宫或别的领域;它没有激活时,各节正文不提它,也不写「只查了第几宫」(这属于执行状态,只在「依据与边界」说)。另一套大运只作参考时,写「只作参考」就够,不写它「还没有完成外部核对」。
|
||||
<!-- 产品规则,不是占星师的方法:R-06 格局与尊贵度。她 §5.1、§6 P1。 -->
|
||||
格局按 yogas 每一行的形成状态写:满足了来源的形成条件就可以说形成,不把未经现实验证写成未形成;state 为 candidate 的只说它是按规则筛出的候选,不说成已经形成,也不再加「本次只按候选记录,不作结论」这类说明。状态原词(「命中候选」「尚未完整确认」)不照抄进正文,句后也不另加「现实是否应验另说」这类说明。尊贵度照 dignity_zh 原词写(入旺、入庙、落陷……),不自己翻译。dignity_zh 以「落陷;这一配置的不利影响有缓解因素」开头的行星:用自己的话讲清它落陷、不利影响有缓解、但困难不会因此全部消失,结合它所在的宫位说这对当事人意味着什么;不写「落陷取消」「取消条件已满足」,也不整句照抄这条状态。
|
||||
格局按 yogas 每一行的形成状态写:满足了来源的形成条件就可以说形成,不把未经现实验证写成未形成;state 为 candidate 的不说成已经形成,各节正文不拿它下判断;要提到时用日常话,例如「盘里有某某格局的迹象,这一点目前还不能明确判断」,不写「候选」「筛出」「检出」,也不再加「本次只按候选记录,不作结论」这类说明。状态原词(「命中候选」「尚未完整确认」)不照抄进正文,句后也不另加「现实是否应验另说」这类说明。尊贵度照 dignity_zh 原词写(入旺、入庙、落陷……),不自己翻译。dignity_zh 以「落陷;这一配置的不利影响有缓解因素」开头的行星:用自己的话讲清它落陷、不利影响有缓解、但困难不会因此全部消失,结合它所在的宫位说这对当事人意味着什么;不写「落陷取消」「取消条件已满足」,也不整句照抄这条状态。
|
||||
<!-- 产品规则,不是占星师的方法:R-07 术语与红线(原 REPORT_READING_SYSTEM 第 9–11 条,未改)。 -->
|
||||
可以写技法名和分盘代号(Vimshottari、Narayana、D10、A10、UL、AK、AmK、DK、KP、Shadbala、Ashtakavarga、Sade Sati),第一次出现时在括号里用半句中文说明它看什么。行星、星座用中文;交点只叫罗睺、计都。不写字段名、下划线、花括号、井号、代码,不写「本仓」「检测器」「字段」「口径」「参数敏感」「双体系确认」「具名规则」「证据链」「方法版本」「候选分支」这类内部说法。审计行里网上检索和案例校准这两行只在后台记录(产品 2026-11-08 决定,BUG-1794),正文不写它们有没有做;等级不给读者看。不写病名、诊断和身体部位的疾病;不给投资指令,不点名股票、基金、币;不写「注定」「先苦后甜」「宿命」「一定会」;不预测死亡、必然离婚、怀孕与孩子性别、某天必然发财;婚姻、生死不下确定结论。每节最多一句提醒,不逐句免责。
|
||||
可以写技法名和分盘代号(Vimshottari、Narayana、D10、A10、UL、AK、AmK、DK、KP、Shadbala、Ashtakavarga、Sade Sati),第一次出现时在括号里用半句中文说明它看什么。行星、星座用中文;交点只叫罗睺、计都。不写字段名、下划线、花括号、井号、代码,不写「本仓」「检测器」「字段」「口径」「参数敏感」「双体系确认」「具名规则」「证据链」「方法版本」「候选分支」这类内部说法。审计行里网上检索和案例校准这两行只在后台记录(产品 2026-11-08 决定,BUG-1794),正文不写它们有没有做;等级不给读者看。不写病名、诊断和身体部位的疾病;不给投资指令,不点名股票、基金、币;不写「注定」「先苦后甜」「宿命」「一定会」;不预测死亡、必然离婚、怀孕与孩子性别、某天必然发财;婚姻、生死不下确定结论。每节最多一句提醒,不逐句免责;健康一节的提醒由系统补,正文不写。
|
||||
<!-- 产品规则,不是占星师的方法:R-08 篇幅与输出格式。 -->
|
||||
每节一到六段,每段不超过六百五十字,全篇三千到一万五千字。只输出 JSON,顶层为 {"sections":[…]}。九节的 id 依次是 overview、character、career、wealth、love、health、now、advice、basis,各节的 paragraphs 按段选择一种形态,例如 {"text":"水星落第五宫。","kind":"fact"} 或 {"text":"本命盘显示……","claims":["character_structure"],"grade":"C","refs":["v:D1"]}。claims 的每项只能取 {{CLAIM_TYPES}} 之一,grade 只能取 A、B、C、D。
|
||||
收到章节修改请求时,只按退回原因与命中片段重写指定章节。沿用同一份事实包、段落标注和证据等级规则。仍用 `sections` 数组,按请求顺序返回指定章节,各返回一次。
|
||||
@@ -756,3 +758,17 @@ evidence_card.backstage records, for the backend only, that global web evidence
|
||||
- 「逐条依据」:每行不列 `v:` 开头的上升稳定性检查(每类结论都要过,尤其 `v:D1`);只引用了它的段落写「依据:本命盘」。受影响的段落仍标「受出生时间前后几分钟影响」。等级计算和存下来的引用不变。
|
||||
- 年运报告:评级项下面不再有「证据等级 X:……」一行,只列原因(「这一点目前还不能明确判断:……」),没有原因就不显示;附录「证据等级上限」一块在页面和导出里叫「各类结论的依据情况」,每行写「所需依据已算出」或「这一点目前还不能明确判断」。快照里的等级、原因和附录原行不变。
|
||||
- 合盘报告:正文和导出里没有等级行,本条没有改动;「分析逻辑」显示时把「甲」「乙」换成两个人的称呼并去掉带下划线机器名的括注(存下来的文字不变,写作核对仍按原文比对);技术附录里「研究扫描 v1」写成「探索性扫描(版本 v1)」,「随参数变化」写成「只作参考」。
|
||||
|
||||
## AR. 读者正文的几处收尾(产品 2026-11-20,BUG-2038)
|
||||
|
||||
依据:占星师 2026-11-19 分层答复;产品负责人 2026-11-16「不写推责的话」;测试环境复测第九轮。
|
||||
|
||||
- 个人报告:程序按句去掉越界引用(§AM)之后,紧跟的句子若以「它」「这颗星」「该星」开头,换成被删句最先点名的行星;被删句没有点名行星时不动。
|
||||
- 报告事实 `transits.transit_natal_sign` 只列回到本命星座的行星;不同座的不列,正文也不写「不在同一个星座」(规则 R-03,公告 G-7)。
|
||||
- 「现在这几年」先说处在什么阶段;正文日期只给 Vimshottari,Narayana 至多一句,其他大运体系与逐颗行运度数留在后面的计算依据(规则 R-03)。
|
||||
- 中文开篇时间线的「Narayana 当前大运」不带算法标签;标签在 Narayana 章节和附录。英文版不变。
|
||||
- 各节正文不写:外部核对有没有做、没有激活的 Double Transit、Shadbala 的 Rupa 数值(规则 R-03、R-05;残留由程序去掉)。「依据与边界」一节不受这条影响。
|
||||
- 候选格局:各节正文不拿它下判断,提到时用日常话「这一点目前还不能明确判断」(规则 R-06)。数据章节里的状态文字不变。
|
||||
- 健康一节:模型不写医疗提醒,程序在节末补一句「这一节不构成医疗建议,身体有具体不适请找医生。」;历史人物回放不补。
|
||||
- 合盘显示:「所以:」后面不重复「所以」;「技术依据摘要」与「分析逻辑」同样处理(两个人的称呼、去掉带下划线机器名的括注),带小数的分钟写成几分几秒。保存的文字不变。
|
||||
|
||||
|
||||
@@ -183,8 +183,11 @@ def timeline(packet: dict, language: str) -> str:
|
||||
if md.get("sign"):
|
||||
label = narayana.get("algorithm_label" if zh else "algorithm_label_en")
|
||||
heading = "Narayana 当前大运" if zh else "Current Narayana period"
|
||||
if label:
|
||||
heading += f"({label})" if zh else f" ({label})"
|
||||
# BUG-2038 原值:中文开篇也带模块给出的算法标签(版本与出处,写在括号里)。
|
||||
# 新值:中文开篇不带;标签留在后面的 Narayana 章节和附录。英文版不变。
|
||||
# 原因:复测第九轮;开篇是读者正文,版本出处是后台信息(占星师 2026-11-19 分层答复)。
|
||||
if label and not zh:
|
||||
heading += f" ({label})"
|
||||
current_periods = [(heading, md)]
|
||||
if ad.get("sign") and current.get("ad_status") != "blocked":
|
||||
current_periods.append(("小运" if zh else "Antardasha", ad))
|
||||
|
||||
@@ -737,8 +737,12 @@ def _transits(packet: dict, full_reading: dict | None = None) -> dict[str, Any]:
|
||||
returns = transit_natal_sign_facts(
|
||||
dig(packet, "core_chart.planets"), out.get("planets"), key_dates, out.get("target_date"),
|
||||
)
|
||||
if returns:
|
||||
out["transit_natal_sign"] = returns
|
||||
# BUG-2038 原值:两颗星各一行,same_sign 为 false 的也给。新值:只给回到本命星座的行。
|
||||
# 原因:复测第九轮正文写出「行运木星从出生时的摩羯座走到狮子座,不在同一个星座」这种没有内容的话;
|
||||
# 问答的关键事实行同样只列 same_sign 为 true 的(BUG-2006)。`returns` 仍完整,用于下面取土星离开日期。
|
||||
back = [row for row in returns if row.get("same_sign") is True]
|
||||
if back:
|
||||
out["transit_natal_sign"] = back
|
||||
sade = dig(packet, SADE_SATI)
|
||||
if isinstance(sade, dict):
|
||||
out["sade_sati"] = _pick(sade, ("is_active", "phase", "moon_sign", "phases"))
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
"""BUG-2038 (staging 复测第九轮, 2026-11-20): reader-text leftovers on the Python side of the personal report."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from scripts.report_render import reading_facts
|
||||
from scripts.report_render.opening_guide import timeline
|
||||
|
||||
|
||||
def _packet(saturn_sign: str) -> dict:
|
||||
timing = {
|
||||
"transit_positions": {"target_date": "2026-11-19", "planets": {
|
||||
"Saturn": {"sign": saturn_sign, "degree_in_sign": 15.6}, "Jupiter": {"sign": "Leo", "degree_in_sign": 3.3}}},
|
||||
"transit_multi_reference": {"transit_analysis": {"Saturn": {"house_from_ref": {"Chandra_Lagna": {"house": 7}}}}},
|
||||
}
|
||||
return {
|
||||
"core_chart": {"planets": {"Saturn": {"sign": "Pisces"}, "Jupiter": {"sign": "Capricorn"}}},
|
||||
"worksheets": {
|
||||
"timing_and_predictive_systems": timing,
|
||||
"advanced_systems": {"yogas_doshas": {"sade_sati": {"is_active": False, "phase": "none", "moon_sign": "Virgo"}}},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_only_a_planet_back_in_its_natal_sign_is_given_to_the_reading() -> None:
|
||||
# 复测第九轮正文:「行运木星从出生时的摩羯座走到狮子座,不在同一个星座。」
|
||||
rows = reading_facts._transits(_packet("Pisces"), {})["transit_natal_sign"]
|
||||
assert [row["planet"] for row in rows] == ["Saturn"] and rows[0]["same_sign"] is True
|
||||
away = reading_facts._transits(_packet("Aries"), {})
|
||||
assert "transit_natal_sign" not in away
|
||||
# Saturn's house from the Moon is still stated when it is not in its natal sign.
|
||||
assert away["sade_sati"]["saturn_from_moon"]["house"] == 7
|
||||
|
||||
|
||||
def _narayana_packet() -> dict:
|
||||
return {"worksheets": {"timing_and_predictive_systems": {"narayana_dasha": {
|
||||
"algorithm_label": "Sanjay Rath 版(默认;按原书 p.43 正文(第七轮裁定))",
|
||||
"algorithm_label_en": "Sanjay Rath version (default)",
|
||||
"current_dasha": {"md": {"sign": "Libra", "start": "2018-08-08", "end": "2028-08-07", "start_age": 21.0, "end_age": 31.0}},
|
||||
}}}}
|
||||
|
||||
|
||||
def test_the_chinese_opening_names_the_narayana_period_without_the_profile_label() -> None:
|
||||
# 复测第九轮开篇:「Narayana 当前大运(Sanjay Rath 版(默认;按原书 p.43 正文(第七轮裁定))):天秤座 …」
|
||||
zh = timeline(_narayana_packet(), "zh")
|
||||
assert "Narayana 当前大运:天秤座" in zh
|
||||
assert "Sanjay Rath" not in zh and "第七轮裁定" not in zh
|
||||
# The English opening is unchanged.
|
||||
assert "Current Narayana period (Sanjay Rath version (default)): " in timeline(_narayana_packet(), "en")
|
||||
@@ -101,8 +101,11 @@ def _packet(saturn_sign: str, house_from_moon: int) -> dict:
|
||||
def test_report_facts_name_the_return_and_saturn_from_the_moon_next_to_sade_sati(monkeypatch) -> None:
|
||||
monkeypatch.setattr(reading_facts, "slow_transit_key_dates", lambda packet, full, day: INGRESS)
|
||||
transits = reading_facts._transits(_packet("Pisces", 7), {})
|
||||
saturn, jupiter = transits["transit_natal_sign"]
|
||||
assert saturn["same_sign"] is True and saturn["end"] == "2027-05-20" and jupiter["same_sign"] is False
|
||||
# 原值: 土星、木星各一行,木星 same_sign 为 False 也在事实里
|
||||
# 新值: 只列回到本命星座的行(这里只有土星)
|
||||
# 原因: BUG-2038,复测第九轮正文把不同座的那一行写成「不在同一个星座」,没有内容
|
||||
(saturn,) = transits["transit_natal_sign"]
|
||||
assert saturn["same_sign"] is True and saturn["end"] == "2027-05-20"
|
||||
sade = transits["sade_sati"]
|
||||
# 原值:只有 is_active / phase / moon_sign / phases,正文写成「Sade Sati 未启动」一句
|
||||
# 新值:同一条里带土星在月亮起第几宫、是否 Kantaka、到哪一天
|
||||
@@ -122,7 +125,8 @@ def test_saturn_outside_its_natal_sign_still_gets_its_house_from_the_moon_and_le
|
||||
rows = [{"kind": "ingress", "date": "2029-08-08", "body": "saturn", "from_sign": "Aries", "to_sign": "Taurus"}]
|
||||
monkeypatch.setattr(reading_facts, "slow_transit_key_dates", lambda packet, full, day: rows)
|
||||
transits = reading_facts._transits(_packet("Aries", 8), {})
|
||||
assert transits["transit_natal_sign"][0]["same_sign"] is False
|
||||
# 原值: transits["transit_natal_sign"][0]["same_sign"] is False;新值: 不同座时没有这个键;原因: BUG-2038(同上)
|
||||
assert "transit_natal_sign" not in transits
|
||||
from_moon = transits["sade_sati"]["saturn_from_moon"]
|
||||
assert (from_moon["house"], from_moon["kantaka"], from_moon["ashtama_shani"], from_moon["until"]) == (8, False, True, "2029-08-08")
|
||||
|
||||
|
||||
@@ -76,7 +76,12 @@ def test_current_periods_keep_module_label_and_exact_engine_dates(case_id):
|
||||
for language, report, label in (("zh", zh, "algorithm_label"), ("en", en, "algorithm_label_en")):
|
||||
opening = timeline(packet, language)
|
||||
assert opening in report
|
||||
assert module[label] in opening
|
||||
# 原值: 中英文开篇都带模块的算法标签(assert module[label] in opening)
|
||||
# 新值: 中文开篇不带,标签仍在报告后面的 Narayana 章节;英文开篇照旧
|
||||
# 原因: BUG-2038,复测第九轮;开篇是读者正文,算法版本与出处是后台信息(占星师 2026-11-19 分层答复)
|
||||
assert module[label] in (report if language == "zh" else opening)
|
||||
if language == "zh":
|
||||
assert module[label] not in opening
|
||||
audit = _dual_dasha_note(packet["worksheets"][TIMING], language)
|
||||
difference = next(row[1] for row in _difference_rows(packet, language) if row[0] == "Narayana Dasha")
|
||||
for key in ("md", "ad"):
|
||||
|
||||
@@ -77,7 +77,12 @@ def test_supplement_has_guide_timeline_and_domain_tables() -> None:
|
||||
assert "MD" not in text.split("### 时间线")[0]
|
||||
assert "- 土星:2027-03-28 → 2027-09-28" in text
|
||||
assert "- 水星:2027-09-28 → 2028-03-09" in text
|
||||
assert "Narayana 当前大运(任务包算法):巨蟹座 2022-08-01 → 2031-08-01" in text
|
||||
# 原值: "Narayana 当前大运(任务包算法):巨蟹座 2022-08-01 → 2031-08-01"
|
||||
# 新值: 中文开篇不带算法标签
|
||||
# 原因: BUG-2038,复测第九轮开篇出现「Sanjay Rath 版(默认;按原书 p.43 正文(第七轮裁定))」;
|
||||
# 版本出处是后台信息,留在 Narayana 章节。英文版仍带标签。
|
||||
assert "Narayana 当前大运:巨蟹座 2022-08-01 → 2031-08-01" in text
|
||||
assert "任务包算法" not in text.split("### 时间线")[1].split("###")[0]
|
||||
assert "起运星座 水瓶座" in text
|
||||
# Career: 10th lord Saturn + AmK Mars in D10 and D9; A10 Taurus is natal house 2.
|
||||
assert "| D10 | 狮子座 | 土星 | 天秤座 | 3 |" in text
|
||||
|
||||
Reference in New Issue
Block a user