diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index 34812476b..7f125cf4c 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -30424,3 +30424,22 @@ - 防复发:`frontend/tests/saham-names-2249.test.ts` 钉住:负责人定名 = SAHAM_TERMS;gloss 与简称都不重复;问答表、年运表与 SAHAM_TERMS 逐个一致;合盘、个人报告的 Vivaha 名由 gloss 推出;星盘页、问答、年运三张表合起来没有两个 Saham 同名(Artha 财物 / Dhana 钱财、Vidya 学业 / Sastra 学问);「婚姻点 UL」不被读成 Saham;旧名在存档回答里不被当成未知名、位置错仍标出;别名不得是任何 Saham 的现名。 - 关联记录:BUG-2241(Karma Saham 统一叫事业,列出本条各项)、BUG-2239(问答 Saham 行与名字核对)、BUG-1547 / BUG-2156(本命 Vivaha Saham 计算)、BUG-1702(年运 Saham 进写作材料)。 - 修复版本:分支 `claude/saham-names-2249`(待父会话推送)。 + +## BUG-2269 | 年运和合盘报告把后台词给了读者:待核的缓解写成「有缓解因素」、合盘正文印「正式核对 / 研究扫描 / 计票」、附录「lahiri / mean」、「证据等级」、原始状态码和提交号 + +- 状态:fixed(待推送 staging) +- 现象(白话盘点 2026-11-23「〇、严重项」C-S1/C-S2/C-S3/C-S7/C-S8/C-S9): + - 年运替换表把「有取消条件被检出,但仍有待核实」换成「有缓解因素」,把待核抬成了「有」。 + - 每份合盘的「关系事件」正文和附录都印「正式核对:」「研究扫描:」前缀,固定说明里有「研究扫描只按大运找时间段……不按条数计票」;这些正是合盘写作禁用表里的内部词。 + - 合盘附录「两盘口径」写「合盘统一用 lahiri / mean」(原始英文键)。 + - 年运条件说明「这一点目前还不能明确判断:缺少证据等级所需的计算依据」,把后台的「证据等级」给了读者。 + - 年运写作材料里有「没有算出(blocked)」「Varsha Narayana(…,parameter_sensitive)」等原始状态码,模型抄进「依据」读者就能看到;Tajika 说明带「(占星师 3509ccd7)」和「来源尚未核定」,附录写「来源未核定」。 +- 触发条件:任何一份年运或合盘报告。 +- 根因:状态码和内部检查名直接拼进了给模型的材料和给读者的行;合盘存储行的前缀被页面、导出和附录原样显示;替换表只考虑了「去掉状态用语」,没守住「待核 ≠ 有」。 +- 修复: + - 年运:替换表改成「有没有缓解还没核实」(和问答一致);`DEPENDENCY_LABELS.evidence_grades` 改成「判断所需的计算」,读者行由 `dependencyGapLine` 写成「判断所需的计算还不全」;材料只写「没有算出」「这一年不适用」「换一种算法结果可能不同」,写作规则同步;Tajika 说明改成「Tajika 相位只说明两颗星之间有联系,不用来下判断」,附录同句;`annualBasisText` 在显示时清掉旧报告里存下的这些词(状态码、提交号括注、「来源尚未核定」「缺少证据等级所需的计算依据」)。 + - 合盘:存储行保留原前缀(解析要用),新增 `readerEventLine` 给正文、导出和附录去掉前缀,扫描行写「两人在 2027 年 3 月至 9 月同时走到相关的运」;固定说明改成「两人同时走到相关的运,只说明各自当时的背景。」;「正式核对是候选,但研究扫描没有找到……」改成「两人各自都符合条件,但没有找到两人同时走到相关的运的时间段。」(旧报告经 `currentSynastryEventStatus` 换成新句)。候选那一句「两人各自都符合这一类事件的条件,是候选,不代表已经或一定发生」不变。附录「合盘统一用 Lahiri 岁差、平交点」。 +- 验证:新增 `frontend/tests/report-backstage-words-2269.test.tsx` 6 条(合盘正文、固定说明和附录不含后台词且候选意思保留;附录岁差 / 交点用词;年运写作材料、用户提示和写作规则不含状态码与提交号;待核不抬成「有」;条件说明白话、旧报告依据显示时清掉后台词;附录 Tajika 行)。改写钉旧文的 8 个测试文件,逐处注明原值 / 新值 / 原因。 +- 防复发:守卫测试的词表覆盖 blocked、parameter_sensitive、证据等级、正式核对、研究扫描、计票、占星师、提交号、「lahiri / mean」。 +- 关联记录:BUG-2029(合盘分层)、BUG-2037(年运分层)、BUG-2097、BUG-2130、BUG-2243(Shadbala 最低线句式)、BUG-2241;个人报告数据章的 C-S4/C-S5/C-S6 由另一窗口处理。 +- 修复版本:分支 `claude/report-severe-2269`(待父会话推送)。 diff --git a/frontend/src/lib/annual-reader-display.ts b/frontend/src/lib/annual-reader-display.ts index c60e0c7a3..6025f668a 100644 --- a/frontend/src/lib/annual-reader-display.ts +++ b/frontend/src/lib/annual-reader-display.ts @@ -231,10 +231,24 @@ function cleanSentence(sentence: string): string { * 「只作参考」-type hedges. A sentence that was only such a note goes; a hedge attached to content leaves the * content (「三个Saham只作参考:Artha第6宫」 → 「三个Saham:Artha第6宫」). Technique names stay. */ +/** + * BUG-2269: words saved before the reader wording — the raw status codes the material used to carry + * (the model copied them into 「依据」), the commit note after the Tajika line and the grading word. + */ +const SAVED_BACKSTAGE: readonly (readonly [RegExp, string])[] = [ + [/[((]\s*占星师\s*[0-9a-f]{7,40}\s*[))]/gu, ""], + [/[;;,,]?\s*九种结构的来源尚未核定[,,]?\s*不作判断因素/gu, ",不用来下判断"], + [/缺少证据等级所需的计算依据/gu, "判断所需的计算还不全"], + [/[((]\s*(?:blocked|parameter_sensitive)\s*[))]/gu, ""], + [/[,,、]\s*parameter_sensitive\b/gu, ",换一种算法结果可能不同"], + [/\b(?:blocked|parameter_sensitive)\b/gu, ""], +]; + export function annualBasisText(value: unknown): string { // BUG-2117 (round twenty-four): 「…年度取样,仅供观察,不能据此确定…」 — the clause goes, the statement stays. // BUG-2130: no book, author, table or page citation (「Narayana(Rath 版)」「Saham(PVR 表 74,…)」). - const text = withoutCitations(withoutObservationHedge(str(value))); + const text = SAVED_BACKSTAGE.reduce((current, [pattern, replacement]) => current.replace(pattern, replacement), + withoutCitations(withoutObservationHedge(str(value)))); if (!text || !BASIS_TRIGGER.test(text)) return text; return text.split("\n").map((line) => { if (!BASIS_TRIGGER.test(line)) return line; diff --git a/frontend/src/lib/annual-report-generate.ts b/frontend/src/lib/annual-report-generate.ts index 69be9aaa0..561630125 100644 --- a/frontend/src/lib/annual-report-generate.ts +++ b/frontend/src/lib/annual-report-generate.ts @@ -909,7 +909,7 @@ export function buildAppendix(facts: unknown, range: AnnualSnapshot["range"], bi "只判断了部分领域时只写这些领域,不概括整段;和前一段相同的写「延续前一阶段的主题」;「平稳」暂不使用", "宫主的功能属性、所管宫、所落宫、尊贵、燃烧分别记录;Maraka 单独记录,不作为负分;罗睺计都参考定位星,保留自身位置", "各领域方向一致才有主调,不一致就分领域写,看不出就写看不出;基调只决定建议的方向,正文不写顺紧总评", - "年内展开看 Mudda 和 Patyayini,不参与本命运限判断;年盘分四层记:事项关联、Tajika 联系(九种结构判断,来源未核定,只列联系、不作因素)、阻碍、五分力(偏弱不等于压力);只列支持与压力因素,不下成败结论", + "年内展开看 Mudda 和 Patyayini,不参与本命运限判断;年盘分四层记:事项关联、Tajika 联系(只说明两颗星之间有联系,不用来下判断)、阻碍、五分力(偏弱不等于压力);只列支持与压力因素,不下成败结论", ...muddaBalanceLines(root), // 产品 2026-11-07 占星师方案:年盘完整层。 "年盘另看:Deeptamsa 内的 Tajika 相位、五分力与 Harsha、年盘 Shadbala(年盘时刻重算,与本命分开)、Saham(按回归时刻昼夜取式,参数敏感)", diff --git a/frontend/src/lib/annual-report-grade.ts b/frontend/src/lib/annual-report-grade.ts index 878f2a42e..bba364b9d 100644 --- a/frontend/src/lib/annual-report-grade.ts +++ b/frontend/src/lib/annual-report-grade.ts @@ -27,9 +27,18 @@ const DEPENDENCY_LABELS: Record = { double_transit: "木星与土星行运交叉", kp: "KP 宫头", sudarshana: "Sudarshana 三参照", bhrigu_pada: "Bhrigu Pada 年龄观察", yoga_pravesha: "Yoga 回归", nakshatra_pravesha: "Nakshatra 回归", tithi_pravesha: "Tithi 月相回归", shadbala: "本命六维力量", avastha: "本命行星状态", - evidence_grades: "证据等级所需的计算依据", + // 原值: 「证据等级所需的计算依据」;原因: BUG-2269,「证据等级」是后台词(11-19 分层规则),也进了模型材料。 + evidence_grades: "判断所需的计算", }; +/** BUG-2269: what a reader sees when the whole grading input is missing. */ +const EVIDENCE_GAP_READER = "判断所需的计算还不全"; + +/** BUG-2269: one missing dependency as a reader line. */ +export function dependencyGapLine(label: string): string { + return label === DEPENDENCY_LABELS.evidence_grades ? EVIDENCE_GAP_READER : `缺少${label}`; +} + const dependencySchema = z.object({ id: z.string(), state: z.string(), @@ -171,7 +180,8 @@ export function annualBoundaryReaderText(text: string): string { export function annualDependencyReasons(cap: AnnualCap): string[] { const evidence = gradeEvidence(cap); - return [...evidence.会变, ...evidence.缺少.map((label) => `缺少${label}`)]; + // BUG-2269: 原值「缺少证据等级所需的计算依据」把后台的「证据等级」给了读者(11-19 分层规则)。 + return [...evidence.会变, ...evidence.缺少.map(dependencyGapLine)]; } function uniqueAnnualReasons(reasons: readonly string[]): string { diff --git a/frontend/src/lib/annual-report-sections.ts b/frontend/src/lib/annual-report-sections.ts index 2e81bb968..e18e17d68 100644 --- a/frontend/src/lib/annual-report-sections.ts +++ b/frontend/src/lib/annual-report-sections.ts @@ -21,7 +21,7 @@ import { readerWording } from "./personal-report-reading-wording.ts"; import { SAHAM_TERMS } from "./chart-data-terms.ts"; import { annualBasisText, annualRememberText } from "./annual-reader-display.ts"; import { ANNUAL_CLAIMS, ANNUAL_CLAIM_LABELS, annualCap, annualParagraph, annualRating, gradeEvidence, varyingAnnualReasons, weakestCap, - type AnnualCap, type AnnualClaim } from "./annual-report-grade.ts"; + dependencyGapLine, type AnnualCap, type AnnualClaim } from "./annual-report-grade.ts"; import { ANNUAL_DOMAINS, @@ -266,10 +266,11 @@ function dualTrack(phase: Row, domain: AnnualDomain): string { function varshaLine(phase: Row): string { const varsha = record(phase.varsha_narayana); - if (str(varsha.status) !== "parameter_sensitive") return `Varsha Narayana:没有算出(${str(varsha.reason) || "blocked"})`; + // BUG-2269: the material carries reader words, never the raw status codes (blocked / parameter_sensitive). + if (str(varsha.status) !== "parameter_sensitive") return "Varsha Narayana:没有算出"; const md = record(varsha.md); const ad = record(varsha.ad); - return `Varsha Narayana(年度 Narayana,parameter_sensitive):${signCn(md.sign)}运${num(md.annual_house) ? `(年盘第 ${md.annual_house} 宫)` : ""}、${signCn(ad.sign)}分运${num(ad.annual_house) ? `(年盘第 ${ad.annual_house} 宫)` : ""}`; + return `Varsha Narayana(年度 Narayana,换一种算法结果可能不同):${signCn(md.sign)}运${num(md.annual_house) ? `(年盘第 ${md.annual_house} 宫)` : ""}、${signCn(ad.sign)}分运${num(ad.annual_house) ? `(年盘第 ${ad.annual_house} 宫)` : ""}`; } function sadeSatiLine(phase: Row): string { @@ -507,9 +508,9 @@ function sahamLine(row: Row): string { return `${SAHAM_CN[str(row.key)] ?? str(row.name)} Saham 在${signCn(row.sign)},年盘第 ${num(row.annual_house) ?? "?"} 宫,宫主${planetCn(row.lord)}在年盘第 ${num(row.lord_annual_house) ?? "?"} 宫`; } -function statusNote(value: Row): string { - const status = str(value.status); - return status === "blocked" || status === "not_applicable" ? `${status}${str(value.reason) ? `(${str(value.reason)})` : ""}` : ""; +/** BUG-2269: 原值返回「blocked(reason)」写进材料;新值: 不可用时只说「没有算出」或「这一年不适用」。 */ +function notComputed(value: Row): string { + return str(value.status) === "not_applicable" ? "这一年不适用" : "没有算出"; } /** One year chart in full (tajika-annual: year lord and Muntha first, then Sahams, strength and the annual periods). */ @@ -529,7 +530,7 @@ function yearEvidence(facts: unknown, domain?: AnnualDomain): Row[] { 年盘上升: `${signCn(year.ascendant)},上升主${planetCn(record(year.ascendant_lord).planet)}在年盘第 ${num(record(year.ascendant_lord).house) ?? "?"} 宫`, 年主: lord.status === "computed" ? `${planetCn(lord.planet)}(Panchadhikari 选出),年盘第 ${num(lord.annual_house) ?? "?"} 宫,管年盘第 ${(Array.isArray(lord.owned_annual_houses) ? lord.owned_annual_houses as number[] : []).join("、") || "?"} 宫,五分力 ${num(lord.panchavargiya) ?? "?"}` - : `没有算出(${str(lord.reason) || "blocked"})`, + : "没有算出", Muntha: muntha.status === "computed" ? `${signCn(muntha.sign)},年盘第 ${num(muntha.annual_house) ?? "?"} 宫(${houseMeaning(muntha.annual_house)});Muntha 主${planetCn(muntha.lord)}在年盘第 ${num(placement.house_from_annual_ascendant) ?? "?"} 宫` : "没有算出", @@ -546,21 +547,22 @@ function yearEvidence(facts: unknown, domain?: AnnualDomain): Row[] { // 新值:「与最低线之比(总 Rupa ÷ 最低要求,不说吉凶)」 // 原因:BUG-1964,占星师 2026-11-17 第二批第 9 项:避免「够用/不够用」 ? `按总 Rupa 从高到低:${(Array.isArray(shadbala.ranking) ? shadbala.ranking as string[] : []).map(planetCn).join("、")};与最低线之比(总 Rupa ÷ 最低要求,不说吉凶)${Object.entries(record(shadbala.ratio)).map(([planet, ratio]) => `${planetCn(planet)} ${num(ratio) ?? "?"}`).join("、")}(年盘时刻重算,不是本命 Shadbala)` - : `没有算出(${statusNote(shadbala)})`, + : notComputed(shadbala), } : {}), ...(Array.isArray(year.tajika_aspects) ? { Tajika相位: rows(year.tajika_aspects).map((row) => `${(Array.isArray(row.planets) ? row.planets as string[] : []).map(planetCn).join("与")} ${num(row.aspect) ?? "?"}°,${row.motion === "applying" ? "入相(Ithasala 型)" : "离相(Easarapha 型)"}`), - Tajika说明: "Tajika 相位只说明两颗星之间有联系;九种结构的来源尚未核定,不作判断因素(占星师 3509ccd7)", + // 原值: 「……九种结构的来源尚未核定,不作判断因素(占星师 3509ccd7)」;原因: BUG-2269,不给用户提交号、「占星师」「来源」。 + Tajika说明: "Tajika 相位只说明两颗星之间有联系,不用来下判断", } : {}), ...(sahams.status ? { Saham: sahams.status === "parameter_sensitive" - ? { 口径: `按回归时刻的${sahams.day_or_night === "night" ? "夜间" : "白天"}公式,parameter_sensitive`, 行: sahamRows.map(sahamLine) } // BUG-2130: 原值带「(PVR 表 74)」 - : `没有算出(${statusNote(sahams)})`, + ? { 口径: `按回归时刻的${sahams.day_or_night === "night" ? "夜间" : "白天"}公式,换一种算法结果可能不同`, 行: sahamRows.map(sahamLine) } // BUG-2130: 原值带「(PVR 表 74)」 + : notComputed(sahams), } : {}), ...(varsha.status ? { Varsha_Narayana: varsha.status === "parameter_sensitive" - ? `从 Muntha(${signCn(varsha.muntha_sign)})起算,起运${signCn(varsha.seed)};报告范围内:${rows(varsha.md).map((row) => `${signCn(row.sign)}(${monthPhrase(row.start)}起)`).join("、")};太阳每走 3° 为一名义年,parameter_sensitive` - : `没有算出(${statusNote(varsha)})`, + ? `从 Muntha(${signCn(varsha.muntha_sign)})起算,起运${signCn(varsha.seed)};报告范围内:${rows(varsha.md).map((row) => `${signCn(row.sign)}(${monthPhrase(row.start)}起)`).join("、")};太阳每走 3° 为一名义年,换一种算法结果可能不同` + : notComputed(varsha), } : {}), // BUG-1739 (astrologer Q2): the Mudda segment crossing the next return, in her wording. ...(str(year.mudda_crossing) ? { Mudda跨回归: str(year.mudda_crossing) } : {}), @@ -573,12 +575,12 @@ const SADE_SATI_CN_SHORT: Readonly> = { rising: "Sade Sat function transitEvidence(facts: unknown): Row { const context = record(cards(facts).transit_context); if (!context.status) return {}; - if (context.status !== "computed") return { 行运背景: "Sade Sati、Ashtakavarga、Vedha 没有算出(blocked)" }; + if (context.status !== "computed") return { 行运背景: "Sade Sati、Ashtakavarga、Vedha 没有算出" }; return { SadeSati: rows(context.sade_sati).map((row) => `${monthPhrase(row.from)}起:土星在${signCn(row.saturn_sign)},月亮第 ${num(row.house_from_moon) ?? "?"} 座,${SADE_SATI_CN_SHORT[str(row.phase)] ?? str(row.phase)}${row.ashtama_shani === true ? "、Ashtama Shani" : ""}${row.kantaka_from_moon === true ? "、Kantaka" : ""}`), Ashtakavarga: rows(context.ashtakavarga_at_start).map((row) => `${planetCn(row.body)}在${signCn(row.sign)}:${num(row.bav) !== null ? `BAV ${row.bav}/8、` : ""}SAV ${num(row.sav) ?? "?"}`), Vedha: rows(context.vedha).filter((row) => row.obstructed === true) - .map((row) => `${monthPhrase(row.at)}:${planetCn(row.body)}在月亮第 ${num(row.house_from_moon) ?? "?"} 座的好位置被${(Array.isArray(row.obstructed_by) ? row.obstructed_by as string[] : []).map(planetCn).join("、")}在第 ${num(row.vedha_house_from_moon) ?? "?"} 座阻住(Vedha,parameter_sensitive)`), + .map((row) => `${monthPhrase(row.at)}:${planetCn(row.body)}在月亮第 ${num(row.house_from_moon) ?? "?"} 座的好位置被${(Array.isArray(row.obstructed_by) ? row.obstructed_by as string[] : []).map(planetCn).join("、")}在第 ${num(row.vedha_house_from_moon) ?? "?"} 座阻住(Vedha,换一种算法结果可能不同)`), 行运口径: "BAV 4、SAV 28 为中线;Vedha 只查慢星;这些都说明力量和阻碍,不是事件日期", }; } @@ -720,7 +722,7 @@ const WRITING_RULES = [ "- 术语主要放在 evidence,第一次出现时用半句话解释,例如「Muntha(每年顺移一宫的年度敏感点)落在年盘第 10 宫」「Mudda(年内按月亮星宿分的计时)」。正文确实要点到某个技法时,只点一次并说明它管什么。不要把术语堆成清单。", "- 应期看两套计时:本命计时看 Vimshottari 和 Narayana 两套,各自判断后再对照,写在 evidence 和 timing 里;两套方向一致或不一致,都在这两处照实写清楚。timing 和 evidence 一起折叠在「依据」里,读者翻开才看;timing 以「Vimshottari 在某段时间支持(或压着)什么」起句,再写 Narayana 同期怎么说。年内再用 Mudda / Patyayini 与年盘解释,它们不改写本命两套计时的判断。", "- 两套计时的对照不写进正文(text、base、theme、action、matter、arrange、remember、line):正文只按主要那套(Vimshottari)用日常话说哪段时间对这件事有利、哪段时间压力大,例如「6 月下旬到 7 月中旬对工作比较有利」;不写「两套计时」「两轨」「另一套计时看不出方向」「两套说法不同」「两边都留着看」「不挑一边」「不合成一个说法」,也不点 Narayana 的名字。只有两套方向相反、足以改变这段时间该推还是该守时,正文才说一次「这段时间该推还是该守,这一点目前还不能明确判断」,不解释是哪两套方法。", - "- 状态照实保留,写在 evidence:材料里标 parameter_sensitive(如 Saham、Varsha Narayana、Vedha)的,照写它的结果,不加「只作参考」「仅供参考」这类话;标 blocked 或「没有算出」的,在 evidence 里写明这一层没有算出,不用它下结论,也不要假装用过。正文不写「参数敏感」「条件参考」「不作为独立印证」「候选格局」「尚未完整确认」「有待核实」这类状态用语。", + "- 状态照实保留,写在 evidence:材料里标「换一种算法结果可能不同」(如 Saham、Varsha Narayana、Vedha)的,照写它的结果,不加「只作参考」「仅供参考」这类话;标「没有算出」的,在 evidence 里写明这一层没有算出,不用它下结论,也不要假装用过。正文不写「参数敏感」「条件参考」「不作为独立印证」「候选格局」「尚未完整确认」「有待核实」这类状态用语。", // BUG-2130 (产品负责人 2026-11-21「报告里的书名引文也去掉」): text and evidence alike. `- 正文和 evidence 都${NO_CITATION_RULE}`, "- 正文直接说判断和安排。某一点确实看不出,就说一次「这一点目前还不能明确判断」,然后接着写看得出的部分;不在判断后面加「只能当线索,不能当成结论」「不当作定论」「不细断」「仅供参考」这类话。", @@ -1006,7 +1008,7 @@ function missingReasons(item: Row, cap: AnnualCap): string[] { const { 会变, 缺少 } = gradeEvidence(cap); return [ ...会变.filter((reason) => !evidence.includes(reason)), - ...缺少.filter((label) => !evidence.includes(label)).map((label) => `缺少${label}`), + ...缺少.filter((label) => !evidence.includes(label)).map(dependencyGapLine), ]; } @@ -1070,9 +1072,13 @@ const ANNUAL_READER_PATTERNS: readonly (readonly [RegExp, string])[] = [ [/Narayana\s*看不出/gu, "Narayana 没有明显指向"], // 「……被检出为候选格局,但尚未完整确认」「……有取消条件被检出,但仍有待核实」 [/被?检出为候选(?:格局)?[,,]?\s*(?:但)?(?:尚未|还没有?)完整确认/gu, "是按规则筛出的候选"], - [/有取消条件被检出[,,]?\s*(?:但)?(?:仍|还)?有待核实/gu, "有缓解因素"], + // 原值: 换成「有缓解因素」,把待核抬成了有;新值同问答;原因: BUG-2269。 + [/有取消条件被检出[,,]?\s*(?:但)?(?:仍|还)?有待核实/gu, "有没有缓解还没核实"], // 「钱这一块缺少证据等级所需的计算依据,只写到看得出的方向」 [/缺少证据等级所需的计算依据/gu, "目前还不能明确判断"], + // BUG-2269: a raw status code the model copied (old material) never reaches the reader. + [/[((]\s*(?:blocked|parameter_sensitive)\s*[))]/gu, ""], + [/[,,、]?\s*\b(?:blocked|parameter_sensitive)\b/gu, ""], // 技法名用原文拼写;模型偶尔把它们音译成中文(本地试写里各出现两次) [/维姆肖塔里/gu, "Vimshottari"], [/纳拉亚纳/gu, "Narayana"], diff --git a/frontend/src/lib/synastry-full-technical.ts b/frontend/src/lib/synastry-full-technical.ts index c23e24102..c8170f1f3 100644 --- a/frontend/src/lib/synastry-full-technical.ts +++ b/frontend/src/lib/synastry-full-technical.ts @@ -4,7 +4,7 @@ import { signZh } from "./chart-view-labels.ts"; import { NAKSHATRA_ZH } from "./panchanga-names-zh.ts"; import { displayTechniqueAuditLabel, displayTechniqueAuditNote, techniqueCalculationStatusLabel } from "./consultation-technique-audit.ts"; import { hasRamanMatchingProfile } from "./synastry-matching-profiles.ts"; -import { currentSynastryEventStatus, EVENT_INPUT_LABELS, EVENT_TITLES, eventClassRows, eventTimingSentence, isScanOnlyEvent, SCAN_INTERVAL_NOTE, synastryEventTiming } from "./synastry-full-timeline.ts"; +import { currentSynastryEventStatus, EVENT_INPUT_LABELS, EVENT_TITLES, eventClassRows, eventTimingSentence, isScanOnlyEvent, readerEventLine, SCAN_INTERVAL_NOTE, synastryEventTiming } from "./synastry-full-timeline.ts"; import { synastryNodeNames } from "./synastry-node-names.ts"; /** @@ -53,6 +53,17 @@ const NOT_APPLICABLE: Readonly> = { "Prashna context when a real question chart was supplied": "本报告没有用于问卦的提问时刻盘", }; +/** BUG-2269: the pair's shared ayanamsa and node mode in reader words, not the raw keys. */ +function pairAyanamsaZh(value: string): string { + const key = value.trim().toLowerCase() || "lahiri"; + return ({ lahiri: "Lahiri ", raman: "Raman ", krishnamurti: "KP ", kp: "KP " } as Record)[key] ?? `${value.trim()} `; +} + +function pairNodeZh(value: string): string { + const key = value.trim().toLowerCase() || "mean"; + return key === "true" ? "真交点" : key === "mean" ? "平交点" : value.trim(); +} + function record(value: unknown): Record | null { return value && typeof value === "object" && !Array.isArray(value) ? value as Record : null; } @@ -215,7 +226,8 @@ export function eventTimingBlock(dossier: unknown, names?: Readonly<{ a: string; : (zh ? "旧报告没有记录探索性扫描的版本" : "The saved report has no scan version"), ...timing.classes.flatMap(({ event, a, b, required }) => [ EVENT_TITLES[event][language], - ...[states.get(event)?.formal, research(states.get(event))].filter((line): line is string => Boolean(line)), + // BUG-2269: without the stored 「正式核对:」 / 「研究扫描:」 prefixes. + ...[states.get(event)?.formal, research(states.get(event))].map((line) => readerEventLine(line, language)).filter(Boolean), ...[a, b].flatMap((person, personIndex) => { // BUG-2022: the appendix names the two people the way the report does; 甲 / 乙 only without names. const own = personIndex === 0 ? names?.a : names?.b; @@ -1002,7 +1014,8 @@ export function buildTechnicalBasis(input: Readonly<{ const pairLines = [ ...(alignment ? [text(alignment.status) === "same_profile" ? "两盘口径:两人用同一岁差与交点" - : `两盘口径:两人档案的岁差或交点不同,合盘统一用 ${text(used?.ayanamsa) || "lahiri"} / ${text(used?.node_mode) || "mean"}`] : []), + // 原值: 「合盘统一用 lahiri / mean」(原始英文键);新值: 岁差名加平交点 / 真交点;原因: BUG-2269。 + : `两盘口径:两人档案的岁差或交点不同,合盘统一用 ${pairAyanamsaZh(text(used?.ayanamsa))}岁差、${pairNodeZh(text(used?.node_mode))}`] : []), ...(scope ? [`结论范围:${text(scope.status) === "full" ? "可以写完整结论" : text(scope.status) === "limited" ? "主链对照有未闭合项,只写条件性结论" : "两盘口径不一致,不出结论"}`] : []), ]; const eventTiming = eventTimingBlock(dossier, input.names); diff --git a/frontend/src/lib/synastry-full-timeline.ts b/frontend/src/lib/synastry-full-timeline.ts index 8d0000e7f..102c023a2 100644 --- a/frontend/src/lib/synastry-full-timeline.ts +++ b/frontend/src/lib/synastry-full-timeline.ts @@ -507,8 +507,9 @@ const CONFLICTS: Readonly>>> = en: SCAN_INTERVAL_NOTE.en, }, gate_candidate_without_scan_dates: { - zh: "正式核对是候选,但研究扫描没有找到两人重叠的时间段。", - en: "The formal check identifies a candidate. The research scan found no overlapping periods.", + // 原值: 「正式核对是候选,但研究扫描没有找到两人重叠的时间段。」;新值见下;原因: BUG-2269,正文不用内部词(synastry-full-sections.ts 禁用表)。 + zh: "两人各自都符合条件,但没有找到两人同时走到相关的运的时间段。", + en: "Both people meet the conditions, but no period was found when both run relevant periods at the same time.", }, }; @@ -603,6 +604,9 @@ const LEGACY_COPY = [ ["研究扫描找到的时间段仅为计算扫描结果,尚不能据此判断事件发生,不是两人的事件窗口。", SCAN_INTERVAL_NOTE.zh], ["The formal check did not confirm these periods. They are for research reference only and do not establish a shared event window.", SCAN_INTERVAL_NOTE.en], ["These periods are computed scan results only and cannot yet be used to judge that an event will happen. They do not establish a shared event window.", SCAN_INTERVAL_NOTE.en], + // BUG-2269: the conflict line saved before the reader wording. + ["正式核对是候选,但研究扫描没有找到两人重叠的时间段。", CONFLICTS.gate_candidate_without_scan_dates.zh], + ["The formal check identifies a candidate. The research scan found no overlapping periods.", CONFLICTS.gate_candidate_without_scan_dates.en], ["多体系共识", "研究参考"], ["多体系一致", "研究参考"], ["multi-system consensus", "research reference"], @@ -701,7 +705,8 @@ export function readerSynastryEvents(events: readonly EventClassRow[], language: const conflict = event.conflict === CONFLICTS.gate_candidate_without_scan_dates[language] ? event.conflict : undefined; return [{ ...event, - research: outcome ? `${RESEARCH_PREFIX[language]}${withReaderNames(outcome, names, language)}` : "", + formal: readerEventLine(event.formal, language), + research: outcome ? readerEventLine(`${RESEARCH_PREFIX[language]}${withReaderNames(outcome, names, language)}`, language) : "", conflict, people: [], }]; }); @@ -756,7 +761,26 @@ export function followupSynastryEvents(events: readonly EventClassRow[], languag }); } +// 原值: 「两人的运限同时落在一段时间里,只说明各自的背景。研究扫描只按大运找时间段,Narayana 和行运作为条件列出,不按条数计票。」 +// 新值: 下面一句;原因: BUG-2269,「研究扫描」「计票」是禁用的内部词,找时间段的方法留在附录。 export const EVENT_OVERLAP_NOTE = { - zh: "两人的运限同时落在一段时间里,只说明各自的背景。研究扫描只按大运找时间段,Narayana 和行运作为条件列出,不按条数计票。", - en: "Periods running at the same time only describe each person's circumstances. The research scan finds dates using Vimshottari periods and records Narayana and transits as accompanying conditions.", + zh: "两人同时走到相关的运,只说明各自当时的背景。", + en: "Both people running relevant periods at the same time only describes each person's circumstances then.", } as const; + +const READER_LABEL_PATTERN = /^两人同时有相关运限:([^;(;]+)(.*)$/u; + +/** + * BUG-2269: the reader's wording of an event row. The stored rows keep their 「正式核对:」 / + * 「研究扫描:」 prefixes (the parsers above read them); the body, the export and the appendix show + * the lines without them. + */ +export function readerEventLine(line: string | undefined, language: Language): string { + if (!line) return ""; + if (line.startsWith(FORMAL_PREFIX[language])) return line.slice(FORMAL_PREFIX[language].length); + if (!line.startsWith(RESEARCH_PREFIX[language])) return line; + const rest = line.slice(RESEARCH_PREFIX[language].length); + if (language !== "zh") return rest.replace(/^Both people have relevant periods at the same time: (.+)$/u, "Both people run relevant periods at the same time: $1"); + const match = READER_LABEL_PATTERN.exec(rest); + return match ? `两人在${match[1].trim()}同时走到相关的运${match[2]}` : rest.replaceAll("相关运限", "相关的运"); +} diff --git a/frontend/tests/annual-report.test.tsx b/frontend/tests/annual-report.test.tsx index fd6ec8e9d..8dd3f6548 100644 --- a/frontend/tests/annual-report.test.tsx +++ b/frontend/tests/annual-report.test.tsx @@ -266,7 +266,8 @@ test("evidence and prompts carry only the server cards and the writing rules", ( // 原值「先说生活里的事」;新值「先证据,后解读」及双轨、A/B/C、参数敏感照实写;原因:产品 2026-11-07 占星师方案:年报/合盘完整运行 skill // 原值「先证据,后解读」「应期双轨」;新值「两层分开」「应期看两套计时」:依据写在 evidence(页面折叠),正文用日常话 // 原因:BUG-2037,占星师 2026-11-19 分层答复(用户看日常语言,技法状态留在依据里) - for (const rule of ["两层分开", "应期看两套计时", "这一点目前还不能明确判断", "回到出生时所在的位置", "等级取 C 或 D", "parameter_sensitive", "可以写月份", "这段时间是否出现了", "材料里没有的日期", "压力不要删掉", "恋爱、确定关系、法律婚分开说", "身体只写作息和精力"]) { + // 原值「parameter_sensitive」;新值「换一种算法结果可能不同」;原因:BUG-2269,材料不带原始状态码 + for (const rule of ["两层分开", "应期看两套计时", "这一点目前还不能明确判断", "回到出生时所在的位置", "等级取 C 或 D", "换一种算法结果可能不同", "可以写月份", "这段时间是否出现了", "材料里没有的日期", "压力不要删掉", "恋爱、确定关系、法律婚分开说", "身体只写作息和精力"]) { assert.ok(rules.includes(rule), rule); } assert.match(prompt, /语气参考(别人的盘,只学写法/); diff --git a/frontend/tests/annual-skill-layer-20261107.test.tsx b/frontend/tests/annual-skill-layer-20261107.test.tsx index 3564b6476..44a82300e 100644 --- a/frontend/tests/annual-skill-layer-20261107.test.tsx +++ b/frontend/tests/annual-skill-layer-20261107.test.tsx @@ -58,7 +58,9 @@ test("the writer gets the whole annual layer, in terms, with both natal tracks", assert.ok(text.includes(needle), needle); } // Tajika yogas stay relations, never judgment factors (astrologer 3509ccd7). - assert.match(text, /不作判断因素/); + // 原值 /不作判断因素/;新值 「不用来下判断」,且不带提交号;原因:BUG-2269 + assert.match(text, /不用来下判断/); + assert.doesNotMatch(text, /3509ccd7|占星师|parameter_sensitive|blocked/); // Health-style Sahams never reach the writer. assert.doesNotMatch(text, /Roga|Mrityu|rogha|mrityu/); const area = plan.find((entry) => entry.kind === "area" && entry.domain === "career")!; @@ -67,7 +69,8 @@ test("the writer gets the whole annual layer, in terms, with both natal tracks", assert.ok(periods.length > 0); for (const period of periods) { assert.match(String(period.双轨), /^Vimshottari:.+;Narayana:.+(两轨(一致|不同,两边都写))$/); - assert.match(String(period.年度Narayana), /parameter_sensitive/); + // 原值 /parameter_sensitive/;新值「换一种算法结果可能不同」;原因:BUG-2269,材料不带原始状态码 + assert.match(String(period.年度Narayana), /换一种算法结果可能不同/); } assert.match(JSON.stringify(evidence.年盘里这一块), /Karma(事业) Saham/); // Days stay with the program; the writer reads months. diff --git a/frontend/tests/annual-user-layer-2037.test.tsx b/frontend/tests/annual-user-layer-2037.test.tsx index 6a750f792..9fcf77db3 100644 --- a/frontend/tests/annual-user-layer-2037.test.tsx +++ b/frontend/tests/annual-user-layer-2037.test.tsx @@ -133,7 +133,8 @@ test("the reader layer puts the plain birth-time line under the dependent item a test("reader wording: status words, disclaimers and the Saturn title", () => { const cases: Array<[string, string]> = [ ["土星与木星互换星座被检出为候选格局,但尚未完整确认;木星在摩羯座的落陷有取消条件被检出,但仍有待核实。这两条都只能当线索,不能当成结论。恋爱和结婚是两件事。", - "土星与木星互换星座是按规则筛出的候选;木星在摩羯座的落陷有缓解因素。恋爱和结婚是两件事。"], + // 原值:「……的落陷有缓解因素。」;新值:「……的落陷有没有缓解还没核实。」;原因:BUG-2269,「待核」不能抬成「有」 + "土星与木星互换星座是按规则筛出的候选;木星在摩羯座的落陷有没有缓解还没核实。恋爱和结婚是两件事。"], ["钱这一块缺少证据等级所需的计算依据,只写到看得出的方向。", "钱这一块目前还不能明确判断,只写到看得出的方向。"], ["这一节暂不能判断。", "这一节目前还不能明确判断。"], ["家和学习是 Vimshottari 压力、Narayana看不出,这一节看不出,不细断。", "家和学习是 Vimshottari 压力、Narayana 没有明显指向,这一节看不出。"], diff --git a/frontend/tests/report-backstage-words-2269.test.tsx b/frontend/tests/report-backstage-words-2269.test.tsx new file mode 100644 index 000000000..57db3ab78 --- /dev/null +++ b/frontend/tests/report-backstage-words-2269.test.tsx @@ -0,0 +1,116 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +import { annualBasisText } from "../src/lib/annual-reader-display.ts"; +import { ANNUAL_CLAIMS, annualDependencyReasons, annualCap } from "../src/lib/annual-report-grade.ts"; +import { buildAppendix, rangeView } from "../src/lib/annual-report-generate.ts"; +import { annualReaderWording, buildAnnualPlan, sectionEvidence, systemPrompt, userPrompt } from "../src/lib/annual-report-sections.ts"; +import { EMPTY_ANNUAL_SITUATION, type AnnualBirthTime } from "../src/lib/annual-report-shared.ts"; +import { buildTechnicalBasis, eventTimingBlock } from "../src/lib/synastry-full-technical.ts"; +import { EVENT_OVERLAP_NOTE, eventClassRows, readerSynastryEvents } from "../src/lib/synastry-full-timeline.ts"; + +// BUG-2269 (wording inventory 2026-11-23, 严重项 C-S1/C-S2/C-S3/C-S7/C-S8/C-S9): backstage words — raw status +// codes, commit ids, 「占星师」, the internal check names and the grading word — never reach a reader or the +// writer's material. Synthetic data only. + +const BACKSTAGE = /\bblocked\b|parameter_sensitive|证据等级|正式核对|研究扫描|计票|占星师|\b[0-9a-f]{8,40}\b|lahiri \/ mean/u; +// The writer's material keeps its 「证据等级」 block (grading is the writer's own instruction, never printed); every +// other backstage word stays out of it too. +const MATERIAL_BACKSTAGE = /\bblocked\b|parameter_sensitive|正式核对|研究扫描|计票|占星师|\b[0-9a-f]{8,40}\b|lahiri \/ mean/u; + +const names = { a: "林甲", b: "王乙" }; +const span = { start: "2027-03-01", end: "2027-10-01" }; +const person = { status: "activated", spans: [{ start: "2027-02-01", end: "2027-11-01" }] }; +const dossier = { + ayanamsa_alignment: { status: "pair_override", used: { ayanamsa: "lahiri", node_mode: "mean" } }, + relationship_event_timeline: { + window: { start: "2026-11-15", end: "2031-11-15", years: 5 }, scan: { id: "synastry_research_scan", version: "v1" }, + event_classes: [ + { event_class: "first_contact", formal_gate: { status: "blocked", reason: "no_first_contact_rule" } }, + { event_class: "romantic_activation", formal_gate: { status: "candidate_alignment_requires_event_history" }, + scan_status: "candidates_found", research_candidates: [span], person_a: person, person_b: person }, + { event_class: "relationship_formation", formal_gate: { status: "candidate_alignment_requires_event_history" }, + scan_status: "both_activated_no_overlap", research_candidates: [], person_a: person, person_b: person, + alignment: { conflict: "gate_candidate_without_scan_dates" } }, + { event_class: "public_formalization", formal_gate: { status: "blocked", reason: "public_formalization_rule_not_sourced" } }, + { event_class: "legal_marriage", formal_gate: { status: "not_established" }, + scan_status: "candidates_found", research_candidates: [span], person_a: person, person_b: person }, + ], + }, +}; + +test("synastry: the body rows, the overlap note and the appendix carry no internal check names", () => { + const rows = eventClassRows(dossier, names, "zh"); + const body = readerSynastryEvents(rows, "zh", names); + assert.ok(body.length >= 1); + // The candidate meaning stays. + assert.match(body[0].formal ?? "", /^两人各自都符合这一类事件的条件,是候选,不代表已经或一定发生/); + assert.equal(body[0].research, "两人在2027 年 3 月至 9 月同时走到相关的运"); + assert.equal(EVENT_OVERLAP_NOTE.zh, "两人同时走到相关的运,只说明各自当时的背景。"); + const shown = JSON.stringify([body, EVENT_OVERLAP_NOTE.zh]); + assert.doesNotMatch(shown, BACKSTAGE); + const appendix = eventTimingBlock(dossier, names)?.lines.join("\n") ?? ""; + assert.ok(appendix.includes("同时走到相关的运")); + assert.doesNotMatch(appendix, BACKSTAGE); +}); + +test("synastry: the parameter line names the pair's ayanamsa and node mode in words", () => { + const blocks = buildTechnicalBasis({ dossier, names, contacts: [], timing: [] }); + const text = JSON.stringify(blocks); + assert.match(text, /合盘统一用 Lahiri 岁差、平交点/); + assert.doesNotMatch(text, /lahiri \/ mean/); +}); + +const base = JSON.parse(readFileSync(new URL("./fixtures/annual-report-facts.json", import.meta.url), "utf8")).facts; + +function withStatuses() { + const facts = structuredClone(base); + for (const year of facts.cards.year_overview) { + Object.assign(year, { + sahams: { status: "parameter_sensitive", day_or_night: "day", year: [{ key: "punya_saham", name: "Punya Saham", sign: "Scorpio", annual_house: 2, lord: "Mars", lord_annual_house: 7 }], domains: {} }, + annual_shadbala: { status: "blocked", reason: "annual_chart_missing" }, + tajika_aspects: [{ planets: ["Mars", "Mercury"], aspect: 60, motion: "applying" }], + varsha_narayana: { status: "blocked", reason: "muntha_missing" }, + year_lord: { status: "blocked", reason: "panchadhikari_missing" }, + }); + } + for (const phase of facts.cards.phases) phase.varsha_narayana = { status: "blocked", reason: "seed_missing" }; + facts.cards.transit_context = { status: "blocked" }; + return facts; +} + +test("annual: the writer's material and rules carry reader words, not status codes or the commit note", () => { + const facts = withStatuses(); + const plan = buildAnnualPlan(facts, EMPTY_ANNUAL_SITUATION); + const material = plan.map((entry) => JSON.stringify(sectionEvidence(facts, entry, EMPTY_ANNUAL_SITUATION))).join("\n"); + assert.match(material, /没有算出/); + assert.match(material, /换一种算法结果可能不同/); + assert.match(material, /Tajika 相位只说明两颗星之间有联系,不用来下判断/); + assert.doesNotMatch(material, MATERIAL_BACKSTAGE); + const overview = plan.find((entry) => entry.kind === "overview")!; + assert.doesNotMatch(userPrompt({ name: "小林", entry: overview, evidence: sectionEvidence(facts, overview, EMPTY_ANNUAL_SITUATION) }), MATERIAL_BACKSTAGE); + // The persona line 「你是一位印度占星师」 stays; status codes and the commit note do not. + assert.doesNotMatch(systemPrompt(), /\bblocked\b|parameter_sensitive|3509ccd7/); +}); + +test("annual: a cancellation still to be checked is never raised to 「有缓解因素」", () => { + assert.equal(annualReaderWording("木星在摩羯座的落陷有取消条件被检出,但仍有待核实。"), "木星在摩羯座的落陷有没有缓解还没核实。"); +}); + +test("annual: a missing grading input reads as a plain sentence; saved basis text loses backstage words", () => { + const reasons = annualDependencyReasons(annualCap(null, ANNUAL_CLAIMS[0])); + assert.ok(reasons.includes("判断所需的计算还不全"), JSON.stringify(reasons)); + assert.doesNotMatch(reasons.join(";"), /证据等级/); + const saved = "Tajika 相位只说明两颗星之间有联系;九种结构的来源尚未核定,不作判断因素(占星师 3509ccd7)。Varsha Narayana:没有算出(blocked)。"; + const shown = annualBasisText(saved); + assert.doesNotMatch(shown, BACKSTAGE); + assert.match(shown, /不用来下判断/); +}); + +test("annual: the appendix Tajika line has no 「来源未核定」", () => { + const birth: AnnualBirthTime = { known: true, beforeMinutes: 15, afterMinutes: 15, source: "family_exact", rectification: "none" }; + const appendix = JSON.stringify(buildAppendix(withStatuses(), rangeView(base, "birthday_year", "annual:birthday_year:2026"), birth, "上海")); + assert.match(appendix, /Tajika 联系(只说明两颗星之间有联系,不用来下判断)/); + assert.doesNotMatch(appendix, /来源未核定|占星师|parameter_sensitive/); +}); diff --git a/frontend/tests/synastry-exploratory-2014.test.tsx b/frontend/tests/synastry-exploratory-2014.test.tsx index 4ac885f77..78ac175a4 100644 --- a/frontend/tests/synastry-exploratory-2014.test.tsx +++ b/frontend/tests/synastry-exploratory-2014.test.tsx @@ -40,9 +40,10 @@ test("BUG-2014: a formal candidate with scan periods is a body row; a scan-only const body = readerSynastryEvents(saved, "zh", names); assert.deepEqual(body.map((row) => row.title), ["心动"]); // 原值: /…是候选,需要用真实经历核对/;新值不再要求用两人的经历核对;原因: BUG-2111(占星师 2026-11-21:普通解读不用用户经历) - assert.match(body[0].formal!, /^正式核对:两人各自都符合这一类事件的条件,是候选,不代表已经或一定发生/); +// 原值带「正式核对:」「研究扫描:」前缀;新值不带,扫描行写「两人在…同时走到相关的运」;原因:BUG-2269,内部词不给读者 + assert.match(body[0].formal!, /^两人各自都符合这一类事件的条件,是候选,不代表已经或一定发生/); assert.doesNotMatch(body[0].formal!, /真实经历|过往经历/); - assert.equal(body[0].research, "研究扫描:两人同时有相关运限:2027 年 3 月至 9 月"); + assert.equal(body[0].research, "两人在2027 年 3 月至 9 月同时走到相关的运"); assert.deepEqual(body[0].people, []); const scanned = exploratorySynastryEvents(saved, "zh", names); assert.deepEqual(scanned, [ @@ -57,7 +58,7 @@ test("BUG-2014: a formal candidate with scan periods is a body row; a scan-only names: { a: "林甲", b: "王乙" }, events: saved, technical: [], }} />); const area = html.slice(html.indexOf("synastry-events")); - assert.match(area, /
  • 心动<\/b><\/p>

    正式核对:[^<]+<\/p>

    研究扫描:两人同时有相关运限:2027 年 3 月至 9 月<\/p><\/li><\/ul>/); + assert.match(area, /

    • 心动<\/b><\/p>

      两人各自都符合[^<]+<\/p>

      两人在2027 年 3 月至 9 月同时走到相关的运<\/p><\/li><\/ul>/); // 原值 (BUG-2014): 正文表后有折叠的「探索性结果」,里面列出只有扫描结果的事件 // 新值: 页面不再出现这一块,也不出现只有扫描结果的事件和它的时间段;原因: BUG-2029 assert.doesNotMatch(area, /探索性结果|仅为计算扫描结果|成为伴侣|法律婚姻/); diff --git a/frontend/tests/synastry-leftovers-2022.test.tsx b/frontend/tests/synastry-leftovers-2022.test.tsx index c5dc2fe5c..5010fda51 100644 --- a/frontend/tests/synastry-leftovers-2022.test.tsx +++ b/frontend/tests/synastry-leftovers-2022.test.tsx @@ -158,8 +158,9 @@ test("the appendix names the two people as the report does and keeps both states assert.doesNotMatch(named, /(^|\n)[甲乙][: ]/u); // Both states stay (astrologer 2026-11-15 Q1 / Q4); a scan-only period carries her 11-19 note. // 原值 (BUG-2022): 「…两人各自的盘里都没有针对这类事件的依据」和行尾括注;新值: 第 19 条原句;原因: BUG-2029 - assert.match(named, /成为伴侣\n正式核对:目前尚未建立支持这类事件时间判断的完整依据,因此暂不提供时间段。\n研究扫描:两人同时有相关运限:2027 年 3 月至 9 月;已找到探索性扫描区间,尚不能据此判断该事件会发生。/); - assert.match(named, /心动\n正式核对:[^\n]+\n研究扫描:两人各有相关运限,但时间没有重叠\n/); +// 原值带「正式核对:」「研究扫描:」前缀;新值不带,扫描行写「两人在…同时走到相关的运」;原因:BUG-2269 + assert.match(named, /成为伴侣\n目前尚未建立支持这类事件时间判断的完整依据,因此暂不提供时间段。\n两人在2027 年 3 月至 9 月同时走到相关的运;已找到探索性扫描区间,尚不能据此判断该事件会发生。/); + assert.match(named, /心动\n[^\n]+\n两人各有相关的运,但时间没有重叠\n/); assert.doesNotMatch(named, /本证据链尚未建立|暂不能判断|严格核对不能通过/); // Without names (the follow-up material), 甲 / 乙 as before. assert.match(eventTimingBlock(dossier)!.lines.join("\n"), /甲:UL 金牛/); diff --git a/frontend/tests/synastry-timeline-2002-2004.test.tsx b/frontend/tests/synastry-timeline-2002-2004.test.tsx index e9cf4ac97..009e4785d 100644 --- a/frontend/tests/synastry-timeline-2002-2004.test.tsx +++ b/frontend/tests/synastry-timeline-2002-2004.test.tsx @@ -71,8 +71,9 @@ test("BUG-2002: a formal candidate and its conflict with the scan stay in the re }, }; const [row] = readerSynastryEvents(eventClassRows(candidate, names, "zh"), "zh").filter((item) => item.eventClass === "relationship_formation"); - assert.match(row.formal!, /^正式核对:两人各自都符合这一类事件的条件,是候选/); - assert.equal(row.conflict, "正式核对是候选,但研究扫描没有找到两人重叠的时间段。"); +// 原值带「正式核对:」「研究扫描:」前缀;新值不带,扫描行写「两人在…同时走到相关的运」;原因:BUG-2269,内部词不给读者 + assert.match(row.formal!, /^两人各自都符合这一类事件的条件,是候选/); + assert.equal(row.conflict, "两人各自都符合条件,但没有找到两人同时走到相关的运的时间段。"); // BUG-2014: a formal candidate is a body row and never an exploratory one; the per-person status lines are gone. assert.deepEqual(row.people, []); assert.deepEqual(exploratorySynastryEvents(eventClassRows(candidate, names, "zh"), "zh"), []); @@ -130,10 +131,12 @@ test("BUG-2002: the page body and the export show the reader's table; the append // 只有扫描结果的时间段,附录的研究扫描行后面带她的说明。 // 原值 (BUG-2022): 「正式核对:目前无法给出有依据的时间段:两人各自的盘里都没有针对这类事件的依据」「…这类事件还没有判断规则」,扫描行尾括注「仅为计算扫描结果…」 // 新值: 占星师 2026-11-19 第 19 条的原句;原因: BUG-2029,「没建立依据」不能写成「盘里没有」 - assert.match(appendix, /成为伴侣\n正式核对:目前尚未建立支持这类事件时间判断的完整依据,因此暂不提供时间段。\n研究扫描:两人同时有相关运限:2027 年 3 月至 9 月;已找到探索性扫描区间,尚不能据此判断该事件会发生。/); - assert.match(appendix, /首次接触\n正式核对:本系统尚未接入这类事件所需的判断规则,目前无法给出有依据的时间段。\n研究扫描:不扫描,不借用心动的时间/); +// 原值带「正式核对:」「研究扫描:」前缀;新值不带,扫描行写「两人在…同时走到相关的运」;原因:BUG-2269,内部词不给读者 + assert.match(appendix, /成为伴侣\n目前尚未建立支持这类事件时间判断的完整依据,因此暂不提供时间段。\n两人在2027 年 3 月至 9 月同时走到相关的运;已找到探索性扫描区间,尚不能据此判断该事件会发生。/); + assert.match(appendix, /首次接触\n本系统尚未接入这类事件所需的判断规则,目前无法给出有依据的时间段。\n不扫描,不借用心动的时间/); + assert.doesNotMatch(appendix, /正式核对|研究扫描/); assert.doesNotMatch(appendix, /本证据链尚未建立|暂不能判断|严格核对不能通过|缺输入|盘里都没有/); - assert.match(technical[0].english!.lines.join("\n"), /Becoming a couple\nFormal check: A complete basis for timing this kind of event has not been built yet, so no period is given\.\nResearch scan: /); + assert.match(technical[0].english!.lines.join("\n"), /Becoming a couple\nA complete basis for timing this kind of event has not been built yet, so no period is given\.\nBoth people run relevant periods at the same time: /); const exported = buildSynastryExportBlocks({ title: "甲 × 乙", savedLine: "保存于 2026-11-19", language: "zh", order: ["timeline"], headings: { timeline: "九、关系应期" }, diff --git a/frontend/tests/synastry-timing-b4-20261115.test.tsx b/frontend/tests/synastry-timing-b4-20261115.test.tsx index 7e17552db..3c6b33d61 100644 --- a/frontend/tests/synastry-timing-b4-20261115.test.tsx +++ b/frontend/tests/synastry-timing-b4-20261115.test.tsx @@ -6,7 +6,7 @@ import { renderToStaticMarkup } from "react-dom/server"; import { SynastryReportView } from "../src/components/synastry/synastry-report-view.tsx"; import { eventTimelineEvidence, sectionEvidence, userPrompt } from "../src/lib/synastry-full-sections.ts"; import { currentSynastryTechnicalBlocks, eventTimingBlock } from "../src/lib/synastry-full-technical.ts"; -import { currentSynastryEvents, EVENT_OVERLAP_NOTE, eventClassRows } from "../src/lib/synastry-full-timeline.ts"; +import { currentSynastryEvents, EVENT_OVERLAP_NOTE, eventClassRows, readerEventLine } from "../src/lib/synastry-full-timeline.ts"; import { synastrySectionMaterial } from "../src/lib/synastry-report-material.ts"; const names = { a: "甲", b: "乙" }; @@ -55,7 +55,8 @@ test("the report and follow-up display the same five formal checks and research conflict: "已找到探索性扫描区间,尚不能据此判断该事件会发生。", people: ["甲:有相关运限", "乙:有相关运限"], }); - assert.equal(events[2].conflict, "正式核对是候选,但研究扫描没有找到两人重叠的时间段。"); + // 原值「正式核对是候选,但研究扫描没有找到两人重叠的时间段。」;原因:BUG-2269,内部词不给读者 + assert.equal(events[2].conflict, "两人各自都符合条件,但没有找到两人同时走到相关的运的时间段。"); // 原值: /缺年度层,严格核对不能通过/;新值: 读者的话,信息不变;原因: BUG-2022 // 原值 (BUG-2022): /缺少年度资料,尚不能据此判断事件发生/;新值: 她第 19 条的原句;原因: BUG-2029 assert.match(events[4].research!, /这条判断所需的年度资料尚未取得,当前不能完成该时间段的核对/); @@ -72,7 +73,8 @@ test("the report and follow-up display the same five formal checks and research for (const row of localized) { const visible = [row.title, row.formal, row.research, row.conflict, ...row.people].filter(Boolean).join(" "); assert.doesNotMatch(visible, /_|·|线|票|多体系共识|\blanes?\b|consensus/i); - assert.ok(html.includes(row.formal!) && html.includes(row.research!)); + // 原值:页面原样含存储行(带「正式核对:」「研究扫描:」);新值:页面含去掉前缀的读者行;原因:BUG-2269 + assert.ok(html.includes(readerEventLine(row.formal, language)) && html.includes(readerEventLine(row.research, language))); } const material = synastrySectionMaterial({ payload, sectionId: "timeline", language }); // 原值 (BUG-2026): 追问材料的事件行和页面内容相同,只换两个标签 @@ -140,7 +142,8 @@ test("the timing appendix preserves each person's conditions and missing strict // 原值: /缺年度层/;新值: /缺少年度资料/;原因: BUG-2022,「年度层」是内部用词 // 原值 (BUG-2022): /缺少年度资料/;新值: 第 19 条的原句;原因: BUG-2029 assert.match(block.lines.join("\n"), /这条判断所需的年度资料尚未取得,当前不能完成该时间段的核对。/); - assert.match(block.lines.join("\n"), /研究扫描:两人同时有相关运限:2027 年 3 月至 9 月;已找到探索性扫描区间,尚不能据此判断该事件会发生。/); +// 原值带「正式核对:」「研究扫描:」前缀;新值不带,扫描行写「两人在…同时走到相关的运」;原因:BUG-2269 + assert.match(block.lines.join("\n"), /两人在2027 年 3 月至 9 月同时走到相关的运;已找到探索性扫描区间,尚不能据此判断该事件会发生。/); assert.doesNotMatch(block.lines.join("\n"), /盘里都没有|没有针对这类事件/); assert.match(block.english?.lines.join("\n") ?? "", /Narayana Parameter-sensitive.*Jupiter Virgo/); }); diff --git a/frontend/tests/synastry-user-layer-2029.test.tsx b/frontend/tests/synastry-user-layer-2029.test.tsx index dc02a3513..f2eaba377 100644 --- a/frontend/tests/synastry-user-layer-2029.test.tsx +++ b/frontend/tests/synastry-user-layer-2029.test.tsx @@ -61,7 +61,8 @@ test("the reader's page and export show one plain sentence and no scan periods; assert.match(area, /

      关系事件<\/h3>

      目前还不能给出有充分依据的时间段。<\/p><\/div>/); assert.doesNotMatch(page, /探索性结果|研究扫描|2027|尚未接入|尚未建立|资料不足|正式核对/); assert.match(page, /先看两个人各自走到的阶段,再看关系事件。/); - assert.match(appendix ?? "", /成为伴侣<\/li>

    • 正式核对:目前尚未建立支持这类事件时间判断的完整依据,因此暂不提供时间段。<\/li>
    • 研究扫描:两人同时有相关运限:2027 年 3 月至 9 月;已找到探索性扫描区间,尚不能据此判断该事件会发生。/); +// 原值带「正式核对:」「研究扫描:」前缀;新值不带,扫描行写「两人在…同时走到相关的运」;原因:BUG-2269,内部词不给读者 + assert.match(appendix ?? "", /成为伴侣<\/li>
    • 目前尚未建立支持这类事件时间判断的完整依据,因此暂不提供时间段。<\/li>
    • 两人在2027 年 3 月至 9 月同时走到相关的运;已找到探索性扫描区间,尚不能据此判断该事件会发生。/); const exported = buildSynastryExportBlocks({ title: "林甲 × 王乙", savedLine: "保存于 2026-11-19", language: "zh", order: ["timeline"], headings: { timeline: "九、关系应期" },