From 5fb7d8fa2b6dfac8442582a22ed3d52837779f87 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 18:05:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20acceptance=20round=20=E2=80=94=20plan=20?= =?UTF-8?q?clarify=20reply=20saves,=20recorded=20certificate=20times=20are?= =?UTF-8?q?=20certain,=20body=20dates=20to=20the=20month,=20no=20=E3=80=8C?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=EF=BC=9A=E3=80=8D=20labels,=20children=20yog?= =?UTF-8?q?as=20conditional,=20user=20length=20requests=20win=20(BUG-2179?= =?UTF-8?q?=E2=80=932182)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG-2179: the plan-timing clarify reply (~70 chars) went through the smalltalk free completion, which the database caps at 20 chars, so every save failed; it now settles through the feedback free completion (400 chars, still free). BUG-2180: hospital/ID records saved as 「记录下来的」 store birth_time_uncertainty_known=false (no range given); birthTimeUncertain no longer reads that as 「说不准」. BUG-2181: exact-day dates left in the eight body sections are shortened to the month; data-chapter labels drop 「来源」; children-related yoga effects use the 「传统上与…有关」 form (topic map regenerated, topics unchanged). BUG-2182: an explicit length request from the user overrides the default answer shape in chat and in-report questions. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8 --- docs/BUG_HISTORY.md | 53 ++++++++++ frontend/src/app/api/consult/route.ts | 5 +- frontend/src/lib/annual-report-generate.ts | 2 +- frontend/src/lib/birth-time-trust.ts | 9 +- frontend/src/lib/personal-report-reading.ts | 13 +++ frontend/src/mastra/annual-report-chat.ts | 2 + frontend/src/mastra/personal-report-chat.ts | 2 + frontend/src/mastra/product-voice.ts | 1 + frontend/src/mastra/synastry-report-chat.ts | 2 + frontend/tests/acceptance-fixes-2179.test.ts | 73 ++++++++++++++ frontend/tests/annual-ruling-1650.test.tsx | 2 +- .../tests/annual-user-layer-2037.test.tsx | 2 +- .../consult-answer-shape-20261105.test.ts | 4 +- .../consult-named-techniques-20261105.test.ts | 2 +- .../tests/consultation-voice-contract.test.ts | 2 +- .../tests/plan-timing-clarify-2161.test.ts | 5 +- references/yoga_rule_topics.v1.json | 35 ++++--- references/yoga_rules.json | 96 +++++++++---------- scripts/report_render/parity_chapters.py | 2 +- .../report_render/upstream_sync_chapters.py | 6 +- tests/test_birth_coordinate_source_2125.py | 4 +- tests/test_report_upstream_sync_20261107.py | 2 +- 22 files changed, 239 insertions(+), 85 deletions(-) create mode 100644 frontend/tests/acceptance-fixes-2179.test.ts diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index ab6925206..336f28156 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -29536,3 +29536,56 @@ - 尚未处理:公开发布前需把「要求主体信息齐全」的测试同时要求开关打开。 - 关联记录:BUG-2139、BUG-2190。 - 修复版本:`claude/dialog-findings-2189`。 + +## BUG-2179 | 新账号点首页「今年推进重要计划」,两次都只得到「这次回复没能保存,请重试。」 + +- 状态:fixed-pending-verify。 +- 首次发现 / 最近更新:2026-11-22 / 2026-11-22。 +- 现象:staging 验收(负责人用 AI 按手册测,T-01):新账号首次免费提问未用、余额 0,点首页第三问,两次都显示「这次回复没能保存,请重试。」,对话里另有一条错误条;手动补充计划后才拿到完整回答。 +- 触发条件:首页第三问以 `starter_plan_timing` 发出、对话里没有之前的消息,走 BUG-2161 的固定追问。 +- 根因:固定追问约 70 字,走的是 `completeSmalltalk` → `complete_consultation_free`。数据库函数(`20261119150000_consultation_smalltalk_birth_revision.sql`)只收 20 字以内的 smalltalk,每次返回 `invalid_response_message`,流式回复因此报「这次回复没能保存」。BUG-2161 的测试只看了路由选对分支,没有对照数据库的长度限制;BUG-2166 修的是卡住的预留,没有碰到这一步。 +- 修复:`frontend/src/app/api/consult/route.ts` 的追问分支改用 `completeFeedback`(数据库允许 400 字),同样免扣点、释放首问保留,不新增迁移。 +- 验证:新增 `frontend/tests/acceptance-fixes-2179.test.ts`:读最新一版 `complete_consultation_free` 的长度限制,核对追问(本人和他人两种)长于 smalltalk 上限、在 feedback 上限之内,且路由用的是 `completeFeedback`;`plan-timing-clarify-2161` 的断言按原值/新值/原因更新。 +- 防复发:上面的测试读取迁移里的真实上限;以后改追问文字或数据库限制,测试会提醒。 +- 尚未处理:失败时对话里的错误条没有「重试」按钮(验收另记)。 +- 关联记录:BUG-2161、BUG-2166、BUG-2040、BUG-1980。 +- 修复版本:`claude/acceptance-fixes-a`。 + +## BUG-2180 | 出生证明、医院记录「记录下来的」时间,报告开头仍说「你填写的出生时间标注为不确定」 + +- 状态:fixed-pending-verify。 +- 首次发现 / 最近更新:2026-11-22 / 2026-11-22。 +- 现象:staging 验收 T-11:档案选「出生证明、医院记录」「记录下来的」,导出也写着医院记录,个人报告开头却说时间标注为不确定,并按前后 30 分钟试算。 +- 触发条件:首次引导选「有记录」,或六来源里「出生证明、医院记录 / 证件」→「记录下来的」。 +- 根因:这两条路径都把 `birth_time_uncertainty_known` 存成 `false`,意思是「没给范围」;BUG-2141 的 `birthTimeUncertain` 把这个值一律当成「说不准」。BUG-2141 的测试底样没有带这个字段,所以没测到真实存下的值。 +- 修复:`frontend/src/lib/birth-time-trust.ts`:来源是 `hospital_record` / `id_document`、记录方式是 `recorded`(或旧数据没有记录方式)时,这个标志不再算不确定;「大概记得」「后来推算的」和用户给的范围照旧算不确定。个人报告、年运、报告内提问都通过这一个函数判断。 +- 验证:`acceptance-fixes-2179.test.ts` 按真实存下的值核对:医院记录、证件、无记录方式的旧数据都算确定;个人报告载荷按填的分钟、年运为 `entered_minute`;「大概记得」和给了范围的仍算不确定。`birth-time-trust-2141` 全过。 +- 防复发:测试底样用表单实际写入的字段组合。 +- 尚未处理:已经生成的报告开头说明不会改写(测试报告)。 +- 关联记录:BUG-2141、BUG-2144、BUG-2146。 +- 修复版本:`claude/acceptance-fixes-a`。 + +## BUG-2181 | 报告正文仍写到某一天;导出里有「来源:」;子女格局写「子女运佳;子女智慧」 + +- 状态:fixed-pending-verify。 +- 首次发现 / 最近更新:2026-11-22 / 2026-11-22。 +- 现象:staging 验收 T-11:(1)「现在这几年」写了行运取数日「2026 年 11 月 22 日」;(2) 中文导出里「来源:」出现 3 次(Argala 说明一处、出生资料两处);(3)「子女格局(木星有力)」仍写「子女运佳;子女智慧」。 +- 触发条件:所有新生成的个人报告。 +- 根因:(1) BUG-2143 只在一节超过 3 个精确到日的日期时才缩到月份,1 个不处理;(2) 资料章节的标签「坐标来源」「出生时间来源」「Argala 来源」字面带「来源:」,和去掉出处说明的规则(BUG-2115/2129)字面冲突;(3) BUG-2128 只改了两条子女格局,其余子女相关效果仍是断语。 +- 修复:(1) `personal-report-reading.ts`:八节正文里剩下的精确到日日期一律由程序缩到月份(「依据与边界」不动,按设计照写起止日期);(2) 标签改为「坐标取自」「出生时间记录」「Argala 形成情况」,小标题「出生资料与不确定范围」,年运开头一行「出生时间记录:」;(3) `references/yoga_rules.json` 里 11 条启用中的格局、24 条子女相关效果改成「传统上与……有关」,英文同步;`yoga_rule_topics.v1.json` 重新生成,主题分类不变。 +- 验证:`tests/test_birth_coordinate_source_2125.py`、`tests/test_report_upstream_sync_20261107.py`、`annual-ruling-1650`、`annual-user-layer-2037` 按原值/新值/原因更新并通过;英文对照测试通过。 +- 尚未处理:已生成报告的正文日期不改写。 +- 关联记录:BUG-2143、BUG-2115、BUG-2129、BUG-2128。 +- 修复版本:`claude/acceptance-fixes-a`。 + +## BUG-2182 | 用户要求「用一两句话说」,回答仍写了好几段 + +- 状态:fixed-pending-verify。 +- 首次发现 / 最近更新:2026-11-22 / 2026-11-22。 +- 现象:staging 验收 T-12:报告内提问「这两段说的是同一件事吗?用一两句话说」,回答多段长文。 +- 触发条件:用户在问题里指定长度。 +- 根因:报告内提问和问答的写作要求只有默认写法(先生活后依据、分段),没有说用户指定长度时以谁为准。 +- 修复:个人、年运、合盘报告内提问说明和问答主写法各加一句:用户说了要多长时按用户说的写,优先于其他写法要求;问答里「判断依据」照常保留。 +- 验证:公开名人盘、deepseek-flash 抽测 4 条「接下来两年我的事业会怎样?用一两句话说」:只加一句「按用户说的长度」时正文 281 / 363 字,仍带 2–3 条「能做的几件事」;写明「不写「能做的几件事」、不分段」后正文 217 / 126 字,没有清单,「判断依据」照常。VISIBLE VOICE 长度上限 4420 → 4500,三个测试按原值/新值/原因更新。报告内提问的三处说明没有单独抽测。 +- 关联记录:BUG-2140、BUG-2149。 +- 修复版本:`claude/acceptance-fixes-a`。 diff --git a/frontend/src/app/api/consult/route.ts b/frontend/src/app/api/consult/route.ts index 4a2fc4e0f..dce27df67 100644 --- a/frontend/src/app/api/consult/route.ts +++ b/frontend/src/app/api/consult/route.ts @@ -951,7 +951,10 @@ export async function POST(request: Request) { reply, birthFields: publicBirthFields, async complete() { - await consultSettlement.completeSmalltalk(reply, birthFields); + // BUG-2179 原值:completeSmalltalk;新值:completeFeedback;原因:complete_consultation_free 只收 + // 20 字以内的 smalltalk,这句追问约 70 字,每次都被拒(invalid_response_message),用户看到 + // 「这次回复没能保存,请重试。」。免费短回复里只有 feedback 一类允许 400 字,同样免扣点、释放首问。 + await consultSettlement.completeFeedback(reply, {}, birthFields); }, async onError() { await cancel(); diff --git a/frontend/src/lib/annual-report-generate.ts b/frontend/src/lib/annual-report-generate.ts index 62bc360aa..d12672a48 100644 --- a/frontend/src/lib/annual-report-generate.ts +++ b/frontend/src/lib/annual-report-generate.ts @@ -233,7 +233,7 @@ export function birthTimeLines(facts: unknown, birth: AnnualBirthTime): string[] const unchanged = unchangedWithinBirthWindow(scope); return [ "出生资料:用户核对后录入", - `时间来源:${(birth.source && BIRTH_SOURCE_CN[birth.source]) || "未标明"};误差:${source}`, + `出生时间记录:${(birth.source && BIRTH_SOURCE_CN[birth.source]) || "未标明"};误差:${source}`, `校正:${birth.rectification === "adopted" ? "采用了校正时间(是选定的时间,不等于误差已消失)" : "未校正"}`, // Second round, item 3: sampled minutes agreeing is not the whole range proven stable. check.status === "range_unknown" ? `${checkLabel}:没有误差范围,无法核对,和出生时间有关的日期标为不确定` diff --git a/frontend/src/lib/birth-time-trust.ts b/frontend/src/lib/birth-time-trust.ts index b1cff1f21..6a645d44b 100644 --- a/frontend/src/lib/birth-time-trust.ts +++ b/frontend/src/lib/birth-time-trust.ts @@ -11,7 +11,7 @@ * - birth_time_record_kind `approximate` (大概记得) or `derived` (后来推算的); * - 「说不准」 (birth_time_uncertainty_known false); * - a declared range wider than zero (declared_window_start/end or uncertainty_before/after_minutes). - * Everything else (证件、医院记录 recorded to the minute, 家人记得准确, 0 / 0 range, imported records) is trusted. + * Everything else (证件、医院记录 recorded to the minute — including the stored 「没给范围」 flag, BUG-2180 —, 家人记得准确, 0 / 0 range, imported records) is trusted. */ import { declaredBirthWindow } from "./lagna-precheck.ts"; @@ -23,8 +23,13 @@ const UNCERTAIN_RECORD_KINDS = new Set(["approximate", "derived"]); export function birthTimeUncertain(row: Row): boolean { if (UNCERTAIN_SOURCES.has(String(row.birth_time_source ?? ""))) return true; if (UNCERTAIN_RECORD_KINDS.has(String(row.birth_time_record_kind ?? ""))) return true; + // BUG-2180 原值:凡是 birth_time_uncertainty_known = false 一律算不确定;新值:证件、医院记录且记录方式是 + // 「记录下来的」时不算;原因:首次引导「有记录」和六来源里「出生证明、医院记录 → 记录下来的」都把这一项存成 + // false,表示没给范围,不是「说不准」,报告却因此说「你填写的出生时间标注为不确定」。 + const recordedDocument = (row.birth_time_source === "hospital_record" || row.birth_time_source === "id_document") + && (row.birth_time_record_kind === "recorded" || row.birth_time_record_kind == null); // 「说不准」: the user said they do not know how far off the time may be. - if (row.birth_time_uncertainty_known === false) return true; + if (row.birth_time_uncertainty_known === false && !recordedDocument) return true; const declared = declaredBirthWindow(row as Record); if (declared?.precisionKind === "minutes") { return (declared.beforeMinutes ?? 0) > 0 || (declared.afterMinutes ?? 0) > 0; diff --git a/frontend/src/lib/personal-report-reading.ts b/frontend/src/lib/personal-report-reading.ts index 25a69ba52..c438fa0da 100644 --- a/frontend/src/lib/personal-report-reading.ts +++ b/frontend/src/lib/personal-report-reading.ts @@ -904,6 +904,19 @@ function checkSection( } } } + // BUG-2181 原值:三个以内的精确到日日期留在正文;新值:八节正文里剩下的「某年某月某日」一律由程序缩到月份; + // 原因:BUG-2143 的规则是正文只写到月份或季节,验收时「现在这几年」仍写了行运的取数日「2026 年 11 月 22 日」。 + // 「依据与边界」不受影响,那里照写起止日期。 + if (!READING_TECHNIQUE_EXEMPT_SECTIONS.has(section.id)) { + for (const [index, paragraph] of paragraphs.entries()) { + if (!readingExactDays(paragraph.text)) continue; + const shortened = withMonthDates(paragraph.text); + if (shortened !== paragraph.text) { + paragraphs[index] = { ...paragraph, text: shortened }; + datesShortened += readingExactDays(paragraph.text) - readingExactDays(shortened); + } + } + } // 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]; diff --git a/frontend/src/mastra/annual-report-chat.ts b/frontend/src/mastra/annual-report-chat.ts index 5076c8570..06376dc88 100644 --- a/frontend/src/mastra/annual-report-chat.ts +++ b/frontend/src/mastra/annual-report-chat.ts @@ -20,6 +20,8 @@ export const ANNUAL_CHAT_INSTRUCTIONS = [ "只使用工具返回的内容。可以写星曜、星座和时间段的起止;宫位编号只在用户自己问到时写(BUG-2143)。不要重新排盘,不要补充材料里没有的盘面事实,不写材料里没有的日期和月份。", `用户问的整件事这份年运都没有算(比如另一个人的盘、和某个人合不合、这份报告以外的年份)时,全文只写这一句:「${ANNUAL_FIXED_REPLY}」,后面不再写任何内容,不复述这一节,也不给别的建议。`, "问题里只有一部分没算到时:先回答算到的部分,照常下判断;没算到的那个结果放在后面说一次,例如「会不会离职,这份年运没算到」,对它两头都不下判断——不写会、不会、不至于,也不写它「不会走到那一步」来安抚。", + // BUG-2182:用户指定长度时以用户为准(验收时「用一两句话说」得到好几段长回答)。 + "用户说了要多长(「一两句话」「简单说」「只要结论」「说详细点」)时,按用户说的长度写,这一条优先于其他写法要求:说「一两句话」就只写一两句,不分段、不列「能做的几件事」、不加依据清单和小标题。", "口吻像一个懂行、说话温和的姐姐。报告是写给一个人的,称呼跟报告正文走:正文称「你」就称「你」,正文写名字就写名字。不替人做决定。", "先说这一年的生活里会怎样,再说依据。月份可以写。不用「偏顺」「偏紧」这类给一段时间打分的词。", "不说注定、必然。材料里写了「要有的条件」「另一面」的时间点,条件和另一面照实说,不把它说成一定会发生。", diff --git a/frontend/src/mastra/personal-report-chat.ts b/frontend/src/mastra/personal-report-chat.ts index d028adc40..dcf78ecd4 100644 --- a/frontend/src/mastra/personal-report-chat.ts +++ b/frontend/src/mastra/personal-report-chat.ts @@ -23,6 +23,8 @@ export const PERSONAL_CHAT_INSTRUCTIONS = [ "只使用工具返回的内容。可以写星曜、星座和时间段的起止;宫位编号、分盘代号只在用户自己问到时写(BUG-2143)。不要重新排盘,不要补充材料里没有的盘面事实,不写材料里没有的日期和月份。", `用户问的整件事这份报告都没有算(比如另一个人的盘、和某个人合不合、报告里没有的年份)时,全文只写这一句:「${PERSONAL_FIXED_REPLY}」,后面不再写任何内容,不复述这一节,也不给别的建议。`, "问题里只有一部分没算到时:先回答算到的部分,照常下判断;没算到的那个结果放在后面说一次,例如「哪一年结婚,这份报告没算到」,对它两头都不下判断——不写会、不会、不至于,也不写它「不会走到那一步」来安抚。", + // BUG-2182:用户指定长度时以用户为准(验收时「用一两句话说」得到好几段长回答)。 + "用户说了要多长(「一两句话」「简单说」「只要结论」「说详细点」)时,按用户说的长度写,这一条优先于其他写法要求:说「一两句话」就只写一两句,不分段、不列「能做的几件事」、不加依据清单和小标题。", "口吻像一个懂行、说话温和的姐姐。称呼用「你」,不替人做决定。", "先说生活里会怎样,再说依据。", "不说注定、必然。材料里写了条件的,条件照实说,不把它说成一定会发生。", diff --git a/frontend/src/mastra/product-voice.ts b/frontend/src/mastra/product-voice.ts index d14049d2c..c150518c0 100644 --- a/frontend/src/mastra/product-voice.ts +++ b/frontend/src/mastra/product-voice.ts @@ -66,6 +66,7 @@ export const productConversationVoice = `VISIBLE VOICE 只是打招呼、道谢、告别时,回一句话,不要套开场形状:20 字以内,不讲星盘、运势或应期。 怎么写 +- 用户说了要多长(「一两句话」「简单说」)时正文就只写那么长:「一两句话」只写一两句,不写「能做的几件事」,不分段,优先于下面所有要求;「## 判断依据」照常(BUG-2182)。 - 第一段一两句话直接回答用户问的那件事,说它在你生活里是什么样子,不提宫位、星和盘;是非题第一句先答是或不是,把握不足时说多半是或多半不是,成立的条件放在后面一句。问一段时间(最近、今年、往后几年)就先说这段时间。不给人、关系或模式起名号,不造词,不用四字概括和加引号的说法:用平常说话会用的词把意思说完整。 - 按用户自己的问法组织:问题有几个部分(比如平时怎么相处、在哪摩擦、对我有什么影响),就一部分一段、按用户的顺序;只点到几个人,就按人分段。每段第一句是一句 **加粗** 的白话结论,说到底:是什么、偏向哪一边,读的人不用再猜;别处不加粗。 - 正文里的依据:结论之后先讲它在日子里是什么样子,再用一句话带出最要紧的原因:每段只这一句,最多点两颗星,用白话说它让这件事怎样;不写宫位编号、星座名和分盘(用户点名的除外),不串配置、不讲推导过程,也不解释哪一处抵消或不抵消哪一处,位置、度数、分盘、运程的起止都留给「判断依据」。卡上标候选、待核实的格局和化解,正文不写成已经成立或已经解开。有一处反证让结论要打折扣时,把它写进结论本身(有支持也有摩擦,就两样都说),不另起一段解释。 diff --git a/frontend/src/mastra/synastry-report-chat.ts b/frontend/src/mastra/synastry-report-chat.ts index 14ad0af67..79cb877a1 100644 --- a/frontend/src/mastra/synastry-report-chat.ts +++ b/frontend/src/mastra/synastry-report-chat.ts @@ -42,6 +42,8 @@ export const SYNASTRY_CHAT_INSTRUCTIONS = [ `用户问的整件事这份合盘都没有算(比如子女、财运、事业、健康)时,全文只写这一句:「${SYNASTRY_FIXED_REPLY}」,后面不再写任何内容,不复述这一节,也不给别的建议。`, "问题里只有一部分没算到时(比如顺带问到会不会分开、离婚、有没有孩子、身体或钱的结果):先回答算到的部分,照常下判断;没算到的那个结果放在后面说一次,例如「会不会分开,这份合盘没算到」,对它两头都不下判断——不写会、不会、不至于,也不写它「不是……的原因」「不会走到那一步」来安抚。可以建议回到各自的盘单独问。", "前后 30 分钟只是试算。材料说试算里没有变化,就保留试算口径,不写「稳定」「已确认」或「不会变」。", + // BUG-2182:用户指定长度时以用户为准(验收时「用一两句话说」得到好几段长回答)。 + "用户说了要多长(「一两句话」「简单说」「只要结论」「说详细点」)时,按用户说的长度写,这一条优先于其他写法要求:说「一两句话」就只写一两句,不分段、不列「能做的几件事」、不加依据清单和小标题。", // 原值: 「口吻像一个懂行、说话温和的姐姐。说「你们」,不替两个人做决定。」;新值加了称呼的写法; // 原因: BUG-2084,同一份报告的回答里一位被写成「你」、另一位一会儿「他」一会儿「她」。读的人可能是两个人里的任何一位。 "口吻像一个懂行、说话温和的姐姐。一起说两个人时说「你们」,不替两个人做决定。说到其中一位时写名字,不用「你」指其中一位,也不写「他」「她」:材料里没有性别,不从名字猜;要代称时重复名字,或说「对方」。", diff --git a/frontend/tests/acceptance-fixes-2179.test.ts b/frontend/tests/acceptance-fixes-2179.test.ts new file mode 100644 index 000000000..d62551924 --- /dev/null +++ b/frontend/tests/acceptance-fixes-2179.test.ts @@ -0,0 +1,73 @@ +// BUG-2179: the plan-timing clarify reply is settled on the free path that accepts its length. +import assert from "node:assert/strict"; +import { readFileSync, readdirSync } from "node:fs"; +import test from "node:test"; +import { planTimingClarifyReply } from "../src/lib/plan-timing-clarify.ts"; + +const migrations = new URL("../supabase/migrations/", import.meta.url); +const latestFreeCompletion = readdirSync(migrations) + .filter((name) => name.endsWith(".sql")) + .sort() + .map((name) => readFileSync(new URL(name, migrations), "utf8")) + .filter((sql) => /create or replace function public\.complete_consultation_free\(/.test(sql)) + .at(-1) ?? ""; + +function limitFor(kind: string): number { + const match = latestFreeCompletion.match(new RegExp(`responseKind' = '${kind}'\\s*\\n?\\s*and length\\(p_response_message->>'text'\\) <= (\\d+)`)); + assert.ok(match, `no length limit found for ${kind}`); + return Number(match[1]); +} + +test("the clarify reply is longer than smalltalk allows but within the feedback limit", () => { + for (const question of ["我想看看今年推进一项重要计划的时机。请先确认具体是什么计划、希望什么时候完成,再分析准备、启动和落实的阶段,以及需要先解决的问题。", + "我想看看小王今年推进一项重要计划的时机。请先确认具体是什么计划、希望什么时候完成,再分析准备、启动和落实的阶段,以及需要先解决的问题。"]) { + const reply = planTimingClarifyReply(question); + assert.ok(reply.length > limitFor("smalltalk"), "if this ever fits smalltalk, the feedback path is no longer needed"); + assert.ok(reply.length <= limitFor("feedback"), `clarify reply ${reply.length} chars exceeds the feedback limit`); + } +}); + +test("the route settles the clarify reply with completeFeedback", () => { + const route = readFileSync(new URL("../src/app/api/consult/route.ts", import.meta.url), "utf8"); + const start = route.indexOf("shouldClarifyPlanTiming({"); + const block = route.slice(start, route.indexOf('if (turn.kind === "smalltalk")')); + assert.match(block, /consultSettlement\.completeFeedback\(reply, \{\}, birthFields\)/); +}); + +// BUG-2180: 首次引导「有记录」和「出生证明、医院记录 → 记录下来的」实际存下的值。 +import { birthTimeUncertain } from "../src/lib/birth-time-trust.ts"; +import { buildLongformBirthPayload } from "../src/lib/personal-report-longform-birth.ts"; +import { annualBirthTime } from "../src/lib/annual-birth-time.ts"; + +const recordedAsStored = Object.freeze({ + birth_date: "1961-08-04", + reported_birth_time: "19:24", + birth_time_source: "hospital_record", + birth_time_record_kind: "recorded", + birth_time_uncertainty_known: false, + birth_time_status: "reported", + latitude: 21.3069, + longitude: -157.8583, + timezone_offset: -10, + ayanamsa: "lahiri", +}); + +test("a recorded certificate or hospital time stored with 「没给范围」 is certain", () => { + assert.equal(birthTimeUncertain(recordedAsStored), false, "hospital_record + recorded + known false"); + assert.equal(birthTimeUncertain({ ...recordedAsStored, birth_time_source: "id_document" }), false); + assert.equal(birthTimeUncertain({ ...recordedAsStored, birth_time_record_kind: null }), false, "older rows without a record kind"); + // Still uncertain: a record the user only roughly remembers, or a range they gave. + assert.equal(birthTimeUncertain({ ...recordedAsStored, birth_time_record_kind: "approximate" }), true); + assert.equal(birthTimeUncertain({ ...recordedAsStored, birth_time_uncertainty_known: true, + declared_window_start: "19:10", declared_window_end: "19:40" }), true); + assert.equal(birthTimeUncertain({ ...recordedAsStored, birth_time_source: "approximate", birth_time_record_kind: null }), true, + "家人记得大概几点 + 说不准"); +}); + +test("the report and the annual report read that record as the entered minute", () => { + const payload = buildLongformBirthPayload(recordedAsStored, { today: "2026-11-22", targetYear: 2026, candidateRange: null, + birthTimeAccuracy: "confirmed", readingMinuteConfirmed: false })!; + assert.equal(payload.birth_time_accuracy, "confirmed"); + assert.equal("birth_time_window" in payload, false); + assert.equal(annualBirthTime(recordedAsStored).range, "entered_minute"); +}); diff --git a/frontend/tests/annual-ruling-1650.test.tsx b/frontend/tests/annual-ruling-1650.test.tsx index 25c658e68..e65f67874 100644 --- a/frontend/tests/annual-ruling-1650.test.tsx +++ b/frontend/tests/annual-ruling-1650.test.tsx @@ -56,7 +56,7 @@ test("timeline rows merge only what the rule layer groups, and keep every phase test("the appendix keeps the four birth-time facts apart and drops the weighted lean", () => { const lines = birthTimeLines(facts, BIRTH); - assert.deepEqual(lines.slice(0, 3), ["出生资料:用户核对后录入", "时间来源:家人记得的时间;误差:早 15 分钟到晚 15 分钟", "校正:未校正"]); + assert.deepEqual(lines.slice(0, 3), ["出生资料:用户核对后录入", "出生时间记录:家人记得的时间;误差:早 15 分钟到晚 15 分钟", "校正:未校正"]); assert.match(lines[3], /^稳定性:/); assert.match(birthTimeLines(facts, { ...BIRTH, rectification: "adopted" })[2], /不等于误差已消失/); const appendix = buildAppendix(facts, rangeView(facts, "birthday_year", "annual:birthday_year:2026"), BIRTH); diff --git a/frontend/tests/annual-user-layer-2037.test.tsx b/frontend/tests/annual-user-layer-2037.test.tsx index c534a9ac5..80fd1547b 100644 --- a/frontend/tests/annual-user-layer-2037.test.tsx +++ b/frontend/tests/annual-user-layer-2037.test.tsx @@ -53,7 +53,7 @@ test("the start page and the parameters block name a chosen range as chosen, not const birth: AnnualBirthTime = { known: true, beforeMinutes: 6, afterMinutes: 1, source: "family_exact", rectification: "adopted", range: "chosen" }; assert.deepEqual(birthNotice({ id: "self", name: "小林", isSelf: true, birthTime: birth }), { text: "出生时间按你在生时纠正里选的情况来算。" }); const lines = birthTimeLines(facts, birth); - assert.equal(lines[1], "时间来源:家人记得的时间;误差:生时纠正里选定的区间(早 6 分钟到晚 1 分钟)"); + assert.equal(lines[1], "出生时间记录:家人记得的时间;误差:生时纠正里选定的区间(早 6 分钟到晚 1 分钟)"); assert.doesNotMatch(lines.join("\n"), /30 分钟试算|没有填/); }); diff --git a/frontend/tests/consult-answer-shape-20261105.test.ts b/frontend/tests/consult-answer-shape-20261105.test.ts index 52b6cf5d6..130d33c90 100644 --- a/frontend/tests/consult-answer-shape-20261105.test.ts +++ b/frontend/tests/consult-answer-shape-20261105.test.ts @@ -109,14 +109,14 @@ test("VISIBLE VOICE stays at most 2,600 characters and did not grow (BUG-1603)", // 原值: ≤ 2600 / 新值: ≤ 2750 / 原因: 占星师 2026-11-08 第五轮裁定 6(BUG-1755、BUG-1757):白话不能少信息——决定性反证不省、方法分歧写技法名、限制与核验缺口写在相关结论旁、冲突时写实际来源 // 原值(2): ≤ 2750 / 新值(2): ≤ 3074 / 原因(2): 产品 2026-11-16 合并两种解读方式:这段成为唯一的写法,加「(明显)/(只是可能)」标注、照用户划的范围写、末尾「## 判断依据」一节三条 // BUG-1920 (2026-11-16): 原值(3): ≤ 3074 / 新值(3): ≤ 3731 / 原因(3): 产品 2026-11-16 回答读起来像推责、难懂:加「不推责」「用词」两条,正文依据改成每段一句、位置留给判断依据,受冲红线改成直接下判断 - assert.ok(productConversationVoice.length <= 4420 /* BUG-2153 (2026-11-22): 原值 4260 / 新值 4420 / 原因: 传统说法一条加「在这张盘里」称量和一个例句,场景一条改成按这张盘定。 BUG-2150 (2026-11-22): 原值 3960 / 新值 4260 / 原因: 判断依据写出第二套运程、对口代表星、对口分盘和时间段的原因(负责人同意深度解读与网站回答对比后补回) */ /* BUG-2149 (2026-11-22): 原值 3880 / 新值 3960 / 原因: 问答正文跟报告同一条宫位规则(READING_HOUSE_RULE 比原来「说这颗星管哪几个宫」长),日期写到月份 */ /* BUG-1981 (2026-11-18): 原值 3820 / 新值 3880 / 原因: 判断依据改用中文依据性质说明,列出五种性质 */ /* BUG-1977 补充 (2026-11-18): 原值 3790 / 新值 3820 / 原因: staging 实测追问「上次说的没发生」时模型认领了本对话没说过的预测、把已发生的事改读去迎合、没提生时纠正;纠正一条补「没说过的话不认领、已过去的事不改读法去迎合、用一句话提生时纠正」 */ /* BUG-1977 (2026-11-18): 原值 3780 / 新值 3790 / 原因: 纠正一条改为「用户说不准时判断不因此改、核对出生时间走生时纠正,事实读错才改正」(占星师 11-18:用户反馈只用于生时纠正) */ /* BUG-1974 (2026-11-18): 原值 3765 / 新值 3780 / 原因: 是非题开头改为先表态(多半是或多半不是),条件放后面 */ /* BUG-1930 (2026-11-16): 原值 3731 / 新值 3765 / 原因: 「不推责」补「判断后面不补叫人别当真的话」,并把会被照抄的「底色」「这条线」换成平常说法 */, `VISIBLE VOICE is ${productConversationVoice.length} characters`); + assert.ok(productConversationVoice.length <= 4500 /* BUG-2182 (2026-11-22): 原值 4420 / 新值 4500 / 原因: 加一句「用户说了要多长时按用户说的写」。 BUG-2153 (2026-11-22): 原值 4260 / 新值 4420 / 原因: 传统说法一条加「在这张盘里」称量和一个例句,场景一条改成按这张盘定。 BUG-2150 (2026-11-22): 原值 3960 / 新值 4260 / 原因: 判断依据写出第二套运程、对口代表星、对口分盘和时间段的原因(负责人同意深度解读与网站回答对比后补回) */ /* BUG-2149 (2026-11-22): 原值 3880 / 新值 3960 / 原因: 问答正文跟报告同一条宫位规则(READING_HOUSE_RULE 比原来「说这颗星管哪几个宫」长),日期写到月份 */ /* BUG-1981 (2026-11-18): 原值 3820 / 新值 3880 / 原因: 判断依据改用中文依据性质说明,列出五种性质 */ /* BUG-1977 补充 (2026-11-18): 原值 3790 / 新值 3820 / 原因: staging 实测追问「上次说的没发生」时模型认领了本对话没说过的预测、把已发生的事改读去迎合、没提生时纠正;纠正一条补「没说过的话不认领、已过去的事不改读法去迎合、用一句话提生时纠正」 */ /* BUG-1977 (2026-11-18): 原值 3780 / 新值 3790 / 原因: 纠正一条改为「用户说不准时判断不因此改、核对出生时间走生时纠正,事实读错才改正」(占星师 11-18:用户反馈只用于生时纠正) */ /* BUG-1974 (2026-11-18): 原值 3765 / 新值 3780 / 原因: 是非题开头改为先表态(多半是或多半不是),条件放后面 */ /* BUG-1930 (2026-11-16): 原值 3731 / 新值 3765 / 原因: 「不推责」补「判断后面不补叫人别当真的话」,并把会被照抄的「底色」「这条线」换成平常说法 */, `VISIBLE VOICE is ${productConversationVoice.length} characters`); // 2,228 before BUG-1603 (staging 1ef3caa4); the shape statements were replaced, not stacked. // 原值: 2228 / 新值: 2253 / 原因: BUG-1693、BUG-1690(问一段时间先说这段时间;强弱只照 shadbala) // 原值(2): 2253 / 新值(2): 2315 / 原因(2): 产品 2026-11-07 占星师方案:专业模式默认、完整运行 skill;本段成为白话模式,加一行模式说明,红线补怀孕、孩子性别 // 原值(3): 2315 / 新值(3): 2712 / 原因(3): 占星师 2026-11-08 第五轮裁定 6(BUG-1755、BUG-1756、BUG-1757):删「最多两处」后补「决定性反证不省」,加方法分歧写技法名、限制与核验缺口写在相关结论旁、冲突时写实际来源;PLAIN_TERMS 加技法名例外 // 原值(4): 2712 / 新值(4): 3074 / 原因(4): 产品 2026-11-16 合并两种解读方式:这段成为唯一的写法,加「(明显)/(只是可能)」标注、照用户划的范围写、末尾「## 判断依据」一节三条 // BUG-1920 (2026-11-16): 原值(5): 3074 / 新值(5): 3731 / 原因(5): 产品 2026-11-16 回答读起来像推责、难懂:加「不推责」「用词」两条,正文依据改成每段一句、位置留给判断依据,受冲红线改成直接下判断 - assert.ok(productConversationVoice.length <= 4420 /* BUG-2153 (2026-11-22): 原值 4260 / 新值 4420 / 原因: 传统说法一条加「在这张盘里」称量和一个例句,场景一条改成按这张盘定。 BUG-2150 (2026-11-22): 原值 3960 / 新值 4260 / 原因: 判断依据写出第二套运程、对口代表星、对口分盘和时间段的原因(负责人同意深度解读与网站回答对比后补回) */ /* BUG-2149 (2026-11-22): 原值 3880 / 新值 3960 / 原因: 问答正文跟报告同一条宫位规则(READING_HOUSE_RULE 比原来「说这颗星管哪几个宫」长),日期写到月份 */ /* BUG-1981 (2026-11-18): 原值 3820 / 新值 3880 / 原因: 判断依据改用中文依据性质说明,列出五种性质 */ /* BUG-1977 补充 (2026-11-18): 原值 3790 / 新值 3820 / 原因: staging 实测追问「上次说的没发生」时模型认领了本对话没说过的预测、把已发生的事改读去迎合、没提生时纠正;纠正一条补「没说过的话不认领、已过去的事不改读法去迎合、用一句话提生时纠正」 */ /* BUG-1977 (2026-11-18): 原值 3780 / 新值 3790 / 原因: 纠正一条改为「用户说不准时判断不因此改、核对出生时间走生时纠正,事实读错才改正」(占星师 11-18:用户反馈只用于生时纠正) */ /* BUG-1974 (2026-11-18): 原值 3765 / 新值 3780 / 原因: 是非题开头改为先表态(多半是或多半不是),条件放后面 */, `VISIBLE VOICE grew to ${productConversationVoice.length}`); + assert.ok(productConversationVoice.length <= 4500 /* BUG-2182 (2026-11-22): 原值 4420 / 新值 4500 / 原因: 加一句「用户说了要多长时按用户说的写」。 BUG-2153 (2026-11-22): 原值 4260 / 新值 4420 / 原因: 传统说法一条加「在这张盘里」称量和一个例句,场景一条改成按这张盘定。 BUG-2150 (2026-11-22): 原值 3960 / 新值 4260 / 原因: 判断依据写出第二套运程、对口代表星、对口分盘和时间段的原因(负责人同意深度解读与网站回答对比后补回) */ /* BUG-2149 (2026-11-22): 原值 3880 / 新值 3960 / 原因: 问答正文跟报告同一条宫位规则(READING_HOUSE_RULE 比原来「说这颗星管哪几个宫」长),日期写到月份 */ /* BUG-1981 (2026-11-18): 原值 3820 / 新值 3880 / 原因: 判断依据改用中文依据性质说明,列出五种性质 */ /* BUG-1977 补充 (2026-11-18): 原值 3790 / 新值 3820 / 原因: staging 实测追问「上次说的没发生」时模型认领了本对话没说过的预测、把已发生的事改读去迎合、没提生时纠正;纠正一条补「没说过的话不认领、已过去的事不改读法去迎合、用一句话提生时纠正」 */ /* BUG-1977 (2026-11-18): 原值 3780 / 新值 3790 / 原因: 纠正一条改为「用户说不准时判断不因此改、核对出生时间走生时纠正,事实读错才改正」(占星师 11-18:用户反馈只用于生时纠正) */ /* BUG-1974 (2026-11-18): 原值 3765 / 新值 3780 / 原因: 是非题开头改为先表态(多半是或多半不是),条件放后面 */, `VISIBLE VOICE grew to ${productConversationVoice.length}`); }); test("one term table: PLAIN_TERMS, interpolated by VISIBLE VOICE and the report rule, no fixed glosses (BUG-1603)", () => { diff --git a/frontend/tests/consult-named-techniques-20261105.test.ts b/frontend/tests/consult-named-techniques-20261105.test.ts index fa62be9ac..ec3400785 100644 --- a/frontend/tests/consult-named-techniques-20261105.test.ts +++ b/frontend/tests/consult-named-techniques-20261105.test.ts @@ -49,5 +49,5 @@ test("no sample phrases and no growth (BUG-1165 / BUG-1540)", () => { // 原值(3): 2315 / 新值(3): 2712 / 原因(3): 占星师 2026-11-08 第五轮裁定 6(BUG-1755..1757):白话不能少信息——反证不省、分歧写技法名、限制与核验缺口写在相关结论旁、冲突写实际来源 // 原值(4): 2712 / 新值(4): 3074 / 原因(4): 产品 2026-11-16 合并两种解读方式:这段成为唯一的写法,加「(明显)/(只是可能)」标注、照用户划的范围写、末尾「## 判断依据」一节三条 // BUG-1920 (2026-11-16): 原值(5): 3074 / 新值(5): 3731 / 原因(5): 产品 2026-11-16 回答读起来像推责、难懂:加「不推责」「用词」两条,正文依据改成每段一句、位置留给判断依据,受冲红线改成直接下判断 - assert.ok([...productConversationVoice].length <= 4420 /* BUG-2153 (2026-11-22): 原值 4260 / 新值 4420 / 原因: 传统说法一条加「在这张盘里」称量和一个例句,场景一条改成按这张盘定。 BUG-2150 (2026-11-22): 原值 3960 / 新值 4260 / 原因: 判断依据写出第二套运程、对口代表星、对口分盘和时间段的原因(负责人同意深度解读与网站回答对比后补回) */ /* BUG-2149 (2026-11-22): 原值 3880 / 新值 3960 / 原因: 问答正文跟报告同一条宫位规则,日期写到月份 */ /* BUG-1981 (2026-11-18): 原值 3820 / 新值 3880 / 原因: 判断依据改用中文依据性质说明,列出五种性质 */ /* BUG-1977 补充 (2026-11-18): 原值 3790 / 新值 3820 / 原因: staging 实测追问「上次说的没发生」时模型认领了本对话没说过的预测、把已发生的事改读去迎合、没提生时纠正;纠正一条补「没说过的话不认领、已过去的事不改读法去迎合、用一句话提生时纠正」 */ /* BUG-1977 (2026-11-18): 原值 3780 / 新值 3790 / 原因: 纠正一条改为「用户说不准时判断不因此改、核对出生时间走生时纠正,事实读错才改正」(占星师 11-18:用户反馈只用于生时纠正) */ /* BUG-1974 (2026-11-18): 原值 3765 / 新值 3780 / 原因: 是非题开头改为先表态(多半是或多半不是),条件放后面 */ /* BUG-1930 (2026-11-16): 原值 3731 / 新值 3765 / 原因: 「不推责」补「判断后面不补叫人别当真的话」,并把会被照抄的「底色」「这条线」换成平常说法 */, String([...productConversationVoice].length)); + assert.ok([...productConversationVoice].length <= 4500 /* BUG-2182 (2026-11-22): 原值 4420 / 新值 4500 / 原因: 加一句「用户说了要多长时按用户说的写」。 BUG-2153 (2026-11-22): 原值 4260 / 新值 4420 / 原因: 传统说法一条加「在这张盘里」称量和一个例句,场景一条改成按这张盘定。 BUG-2150 (2026-11-22): 原值 3960 / 新值 4260 / 原因: 判断依据写出第二套运程、对口代表星、对口分盘和时间段的原因(负责人同意深度解读与网站回答对比后补回) */ /* BUG-2149 (2026-11-22): 原值 3880 / 新值 3960 / 原因: 问答正文跟报告同一条宫位规则,日期写到月份 */ /* BUG-1981 (2026-11-18): 原值 3820 / 新值 3880 / 原因: 判断依据改用中文依据性质说明,列出五种性质 */ /* BUG-1977 补充 (2026-11-18): 原值 3790 / 新值 3820 / 原因: staging 实测追问「上次说的没发生」时模型认领了本对话没说过的预测、把已发生的事改读去迎合、没提生时纠正;纠正一条补「没说过的话不认领、已过去的事不改读法去迎合、用一句话提生时纠正」 */ /* BUG-1977 (2026-11-18): 原值 3780 / 新值 3790 / 原因: 纠正一条改为「用户说不准时判断不因此改、核对出生时间走生时纠正,事实读错才改正」(占星师 11-18:用户反馈只用于生时纠正) */ /* BUG-1974 (2026-11-18): 原值 3765 / 新值 3780 / 原因: 是非题开头改为先表态(多半是或多半不是),条件放后面 */ /* BUG-1930 (2026-11-16): 原值 3731 / 新值 3765 / 原因: 「不推责」补「判断后面不补叫人别当真的话」,并把会被照抄的「底色」「这条线」换成平常说法 */, String([...productConversationVoice].length)); }); diff --git a/frontend/tests/consultation-voice-contract.test.ts b/frontend/tests/consultation-voice-contract.test.ts index 30f1c0707..1a8392f90 100644 --- a/frontend/tests/consultation-voice-contract.test.ts +++ b/frontend/tests/consultation-voice-contract.test.ts @@ -33,7 +33,7 @@ test("the answer is written from one short VISIBLE VOICE, stated once (BUG-1540) // 原值: ≤ 2600 / 新值: ≤ 2750 / 原因: 占星师 2026-11-08 第五轮裁定 6(BUG-1755、BUG-1757):白话不能少信息——决定性反证不省、方法分歧写技法名、限制与核验缺口写在相关结论旁、冲突时写实际来源 // 原值(2): ≤ 2750 / 新值(2): ≤ 3074 / 原因(2): 产品 2026-11-16 合并两种解读方式:这段成为唯一的写法,加「(明显)/(只是可能)」标注、照用户划的范围写、末尾「## 判断依据」一节三条 // BUG-1920 (2026-11-16): 原值(3): ≤ 3074 / 新值(3): ≤ 3731 / 原因(3): 产品 2026-11-16 回答读起来像推责、难懂:加「不推责」「用词」两条,正文依据改成每段一句、位置留给判断依据,受冲红线改成直接下判断 - assert.ok(productConversationVoice.length <= 4420 /* BUG-2153 (2026-11-22): 原值 4260 / 新值 4420 / 原因: 传统说法一条加「在这张盘里」称量和一个例句,场景一条改成按这张盘定。 BUG-2150 (2026-11-22): 原值 3960 / 新值 4260 / 原因: 判断依据写出第二套运程、对口代表星、对口分盘和时间段的原因(负责人同意深度解读与网站回答对比后补回) */ /* BUG-2149 (2026-11-22): 原值 3880 / 新值 3960 / 原因: 问答正文跟报告同一条宫位规则(READING_HOUSE_RULE 比原来「说这颗星管哪几个宫」长),日期写到月份 */ /* BUG-1981 (2026-11-18): 原值 3820 / 新值 3880 / 原因: 判断依据改用中文依据性质说明,列出五种性质 */ /* BUG-1977 补充 (2026-11-18): 原值 3790 / 新值 3820 / 原因: staging 实测追问「上次说的没发生」时模型认领了本对话没说过的预测、把已发生的事改读去迎合、没提生时纠正;纠正一条补「没说过的话不认领、已过去的事不改读法去迎合、用一句话提生时纠正」 */ /* BUG-1977 (2026-11-18): 原值 3780 / 新值 3790 / 原因: 纠正一条改为「用户说不准时判断不因此改、核对出生时间走生时纠正,事实读错才改正」(占星师 11-18:用户反馈只用于生时纠正) */ /* BUG-1974 (2026-11-18): 原值 3765 / 新值 3780 / 原因: 是非题开头改为先表态(多半是或多半不是),条件放后面 */ /* BUG-1930 (2026-11-16): 原值 3731 / 新值 3765 / 原因: 「不推责」补「判断后面不补叫人别当真的话」,并把会被照抄的「底色」「这条线」换成平常说法 */, `VISIBLE VOICE is ${productConversationVoice.length} characters`); + assert.ok(productConversationVoice.length <= 4500 /* BUG-2182 (2026-11-22): 原值 4420 / 新值 4500 / 原因: 加一句「用户说了要多长时按用户说的写」。 BUG-2153 (2026-11-22): 原值 4260 / 新值 4420 / 原因: 传统说法一条加「在这张盘里」称量和一个例句,场景一条改成按这张盘定。 BUG-2150 (2026-11-22): 原值 3960 / 新值 4260 / 原因: 判断依据写出第二套运程、对口代表星、对口分盘和时间段的原因(负责人同意深度解读与网站回答对比后补回) */ /* BUG-2149 (2026-11-22): 原值 3880 / 新值 3960 / 原因: 问答正文跟报告同一条宫位规则(READING_HOUSE_RULE 比原来「说这颗星管哪几个宫」长),日期写到月份 */ /* BUG-1981 (2026-11-18): 原值 3820 / 新值 3880 / 原因: 判断依据改用中文依据性质说明,列出五种性质 */ /* BUG-1977 补充 (2026-11-18): 原值 3790 / 新值 3820 / 原因: staging 实测追问「上次说的没发生」时模型认领了本对话没说过的预测、把已发生的事改读去迎合、没提生时纠正;纠正一条补「没说过的话不认领、已过去的事不改读法去迎合、用一句话提生时纠正」 */ /* BUG-1977 (2026-11-18): 原值 3780 / 新值 3790 / 原因: 纠正一条改为「用户说不准时判断不因此改、核对出生时间走生时纠正,事实读错才改正」(占星师 11-18:用户反馈只用于生时纠正) */ /* BUG-1974 (2026-11-18): 原值 3765 / 新值 3780 / 原因: 是非题开头改为先表态(多半是或多半不是),条件放后面 */ /* BUG-1930 (2026-11-16): 原值 3731 / 新值 3765 / 原因: 「不推责」补「判断后面不补叫人别当真的话」,并把会被照抄的「底色」「这条线」换成平常说法 */, `VISIBLE VOICE is ${productConversationVoice.length} characters`); assert.ok(natalSpokenReportContract.length <= 600, `contract is ${natalSpokenReportContract.length} characters`); // Stated once: the contract, the user turns, index and the skill binding point at it instead of restating it. assert.match(natalSpokenReportContract, /VISIBLE VOICE above is the only statement of how the answer is written/); diff --git a/frontend/tests/plan-timing-clarify-2161.test.ts b/frontend/tests/plan-timing-clarify-2161.test.ts index 104e6f176..b3bf64646 100644 --- a/frontend/tests/plan-timing-clarify-2161.test.ts +++ b/frontend/tests/plan-timing-clarify-2161.test.ts @@ -59,7 +59,10 @@ test("the route answers the bare starter on the free path before smalltalk and f assert.ok(clarify > 0); assert.ok(clarify < route.indexOf('if (turn.kind === "smalltalk")')); const block = route.slice(clarify, route.indexOf('if (turn.kind === "smalltalk")')); - assert.match(block, /completeSmalltalk\(reply, birthFields\)/); + // BUG-2179 原值:completeSmalltalk(reply, birthFields);新值:completeFeedback(reply, {}, birthFields); + // 原因:smalltalk 在数据库里限 20 字,这句追问约 70 字,每次保存都被拒。 + assert.match(block, /completeFeedback\(reply, \{\}, birthFields\)/); + assert.doesNotMatch(block, /consultSettlement\.completeSmalltalk/); assert.match(block, /consultation-plan-clarify-v1/); }); diff --git a/references/yoga_rule_topics.v1.json b/references/yoga_rule_topics.v1.json index 18496ac12..f504c0c07 100644 --- a/references/yoga_rule_topics.v1.json +++ b/references/yoga_rule_topics.v1.json @@ -2,7 +2,7 @@ "schema": "yoga-rule-topics-v1", "status": "pending_astrologer_review", "built_from": "references/yoga_rules.json", - "built_from_sha256": "c0e7ef2a5195", + "built_from_sha256": "b521bd126b59", "builder": "scripts/research/build_yoga_rule_topics.py", "rule": "A topic is assigned only when the rule's own effect text names the domain with a listed keyword; condition text is not read. unmapped = the text names no domain (待映射, never dropped). longevity, fame_authority and spirituality are recorded for review; no chat domain selects by them.", "rules": { @@ -236,7 +236,7 @@ "学" ] }, - "basis_text": "Desires fulfilled through intelligence | Help from children or students | 愿望通过智慧实现 | 子女/学生助力", + "basis_text": "Desires fulfilled through intelligence | Traditionally linked to help from children or students | 愿望通过智慧实现 | 传统上与得到子女或学生相助有关", "mapping": "keyword_proposal" }, "asraya_partial": { @@ -1117,7 +1117,7 @@ "子女" ] }, - "basis_text": "Many children | Thriving descendants | Accomplished descendants | 子女众多 | 子孙兴旺 | 后代有成就", + "basis_text": "Traditionally linked to having many children | Traditionally linked to thriving descendants | Traditionally linked to accomplished descendants | 传统上与子女较多有关 | 传统上与后代兴旺有关 | 传统上与后代有成就有关", "mapping": "keyword_proposal" }, "bvr_bahu_sthree_yoga": { @@ -1626,12 +1626,11 @@ ], "matched_words": { "children": [ - "child", "children", "子女" ] }, - "basis_text": "An only child | Few but excellent children | 独生子女 | 子女少但优秀", + "basis_text": "Traditionally linked to having few children | Traditionally linked to few but outstanding children | 传统上与子女数量少有关 | 传统上与子女虽少但出众有关", "mapping": "keyword_proposal" }, "bvr_ekabhagini_yoga": { @@ -3456,7 +3455,7 @@ "子女" ] }, - "basis_text": "Substantial savings | Good fortune with children | Successful investments | 储蓄丰厚 | 子女运好 | 投资成功", + "basis_text": "Substantial savings | Traditionally linked to good fortune with children | Successful investments | 储蓄丰厚 | 传统上与子女方面的福分有关 | 投资成功", "mapping": "keyword_proposal" }, "dhana_yoga_2_lord_strong": { @@ -3496,6 +3495,7 @@ "wealth": [ "Wealth", "gains", + "wealth", "富", "财" ], @@ -3504,7 +3504,7 @@ "子女" ] }, - "basis_text": "Investment gains | Wealth through children | Wealth through intelligence | 投资收益 | 子女带来财富 | 智慧致富", + "basis_text": "Investment gains | Traditionally linked to wealth through children | Wealth through intelligence | 投资收益 | 传统上与通过子女得到财富有关 | 智慧致富", "mapping": "keyword_proposal" }, "dhana_yoga_5_9_lord": { @@ -4802,7 +4802,7 @@ "健康" ] }, - "basis_text": "Obstacles concerning children | Watch children's health | 子女运受阻 | 需要注意子女健康", + "basis_text": "Traditionally linked to obstacles concerning children | Traditionally linked to care for children's health | 传统上与子女方面的阻碍有关 | 传统上与子女健康需要留意有关", "mapping": "keyword_proposal" }, "putra_yoga_5_9": { @@ -4817,7 +4817,7 @@ "子女" ] }, - "basis_text": "Good fortune with children | Accomplished children | 子女运好 | 子女有成就", + "basis_text": "Traditionally linked to good fortune with children | Traditionally linked to accomplished children | 传统上与子女方面的福分有关 | 传统上与子女有成就有关", "mapping": "keyword_proposal" }, "putra_yoga_5_exalted": { @@ -4832,7 +4832,7 @@ "子女" ] }, - "basis_text": "Outstanding children | Highly accomplished children | 杰出子女 | 子女成就高", + "basis_text": "Traditionally linked to outstanding children | Traditionally linked to accomplished children | 传统上与子女出众有关 | 传统上与子女有成就有关", "mapping": "keyword_proposal" }, "putra_yoga_5_in_kendra": { @@ -4848,11 +4848,11 @@ "子女" ], "fame_authority": [ - "Fame", + "fame", "名" ] }, - "basis_text": "Accomplished children | Fame through children | 子女有成就 | 子女带来名声", + "basis_text": "Traditionally linked to accomplished children | Traditionally linked to fame through children | 传统上与子女有成就有关 | 传统上与因子女得名有关", "mapping": "keyword_proposal" }, "putra_yoga_9_kendra": { @@ -4863,12 +4863,11 @@ ], "matched_words": { "children": [ - "Children", "children", "子女" ] }, - "basis_text": "Children are protected by the native | Ancestral merit benefits the children | 子女受其庇护 | 祖先福报影响子女", + "basis_text": "Traditionally linked to children being protected | Traditionally linked to ancestral merit benefiting the children | 传统上与子女受到庇护有关 | 传统上与祖先福报惠及子女有关", "mapping": "keyword_proposal" }, "putra_yoga_combined": { @@ -4879,12 +4878,11 @@ ], "matched_words": { "children": [ - "Children", "children", "子女" ] }, - "basis_text": "Excellent fortune with children | Children achieve highly | 极佳子女运 | 子女成就卓越", + "basis_text": "Traditionally linked to good fortune with children | Traditionally linked to accomplished children | 传统上与子女方面的福分有关 | 传统上与子女有成就有关", "mapping": "keyword_proposal" }, "putra_yoga_jupiter_5": { @@ -4897,7 +4895,6 @@ ], "matched_words": { "children": [ - "Children", "children", "子女" ], @@ -4909,7 +4906,7 @@ "宗教" ] }, - "basis_text": "Intelligent children | Children inclined to religion or philosophy | 子女智慧 | 子女有宗教/哲学倾向", + "basis_text": "Traditionally linked to intelligent children | Traditionally linked to children inclined to religion or philosophy | 传统上与子女聪慧有关 | 传统上与子女倾向宗教或哲学有关", "mapping": "keyword_proposal" }, "putra_yoga_jupiter_strong": { @@ -4924,7 +4921,7 @@ "子女" ] }, - "basis_text": "Good fortune with children | Intelligent children | 子女运佳 | 子女智慧", + "basis_text": "Traditionally linked to good fortune with children | Traditionally linked to intelligent children | 传统上与子女方面的福分有关 | 传统上与子女聪慧有关", "mapping": "keyword_proposal" }, "rahu_guru_yoga": { diff --git a/references/yoga_rules.json b/references/yoga_rules.json index 8b606a07d..5e67b12dd 100644 --- a/references/yoga_rules.json +++ b/references/yoga_rules.json @@ -3362,12 +3362,12 @@ }, "effects": [ "投资收益", - "子女带来财富", + "传统上与通过子女得到财富有关", "智慧致富" ], "effects_en": [ "Investment gains", - "Wealth through children", + "Traditionally linked to wealth through children", "Wealth through intelligence" ], "strength": "强", @@ -3397,12 +3397,12 @@ }, "effects": [ "储蓄丰厚", - "子女运好", + "传统上与子女方面的福分有关", "投资成功" ], "effects_en": [ "Substantial savings", - "Good fortune with children", + "Traditionally linked to good fortune with children", "Successful investments" ], "strength": "强", @@ -4264,12 +4264,12 @@ ] }, "effects": [ - "子女运好", - "子女有成就" + "传统上与子女方面的福分有关", + "传统上与子女有成就有关" ], "effects_en": [ - "Good fortune with children", - "Accomplished children" + "Traditionally linked to good fortune with children", + "Traditionally linked to accomplished children" ], "strength": "强", "strength_en": "strong", @@ -4294,12 +4294,12 @@ ] }, "effects": [ - "子女运佳", - "子女智慧" + "传统上与子女方面的福分有关", + "传统上与子女聪慧有关" ], "effects_en": [ - "Good fortune with children", - "Intelligent children" + "Traditionally linked to good fortune with children", + "Traditionally linked to intelligent children" ], "strength": "强", "strength_en": "strong", @@ -4324,12 +4324,12 @@ ] }, "effects": [ - "子女有成就", - "子女带来名声" + "传统上与子女有成就有关", + "传统上与因子女得名有关" ], "effects_en": [ - "Accomplished children", - "Fame through children" + "Traditionally linked to accomplished children", + "Traditionally linked to fame through children" ], "strength": "强", "strength_en": "strong", @@ -4354,12 +4354,12 @@ ] }, "effects": [ - "极佳子女运", - "子女成就卓越" + "传统上与子女方面的福分有关", + "传统上与子女有成就有关" ], "effects_en": [ - "Excellent fortune with children", - "Children achieve highly" + "Traditionally linked to good fortune with children", + "Traditionally linked to accomplished children" ], "strength": "强", "strength_en": "strong", @@ -4384,12 +4384,12 @@ ] }, "effects": [ - "子女运受阻", - "需要注意子女健康" + "传统上与子女方面的阻碍有关", + "传统上与子女健康需要留意有关" ], "effects_en": [ - "Obstacles concerning children", - "Watch children's health" + "Traditionally linked to obstacles concerning children", + "Traditionally linked to care for children's health" ], "strength": "弱", "strength_en": "weak", @@ -5794,12 +5794,12 @@ "strength": "强", "strength_en": "strong", "effects": [ - "杰出子女", - "子女成就高" + "传统上与子女出众有关", + "传统上与子女有成就有关" ], "effects_en": [ - "Outstanding children", - "Highly accomplished children" + "Traditionally linked to outstanding children", + "Traditionally linked to accomplished children" ], "logic": { "type": "dignity", @@ -5824,12 +5824,12 @@ "strength": "强", "strength_en": "strong", "effects": [ - "子女智慧", - "子女有宗教/哲学倾向" + "传统上与子女聪慧有关", + "传统上与子女倾向宗教或哲学有关" ], "effects_en": [ - "Intelligent children", - "Children inclined to religion or philosophy" + "Traditionally linked to intelligent children", + "Traditionally linked to children inclined to religion or philosophy" ], "logic": { "type": "same_house", @@ -5854,12 +5854,12 @@ "strength": "中", "strength_en": "moderate", "effects": [ - "子女受其庇护", - "祖先福报影响子女" + "传统上与子女受到庇护有关", + "传统上与祖先福报惠及子女有关" ], "effects_en": [ - "Children are protected by the native", - "Ancestral merit benefits the children" + "Traditionally linked to children being protected", + "Traditionally linked to ancestral merit benefiting the children" ], "logic": { "type": "lord_in_house", @@ -6540,11 +6540,11 @@ "strength_en": "strong", "effects": [ "愿望通过智慧实现", - "子女/学生助力" + "传统上与得到子女或学生相助有关" ], "effects_en": [ "Desires fulfilled through intelligence", - "Help from children or students" + "Traditionally linked to help from children or students" ], "logic": { "type": "in_houses", @@ -11628,12 +11628,12 @@ "combo_template_en": "5th lord in a Kendra or Trikona" }, "effects": [ - "独生子女", - "子女少但优秀" + "传统上与子女数量少有关", + "传统上与子女虽少但出众有关" ], "effects_en": [ - "An only child", - "Few but excellent children" + "Traditionally linked to having few children", + "Traditionally linked to few but outstanding children" ], "strength": "中", "strength_en": "moderate", @@ -11971,14 +11971,14 @@ "combo_template_en": "Rahu in the 5th not in a Saturn Navamsa, or the Navamsa lord of planets linked to the 7th lord in the 1st/2nd/5th" }, "effects": [ - "子女众多", - "子孙兴旺", - "后代有成就" + "传统上与子女较多有关", + "传统上与后代兴旺有关", + "传统上与后代有成就有关" ], "effects_en": [ - "Many children", - "Thriving descendants", - "Accomplished descendants" + "Traditionally linked to having many children", + "Traditionally linked to thriving descendants", + "Traditionally linked to accomplished descendants" ], "strength": "中", "strength_en": "moderate", diff --git a/scripts/report_render/parity_chapters.py b/scripts/report_render/parity_chapters.py index acebcc9d5..79219f6ee 100644 --- a/scripts/report_render/parity_chapters.py +++ b/scripts/report_render/parity_chapters.py @@ -3807,7 +3807,7 @@ def _argala_detail(houses: dict, language: str) -> str: else ["Reference house", "Kind", "House from reference", "Planets", "Obstructing house", "Obstructing planets", "Effective"] ) note = ( - "逐条列出每一宫的 Argala 来源:第 2、4、11 宫为主 Argala,对应第 12、10、3 宫阻挡;第 5 宫为次 Argala,第 9 宫阻挡;第 3 宫两颗以上凶星形成特殊 Argala。两边都没有行星的来源不列。" + "逐条列出每一宫的 Argala 形成情况:第 2、4、11 宫为主 Argala,对应第 12、10、3 宫阻挡;第 5 宫为次 Argala,第 9 宫阻挡;第 3 宫两颗以上凶星形成特殊 Argala。两边都没有行星的来源不列。" if zh else "Each Argala source per house: houses 2, 4 and 11 are primary, obstructed from 12, 10 and 3; house 5 is secondary, obstructed from 9; two or more malefics in the 3rd form the special Argala. Sources with no planets on either side are omitted." ) diff --git a/scripts/report_render/upstream_sync_chapters.py b/scripts/report_render/upstream_sync_chapters.py index 09fd3d7cf..b1956209a 100644 --- a/scripts/report_render/upstream_sync_chapters.py +++ b/scripts/report_render/upstream_sync_chapters.py @@ -650,12 +650,12 @@ def _rect_section(packet: dict, language: str) -> list[str]: scope_label = birth_window_disclosure(reading_window, language) if reading_window else None scope_line = f"- {'Range checked' if en else '本次核对范围'}{_colon(language)}{scope_label}" lines = [ - "### Birth data source and uncertainty" if en else "### 出生资料来源与不确定范围", + "### Birth data source and uncertainty" if en else "### 出生资料与不确定范围", "", f"- {'Place label' if en else '地点标签'}{_colon(language)}{_place_label(provenance.get('birthplace_label', 'not_recorded'), language)}", f"- {'Coordinate precision' if en else '坐标精度'}{_colon(language)}{_word(provenance.get('coordinate_precision', 'unverified_user_coordinates'), language)}", - f"- {'Coordinate source' if en else '坐标来源'}{_colon(language)}{_word(provenance.get('coordinate_source', 'not_recorded'), language)}", - f"- {'Birth time source' if en else '出生时间来源'}{_colon(language)}{_word(provenance.get('time_source', 'not_recorded'), language)}", + f"- {'Coordinate source' if en else '坐标取自'}{_colon(language)}{_word(provenance.get('coordinate_source', 'not_recorded'), language)}", + f"- {'Birth time source' if en else '出生时间记录'}{_colon(language)}{_word(provenance.get('time_source', 'not_recorded'), language)}", *([scope_line] if scope_label else [ f"- {'Time uncertainty (minutes)' if en else '时间不确定范围(分钟)'}{_colon(language)}{_word(provenance.get('uncertainty_minutes', 'not_recorded'), language)}", ]), diff --git a/tests/test_birth_coordinate_source_2125.py b/tests/test_birth_coordinate_source_2125.py index 119112e0f..76a02e2c2 100644 --- a/tests/test_birth_coordinate_source_2125.py +++ b/tests/test_birth_coordinate_source_2125.py @@ -18,8 +18,8 @@ PROVENANCE = { "user_entered": "unverified_user_coordinates", } ZH = { - "district_centroid": ("| 坐标 | 区县中心点 |", "- 坐标来源:区县中心点", "- 坐标精度:按区县中心点,未精确到出生地址"), - "user_entered": ("| 坐标 | 你填写的经纬度 |", "- 坐标来源:你填写的经纬度", "- 坐标精度:用户提供坐标,未核验"), + "district_centroid": ("| 坐标 | 区县中心点 |", "- 坐标取自:区县中心点", "- 坐标精度:按区县中心点,未精确到出生地址"), + "user_entered": ("| 坐标 | 你填写的经纬度 |", "- 坐标取自:你填写的经纬度", "- 坐标精度:用户提供坐标,未核验"), } EN = { "district_centroid": ("| Coordinates | District centre |", "- Coordinate source: district centre", diff --git a/tests/test_report_upstream_sync_20261107.py b/tests/test_report_upstream_sync_20261107.py index 574509d33..f85f4e26b 100644 --- a/tests/test_report_upstream_sync_20261107.py +++ b/tests/test_report_upstream_sync_20261107.py @@ -157,7 +157,7 @@ def test_rectification_contract_blocked_without_events() -> None: # 原值: 章内有「### 事件回放校验」「#### 盲回放与防调参边界」两个标题,事件回放状态为阻塞。 # 新值: 这两个标题不再出现,其余标题不变。 # 原因: BUG-2068 产品负责人与占星师 2026-11-20(B11)同意删除事件回放章节及其等级限制。 - for heading in ("### 出生资料来源与不确定范围", "### 时间精度合同", + for heading in ("### 出生资料与不确定范围", "### 时间精度合同", "### 断事推运判决矩阵", "### 生时敏感性矩阵", "#### 校时附录:分钟排行表", "### 校时证据领域合同"): assert heading in rect, heading assert "事件回放" not in rect and "盲回放" not in rect