fix: normal readings never calibrate on the user's past events (BUG-2111)
The astrologer (2026-11-21) ruled that ordinary readings and forecasts never use the user's experiences or feedback; only the rectification flow may. Her reference files still told the model to back-calculate the user's known events first, stop predicting below 3/5 matches, and grade A by such verification. Until she edits them upstream, a product layer cuts those passages out of every text sent to a model: the personal reading's quoted references, the chat's methodology excerpts, and every chat prompt before it reaches the provider (covering skill_read). The files are not edited; a test names any rule that stops matching once she changes them. Grade A no longer asks for a historical back-test. The status user_history_verification_required is no longer a gap: no verification questions, no penalty in ranking, never shown as 「需要过往经历核对」, not offered to the report or synastry writers. 「未见阻断项」 is caught in the reading and in report-question answers. Contract §AU announces the layer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
This commit is contained in:
@@ -28473,3 +28473,20 @@
|
||||
- 验证与防复发:`tests/test_report_leftovers_2109.py`(18 例)在两张公开盘的中英文报告上断言:英文版没有保留标记和中文行,Pada 行不印「未列」,相位矩阵没有罗睺—计都、没有原始阶段词、英文标题干净且覆盖对照表能找到,资料章节相位表里这一对不再标成相位,类别栏没有原始键,宫主表头是中文。`tests/test_report_fields_2065a.py` 里钉住旧写法的一处按原值、新值、原因更新。改前在干净检出上 17 例全部失败。
|
||||
- 关联记录:BUG-2065(相位表)、BUG-2095 / BUG-2104(读者用词)、BUG-2105(Arudha 表)。
|
||||
- 修复版本:`claude/report-leftovers-2109`。
|
||||
|
||||
## BUG-2111 | 普通解读和推运送给模型的材料里仍要求用用户过往经历校准
|
||||
|
||||
- 状态:fixed-pending-verify
|
||||
- 现象:占星师 2026-11-21 审核发现,送给模型的 `references/precision-reading-methodology.md` 不只一处要求先用用户已知的过去事件倒推校准、匹配不足就停止预测,并把「A-已验证」定义为经用户已知事件倒推验证;同类说法还在 `ai-reading-workflow-prompt.md` §5.0.1–5.0.2(含「用户未提供过往事件就必须降低置信度」)和 `transit-actionable-output-guide.md` 要素3。产品自己的提示词里也有:等级 A「个人预测最好有历史回测」,状态规则要求 `user_history_verification_required`「写成待核验并给出可核验的问题」,个人报告卡片带「建议结合真实经历核验本主题的部分证据结论」,事实表显示「需要过往经历核对」,合盘写作可选这个标签并显示「需要用真实经历核对」。
|
||||
- 触发条件:任何普通解读(个人报告解读整段引用方法论文件;问答摘录行运规范、并可用 `skill_read` 打开任何参考文件)。
|
||||
- 根因:占星师的参考文件把用户经历校准写成通用流程;产品此前只在问答的反馈处理里隔离了用户反馈(BUG-1980),没有隔离送给模型的方法原文,也没有清理把等级和状态挂到用户经历上的产品文字。
|
||||
- 修复(模型输入一侧;产生这个状态的 Python 一侧见 BUG-2110):
|
||||
- 新模块 `frontend/src/lib/user-history-isolation.ts`:按原文内容(不按行号)找出 10 处段落,整段换成一句产品说明、单行直接去掉;参考文件本身不改。用在个人报告解读的参考文件引用(`report-reading-skill.ts`,记录的哈希仍是原文件的)、问答方法摘录的文件读取(`consultation-methodology.ts`),以及问答每次发给模型前的整份提示(`skill-binding.ts` 的 `processLLMRequest`,覆盖 `skill_read` 读到的任何文件,不改存下来的工具结果)。生时纠正流程不读这些文件。
|
||||
- `product-voice.ts`:A 不再以历史回测为条件;等级只看盘面依据,不向用户要过往经历。`consultation-thinking-plan.ts`:`user_history_verification_required` 是旧数据标记、不算缺口,不写待核验、不提核验问题、不降结论。
|
||||
- 个人报告:事实表把这个状态按未声明处理;显示标签改成中性;状态排序与 `parameter_sensitive` 同级;不再生成「结合真实经历核验」的问题;写作代理的输出选项里去掉这个状态(存下的旧报告仍按 `CLAIM_STATUSES` 校验通过)。合盘:写作不再提供这个标签,显示词改中性,候选事件的说明不再要求用两人经历核对。
|
||||
- 「未见阻断项」(`no_open_blocker`):解读检查和报告内提问的用词检查会拦下,走现有的一次修复或改写。
|
||||
- `references/product_runtime_contract.md` §AU 记录这一产品隔离及其临时性。
|
||||
- 验证:`frontend/tests/user-history-isolation-2111.test.ts`(7 例:每条规则仍能匹配上游原文——她改完后会失败并点名;隔离后无校准句、其余方法原样;解读提示;问答处理器;行运规范摘录;等级和状态文字;未见阻断项);`synastry-exploratory-2014` 按原值 / 新值 / 原因更新。
|
||||
- 防复发:上游段落一变,匹配测试点名失败;送给模型的三条路径都走同一个模块。
|
||||
- 关联记录:BUG-1980(问答反馈隔离)、BUG-2110(Python 一侧的状态)、BUG-2098 / BUG-2101(同一轮审核)。
|
||||
- 修复版本:`claude/history-isolation-2111`。
|
||||
|
||||
@@ -77,6 +77,8 @@ const ANNUAL_INTERNAL: ReadonlyArray<readonly [string, RegExp]> = [
|
||||
["证据等级", /证据等级|把握等级|把握上限|置信度/u],
|
||||
["等级字母", /(?:把握|等级|置信)[^,。;\n]{0,6}[A-D](?![A-Za-z])|[A-D]\s*[级档]/u],
|
||||
["偏顺 / 偏紧", /偏顺|偏紧/u],
|
||||
// BUG-2111 (astrologer 2026-11-21): 「未见阻断项」 is an internal state, not evidence sufficiency.
|
||||
["未见阻断项", /未见阻断项|no[ _]open[ _]blocker/iu],
|
||||
["Mudda", /Mudda/iu],
|
||||
["Tajika", /Tajika/iu],
|
||||
["Varshaphala", /Varshaphala/iu],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { existsSync, readFileSync, statSync } from "node:fs";
|
||||
import { isolateUserHistoryCalibration } from "./user-history-isolation.ts";
|
||||
import { resolve } from "node:path";
|
||||
import { ANNUAL_BACKEND_RULES, ANNUAL_BACKEND_RULES_SOURCE } from "./annual-backend-rules.ts";
|
||||
import { z } from "zod";
|
||||
@@ -557,7 +558,8 @@ function packageFile(relativePath: string): string | null {
|
||||
if (hit !== undefined) return hit;
|
||||
let content: string | null = null;
|
||||
try {
|
||||
content = readFileSync(resolvePackageFile(relativePath), "utf8");
|
||||
// BUG-2111: passages that calibrate on the user's past events never reach the model.
|
||||
content = isolateUserHistoryCalibration(readFileSync(resolvePackageFile(relativePath), "utf8")).text;
|
||||
} catch {
|
||||
content = null;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ export const PERIOD_FIRST_RULE = "问一段时间(最近、今年、这段时
|
||||
* The server overlay (answer_policy, deterministic_claims_forbidden_for) is
|
||||
* unchanged: it still forbids certainty, not the conditional reading.
|
||||
*/
|
||||
export const INTERPRETATION_STATUS_RULE = "解读状态(references/interpretation_status_contract.md):parameter_sensitive = 有来源、已计算,但派别或参数会改变结果、外部验证未完成——照常解读,条件和所用参数写进「判断依据」,正文不讲参数和算法;user_history_verification_required = 已计算,需要用户的现实经历来核验——照常解读,写成待核验并给出可核验的问题;blocked = 没有输入或确实不能运行——只写缺什么,不产生结果性断言;not_available_yet = 本产品尚未接入的技法(如 Sarvatobhadra、Kota、Kalanala、Nakshatra Latta、部分稀有大运、问事盘)——在审计里写明,不假装用过,也不因此阻止其他技法的条件性分析。外部 oracle 未闭环、体系分歧、工具结果里的 reference_only、partial、observation_only,只降低断言强度、不等于不能解读;KP(宫头、Sign Lord、Star Lord、Sub Lord、significator)、行运和 Saham 可以有条件地作为依据,和整宫结果不一致时两面都写。服务端 answer_policy 禁止的仍然禁止:它限制的是确定性的说法,不是条件性的解读。";
|
||||
export const INTERPRETATION_STATUS_RULE = "解读状态(references/interpretation_status_contract.md):parameter_sensitive = 有来源、已计算,但派别或参数会改变结果、外部验证未完成——照常解读,条件和所用参数写进「判断依据」,正文不讲参数和算法;user_history_verification_required = 旧数据里的标记,不算缺口——按已有依据照常判断,不写待核验,不向用户要过往经历,也不因此降低结论(用户经历只在生时校正流程里使用);blocked = 没有输入或确实不能运行——只写缺什么,不产生结果性断言;not_available_yet = 本产品尚未接入的技法(如 Sarvatobhadra、Kota、Kalanala、Nakshatra Latta、部分稀有大运、问事盘)——在审计里写明,不假装用过,也不因此阻止其他技法的条件性分析。外部 oracle 未闭环、体系分歧、工具结果里的 reference_only、partial、observation_only,只降低断言强度、不等于不能解读;KP(宫头、Sign Lord、Star Lord、Sub Lord、significator)、行运和 Saham 可以有条件地作为依据,和整宫结果不一致时两面都写。服务端 answer_policy 禁止的仍然禁止:它限制的是确定性的说法,不是条件性的解读。";
|
||||
|
||||
export const PLAIN_SPEECH_RULE = `分析清单只用来想,不用来说:工具结果里的清单(受冲信号的编号与条数、「分三件事看」的层名、「旺弱不说明顺不顺」这类规则原句、「从某宫数起第几宫」这类数法)只决定你怎么判断,不写进回答,也不对用户解释规则;说给用户的是判断的结果,用生活里的话。依据用白话写进句子里,可以压缩语言、不必把信号逐条列全,但决定这句判断的反证不能省(占星师 2026-11-08 第五轮裁定 6:原值「说出来的依据最多两条,挑最能撑住这句话的」,删除「最多两条」)。${PLAIN_TERMS}`;
|
||||
|
||||
|
||||
@@ -2176,9 +2176,8 @@ export function buildReportEvidenceBundleV2(
|
||||
executedTechniqueRefs: uniqueMatched.map((receipt) => receipt.id),
|
||||
assertionLevel,
|
||||
timingBoundary,
|
||||
verificationQuestions: assertionLevel === "parameter_sensitive"
|
||||
? ["建议结合真实经历核验本主题的部分证据结论"]
|
||||
: [],
|
||||
// BUG-2111: a normal reading never asks the reader to check it against their own past.
|
||||
verificationQuestions: [],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2546,7 +2545,8 @@ const CLAIM_STATUS_RANK: Readonly<Record<ClaimStatus, number>> = {
|
||||
single_system_inference: 1,
|
||||
parameter_sensitive: 2,
|
||||
unclosed_divisional_chart: 3,
|
||||
user_history_verification_required: 4,
|
||||
// BUG-2111: missing user history is no penalty (astrologer 2026-11-21) — ranked with parameter_sensitive.
|
||||
user_history_verification_required: 2,
|
||||
blocked: 5,
|
||||
};
|
||||
|
||||
|
||||
@@ -74,6 +74,9 @@ export function withoutGlossedNames(text: string): string {
|
||||
const HEDGE = /(?:只|仅)(?:能)?(?:作|供|当|用作|作为)[^。,;,;::!?!?\s]{0,4}?参考/u;
|
||||
|
||||
/** The 「只作参考」-type hedge in one sentence, or undefined. */
|
||||
/** BUG-2111 (astrologer 2026-11-21): 「未见阻断项」 is an internal state, never reader text. */
|
||||
const INTERNAL_STATE = /未见阻断项|no[ _]open[ _]blocker/iu;
|
||||
|
||||
export function readingHedge(text: string): string | undefined {
|
||||
return HEDGE.exec(text)?.[0];
|
||||
return HEDGE.exec(text)?.[0] ?? INTERNAL_STATE.exec(text)?.[0];
|
||||
}
|
||||
|
||||
@@ -883,7 +883,7 @@ const REPAIR_INSTRUCTIONS: Partial<Record<ReadingRejection, string>> = {
|
||||
disclaimer: "将重复的边界说明合为一处。",
|
||||
banned_phrase: "删掉命中句里的确定性、医疗或其他超出报告范围的表达。",
|
||||
technique_name: "命中句写了技法或点位的名字。改成读者听得懂的话:说这颗星、这个点、这段时间对当事人意味着什么;时间直接写起止日期;行星、星座、宫位和日期照写。技法名只写在「依据与边界」。" + READER_WORDING_TAIL,
|
||||
hedge_phrase: "命中句写了「只作参考」这类话。这一层依据用来看什么就直接写它看什么,用不上就不写;不换成别的说法再写一遍。" + READER_WORDING_TAIL,
|
||||
hedge_phrase: "命中句写了「只作参考」这类话,或「未见阻断项」这类内部状态。这一层依据用来看什么就直接写它看什么,用不上就不写;不换成别的说法再写一遍。" + READER_WORDING_TAIL,
|
||||
strength_verdict: "命中句从行星力量推出了事实包里没有的判断(扛得住、稳得住、撑不撑得起来这类)。力量只照事实包写有没有达到最低线,不从力量推出对生活的判断;要说生活里会怎样,用宫位、主星和时间的依据。" + READER_WORDING_TAIL,
|
||||
dignity_mismatch: "把星曜状态改为事实包里的状态,无法核对时删除该说法。",
|
||||
false_missing_layer: "删除未计算的说法,按事实包写实际有无和状态。",
|
||||
|
||||
@@ -6,7 +6,8 @@ export const FACT_STATUS_LABELS = {
|
||||
single_system_inference: "单一系统推断",
|
||||
parameter_sensitive: "参数敏感",
|
||||
unclosed_divisional_chart: "分盘尚未核验完整",
|
||||
user_history_verification_required: "需要过往经历核对",
|
||||
// BUG-2111: never a gap for the reader; normalised away in report-fact-tables.ts, neutral if it slips through.
|
||||
user_history_verification_required: "按已有依据判断",
|
||||
blocked: "暂不可用",
|
||||
} as const;
|
||||
|
||||
@@ -15,7 +16,7 @@ export const FACT_STATUS_LABELS_EN: Record<keyof typeof FACT_STATUS_LABELS, stri
|
||||
single_system_inference: "Single-system inference",
|
||||
parameter_sensitive: "Setting-sensitive",
|
||||
unclosed_divisional_chart: "Divisional chart not fully checked",
|
||||
user_history_verification_required: "Needs checking against past events",
|
||||
user_history_verification_required: "Judged on the evidence at hand",
|
||||
blocked: "Not available",
|
||||
};
|
||||
|
||||
|
||||
@@ -90,7 +90,9 @@ export function assembleReportFactTables(packet: unknown, language: ReportLangua
|
||||
const raw = record(source);
|
||||
const declared = raw.claimStatus ?? raw.claim_status;
|
||||
const claimStatus = isBlocked(raw) ? "blocked"
|
||||
: declared === "unclosed_divisional_chart" || declared === "user_history_verification_required"
|
||||
// BUG-2111: user_history_verification_required (old stored packets) is not a gap in a normal
|
||||
// reading; it is read like any undeclared status, never shown as 「需要过往经历核对」.
|
||||
: declared === "unclosed_divisional_chart"
|
||||
|| declared === "single_system_inference" || declared === "multi_system_consensus" ? declared : "parameter_sensitive";
|
||||
const table: ReportFactTable = { id, title, claimStatus, sourcePath, note: L.note, columns: [...columns], rows: [] };
|
||||
const children: ReportFactSubtable[] = [];
|
||||
|
||||
@@ -110,8 +110,9 @@ const ENGINEERING_TERMS: Readonly<Record<string, Readonly<{ zh: string; en: stri
|
||||
no_first_contact_rule: { zh: "缺少首次接触的独立规则", en: "no rule specific to first contact" },
|
||||
vivah_saham_unavailable: { zh: "缺少婚姻点", en: "marriage point missing" },
|
||||
parameter_sensitive: { zh: "随出生时间变化", en: "sensitive to birth time" },
|
||||
user_history_verification_required: { zh: "需要用真实经历核对", en: "needs checking against real history" },
|
||||
candidate_alignment_requires_event_history: { zh: "需要用真实经历核对", en: "needs checking against real history" },
|
||||
// BUG-2111: missing user history is not a gap in a normal reading (astrologer 2026-11-21).
|
||||
user_history_verification_required: { zh: "按已有依据判断", en: "judged on the evidence at hand" },
|
||||
candidate_alignment_requires_event_history: { zh: "两人各自符合条件,是候选", en: "a candidate for both people" },
|
||||
single_system_inference: { zh: "单一体系推断", en: "single-system inference" },
|
||||
not_established: { zh: "目前没有这类事件的依据", en: "not established" },
|
||||
};
|
||||
|
||||
@@ -176,7 +176,8 @@ export const EVIDENCE_LABELS = [
|
||||
"single_system_inference",
|
||||
"parameter_sensitive",
|
||||
"unclosed_divisional_chart",
|
||||
"user_history_verification_required",
|
||||
// BUG-2111: user_history_verification_required is no longer offered to the writer — missing
|
||||
// user history is not a gap in a normal reading (astrologer 2026-11-21).
|
||||
"blocked",
|
||||
] as const;
|
||||
|
||||
@@ -457,8 +458,8 @@ export const SECTION_TASKS: Readonly<Record<SynastrySectionId, Readonly<{ zh: st
|
||||
en: "Timing by event: each segment's phase and text describe each person's background and usable conditions in that span. The event classes in event_timeline are listed by the program; do not rewrite dates and never turn two people's overlapping periods into a shared event window.",
|
||||
},
|
||||
direction: {
|
||||
zh: "辅助证据与边界:传统配对(Koota、火星 Kuja、Papasamya)只能支持或限定前面的主链判断,不能推翻;不写分数。说明哪些判断参数敏感(parameter_sensitive)、哪些需要用真实经历核对(user_history_verification_required)、哪些没法判断(blocked)。",
|
||||
en: "Supporting evidence and limits: traditional matching (Koota, Mars Kuja, Papasamya) may support or qualify the main chain, never overrule it; no scores. Say which judgments are parameter_sensitive, which need real history (user_history_verification_required) and which are blocked.",
|
||||
zh: "辅助证据与边界:传统配对(Koota、火星 Kuja、Papasamya)只能支持或限定前面的主链判断,不能推翻;不写分数。说明哪些判断参数敏感(parameter_sensitive)、哪些没法判断(blocked,写清缺什么)。",
|
||||
en: "Supporting evidence and limits: traditional matching (Koota, Mars Kuja, Papasamya) may support or qualify the main chain, never overrule it; no scores. Say which judgments are parameter_sensitive and which are blocked (say what is missing).",
|
||||
},
|
||||
practices: {
|
||||
zh: "现实建议:每条建议回扣前文一条具体配置,例如「由于甲的 7 宫主与乙的 UL 同座,居住与工作安排需要先说清」;不写「多沟通、互相包容」这类通用话。",
|
||||
@@ -476,7 +477,7 @@ const ZH_SYSTEM = `你在写一份专业的婚恋合盘报告的一节,按占
|
||||
写法:每一段最多建立一个主结论;结论至少有两条同向证据,否则 label 写 single_system_inference。用「7 宫主落……,同时……,所以这段关系中容易/不容易……」的递进句式。「可能」要交代条件,「会」要对应实盘结构与有效时间窗。保留双方主体性,写「双方在……时容易……」,不给一方定性。
|
||||
术语:可以用印度占星的术语(宫、宫主、上升、D9、UL、DK、A7、Dasha、Narayana 等),但每个术语在一节里第一次出现时要用括号或半句话解释它看什么,例如「UL(上升婚姻点,看婚姻能不能被日常托住)」。不要堆公式和度数。
|
||||
reading_scope:status 是 limited 时,不写全量结论,每个判断写成条件,不得用 multi_system_consensus;blocked 时只说明为什么无法判断。
|
||||
证据等级:parameter_sensitive、user_history_verification_required、blocked 照实保留,不要升级成确定的话。出生时间候选已有结果时,逐个写出条件和对应值,不替用户选,也不写成没算出。试算中没有变化的项目只描述这次核对,不说稳定。
|
||||
证据等级:parameter_sensitive、blocked 照实保留,不要升级成确定的话。证据里出现 user_history_verification_required 时不算缺口,按已有依据照常判断,不写成要用两人的经历来核对。出生时间候选已有结果时,逐个写出条件和对应值,不替用户选,也不写成没算出。试算中没有变化的项目只描述这次核对,不说稳定。
|
||||
出生时间误差内会变的层只能写成条件性证据。它们已经算出,不写成缺少或没有算出。
|
||||
只用前后 30 分钟试算的结果时,样本没有变化就写「按前后 30 分钟试算,没有变化」,不得写成「稳定」「已确认」或「不会变」。
|
||||
不要报分数。不要用「克 / 煞 / 凶」贴标签,也不用「吉」字下判语(「功能吉星」「功能凶星」作为术语可以用)。不要说「注定」「必然」「命中」「一定会」。不要把一方说成问题源。不要替当事人做决定。不要点名补充方法(西方占星、宿曜、问事盘),也不要写出生日期、时间、地点。不要写某年结婚、领证或分开。第一句不要写成「这段关系的核心不是……」,正文也不要以这一节的标题开头。两人运限日期同时落在一段时间里,只说明各自的背景,不等于共同的事件窗口。
|
||||
@@ -488,7 +489,7 @@ const EN_SYSTEM = `You write one section of a professional synastry report, foll
|
||||
Each paragraph builds at most one main conclusion, backed by at least two agreeing pieces of evidence; otherwise label it single_system_inference. Use the pattern "the 7th lord sits in ..., and ..., so in this relationship it is easier / harder to ...". "May" needs its condition; "will" needs a chart structure and a live time window. Keep both people as agents; describe the pair, never define one person.
|
||||
Terms: Jyotish terms are allowed (house, lord, ascendant, D9, UL, DK, A7, dasha, Narayana), but explain each one the first time it appears in a section, e.g. "UL (the Upapada, the point that shows whether a marriage is carried by daily life)". No formulas or degree tables.
|
||||
reading_scope: when its status is limited, give no full conclusion, write every judgment as a condition and never use multi_system_consensus; when blocked, only say why no judgment is possible.
|
||||
Evidence labels: keep parameter_sensitive, user_history_verification_required and blocked as they are; never upgrade them into certainty. If there are computed birth-time candidates, state each condition and its value, without picking a candidate or calling it unavailable. Describe unchanged values within the checked range without calling them stable.
|
||||
Evidence labels: keep parameter_sensitive and blocked as they are; never upgrade them into certainty. user_history_verification_required in the evidence is not a gap: judge from the evidence you have, and do not say the couple's own history is needed to check it. If there are computed birth-time candidates, state each condition and its value, without picking a candidate or calling it unavailable. Describe unchanged values within the checked range without calling them stable.
|
||||
Layers that vary within a person's birth-time window are computed and conditional. Do not describe them as missing or certain.
|
||||
If a result only uses the default 30-minute trial on either side, describe matching samples as no change in that trial. Never call the result stable, confirmed, or certain to stay the same.
|
||||
Do not quote a score. Do not use soulmate, destined, inevitable, guaranteed. Do not call one person the problem. Do not decide for them. Do not name supplementary methods (Western astrology, Shukuyo, horary), and do not include birth dates, times, or places. Do not predict a wedding or a breakup in a named year. Do not open with "The core of this relationship is not". Do not start the body with the section title. Two people's periods running at the same time only describe each person's background; they are not a shared event window.
|
||||
|
||||
@@ -281,8 +281,9 @@ const RULE_NOT_BUILT = {
|
||||
} as const;
|
||||
const FORMAL_STATUS: Readonly<Record<string, Readonly<Record<Language, string>>>> = {
|
||||
candidate_alignment_requires_event_history: {
|
||||
zh: "两人各自都符合这一类事件的条件,是候选,需要用真实经历核对,不代表已经或一定发生",
|
||||
en: "Both people individually meet the conditions for this event class. It is a candidate for checking against real history.",
|
||||
// BUG-2111: no request to check against the couple's own history (astrologer 2026-11-21).
|
||||
zh: "两人各自都符合这一类事件的条件,是候选,不代表已经或一定发生",
|
||||
en: "Both people individually meet the conditions for this event class. It is a candidate, not something that has happened or must happen.",
|
||||
},
|
||||
parallel_observation_only: { zh: "两人各有观察,但还不够判断", en: "There are observations for both people, with too little evidence to draw a conclusion" },
|
||||
one_sided_or_incomplete: { zh: "单侧或证据不完整", en: "One-sided or incomplete evidence" },
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
* BUG-2111 (astrologer 2026-11-21, relayed by the owner): 「普通解盘与推运不得使用用户经历或反馈,
|
||||
* 改变事件选择、权重、方向、计算参数或结论。只有用户明确进入生时校正流程时,才可在该流程内使用相关经历。
|
||||
* 独立公开案例的规则验证属于另外的研究流程,不等同于对当前用户进行经历校准。」
|
||||
*
|
||||
* Her reference files still tell the model to calibrate on the user's past events
|
||||
* (precision-reading-methodology.md 共识6 / §4.1–4.2 / §4.3 gate / grade A / Step 3;
|
||||
* ai-reading-workflow-prompt.md §5.0.1–5.0.2 rows; transit-actionable-output-guide.md
|
||||
* 要素3 line A). She will edit the upstream text herself. Until then the product cuts
|
||||
* these passages out of every text that reaches a model in normal readings and
|
||||
* forecasts. The files are not edited (owner rule: her skill runs in full; product
|
||||
* differences live in announced product files — references/product_runtime_contract.md
|
||||
* §AU). No rectification flow reads these files, so there is no exception to make.
|
||||
*
|
||||
* Passages are found by their own text, not by line numbers. When her edit removes a
|
||||
* passage, its rule stops matching; tests/user-history-isolation-2111.test.ts then
|
||||
* fails and names the rule, so the layer is dropped instead of silently lingering.
|
||||
*/
|
||||
|
||||
export const USER_HISTORY_ISOLATION_NOTE =
|
||||
"(产品说明:此处原文讲用用户过往经历校准预测,普通解盘与推运不使用:不向用户索要过往经历,也不因为没有经历而降低结论或停止预测。用户经历只在生时校正流程里使用。)";
|
||||
|
||||
type BlockRule = Readonly<{
|
||||
id: string;
|
||||
file: string;
|
||||
/** The first line of the passage, matched after trimming. */
|
||||
start: string;
|
||||
/** The passage stops before the first later line that starts with this (trimmed); "" = blank line. */
|
||||
end: string;
|
||||
note: boolean;
|
||||
}>;
|
||||
|
||||
type LineRule = Readonly<{
|
||||
id: string;
|
||||
file: string;
|
||||
/** A line whose trimmed text starts with this is removed. */
|
||||
line: string;
|
||||
}>;
|
||||
|
||||
export type UserHistoryRule = BlockRule | LineRule;
|
||||
|
||||
const METHODOLOGY = "references/precision-reading-methodology.md";
|
||||
const WORKFLOW = "references/ai-reading-workflow-prompt.md";
|
||||
const TRANSIT = "references/transit-actionable-output-guide.md";
|
||||
/** Her tables join two words with a middle dot; built here so no literal separator sits in our source. */
|
||||
const DOT = String.fromCharCode(0xb7);
|
||||
|
||||
export const USER_HISTORY_RULES: readonly UserHistoryRule[] = [
|
||||
{ id: "methodology-consensus-6", file: METHODOLOGY, start: "### 共识6:先验证过去,再预测未来", end: "---", note: true },
|
||||
{ id: "methodology-4.1-4.2", file: METHODOLOGY, start: "### 4.1 为什么要验证过去", end: "### 4.3 ", note: true },
|
||||
{ id: "methodology-4.3-gate", file: METHODOLOGY, line: "**只有在倒推验证通过后,才进入正推预测。**" },
|
||||
{ id: "methodology-grade-a", file: METHODOLOGY, line: "| **A-已验证** | 经过用户已知事件倒推验证的结论" },
|
||||
{ id: "methodology-step-3", file: METHODOLOGY, start: "Step 3: 倒推验证", end: "", note: false },
|
||||
{ id: "workflow-grade-a", file: WORKFLOW, line: "| **A-已验证** | ✅ [A] | 经过用户已知事件倒推验证的结论" },
|
||||
{ id: "workflow-verified", file: WORKFLOW, line: `| 已验证 | \`[已验证${DOT}N/N事件吻合]\`` },
|
||||
{ id: "workflow-unverified", file: WORKFLOW, line: "| 未经验证 | `[未经验证]` | 用户未提供过往事件" },
|
||||
{ id: "workflow-calibration-failed", file: WORKFLOW, line: `| 验证失败 | \`[校准异常${DOT}需重新评估]\`` },
|
||||
{ id: "transit-grade-a", file: TRANSIT, line: "✅ [A] 已验证(倒推历史事件命中)" },
|
||||
];
|
||||
|
||||
/** Cheap pre-check: a text can only need isolating if it carries one of these. */
|
||||
const MARKERS = [...new Set(USER_HISTORY_RULES.map((rule) => ("line" in rule ? rule.line : rule.start)))];
|
||||
|
||||
export function mayNeedUserHistoryIsolation(text: string): boolean {
|
||||
return MARKERS.some((marker) => text.includes(marker));
|
||||
}
|
||||
|
||||
export type UserHistoryIsolation = Readonly<{ text: string; applied: readonly string[] }>;
|
||||
|
||||
/** Cut every matching passage out of `text`. Text without a marker comes back unchanged. */
|
||||
export function isolateUserHistoryCalibration(text: string): UserHistoryIsolation {
|
||||
if (!mayNeedUserHistoryIsolation(text)) return { text, applied: [] };
|
||||
let lines = text.split("\n");
|
||||
const applied: string[] = [];
|
||||
for (const rule of USER_HISTORY_RULES) {
|
||||
if ("line" in rule) {
|
||||
const kept = lines.filter((line) => !line.trim().startsWith(rule.line));
|
||||
if (kept.length !== lines.length) {
|
||||
applied.push(rule.id);
|
||||
lines = kept;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
const out: string[] = [];
|
||||
let hit = false;
|
||||
for (let index = 0; index < lines.length; index += 1) {
|
||||
if (lines[index].trim() !== rule.start && !lines[index].trim().startsWith(rule.start)) {
|
||||
out.push(lines[index]);
|
||||
continue;
|
||||
}
|
||||
let stop = index + 1;
|
||||
while (stop < lines.length) {
|
||||
const trimmed = lines[stop].trim();
|
||||
if (rule.end === "" ? trimmed === "" : trimmed.startsWith(rule.end)) break;
|
||||
stop += 1;
|
||||
}
|
||||
if (rule.note) out.push(USER_HISTORY_ISOLATION_NOTE, "");
|
||||
hit = true;
|
||||
index = stop - 1;
|
||||
}
|
||||
if (hit) {
|
||||
applied.push(rule.id);
|
||||
lines = out;
|
||||
}
|
||||
}
|
||||
return { text: lines.join("\n"), applied };
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the isolation to every string inside a value (a model prompt, a tool result),
|
||||
* returning the same object when nothing matched so callers can skip a rewrite.
|
||||
*/
|
||||
export function isolateUserHistoryDeep<T>(value: T): { value: T; applied: string[] } {
|
||||
const applied: string[] = [];
|
||||
const visit = (node: unknown): unknown => {
|
||||
if (typeof node === "string") {
|
||||
if (!mayNeedUserHistoryIsolation(node)) return node;
|
||||
const result = isolateUserHistoryCalibration(node);
|
||||
applied.push(...result.applied);
|
||||
return result.text;
|
||||
}
|
||||
if (Array.isArray(node)) {
|
||||
let changed = false;
|
||||
const next = node.map((item) => {
|
||||
const mapped = visit(item);
|
||||
if (mapped !== item) changed = true;
|
||||
return mapped;
|
||||
});
|
||||
return changed ? next : node;
|
||||
}
|
||||
if (node && typeof node === "object" && Object.getPrototypeOf(node) === Object.prototype) {
|
||||
let changed = false;
|
||||
const next: Record<string, unknown> = {};
|
||||
for (const [key, item] of Object.entries(node as Record<string, unknown>)) {
|
||||
const mapped = visit(item);
|
||||
if (mapped !== item) changed = true;
|
||||
next[key] = mapped;
|
||||
}
|
||||
return changed ? next : node;
|
||||
}
|
||||
return node;
|
||||
};
|
||||
return { value: visit(value) as T, applied: [...new Set(applied)] };
|
||||
}
|
||||
@@ -29,12 +29,14 @@ export type {
|
||||
* stacks must never reach this agent.
|
||||
*/
|
||||
|
||||
// BUG-2111 (astrologer 2026-11-21): the writer is no longer offered user_history_verification_required —
|
||||
// missing user history is not a gap in a normal reading. Stored reports still validate through
|
||||
// lib/personal-report-contract.ts CLAIM_STATUSES, which keeps the value.
|
||||
export const claimStatusSchema = z.enum([
|
||||
"multi_system_consensus",
|
||||
"single_system_inference",
|
||||
"parameter_sensitive",
|
||||
"unclosed_divisional_chart",
|
||||
"user_history_verification_required",
|
||||
"blocked",
|
||||
]);
|
||||
|
||||
|
||||
@@ -132,8 +132,8 @@ export const professionalConversationVoice = `VISIBLE VOICE
|
||||
## 实际执行的技法与原始数据:先 D1(上升与度数、相关宫的星座和宫内星、宫主落宫、相关行星的度数、尊贵和燃烧);再功能吉凶——按当前上升写出功能吉星、功能凶星、功能中性星和 Yogakaraka,自然吉凶与功能吉凶冲突的星写出冲突来源并降低置信度;再力量(Shadbala 达标与否、Bhava Bala、SAV / BAV);再 Yoga(只写卡上 yogas_detail 和 yogas.hits 列出的,状态照卡上原词写,写条件和是否被当前 Dasha 激活);再 Jaimini(AK、AmK、DK、Karakamsha、AL、UL、A7、A10 等按领域取)。
|
||||
## 相关分盘:按问题域取——事业 D10 + A10 + AmK;财富 D2、D11、A2、A11(收入来自工作时加 D10、A10),分开「能不能挣到」和「能不能留下」;婚恋 D9 + UL + A7 + DK;子女 D7;父母 D12;学习 D24;健康 D6、D8、D30;迁居 D4、D12。与本题无关的分盘不列。
|
||||
## 多套 Dasha 与行运:Vimshottari 大运、小运、细运的起止,Narayana 主运、子运的起止,相关的 Jaimini dasha(Chara 等;卡上没有时用 read-consultation-evidence 补取),木星、土星、罗睺、计都的行运与双重行运,年运(Tajika 年盘、Muntha、年主;卡上有才写)。几套方向不同时,两面都写出来:各自的机制和让它成立的条件,不只挑一套。时间节点分开写:接触、启动、确认、落地、责任考验。
|
||||
## 证据等级:每项实质判断标 A / B / C(router §10:A = 本命承诺 + 相关分盘 + Dasha + 行运 + 至少一层核验,个人预测最好有历史回测;B = 三套主要体系支持,但缺一层或时间宽;C = 只有一两个指标),并标解读状态。每个等级后面写它按的规则和满足、缺少的项,例如「B(router §10:本命、分盘、Dasha 支持,行运时间宽)」,读者能照着复核。本轮不写 A(A 要求的历史回测与核验层本产品没有),也不在正文解释这一点。
|
||||
## 冲突与阻塞项:体系之间、自然与功能吉凶之间、D1 与分盘之间、两套 Dasha 之间的冲突;blocked(写缺什么输入)、not_available_yet、parameter_sensitive、user_history_verification_required 的项目各自写明。
|
||||
## 证据等级:每项实质判断标 A / B / C(router §10:A = 本命承诺 + 相关分盘 + Dasha + 行运 + 至少一层核验;B = 三套主要体系支持,但缺一层或时间宽;C = 只有一两个指标),并标解读状态。每个等级后面写它按的规则和满足、缺少的项,例如「B(router §10:本命、分盘、Dasha 支持,行运时间宽)」,读者能照着复核。本轮不写 A(A 要求的核验层本产品没有),也不在正文解释这一点。等级只看盘面依据够不够,不看用户有没有讲过往经历;普通解读不向用户索要过往经历来定等级。
|
||||
## 冲突与阻塞项:体系之间、自然与功能吉凶之间、D1 与分盘之间、两套 Dasha 之间的冲突;blocked(写缺什么输入)、not_available_yet、parameter_sensitive 的项目各自写明。工具结果里出现 user_history_verification_required 时不算缺口:按已有依据照常判断,不写待核验,不向用户要过往经历。
|
||||
## 结论与行动建议:展开开头的结论;按用户的问法分段,每条结论回指上面的证据和等级;问时间的按时间段写起止和做什么;给两三件具体能做的事。
|
||||
## Technique Audit Table:Markdown 表格,五列 Technique | Calculation | Interpretation | Key result | Effect on confidence;每行两个状态分开写,不合成一个值(占星师 2026-11-08 第五轮裁定 7,她的 interpretation_status_contract)。Calculation(计算状态)只用 executed、partial、blocked、not_applicable:算没算出来;not_available_yet 写 blocked,原因写在 Key result。Interpretation(解读状态)只用 primary、supporting、conditional、observation_only、blocked、not_used:这一层的结果怎样参与本题的判断——primary 主要依据,supporting 辅助依据,conditional 有条件(参数敏感、方法或版本有分歧),observation_only 只作观察,blocked 不作结果性判断,not_used 本题不参与。能算但方法有分歧 = Calculation executed + Interpretation conditional,不写 blocked:卡上 Narayana 的 method_status.chat_use 为 single_system_candidate 就是这一档,Effect 写不据此强化应期;Calculation 写 blocked 只给没有结果的层(起运、双宫主或年数定不出,chat_use 为 no_judgment;缺输入;未接入),这时 Interpretation 也是 blocked。卡上标 parameter_sensitive 的(KP、Tajika 年盘、Shadbala 达标与否)写 executed + conditional;not_applicable 写 not_applicable + not_used。照卡上每个领域的 route 表列:on_card 且本题用到的写 executed,not_applicable、blocked、not_available_yet 照它写并写明缺什么。至少列:D1、D9、本题相关分盘、Functional Benefic/Malefic(Key result 写关键功能吉星和功能凶星,并写所用的功能吉凶表 profile)、Vimshottari、Narayana、Jaimini / Chara Dasha、Shadbala、Ashtakavarga、Yoga、Transit、Tajika / Varshaphala、KP / Sub-lord;router §8 里和本题相关的其他行也列。不写外部验证、联网、MEVG 或真实案例校准的行(产品 2026-11-08 决定:这些只记在后台回执),也不写「已验证」「MEVG 通过」一类的总评。
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import { PLAIN_TERMS } from "../lib/consultation-thinking-plan.ts";
|
||||
import type { ReportReadingPrompt } from "../lib/personal-report-reading.ts";
|
||||
import { jyotishSkillPackage } from "./skill-binding.ts";
|
||||
import { SYNASTRY_PLAIN_TIME_RULE } from "./synastry-report-chat.ts";
|
||||
import { isolateUserHistoryCalibration } from "../lib/user-history-isolation.ts";
|
||||
|
||||
/**
|
||||
* #192 (owner 2026-11-11 decision 2; astrologer 2026-11-12, her repo 8aaf6099
|
||||
@@ -54,7 +55,12 @@ export function reportReadingPrompt(): ReportReadingPrompt {
|
||||
const skill = read("SKILL.md");
|
||||
const body = skillBody(skill.text);
|
||||
if (!body) throw new Error(`Skill ${jyotishSkillPackage.name} has no method body for the report reading`);
|
||||
const references = REPORT_READING_REFERENCES.map((path) => ({ path, ...read(path) }));
|
||||
// BUG-2111: the hash stays the file's own; the text the model reads has the
|
||||
// user-history calibration passages cut out (lib/user-history-isolation.ts).
|
||||
const references = REPORT_READING_REFERENCES.map((path) => {
|
||||
const file = read(path);
|
||||
return { path, sha256: file.sha256, text: isolateUserHistoryCalibration(file.text).text };
|
||||
});
|
||||
const contract = read(PRODUCT_RUNTIME_CONTRACT_FILE);
|
||||
const sourceNotices = productContractBlock("report-reading-source-notices", {}, contract.text);
|
||||
// BUG-2098: the reading's sections for ordinary readers take the chat's own plain-terms and time rules.
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
resolveLiveJyotishSkillRuntimePath,
|
||||
} from "../lib/skill-package-registry.ts";
|
||||
import { productContractBlock } from "../lib/product-runtime-contract.ts";
|
||||
import { isolateUserHistoryDeep } from "../lib/user-history-isolation.ts";
|
||||
|
||||
const skill = resolveLiveJyotishSkill();
|
||||
|
||||
@@ -178,7 +179,10 @@ export const jyotishSkillMethodBlock = methodBlock(NATAL_REPORT_SKELETON);
|
||||
* that bind this skill share this object, so remembering that one of them had
|
||||
* its method would stop the others from ever being asked.
|
||||
*/
|
||||
export const jyotishSkillBoundProcessor: Processor & { processInputStep: NonNullable<Processor["processInputStep"]> } = {
|
||||
export const jyotishSkillBoundProcessor: Processor & {
|
||||
processInputStep: NonNullable<Processor["processInputStep"]>;
|
||||
processLLMRequest: NonNullable<Processor["processLLMRequest"]>;
|
||||
} = {
|
||||
id: "jyotish-skill-bound",
|
||||
name: "Jyotish Skill Bound",
|
||||
providesSkillDiscovery: "on-demand",
|
||||
@@ -189,6 +193,16 @@ export const jyotishSkillBoundProcessor: Processor & { processInputStep: NonNull
|
||||
abort(`Jyotish skill method is not bound into the system prompt for ${skill.name}`);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* BUG-2111: `skill_read` hands the model any reference file whole, so the
|
||||
* passages that calibrate on the user's past events (lib/user-history-isolation.ts)
|
||||
* are cut out of the prompt here, on every call, before it reaches the provider.
|
||||
* Nothing is persisted: the stored tool result keeps the file as read.
|
||||
*/
|
||||
processLLMRequest({ prompt }) {
|
||||
const { value, applied } = isolateUserHistoryDeep(prompt);
|
||||
return applied.length > 0 ? { prompt: value } : undefined;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
import { resolveLiveJyotishSkill } from "../src/lib/skill-package-registry.ts";
|
||||
import { consultationWorkflowResponseSchema, toAgentConsultationContext, toModelOutput } from "../src/mastra/consultation-workflow.ts";
|
||||
import { createConsultationPlan } from "../src/lib/consultation-plan.ts";
|
||||
import { isolateUserHistoryCalibration } from "../src/lib/user-history-isolation.ts";
|
||||
|
||||
type Json = Record<string, unknown>;
|
||||
const golden = JSON.parse(readFileSync(new URL("./fixtures/consult-evidence-card-golden.json", import.meta.url), "utf8")) as {
|
||||
@@ -67,7 +68,9 @@ test("BUG-1726: her files travel in her three layers, verbatim where whole", ()
|
||||
const timed = consultationMethodologyForDomains(["career"], { question: "我什么时候升职" })!;
|
||||
const transit = timed.delivery.find((row) => row.source === "references/transit-actionable-output-guide.md");
|
||||
assert.deepEqual(transit && { layer: transit.layer }, { layer: "per_question" });
|
||||
assert.equal(timed.sections.find((s) => s.source === "references/transit-actionable-output-guide.md")!.text, herFile("references/transit-actionable-output-guide.md"));
|
||||
// 原值: 与 herFile(...) 逐字相等;新值: 与去掉用户经历校准段落后的原文逐字相等;
|
||||
// 原因: BUG-2111(占星师 2026-11-21:普通解读不用用户经历;§AU 产品隔离,原文件不改)
|
||||
assert.equal(timed.sections.find((s) => s.source === "references/transit-actionable-output-guide.md")!.text, isolateUserHistoryCalibration(herFile("references/transit-actionable-output-guide.md")).text);
|
||||
// Health has no own adjudicator: the generic skeleton travels whole, and the §5–§6 excerpt is not repeated.
|
||||
const health = consultationMethodologyForDomains(["health"])!;
|
||||
assert.equal(health.sections.find((s) => s.source === "references/event_judgment_skeleton.md")!.text, herFile("references/event_judgment_skeleton.md"));
|
||||
|
||||
@@ -132,7 +132,7 @@ function agentOutputForBundle(
|
||||
narrative: claim.conclusion,
|
||||
actions: [],
|
||||
caveats: [],
|
||||
claimStatus: claim.assertionLevel,
|
||||
claimStatus: writerStatus(claim.assertionLevel),
|
||||
evidenceRefs: [...section.evidenceRefs],
|
||||
};
|
||||
}),
|
||||
@@ -1540,3 +1540,9 @@ test("core create: a billed report has no daily or hourly cap (BUG-1641)", async
|
||||
assert.equal(counted, 0);
|
||||
assert.equal(billing.reservations, 1);
|
||||
});
|
||||
|
||||
// Defined last so the privacy allow-list line numbers above stay put.
|
||||
// BUG-2111: the writer is no longer offered user_history_verification_required; a card that still
|
||||
// carries it (old data) is written as parameter_sensitive, the rank it now shares.
|
||||
const writerStatus = <T extends string>(level: T) =>
|
||||
(level === "user_history_verification_required" ? "parameter_sensitive" : level) as Exclude<T, "user_history_verification_required">;
|
||||
|
||||
@@ -28,6 +28,11 @@ import type {
|
||||
ReportAgentPort,
|
||||
} from "../src/mastra/personal-report.ts";
|
||||
|
||||
// BUG-2111: the writer is no longer offered user_history_verification_required; a card that still
|
||||
// carries it (old data) is written as parameter_sensitive, the rank it now shares.
|
||||
const writerStatus = <T extends string>(level: T) =>
|
||||
(level === "user_history_verification_required" ? "parameter_sensitive" : level) as Exclude<T, "user_history_verification_required">;
|
||||
|
||||
const REPORT_ID = "22222222-2222-4222-8222-222222222222";
|
||||
const GENERATED_AT = "2026-08-14T00:00:00.000Z";
|
||||
const SIGNS = [
|
||||
@@ -206,7 +211,7 @@ function writerOutputFor(
|
||||
narrative: card.conclusion,
|
||||
actions: [`围绕${card.section}记录可验证的现实反馈`],
|
||||
caveats: ["该结论不得脱离所列证据引用。"],
|
||||
claimStatus: card.assertionLevel,
|
||||
claimStatus: writerStatus(card.assertionLevel),
|
||||
evidenceRefs: [...section.evidenceRefs],
|
||||
};
|
||||
}),
|
||||
@@ -844,7 +849,7 @@ function sectionPayloadFor(
|
||||
narrative: card.conclusion,
|
||||
actions: [`围绕${card.section}记录可验证的现实反馈`],
|
||||
caveats: ["该结论不得脱离所列证据引用。"],
|
||||
claimStatus: card.assertionLevel,
|
||||
claimStatus: writerStatus(card.assertionLevel),
|
||||
evidenceRefs: [...section.evidenceRefs],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -101,7 +101,9 @@ test("density golden: Sade Sati reports missing cycle dates without inventing th
|
||||
test("density facts preserve declared limitations and reject malformed provenance", () => {
|
||||
const altered = structuredClone(packet);
|
||||
altered.worksheets.advanced_systems.yogas_doshas.sade_sati.claimStatus = "user_history_verification_required";
|
||||
assert.equal(assembleReportFactTables(altered).find(t => t.id === "sade_sati")?.claimStatus, "user_history_verification_required");
|
||||
// 原值: 原样保留 "user_history_verification_required";新值: 按未声明状态读成 "parameter_sensitive";
|
||||
// 原因: BUG-2111(占星师 2026-11-21:缺用户经历不算缺口,读者不看到「需要过往经历核对」)
|
||||
assert.equal(assembleReportFactTables(altered).find(t => t.id === "sade_sati")?.claimStatus, "parameter_sensitive");
|
||||
const tables = assembleReportFactTables(packet);
|
||||
tables[0].rows[0].sourcePath = tables[0].sourcePath + "_wrong.lord";
|
||||
assert.equal(reportFactTablesSchema.safeParse(tables).success, false);
|
||||
|
||||
@@ -39,7 +39,9 @@ test("BUG-2014: a formal candidate with scan periods is a body row; a scan-only
|
||||
const saved = eventClassRows(dossier, names, "zh");
|
||||
const body = readerSynastryEvents(saved, "zh", names);
|
||||
assert.deepEqual(body.map((row) => row.title), ["心动"]);
|
||||
assert.match(body[0].formal!, /^正式核对:两人各自都符合这一类事件的条件,是候选,需要用真实经历核对/);
|
||||
// 原值: /…是候选,需要用真实经历核对/;新值不再要求用两人的经历核对;原因: BUG-2111(占星师 2026-11-21:普通解读不用用户经历)
|
||||
assert.match(body[0].formal!, /^正式核对:两人各自都符合这一类事件的条件,是候选,不代表已经或一定发生/);
|
||||
assert.doesNotMatch(body[0].formal!, /真实经历|过往经历/);
|
||||
assert.equal(body[0].research, "研究扫描:两人同时有相关运限:2027 年 3 月至 9 月");
|
||||
assert.deepEqual(body[0].people, []);
|
||||
const scanned = exploratorySynastryEvents(saved, "zh", names);
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
* BUG-2111 (astrologer 2026-11-21): normal readings and forecasts never use the user's own past
|
||||
* events. Her reference files still say so in places; the product cuts those passages out of every
|
||||
* text sent to a model (references/product_runtime_contract.md §AU) until she edits them upstream.
|
||||
*/
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import test from "node:test";
|
||||
|
||||
import {
|
||||
USER_HISTORY_ISOLATION_NOTE,
|
||||
USER_HISTORY_RULES,
|
||||
isolateUserHistoryCalibration,
|
||||
isolateUserHistoryDeep,
|
||||
} from "../src/lib/user-history-isolation.ts";
|
||||
import { reportReadingPrompt } from "../src/mastra/report-reading-skill.ts";
|
||||
import { jyotishSkillBoundProcessor } from "../src/mastra/skill-binding.ts";
|
||||
import { consultationMethodologyForDomains } from "../src/lib/consultation-methodology.ts";
|
||||
import { INTERPRETATION_STATUS_RULE } from "../src/lib/consultation-thinking-plan.ts";
|
||||
import { annualReplyWording } from "../src/lib/annual-question-check.ts";
|
||||
import { readingHedge } from "../src/lib/personal-report-reading-terms.ts";
|
||||
import { FACT_STATUS_LABELS, FACT_STATUS_LABELS_EN } from "../src/lib/report-fact-table-display.ts";
|
||||
import { EVIDENCE_LABELS } from "../src/lib/synastry-full-sections.ts";
|
||||
import { claimStatusSchema as writerClaimStatus } from "../src/mastra/personal-report.ts";
|
||||
import { CLAIM_STATUSES } from "../src/lib/personal-report-contract.ts";
|
||||
|
||||
const ROOT = resolve(import.meta.dirname, "../..");
|
||||
const file = (path: string) => readFileSync(resolve(ROOT, path), "utf8").replace(/\r\n/g, "\n");
|
||||
|
||||
/** Phrases that only the isolated passages carry; none may reach a model after isolation. */
|
||||
const FORBIDDEN: Readonly<Record<string, readonly string[]>> = {
|
||||
"references/precision-reading-methodology.md": [
|
||||
"先验证过去,再预测未来", "用户的真实经历是最好的校准数据", "倒推验证协议", "收集已知事件",
|
||||
"必须停止预测,先解决校准问题", "只有在倒推验证通过后", "经过用户已知事件倒推验证", "用用户已知的3-5件重大事件",
|
||||
"在预测未来之前,必须先用已知的过去事件做验证校准",
|
||||
],
|
||||
"references/ai-reading-workflow-prompt.md": ["经过用户已知事件倒推验证", "用户未提供过往事件", "[校准异常·需重新评估]", "[已验证·N/N事件吻合]"],
|
||||
"references/transit-actionable-output-guide.md": ["已验证(倒推历史事件命中)"],
|
||||
};
|
||||
|
||||
test("every isolation rule still matches its upstream passage (fails when she edits the file: drop that rule)", () => {
|
||||
for (const rule of USER_HISTORY_RULES) {
|
||||
const { applied } = isolateUserHistoryCalibration(file(rule.file));
|
||||
assert.ok(
|
||||
applied.includes(rule.id),
|
||||
`rule ${rule.id} no longer matches ${rule.file}: if the astrologer removed this passage upstream, delete the rule (and the layer when none is left)`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test("after isolation no user-history calibration phrase is left, and the rest of the method is intact", () => {
|
||||
for (const [path, phrases] of Object.entries(FORBIDDEN)) {
|
||||
const before = file(path);
|
||||
const after = isolateUserHistoryCalibration(before).text;
|
||||
for (const phrase of phrases) {
|
||||
assert.ok(before.includes(phrase), `${path} should carry 「${phrase}」 upstream (update FORBIDDEN if she changed it)`);
|
||||
assert.ok(!after.includes(phrase), `${path} still sends 「${phrase}」`);
|
||||
}
|
||||
}
|
||||
const methodology = isolateUserHistoryCalibration(file("references/precision-reading-methodology.md")).text;
|
||||
for (const kept of ["## 二、PACDARES 本命盘分析框架", "### 4.3 正推预测协议", "**步骤1:确认承诺**", "| **B-强推断** |", "| **C-假设** |", "Step 4: 推运定位"]) {
|
||||
assert.ok(methodology.includes(kept), `kept text missing: ${kept}`);
|
||||
}
|
||||
assert.equal(methodology.split(USER_HISTORY_ISOLATION_NOTE).length - 1, 2);
|
||||
const unrelated = "## 标题\n\n普通文字,不含任何需要隔离的段落。\n";
|
||||
assert.equal(isolateUserHistoryCalibration(unrelated).text, unrelated);
|
||||
});
|
||||
|
||||
test("the personal report reading quotes the methodology without the calibration passages, hash unchanged", () => {
|
||||
const prompt = reportReadingPrompt();
|
||||
for (const phrase of FORBIDDEN["references/precision-reading-methodology.md"]) {
|
||||
assert.ok(!prompt.system.includes(phrase), `reading prompt still sends 「${phrase}」`);
|
||||
}
|
||||
assert.ok(prompt.system.includes(USER_HISTORY_ISOLATION_NOTE));
|
||||
const loaded = prompt.skill.loaded.find((entry) => entry.path === "references/precision-reading-methodology.md");
|
||||
assert.ok(loaded && /^[0-9a-f]{64}$/.test(loaded.sha256), "the file's own hash is still recorded");
|
||||
});
|
||||
|
||||
test("the chat's per-call processor cuts the passages out of a skill_read result and leaves other prompts alone", async () => {
|
||||
const raw = file("references/precision-reading-methodology.md");
|
||||
const prompt = [
|
||||
{ role: "system", content: "system text" },
|
||||
{ role: "tool", content: [{ type: "tool-result", toolCallId: "1", toolName: "skill_read", output: { type: "text", value: raw } }] },
|
||||
];
|
||||
const args = { prompt } as unknown as Parameters<typeof jyotishSkillBoundProcessor.processLLMRequest>[0];
|
||||
const result = await jyotishSkillBoundProcessor.processLLMRequest(args);
|
||||
const sent = JSON.stringify(result && "prompt" in result ? result.prompt : prompt);
|
||||
for (const phrase of FORBIDDEN["references/precision-reading-methodology.md"]) assert.ok(!sent.includes(phrase), phrase);
|
||||
assert.ok(sent.includes("PACDARES"));
|
||||
assert.ok(raw.includes("倒推验证协议"), "the stored tool result object is not mutated");
|
||||
|
||||
const plain = [{ role: "user", content: [{ type: "text", text: "我的事业怎么样?" }] }];
|
||||
const untouched = await jyotishSkillBoundProcessor.processLLMRequest({ prompt: plain } as unknown as typeof args);
|
||||
assert.equal(untouched, undefined);
|
||||
const deep = isolateUserHistoryDeep(plain);
|
||||
assert.equal(deep.value, plain);
|
||||
});
|
||||
|
||||
test("the chat's quoted transit guide no longer carries grade A by back-calculated past events", () => {
|
||||
const timing = consultationMethodologyForDomains(["timing"])!;
|
||||
const transit = timing.sections.find((section) => section.source === "references/transit-actionable-output-guide.md");
|
||||
assert.ok(transit, "the transit guide is quoted for a timing question");
|
||||
assert.ok(!transit.text.includes("已验证(倒推历史事件命中)"));
|
||||
assert.ok(transit.text.includes("[B] 高概率"));
|
||||
});
|
||||
|
||||
test("grades and statuses no longer depend on the user's past events", () => {
|
||||
const voice = file("frontend/src/mastra/product-voice.ts");
|
||||
assert.ok(!voice.includes("历史回测"), "grade A no longer asks for a historical back-test");
|
||||
assert.ok(!/user_history_verification_required 的项目各自写明/.test(voice));
|
||||
assert.ok(!INTERPRETATION_STATUS_RULE.includes("可核验的问题"));
|
||||
assert.ok(!INTERPRETATION_STATUS_RULE.includes("需要用户的现实经历来核验"));
|
||||
assert.match(INTERPRETATION_STATUS_RULE, /user_history_verification_required = 旧数据里的标记,不算缺口/);
|
||||
assert.ok(!(EVIDENCE_LABELS as readonly string[]).includes("user_history_verification_required"));
|
||||
const synastrySections = file("frontend/src/lib/synastry-full-sections.ts");
|
||||
assert.ok(!/真实经历核对|need real history/.test(synastrySections), "no synastry section asks which judgments need the couple's history");
|
||||
assert.ok(!(writerClaimStatus.options as readonly string[]).includes("user_history_verification_required"), "the report writer is not offered it");
|
||||
assert.ok((CLAIM_STATUSES as readonly string[]).includes("user_history_verification_required"), "stored reports still validate");
|
||||
assert.ok(!/过往经历|past events/i.test(FACT_STATUS_LABELS.user_history_verification_required + FACT_STATUS_LABELS_EN.user_history_verification_required));
|
||||
const generation = file("frontend/src/lib/personal-report-generation.ts");
|
||||
assert.ok(!generation.includes("建议结合真实经历核验"));
|
||||
assert.match(generation, /user_history_verification_required: 2,/);
|
||||
const tables = file("frontend/src/lib/report-fact-tables.ts");
|
||||
assert.ok(!/declared === "user_history_verification_required"/.test(tables), "the fact table reads it like an undeclared status");
|
||||
});
|
||||
|
||||
test("「未见阻断项」 is an internal state: the reading and question checks catch it", () => {
|
||||
assert.equal(readingHedge("这一块未见阻断项,可以放心。"), "未见阻断项");
|
||||
assert.ok(readingHedge("status no_open_blocker"));
|
||||
assert.ok(annualReplyWording("这一项未见阻断项。").some((note) => note.includes("未见阻断项")));
|
||||
assert.equal(readingHedge("这一年工作上会更忙。"), undefined);
|
||||
});
|
||||
@@ -800,3 +800,14 @@ evidence_card.backstage records, for the backend only, that global web evidence
|
||||
- 个人报告:写好的日期后面不留空格;`not_routed` 的「没有路由」写成「已放在××部分使用」或「没有用到」;披露标签单独成句时写「本报告没有评估出生时间对各类判断的影响」;「现在这几年」第一句用日常话说阶段(规则 R-03);报告开头只在「重点」块保留一句「不是确定会发生的事」。
|
||||
- 合盘「技术依据摘要」(只改显示):「档案时刻 / 候选时刻」显示为「填写的时间 / 试算的时间」;「参数敏感 / 只作观察」显示为「结果会随算法设置变化 / 只作参考」;表头用两个人的名字;同一句说明只留一次。
|
||||
- 没有改:年运开始页「具体会发生什么事,星盘只能推测,报告里会写成『可能』,不当成定论。」(2026-11-01 的固定文案,#153);页首「本报告由 AI 生成,仅供参考。」
|
||||
|
||||
## AU. 普通解盘与推运不使用用户经历校准(占星师 2026-11-21 审核,BUG-2111;临时隔离)
|
||||
|
||||
依据:占星师 2026-11-21 审核原话:「普通解盘与推运不得使用用户经历或反馈,改变事件选择、权重、方向、计算参数或结论。只有用户明确进入生时校正流程时,才可在该流程内使用相关经历。独立公开案例的规则验证属于另外的研究流程,不等同于对当前用户进行经历校准。」她会自己改上游原文;在那之前,产品把相关段落从送给模型的文字里隔离出去,参考文件本身不改。
|
||||
|
||||
- 隔离的段落(按原文内容匹配,不按行号):`precision-reading-methodology.md` 的「共识6:先验证过去,再预测未来」、§4.1–4.2(为什么要验证过去、倒推验证协议)、§4.3 开头「只有在倒推验证通过后,才进入正推预测」、§5.1 表里「A-已验证」一行、§八 的「Step 3: 倒推验证」;`ai-reading-workflow-prompt.md` §5.0.1 的「A-已验证」一行和 §5.0.2 的「已验证 / 未经验证 / 验证失败」三行;`transit-actionable-output-guide.md` 要素3 的「[A] 已验证(倒推历史事件命中)」一行。整段处换成一句产品说明,单行直接去掉。
|
||||
- 作用范围:个人报告解读(整段引用的参考文件)、问答(方法摘录和 `skill_read` 读到的任何参考文件,在每次发给模型前处理)。生时纠正流程不读这些文件,不受影响。
|
||||
- 等级:A 不再以「历史回测」为条件,等级只看盘面依据够不够;普通解读不向用户索要过往经历来定等级,也不因为没有经历而降低结论或停止预测。
|
||||
- `user_history_verification_required`:旧数据里仍可能出现。前端不把它当缺口:不显示「需要过往经历核对」,事实表按未声明状态处理,个人报告的状态排序与 `parameter_sensitive` 同级,提示词里不要求「写成待核验并给出可核验的问题」;合盘写作不再提供这个标签。真正缺输入、缺规则或方法冲突时,用已有的具体状态并写清缺什么(Python 一侧,BUG-2110)。
|
||||
- 「未见阻断项」(`no_open_blocker`)只是内部状态,不等于证据充分,不进读者文字;解读和报告内提问的回答出现时走同一次修复或改写。
|
||||
- 临时性:她改完上游后,这些段落不再出现,`tests/user-history-isolation-2111.test.ts` 会指出哪条规则不再匹配,届时删掉对应规则,全部不匹配时删掉这一层。
|
||||
|
||||
Reference in New Issue
Block a user