Merge #217 runtime source notices, BPHS profile split, appendix verification rows (BUG-1861)
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m4s
Independent Staging Quality Gate / validate-python (push) Successful in 6m54s
Independent Staging Quality Gate / publish (push) Successful in 3m23s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXozsiu43ob7B8UZCmDM
This commit is contained in:
2026-11-12 23:30:16 +08:00
co-authored by Claude Opus 5.5
20 changed files with 496 additions and 66 deletions
+6
View File
@@ -1,5 +1,11 @@
# 印度占星 Skill 更新日志
## 2026-11-12 — 个人报告按当前证据合同写作并单列核验状态
- 解读开头明确废止历史预测数字和旧分级口径,功能吉凶按事实包选中的版本解释。
- 「计算依据」中的核验记录按实际状态显示,默认折叠,导出保留两行。
- 本轮沿用当前 Skill 版本(BUG-1861)。
## 2026-11-12 — 年运报告将 Narayana 列为条件参考
- 未决种子的具名分支独立列出,窗口来源数及把握等级依据独立证据。
+15
View File
@@ -25112,3 +25112,18 @@
- 防复发:检查已算未用、缺真实结果、不适用理由及阻碍原因。断言宫主不在阻碍宫时不列入其宫内行星,落在该宫时列入。
- 关联记录:#216、BUG-1848、BUG-1852、BUG-1853。
- 修复版本:`codex/reading-status-axes-badhaka-20261112`。
## BUG-1861 | 个人报告提示仍含旧置信度口径,功能吉凶资料混用
- 状态:resolved(分支定向回归通过,待独立验收)
- 首次发现 / 最近更新:2026-11-12 / 2026-11-12
- 影响面:个人报告写作提示、功能吉凶规则溯源与「计算依据」附录。
- 用户现象:旧准确率和 A/B/C 置信度口径仍进入个人报告写作提示。附录显示固定核验说明,读者无法辨认两项实际核验状态。
- 触发条件:个人报告从事实包生成写作提示并渲染计算依据。
- 根因:历史方法原文先于产品合同进入模型上下文。事实包使用 PVR,供模型参考的 BPHS 文档却用上游路径存放产品修订。普通审计表用固定文案替换后台核验状态。
- 修复:先载入产品合同的废止公告,报告继续遵循 `report_evidence_grade_v1`。按 Git 原始字节恢复上游 BPHS 并另存产品修订。个人报告附录从已有审计读取两项核验状态,缺失或阻塞显示「未完成」。
- 验证:检查提示拼接顺序、上游 SHA256、十二上升土星分类、两张公开盘的 PVR profile、已保存与缺失的核验状态,以及附录折叠和九节正文的渲染边界。详情见 `docs/tasks/PROGRESS-reading-runtime-sources-20261112.md`。
- 防复发:`test_functional_profile_split_20261112.py` 锁定原始文件和运行时 profile。`report-reading-runtime-sources-20261112.test.ts` 锁定公告、提示顺序和个人报告附录边界。
- 相关记录:BUG-1794(个人报告附录部分回撤)、BUG-1841、BUG-1570、BUG-1590。
- 复发自:无。
- 修复版本:`codex/reading-runtime-sources-20261112`,待发布。
@@ -0,0 +1,55 @@
# 个人报告解读的运行时资料与核验记录 · 2026-11-12
Gitea #217,BUG-1861。计划评论 42256,认领评论 42374。任务书基线 `1ba0364a`,合入本分支的验证基线为 staging `c55338f35916587ec9007d0786f370e5c29d0aa9`。
## 旧原文盘点
范围为仓库 `SKILL.md` 与 `REPORT_READING_REFERENCES` 的八份文件。下列行号按本轮基线。
| 文件与标题 | 行 | 原文片段与用途 |
| --- | --- | --- |
| `SKILL.md`,v6.9.14 核心能力、Yoga 逻辑验证指标 | 29、57–61 | 「Yoga精度Benchmark 100%」、Precision 83.26% / 96.48%、Recall 91.52% / 93.99%、F1 87.19% / 95.22%、8/8。技术样本指标,报告不据此声明预测准确率。 |
| `SKILL.md`,Transit Actionable Output | 288 | 「[A]=已验证 / [B]=高概率 / [C]=推断」。旧三级分法。 |
| `SKILL.md`,Chara Dasha 能力升级 | 334–338 | 「95.83% ≥ 95%」,「Sign 100%, Dur 91.67%, Overall 95.83%」,「~4.2%差异」。引擎对拍,不是个案命中率。 |
| `SKILL.md`,核心分析规则 | 426 | 「若没有主承诺和推运激活,输出置信度不得超过 C」。旧固定上限。 |
| `SKILL.md`,精准解盘方法论与资料索引 | 392、604 | 「三级置信度」索引及「[A]已验证 / [B]强推断 / [C]假设」。 |
| `SKILL.md`,已验证名人案例 | 727、731–736、738 | 标题与总览「平均93%」,个案列 95%、94%、92%、93%、94%、93%。历史吻合度,报告不据此声明验证或命中。 |
| `strict-workflow-router.md`,full-reading-strict | 181 | `Confidence label: A/B/C/insufficient`。 |
| 同文件,event-verification-strict | 332–343 | `A: same theme + same timing`、`B: … approximate timing`、`C: symbolic match only`、`Fail`、表格 `A/B/C/fail`。回放质量的旧映射不作报告等级。 |
| 同文件,Confidence rules | 409–418 | 表格 A、B、C、Insufficient 与「Upgrade only when independent techniques converge」。报告不采用这组旧分级门槛。 |
| `precision-reading-methodology.md`,案例验证 | 42 | 「500个案例验证,达到99%成功率」。 |
| 同文件,九层复合方法 | 141 | 「做到第六层,平均85%的预测成功率」。 |
| 同文件,验证驱动 | 178 | 「倒推失败率 > 30%」。历史流程阈值,不是本报告结果。 |
| 同文件,置信度分级、输出规范及诚实边界 | 226–249 | 「A-已验证 / B-强推断 / C-假设」、「置信度:[A/B/C]」。第 249 行「物理学中90%」「医学中60%」是跨学科举例,不是预测成绩。 |
| 同文件,常见教条式失误及纠正 | 269 | 「多系统验证(L4-L9)才能达到85%准确率」。 |
| 同文件,实战五步法 | 315、323 | 「匹配度 <60% 则停止」是历史流程阈值。「三级置信度标注」是旧输出。 |
| `event_judgment_skeleton.md`,Confidence Mapping 与 Output Contract | 109–125、147 | 「建议映射」A–D 与 `"confidence": "A|B|C|D"`。不是旧 A/B/C 词表,但本报告不按其示例自评分。 |
`SKILL.md` 第 148 行 A/B/C 是入口路由分类。第 713 行 97.8% 是文档覆盖率。三个专题 `event_judgment_career.md`、`event_judgment_wealth.md`、`event_judgment_marriage.md` 只提证据不足会影响置信度,未给旧等级词表或预测率。`functional-role-profile.md` 与 `interpretation_status_contract.md` 分别记方法和状态,不含此类旧声明。
## 实施与消费位置
- 产品合同 G 节新增专供个人报告的前置公告。 `reportReadingPrompt` 在引述原文之前加载公告,原文照常逐份保留和记录哈希。聊天不加载这个块。
- 从占星师 `8aaf60991c32a84ac30d6d7b6a62c4f166507bce` Git 对象取原始字节。SHA256 为 `95f5445a197a5f49ebaa08431816f0f3583b0a3c13f7967d3c043cecfe63aa7e`。原产品表按原字节移入具名文件,另加逐行差异表。 `functional_benefics.py` 仅修改两处引用路径。
- 从当前 BPHS 代码取十二上升的土星期望值。白羊、巨蟹、狮子、天蝎、射手、双鱼为凶。金牛、天秤、摩羯、水瓶为吉。双子、处女为混合,现有集合将混合列入中性组,歧义注记标为 mixed。
- `pl9_full_data_export._append_audit_chapters` 是个人报告审计的统一接入点。 `audit_chapters` 在这里读取已保存的两个审计状态,不复制后台词和说明。空记录或阻塞记未完成,已记录的完成、部分完成或不适用照实写。中文行名为「网上资料核对」「真实案例校准」,英文版独立翻译。 `PersonalReportMarkdownView` 在原计算依据下折叠显示这张表,打印复用原折叠表机制,Markdown 导出保留两行。
- 九节的 C 级说明仍表示缺少相符案例。文案为「有星盘依据,还没有对得上的案例」,使核验行名只出现在附录。原作者写作与聊天过滤合同继续生效。
## 既有断言变更
| 位置 | 原值 | 新值 | 原因 |
| --- | --- | --- | --- |
| `test_report_no_web_wording_20261109.py::_assert_clean` | 一条固定核验说明必须是普通审计表最后一行,其余内容禁词 | 独立核验表恰有两条状态行,其余内容沿用禁词断言 | #217 要求两条可读的实际状态。 |
| `test_report_audit_chapters_20261107.py` 中文审计 | 固定说明仅一次,正文全篇不出现案例词 | 两条未完成行分别检查,隔离后仍禁止其余内容出现案例词 | 保留词语隔离,按新附录结构验证。 |
| `test_report_wording_sanitizer_20261111.py` | 聊天与报告共用同一句固定说明 | 聊天固定文案保持原值,个人报告不显示旧固定句 | 本轮只更改个人报告附录。 |
| `report-reading-20261027.test.tsx` C 级 | 「有星盘依据,还没有用真实案例校准过」 | 「有星盘依据,还没有对得上的案例」 | 九节不重复附录中的核验行名,保留 C 级含义。 |
## 验证
- 开工基线 `c55338f35916587ec9007d0786f370e5c29d0aa9`。Python 定向 64 项通过,覆盖 BPHS 拆分、两张公开盘的 PVR 事实包、报告审计、禁词范围和聊天提示。盘面、功能吉凶及校正另有 95 项与 3 个子测试通过。隐私守卫 62 项通过。
- 前端指定测试 24 项通过,另有聊天核验说明、报告导出与相关消费链 16 项通过。原 6 个提示块逐块校验,去掉维护者注释后的文本与基线一致。
- TypeScript 检查通过。Lint 为 0 错误、62 条既有警告。对照 `npm run build` 两边均成功,首页 `/` 保持 `○ Static`。从构建后的首页 HTML 提取 JS 和 CSS 资源,两边各 39 个文件,gzip 后 JS 515860 字节、CSS 90886 字节,均为 0% 变化。
- Python 快速门 `--profile quick --skip-frontend-runtime` 退出 1,1463 项通过、2 项跳过、29 个子测试通过。3 项失败与开工基线对照一致,均在 `tests/test_upstream_technique_layers.py`,分别为公开盘固定值、大运注册表与 Kaala 的 PyJHora 对照。失败表现相同,分别为 `KeyError: 'seed'`、Windows `OSError: [Errno 22]`、`KeyError: 'seed'`。
- 合入 staging `718bc991368cd3eb33de60e93c22600e80a139f1`(#216)后,验证实际合并树。功能吉凶拆分、两张公开盘、参与状态和报告事实包定向共 41 项通过。合入期间只需解决 Bug 历史的追加冲突,两单记录均保留。前端源文件和测试与上面的验证版本逐字节一致。
- 前端全量按 `npm test` 同一 TSX 文件清单运行,每组并发 4。开工基线 3663 项,3636 通过、27 失败。分支 3665 项,3638 通过、27 失败。两组取消与跳过均为 0,退出码均为 1。27 项失败名称完全一致,无缺失断言。新增的 2 项提示与附录测试均通过。
- 已验证提示实际拼接及个人报告服务端渲染。真实模型输出与浏览器交互留待独立验收。
@@ -0,0 +1,115 @@
# TASK:报告解读运行时口径:废止旧成功率与旧 ABC 口径,拆分功能吉凶 profile,附录如实列核验行(2026-11-12)
- Gitea:#217
- 分支:`codex/reading-runtime-sources-20261112`,基于 staging `1ba0364a7a8c0f964c3e21c21cb304aaa1899375`
- Bug 编号:BUG-1861
- 验收:Claude(jyotisha-e6)
不得自行写「产品决定/裁定」。任务书没写到的取舍,一律选「需拍板」。
不得修改或删除既有断言来让测试通过。确需修改的,在 PROGRESS 里逐条写明原值、新值和原因。
占星师的引擎和资料(`scripts/jyotish_engine.py`、`scripts/yoga_engine.py`、`references/` 下她仓库已有的文件、`SKILL.md`)一律不改。产品差异只能放进单独的产品文件,并在 `references/product_runtime_contract.md` 公告(项目规则 2026-11-07)。
占星师回复原文:`docs/tasks/ref-astrologer-acceptance-reply-20261112.md`,由本分支第一个提交带入。下文的「她 §N」都指这份文件。
本任务**允许**修改 `references/product_runtime_contract.md`(产品文件),但只能改下文点名的地方。
## 背景
### A. 旧提示原文仍有运行效力(她 §4 末条)
报告解读的系统提示由 `frontend/src/mastra/report-reading-skill.ts` 拼成:`SKILL.md` 加上 `REPORT_READING_REFERENCES` 里列的文件,最后加产品合同的 report-reading 块。
其中 `references/precision-reading-methodology.md`「三、九层复合方法」写有「做到第六层,平均85%的预测成功率」,另外好几处还用着旧的 A/B/C 置信度口径,例如:
- `strict-workflow-router.md` 的 `Confidence label: A/B/C/insufficient` 和 `A/B/C/fail`
- `precision-reading-methodology.md` 的 `置信度:[A/B/C]`
她要求保留原文以便追溯,但必须明确废止它们在运行时的效力,不能只靠末尾的新合同去隐式覆盖。没有验证设计、分母和适用范围,就不得向用户宣称准确率。
### B. 功能吉凶 profile 混用(她 §4)
- 事实包 `functional.functional_profile` 选的是 `pvr_table30_v1`。
- 提示里加载的 `references/functional-role-profile.md` 是**我们改过的** BPHS 表(`bphs_ch34_general_with_sign_exceptions_v3_166q4`)。它与她 `8aaf6099` 的同名文件有几处不同:
- 双子、处女上升的土星 mixed 两行;
- 34.20、34.35 两处注释;
- 她的「Revision v3」整段被换成了我们的 #163 说明。
- 她的裁定:
- 按已选的 profile(PVR)给结论。
- BPHS 修订作为另一个具名、带版本的 profile,附来源定位、完整差异和十二上升测试,另行送审。
- 不接受「只有两个词差异」这种笼统说明。
### C. 核验行在附录里如实显示(她 §4,产品 2026-11-12 决定)
她要求真实案例与 MEVG 的状态保留在用户可读的证据附录里。产品 2026-11-12 的决定如下:
- **个人报告**里可折叠的「计算依据」附录如实列两行:「网上资料核对:未完成」「真实案例校准:未完成」,按实际状态写。
- 正文和聊天回答照旧不提(BUG-1794 对正文仍然有效)。
- 这属于 BUG-1794 在**附录**范围的部分回撤,要在产品合同里写明。
- 年运报告的附录由 #210/#212 负责,本任务不管。
## 要改的文件
- `references/product_runtime_contract.md`:
- report-reading 块之前的 G 节公告区:新增「运行时废止」一段和「功能吉凶 profile」一段;
- BUG-1794 的两处注释(第 14、128 行附近):各追加一句附录例外,并写原值、新值和原因。
- 其他段落一律不动。
- `references/functional-role-profile.md`:恢复为她 `8aaf6099` 的原文,逐字节一致。原文见 `/workspace/yinduzhanxing`,用 `git -C /workspace/yinduzhanxing show 8aaf6099:references/functional-role-profile.md` 取得。
- 新建 `references/product_functional_profile_bphs_v3_166q4.md`:我们当前的版本,加上文件头和差异表(见下)。
- `scripts/functional_benefics.py`:`profile_source` 和 `rule_reference` 两处字符串指向新文件,只改字符串。
- 「计算依据」附录的生成代码:自己定位,先看 `frontend/src/lib/report-toc-groups.ts`、`frontend/src/components/personal-report/`、`scripts/report_render/audit_chapters.py`;在 PROGRESS 写明改的是哪里。
- 新建 `tests/test_functional_profile_split_20261112.py`
- 新建 `frontend/tests/report-reading-runtime-sources-20261112.test.ts`
- `frontend/tests/report-no-web-wording-20261109.test.ts`:只在它对附录也断言「不出现」时才收窄到正文,并在 PROGRESS 写明原值、新值和原因。
- `docs/BUG_HISTORY.md`:末尾追加一条
- `docs/tasks/PROGRESS-reading-runtime-sources-20261112.md`
## 要做的
1. **盘点。** 在 `SKILL.md` 和 `REPORT_READING_REFERENCES` 列出的每份文件里,找出所有准确率、成功率、命中率的数字说法,以及所有 A/B/C 置信度口径的位置。每处记下文件、标题、行号和原文片段,列进 PROGRESS。
- SKILL.md「阶段零 A/B/C 入口路由」是路由分类,不是置信度,不算。其他类似情况也照此分辨,并写明理由。
2. **废止段。** 在产品合同的 G 节公告区写「运行时废止」:
- 逐条点名第 1 步找到的位置,说明「保留原文以便追溯,运行时无效」。
- 置信度只按 `report_evidence_grade_v1` 的 A–D 上限,不得向用户宣称任何准确率或成功率。
3. **profile 段。** 在 G 节写明:
- 报告的功能吉凶以事实包 `functional.functional_profile`(目前是 `pvr_table30_v1`)为准;
- `references/functional-role-profile.md` 是她的 BPHS 原文,只作对照;
- 产品修订的 BPHS 表是 `references/product_functional_profile_bphs_v3_166q4.md`,状态为待她审核,不进报告结论。
4. **新 profile 文件。** 文件头写清以下内容:
- profile id;
- 来源:她 11-05 #166 Q4 裁定、BUG-1570、BUG-1590;
- 与她 `8aaf6099` 版本的**完整**差异表,逐行列出新增、删除和改写,被替换掉的「Revision v3」段也要列。
5. **测试。**
- Python 测试:
- `references/functional-role-profile.md` 的 sha256 等于她 `8aaf6099` 版本的 sha256(把期望值写死在测试里,并注明来源提交);
- 十二个上升都用 `functional_benefics` 的 BPHS profile 求土星分类,双子、处女是 mixed,其余十个上升的结果写死成期望值(期望值取自现有代码,写进 PROGRESS);
- 对 Jobs 和 Obama 两张公开盘调用报告事实包(方法参照 `tests/test_reading_facts_v3_20261112.py`),`functional.functional_profile == "pvr_table30_v1"`。
- 前端测试:
- `buildReportReadingSystemPrompt`(以实际函数名为准)的输出里,含有新的废止段和 profile 段;
- 附录渲染出「网上资料核对」「真实案例校准」两行,状态为「未完成」;
- 正文区域(解读的九节)仍然不出现这两个词。
6. **附录两行。**
- 状态取自现有后台记录(回执或审计里的 MEVG / Real Case 行)。没有记录就写「未完成」,不得写成「已完成」或「通过」。
- 行名用中文:「网上资料核对」「真实案例校准」。附录里不出现「MEVG」字样。
## 不要碰
- `frontend/src/lib/personal-report-reading.ts`(#207 和 BUG-1860 在改)
- `scripts/report_render/evidence_grade.py`、`reading_facts.py`
- 聊天的提示和回答
- 冻结文件
- 她的其他 references 文件(只恢复 `functional-role-profile.md` 这一份)
## 自测命令
```
python3 -m pytest -q tests/test_functional_profile_split_20261112.py tests/test_functional_yogakaraka_kendra_trikona.py tests/test_reading_facts_v3_20261112.py
python3 scripts/run_quality_gate.py --profile quick --skip-frontend-runtime
cd frontend && npx tsx --test tests/report-reading-runtime-sources-20261112.test.ts tests/report-no-web-wording-20261109.test.ts tests/report-reading-20261027.test.tsx && npx tsc --noEmit -p . && npx eslint .
```
## 何时停下来选「需拍板」
- 恢复她的 `functional-role-profile.md` 之后,聊天、生时纠正或盘面页的测试失败。说明这些地方实际读的是我们改过的表,先停下来报告。
- 找不到「计算依据」附录的单一生成点,或者附录同时用于聊天。
+2
View File
@@ -1518,6 +1518,8 @@ Bhava Bala 保留完整十二宫力量表;Score / Weight 等领域表头不单
## 报告核对层与独立附录(2026-09-23)
个人报告「计算依据」内的「核验记录」默认折叠。网上资料核对和真实案例校准各一行,按记录显示状态。导出保留两行,打印时按现有核对表规则展开,打印后恢复展开状态。解读区不显示这两行。
个人报告保留原 Markdown 阅读、目录隔离与 memo 边界;文后独立渲染服务端分盘和事实表。分盘复用 VedicChartSvg 与 chart-grid/chart-card,不使用 float 或负 margin。事实表默认折叠、可键盘展开,横向溢出仅在表格区域滚动,缺数据不补写。Markdown 表里,只有表头含速度、Speed、度数或黄经的数值表(`.personal-report-table-numeric`)单行并按内容撑宽,放不下时在表自己的框里横滑;作用说明、建议这类整句表在页内换行。打印时所有报告表都是页宽,单元格可以换行,纸上不横滑。Sade Sati 明确缺三轮日期。09-24 reader-actions D2 撤下操作区「下载原始附录」入口;相关组件、路由和 helper 因删除权限阻塞暂留源码,不当作完成清理。不接普通下载 fallback、不增加 spinner。旧缓存不升级、不重算;没有结构化层就不显示占位盘。文案遵守 VOICE:不把可计算写成已验证。
事实表用中文列名和领域行列呈现,不把引擎路径当行名。主运、分运与小运、SAV 与 BAV、年度位置与 Saham 分为同组子表;缺失的年度行星位置明确说明,不用本命盘替代。机器溯源路径保留在数据中、不渲染。打印或保存 PDF 前自动展开此核对层全部折叠组,完成或取消后恢复原状态;打印解除表格横向滚动裁剪、重复表头,宽 BAV 表仍保留十二星座列。不新增打印入口或等待动画。
@@ -18,6 +18,7 @@ import {
import { reportAiNotice } from "@/lib/ai-generated-notice";
import { parseReportFocusBlock, reportTitleByline } from "@/lib/report-focus-block";
import { reportChartGrid } from "@/lib/report-chart-grid-rehype";
import { bindFactTablePrint } from "@/lib/report-fact-table-print";
import { remarkCjkStrong } from "@/lib/remark-cjk-strong";
import { NorthIndianChartSvg } from "@/components/personal-report/vedic-chart-svg";
import { ReportEdgeJump } from "@/components/personal-report/report-edge-jump";
@@ -87,6 +88,21 @@ export function reportBirthLine(markdown: string): string | null {
return value && value.length <= 40 ? value : null;
}
function VerificationAppendix({ language, children }: { language: ReportLanguage; children: ReactNode }) {
const root = useRef<HTMLDivElement>(null);
useEffect(() => {
if (root.current) return bindFactTablePrint(root.current, window);
}, []);
return (
<div ref={root} className="personal-report-fact-tables">
<details>
<summary>{language === "en" ? "Verification" : "核验记录"}</summary>
<div className="personal-report-fact-body">{children}</div>
</details>
</div>
);
}
function markdownComponents(
headings: readonly LongformHeading[],
language: ReportLanguage,
@@ -112,11 +128,14 @@ function markdownComponents(
return <span>{children}</span>;
},
img: () => null,
table: ({ children }) => (
<div className={reportTableWrapClass(tableHeaderLabels(children))}>
<table>{children}</table>
</div>
),
table: ({ children }) => {
const labels = tableHeaderLabels(children);
const table = <div className={reportTableWrapClass(labels)}><table>{children}</table></div>;
const verificationHeader = language === "en" ? "Verification item|Status" : "核验项目|状态";
return labels.join("|") === verificationHeader
? <VerificationAppendix language={language}>{table}</VerificationAppendix>
: table;
},
td: ({ children }) => <td>{renderNakshatraLabel(children)}</td>,
h1: ({ children }) => {
const title = flattenText(children).trim();
@@ -143,7 +143,7 @@ export const EVIDENCE_GRADE_LABEL = "证据等级";
export const EVIDENCE_GRADE_MEANING: Readonly<Record<EvidenceGrade, string>> = {
A: "在明确的案例集里经过较强的独立验证",
B: "有对得上的真实案例支持,几种独立方法方向一致",
C: "有星盘依据,还没有用真实案例校准过",
C: "有星盘依据,还没有对得上的案例",
D: "关键依据缺失,暂不能判断",
};
@@ -156,7 +156,7 @@ export function readingSectionView(section: ReportReading["sections"][number]):
return { status: "ok", paragraphs: section.paragraphs.map(({ text, grade }) => (grade ? { text, grade } : { text })) };
}
/** 「证据等级 C:有星盘依据,还没有用真实案例校准过」 */
/** 「证据等级 C:有星盘依据,还没有对得上的案例」 */
export function evidenceGradeTag(grade: EvidenceGrade): string {
return `${EVIDENCE_GRADE_LABEL} ${grade}:${EVIDENCE_GRADE_MEANING[grade]}`;
}
@@ -28,6 +28,7 @@ export type ProductContractBlock =
| "natal-instructions"
| "mevg-blocked-policy"
| "shared-reading"
| "report-reading-source-notices"
| "report-reading";
let cached: string | null = null;
+3 -1
View File
@@ -54,9 +54,11 @@ export function reportReadingPrompt(): ReportReadingPrompt {
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) }));
const contract = read(PRODUCT_RUNTIME_CONTRACT_FILE);
const rules = productContractBlock("report-reading", { CLAIM_TYPES: REPORT_CLAIM_TYPES.join("、") });
const sourceNotices = productContractBlock("report-reading-source-notices", {}, contract.text);
const rules = productContractBlock("report-reading", { CLAIM_TYPES: REPORT_CLAIM_TYPES.join("、") }, contract.text);
const system = [
`The jyotish-vedic-astrology skill is loaded for a written report. Its full SKILL.md (the astrologer's upstream skill, verbatim) is quoted below, then the references this report routes to, verbatim. Follow its method, routing and truth boundaries. There are no tools in this call: everything you may use is in this message and the chart facts.`,
sourceNotices,
REPORT_READING_SKILL_MARKER,
body,
...references.map((file) => `<reference path="${file.path}">\n${file.text.trim()}\n</reference>`),
@@ -389,7 +389,7 @@ test("the page keeps a reading only in the stored shape and shows it before the
assert.ok(readingAt > zh.indexOf("印度占星星盘报告") && readingAt < basisAt && basisAt < engineAt, zh.slice(0, 400));
for (const title of ["总评", "现在这几年", "几条建议", "依据与边界"]) assert.ok(zh.includes(`<h3>${title}</h3>`), title);
// #192(产品 2026-11-12 原型方案 B):领域节每段下面一行灰字,写等级和含义;总评等不分级的节没有
assert.ok(zh.includes("证据等级 C:有星盘依据,还没有用真实案例校准过"), "grade line");
assert.ok(zh.includes("证据等级 C:有星盘依据,还没有对得上的案例"), "grade line");
assert.match(zh, /<p class="personal-report-evidence-grade">证据等级 C:/, "a plain line, no tap to open");
const withheld = (accept(draft({ love: [`${PARAGRAPH}你注定晚婚。`] })) as { reading: unknown }).reading;
const shown = renderToStaticMarkup(<PersonalReportMarkdownView markdown={markdown} reading={withheld as never} language="zh" />);
@@ -0,0 +1,56 @@
import assert from "node:assert/strict";
import test from "node:test";
import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import { PersonalReportMarkdownView } from "../src/components/personal-report/personal-report-markdown-view.tsx";
import {
EVIDENCE_GRADE_CONTRACT,
REPORT_READING_SECTIONS,
type ReportReading,
} from "../src/lib/personal-report-reading-contract.ts";
import { projectOrdinaryReportMarkdown } from "../src/lib/report-public-projection.ts";
import { reportReadingPrompt, REPORT_READING_SKILL_MARKER } from "../src/mastra/report-reading-skill.ts";
test("report writer retires the historic rules before the original references", () => {
const { system, skill } = reportReadingPrompt();
const noticesAt = system.indexOf("### 运行时废止");
const profileAt = system.indexOf("### 功能吉凶 profile");
const sourceAt = system.indexOf(REPORT_READING_SKILL_MARKER);
assert.ok(noticesAt >= 0 && noticesAt < profileAt && profileAt < sourceAt);
const notices = system.slice(noticesAt, sourceAt);
assert.match(notices, /保留原文以便追溯,运行时无效/);
assert.match(notices, /report_evidence_grade_v1/);
assert.match(notices, /不得向用户宣称准确率、成功率或命中率/);
assert.match(notices, /functional\.functional_profile.*pvr_table30_v1/);
assert.match(notices, /product_functional_profile_bphs_v3_166q4\.md.*待占星师审核/);
assert.match(system.slice(sourceAt), /平均85%的预测成功率/);
assert.ok(skill.loaded.some(({ path }) => path === "references/functional-role-profile.md"));
assert.ok(!skill.loaded.some(({ path }) => path.includes("product_functional_profile_bphs")));
});
test("personal report verification appears in the folded appendix outside all nine reading sections", () => {
const reading: ReportReading = {
version: 3,
language: "zh",
contract: EVIDENCE_GRADE_CONTRACT,
skill: { name: "fixture", version: "fixture", loaded: [{ path: "SKILL.md", sha256: "0".repeat(64) }] },
sections: REPORT_READING_SECTIONS.map((section) => ({
...section, status: "ok", paragraphs: [{ text: "先核对盘面材料。", grade: "C" }],
})),
};
const markdown = [
"# 个人报告", "", "## 技法审计与证据边界", "", "| 核验项目 | 状态 |", "| ------ | ------ |",
"| 网上资料核对 | 未完成 |", "| 真实案例校准 | 未完成 |",
].join("\n");
const html = renderToStaticMarkup(createElement(PersonalReportMarkdownView, {
markdown: projectOrdinaryReportMarkdown(markdown), reading, drawnThrough: 0,
}));
const body = /<section[^>]+class="personal-report-reading"[^>]*>([\s\S]*?)<\/section>/.exec(html)?.[1];
assert.ok(body);
assert.equal(body.match(/class="personal-report-reading-part"/g)?.length, 9);
assert.doesNotMatch(body, /网上资料核对|真实案例校准/);
assert.match(body, /证据等级 C/);
assert.match(html, /<details><summary>核验记录<\/summary>[\s\S]*网上资料核对<\/td><td>未完成[\s\S]*真实案例校准<\/td><td>未完成/);
assert.doesNotMatch(html, /MEVG/);
});
+10 -15
View File
@@ -1,8 +1,6 @@
# Functional ownership profile v3 + #166 Q4
# Functional ownership profile v3
Profile: `bphs_ch34_general_with_sign_exceptions_v3_166q4` (upstream v3 table, i.e. Aries / Scorpio
Venus challenging (BUG-1570), plus the #166 Q4 Gemini / Virgo Saturn mixed rows
(BUG-1590)). Until 2026-11-07 this table was mislabelled `..._v2`.
Profile: `bphs_ch34_general_with_sign_exceptions_v3`.
Source: BPHS chapter 34, general rules 2–17 and ascendant entries 19–44,
public translation at https://jyotishvidya.com/ch34.htm (inspected 2026-10-02).
This is a named implementation of a translation, not all-lineage agreement.
@@ -19,11 +17,9 @@ not automatically malefic. Sun/Moon eighth lordship has the stated exception.
Unspecified angular or second-house-only cases remain neutral/mixed.
Explicit exceptions are recorded in `ROLE_OVERRIDES`: Aries Mars helpful in
association (mixed), Venus challenging (34.20); Taurus Venus challenging, Sun
supportive; Gemini Jupiter challenging, Saturn mixed (#166 Q4); Virgo Jupiter
challenging, Saturn mixed (#166 Q4); Libra Venus
mixed, Mars challenging; Scorpio Mars mixed, Sun yoga-supporting, Venus
challenging (34.35); Sagittarius Jupiter/Mercury mixed
association (mixed), Venus challenging; Taurus Venus challenging, Sun supportive; Gemini Jupiter
challenging; Virgo Jupiter challenging; Libra Venus mixed, Mars challenging;
Scorpio Mars mixed, Sun yoga-supporting and Venus challenging; Sagittarius Jupiter/Mercury mixed
(Mercury's association with Sun is separate); Capricorn Moon challenging;
Aquarius Mars challenging, Mercury mixed; Pisces Mercury challenging.
The remaining general fallbacks are identified in each planet's `role_basis`;
@@ -35,9 +31,8 @@ functional benefic does not guarantee a favorable event. No death or outcome
prediction is inferred from this classification. The Yoga engine's natural
predicates and active Yoga rule library are not replaced by ownership roles.
Chart page layout (issue #163): `scripts/chart_view_points/functional_roles.py` lays this
profile out one row per body for the 盘面数据 table. It adds no rule: the
functional class is the profile's; Rahu/Ketu are `pending` (association not
evaluated); Yogakaraka and Badhaka (lord of `yoga_engine.badhaka_house`) are
separate labels; a natural benefic owning 4/7/10 and none of 1/5/9 is marked
Kendradhipati with `conditions_not_evaluated`.
Revision v3 (2026-11-04) restores the explicit Venus entries in ch34.19–22
and35–36. This corrects omissions independently of rectification fit. Existing
score weights remain unchanged; native event evidence records the functional
profile and its weighted/unweighted auxiliary contribution. Historical scores
must not be described as recomputed merely because this profile changed.
@@ -0,0 +1,73 @@
# 产品功能吉凶 profile · BPHS v3 + #166 Q4
- Profile ID:`bphs_ch34_general_with_sign_exceptions_v3_166q4`
- 来源:占星师 2026-11-05 #166 Q4,BUG-1570,BUG-1590。
- 状态:产品修订,待占星师审核。个人报告以事实包选中的 profile 为准。
## 与占星师 `8aaf6099` 版本的逐行差异
行号分别按上游原文和下方产品原文计算。末组改动将上游 Revision v3 整段替换为产品 #163 的星盘页说明。
| 改动 | 上游原文 | 产品原文 |
| --- | --- | --- |
| 改写 | 1 <code># Functional ownership profile v3</code> | 1 <code># Functional ownership profile v3 + #166 Q4</code> |
| 改写 | 3 <code>Profile: `bphs_ch34_general_with_sign_exceptions_v3`.</code> | 3 <code>Profile: `bphs_ch34_general_with_sign_exceptions_v3_166q4` (upstream v3 table, i.e. Aries / Scorpio</code> |
| 新增 | — | 4 <code>Venus challenging (BUG-1570), plus the #166 Q4 Gemini / Virgo Saturn mixed rows</code> |
| 新增 | — | 5 <code>(BUG-1590)). Until 2026-11-07 this table was mislabelled `..._v2`.</code> |
| 改写 | 20 <code>association (mixed), Venus challenging; Taurus Venus challenging, Sun supportive; Gemini Jupiter</code> | 22 <code>association (mixed), Venus challenging (34.20); Taurus Venus challenging, Sun</code> |
| 改写 | 21 <code>challenging; Virgo Jupiter challenging; Libra Venus mixed, Mars challenging;</code> | 23 <code>supportive; Gemini Jupiter challenging, Saturn mixed (#166 Q4); Virgo Jupiter</code> |
| 改写 | 22 <code>Scorpio Mars mixed, Sun yoga-supporting and Venus challenging; Sagittarius Jupiter/Mercury mixed</code> | 24 <code>challenging, Saturn mixed (#166 Q4); Libra Venus</code> |
| 新增 | — | 25 <code>mixed, Mars challenging; Scorpio Mars mixed, Sun yoga-supporting, Venus</code> |
| 新增 | — | 26 <code>challenging (34.35); Sagittarius Jupiter/Mercury mixed</code> |
| 改写 | 34 <code>Revision v3 (2026-11-04) restores the explicit Venus entries in ch34.19–22</code> | 38 <code>Chart page layout (issue #163): `scripts/chart_view_points/functional_roles.py` lays this</code> |
| 改写 | 35 <code>and35–36. This corrects omissions independently of rectification fit. Existing</code> | 39 <code>profile out one row per body for the 盘面数据 table. It adds no rule: the</code> |
| 改写 | 36 <code>score weights remain unchanged; native event evidence records the functional</code> | 40 <code>functional class is the profile&#x27;s; Rahu/Ketu are `pending` (association not</code> |
| 改写 | 37 <code>profile and its weighted/unweighted auxiliary contribution. Historical scores</code> | 41 <code>evaluated); Yogakaraka and Badhaka (lord of `yoga_engine.badhaka_house`) are</code> |
| 改写 | 38 <code>must not be described as recomputed merely because this profile changed.</code> | 42 <code>separate labels; a natural benefic owning 4/7/10 and none of 1/5/9 is marked</code> |
| 新增 | — | 43 <code>Kendradhipati with `conditions_not_evaluated`.</code> |
## 分拆前的产品原文
# Functional ownership profile v3 + #166 Q4
Profile: `bphs_ch34_general_with_sign_exceptions_v3_166q4` (upstream v3 table, i.e. Aries / Scorpio
Venus challenging (BUG-1570), plus the #166 Q4 Gemini / Virgo Saturn mixed rows
(BUG-1590)). Until 2026-11-07 this table was mislabelled `..._v2`.
Source: BPHS chapter 34, general rules 2–17 and ascendant entries 19–44,
public translation at https://jyotishvidya.com/ch34.htm (inspected 2026-10-02).
This is a named implementation of a translation, not all-lineage agreement.
`owned_houses` is geometry. `lagna_lord` is identity. `yogakarakas` is the
strict distinct 4/7/10 plus 5/9 lordship definition. The first house remains
angular and trinal but cannot count twice. Broader textual yoga-producing
associations (including Scorpio Sun/Moon) are not restricted by that field.
Functional roles use general ownership rules with explicit sign entries
taking precedence. Lagna/trinal lords are generally supportive; 3/6/11 and
qualified eighth lordship challenging. Sole twelfth lordship is conditional,
not automatically malefic. Sun/Moon eighth lordship has the stated exception.
Unspecified angular or second-house-only cases remain neutral/mixed.
Explicit exceptions are recorded in `ROLE_OVERRIDES`: Aries Mars helpful in
association (mixed), Venus challenging (34.20); Taurus Venus challenging, Sun
supportive; Gemini Jupiter challenging, Saturn mixed (#166 Q4); Virgo Jupiter
challenging, Saturn mixed (#166 Q4); Libra Venus
mixed, Mars challenging; Scorpio Mars mixed, Sun yoga-supporting, Venus
challenging (34.35); Sagittarius Jupiter/Mercury mixed
(Mercury's association with Sun is separate); Capricorn Moon challenging;
Aquarius Mars challenging, Mercury mixed; Pisces Mercury challenging.
The remaining general fallbacks are identified in each planet's `role_basis`;
they are not presented as a verbatim complete classical table.
Natural benefic/malefic status, strength, maraka roles, conjunctions, aspects
and period activation are independent layers. Neutral does not mean harmless;
functional benefic does not guarantee a favorable event. No death or outcome
prediction is inferred from this classification. The Yoga engine's natural
predicates and active Yoga rule library are not replaced by ownership roles.
Chart page layout (issue #163): `scripts/chart_view_points/functional_roles.py` lays this
profile out one row per body for the 盘面数据 table. It adds no rule: the
functional class is the profile's; Rahu/Ketu are `pending` (association not
evaluated); Yogakaraka and Badhaka (lord of `yoga_engine.badhaka_house`) are
separate labels; a natural benefic owning 4/7/10 and none of 1/5/9 is marked
Kendradhipati with `conditions_not_evaluated`.
+20 -2
View File
@@ -11,7 +11,7 @@ SKILL.md 是占星师 skill 的原文(上游 732642856/yinduzhanxing),方
- 不给医疗、法律、投资、安全关键指令;不断言死亡、疾病诊断、离婚、妊娠、流产、不孕、孩子性别。
<!-- 产品规则,不是占星师的方法:A-04 blocked 原样保留;外部 oracle 未闭环不阻塞有条件解读。 -->
- 服务端标为 `blocked` 的计算原样保留为 blocked;外部 oracle 未闭环或体系分歧本身不阻塞有条件的传统解读,按 `references/interpretation_status_contract.md` 记在解读状态轴上。
<!-- 产品规则,不是占星师的方法:A-05 联网检索、外部资料、MEVG 与真实案例校准不写进回答。原值:「本轮没有做的联网核验、真实案例校准,照实说明并降低置信度,不假装做过。」;新值:两种模式的回答都不写这几项,置信度照常封顶;原因:产品 2026-11-08 决定(BUG-1794),偏离占星师「缺口不能隐藏」的裁定(第五轮裁定 6 / 8、她的 Q5 之一与 Q6):产品选择不向用户展示;后台保留记录(回执里的技法审计行 MEVG / Global Web Evidence、Real Case Calibration 照旧)。 -->
<!-- 产品规则,不是占星师的方法:A-05 联网检索、外部资料、MEVG 与真实案例校准不写进回答。原值:「本轮没有做的联网核验、真实案例校准,照实说明并降低置信度,不假装做过。」;新值:两种模式的回答都不写这几项,置信度照常封顶;原因:产品 2026-11-08 决定(BUG-1794),偏离占星师「缺口不能隐藏」的裁定(第五轮裁定 6 / 8、她的 Q5 之一与 Q6):产品选择不向用户展示;后台保留记录(回执里的技法审计行 MEVG / Global Web Evidence、Real Case Calibration 照旧)。 原值(2026-11-08):核验行只留后台。新值(2026-11-12):个人报告「计算依据」附录按记录展示网上资料核对和真实案例校准两行,个人报告正文与聊天回答照旧不写。原因:产品负责人 2026-11-12 同意在附录落实占星师 §4 的可见核验要求(BUG-1861)。 -->
- 回答里不写联网检索、外部资料、MEVG、全网核验或真实案例校准(简明解读、深度解读两种模式都不写,审计表也不列这几行);这几项只记在后台。也不假装做过:不把任何结论写成已验证、已校准或确定。
<!-- 产品规则,不是占星师的方法:A-06 Arudha 写法(占星师 2026-11-07 确认「A2 水瓶(主土星,落 2 宫)」有歧义;句式是她给的,字段是产品加的)。 -->
- Arudha(A1–A12、AL、UL)的写法:pada 所在星座、pada 所在宫、pada 星座的主星、该主星的本命落宫是四件不同的事,证据卡分别给出 `sign`、`pada_house_from_lagna`(从本命上升按整宫数到 pada 所在星座)、`lord`、`lord_natal_house`。写主星落宫时按占星师要求的句式:「A2 位于水瓶;其主星土星位于本命第 2 宫」。不得写成「A2 水瓶(主土星,落 2 宫)」这类分不清是 pada 落宫还是主星落宫的写法;要说 pada 所在宫时写明「A2 所在宫(从上升数)为第 6 宫」,并且只引卡上的 `pada_house_from_lagna`,不自己数。
@@ -125,7 +125,7 @@ Treat the tool result's top-level status and evidence_contract as the authoritat
- When status is ready and evidence_contract.answer_policy.can_answer_direction is true, answer the user's actual question directly. Do not begin with infrastructure or confidence disclaimers.
<!-- 产品规则,不是占星师的方法:P-17 可选外部交叉验证不可用不是计算失败。 -->
- An unavailable optional provider or external cross-check is not a calculation failure. Never call it an internal error.
<!-- 产品规则,不是占星师的方法:P-18 不谈 provider 内部词。原值(2):「The gap in external verification and real-case calibration is not hidden: plain mode states it in one short sentence next to the conclusion it limits, and professional mode records it in the Technique Audit Table's four verification rows.」;新值(2):两种模式都不写;原因(2):产品 2026-11-08 决定(BUG-1794),偏离占星师「缺口不能隐藏」的裁定(第五轮裁定 6 / 8、她的 Q5 之一与 Q6):产品选择不向用户展示;后台保留记录(回执里的技法审计行 MEVG / Global Web Evidence、Real Case Calibration 照旧)。第五轮裁定 6(BUG-1757):原值「Do not mention VedAstro, snapshot, fallback, gateway, archive, provider, MEVG, or calibration unless the user explicitly asks about methodology, or the missing layer materially blocks the exact claim they requested.」;新值:provider 内部词照旧不谈,外部核验与真实案例校准的缺口不再隐藏(白话一句短话,专业模式审计表四行);原因:占星师 2026-11-08 第五轮裁定 6「白话模式不主动提 MEVG 缺口:删除;可用一句简短说明,但不能隐藏」。 -->
<!-- 产品规则,不是占星师的方法:P-18 不谈 provider 内部词。原值(2):「The gap in external verification and real-case calibration is not hidden: plain mode states it in one short sentence next to the conclusion it limits, and professional mode records it in the Technique Audit Table's four verification rows.」;新值(2):两种模式都不写;原因(2):产品 2026-11-08 决定(BUG-1794),偏离占星师「缺口不能隐藏」的裁定(第五轮裁定 6 / 8、她的 Q5 之一与 Q6):产品选择不向用户展示;后台保留记录(回执里的技法审计行 MEVG / Global Web Evidence、Real Case Calibration 照旧)。第五轮裁定 6(BUG-1757):原值「Do not mention VedAstro, snapshot, fallback, gateway, archive, provider, MEVG, or calibration unless the user explicitly asks about methodology, or the missing layer materially blocks the exact claim they requested.」;新值:provider 内部词照旧不谈,外部核验与真实案例校准的缺口不再隐藏(白话一句短话,专业模式审计表四行);原因:占星师 2026-11-08 第五轮裁定 6「白话模式不主动提 MEVG 缺口:删除;可用一句简短说明,但不能隐藏」。 原值(2026-11-08):核验行只留后台。新值(2026-11-12):个人报告「计算依据」附录按记录展示网上资料核对和真实案例校准两行,个人报告正文与聊天回答照旧不写。原因:产品负责人 2026-11-12 同意在附录落实占星师 §4 的可见核验要求(BUG-1861)。 -->
- Do not mention VedAstro, snapshot, fallback, gateway, archive or provider internals unless the user explicitly asks about methodology. In either mode, do not write about web search, external sources, MEVG or real-case calibration, and do not put rows for them in the 深度解读 Technique Audit Table; the backend keeps that record.
Always:
@@ -255,6 +255,24 @@ evidence_card.backstage records, for the backend only, that global web evidence
**产品计算,待占星师审核(BUG-1853,2026-11-12):Badhaka。** 她的引擎(`8aaf6099`)没有本命 Badhaka 模块,健康领域清单却列了它。产品在 `scripts/report_render/badhaka_facts.py` 里按 `references/badhaka-obstacle-planet-guide.md` §二(与她仓库同名文件逐字相同)从已算好的 D1 位置给出 Badhaka 宫、星座、宫主及其落点、宫内行星,只给位置、不下结论,记录里带 `status: product_computation_pending_astrologer_review`。它不改她的 `jyotish_engine.py`、`yoga_engine.py`(只调用后者的 `badhaka_house`)。报告解读和聊天健康证据卡都读这条记录。她的路由 §7 本身没有列 Badhaka;是否保留为健康必查项、用哪条规则,等她审核。
<!-- product-block:report-reading-source-notices -->
### 运行时废止
以下位置保留原文以便追溯,运行时无效。它们不得成为个人报告的预测准确率、成功率或证据等级依据。
- `SKILL.md` 的「v6.9.14 核心能力」第 29 行和「Yoga 逻辑验证指标」第 57–61 行为旧技术评测。`Chara Dasha 能力升级`第 334–338 行为旧引擎对拍。第 727、731–736、738 行为既有案例吻合数字。这些数字均不得用于报告的准确率、成功率、命中率或校准声明。
- `SKILL.md` 的「Transit Actionable Output」第 288 行、应期规则第 426 行及「精准解盘方法论」第 604 行的旧置信度口径和固定上限停止生效。第 392 行的索引只用于追溯。
- `references/strict-workflow-router.md` 的「full-reading-strict」第 181 行、「event-verification-strict」第 332–343 行和「Confidence rules」第 409–418 行的旧 A/B/C/insufficient、A/B/C/fail 和分级门槛停止生效。
- `references/precision-reading-methodology.md` 的「案例验证」第 42 行、「九层复合方法」第 141 行、「常见教条式失误及纠正」第 269 行的预测数字停止生效。「验证驱动」第 178 行和「实战」第 315 行的历史阈值与第 249 行的跨学科举例,不得当成本报告的验证结果或门槛。第 226–245 行与第 323 行的三级标签和示例停止生效。
- `references/event_judgment_skeleton.md` 第 109–125 行的旧示例映射只保留方法史。第 147 行的 A–D 字段示例不能给报告自评分。
结论等级只按 `report_evidence_grade_v1` 提供的 A–D 上限逐条使用。报告不得向用户宣称准确率、成功率或命中率,也不得把旧样例或工程对拍写成本次验证。
### 功能吉凶 profile
个人报告以事实包 `functional.functional_profile` 选中的版本为准,当前为 `pvr_table30_v1`。引用的 `references/functional-role-profile.md` 是占星师 `8aaf6099` 的 BPHS 原文,只供对照。产品修订的 `references/product_functional_profile_bphs_v3_166q4.md` 另有具名版本,待占星师审核,不进入报告结论。不要用对照表重判已选 PVR 结果。
<!-- /product-block:report-reading-source-notices -->
<!-- product-block:report-reading -->
<!-- 产品规则,不是占星师的方法:R-01 输入边界。 -->
你在给一份个人星盘报告写开头的「解读」。用户消息里的盘面事实(report-reading-facts-v3)是引擎已经算好的全部材料,只用这些,不编数据,不另起算法,不凭印象重算尊贵度、宫位或日期。事实里没有的层就当没有。
+2 -2
View File
@@ -377,7 +377,7 @@ def derive_functional_benefic_malefic(
else "BPHS ch34 general ownership; associations not evaluated"
for planet in PLANETS
}
profile_source = "BPHS ch. 34 general ownership rules plus sign exceptions (references/functional-role-profile.md)"
profile_source = "BPHS ch. 34 general ownership rules plus sign exceptions (references/product_functional_profile_bphs_v3_166q4.md)"
prior = []
for (sign, planet), (ruling, product_role, note) in PRIOR_RULINGS.items():
@@ -408,7 +408,7 @@ def derive_functional_benefic_malefic(
"profile_source": profile_source,
"lagna_lord": SIGN_LORDS[asc_sign],
"yogakaraka_definition": "distinct lordships: one of 4/7/10 and one of 5/9",
"rule_reference": "references/functional-role-profile.md",
"rule_reference": "references/product_functional_profile_bphs_v3_166q4.md",
"profile_is_not": PROFILE_IDS[other],
"assertion_label": "parameter_sensitive",
"dual_lordship_note": DUAL_LORDSHIP_NOTE,
+32 -12
View File
@@ -6,9 +6,8 @@ for: the full Technique Audit Table (with the Functional Benefic/Malefic row),
the parameter and method differences, the evidence boundaries, and the
60-division ledger (20 formal traditional divisions + 40 research D-N rows).
产品 2026-11-08(BUG-1810):用户可见文字不出现「联网 / 外部资料 / 外部核验 /
MEVG / 真实案例」这类说法。审计行与证据边界里的外部核验字样不再渲染;后台
packet 的 ``technique_audit_table`` 原样保留,质量门改为检查后台记录仍在。
核验状态只在个人报告计算依据的独立表中显示(BUG-1861)。普通审计行和
证据边界继续过滤后台措辞,packet 的 ``technique_audit_table`` 原样保留。
Everything is read from the packet. Statuses are written as words, never as
internal codes, so the ordinary projection keeps the chapter.
@@ -37,13 +36,11 @@ LEDGER_HEADING = {
REQUIRED_ROWS = ("Functional Benefic/Malefic",)
# 原值:这三行都渲染,缺哪行就补哪行
# 新值:后两行不再渲染(后台 packet 保留);原因:产品负责人 2026-11-08:用户可见文字不出现联网/外部核验字样
HIDDEN_TECHNIQUES = ("MEVG / Global Web Evidence", "Real Case Calibration")
VERIFICATION_LABELS = {
"MEVG / Global Web Evidence": ("网上资料核对", "Online sources check"),
"Real Case Calibration": ("真实案例校准", "Real-case calibration"),
}
NO_WEB_WORDS = ("联网", "外部资料", "外部核验", "MEVG", "真实案例", "Real Case", "Global Web")
VERIFICATION_LIMIT_LINE = "本次未完成外部资料与案例核验,候选窗口尚未据此确认。"
VERIFICATION_LIMIT_LINE_EN = (
"This reading did not complete external-source or real-case verification; "
"candidate windows have not been confirmed on that basis."
)
WEB_WORDING = re.compile("|".join(re.escape(word) for word in NO_WEB_WORDS), re.IGNORECASE)
AUDIT_CLAUSE = re.compile(r"[^。;;]+[。;;]?")
BODIES = ("Ascendant", "Sun", "Moon", "Mars", "Mercury", "Jupiter", "Venus", "Saturn", "Rahu", "Ketu")
@@ -282,8 +279,8 @@ def _audit_rows(packet: dict, language: str) -> list[tuple[str, str, str, str]]:
continue
name = str(row["technique"])
seen.add(name)
if name in HIDDEN_TECHNIQUES:
# 产品负责人 2026-11-08:这两行只在后台记录里保留,不渲染给用户。
if name in VERIFICATION_LABELS:
# The original audit names and notes stay in the packet.
continue
if name == "Functional Benefic/Malefic":
note = _functional_note(functional, language) if functional else _clean(row.get("note"), language)
@@ -325,6 +322,28 @@ def _table(header: tuple[str, ...], rows: list[tuple[str, ...]]) -> list[str]:
return lines
def _verification_table(packet: dict, language: str) -> list[str]:
en = language == "en"
status_by_technique = {}
table = packet.get("technique_audit_table")
for row in table if isinstance(table, list) else []:
if isinstance(row, dict) and str(row.get("technique")) in VERIFICATION_LABELS:
status_by_technique[row["technique"]] = str(row.get("calculation_status") or row.get("status") or "").strip().lower()
lines = ["| Verification item | Status |" if en else "| 核验项目 | 状态 |", "| ------ | ------ |"]
for technique, labels in VERIFICATION_LABELS.items():
state = status_by_technique.get(technique)
if state in ("used", "executed", "complete", "completed", "verified", "official_verified"):
status = "Completed" if en else "已完成"
elif state in ("partial", "partial_verified"):
status = "Partially completed" if en else "部分完成"
elif state == "not_applicable":
status = "Not applicable" if en else "不适用"
else:
status = "Not completed" if en else "未完成"
lines.append(f"| {labels[int(en)]} | {status} |")
return lines
def _functional_table(packet: dict, language: str) -> list[str]:
functional = _dict(_dict(_dict(packet.get("worksheets")).get("strengths_and_scores")).get("functional_benefic_malefic"))
if not functional:
@@ -551,7 +570,8 @@ def render_audit_chapters(packet: dict, language: str) -> str:
"",
*_table(("Technique", "Status", "Source", "Audit note") if en else ("技法", "状态", "依据来源", "审计说明"),
_audit_rows(packet, language)),
f"| — | — | — | {VERIFICATION_LIMIT_LINE_EN if en else VERIFICATION_LIMIT_LINE} |",
"",
*_verification_table(packet, language),
"",
*_functional_table(packet, language),
]
@@ -0,0 +1,60 @@
"""Report and product BPHS provenance and the selected profile."""
from hashlib import sha256
from pathlib import Path
import pytest
from scripts.functional_benefics import derive_functional_benefic_malefic
from scripts.report_render.audit_chapters import render_audit_chapters
from tests.test_reading_facts_v3_20261112 import _reading_facts, _reading_request, public_report
ROOT = Path(__file__).resolve().parents[1]
PRODUCT_PROFILE_PATH = "references/product_functional_profile_bphs_v3_166q4.md"
def test_upstream_profile_retains_exact_source_bytes():
source = ROOT / "references/functional-role-profile.md"
# yinduzhanxing 8aaf60991c32a84ac30d6d7b6a62c4f166507bce.
assert sha256(source.read_bytes()).hexdigest() == "95f5445a197a5f49ebaa08431816f0f3583b0a3c13f7967d3c043cecfe63aa7e"
product = (ROOT / PRODUCT_PROFILE_PATH).read_text(encoding="utf-8")
assert "bphs_ch34_general_with_sign_exceptions_v3_166q4" in product
assert "Revision v3" in product and "Chart page layout (issue #163)" in product
@pytest.mark.parametrize(("ascendant", "role"), [
("Aries", "malefic"), ("Taurus", "benefic"), ("Gemini", "mixed"),
("Cancer", "malefic"), ("Leo", "malefic"), ("Virgo", "mixed"),
("Libra", "benefic"), ("Scorpio", "malefic"), ("Sagittarius", "malefic"),
("Capricorn", "benefic"), ("Aquarius", "benefic"), ("Pisces", "malefic"),
])
def test_product_bphs_saturn_table_is_unchanged(ascendant, role):
result = derive_functional_benefic_malefic(ascendant, functional_profile="bphs_exception_profile")
group = "neutral" if role == "mixed" else role
assert "Saturn" in result[f"functional_{group}s"]
if role == "mixed":
assert "mixed" in result["ambiguous_cell_notes"]["Saturn"]["summary_en"]
assert result["profile"] == "bphs_ch34_general_with_sign_exceptions_v3_166q4"
assert result["rule_reference"] == PRODUCT_PROFILE_PATH
assert PRODUCT_PROFILE_PATH in result["profile_source"]
def test_report_functional_profile_follows_packet(public_report):
_, body, reading, packet = public_report
assert _reading_facts(packet, reading, **_reading_request(body))["functional"]["functional_profile"] == "pvr_table30_v1"
def test_personal_appendix_reports_only_recorded_verification_status():
packet = {"technique_audit_table": [
{"technique": "MEVG / Global Web Evidence", "status": "blocked", "note": "internal"},
{"technique": "Real Case Calibration", "calculation_status": "partial", "status": "executed"},
]}
zh = render_audit_chapters(packet, "zh")
assert "| 网上资料核对 | 未完成 |" in zh
assert "| 真实案例校准 | 部分完成 |" in zh
assert "MEVG" not in zh and "internal" not in zh
packet["technique_audit_table"][0]["status"] = "executed"
assert "| 网上资料核对 | 已完成 |" in render_audit_chapters(packet, "zh")
fallback = render_audit_chapters({}, "zh")
assert "| 网上资料核对 | 未完成 |" in fallback and "| 真实案例校准 | 未完成 |" in fallback
+5 -6
View File
@@ -72,12 +72,11 @@ def test_audit_chapter_keeps_required_rows_differences_boundaries_and_ledger() -
assert "| Functional Benefic/Malefic |" in zh
assert "MEVG" not in zh
assert "Real Case" not in zh
# 原值:全文没有「外部资料」。新值:只放行表尾的固定说明行。
# 原因:2026-11-11 固定核验说明(BUG-1837)。
limit = "| — | — | — | 本次未完成外部资料与案例核验,候选窗口尚未据此确认。 |"
assert zh.count(limit) == 1
assert "外部资料" not in zh.replace(limit, "", 1)
assert "真实案例" not in zh
assert "| 网上资料核对 | 未完成 |" in zh
case_row = "| 真实案例校准 | 未完成 |"
assert zh.count(case_row) == 1
assert "外部资料" not in zh
assert "真实案例" not in zh.replace(case_row, "", 1)
# Functional vs natural conflicts are stated, not only the role lists.
assert "| 土星 | 自然凶 | Yogakaraka | 9, 10 | 冲突,降一级置信度 |" in zh
# Parameter-sensitive rows and the Narayana method conflict.
+11 -18
View File
@@ -1,7 +1,4 @@
"""产品负责人 2026-11-08(BUG-1810):报告渲染不出现联网/外部核验字样,后台记录保留。
只有技法审计表末行可显示固定核验说明。表中其他内容不显示联网措辞,后台记录保留。
"""
"""Verification wording is confined to the personal-report appendix."""
from __future__ import annotations
@@ -9,27 +6,23 @@ from itertools import takewhile
from scripts.full_report_quality_gate import BACKSTAGE_TECHNIQUE_AUDIT_ROWS
from scripts.report_render.audit_chapters import (
AUDIT_TABLE_HEADING,
NO_WEB_WORDS,
VERIFICATION_LIMIT_LINE,
VERIFICATION_LIMIT_LINE_EN,
render_audit_chapters,
)
from tests.test_report_audit_chapters_20261107 import _packet
def _assert_clean(text: str, language: str, where: str) -> None:
# 原值:在全文检查禁词。
# 新值:先核对固定说明只出现一次且位于技法审计表末行,再检查其余全文。
# 原因:2026-11-11 的说明行及英文版补充(BUG-1837)。
limit = VERIFICATION_LIMIT_LINE_EN if language == "en" else VERIFICATION_LIMIT_LINE
row = f"| — | — | — | {limit} |"
assert text.count(limit) == 1, where
_, heading, tail = text.partition(f"\n### {AUDIT_TABLE_HEADING[language]}\n")
assert heading, where
rows = list(takewhile(lambda line: line.startswith("|"), tail.lstrip("\n").splitlines()))
assert rows and rows[-1] == row, where
remainder = "\n".join(line for line in text.splitlines() if line != row).casefold()
header = "| Verification item | Status |" if language == "en" else "| 核验项目 | 状态 |"
first, second = (("Online sources check", "Real-case calibration") if language == "en"
else ("网上资料核对", "真实案例校准"))
lines = text.splitlines()
assert lines.count(header) == 1, where
start = lines.index(header)
table = list(takewhile(lambda line: line.startswith("|"), lines[start:]))
assert len(table) == 4, where
assert table[2].startswith(f"| {first} | ") and table[3].startswith(f"| {second} | "), where
remainder = "\n".join(lines[:start] + lines[start + len(table):]).casefold()
for word in NO_WEB_WORDS:
assert word.casefold() not in remainder, f"{where} 里出现了「{word}」"
@@ -7,7 +7,7 @@ import pytest
from scripts.pl9_full_data_export import _sanitize_pl9_ai_density_markdown
from scripts.pl9_reader_export import _sanitize_pl9_public_markdown
from scripts.report_render.audit_chapters import STATUS, VERIFICATION_LIMIT_LINE, render_audit_chapters
from scripts.report_render.audit_chapters import STATUS, render_audit_chapters
from tests.public_chart_reports import PUBLIC_REPORT_CASES, public_chart_reports
from tests.test_report_audit_chapters_20261107 import _packet
from tests.test_report_no_web_wording_20261109 import _assert_clean
@@ -41,7 +41,8 @@ def test_audit_filter_preserves_other_clauses_and_uses_empty_cell_marker() -> No
def test_chinese_limit_line_matches_consult_literal() -> None:
frontend = Path(__file__).resolve().parents[1] / "frontend/src/lib/consult-answer-basis.ts"
match = re.search(r'CONSULT_VERIFICATION_LIMIT_LINE\s*=\s*"([^"]+)"', frontend.read_text(encoding="utf-8"))
assert match and VERIFICATION_LIMIT_LINE == match[1]
assert match and match[1] == "本次未完成外部资料与案例核验,候选窗口尚未据此确认。"
assert match[1] not in render_audit_chapters(_packet(), "zh")
def test_both_reader_paths_translate_status_words_without_changing_field_keys_or_code() -> None: