Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f45759737 |
@@ -26261,29 +26261,3 @@
|
||||
- 验证与防复发:合成用例覆盖线前线后、整分钟边界、原始范围边界和短段回退。原生引擎分别重算两侧六盘,并验证重复请求与另一版采用时刻。见 [#306 进度](tasks/PROGRESS-rect-self-choice-nearest-minute-20261117.md)。
|
||||
- 关联记录:#306、#301、BUG-1936、BUG-1872。
|
||||
- 修复版本:`codex/rect-self-choice-nearest-minute-20261117`,待独立验收。
|
||||
|
||||
## BUG-1954 | 占星师 2026-11-17 对问答数据口径的裁定落地:D2 不再给十二宫行,三个辅助点参与,汇合段补状态
|
||||
|
||||
- 状态:fixed-pending-verify(未推送)。
|
||||
- 首次发现 / 最近更新:2026-11-17 / 2026-11-17。
|
||||
- 触发与现象:占星师 2026-11-17 回复十个问题,其中三处纠正或放开了此前上线的做法。(一)BUG-1944 / 1945 的关键项块给 D2 列了十二宫行(某宫的星座、宫内星、宫主、宫主落宫),依据句也这样写;她裁定两座 Hora 的 D2 不能套通用十二宫财富解读。(二)BUG-1943 留下的矛盾:健康卡的 Gulika、Maandi 和财富卡的 Indu Lagna 在路线表和特殊点里有数值,参与表却标 blocked;她裁定这三项条件参与、作辅助层。(三)多套大运汇合的补充段要给各系统的真实周期与端点、计算状态和共享依赖,无有效输入的体系不计入。
|
||||
- 触发条件:任何讲盘的聊天提问;财富、健康题最明显。
|
||||
- 根因:(一)关键项块对所有分盘用同一个「按整宫读本领域各宫」的写法,没有区分构造;产品算的 D2 是两座 Hora 映射(只落狮子、巨蟹两座)。(二)参与表按「`references/` 的清单是否列出」来标 blocked,她明确说这不是不适用的理由。(三)BUG-1943 做汇合段时只带了触到哪一宫和当前主星。
|
||||
- 修复:(一)`consultation-evidence-card.ts`:D2 改为给构造名与出处、15° 分界、上升和九颗星各自的本命星座与度数、所在 Hora、离 15° 分界的度数,以及一句只供判断的说明;依据句里 D2 写成各 Hora 里有哪些星、哪些离分界不到 1 度;其余分盘每项加 `construction`(规则与出处),写不出构造的分盘不给宫位行。(二)`consult_card_domain_facts.py`:三行改为辅助层,记录位置、辅助状态、敏感性、规则是否有来源、Gulika / Maandi 的方法说明,边界只写在一句标着「只给你判断用,字眼不进回答」的话里;关键项块不收辅助层。(三)汇合段各系统加计算状态、小运起止,每一宫列出触到它的已执行体系和其中依据同源的体系;未执行体系的触发行不列;等级、概率、「强信号」仍不带,也没有加旧启发区。
|
||||
- 没有做的:财富题判断表里每颗星的 `domain_varga_house` 仍是 D2 的整宫位(BUG-1907 加的,在这次范围之外);Vighati、第 64 个 Navamsa、Pranapada、D5 等同类 blocked 项没有放开;「部分核验」的核验对象在到达取数卡的两处数据里没有写,对照表没有改;汇合段缺「相互冲突」和大运层端点(数据包里没有)。各分盘按宫位读的解释规则出处没有逐张核对。
|
||||
- 验证与防复发:`tests/test_consult_qa_rulings_1954.py` 四条、`frontend/tests/consult-qa-rulings-1954.test.ts` 四条;三处被钉住的断言按原值、新值、原因更新。公开测试盘:财富关键项块的 D2 从六个宫位行变成十个 Hora 归属行(上升离分界 0.06 度),依据句相应改写;健康卡 Gulika、Mandi 和财富卡 Indu 的参与行从 blocked 变成带位置和说明的辅助行。未调用模型,没有验证回答怎么用这些改动。
|
||||
- 关联记录:BUG-1943、BUG-1944、BUG-1945、BUG-1907。
|
||||
- 修复版本:`claude/qa-rulings-1954`,未推送。
|
||||
|
||||
## BUG-1955 | 财富题判断表仍把 D2 的整宫位交给模型;个人报告解读材料同样,并把三个辅助点读成主要依据
|
||||
|
||||
- 状态:fixed-pending-verify(未推送)。
|
||||
- 首次发现 / 最近更新:2026-11-17 / 2026-11-17。
|
||||
- 触发与现象:BUG-1954 把关键项块里的 D2 改成了两座 Hora 的归属,但财富题判断表每颗星还带 `domain_varga_house`,值是 D2 里从分盘上升按整宫数出的宫位,并且落 6 / 8 / 12 宫时记一条受冲信号。个人报告的解读材料里 `varga_charts.D2` 和 `planets_in_varga` 也是同样的宫位。另外,BUG-1954 之后个人报告解读材料把 Gulika、Maandi、Indu Lagna 读成了主要依据,三条已有测试在 staging 上失败。
|
||||
- 触发条件:财富类聊天提问;个人报告的财富部分;个人报告的健康、财富参与表。
|
||||
- 根因:BUG-1907 给所有领域分盘统一补了整宫位,没有区分构造;产品算的 D2 是两座 Hora 映射,占星师 2026-11-17 Q8 裁定这种 D2 没有被认可的十二宫读法。BUG-1954 只改了关键项块,并且改领域事实时没有跑读同一份事实的个人报告测试。
|
||||
- 修复:`scripts/consult_card_domain_facts.py` 对 D2 给 `domain_varga_hora` / `domain_varga_horas`(照数据包里 D2 的落座读太阳或月亮 Hora,带核对),不再给宫位;`frontend/src/lib/consultation-judgment-table.ts` 判断表行改带 Hora,第 5 类受冲信号对 D2 不算,旧事实里的 D2 宫位在组表时去掉;`scripts/report_render/reading_facts.py` 的 D2 给 Hora 不给宫位,三个辅助点记为辅助层并带位置记录(不带经度键,不带只给聊天用的分析说明)。其余领域分盘都是十二座的具名分法,没有改。提示词和检查清单里没有要求读「D2 第几宫」的句子,没有改文字。
|
||||
- 没有做的(留给产品负责人):年度报告财富部分的「D2 上升主在第几宫」、个人报告导出的 D2「整宫宫位」表和开头导读分盘表、星盘页 D2 表的宫位列,都是用户可见的版面或文案。
|
||||
- 验证与防复发:`tests/test_d2_hora_leftovers_1955.py` 三条、`frontend/tests/consult-d2-hora-leftovers-1955.test.ts` 三条;`tests/test_reading_facts_v3_20261112.py` 与 `tests/test_reading_status_axes_20261112.py` 被钉住的断言按原值、新值、原因更新。公开测试盘财富题判断表改前改后已对比。没有调用模型。
|
||||
- 关联记录:BUG-1907、BUG-1954、BUG-1852。
|
||||
- 修复版本:`claude/d2-house-leftovers-1955`,未推送。
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
# 生时纠正 P0 聚合统计 v3:补占星师指出的覆盖缺口(2026-11-17,Claude)
|
||||
|
||||
Bug 编号:BUG-1957。关联 BUG-1931(#296)、BUG-1890、BUG-1936。
|
||||
|
||||
## 背景
|
||||
|
||||
占星师 11-17 审了 `docs/operations/rect-p0-aggregate-20261116-v2.sql`:允许负责人拿它在生产库做一次内部只读摸底,但不能用它证明「旧产物已清零」,因为有几类情况它数不到。本单出 v3,把这些情况数出来,并补齐测试。**v2 文件不动**(负责人可能已按 v2 执行过,要能对照)。
|
||||
|
||||
新文件:`docs/operations/rect-p0-aggregate-20261117-v3.sql`,从 v2 复制后修改。沿用 v2 的全部约束:`repeatable read read only` 事务、固定词表、不输出任何个人明细、0 可见、1–4 屏蔽、各 feature 可重叠不可相加。
|
||||
|
||||
## 一、要补的统计
|
||||
|
||||
每项都作为独立的输出段(`section` 名固定,写进文件头注释),互相可重叠:
|
||||
|
||||
1. **有当前来源但没有历史回执的主体**(`provenance_without_history`):`active_birth_provenance` 非空(或 `birth_time_status in ('accepted','confirmed')` 且有 `active_birth_time`),但 `chart_choice_records` 里没有这个主体的任何记录。v2 的 `historical_subjects` 只从 `chart_choice_records` 出发,这类主体不在里面。再按「该主体名下是否有现存报告/年运/合盘」分两组计数。
|
||||
2. **主体已删除但产物还在**(`artifacts_without_subject`):`personal_reports`(含年运)、完整合盘、旧独立合盘中,`chart_profile_id` 指向已不存在的 `chart_profiles` 行的产物数;按产物类型分组。若外键是 `on delete cascade` 或 `set null`,先查迁移确认实际行为,把结论写进文件头注释和 PROGRESS:级联删除则此项恒为 0 并说明依据;置空则这些产物会被算成「本人」——这种情况要单独数出来(`artifacts_subject_nulled`,若无法区分就写明无法区分,不要猜)。
|
||||
3. **单独的旧选边记录**(`legacy_chart_side`):历史或当前来源是旧版逐条线选边(`chart-choice-v1` 且 `rule`/`decided_by` 为选边而非事件证据、非问卷)的主体数,分「当前仍在用」和「仅历史出现」。**不把它并入 `active_retired`**:是否属于撤回集合由产品和占星师另行冻结,本单只把数给出来。先读 `frontend/src/lib/retired-birth-window.ts::birthWindowRetired` 和 `scripts/chart_choice/service.py`,把「旧选边」对应的字段取值写准,写进注释。
|
||||
4. **新自选**(`self_choice_20261116`):当前来源 `basis = 'self_choice_20261116'` 的主体数,以及历史上出现过的主体数。它不得落入任何旧分类(`explicit_manual_choice`、`active_retired`、旧选边);v3 的分类 `CASE`/条件要显式把它排出去,并有测试。
|
||||
5. **白名单之外的报告**(`reports_outside_whitelist`):`personal_reports` 中报告类型或状态不在 v2 统计白名单里的行数,按(类型是否在白名单、状态是否在白名单)分组,不输出具体类型名以外的任何内容;类型名属于固定词表可以输出,未知类型统一记为 `other`。
|
||||
6. **无主体绑定的旧独立合盘**(`standalone_synastry_unbound`):`synastry_reports` 中 `rules_version` 为空、没有双主体绑定的行数。v2 注释里说这类「无法归因」,v3 要把总量数出来,输出段注明「无法归因到主体,只有总量」。
|
||||
7. 在输出里新增一段 `coverage_notes`(固定文本行,不含数据):列出本脚本**仍然数不到**的东西——浏览器已下载的文件、已交付的聊天正文、已离开服务器的导出。让拿到结果的人不会把「没列出」读成「没有」。
|
||||
|
||||
## 二、执行条件写进文件头
|
||||
|
||||
把占星师要求的运行条件写成文件头注释(不改变 SQL 的事务语句本身):
|
||||
|
||||
- 用受权的只读审计身份执行,并先确认它能看到跨账号的行;普通用户在 RLS 下得到的 0 不是全库的 0;不要为了方便换超级用户。
|
||||
- 执行前核对生产 schema、字段和状态枚举与脚本基线一致;记录脚本 sha256、数据库迁移版本、执行时间、审计身份的可见范围。
|
||||
- 由执行工具设置 `statement_timeout`、`lock_timeout`、`idle_in_transaction_session_timeout`(给出示例 `set local` 语句,放在注释里);超时或出错即回滚并断开,不自动重试。
|
||||
- 结果仅限内部审核;`has_any` 会暴露「是否存在少量记录」,不是匿名数据。
|
||||
- 本脚本的任何结果都不能作为自动批量撤回的依据,`has_any = no` 不证明旧产物已安全。
|
||||
|
||||
## 三、测试
|
||||
|
||||
新文件 `frontend/tests/rectification-p0-aggregate-v3-20261117.test.ts`,沿用 v2 测试的建库方式和夹具写法(全部合成数据)。v2 的测试文件不动、照旧通过。
|
||||
|
||||
每个新增输出段至少一条命中和一条不命中,另加占星师点名的边界:
|
||||
|
||||
- `role = 'other'` 的主体(v2 测试主要是本人档案):每个新增段都要有 other 主体的用例。
|
||||
- 合盘:任一侧命中、双方同时命中只计一次。
|
||||
- 错误绑定:回执的 `user_id` 与主体所有者不同、`record_id` 指向别人的记录——不得被算成有效回执。
|
||||
- 空库:所有段输出 0,不报错,`coverage_notes` 照常输出。
|
||||
- 来源撤回但时刻不变:分类跟随来源,不跟随时刻。
|
||||
- 无回执、主体已删除两类边界(对应第一节 1、2)。
|
||||
- 新自选不落入任何旧分类(第一节 4)。
|
||||
- 屏蔽规则对新增段同样生效(1–4 屏蔽、0 可见)。
|
||||
|
||||
**这些是需要 PostgreSQL 的测试。** 本机 Docker 不可用时现有写法会跳过。PROGRESS 里必须写明:哪次运行真正连了数据库、跑了几条、结果如何(staging 质量门里跑到的也算,写明 run 号);没有真正跑过的写「未执行」,不把跳过写成通过。
|
||||
|
||||
## 四、文档
|
||||
|
||||
- `docs/BUG_HISTORY.md` 新增 BUG-1957(只在自己那一节内编辑;不写姓名、出生资料、邮箱、ID)。
|
||||
- `CHANGELOG.md` 一行;`docs/tasks/PROGRESS-rect-p0-aggregate-v3-20261117.md`,含 v2→v3 的输出段对照表,和第一节第 2 项的外键行为结论。
|
||||
- `docs/research/rect-p0-artifact-checklist-20261116.md` 不改(BUG-1956 那一单会追加),避免冲突。
|
||||
|
||||
## 五、不做的事
|
||||
|
||||
- 不连接、不查询任何生产或 staging 的真实数据;不写任何会修改数据的语句。
|
||||
- 不改 v2 的 SQL 和测试;不改应用代码、迁移、`scripts/`。
|
||||
- 不把任何一类自动并入「应撤回」。
|
||||
|
||||
## 验收
|
||||
|
||||
- `PATH=<venv>/bin:$PATH python scripts/run_quality_gate.py --profile quick --skip-frontend-runtime` 通过;
|
||||
- `cd frontend && npx eslint .` 0 错误;v2、v3 两个测试文件在有数据库的环境里全部通过(验收看 staging 质量门的记录);
|
||||
- diff 只含新 SQL、新测试、文档。
|
||||
@@ -50,10 +50,6 @@ export const EVIDENCE_CARD_LABELS = {
|
||||
// BUG-1945 原值:「……下判断前先看完下面各项,正文的判断要有其中的依据,用到的项连同盘面值写进「判断依据」。」
|
||||
// 新值:去掉「正文的判断要有其中的依据」;原因:这半句把各张盘的落点带进正文,8 个回答里 3 个的正文写了盘的类别名。
|
||||
keyFacts: "路线的必看项和盘面值(分析用,这句话的字眼不进回答):下判断前先看完下面各项,用到的项连同盘面值写进「判断依据」。",
|
||||
/**
|
||||
* BUG-1954 (her Q8): what the D2 rows are and are not. Analysis-only.
|
||||
*/
|
||||
keyFactsHoraNote: "(只给你判断用,字眼不进回答)D2 这里只有两座 Hora 的归属,没有十二宫;别的 Hora 分法落点不同,这张卡没有算",
|
||||
/** BUG-1945: the opening of the computed line that restates the block's items as relations. */
|
||||
keyFactsReading: "依据(分析用,字眼不进回答):",
|
||||
/**
|
||||
@@ -3238,82 +3234,10 @@ const KEY_FACT_PARTICIPATION_ID: Partial<Record<EvidenceCardRouteItem, string>>
|
||||
Indu_Lagna: "Indu", Sree_Lagna: "Sree", Gulika: "Gulika", Maandi: "Mandi",
|
||||
};
|
||||
|
||||
const SHODASA_SOURCE = "references/shodasavarga-complete-guide.md 分盘表(BPHS 第 6–8 章)";
|
||||
const PVR_VARGA_SOURCE = "PVR《Integrated Approach》§6.2.5–6.2.11";
|
||||
|
||||
/**
|
||||
* BUG-1954 (占星师 2026-11-17 问答数据口径 Q8): every varga in the key block states the
|
||||
* construction the engine computes (scripts/varga.py `varga_map`) and where it is written
|
||||
* down. The rule words are the reference table's own. A varga with no entry here gets no
|
||||
* house rows.
|
||||
*/
|
||||
export const KEY_FACT_VARGA_CONSTRUCTION: Readonly<Record<string, { rule: string; source: string }>> = {
|
||||
D2: { rule: "两座 Hora 分法:奇数星座前 15° 为太阳 Hora、后 15° 为月亮 Hora,偶数星座相反", source: `${SHODASA_SOURCE};PVR p64 给出这一分法,没有给完整用法` },
|
||||
D3: { rule: "三段依次为本星座、第 5、第 9 星座", source: SHODASA_SOURCE },
|
||||
D4: { rule: "四段依次为本星座、第 4、第 7、第 10 星座", source: SHODASA_SOURCE },
|
||||
D5: { rule: "奇数星座五段依次为白羊、水瓶、射手、双子、天秤,偶数星座依次为金牛、处女、双鱼、摩羯、天蝎", source: PVR_VARGA_SOURCE },
|
||||
D6: { rule: "奇数星座从白羊起,偶数星座从天秤起", source: PVR_VARGA_SOURCE },
|
||||
D7: { rule: "奇数星座从本星座起,偶数星座从第 7 起", source: SHODASA_SOURCE },
|
||||
D8: { rule: "本位星座从白羊起,固定星座从射手起,变动星座从狮子起", source: PVR_VARGA_SOURCE },
|
||||
D9: { rule: "本位星座从本星座起,固定星座从第 9 起,变动星座从第 5 起", source: SHODASA_SOURCE },
|
||||
D10: { rule: "奇数星座从本星座起,偶数星座从第 9 起", source: SHODASA_SOURCE },
|
||||
D11: { rule: "从白羊逆数到本星座定起点,再顺排十一份", source: PVR_VARGA_SOURCE },
|
||||
D12: { rule: "从本星座顺序起算", source: SHODASA_SOURCE },
|
||||
D24: { rule: "奇数星座从狮子起,偶数星座从巨蟹起", source: SHODASA_SOURCE },
|
||||
D30: { rule: "不等分五段,奇数星座与偶数星座的区间相反", source: SHODASA_SOURCE },
|
||||
};
|
||||
|
||||
export const KEY_FACT_HORA_BOUNDARY_DEGREES = 15;
|
||||
|
||||
/**
|
||||
* D2 under the two-Hora mapping: the method, each body's own longitude against the 15°
|
||||
* boundary, and which Hora it falls in. No twelve-house rows: a computed coordinate is not
|
||||
* an accepted reading under this construction (her Q8). The Hora is read off the engine's
|
||||
* D2 sign (Leo = Sun's Hora, Cancer = Moon's Hora); nothing is recomputed.
|
||||
*/
|
||||
function keyFactHora(
|
||||
varga: { lagna?: unknown; planets?: unknown } | undefined,
|
||||
natal: { ascendant?: unknown; planets?: unknown },
|
||||
): JsonRecord | undefined {
|
||||
const d2Planets = record(varga?.planets);
|
||||
const horaOf = (sign: unknown) => (sign === "Leo" ? "Sun" : sign === "Cancer" ? "Moon" : undefined);
|
||||
const row = (hora: string | undefined, source: unknown): JsonRecord | undefined => {
|
||||
const body = record(source);
|
||||
const degree = typeof body.degree_in_sign === "number" ? body.degree_in_sign : undefined;
|
||||
if (!hora || typeof body.sign !== "string" || degree === undefined) return undefined;
|
||||
return {
|
||||
sign: body.sign,
|
||||
degree_in_sign: degree,
|
||||
hora,
|
||||
// Distance to the 15° line. The Hora does not change at a sign's ends: an odd sign ends in
|
||||
// the Moon's Hora and the next sign begins in it, and likewise for the Sun's.
|
||||
degrees_to_hora_change: Number(Math.abs(degree - KEY_FACT_HORA_BOUNDARY_DEGREES).toFixed(4)),
|
||||
};
|
||||
};
|
||||
const bodies: JsonRecord = {};
|
||||
const lagna = row(horaOf(varga?.lagna), natal.ascendant);
|
||||
if (lagna) bodies.Ascendant = lagna;
|
||||
for (const [name, sign] of Object.entries(d2Planets)) {
|
||||
const hit = row(horaOf(sign), record(natal.planets)[name]);
|
||||
if (hit) bodies[name] = hit;
|
||||
}
|
||||
if (!Object.keys(bodies).length) return undefined;
|
||||
return {
|
||||
construction: KEY_FACT_VARGA_CONSTRUCTION.D2!,
|
||||
hora_boundary_degrees: KEY_FACT_HORA_BOUNDARY_DEGREES,
|
||||
bodies,
|
||||
method_note: EVIDENCE_CARD_LABELS.keyFactsHoraNote,
|
||||
};
|
||||
}
|
||||
|
||||
function keyFactVarga(
|
||||
code: string,
|
||||
varga: { lagna?: unknown; planets?: unknown } | undefined,
|
||||
houses: readonly number[],
|
||||
): JsonRecord | undefined {
|
||||
const construction = KEY_FACT_VARGA_CONSTRUCTION[code];
|
||||
// A construction the product cannot name gets no house rows (her Q8).
|
||||
if (!construction) return undefined;
|
||||
const lagna = typeof varga?.lagna === "string" ? varga.lagna : undefined;
|
||||
const planets = record(varga?.planets);
|
||||
const start = lagna ? ZODIAC_SIGNS.indexOf(lagna as (typeof ZODIAC_SIGNS)[number]) : -1;
|
||||
@@ -3332,7 +3256,7 @@ function keyFactVarga(
|
||||
...(lordSign && lordAt >= 0 ? { lord_sign: lordSign, lord_house: ((lordAt - start + 12) % 12) + 1 } : {}),
|
||||
};
|
||||
}
|
||||
return { construction, lagna, houses: rows };
|
||||
return { lagna, houses: rows };
|
||||
}
|
||||
|
||||
export const KEY_FACTS_READING_LIMIT = 620;
|
||||
@@ -3354,17 +3278,7 @@ function keyFactsReading(items: JsonRecord, houses: readonly number[]): string |
|
||||
const text = (value: unknown) => (typeof value === "string" ? value : "");
|
||||
for (const [key, raw] of Object.entries(items)) {
|
||||
const row = record(raw);
|
||||
if (key === "D2" && row.bodies) {
|
||||
const bodies = record(row.bodies);
|
||||
const names = (hora: string) => Object.entries(bodies)
|
||||
.filter(([, item]) => record(item).hora === hora)
|
||||
.map(([name]) => (name === "Ascendant" ? "上升" : planetZh(name)));
|
||||
const close = Object.entries(bodies)
|
||||
.filter(([, item]) => typeof record(item).degrees_to_hora_change === "number" && (record(item).degrees_to_hora_change as number) < 1)
|
||||
.map(([name]) => (name === "Ascendant" ? "上升" : planetZh(name)));
|
||||
clauses.push(`D2 按两座 Hora 分法,太阳 Hora 有${names("Sun").join("、") || "无"},月亮 Hora 有${names("Moon").join("、") || "无"}`
|
||||
+ (close.length ? `,离换 Hora 的分界不到 1 度的有${close.join("、")}` : ""));
|
||||
} else if (/^D\d+$/.test(key)) {
|
||||
if (/^D\d+$/.test(key)) {
|
||||
const table = record(row.houses);
|
||||
for (const h of houses) {
|
||||
const house = record(table[String(h)]);
|
||||
@@ -3417,9 +3331,7 @@ export function evidenceCardKeyFacts(card: EvidenceCard): JsonRecord | undefined
|
||||
const blocked = new Set(
|
||||
(Array.isArray(section.participation) ? section.participation : [])
|
||||
.map((row) => record(row))
|
||||
// BUG-1954: an auxiliary layer (Gulika, Maandi, Indu Lagna after her Q5) is on the card and
|
||||
// in the participation table; the key block lists the route's main items only.
|
||||
.filter((row) => (row.status === "blocked" || record(row.value).interpretation === "supporting") && typeof row.id === "string")
|
||||
.filter((row) => row.status === "blocked" && typeof row.id === "string")
|
||||
.map((row) => row.id as string),
|
||||
);
|
||||
const natalPlanets = record(base.natal.planets);
|
||||
@@ -3450,9 +3362,7 @@ export function evidenceCardKeyFacts(card: EvidenceCard): JsonRecord | undefined
|
||||
planets: Object.fromEntries(Object.entries(record(base.natal.d9.planets)).map(([name, row]) => [name, record(row).d9_sign])),
|
||||
}
|
||||
: record(section.vargas[item]);
|
||||
put(item, item === "D2"
|
||||
? keyFactHora(varga, { ascendant: base.natal.ascendant, planets: natalPlanets })
|
||||
: keyFactVarga(item, varga, rule.houses));
|
||||
put(item, keyFactVarga(varga, rule.houses));
|
||||
continue;
|
||||
}
|
||||
const pada = ROUTE_ARUDHA[item];
|
||||
|
||||
@@ -124,11 +124,7 @@ function afflictionForPlanet(
|
||||
if (debilitated(dignity)) details.push({ signal: 4, via: "d1_dignity", value: dignity as Json });
|
||||
if (leafValue(row.combust) === true) details.push({ signal: 4, via: "combust", value: true });
|
||||
const varga = leaf(row.domain_varga_house);
|
||||
// BUG-1955 (占星师 2026-11-17 Q8): a two-Hora D2 has no house to read, so signal 5 does not
|
||||
// apply to it; it is not an unevaluated layer either.
|
||||
if (row.domain_varga_hora !== undefined) {
|
||||
// no house-based signal for this construction
|
||||
} else if (varga.status === "withheld" || varga.status === "gap" || varga.status === undefined) {
|
||||
if (varga.status === "withheld" || varga.status === "gap" || varga.status === undefined) {
|
||||
unevaluated.push("domain_varga_house");
|
||||
} else if (isLord && typeof varga.value === "number" && DUSTHANA.has(varga.value)) {
|
||||
details.push({ signal: 5, via: "domain_varga_house", value: varga.value });
|
||||
@@ -147,7 +143,6 @@ function afflictionForHouse(number: number, planets: Record<string, unknown>, ho
|
||||
const unevaluated = ["aspected_by"];
|
||||
let vargaKnown = true;
|
||||
for (const name of MALEFIC_BODIES) {
|
||||
if (record(planets[name]).domain_varga_hora !== undefined) continue;
|
||||
const varga = leaf(record(planets[name]).domain_varga_house);
|
||||
if (varga.status !== "value") {
|
||||
vargaKnown = false;
|
||||
@@ -248,9 +243,7 @@ function planetColumns(
|
||||
d9_sign: leaf(row.d9_sign),
|
||||
d9_dignity: leaf(row.d9_dignity),
|
||||
vargottama: vargottama(row),
|
||||
...(row.domain_varga_hora !== undefined
|
||||
? { domain_varga_hora: leaf(row.domain_varga_hora) }
|
||||
: { domain_varga_house: leaf(row.domain_varga_house) }),
|
||||
domain_varga_house: leaf(row.domain_varga_house),
|
||||
aspected_by: leaf(row.aspected_by),
|
||||
aspects_houses: leaf(row.aspects_houses),
|
||||
relations: relationsFor(planet, planets, houses),
|
||||
@@ -259,27 +252,9 @@ function planetColumns(
|
||||
}
|
||||
|
||||
/** Assemble one domain table from copied facts. Missing leaves stay gaps. */
|
||||
/** Vargas computed as a Hora mapping (two signs): no house is read in them (BUG-1955). */
|
||||
export const JUDGMENT_HORA_VARGAS: readonly string[] = ["D2"];
|
||||
const HORA_VARGA_NO_HOUSE = { status: "not_applicable", check: "hora_varga" } as const;
|
||||
|
||||
/**
|
||||
* Facts saved before BUG-1955 carry a whole-sign house for a D2 domain varga and no Hora.
|
||||
* That house is dropped here, so an old snapshot cannot put it back in front of the model.
|
||||
*/
|
||||
function withoutHoraVargaHouse(planets: Record<string, unknown>, domainVarga: unknown): Record<string, unknown> {
|
||||
if (typeof domainVarga !== "string" || !JUDGMENT_HORA_VARGAS.includes(domainVarga)) return planets;
|
||||
return Object.fromEntries(Object.entries(planets).map(([name, value]) => {
|
||||
const row = record(value);
|
||||
if (row.domain_varga_hora !== undefined) return [name, value];
|
||||
const rest = Object.fromEntries(Object.entries(row).filter(([key]) => key !== "domain_varga_house"));
|
||||
return [name, { ...rest, domain_varga_hora: HORA_VARGA_NO_HOUSE }];
|
||||
}));
|
||||
}
|
||||
|
||||
export function assembleJudgmentTable(facts: unknown): JsonRecord {
|
||||
const body = record(facts);
|
||||
const planets = withoutHoraVargaHouse(record(body.planets), body.domain_varga);
|
||||
const planets = record(body.planets);
|
||||
const houses = record(body.houses);
|
||||
const domain = typeof body.domain === "string" ? body.domain : "";
|
||||
const rows: Json[] = [];
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
// BUG-1955 (占星师 2026-11-17 问答数据口径 Q8, follow-up of BUG-1907 / BUG-1954): when a domain's
|
||||
// varga is the two-Hora D2, the judgment table gives each planet's Hora and reads no house there.
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import {
|
||||
assembleJudgmentTable,
|
||||
JUDGMENT_HORA_VARGAS,
|
||||
judgmentTableModelView,
|
||||
} from "../src/lib/consultation-judgment-table.ts";
|
||||
|
||||
type Json = Record<string, unknown>;
|
||||
const leaf = (value: unknown) => ({ status: "value", value, check: "path", path: "worksheets.x" });
|
||||
|
||||
function facts(domainVarga: string, saturn: Json, rahu: Json = {}): Json {
|
||||
return {
|
||||
domain: "wealth",
|
||||
domain_varga: domainVarga,
|
||||
houses: { "2": { lord: leaf("Saturn"), sign: leaf("Aries"), occupants: leaf([]) } },
|
||||
factors: [
|
||||
{ id: "lord:2", kind: "planet", planet: "Saturn", role: "lord", citation: "c" },
|
||||
{ id: "house:2", kind: "house", house: 2, citation: "c" },
|
||||
],
|
||||
planets: {
|
||||
Saturn: { present: true, d1_house: leaf(3), aspected_by: leaf([]), ...saturn },
|
||||
Rahu: { present: true, d1_house: leaf(5), ...rahu },
|
||||
Mars: { present: true, d1_house: leaf(6), ...rahu },
|
||||
Ketu: { present: true, d1_house: leaf(11), ...(rahu.domain_varga_hora ? rahu : { domain_varga_house: leaf(4) }) },
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function rows(value: Json): Json[] {
|
||||
return (judgmentTableModelView(assembleJudgmentTable(value)) as { rows: Json[] }).rows;
|
||||
}
|
||||
|
||||
test("a D2 domain varga gives the Hora and counts no house signal", () => {
|
||||
assert.deepEqual(JUDGMENT_HORA_VARGAS, ["D2"]);
|
||||
const hora = { status: "value", value: "Moon", sign: "Cancer", check: "hora_of_sign", path: "worksheets.x" };
|
||||
const [lord, house] = rows(facts("D2", { domain_varga_hora: hora }, { domain_varga_hora: hora }));
|
||||
// 原值: 行里是 domain_varga_house(D2 里按整宫数出的宫位,落 6/8/12 时记受冲信号 5)
|
||||
// 新值: 行里是 domain_varga_hora(Sun / Moon),不再有 D2 的宫位,也不记信号 5
|
||||
// 原因: 占星师 2026-11-17 Q8:两座 Hora 的 D2 没有被认可的十二宫读法
|
||||
assert.equal(lord.domain_varga_hora, "Moon");
|
||||
assert.equal("domain_varga_house" in lord, false);
|
||||
const affliction = lord.affliction as { details: Json[]; unevaluated: string[] };
|
||||
assert.equal(affliction.details.some((item) => item.signal === 5), false);
|
||||
assert.equal(affliction.unevaluated.includes("domain_varga_house"), false);
|
||||
const houseAffliction = house.affliction as { details: Json[]; unevaluated: string[] };
|
||||
assert.equal(houseAffliction.details.some((item) => item.signal === 5), false);
|
||||
assert.equal(houseAffliction.unevaluated.includes("domain_varga_house"), false);
|
||||
});
|
||||
|
||||
test("facts saved before this change lose their D2 house instead of showing it", () => {
|
||||
const [lord, house] = rows(facts("D2", { domain_varga_house: leaf(8) }, { domain_varga_house: leaf(2) }));
|
||||
assert.equal("domain_varga_house" in lord, false);
|
||||
assert.equal(JSON.stringify(lord).includes("\"signal\":5"), false);
|
||||
assert.equal(JSON.stringify(house).includes("\"signal\":5"), false);
|
||||
});
|
||||
|
||||
test("a varga with a named twelve-sign construction keeps its house and signal five", () => {
|
||||
const [lord, house] = rows(facts("D10", { domain_varga_house: leaf(8) }, { domain_varga_house: leaf(2) }));
|
||||
assert.equal(lord.domain_varga_house, 8);
|
||||
assert.equal("domain_varga_hora" in lord, false);
|
||||
assert.deepEqual(
|
||||
(lord.affliction as { details: Json[] }).details.filter((item) => item.signal === 5),
|
||||
[{ signal: 5, via: "domain_varga_house", value: 8 }],
|
||||
);
|
||||
assert.deepEqual(
|
||||
(house.affliction as { details: Json[] }).details.filter((item) => item.signal === 5),
|
||||
[
|
||||
{ signal: 5, via: "domain_varga_house", value: ["Mars", 2] },
|
||||
{ signal: 5, via: "domain_varga_house", value: ["Rahu", 2] },
|
||||
],
|
||||
);
|
||||
});
|
||||
@@ -231,9 +231,7 @@ test("size: the long-range question keeps contract + card within the card budget
|
||||
const { methodology: _methodology, ...rest } = view;
|
||||
void _methodology;
|
||||
// Same ceiling as consult-evidence-card-v2 (product 2026-10-08 temporary card budget).
|
||||
// 原值: 20_000 / 新值: 21_500(实测 barack_obama/wealth 20,503) / 原因: BUG-1954,占星师 2026-11-17 Q8:
|
||||
// 关键项块里每张分盘写明构造与出处,D2 改给上升和九颗星的 Hora 归属(十行),比原来的宫位行长
|
||||
assert.ok(JSON.stringify(rest).length <= 21_500, `${figure.id}/${domain} contract + card ${JSON.stringify(rest).length}`);
|
||||
assert.ok(JSON.stringify(rest).length <= 20_000, `${figure.id}/${domain} contract + card ${JSON.stringify(rest).length}`);
|
||||
// 原值: 12_000 / 新值: 20_000(与契约 + 卡同一上限) / 原因: 产品 2026-11-07 占星师方案:参数、KP、全部大运、年运精简块、Argala 等上卡
|
||||
assert.ok((state.evidenceCardChars ?? Infinity) <= 20_000, `${figure.id}/${domain} card ${state.evidenceCardChars}`);
|
||||
}
|
||||
|
||||
@@ -34,8 +34,7 @@ function cardFor(workflow: Json, domain: ConsultationDomain): EvidenceCard {
|
||||
}
|
||||
|
||||
// Technique names the line may carry as written; everything else is Chinese.
|
||||
// 原值: 允许的拉丁词不含 Hora;新值: 加 Hora;原因: BUG-1954,D2 按两座 Hora 归属写(占星师 2026-11-17 Q8),技法名照写
|
||||
const ALLOWED_LATIN = /Hora|Karakamsha|Yogi|Sree Lagna|Indu Lagna|Vivah Saham|Putra Saham|Gulika|Maandi|\b(?:D\d+|A\d+|AL|UL|AK|AmK|DK|PK|MK|PiK)\b/g;
|
||||
const ALLOWED_LATIN = /Karakamsha|Yogi|Sree Lagna|Indu Lagna|Vivah Saham|Putra Saham|Gulika|Maandi|\b(?:D\d+|A\d+|AL|UL|AK|AmK|DK|PK|MK|PiK)\b/g;
|
||||
|
||||
test("every domain's line is built by rule from the block: relations only, inside the limit, no guard words", () => {
|
||||
let seen = 0;
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
// BUG-1954 (占星师 2026-11-17 问答数据口径 Q5、Q8): D2 under the two-Hora mapping carries no
|
||||
// twelve-house rows; every varga in the key block names its construction; auxiliary layers stay
|
||||
// out of the key block.
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import test from "node:test";
|
||||
|
||||
import {
|
||||
buildEvidenceCard,
|
||||
EVIDENCE_CARD_LABELS,
|
||||
EVIDENCE_CARD_SPECS,
|
||||
evidenceCardKeyFacts,
|
||||
KEY_FACT_HORA_BOUNDARY_DEGREES,
|
||||
KEY_FACT_VARGA_CONSTRUCTION,
|
||||
type EvidenceCard,
|
||||
} from "../src/lib/consultation-evidence-card.ts";
|
||||
import { consultationDomainIds, type ConsultationDomain } from "../src/lib/consultation-domain-registry.ts";
|
||||
import { participationModelView } from "../src/lib/consultation-judgment-table.ts";
|
||||
import { createConsultationPlan } from "../src/lib/consultation-plan.ts";
|
||||
import {
|
||||
consultationWorkflowResponseSchema,
|
||||
toAgentConsultationContext,
|
||||
toModelOutput,
|
||||
} from "../src/mastra/consultation-workflow.ts";
|
||||
|
||||
type Json = Record<string, unknown>;
|
||||
const golden = JSON.parse(readFileSync(
|
||||
new URL("./fixtures/consult-evidence-card-golden.json", import.meta.url),
|
||||
"utf8",
|
||||
)) as { charts: Array<{ id: string; workflow: Json }> };
|
||||
|
||||
function cardFor(workflow: Json, domain: ConsultationDomain): EvidenceCard {
|
||||
const context = toAgentConsultationContext(consultationWorkflowResponseSchema.parse(structuredClone(workflow)));
|
||||
const packet = toModelOutput(context, createConsultationPlan({ userIntent: "q", theme: domain }), domain);
|
||||
return buildEvidenceCard([{ domain, packet, context }]);
|
||||
}
|
||||
const ODD = new Set(["Aries", "Gemini", "Leo", "Libra", "Sagittarius", "Aquarius"]);
|
||||
|
||||
test("D2 gives the method, each body's longitude against 15° and its Hora; no house rows", () => {
|
||||
for (const chart of golden.charts) {
|
||||
const card = cardFor(chart.workflow, "wealth");
|
||||
const block = evidenceCardKeyFacts(card)!.wealth as { reading: string; items: Record<string, Json> };
|
||||
const d2 = block.items.D2 as { construction: Json; hora_boundary_degrees: number; bodies: Record<string, Json>; method_note: string };
|
||||
// 原值: D2 = { lagna, houses: { "2": { sign, occupants, lord, lord_sign, lord_house }, … } }
|
||||
// 新值: 方法名、15° 分界、每颗星的原经度和所在 Hora;没有十二宫行
|
||||
// 原因: 占星师 2026-11-17 Q8:两座 Hora 不能套通用十二宫财富解读
|
||||
assert.equal("houses" in d2, false, chart.id);
|
||||
assert.equal("lagna" in d2, false, chart.id);
|
||||
assert.deepEqual(d2.construction, KEY_FACT_VARGA_CONSTRUCTION.D2);
|
||||
assert.equal(d2.hora_boundary_degrees, KEY_FACT_HORA_BOUNDARY_DEGREES);
|
||||
assert.equal(d2.method_note, EVIDENCE_CARD_LABELS.keyFactsHoraNote);
|
||||
const natal = card.base.natal.planets as Record<string, { sign: string; degree_in_sign: number }>;
|
||||
for (const [name, raw] of Object.entries(d2.bodies)) {
|
||||
const row = raw as { sign: string; degree_in_sign: number; hora: string; degrees_to_hora_change: number };
|
||||
if (name !== "Ascendant") {
|
||||
assert.equal(row.sign, natal[name]!.sign, `${chart.id} ${name}`);
|
||||
assert.equal(row.degree_in_sign, natal[name]!.degree_in_sign, `${chart.id} ${name}`);
|
||||
}
|
||||
// The Hora the engine's D2 sign states is the one the stated rule gives for this longitude.
|
||||
const firstHalf = row.degree_in_sign < KEY_FACT_HORA_BOUNDARY_DEGREES;
|
||||
assert.equal(row.hora, ODD.has(row.sign) === firstHalf ? "Sun" : "Moon", `${chart.id} ${name}`);
|
||||
assert.equal(row.degrees_to_hora_change, Number(Math.abs(row.degree_in_sign - 15).toFixed(4)));
|
||||
}
|
||||
assert.ok(Object.keys(d2.bodies).length >= 9, chart.id);
|
||||
assert.match(block.reading, /D2 按两座 Hora 分法,太阳 Hora 有[^;]+,月亮 Hora 有/);
|
||||
assert.doesNotMatch(block.reading, /D2 第 \d+ 宫/, chart.id);
|
||||
}
|
||||
});
|
||||
|
||||
test("the Hora note is analysis-only and says what the rows are not", () => {
|
||||
const note = EVIDENCE_CARD_LABELS.keyFactsHoraNote;
|
||||
assert.ok(note.startsWith("(只给你判断用,字眼不进回答)"));
|
||||
assert.match(note, /没有十二宫/);
|
||||
assert.doesNotMatch(note.replace(/D2|Hora/g, ""), /[A-Za-z]/);
|
||||
assert.doesNotMatch(note, /条数|计数|数到/);
|
||||
});
|
||||
|
||||
test("every other varga in a key block names its construction and source; an unnamed one gets no house rows", () => {
|
||||
const used = new Set<string>();
|
||||
for (const domain of consultationDomainIds) {
|
||||
for (const item of EVIDENCE_CARD_SPECS[domain].route) if (/^D\d+$/.test(item) && item !== "D1") used.add(item);
|
||||
}
|
||||
for (const code of used) {
|
||||
const entry = KEY_FACT_VARGA_CONSTRUCTION[code];
|
||||
assert.ok(entry && entry.rule && entry.source, `${code} has a named construction`);
|
||||
}
|
||||
const chart = golden.charts[0]!;
|
||||
for (const domain of consultationDomainIds) {
|
||||
if (domain === "annual" || domain === "timing") continue;
|
||||
const block = (evidenceCardKeyFacts(cardFor(chart.workflow, domain)) ?? {})[domain] as { items: Record<string, Json> } | undefined;
|
||||
for (const [key, item] of Object.entries(block?.items ?? {})) {
|
||||
if (!/^D\d+$/.test(key) || key === "D2") continue;
|
||||
assert.deepEqual((item as Json).construction, KEY_FACT_VARGA_CONSTRUCTION[key], `${domain} ${key}`);
|
||||
assert.ok((item as Json).houses, `${domain} ${key}`);
|
||||
}
|
||||
}
|
||||
const source = readFileSync(new URL("../src/lib/consultation-evidence-card.ts", import.meta.url), "utf8");
|
||||
assert.match(source, /const construction = KEY_FACT_VARGA_CONSTRUCTION\[code\];\n\s+\/\/ A construction the product cannot name gets no house rows \(her Q8\)\.\n\s+if \(!construction\) return undefined;/);
|
||||
});
|
||||
|
||||
test("an auxiliary layer is shown in the participation table and kept out of the key block", () => {
|
||||
const auxiliary = {
|
||||
id: "Indu", status: "value", check: "auxiliary", path: "x", citation: "占星师 2026-11-17 问答数据口径 Q5:条件参与,辅助层",
|
||||
value: { position: { sign: "Gemini", house: 12 }, interpretation: "supporting", sensitivity: "unverified", rule_source: "没有具名规则", analysis_note: "(只给你判断用,字眼不进回答)辅助层:与本领域其他依据同向时才写进判断依据,单独一项不下结论" },
|
||||
};
|
||||
// 原值: 这一行是 { id: "Indu", status: "blocked" },模型只看到「blocked」
|
||||
// 新值: 模型看到位置、supporting、敏感性、规则来源和一句只供判断的边界
|
||||
// 原因: 占星师 2026-11-17 Q5
|
||||
const view = participationModelView([auxiliary]) as Json[];
|
||||
assert.deepEqual(view, [{ id: "Indu", value: auxiliary.value, citation: auxiliary.citation }]);
|
||||
const chart = golden.charts[0]!;
|
||||
const card = cardFor(chart.workflow, "wealth");
|
||||
const section = card.domain_sections.wealth!;
|
||||
section.participation = view as never;
|
||||
const items = (evidenceCardKeyFacts(card)!.wealth as { items: Json }).items;
|
||||
assert.equal(items.Indu_Lagna, undefined);
|
||||
assert.ok(items.Sree_Lagna);
|
||||
// The value itself stays on the card where the route table put it.
|
||||
assert.ok((section.special_points as Json).Indu_Lagna);
|
||||
assert.equal((section.route as Json).Indu_Lagna, "on_card");
|
||||
});
|
||||
@@ -447,7 +447,7 @@ evidence_card.backstage records, for the backend only, that global web evidence
|
||||
- 部署:镜像从 git 构建(`deploy/railway-api.Dockerfile` 的 `COPY references ./references`),数据文件随镜像发布,不需要在服务器上另外放置。
|
||||
- 待占星师确认:只带这两类段落是否够(上游回答还引了「母亲缘分」一类的综合段落,这里没有带);600 字符的截断是否影响她的读法;回答里按书名引用的写法。她不同意的项删掉并改本节。
|
||||
|
||||
## S. 四层已算数据进补充段,Arudha 补充段补 A3(产品 2026-11-16,BUG-1943;占星师 2026-11-17 问答数据口径 Q5、Q6 已裁定,BUG-1954)
|
||||
## S. 四层已算数据进补充段,Arudha 补充段补 A3(产品 2026-11-16,BUG-1943,待占星师确认)
|
||||
<!-- 依据:2026-11-16 用上游技能(8aaf6099)在本地跑同一张公开测试盘,与聊天模型实际拿到的取数卡和补充段逐项对照;产品负责人同日同意先补不需要裁定的几项。 -->
|
||||
|
||||
- 原值:Vimsopaka、Pushkara、Dasha Sandhi、Dasa Convergence 在全量数据包里有计算,聊天模型拿不到。新值:四层各成一个补充段(`vimsopaka`、`pushkara`、`dasha_sandhi`、`dasa_convergence`),模型按需查阅;不上取数卡正文,也没有加读法文字。原因:上游 `full-reading` 的输出带这四层。
|
||||
@@ -455,10 +455,9 @@ evidence_card.backstage records, for the backend only, that global web evidence
|
||||
- Dasa Convergence 只带「哪一宫被哪套大运的哪一层触到」和各套大运当前的主星。引擎自带的等级(L1 到 L5)、系统个数、解读句(例如「双系统激活,强信号」)和概率字段没有带。原因:取数卡的规则是按独立盘面事实计、不按体系个数计(合盘八问裁定里也有「不写票数」);等级本身就是数体系个数。需要她确认:这样裁掉是否合她的用法,还是要把等级带上并另写读法。
|
||||
- Arudha 补充段原来没有 A3(投影白名单漏项),现在 A1 到 A11 和 UL 都在。
|
||||
- 没有动的一项:健康卡的 Gulika、Mandi 和财富卡的 Indu Lagna,卡上既有数值(2026-11-07 的领域路线表),参与表又标 blocked(`references/` 没有写明本领域使用)。需要她裁定这三项在本命健康、财富里用不用:用,就把参与表改成有值并写出处;不用,就从路线表和卡上拿掉。
|
||||
- 她的裁定(2026-11-17,Q6):不把体系个数当独立投票的方向保留。汇合段给每套系统的真实周期与端点、事件类、触发依据、计算状态、相互冲突和共享依赖;没有有效执行输入的体系不计入;L1 到 L5 若进模型输入只能放在单独的 `legacy_heuristic` 区并标明不抬高概率,默认不带旧概率和「强信号」字样。落地(BUG-1954):各系统加计算状态(executed / not_executed / not_applicable);小运带起止;每一宫列出触到它的已执行体系,以及其中依据同源的体系(`shared_basis`,按引擎自己写的 basis 归类);未执行体系的触发行不列。没有加 `legacy_heuristic` 区。数据包里没有「相互冲突」这一项,大运层没有端点,这两处仍缺。
|
||||
- 她的裁定(2026-11-17,Q5):Gulika、Maandi(健康)和 Indu Lagna(财富)条件参与、作辅助层;「references 的清单没有列」不是不适用的理由;每项记录已计算、规则是否有来源、输入与方法是否敏感、支持哪条断言;不能单独据此下结论;只批准证据接入方式,不新增预测公式。落地见 W 节。
|
||||
- 她不同意的项删掉并改本节。
|
||||
|
||||
## T. 各领域路线的关键项集中放在取数结果最前面(产品 2026-11-16,BUG-1944;占星师 2026-11-17 问答数据口径 Q8 已裁定,BUG-1954)
|
||||
## T. 各领域路线的关键项集中放在取数结果最前面(产品 2026-11-16,BUG-1944,待占星师确认)
|
||||
<!-- 依据:2026-11-16 公开测试盘四题实测,卡上的路线项多数没进回答;产品负责人同意先用挪数据位置的办法,不加写法规则。 -->
|
||||
|
||||
- 原值:领域路线表只写每项「在卡上」,值散在领域段各处,领域段排在本命基础段和时间段之后。新值:模型读到的结果最前面多一块 `key_facts`,每个领域一组,列出路线表点名的本领域自有项和它们的值。
|
||||
@@ -468,13 +467,7 @@ evidence_card.backstage records, for the backend only, that global web evidence
|
||||
- 块上只有一句说明:「(领域)路线的必看项和盘面值(分析用,这句话的字眼不进回答):下判断前先看完下面各项,正文的判断要有其中的依据,用到的项连同盘面值写进「判断依据」。」回答写法(VISIBLE VOICE)没有改。
|
||||
- 实测结果好坏参半(见 BUG-1944):财富、婚恋明显多用了路线项,父母没有改善,正文里出现「分盘」字样的回答变多。她可以定:这一块保留、改内容,还是撤掉。
|
||||
- (BUG-1945,2026-11-16 当日补充)块上多一行按规则生成的依据句 `reading`:分盘只写本领域前两宫的星座、宫内的星、宫主落在该盘第几宫;Arudha 写所在星座与主星的本命落宫;Karaka 写哪颗星、本命第几宫哪个星座。只写位置和关系,不写强弱吉凶,上限 620 字符。说明句改为:「(领域)路线的必看项和盘面值(分析用,这句话的字眼不进回答):下判断前先看完下面各项,用到的项连同盘面值写进「判断依据」。」Argala 行不再带英文结果词,只留 `verdict_label` 的中文。需要她确认:依据句的写法是否有她不认可的读法。
|
||||
- 她的裁定(2026-11-17,Q8):D2 如果是日 / 月两座 Hora 的映射,按整宫列十二个宫位只是坐标,不等于有了这种分法下的十二宫解读;优先给 D2 的具体方法、原经度与 15° 分界、每颗星的日 / 月 Hora 归属和方法敏感性;十二宫推导若保留只能放技术附录并标为坐标推导。D11 等其他分盘也要写明构造和解释来源。
|
||||
- 落地(BUG-1954):产品算的 D2 就是两座 Hora 映射(`scripts/varga.py` 的 `varga_map`:奇数星座前 15° 狮子、后 15° 巨蟹,偶数星座相反)。关键项块里 D2 不再给十二宫行,改给构造名与出处、15° 分界、上升和九颗星各自的本命星座与度数、所在 Hora、离 15° 分界的度数;依据句里 D2 改写成「太阳 Hora 有哪些、月亮 Hora 有哪些、离分界不到 1 度的有哪些」。块上加一句只供判断的说明:这里只有两座 Hora 的归属,没有十二宫,别的 Hora 分法这张卡没有算。
|
||||
- 其余分盘(D3、D4、D5、D6、D7、D8、D9、D10、D11、D12、D24、D30)每项带 `construction`:规则照 `references/shodasavarga-complete-guide.md` 的分盘表原话(D5、D6、D8、D11 照代码注明的 PVR《Integrated Approach》§6.2.5–6.2.11)。D11 的构造是「从白羊逆数到本星座定起点,再顺排十一份」。写不出构造和出处的分盘不给宫位行(目前没有这种情况)。各分盘按宫位读的解释规则出处没有逐张核对,这一点仍待她确认。
|
||||
- (BUG-1955,2026-11-17)财富题判断表里每颗星原来的 `domain_varga_house`(BUG-1907 加的,本领域分盘是 D2 时就是 D2 的整宫位)改为 `domain_varga_hora`:这颗星在太阳 Hora 还是月亮 Hora,照数据包里 D2 的落座读(狮子 = 太阳,巨蟹 = 月亮),和关键项块用的是同一份事实。`domain_varga_houses` 里不再有 D2,另有 `domain_varga_horas.D2`;D11、D10 的宫位照旧。受冲的第 5 类信号(星落本领域分盘的 6 / 8 / 12 宫、凶星落本领域分盘同号宫)对 D2 不再计算,也不记为「没看到」。之前保存的事实里若还带 D2 的宫位,前端组判断表时去掉。本领域分盘是 D2 的只有财富;其余领域的分盘(D10、D9、D6、D7、D12、D24、D1)都是十二座的具名分法,宫位保留。
|
||||
- 个人报告的解读材料同步:`varga_charts.D2` 每颗星给 `hora`、不给 `house`,带 `construction: two_hora_sun_moon`;`planets_in_varga`(财富)给 Hora。Gulika、Maandi、Indu Lagna 在解读材料里也改为已执行的辅助层(`interpretation_usage: supporting`),带位置、敏感性和规则来源(BUG-1954 改了领域事实之后,这里原来把它们读成了主要依据,三条测试失败)。
|
||||
- 还显示或使用 D2 宫位、这一轮没有动的地方(都要改版面或文案,留给产品负责人决定):年度报告财富部分的「D2 上升主在第几宫」及其换座判断;个人报告导出里 D2 的「整宫宫位」数值表和开头导读的分盘表;星盘页 D2 表的「宫位」列和 D2 盘图。
|
||||
- Gulika、Maandi、Indu Lagna 改为辅助层之后仍不进这一块:这一块只列路线的主项。
|
||||
- 她不同意的项删掉并改本节。
|
||||
|
||||
## U. Kantaka Shani 按占星师 2026-11-16 裁定归类(产品 2026-11-16,BUG-1946,执行她的裁定)
|
||||
<!-- 依据:她 2026-11-16《补充裁定与上游修复交接》§一。她本轮没有改 Kantaka 两处计算代码(ENG-09 仍开放),所以归类放在产品侧。 -->
|
||||
@@ -518,13 +511,3 @@ evidence_card.backstage records, for the backend only, that global web evidence
|
||||
- 表里没有的标识符(例如 `chat_use`、`net_result`、`minimum_check`、`method_status`)不带读者需要的信息,连同「键 =」或它所在的空括号一起去掉。
|
||||
- 不因这项检查扣下回答或判失败;出错时保留原回答。
|
||||
- 需要她确认:上表的对应是否有她不认可的说法;`moderate`(双行运强度)目前没有对应的中文,按去掉处理。
|
||||
|
||||
## W. Gulika、Maandi、Indu Lagna 作辅助层参与(产品 2026-11-17,BUG-1954,执行占星师 2026-11-17 问答数据口径 Q5)
|
||||
<!-- 依据:她 2026-11-17《问答数据口径:第0—9题回复》Q5;问答窗口同日的两条写法约束。 -->
|
||||
|
||||
- 原值:领域事实的参与表把健康的 Gulika、Mandi 和财富的 Indu 标成 blocked(理由是 `references/` 的清单没有列),同一张卡的路线表和特殊点又给了数值。新值:这三行改为有值的辅助层,卡上两处不再矛盾。
|
||||
- 每行记录:算出的位置(照数据包原值);`interpretation: supporting`(她的解读状态词,辅助);输入与方法的敏感性(Gulika、Maandi 写 `parameter_sensitive`,Indu Lagna 写 `unverified`);规则是否有来源(照实写:资料库里只有问事一章写到 Gulika / Maandi,财富必查清单没有列 Indu Lagna,都没有本命的具名规则);Gulika、Maandi 另带方法说明(夜间分段从当日第五位日主星起算,Gulika 取土星段起点,Maandi 取中点;占星师一侧的度数没有独立核对)。
|
||||
- 边界只写在一句标着「只给你判断用,字眼不进回答」的话里:与本领域其他依据同向时才写进判断依据,单独一项不下结论。不在卡上列举不能断的事项,避免回答照抄成免责声明(问答窗口 2026-11-17 的约束)。
|
||||
- 没有新增任何预测公式。数据包里没有这一项的值时仍记为缺口。
|
||||
- 没有放开的同类项:事业的 Vighati Lagna、健康的第 64 个 Navamsa 和 Pranapada、财富的 AL 起第 2 / 第 11 宫、婚恋的 UL 起第 2 宫、学业的 D5 等,仍是 blocked。她只裁定了三项,其余要另问她。
|
||||
- 「部分核验」(partial_verified)核的是什么:年运数据里有 `verification_scope`(年主、Muntha、Mudda 核的是公式,日期没有核),但到达取数卡的两处(Tajika 相位状态、土星周期时间表状态)数据里没有写核验对象,所以对照表没有改;按她的要求这一处仍待补,补上后也只写在「判断依据」里,不进正文。
|
||||
|
||||
@@ -387,28 +387,6 @@ def _domain_varga_house(view: dict, name: str, code: str, minute_ok: bool) -> di
|
||||
return _gap(f"varga.{code}.{name}.house")
|
||||
|
||||
|
||||
# BUG-1955 (占星师 2026-11-17 问答数据口径 Q8): D2 is computed as the two-Hora mapping
|
||||
# (scripts/varga.py varga_map: only Leo and Cancer). A house number counted there is a
|
||||
# coordinate, not an accepted reading, so D2 gives each planet's Hora instead of a house.
|
||||
HORA_VARGAS = ("D2",)
|
||||
HORA_OF_SIGN = {"Leo": "Sun", "Cancer": "Moon"}
|
||||
|
||||
|
||||
def _domain_varga_hora(view: dict, name: str, code: str, minute_ok: bool) -> dict[str, Any]:
|
||||
"""Which Hora the planet falls in, read off the packet's own D2 sign."""
|
||||
if code in PRECISION_VARGA and not minute_ok:
|
||||
return {"status": "withheld", "value": PRECISION_SENTENCE, "check": "withheld"}
|
||||
chart, chart_path = _varga_chart(view, code)
|
||||
planet_path = _varga_planet_path(chart_path, chart, name) if chart_path else None
|
||||
if not planet_path:
|
||||
return _gap(f"varga.{code}.{name}.hora")
|
||||
sign = dig(view, f"{planet_path}.sign")
|
||||
hora = HORA_OF_SIGN.get(sign) if isinstance(sign, str) else None
|
||||
if hora is None:
|
||||
return _gap(f"{planet_path}.sign")
|
||||
return {"status": "value", "path": f"{planet_path}.sign", "value": hora, "sign": sign, "check": "hora_of_sign"}
|
||||
|
||||
|
||||
def _d9(view: dict, name: str) -> tuple[dict[str, Any], dict[str, Any]]:
|
||||
chart, chart_path = _varga_chart(view, "D9")
|
||||
if not chart_path:
|
||||
@@ -516,18 +494,12 @@ def _planet_record(
|
||||
"d9_dignity": d9_dignity,
|
||||
"co_tenants": _co_tenants(view, name, house),
|
||||
}
|
||||
if varga in HORA_VARGAS:
|
||||
record["domain_varga_hora"] = _domain_varga_hora(view, name, varga, minute_ok)
|
||||
elif varga:
|
||||
if varga:
|
||||
record["domain_varga_house"] = _domain_varga_house(view, name, varga, minute_ok)
|
||||
if vargas:
|
||||
record["domain_varga_houses"] = {
|
||||
code: _domain_varga_house(view, name, code, minute_ok)
|
||||
for code in vargas if code != "D1" and code not in HORA_VARGAS
|
||||
code: _domain_varga_house(view, name, code, minute_ok) for code in vargas if code != "D1"
|
||||
}
|
||||
horas = {code: _domain_varga_hora(view, name, code, minute_ok) for code in vargas if code in HORA_VARGAS}
|
||||
if horas:
|
||||
record["domain_varga_horas"] = horas
|
||||
return record
|
||||
|
||||
|
||||
@@ -621,45 +593,6 @@ def _blocked(item_id: str, citation: str) -> dict[str, Any]:
|
||||
return {"id": item_id, "status": "blocked", "citation": citation, "check": "blocked"}
|
||||
|
||||
|
||||
# BUG-1954 (占星师 2026-11-17 问答数据口径 Q5): Gulika / Maandi (health) and Indu Lagna (wealth)
|
||||
# take part conditionally as auxiliary layers. A list in references/ not naming them is no
|
||||
# reason to call them inapplicable. Each row records the computed value, whether a sourced
|
||||
# rule exists in the product's references, how sensitive the input / method is, and that the
|
||||
# layer only supports. No prediction formula is added here.
|
||||
AUXILIARY_CITATION = "占星师 2026-11-17 问答数据口径 Q5:条件参与,辅助层"
|
||||
UPAGRAHA_RAW = "worksheets.divisional_and_special_charts.upagrahas.raw"
|
||||
# Analysis-only (consult peer 2026-11-17): the boundary is stated here, never as a sentence the
|
||||
# answer could repeat as a disclaimer.
|
||||
AUXILIARY_ANALYSIS_NOTE = "(只给你判断用,字眼不进回答)辅助层:与本领域其他依据同向时才写进判断依据,单独一项不下结论"
|
||||
_GULIKA_METHOD_NOTE = "夜间分段从当日第五位日主星起算;Gulika 取土星段的起点,Maandi 取土星段的中点;占星师一侧的度数没有独立核对"
|
||||
AUXILIARY_GULIKA = {
|
||||
"interpretation": "supporting",
|
||||
"sensitivity": "parameter_sensitive",
|
||||
"rule_source": "资料库里只有问事一章写到这一项,没有本命健康的具名规则",
|
||||
"method_note": _GULIKA_METHOD_NOTE,
|
||||
}
|
||||
AUXILIARY_MAANDI = dict(AUXILIARY_GULIKA)
|
||||
AUXILIARY_INDU = {
|
||||
"interpretation": "supporting",
|
||||
"sensitivity": "unverified",
|
||||
"rule_source": "资料库的财富必查清单没有列这一项,没有具名规则",
|
||||
}
|
||||
|
||||
|
||||
def _auxiliary(item_id: str, leaf: dict[str, Any], record: Mapping[str, str]) -> dict[str, Any]:
|
||||
"""A computed point that takes part as an auxiliary layer; a missing value stays a gap."""
|
||||
if leaf.get("status") != "value" or "value" not in leaf:
|
||||
return {"id": item_id, "citation": AUXILIARY_CITATION, **leaf}
|
||||
return {
|
||||
"id": item_id,
|
||||
"citation": AUXILIARY_CITATION,
|
||||
"status": "value",
|
||||
"path": leaf["path"],
|
||||
"value": {"position": leaf["value"], **record, "analysis_note": AUXILIARY_ANALYSIS_NOTE},
|
||||
"check": "auxiliary",
|
||||
}
|
||||
|
||||
|
||||
def _sourced(item_id: str, citation: str, leaf: dict[str, Any]) -> dict[str, Any]:
|
||||
return {"id": item_id, "citation": citation, **leaf}
|
||||
|
||||
@@ -720,7 +653,7 @@ def domain_source_catalog() -> dict[str, list[dict[str, str]]]:
|
||||
("A11", "sourced", f"{WEALTH} §3 A2 / A11 / A10"),
|
||||
("A10", "sourced", f"{WEALTH} §3 A2 / A11 / A10"),
|
||||
("Hora", "sourced", f"{DEEP} Hora Lagna 财富指标"),
|
||||
("Indu", "auxiliary", AUXILIARY_CITATION),
|
||||
("Indu", "blocked", f"{ROUTER} §5 必查模块与 {WEALTH} §3 未列 Indu Lagna;本领域不据此判断"),
|
||||
("Sree", "sourced", "references/promise-assessment-templates.md Hora Lagna + Sree Lagna"),
|
||||
("AL2", "blocked", f"{WEALTH} §3 未列出从 AL 起第 2 宫"),
|
||||
("AL11", "blocked", f"{WEALTH} §3 未列出从 AL 起第 11 宫"),
|
||||
@@ -752,8 +685,8 @@ def domain_source_catalog() -> dict[str, list[dict[str, str]]]:
|
||||
("drekkana22", "sourced", f"{SHODASA} 第22Drekkana与寿限"),
|
||||
("navamsa64", "blocked", f"{ROUTER} §7 必查模块未列第 64 个 Navamsa;本领域不据此判断"),
|
||||
("Badhaka", "sourced", BADHAKA),
|
||||
("Gulika", "auxiliary", AUXILIARY_CITATION),
|
||||
("Mandi", "auxiliary", AUXILIARY_CITATION),
|
||||
("Gulika", "blocked", "references/prashna-complete-guide.md 只在问事章写 Gulika,未列入本命健康参与层"),
|
||||
("Mandi", "blocked", "references/prashna-complete-guide.md 只在问事章写 Mandi,未列入本命健康参与层"),
|
||||
("Pranapada", "blocked", "references/prashna-complete-guide.md 的 Pranapada 是问事替代计算,未列入本命健康参与层"),
|
||||
("natural:Sun", "sourced", f"{ROUTER} §7 Sun"),
|
||||
("natural:Moon", "sourced", f"{ROUTER} §7 Moon"),
|
||||
@@ -918,7 +851,7 @@ def _domain_participation(view: dict, domain: str, minute_ok: bool) -> list[dict
|
||||
f"{ARUDHA}.A10.sign",
|
||||
])),
|
||||
_sourced("Hora", f"{DEEP} Hora Lagna 财富指标", _leaf(view, f"{lagna}.Hora_Lagna.sign")),
|
||||
_auxiliary("Indu", _leaf(view, f"{lagna}.Indu_Lagna"), AUXILIARY_INDU),
|
||||
_blocked("Indu", f"{ROUTER} §5 必查模块与 {WEALTH} §3 未列 Indu Lagna;本领域不据此判断"),
|
||||
_sourced("Sree", "references/promise-assessment-templates.md Hora Lagna + Sree Lagna", _first(view, [
|
||||
f"{lagna}.Sree_Lagna.sign",
|
||||
f"{lagna}.Sri_Lagna.sign",
|
||||
@@ -950,8 +883,8 @@ def _domain_participation(view: dict, domain: str, minute_ok: bool) -> list[dict
|
||||
])),
|
||||
_blocked("navamsa64", f"{ROUTER} §7 必查模块未列第 64 个 Navamsa;本领域不据此判断"),
|
||||
_sourced("Badhaka", BADHAKA, _badhaka(view)),
|
||||
_auxiliary("Gulika", _leaf(view, f"{UPAGRAHA_RAW}.Gulika"), AUXILIARY_GULIKA),
|
||||
_auxiliary("Mandi", _leaf(view, f"{UPAGRAHA_RAW}.Maandi"), AUXILIARY_MAANDI),
|
||||
_blocked("Gulika", "references/prashna-complete-guide.md 只在问事章写 Gulika,未列入本命健康参与层"),
|
||||
_blocked("Mandi", "references/prashna-complete-guide.md 只在问事章写 Mandi,未列入本命健康参与层"),
|
||||
_blocked("Pranapada", "references/prashna-complete-guide.md 的 Pranapada 是问事替代计算,未列入本命健康参与层"),
|
||||
*_domain_arudha(view, domain),
|
||||
]
|
||||
@@ -1162,84 +1095,34 @@ def _supplement_sandhi(block: Any) -> dict[str, Any] | None:
|
||||
return {key: copy.deepcopy(block.get(key)) for key in ("reference_date", "orb_days", "sandhi_windows")}
|
||||
|
||||
|
||||
def _convergence_system_status(row: Mapping) -> str:
|
||||
"""Whether the engine produced a running period for this system."""
|
||||
if row.get("applicable") is False:
|
||||
return "not_applicable"
|
||||
period_keys = [key for key in row if key not in ("basis", "applicable", "years", "mode", "lords")]
|
||||
if not any(row.get(key) not in (None, "", [], {}) for key in period_keys):
|
||||
return "not_executed"
|
||||
return "executed"
|
||||
|
||||
|
||||
def _convergence_basis_family(row: Mapping) -> str:
|
||||
"""The first word of the engine's own `basis` text (Nakshatra / Rashi / …)."""
|
||||
text = str(row.get("basis") or "")
|
||||
for index, char in enumerate(text):
|
||||
if not (char.isalpha() and char.isascii()):
|
||||
return text[:index]
|
||||
return text
|
||||
|
||||
|
||||
def _supplement_convergence(block: Any) -> dict[str, Any] | None:
|
||||
"""Which houses the running periods of each dasha system touch.
|
||||
|
||||
占星师 2026-11-17 问答数据口径 Q6:给每套系统的真实周期与端点、事件类、触发依据、
|
||||
计算状态和共享依赖;没有有效执行输入的体系不计入;L1–L5、概率、「强信号」不进默认区。
|
||||
The engine's level, system count, interpretation and probability fields are left out
|
||||
(no `legacy_heuristic` area either). Conflicts between systems are not in the packet.
|
||||
The engine's level, system count, interpretation and probability fields are
|
||||
left out: the card counts independent chart facts, not systems.
|
||||
"""
|
||||
if not isinstance(block, Mapping) or not isinstance(block.get("domain_activations"), Mapping):
|
||||
return None
|
||||
houses: dict[str, Any] = {}
|
||||
for key, row in block["domain_activations"].items():
|
||||
if not isinstance(row, Mapping) or not isinstance(row.get("activations"), list):
|
||||
continue
|
||||
houses[str(key)] = {"house": row.get("house"), "activations": copy.deepcopy(row["activations"])}
|
||||
if not houses:
|
||||
return None
|
||||
running: dict[str, Any] = {}
|
||||
families: dict[str, str] = {}
|
||||
summary = block.get("systems_summary")
|
||||
if isinstance(summary, Mapping):
|
||||
for system, row in summary.items():
|
||||
if not isinstance(row, Mapping):
|
||||
continue
|
||||
picked: dict[str, Any] = {"status": _convergence_system_status(row)}
|
||||
picked: dict[str, Any] = {}
|
||||
for key, value in row.items():
|
||||
if value is None or isinstance(value, (str, int, float, bool)):
|
||||
picked[key] = value
|
||||
elif isinstance(value, Mapping) and isinstance(value.get("lord"), str):
|
||||
# The running period with its end points, when the engine gives them.
|
||||
picked[key] = {name: value[name] for name in ("lord", "start", "end") if value.get(name) is not None}
|
||||
picked[key] = value["lord"]
|
||||
running[str(system)] = picked
|
||||
families[str(system).lower()] = _convergence_basis_family(row)
|
||||
executed = {name.lower() for name, row in running.items() if row["status"] == "executed"}
|
||||
# The engine's summary key and the name it writes on an activation differ for some systems.
|
||||
alias = {"chara": "chara_dasha", "chara dasha": "chara_dasha"}
|
||||
houses: dict[str, Any] = {}
|
||||
for key, row in block["domain_activations"].items():
|
||||
if not isinstance(row, Mapping) or not isinstance(row.get("activations"), list):
|
||||
continue
|
||||
activations = []
|
||||
touching: list[str] = []
|
||||
for item in row["activations"]:
|
||||
if not isinstance(item, Mapping):
|
||||
continue
|
||||
name = str(item.get("system") or "")
|
||||
system_key = alias.get(name.lower(), name.lower())
|
||||
if running and system_key not in executed:
|
||||
continue
|
||||
activations.append(copy.deepcopy(dict(item)))
|
||||
if name and name not in touching:
|
||||
touching.append(name)
|
||||
by_family: dict[str, list[str]] = {}
|
||||
for name in touching:
|
||||
family = families.get(alias.get(name.lower(), name.lower()), "")
|
||||
if family:
|
||||
by_family.setdefault(family, []).append(name)
|
||||
shared = [name for names in by_family.values() if len(names) > 1 for name in names]
|
||||
houses[str(key)] = {
|
||||
"house": row.get("house"),
|
||||
"activations": activations,
|
||||
"systems": touching,
|
||||
**({"shared_basis": shared} if shared else {}),
|
||||
}
|
||||
if not houses:
|
||||
return None
|
||||
return {"running": running, "houses": houses}
|
||||
|
||||
|
||||
@@ -1316,10 +1199,6 @@ def assert_fact_leaves(packet: dict, facts: dict[str, Any], *, base: Mapping | N
|
||||
assert dig(view, item["path"]) == item["value"], item["path"]
|
||||
elif kind == "index" and item.get("status") == "value":
|
||||
assert dig(view, item["path"])[item["index"]] == item["value"], item["path"]
|
||||
elif kind == "auxiliary" and item.get("status") == "value":
|
||||
assert dig(view, item["path"]) == item["value"]["position"], item["path"]
|
||||
elif kind == "hora_of_sign" and item.get("status") == "value":
|
||||
assert dig(view, item["path"]) == item["sign"] and HORA_OF_SIGN[item["sign"]] == item["value"], item["path"]
|
||||
elif kind == "nonempty" and item.get("status") == "value":
|
||||
assert dig(view, item["path"]) not in (None, {}, [], ""), item["path"]
|
||||
elif kind == "membership" and item.get("status") == "value":
|
||||
|
||||
@@ -31,8 +31,6 @@ from .technique_status_axes import technique_audit_axes
|
||||
|
||||
try:
|
||||
from scripts.consult_card_domain_facts import (
|
||||
HORA_OF_SIGN,
|
||||
HORA_VARGAS,
|
||||
PLANETS,
|
||||
PRECISION_SENTENCE,
|
||||
PRECISION_VARGA,
|
||||
@@ -53,8 +51,6 @@ try:
|
||||
from scripts.pl9_full_data_export import full_data_domain_base, read_full_data_domain
|
||||
except ModuleNotFoundError: # pragma: no cover - direct scripts/ execution path
|
||||
from consult_card_domain_facts import (
|
||||
HORA_OF_SIGN,
|
||||
HORA_VARGAS,
|
||||
PLANETS,
|
||||
PRECISION_SENTENCE,
|
||||
PRECISION_VARGA,
|
||||
@@ -107,10 +103,13 @@ CONDITIONAL_STATES = {"parameter_sensitive", "partial", "partial_verified", "con
|
||||
UNUSED_REASONS = {"not_routed", "not_in_domain_route"}
|
||||
PARTICIPATION_REASON_CODES = {
|
||||
("career", "Vighati"): "not_in_domain_route",
|
||||
("wealth", "Indu"): "not_in_domain_route",
|
||||
("wealth", "AL2"): "not_in_domain_route",
|
||||
("wealth", "AL11"): "not_in_domain_route",
|
||||
("marriage", "UL2"): "not_in_domain_route",
|
||||
("health", "navamsa64"): "not_in_domain_route",
|
||||
("health", "Gulika"): "not_in_domain_route",
|
||||
("health", "Mandi"): "not_in_domain_route",
|
||||
("health", "Pranapada"): "not_in_domain_route",
|
||||
("education", "D5"): "not_in_domain_route",
|
||||
("migration", "D12"): "not_routed",
|
||||
@@ -429,10 +428,6 @@ def _participation_axes(row: dict[str, Any], item: dict[str, Any], view: dict) -
|
||||
usage = "not_used"
|
||||
if state == "executed":
|
||||
usage = {"Badhaka": "supporting", "kp": "conditional"}.get(item_id, "primary")
|
||||
# BUG-1955 (占星师 2026-11-17 Q5, follow-up of BUG-1954): Gulika / Maandi / Indu Lagna are
|
||||
# auxiliary layers. They were read here as primary after the chat-side change.
|
||||
if item.get("check") == "auxiliary":
|
||||
usage = "supporting"
|
||||
axes = technique_audit_axes({}, {"calculation_status": "executed", "interpretation_status": usage})
|
||||
return {"execution_status": axes["calculation_status"], "interpretation_usage": axes["interpretation_status"]}
|
||||
if item.get("status") == "not_applicable" and isinstance(item.get("reason"), str) and item["reason"].strip():
|
||||
@@ -473,16 +468,6 @@ def _participation(rows: list[dict[str, Any]], domain: str, view: dict, minute_c
|
||||
elif state == "executed" and item_id in STRUCTURED_VALUES and isinstance(value, dict):
|
||||
# BUG-1853: Badhaka is a small record; the reading needs its positions, not just "executed".
|
||||
row["value"] = {key: value[key] for key in STRUCTURED_VALUES[item_id] if value.get(key) not in (None, "", [])}
|
||||
elif state == "executed" and item.get("check") == "auxiliary" and isinstance(value, dict):
|
||||
# The computed position with its record; the chat-only analysis note stays off the report.
|
||||
# Position keeps the zodiac placement only: a key named `longitude` reads as a birth
|
||||
# coordinate to the report's privacy check.
|
||||
position = value.get("position")
|
||||
if isinstance(position, dict):
|
||||
position = {key: position[key] for key in ("sign", "sign_idx", "degree_in_sign", "sign_degree", "house")
|
||||
if position.get(key) is not None}
|
||||
row["value"] = {**{key: item for key, item in value.items() if key not in ("analysis_note", "position")},
|
||||
"position": position}
|
||||
if state in UNUSED_REASONS and (value := _unused_value(view, item_id, minute_confirmed)) is not None:
|
||||
row.update(computed=True, value=value)
|
||||
if state == "withheld":
|
||||
@@ -539,19 +524,10 @@ def _varga_signs(view: dict, code: str, minute_confirmed: bool) -> Any:
|
||||
if not isinstance(node, dict) or not node.get("sign"):
|
||||
continue
|
||||
row = {"sign": node["sign"]}
|
||||
if code in HORA_VARGAS:
|
||||
# BUG-1955 (占星师 2026-11-17 Q8): D2 is the two-Hora mapping; the reading material
|
||||
# carries each planet's Hora, never a house counted in it.
|
||||
hora = HORA_OF_SIGN.get(node["sign"])
|
||||
if hora:
|
||||
row["hora"] = hora
|
||||
out["construction"] = "two_hora_sun_moon"
|
||||
house = None
|
||||
else:
|
||||
house = node.get("house")
|
||||
if not isinstance(house, int) and asc_sign in SIGN_ORDER and node["sign"] in SIGN_ORDER:
|
||||
house = (SIGN_ORDER.index(node["sign"]) - SIGN_ORDER.index(asc_sign)) % 12 + 1
|
||||
out["house_basis"] = "whole_sign_from_varga_ascendant"
|
||||
house = node.get("house")
|
||||
if not isinstance(house, int) and asc_sign in SIGN_ORDER and node["sign"] in SIGN_ORDER:
|
||||
house = (SIGN_ORDER.index(node["sign"]) - SIGN_ORDER.index(asc_sign)) % 12 + 1
|
||||
out["house_basis"] = "whole_sign_from_varga_ascendant"
|
||||
if isinstance(house, int):
|
||||
row["house"] = house
|
||||
dignity = dignities.get(planet) or node.get("dignity")
|
||||
@@ -570,10 +546,7 @@ def _domain(row: dict, view: dict, shared: set[str], checked_houses: list[int])
|
||||
houses = {}
|
||||
for planet, record in row["planets"].items():
|
||||
leaves = record.get("domain_varga_houses") or {}
|
||||
if code in HORA_VARGAS:
|
||||
leaves = record.get("domain_varga_horas") or {}
|
||||
leaf = leaves.get(code) if code in leaves else (
|
||||
record.get("domain_varga_hora" if code in HORA_VARGAS else "domain_varga_house") if code == primary else None)
|
||||
leaf = leaves.get(code) if code in leaves else (record.get("domain_varga_house") if code == primary else None)
|
||||
house = _compact(leaf)
|
||||
if house is not None:
|
||||
houses[planet] = house
|
||||
@@ -905,7 +878,7 @@ def build_report_reading_facts(
|
||||
general = rows["general"]
|
||||
planets = {}
|
||||
for name, record in general["planets"].items():
|
||||
kept = _compact({key: value for key, value in record.items() if key not in ("domain_varga_house", "domain_varga_houses", "domain_varga_hora", "domain_varga_horas")})
|
||||
kept = _compact({key: value for key, value in record.items() if key not in ("domain_varga_house", "domain_varga_houses")})
|
||||
if kept.get("present"):
|
||||
kept.pop("present")
|
||||
for key in ("d1_dignity", "d9_dignity"):
|
||||
|
||||
@@ -92,20 +92,13 @@ def test_supplements_copy_packet_values_and_select_keys_only():
|
||||
assert set(houses) == set(source)
|
||||
for key, row in houses.items():
|
||||
# The engine's level, count, interpretation and probability fields stay off the card.
|
||||
# 原值: {"house", "activations"};新值: 另有 systems(触到这一宫的已执行体系)与可选的 shared_basis
|
||||
# 原因: BUG-1954,占星师 2026-11-17 问答数据口径 Q6(计算状态、共享依赖;无有效输入的体系不计入)
|
||||
assert set(row) - {"shared_basis"} == {"house", "activations", "systems"}
|
||||
assert set(row) == {"house", "activations"}
|
||||
assert row["activations"] == source[key]["activations"]
|
||||
encoded = json.dumps(out["dasa_convergence"], ensure_ascii=False)
|
||||
for word in ("convergence_level", "system_count", "interpretation", "probability"):
|
||||
assert word not in encoded
|
||||
running = out["dasa_convergence"]["running"]["vimshottari"]
|
||||
# 原值: {"maha": "Rahu", "antar": "Venus", "pratyantar": "Mercury", "basis": …}
|
||||
# 新值: 多一个 status;小运带起止(引擎给了端点);原因同上
|
||||
assert running == {
|
||||
"status": "executed", "maha": "Rahu", "antar": {"lord": "Venus", "start": "2024-05-10", "end": "2027-05-10"},
|
||||
"pratyantar": "Mercury", "basis": "Nakshatra (Moon)",
|
||||
}
|
||||
assert running == {"maha": "Rahu", "antar": "Venus", "pratyantar": "Mercury", "basis": "Nakshatra (Moon)"}
|
||||
|
||||
|
||||
def test_missing_layers_are_left_out_not_filled():
|
||||
|
||||
@@ -46,13 +46,7 @@ def test_every_domain_row_is_sourced_or_blocked():
|
||||
for domain, rows in catalog.items():
|
||||
assert rows, domain
|
||||
for row in rows:
|
||||
# 原值: 每行只能是 sourced 或 blocked
|
||||
# 新值: 另有 auxiliary,只限健康的 Gulika、Mandi 和财富的 Indu
|
||||
# 原因: BUG-1954,占星师 2026-11-17 问答数据口径 Q5:这三项条件参与、作辅助层,
|
||||
# 「references 的清单没有列」不是不适用的理由
|
||||
assert row["status"] in {"sourced", "blocked", "auxiliary"}, row["id"]
|
||||
if row["status"] == "auxiliary":
|
||||
assert (domain, row["id"]) in {("health", "Gulika"), ("health", "Mandi"), ("wealth", "Indu")}
|
||||
assert row["status"] in {"sourced", "blocked"}, row["id"]
|
||||
citation = row["citation"]
|
||||
assert citation
|
||||
if row["status"] == "sourced" and "references/" in citation:
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
"""BUG-1954: the astrologer's 2026-11-17 rulings on the chat data (Q5, Q6).
|
||||
|
||||
Q5: Gulika / Maandi (health) and Indu Lagna (wealth) take part as auxiliary layers.
|
||||
Q6: the dasa-convergence lookup gives each executed system's period and what it touches,
|
||||
without levels, counts as votes, or probability wording.
|
||||
Packet: the fictional density fixture with synthetic rows; no chart of a person.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from consult_card_domain_facts import (
|
||||
AUXILIARY_ANALYSIS_NOTE,
|
||||
AUXILIARY_CITATION,
|
||||
assert_fact_leaves,
|
||||
build_chart_supplements,
|
||||
build_domain_facts,
|
||||
domain_source_catalog,
|
||||
)
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
DENSITY = ROOT / "frontend" / "tests" / "fixtures" / "report-density-fictional-engine.json"
|
||||
|
||||
|
||||
def _packet() -> dict:
|
||||
packet = json.loads(DENSITY.read_text(encoding="utf-8"))
|
||||
sheets = packet["worksheets"]
|
||||
charts = sheets.setdefault("divisional_and_special_charts", {})
|
||||
charts.setdefault("upagrahas", {})["raw"] = {
|
||||
"Gulika": {"longitude": 63.72, "sign_idx": 2, "degree_in_sign": 3.72, "period": "night", "segment_part": "begin"},
|
||||
"Maandi": {"longitude": 72.61, "sign_idx": 2, "degree_in_sign": 12.61, "period": "night", "segment_part": "middle"},
|
||||
}
|
||||
charts.setdefault("special_lagnas", {})["Indu_Lagna"] = {"sign": "Gemini", "sign_degree": 12.39, "house": 12, "status": "computed"}
|
||||
return packet
|
||||
|
||||
|
||||
def _row(facts: dict, item_id: str) -> dict:
|
||||
return next(row for row in facts["participation"] if row.get("id") == item_id)
|
||||
|
||||
|
||||
def test_the_three_points_take_part_as_auxiliary_layers_with_their_record():
|
||||
packet = _packet()
|
||||
before = copy.deepcopy(packet)
|
||||
health = build_domain_facts(packet, "health", minute_confirmed=True)
|
||||
wealth = build_domain_facts(packet, "wealth", minute_confirmed=True)
|
||||
upagrahas = packet["worksheets"]["divisional_and_special_charts"]["upagrahas"]["raw"]
|
||||
for facts, item_id, source in ((health, "Gulika", upagrahas["Gulika"]), (health, "Mandi", upagrahas["Maandi"]),
|
||||
(wealth, "Indu", packet["worksheets"]["divisional_and_special_charts"]["special_lagnas"]["Indu_Lagna"])):
|
||||
row = _row(facts, item_id)
|
||||
# 原值: {"status": "blocked", "citation": "……未列入本命健康参与层 / 本领域不据此判断"}
|
||||
# 新值: 有值的一行,写明算出的位置、是否有具名规则、输入与方法的敏感性、只作辅助
|
||||
# 原因: 占星师 2026-11-17 Q5
|
||||
assert row["status"] == "value" and row["check"] == "auxiliary"
|
||||
assert row["citation"] == AUXILIARY_CITATION
|
||||
value = row["value"]
|
||||
assert value["position"] == source
|
||||
assert value["interpretation"] == "supporting"
|
||||
assert value["sensitivity"] in {"parameter_sensitive", "unverified"}
|
||||
assert "规则" in value["rule_source"]
|
||||
assert value["analysis_note"] == AUXILIARY_ANALYSIS_NOTE
|
||||
assert _row(health, "Gulika")["value"]["sensitivity"] == "parameter_sensitive"
|
||||
assert "第五位日主星" in _row(health, "Gulika")["value"]["method_note"]
|
||||
assert "没有独立核对" in _row(health, "Mandi")["value"]["method_note"]
|
||||
assert "method_note" not in _row(wealth, "Indu")["value"]
|
||||
assert_fact_leaves(packet, health)
|
||||
assert_fact_leaves(packet, wealth)
|
||||
assert packet == before
|
||||
|
||||
|
||||
def test_the_boundary_is_analysis_only_and_names_no_feared_outcome():
|
||||
# Consult peer 2026-11-17: no sentence the answer could repeat as a disclaimer.
|
||||
assert AUXILIARY_ANALYSIS_NOTE.startswith("(只给你判断用,字眼不进回答)")
|
||||
for word in ("疾病", "死亡", "灾", "金额", "不能断", "不得"):
|
||||
assert word not in AUXILIARY_ANALYSIS_NOTE
|
||||
encoded = json.dumps(_row(build_domain_facts(_packet(), "health", minute_confirmed=True), "Gulika"), ensure_ascii=False)
|
||||
for word in ("疾病", "死亡", "灾祸"):
|
||||
assert word not in encoded
|
||||
|
||||
|
||||
def test_a_point_the_packet_lacks_stays_a_gap_and_the_other_blocked_items_are_untouched():
|
||||
packet = _packet()
|
||||
del packet["worksheets"]["divisional_and_special_charts"]["upagrahas"]["raw"]["Gulika"]
|
||||
health = build_domain_facts(packet, "health", minute_confirmed=True)
|
||||
assert _row(health, "Gulika")["status"] == "gap"
|
||||
# She ruled on three items only. The others blocked for "not listed" stay blocked.
|
||||
assert _row(health, "navamsa64")["status"] == "blocked"
|
||||
assert _row(health, "Pranapada")["status"] == "blocked"
|
||||
catalog = domain_source_catalog()
|
||||
assert next(row for row in catalog["career"] if row["id"] == "Vighati")["status"] == "blocked"
|
||||
assert next(row for row in catalog["wealth"] if row["id"] == "AL2")["status"] == "blocked"
|
||||
|
||||
|
||||
def _convergence_packet() -> dict:
|
||||
packet = json.loads(DENSITY.read_text(encoding="utf-8"))
|
||||
packet["worksheets"]["timing_and_predictive_systems"]["dasa_convergence"] = {
|
||||
"systems_summary": {
|
||||
"vimshottari": {
|
||||
"maha": "Rahu",
|
||||
"antar": {"lord": "Venus", "start": "2024-05-10", "end": "2027-05-10", "is_current": True, "pratyantar_dasha_timeline": [{"lord": "Sun"}]},
|
||||
"pratyantar": "Mercury", "lords": ["Rahu", "Venus", "Mercury"], "basis": "Nakshatra (Moon)",
|
||||
},
|
||||
"chara_dasha": {"maha_sign": None, "antar_sign": None, "basis": "Rashi (Sign-based)"},
|
||||
"yogini": {"yogini": "Siddha", "planet": "Venus", "years": 7, "basis": "Nakshatra/Lagna 36-year cycle"},
|
||||
"ashtottari": {"applicable": False, "planet": None, "years": None, "basis": "Conditional"},
|
||||
},
|
||||
"domain_activations": {
|
||||
"home_mother": {
|
||||
"house": 4,
|
||||
"activations": [
|
||||
{"system": "Vimshottari", "level": "antar", "planet": "Venus", "reason": "Venus是4宫(Libra)的宫主星"},
|
||||
{"system": "Yogini", "level": "maha", "planet": "Venus", "reason": "Yogini当前主星Venus是4宫(Libra)的宫主星"},
|
||||
],
|
||||
"system_count": 2, "convergence_level": "L3", "interpretation": "双系统激活,强信号",
|
||||
"probability": None, "probability_basis": "No empirical probability calibration; level counts activating systems only.",
|
||||
},
|
||||
},
|
||||
"top_convergent_domains": [["home_mother", "L3"]],
|
||||
"protocol": "v6.1.6 Dasa Convergence",
|
||||
}
|
||||
return packet
|
||||
|
||||
|
||||
def test_convergence_gives_periods_with_end_points_status_and_touched_houses_only():
|
||||
out = build_chart_supplements(_convergence_packet())["dasa_convergence"]
|
||||
running = out["running"]
|
||||
assert running["vimshottari"]["status"] == "executed"
|
||||
assert running["vimshottari"]["antar"] == {"lord": "Venus", "start": "2024-05-10", "end": "2027-05-10"}
|
||||
assert running["vimshottari"]["maha"] == "Rahu" and running["vimshottari"]["pratyantar"] == "Mercury"
|
||||
assert running["yogini"]["status"] == "executed"
|
||||
# A system without a valid executed input is named as such and is not among those touching a house.
|
||||
assert running["chara_dasha"]["status"] == "not_executed"
|
||||
assert running["ashtottari"]["status"] == "not_applicable"
|
||||
house = out["houses"]["home_mother"]
|
||||
assert house["house"] == 4
|
||||
assert [row["system"] for row in house["activations"]] == ["Vimshottari", "Yogini"]
|
||||
assert house["systems"] == ["Vimshottari", "Yogini"]
|
||||
assert house["shared_basis"] == ["Vimshottari", "Yogini"]
|
||||
encoded = json.dumps(out, ensure_ascii=False)
|
||||
for word in ("convergence_level", "system_count", "interpretation", "probability", "强信号", "L3", "legacy_heuristic", "top_convergent"):
|
||||
assert word not in encoded, word
|
||||
@@ -1,76 +0,0 @@
|
||||
"""BUG-1955 (占星师 2026-11-17 问答数据口径 Q8): D2 is the two-Hora mapping, so the
|
||||
judgment facts and the report reading material give each planet's Hora, not a house.
|
||||
|
||||
Packet: the fictional density fixture (no chart of a person).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from consult_card_domain_facts import (
|
||||
HORA_OF_SIGN,
|
||||
HORA_VARGAS,
|
||||
PLANETS,
|
||||
assert_fact_leaves,
|
||||
build_domain_facts,
|
||||
)
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
DENSITY = ROOT / "frontend" / "tests" / "fixtures" / "report-density-fictional-engine.json"
|
||||
|
||||
|
||||
def _packet() -> dict:
|
||||
return json.loads(DENSITY.read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
def test_wealth_planet_rows_carry_the_hora_and_no_d2_house():
|
||||
packet = _packet()
|
||||
facts = build_domain_facts(packet, "wealth", minute_confirmed=True)
|
||||
assert facts["domain_varga"] == "D2" and HORA_VARGAS == ("D2",)
|
||||
seen = 0
|
||||
for name in PLANETS:
|
||||
row = facts["planets"][name]
|
||||
# 原值: row["domain_varga_house"] = D2 里从分盘上升按整宫数出的宫位(BUG-1907)
|
||||
# 新值: row["domain_varga_hora"] = 这颗星所在的 Hora(Sun / Moon),照数据包里 D2 的落座读
|
||||
# 原因: 占星师 2026-11-17 Q8:两座 Hora 的 D2 没有被认可的十二宫读法
|
||||
assert "domain_varga_house" not in row, name
|
||||
leaf = row["domain_varga_hora"]
|
||||
assert "D2" not in row.get("domain_varga_houses", {}), name
|
||||
assert row["domain_varga_horas"]["D2"] == leaf
|
||||
if leaf["status"] != "value":
|
||||
continue
|
||||
seen += 1
|
||||
assert leaf["check"] == "hora_of_sign"
|
||||
assert leaf["sign"] in HORA_OF_SIGN and leaf["value"] == HORA_OF_SIGN[leaf["sign"]]
|
||||
assert seen >= 7
|
||||
# D11 and D10 keep their houses: their constructions are named (BUG-1954).
|
||||
assert set(facts["planets"]["Sun"]["domain_varga_houses"]) == {"D11", "D10"}
|
||||
assert_fact_leaves(packet, facts)
|
||||
|
||||
|
||||
def test_other_domains_keep_the_house_in_their_named_varga():
|
||||
packet = _packet()
|
||||
for domain, varga in (("career", "D10"), ("marriage", "D9"), ("health", "D6"), ("parents", "D12")):
|
||||
facts = build_domain_facts(packet, domain, minute_confirmed=True)
|
||||
assert facts["domain_varga"] == varga
|
||||
row = facts["planets"]["Sun"]
|
||||
assert "domain_varga_house" in row and "domain_varga_hora" not in row, domain
|
||||
|
||||
|
||||
def test_report_reading_material_gives_d2_the_hora_not_a_house():
|
||||
from scripts.report_render.reading_facts import _varga_signs
|
||||
from scripts.pl9_full_data_export import read_full_data_domain
|
||||
|
||||
packet = _packet()
|
||||
view = read_full_data_domain(packet, "wealth")
|
||||
d2 = _varga_signs(view, "D2", True)
|
||||
assert d2["construction"] == "two_hora_sun_moon"
|
||||
assert "house_basis" not in d2
|
||||
rows = [d2[name] for name in PLANETS if name in d2]
|
||||
assert rows
|
||||
for row in rows:
|
||||
assert "house" not in row
|
||||
assert row["hora"] == HORA_OF_SIGN[row["sign"]]
|
||||
d11 = _varga_signs(view, "D11", True)
|
||||
assert any("house" in d11[name] for name in PLANETS if name in d11)
|
||||
@@ -67,28 +67,16 @@ def test_public_report_v3_facts(public_report):
|
||||
|
||||
blocked = facts["blocked_states"]
|
||||
assert "general:D10" in blocked["not_routed"]
|
||||
# 原值: health 的 Gulika、Mandi、Pranapada 都在 not_in_domain_route;wealth 的 Indu 状态是
|
||||
# not_in_domain_route,值只带星座,出处写「路线未列 Indu Lagna」
|
||||
# 新值: Pranapada 仍在 not_in_domain_route;Gulika、Mandi、Indu 是已执行的辅助层
|
||||
# (interpretation_usage = supporting),带位置、敏感性、规则来源,出处写她的裁定
|
||||
# 原因: 占星师 2026-11-17 问答数据口径 Q5(BUG-1954 改了领域事实,BUG-1955 把报告解读材料对齐)
|
||||
assert "health:Pranapada" in blocked["not_in_domain_route"]
|
||||
health_points = {f"health:{point}" for point in ("Gulika", "Mandi", "Pranapada")}
|
||||
assert health_points <= set(blocked["not_in_domain_route"])
|
||||
assert not (health_points | {"general:D10"}) & set(blocked["blocked"])
|
||||
assert not {"health:Gulika", "health:Mandi", "wealth:Indu"} & set(blocked["not_in_domain_route"])
|
||||
wealth = facts["domains"]["wealth"]
|
||||
indu = next(row for row in wealth["participation"] if row["id"] == "Indu")
|
||||
assert indu["state"] == "executed" and indu["interpretation_usage"] == "supporting"
|
||||
indu_packet = dig(packet, f"{rf.LAGNAS}.Indu_Lagna")
|
||||
assert indu["value"]["position"]["sign"] == indu_packet["sign"]
|
||||
assert "longitude" not in indu["value"]["position"]
|
||||
assert indu["value"]["interpretation"] == "supporting" and indu["value"]["sensitivity"] == "unverified"
|
||||
assert "analysis_note" not in indu["value"]
|
||||
assert "Q5" in indu["source"]
|
||||
for point in ("Gulika", "Mandi"):
|
||||
row = next(item for item in facts["domains"]["health"]["participation"] if item["id"] == point)
|
||||
assert row["state"] == "executed" and row["interpretation_usage"] == "supporting", point
|
||||
assert row["value"]["sensitivity"] == "parameter_sensitive" and "method_note" in row["value"], point
|
||||
assert indu["reason_code"] == indu["state"] == "not_in_domain_route"
|
||||
assert indu["computed"] is True
|
||||
assert indu["value"] == dig(packet, f"{rf.LAGNAS}.Indu_Lagna.sign")
|
||||
# BUG-1852: the citation names the route that leaves Indu out, not a failed search of references/.
|
||||
assert "未找到" not in indu["source"] and "Indu Lagna" in indu["source"]
|
||||
# BUG-1853: Badhaka is computed from the ascendant and reaches the health facts with its positions.
|
||||
badhaka = next(row for row in facts["domains"]["health"]["participation"] if row["id"] == "Badhaka")
|
||||
assert badhaka["state"] == "executed"
|
||||
|
||||
@@ -9,19 +9,18 @@ from tests.test_reading_facts_v3_20261112 import _reading_facts, _reading_reques
|
||||
|
||||
|
||||
def test_unused_results_and_absent_results_keep_distinct_axes():
|
||||
# 原值: 用 wealth 的 Indu 作「路线未列」的例子;新值: 用 health 的 Pranapada;原因: BUG-1955:Gulika、Mandi、Indu 按占星师 2026-11-17 Q5 改为辅助层,不再是「路线未列」;这里换成仍未放开的同类项
|
||||
card = [{"id": "Pranapada", "status": "blocked"}]
|
||||
missing, = rf._participation(card, "health", {}, True)
|
||||
card = [{"id": "Indu", "status": "blocked"}]
|
||||
missing, = rf._participation(card, "wealth", {}, True)
|
||||
assert (missing["state"], missing["execution_status"], missing["interpretation_usage"]) == (
|
||||
"not_in_domain_route", "not_computed", "not_used",
|
||||
)
|
||||
assert "value" not in missing and "blocked_reason" not in missing
|
||||
|
||||
view = {"worksheets": {"divisional_and_special_charts": {
|
||||
"special_lagnas": {"Pranapada_Lagna": {"sign": "Leo"}},
|
||||
"special_lagnas": {"Indu_Lagna": {"sign": "Leo"}},
|
||||
"varga_full": {"D10_Dasamsa": {"Ascendant": {"sign": "Leo"}}},
|
||||
}}}
|
||||
unused, = rf._participation(card, "health", view, True)
|
||||
unused, = rf._participation(card, "wealth", view, True)
|
||||
not_routed, = rf._participation([{"id": "D10", "status": "blocked"}], "general", view, True)
|
||||
assert unused["state"] == "not_in_domain_route"
|
||||
assert not_routed["state"] == "not_routed"
|
||||
@@ -64,16 +63,15 @@ def test_kp_method_label_is_not_a_calculation_result():
|
||||
|
||||
def test_summary_keeps_routing_separate_from_calculation_gaps():
|
||||
rows = rf._participation([
|
||||
# 原值: Gulika;新值: navamsa64;原因: BUG-1955:Gulika、Mandi、Indu 按占星师 2026-11-17 Q5 改为辅助层,不再是「路线未列」;这里换成仍未放开的同类项
|
||||
{"id": "navamsa64", "status": "blocked"},
|
||||
{"id": "Gulika", "status": "blocked"},
|
||||
{"id": "D6", "status": "withheld"},
|
||||
{"id": "D8", "status": "gap"},
|
||||
], "health", {"worksheets": {"divisional_and_special_charts": {
|
||||
"sensitive_points": {"navamsa_64th": {"sign": "Leo"}},
|
||||
"upagrahas": {"raw": {"Gulika": {"sign_idx": 7}}},
|
||||
}}}, False)
|
||||
transits = {"planets": {"Jupiter": {}}, "double_transit": {"checked_houses": [7]}}
|
||||
result = rf._blocked_states({"health": {"participation": rows}}, [], [], {}, transits, {})
|
||||
assert result["not_in_domain_route"] == ["health:navamsa64"]
|
||||
assert result["not_in_domain_route"] == ["health:Gulika"]
|
||||
assert result["withheld"] == ["health:D6"]
|
||||
assert result["blocked"] == ["health:D6"]
|
||||
assert result["not_computed"] == ["health:D8"]
|
||||
@@ -84,19 +82,12 @@ def test_public_report_axes_and_badhaka_positions(public_report):
|
||||
facts = _reading_facts(packet, reading, **_reading_request(body))
|
||||
participation = {name: {row["id"]: row for row in domain["participation"]}
|
||||
for name, domain in facts["domains"].items()}
|
||||
# 原值: Indu、Gulika、Mandi、Pranapada 四项都是 not_in_domain_route / not_used
|
||||
# 新值: Pranapada 仍是;另外三项是已执行的辅助层(supporting),带位置记录
|
||||
# 原因: BUG-1955:Gulika、Mandi、Indu 按占星师 2026-11-17 Q5 改为辅助层,不再是「路线未列」;这里换成仍未放开的同类项
|
||||
unused = [participation["health"]["Pranapada"]]
|
||||
unused = [participation["wealth"]["Indu"]]
|
||||
unused.extend(participation["health"][name] for name in ("Gulika", "Mandi", "Pranapada"))
|
||||
for row in unused:
|
||||
assert row["state"] == "not_in_domain_route"
|
||||
assert (row["execution_status"], row["interpretation_usage"]) == ("executed", "not_used")
|
||||
assert row["value"] and row["computed"] is True
|
||||
auxiliary = [participation["wealth"]["Indu"]]
|
||||
auxiliary.extend(participation["health"][name] for name in ("Gulika", "Mandi"))
|
||||
for row in auxiliary:
|
||||
assert (row["state"], row["execution_status"], row["interpretation_usage"]) == ("executed", "executed", "supporting")
|
||||
assert row["value"]["position"] and row["value"]["interpretation"] == "supporting"
|
||||
|
||||
health = participation["health"]["Badhaka"]
|
||||
assert (health["state"], health["execution_status"], health["interpretation_usage"]) == (
|
||||
|
||||
Reference in New Issue
Block a user