fix(report): astrologer 11-25 site-vs-local comparison fixes (BUG-2364–2376)
- 2364 KP sub-lord in the Nakshatra Reference: proportional, not equal ninths (upstream calc_sub_lord) - 2365 birth-time sensitivity KP cusps: Placidus + Krishnamurti, same source as the formal KP table - 2366 expression paths: D2/D11/D24/D4 house counted from the varga's own ascendant - 2367 Bhavesh table: PD-only lord labelled, not "Yes", when the PD range is not stable - 2368 KP cusp table: very strong significator is a lead, not a promise - 2369 yoga wording: no blanket "cancellation not checked"; detector match is not "conditions hold" - 2370 Neecha self-reference marked per condition - 2371 reading guide: feedback only in rectification; all applicable systems, two dashas minimum - 2372 audit table: progress/index rows are observation only - 2373 Saptavargaja by chart - 2374 Manahoo interferer never one of the pair (upstream 322e2f30) - 2375 KP monthly table seeded under the KP profile (owner-approved frozen-file edit) + profile line - 2376 annual continuous motion: full event list per year in the appendix (owner-approved) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXp3RzgZVEpT1PXxkwHj
This commit is contained in:
@@ -32202,3 +32202,126 @@
|
||||
- 防复发:报告标题只有 `report-export-title.ts` 一处来源;测试钉住导出弹层与列表都调用它、列表源码里不再出现固定标题。
|
||||
- 关联记录:BUG-2066(导出文件名带人名)、BUG-2073 / BUG-2085(列表行)。
|
||||
- 修复版本:分支 `claude/pada-sweep-2362`。
|
||||
|
||||
## BUG-2364 | 报告「星宿参照」表的 KP 副主按九等分算,与同一黄经的 KP 副主不符
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师 2026-11-25 用同一组出生参数对照网站英文报告与本地导出(E01):「星宿参照」表 9 颗星中 5 颗副主与同一本命黄经按比例划分的结果不同;同一报告前面的「行星宿主与尊贵」表是对的。表下说明却写「按 Vimshottari 年数比例不等分,不是九等分」。
|
||||
- **触发条件**:任一报告;行星落在星宿内按九等分与按比例划分落在不同分段时。
|
||||
- **根因**:`scripts/nakshatra_advanced.py::calc_sub_lord` 仍是注释自称「简化版」的九等分;报告这张表读 `nakshatra_adv.sub_lords`,其余 KP 表读 `kp_system.get_kp_lords`。
|
||||
- **修复**:`calc_sub_lord` 改为调用 `get_kp_lords`(与上游 322e2f30 同名函数一致),并返回副副主、`method: kp_vimshottari_proportional`。
|
||||
- **验证**:`tests/test_kp_sub_lord_and_sensitivity_cusps_2364.py`(全黄道每 0.0137° 比对 `get_kp_lords`;两个九等分与比例划分不同的点);`tests/test_nakshatra.py` 通过;对照盘重新生成后 9 颗星与占星师给出的正确值一致。
|
||||
- **防复发**:副主只有一个来源(`get_kp_lords`),测试扫全黄道。
|
||||
- **关联记录**:BUG-2065(同表 gana)。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2365 | 生时敏感性矩阵的 KP 宫头用的是 Raman 整宫上升度数,中央分钟与正式 KP 表不一致
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(E02):敏感性矩阵中央分钟(即填写的出生时刻)1 宫星宿主/副主、10 宫副主与正式「KP 宫头」表不同,「出生时间变化」里混进了方法差异。
|
||||
- **触发条件**:任一报告的「生时敏感性矩阵」及生时纠正候选重算。
|
||||
- **根因**:`active_rectification_questions._kp_cusp_snapshot` 与 `flexible_birth_time_profile._recast_candidate_layers` 读本命盘 `houses.house_N.cusp_degree`——那是 Raman 岁差下整宫制的上升度数,不是 KP(Placidus + Krishnamurti)宫头。正式 KP 表和生时纠正事件引擎早已用 `rectification/kp_cusp_observation.observe_kp_cusps`。
|
||||
- **修复**:两处都改用 `observe_kp_cusps`;算不出时留空,不回退到别的宫制。
|
||||
- **验证**:同一测试文件:公开盘中央分钟四个宫头的度数、星宿主、副主逐项等于正式 KP 观察。对照盘中央分钟现在与正式表一致,且显示出真实的逐分钟变化(14:50 时 1 宫星宿主换成金星)。相关生时纠正测试通过;`test_flexible_birth_time_engine.py` 有 2 条失败在 staging 原样存在(API FakeEngine 缺 `NODE_MODES`),与本修改无关。
|
||||
- **防复发**:KP 宫头只有一个来源;测试钉住中央分钟 = 正式表。
|
||||
- **关联记录**:BUG-2118(同一行的显示格式)。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2366 | 支持路径里 D2 / D11 / D24 / D4 的宫位写「未提供」,而分盘表里有
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(E03):Yoga 支持路径写「D2:水星在巨蟹座,宫位未提供」,D11、D24、D4 同类;报告开头的分盘表给出了宫位。
|
||||
- **根因**:`scripts/yoga_expression_paths.py` 先读 `inter_chart_linkage`(只有 D1/D9/D10/D12),其余分盘回退到 `varga_full`,那里只有星座序号、没有宫位字段,于是落到默认值「未提供」。
|
||||
- **修复**:回退时用该分盘自己的上升星座序号算宫位;真算不出时整句不写宫位,不再印占位词。中文写法统一为「第 N 宫」。
|
||||
- **验证**:`tests/test_report_audit_fixes_2366_2374.py`:两张公开盘中英文都不再出现该占位词;`tests/test_yoga_expression_paths.py` 通过。
|
||||
- **防复发**:跨章节的缺值断言必须先查全局来源;测试扫整份报告。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2367 | 宫主表把仅是当前细运主星的宫主标「是」,下一张表却说细运不参加
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(E04):「宫主(Bhavesh)」表「是否为当前大运/小运/细运主星」一栏对当前细运主星标「是」;紧接的关联表写「细运稳定性未评估,细运不参加下列关联」。
|
||||
- **根因**:`scripts/pl9_reader_export.py` 宫主表无条件把细运主星加进当前主星集合;下一张表走 `pd_range_stability` 门。
|
||||
- **修复**:细运区间稳定(`stable`)时照旧标「是」;否则只当前细运主星的那一行写「仅为细运主星(按填写的出生时刻)」,不写「是」。
|
||||
- **验证**:同一测试文件(公开盘 Steve Jobs 正好是这种情况)。
|
||||
- **防复发**:两张表用同一个细运稳定性结果。开场导读与逐宫文字也无条件计入细运,留待后续统一。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2368 | KP 宫头表把「有很强层级的显著星」写成「宫头承诺清晰」
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(E05):英文「Clear cusp promise」、导语「has a clear promise」,中文导语「宫头承诺较清晰」。
|
||||
- **根因**:`report_render/upstream_sync_chapters.py::_promise_judgement` 只要很强层级非空就下此判断;KP 的宫头承诺看宫头副主,不看显著星数量。
|
||||
- **修复**:改为「有很强层级的显著星,可作为该主题的核对线索」,导语同步;逻辑不变。
|
||||
- **验证**:同一测试文件;`tests/test_report_upstream_sync_20261107.py` 第 109 行按原值/新值/原因更新。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2369 | Yoga 措辞与实际核对不符:总括写「取消条件没有核对」,单页写「本规则的条件满足」
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(E07、E08):技法边界一句写取消条件没有核对,而各 Yoga 页列出了具体取消条件;单页在只有检测器命中时写「本规则的条件满足」,同段又说强度和完整定义没核。
|
||||
- **根因**:`report_render/audit_chapters.py` 的固定句;`pl9_interpretation_packs.py` 在 `formed_under_source` 为假时的「构型」句。
|
||||
- **修复**:边界句改为「已做的取消、减弱检查写在各 Yoga 页里;没有拿现实事件核对」;构型句改为「检测规则匹配到这个格局;是否完全符合它的具名定义,还没有逐条核对」(「条件满足」只留给按具名定义成立的情况)。
|
||||
- **验证**:同一测试文件;`tests/test_yoga_page_parts_2233.py` 按原值/新值/原因更新。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2370 | 落陷化解条件里「月亮以月亮为参照」没有标自我参照
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(E09):化解条件列出「落陷星座主月亮在月亮起第 1 宫」,与其他独立条件并列,只在段末笼统说自我参照只记录。
|
||||
- **根因**:`pl9_interpretation_packs._neecha_condition_lines` 按行星判断自我参照(`self_reference_witnesses`);月亮同时满足另一条独立条件时就不算自我参照,这一条失去标记。`tithi_lord_report.py` 直接拼接全部条件。
|
||||
- **修复**:按条件自身的 `self_reference` / `witness_is_reference` / `independent_confirmation_allowed=False` 标记,两处一致;条件仍显示(负责人 11-24 裁定保留但不计独立化解),标签「落陷;有缓解」不变。
|
||||
- **验证**:同一测试文件(虚构条件)。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2371 | 阅读说明缺「用户经历只用于生时纠正」,且只要求交叉两套大运
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(M20、M21):报告开头给 AI 的阅读说明没有反馈隔离规则;应期一条只写交叉 Vimshottari 与 Narayana。
|
||||
- **修复**:`report_render/opening_guide.py` 中英各加一条:本人讲述的经历只在明确的出生时间纠正中使用,普通判断不据此改变事件选择、权重、方向或结论;应期一条改为按主题用上所有适用且已算出的体系(两套大运是最低),分别说支持、反对、阶段变化,不当投票。
|
||||
- **验证**:同一测试文件;英文公开泄漏测试通过。
|
||||
- **关联记录**:BUG-1980(问答侧反馈隔离)。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2372 | 技法审计表把「外部核对进度」「解释来源索引」标成「计算完成,主要依据」
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(E10):这两行标「Calculation completed, primary interpretive basis」,同行说明却写外部核对只完成一部分。
|
||||
- **根因**:引擎对有记录的行一律给 `used`,`report_render/technique_status_axes.py` 把 `used` 映射成「主要依据」。
|
||||
- **修复**:在渲染层把这两行的解释状态定为「仅观察」,外部核对进度的计算状态为「部分完成」。没有改冻结的 `jyotish_engine.py`。
|
||||
- **验证**:同一测试文件。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2373 | Shadbala 只印 Saptavargaja 合计,没有七个分盘各自的分值
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(M12)。引擎已返回 `sapta_d1/d2/d3/d7/d9/d12/d30`。
|
||||
- **修复**:`report_render/parity_chapters.py` 在 Sthana、Kala 细项后加一张「Saptavargaja 各分盘分值」表。
|
||||
- **验证**:同一测试文件(两张公开盘中英文)。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2374 | 年运 Manahoo 把相位双方中的一颗当成干扰星
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:核对占星师 M10 时发现:年运具名 Yoga 表出现「Manahoo|水星、土星|干扰星土星」。
|
||||
- **根因**:`tajika_named_yoga_governed_draft.py` 只排除较快的那颗(`malefic == faster`);PVR 29.2.7 要求另一颗凶星。上游 322e2f30 已改为 `malefic in pair`。
|
||||
- **修复**:移植上游判断。
|
||||
- **验证**:同一测试文件(虚构盘 + 两张公开盘)。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2375 | KP 三年流月表按 Lahiri 起运,且没写明口径
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(E06):流月表的大运主星(土星/计都)与主大运表(Raman:土星/金星)不同,表里没写用什么岁差和月亮起运。核对发现月表走了非专用分支:月亮起运、KP 星主和行运都按 Lahiri 算,与 KP 宫头(Krishnamurti)不是一套。
|
||||
- **根因**:`jyotish_engine.py` 调 `build_kp_monthly_report_packet` 时没传 `additional_timing_systems` / `source_natal_chart`(上游传了),于是 `kp_monthly_report_packet.py` 回退到 Lahiri。
|
||||
- **修复**:按上游同一调用补传两项(负责人 2026-11-25 批准改冻结文件这一处);月表导语下加一句口径说明:按 KP 口径从月亮起算(Krishnamurti 岁差、平交点、Placidus 宫头、月亮所在星宿),与主大运表各按自己的口径读,日期不混用。
|
||||
- **验证**:`tests/test_report_audit_fixes_2366_2374.py`(公开盘月表 `natal_kp.kp_profile.ayanamsa == "kp"`,中英文口径句);KP 月表相关测试通过。对照盘按 KP 起运仍是土星/计都,即主星不同本身不是错,缺的是口径。生成时间不变(约 40 秒)。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
## BUG-2376 | 年度连续运动只列精选事件,其余只给数量
|
||||
|
||||
- **状态**:resolved(待 staging 验收)
|
||||
- **现象**:占星师对照(M09):每年约 920 个事件,附录只列 34–68 个,月亮及其余只计数,读报告的人或 AI 查不到哪天哪对星。
|
||||
- **修复**:负责人 2026-11-25 选「放附录,正文不变」:`report_render/annual_motion_appendix.py` 每年末加「全部事件」表(序号、时间、类型、行星、角度或换座),精选表和计数不变;说明句同步。三年约 2,900 行,报告长约 6%。
|
||||
- **验证**:同一测试文件(行数等于该年事件数);`tests/test_annual_motion_appendix_2317.py` 月亮断言按原值/新值/原因改为只查精选表。
|
||||
- **修复版本**:分支 `claude/report-audit-1125`。
|
||||
|
||||
@@ -316,7 +316,6 @@ def _candidate_recast(
|
||||
return None
|
||||
import domain_calculation_service
|
||||
import jaimini
|
||||
import kp_system
|
||||
import varga
|
||||
|
||||
chart = domain_calculation_service.compute_chart({
|
||||
@@ -359,7 +358,7 @@ def _candidate_recast(
|
||||
"A10": padas.get("A10", {}),
|
||||
"UL": upapada,
|
||||
},
|
||||
"kp_cusps": _kp_cusp_snapshot(chart),
|
||||
"kp_cusps": _kp_cusp_snapshot(chart, lat, lon),
|
||||
}
|
||||
|
||||
|
||||
@@ -379,24 +378,32 @@ def recast_candidate_layers(
|
||||
)
|
||||
|
||||
|
||||
def _kp_cusp_snapshot(chart: dict[str, Any]) -> dict[str, Any]:
|
||||
import kp_system
|
||||
def _kp_cusp_snapshot(chart: dict[str, Any], lat: float | None, lon: float | None) -> dict[str, Any]:
|
||||
# 原值:读本命盘 houses.house_N.cusp_degree(Raman 岁差的整宫上升度数)当 KP 宫头。
|
||||
# 新值:与正式 KP 表同一来源——Placidus + Krishnamurti 岁差(observe_kp_cusps);算不出就空,不回退别的宫制。
|
||||
# 原因:BUG-2365,敏感性中央样本与正式 KP 表 1 宫星宿主/副主不一致(占星师 2026-11-25 对照 E02)。
|
||||
try:
|
||||
from scripts.rectification.kp_cusp_observation import observe_kp_cusps
|
||||
except ModuleNotFoundError: # pragma: no cover - script import
|
||||
from rectification.kp_cusp_observation import observe_kp_cusps
|
||||
|
||||
birth_info = chart.get("birth_info") if isinstance(chart.get("birth_info"), dict) else {}
|
||||
observation = observe_kp_cusps(birth_info.get("julian_day"), lat, lon)
|
||||
if observation.get("status") != "executed":
|
||||
return {}
|
||||
snapshot = {}
|
||||
for house_key in ("house_1", "house_4", "house_7", "house_10"):
|
||||
house = chart.get("houses", {}).get(house_key, {})
|
||||
degree = house.get("cusp_degree")
|
||||
if degree is None:
|
||||
for number in (1, 4, 7, 10):
|
||||
row = (observation.get("houses") or {}).get(str(number))
|
||||
if not isinstance(row, dict):
|
||||
continue
|
||||
lords = kp_system.get_kp_lords(float(degree))
|
||||
snapshot[house_key] = {
|
||||
"cusp_degree": round(float(degree) % 360, 6),
|
||||
"sign": lords.get("sign"),
|
||||
"rasi_lord": lords.get("rasi_lord"),
|
||||
"nakshatra": lords.get("nakshatra"),
|
||||
"nakshatra_lord": lords.get("nakshatra_lord"),
|
||||
"sub_lord": lords.get("sub_lord"),
|
||||
"sub_sub_lord": lords.get("sub_sub_lord"),
|
||||
snapshot[f"house_{number}"] = {
|
||||
"cusp_degree": row.get("cusp_degree"),
|
||||
"sign": row.get("sign"),
|
||||
"rasi_lord": row.get("rasi_lord"),
|
||||
"nakshatra": row.get("nakshatra"),
|
||||
"nakshatra_lord": row.get("nakshatra_lord"),
|
||||
"sub_lord": row.get("sub_lord"),
|
||||
"sub_sub_lord": row.get("sub_sub_lord"),
|
||||
}
|
||||
return snapshot
|
||||
|
||||
|
||||
@@ -158,10 +158,9 @@ def _recast_candidate_layers(
|
||||
try:
|
||||
import domain_calculation_service
|
||||
import jaimini
|
||||
import kp_system
|
||||
import varga
|
||||
except ModuleNotFoundError: # pragma: no cover - package import
|
||||
from scripts import domain_calculation_service, jaimini, kp_system, varga
|
||||
from scripts import domain_calculation_service, jaimini, varga
|
||||
|
||||
chart = domain_calculation_service.compute_chart({
|
||||
"year": candidate.year,
|
||||
@@ -187,17 +186,22 @@ def _recast_candidate_layers(
|
||||
vargas = varga.calc_all_vargas(planets, asc_lon, divisions=divisions)
|
||||
arudha = jaimini.calc_arudha_padas(int(asc_lon // 30), planets)
|
||||
padas = arudha.get("padas") or {}
|
||||
# BUG-2365:KP 宫头取 Placidus + Krishnamurti(与正式 KP 表同源),不再读 Raman 整宫上升度数。
|
||||
try:
|
||||
from scripts.rectification.kp_cusp_observation import observe_kp_cusps
|
||||
except ModuleNotFoundError: # pragma: no cover - script import
|
||||
from rectification.kp_cusp_observation import observe_kp_cusps
|
||||
observation = observe_kp_cusps(((chart.get("birth_info") or {}).get("julian_day")), lat, lon)
|
||||
kp_cusps: dict[str, Any] = {}
|
||||
for house_key in ("house_1", "house_4", "house_7", "house_10"):
|
||||
degree = ((chart.get("houses") or {}).get(house_key) or {}).get("cusp_degree")
|
||||
if degree is None:
|
||||
continue
|
||||
lords = kp_system.get_kp_lords(float(degree))
|
||||
kp_cusps[house_key] = {
|
||||
"sign": lords.get("sign"),
|
||||
"nakshatra_lord": lords.get("nakshatra_lord"),
|
||||
"sub_lord": lords.get("sub_lord"),
|
||||
}
|
||||
if observation.get("status") == "executed":
|
||||
for number in (1, 4, 7, 10):
|
||||
row = (observation.get("houses") or {}).get(str(number)) or {}
|
||||
if row:
|
||||
kp_cusps[f"house_{number}"] = {
|
||||
"sign": row.get("sign"),
|
||||
"nakshatra_lord": row.get("nakshatra_lord"),
|
||||
"sub_lord": row.get("sub_lord"),
|
||||
}
|
||||
return {
|
||||
"ascendant": ascendant,
|
||||
"varga_lagna": {key: value.get("Ascendant") or {} for key, value in vargas.items()},
|
||||
|
||||
@@ -1821,6 +1821,18 @@ def _attach_full_report_pack(packet: dict, args) -> dict:
|
||||
},
|
||||
start_month=f'{monthly_start_year:04d}-01',
|
||||
month_count=36,
|
||||
# 原值:不传下列两项,月表走非专用分支,月亮起运、KP 星主与行运都按 Lahiri 算。
|
||||
# 新值:与上游 jyotish_engine.py 同一调用,走专用 KP 口径(KP 岁差、平交点)。
|
||||
# 原因:BUG-2375,占星师 2026-11-25 对照 E06;负责人 2026-11-25 批准改冻结文件这一处。
|
||||
source_natal_chart=modules.get('chart') or {},
|
||||
additional_timing_systems={
|
||||
name: (modules.get('jaimini', {}).get('chara_dasha', {}) if name == 'chara'
|
||||
else modules.get(module_key) or timing.get(module_key) or {})
|
||||
for name, module_key in (
|
||||
('natal_vimshottari', 'dasha'), ('narayana', 'narayana_dasha'),
|
||||
('yogini', 'yogini_dasha'), ('ashtottari', 'ashtottari_dasha'),
|
||||
('chara', 'chara_dasha'))
|
||||
},
|
||||
)
|
||||
elif isinstance(advanced, dict):
|
||||
advanced['kp_monthly_report'] = {
|
||||
|
||||
@@ -19,6 +19,11 @@ from datetime import datetime, timedelta
|
||||
from bisect import bisect_right
|
||||
from fractions import Fraction
|
||||
|
||||
if __package__:
|
||||
from .kp_system import get_kp_lords, KP_LORDS
|
||||
else:
|
||||
from kp_system import get_kp_lords, KP_LORDS
|
||||
|
||||
# Exact star openings. float(Fraction) is the grid cmd_dasha must share with
|
||||
# lon_to_nakshatra; 360/27 and modulo disagree at several of these points.
|
||||
_NAK_SPAN = Fraction(40, 3)
|
||||
@@ -306,23 +311,17 @@ def calc_sub_lord(longitude: float, division: int = 9) -> Dict:
|
||||
longitude: 恒星黄道经度
|
||||
division: 细分层级(9=Sub-Lord, 81=Sub-Sub-Lord)
|
||||
"""
|
||||
# 主星宿
|
||||
# 原值:星宿按 9 等分取副主(注释自称「简化版」),报告「星宿参照」表却写「按 Vimshottari 年数比例不等分」。
|
||||
# 新值:与 kp_system.get_kp_lords 同一比例划分(上游 322e2f30 同名函数)。
|
||||
# 原因:BUG-2364,占星师 2026-11-25 对照发现 5 颗星副主与同一黄经不符。
|
||||
if isinstance(division, bool) or division not in (9, 81):
|
||||
raise ValueError('division must be 9 (sub) or 81 (sub-sub)')
|
||||
nak = find_nakshatra(longitude)
|
||||
nak_span = 360.0 / 27
|
||||
|
||||
# Sub-Lord: 当前版本为简化版,直接按9等分。
|
||||
# 完整 KP 体系应按 Vimshottari 年数比例不等分,后续需单独对标。
|
||||
kp = get_kp_lords(longitude)
|
||||
nak_lord = NAK_LORDS[nak['nakshatra_idx']]
|
||||
deg_in_nak = nak['degree_in_nakshatra']
|
||||
|
||||
# 简化版:直接按9等分
|
||||
sub_span = nak_span / 9
|
||||
sub_idx = int(deg_in_nak / sub_span) % 9
|
||||
|
||||
# Sub-Lord是第sub_idx个行星(从星宿守护星开始的大运顺序)
|
||||
DASHA_ORDER = ["Ketu","Venus","Sun","Moon","Mars","Rahu","Jupiter","Saturn","Mercury"]
|
||||
nak_lord_idx = DASHA_ORDER.index(NAK_LORDS[nak['nakshatra_idx']])
|
||||
sub_lord = DASHA_ORDER[(nak_lord_idx + sub_idx) % 9]
|
||||
sub_lord = kp['sub_lord']
|
||||
sub_idx = (KP_LORDS.index(sub_lord) - KP_LORDS.index(nak_lord)) % 9
|
||||
|
||||
return {
|
||||
'nakshatra': nak['nakshatra'],
|
||||
@@ -331,6 +330,10 @@ def calc_sub_lord(longitude: float, division: int = 9) -> Dict:
|
||||
'sub_index': sub_idx,
|
||||
'pada': nak['pada'],
|
||||
'degree_in_nakshatra': round(deg_in_nak, 4),
|
||||
'sub_sub_lord': kp['sub_sub_lord'],
|
||||
'selected_lord': sub_lord if division == 9 else kp['sub_sub_lord'],
|
||||
'division': division,
|
||||
'method': 'kp_vimshottari_proportional',
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1125,10 +1125,11 @@ def build_yoga_interpretation_pack(
|
||||
# configuration is met, what limits it, and how it links to the current period. 「按该定义构型满足」
|
||||
# only when the formation contract confirms the named definition; a detector hit alone is not that.
|
||||
limits = entry.get("limits") or []
|
||||
# BUG-2369: a detector match is not 'conditions hold'; that wording is kept for formed_under_source.
|
||||
if zh:
|
||||
sections["formation"] = (
|
||||
"构型:按该格局的具名定义,条件满足。" if entry.get("formed_under_source")
|
||||
else "构型:本规则的条件满足;是否完全符合这个格局的具名定义,还没有逐条核对。"
|
||||
else "构型:检测规则匹配到这个格局;是否完全符合它的具名定义,还没有逐条核对。"
|
||||
)
|
||||
sections["limits"] = (
|
||||
f"限制发挥的因素:{';'.join(limits)}。" if limits
|
||||
@@ -1140,7 +1141,7 @@ def build_yoga_interpretation_pack(
|
||||
else:
|
||||
sections["formation"] = (
|
||||
"Configuration: met under the yoga's named definition." if entry.get("formed_under_source")
|
||||
else "Configuration: this rule's conditions hold; whether they fully match the yoga's named definition has not been checked item by item."
|
||||
else "Configuration: the detection rule for this yoga matched; whether it fully meets the named definition has not been checked item by item."
|
||||
)
|
||||
sections["limits"] = (
|
||||
f"What limits it: {'; '.join(limits)}." if limits
|
||||
@@ -1428,7 +1429,11 @@ def _neecha_condition_lines(roles: dict, language: str, condition_text, state: s
|
||||
parts = []
|
||||
for index, item in enumerate(roles.get("conditions") or []):
|
||||
witness = _planet(item.get("planet"), language) if item.get("planet") else ("未列出" if zh else "not listed")
|
||||
if item.get("planet") in roles.get("self_reference_witnesses", []):
|
||||
# BUG-2370: self-reference is a property of the condition (Moon judged from the Moon), not only of the
|
||||
# planet; a planet that also meets an independent condition used to lose the marker on this one.
|
||||
if (item.get("planet") in roles.get("self_reference_witnesses", [])
|
||||
or item.get("self_reference") or item.get("witness_is_reference")
|
||||
or item.get("independent_confirmation_allowed") is False):
|
||||
witness += "(自我参照,不作独立印证)" if zh else " (self-reference, not independent support)"
|
||||
if zh:
|
||||
ordinal = _ZH_ORDINALS[index] if index < len(_ZH_ORDINALS) else str(index + 1)
|
||||
|
||||
@@ -3914,6 +3914,7 @@ def render_pl9_parity_markdown(packet: dict) -> str:
|
||||
except ModuleNotFoundError: # pragma: no cover
|
||||
from report_render.appendix_language import lord_dasha_cell
|
||||
active_lords = set()
|
||||
_pd_lord = None
|
||||
current_dasha = _dict(timing.get('dasha')).get('current_dasha') if isinstance(timing.get('dasha'), dict) else {}
|
||||
if isinstance(current_dasha, dict) and current_dasha.get('lord'):
|
||||
active_lords.add(str(current_dasha.get('lord')))
|
||||
@@ -3922,7 +3923,21 @@ def render_pl9_parity_markdown(packet: dict) -> str:
|
||||
active_lords.add(str(ad.get('lord')))
|
||||
for pd in _list(ad.get('pratyantar_dasha_timeline')):
|
||||
if isinstance(pd, dict) and pd.get('is_current') and pd.get('lord'):
|
||||
active_lords.add(str(pd.get('lord')))
|
||||
_pd_lord = str(pd.get('lord'))
|
||||
# BUG-2367: the next table drops the PD unless its range stability is 'stable'. Here a lord that
|
||||
# is only the current PD lord says so, instead of a plain Yes that contradicts that table.
|
||||
_pd_only = None
|
||||
if _pd_lord and _pd_lord not in active_lords:
|
||||
try:
|
||||
from scripts.report_render.pd_range_stability import attach_pd_range_stability
|
||||
except ModuleNotFoundError: # pragma: no cover
|
||||
from report_render.pd_range_stability import attach_pd_range_stability
|
||||
if _dict(attach_pd_range_stability(packet)).get('status') == 'stable':
|
||||
active_lords.add(_pd_lord)
|
||||
else:
|
||||
_pd_only = _pd_lord
|
||||
elif _pd_lord:
|
||||
active_lords.add(_pd_lord)
|
||||
_neecha = neecha_states(packet)
|
||||
_lord_status = {}
|
||||
for index in range(1, 13):
|
||||
@@ -3935,7 +3950,7 @@ def render_pl9_parity_markdown(packet: dict) -> str:
|
||||
_lord_status.setdefault(str(lord), lord_row.get('status') or lord_row.get('dignity'))
|
||||
lines.append(
|
||||
f"| {index} | {_cell(_token(house.get('cusp_sign') or house.get('sign')))} | {_cell(_token(lord))} | "
|
||||
f"{_cell(placement)} | {_cell(_dignity_label(lord_row.get('status') or lord_row.get('dignity'), _lang, str(lord), _neecha))} | {_cell(lord_dasha_cell(str(lord) in active_lords, bool(active_lords), _lang))} |"
|
||||
f"{_cell(placement)} | {_cell(_dignity_label(lord_row.get('status') or lord_row.get('dignity'), _lang, str(lord), _neecha))} | {_cell(('PD only, at the entered birth minute' if _lang == 'en' else '仅为细运主星(按填写的出生时刻)') if _pd_only and str(lord) == _pd_only else lord_dasha_cell(str(lord) in active_lords, bool(active_lords), _lang))} |"
|
||||
)
|
||||
_notes = neecha_table_notes(list(_lord_status), _lord_status, _neecha, _lang)
|
||||
if _notes:
|
||||
|
||||
@@ -43,11 +43,11 @@ REASON_WORDS = {
|
||||
}
|
||||
FULL_LIST_RULE = {
|
||||
"zh": ("表中完整列出本年具名 Yoga 各行星对自己的精确成相、年主星与 Muntha 主星之间的精确成相,以及年主星、Muntha 主星的换座和停滞;"
|
||||
"月亮约两天半换一个星座,它的事件和其余事件只按种类计数(月亮那几对的第一次精确成相见后面的 Yoga 表)。"),
|
||||
"月亮约两天半换一个星座,它的事件和其余事件在这张表里只按种类计数;每年最后的「全部事件」按时间列出本年每一个事件。"),
|
||||
"en": ("The table lists in full each named-yoga pair's own exact contacts this year, the exact contacts between the year lord "
|
||||
"and the Muntha lord, and the year lord's and Muntha lord's sign changes and stations; the Moon changes sign about every "
|
||||
"two and a half days, so its events and all other events are only counted by kind (the first exact contact of each "
|
||||
"Moon pair is in the yoga table below)."),
|
||||
"two and a half days, so this table only counts its events and all other events by kind; the \"all events\" list at the "
|
||||
"end of each year gives every event in order."),
|
||||
}
|
||||
BOUNDARY = {
|
||||
"zh": "精确成相的时刻是算出的行星运行,不是人生事件的日期;Yoga 表里的成相记录也不表示这条 Yoga 已按传统完成兑现。",
|
||||
@@ -296,6 +296,16 @@ def _year_lines(year: str, pack: dict, language: str) -> list[str]:
|
||||
("、" if zh else ", ").join(others) or "—", *_row_evidence_cells(row, events, clock, language)))
|
||||
lines.extend(_table(header, body))
|
||||
lines.append("")
|
||||
# BUG-2376 (占星师 2026-11-25 M09; 负责人同意「放附录,正文不变」): every event of the year, in order, so a
|
||||
# reader or a model can find which day and which pair; the selection above stays as the readable part.
|
||||
if events:
|
||||
lines.extend([f"#### {year} 年全部事件" if zh else f"#### {year}: all events", ""])
|
||||
header = ("序号", "时间", "类型", "行星", "角度或换座") if zh else ("No.", "Time", "Kind", "Planets", "Angle or sign change")
|
||||
lines.extend(_table(header, [(str(number), clock.local(event.get("timestamp_local")),
|
||||
KIND_WORDS.get(event.get("kind"), {}).get(language, "—"),
|
||||
_planets(event.get("planets"), language), _change_text(event, language))
|
||||
for number, event in enumerate(events, 1)]))
|
||||
lines.append("")
|
||||
return lines
|
||||
|
||||
|
||||
|
||||
@@ -518,15 +518,16 @@ def _boundaries(packet: dict, language: str) -> list[str]:
|
||||
double = _dict(timing.get("double_transit_pac"))
|
||||
ledger = _dict(_dict(_dict(packet.get("full_report_pack")).get("sections")).get("d1_d60_ledger"))
|
||||
lines = []
|
||||
# BUG-2369: the old line said cancellation was never checked, contradicting the yoga pages.
|
||||
if en:
|
||||
lines.append("- Yogas are rule matches (candidates). Cancellation conditions and real events are not checked, so no yoga is stated as confirmed.")
|
||||
lines.append("- Yogas are rule matches. The cancellation and weakening checks that were run are listed on each yoga page; no yoga is checked against real events.")
|
||||
lines.append("- Timing is stated to the month at most; no statement names an exact day.")
|
||||
if double:
|
||||
lines.append("- Double Transit is a reference-date observation, not an event prediction or a calibrated timing result.")
|
||||
if ledger:
|
||||
lines.append("- Only the 20 formal divisions may be read, inside their own boundaries; the 40 research D-N rows are raw data.")
|
||||
else:
|
||||
lines.append("- Yoga 是按规则匹配出的候选;取消条件与现实事件没有核对,不写成已成立。")
|
||||
lines.append("- Yoga 是按规则匹配出的结果;已做的取消、减弱检查写在各 Yoga 页里;没有拿现实事件核对。")
|
||||
lines.append("- 时间判断最多说到月份,不点具体哪一天。")
|
||||
if double:
|
||||
lines.append("- 双重行运(Double Transit)是参考日的观察,不是事件预测,也不是校准过的应期。")
|
||||
|
||||
@@ -97,7 +97,10 @@ def reading_guide(language: str) -> str:
|
||||
"- 大运、小运、细运是同一套大运的三层,上下层要对应着看。不要把不同大运体系的日期拼在一起;星座大运的「主星」一栏可能是星座。",
|
||||
"- 角度单位是度(°)。力量分数按各表自己的单位,Virupa 和 Rupa 不要混。传统分盘与研究型分盘分开看。",
|
||||
"- 「—」「未判定」「规则未单列」表示缺数据或核对受限,不等于零,也不等于没有影响。计算结果、传统含义、条件推论和已核实事实要分开说;冲突照实保留,候选时间窗只是候选,不要当作已定的事。",
|
||||
"- 回答应期问题时,引用具体章节、行星、数值和日期区间;交叉看相关分盘、功能吉凶、Vimshottari 与 Narayana 两套大运,再说明哪里一致、哪里不一致;依据不够的地方,说清具体缺哪项计算或规则。",
|
||||
# BUG-2371 (占星师 2026-11-25 M21):两套大运是最低要求,不是上限。
|
||||
"- 回答应期问题时,引用具体章节、行星、数值和日期区间;按问题的主题,把本文件里所有适用且已经算出的体系都用上(至少 Vimshottari 与 Narayana 两套大运,再加相关分盘、功能吉凶、年盘等),分别说支持、反对和阶段变化,再说明哪里一致、哪里不一致;不要把几个体系当成投票。依据不够的地方,说清具体缺哪项计算或规则。",
|
||||
# BUG-2371 (M20):用户经历只用于生时纠正。
|
||||
"- 本人讲述的经历或对过去的反馈,只在明确进行出生时间纠正时使用;普通的运势和应期判断不能据此改变选哪些事件、各项权重、判断方向或结论。",
|
||||
])
|
||||
return "\n".join([
|
||||
"## AI Reading Guide",
|
||||
@@ -109,7 +112,8 @@ def reading_guide(language: str) -> str:
|
||||
"- MD / AD / PD mean Mahadasha / Antardasha / Pratyantardasha. Do not splice dates from different Dasha systems. A sign-based Dasha lord field can name a sign rather than a planet.",
|
||||
"- Angles are in degrees (°). Strength scores use each table's units; do not confuse Virupas and Rupas. Keep traditional and research divisional charts distinct.",
|
||||
"- An em dash (—), \"not determined\" or \"not listed by the rule\" means missing data or a verification limit, never zero or absence of influence. Distinguish computed data, traditional meanings, conditional inferences and verified facts. Preserve conflicts and do not turn candidate windows into certain events.",
|
||||
"- Ground timing answers in named sections, bodies, values and date ranges. Cross-check relevant divisional charts, functional benefic/malefic roles, Vimshottari and Narayana, then state agreement and disagreement; where the evidence falls short, name the missing calculation or rule.",
|
||||
"- Ground timing answers in named sections, bodies, values and date ranges. For the topic asked, use every applicable system already calculated in this file (at least Vimshottari and Narayana, plus the relevant divisional charts, functional benefic/malefic roles and annual charts); state what supports, what argues against and how phases change, then where they agree and disagree. Do not treat the systems as votes. Where the evidence falls short, name the missing calculation or rule.",
|
||||
"- Life experiences or feedback the person reports are used only in an explicit birth-time rectification. Ordinary readings and timing must not change which events are considered, their weights, the direction or the conclusion because of them.",
|
||||
])
|
||||
|
||||
|
||||
|
||||
@@ -2092,9 +2092,24 @@ def _shadbala_component_tables(rows: list[dict], language: str) -> str:
|
||||
if kala_rows:
|
||||
parts.append(("Kala 细项(Virupa):" if zh else "Kala sub-parts (Virupa):") + "\n\n" + _md_table(
|
||||
["行星" if zh else "Planet"] + [label for _key, label in _KALA_PARTS], kala_rows))
|
||||
# BUG-2373 (占星师 2026-11-25 M12): Saptavargaja by chart — the engine returns each of the seven
|
||||
# charts' share (sapta_d1 … sapta_d30); only the total was printed.
|
||||
sapta_rows = []
|
||||
for item in rows:
|
||||
sthana = item.get("sthana_bala") if isinstance(item.get("sthana_bala"), dict) else {}
|
||||
if any(sthana.get(f"sapta_{chart}") is not None for chart in _SAPTA_CHARTS):
|
||||
sapta_rows.append([show(item["planet"], language, "planet")]
|
||||
+ [_num_cell(sthana.get(f"sapta_{chart}"), language) for chart in _SAPTA_CHARTS]
|
||||
+ [_num_cell(sthana.get("sapta_score"), language)])
|
||||
if sapta_rows:
|
||||
parts.append(("Saptavargaja 各分盘分值(Virupa):" if zh else "Saptavargaja by chart (Virupa):") + "\n\n" + _md_table(
|
||||
["行星" if zh else "Planet"] + [chart.upper() for chart in _SAPTA_CHARTS] + ["合计" if zh else "Total"], sapta_rows))
|
||||
return "\n\n".join(parts)
|
||||
|
||||
|
||||
_SAPTA_CHARTS = ("d1", "d2", "d3", "d7", "d9", "d12", "d30")
|
||||
|
||||
|
||||
def _coordinates(packet: dict, language: str) -> str:
|
||||
"""BUG-2088 (astrologer reply B2): the real equatorial declination beside the Ayana angle.
|
||||
|
||||
|
||||
@@ -109,9 +109,18 @@ def technique_audit_axes(packet, row):
|
||||
axes["calculation_gap"] = "calculation_result_missing"
|
||||
elif status and axes["calculation_status"] == "blocked" and status not in ("blocked", "not_run", "not run", "未完成"):
|
||||
axes["calculation_gap"] = status
|
||||
# BUG-2372: progress and index rows are not an interpretive basis. "External Oracle Progress" was printed
|
||||
# as "calculation completed, primary interpretive basis" while its own note says the checks are partial.
|
||||
if row.get("technique") in _INDEX_ROWS:
|
||||
axes["interpretation_status"] = "observation_only"
|
||||
if row.get("technique") == "External Oracle Progress" and axes["calculation_status"] == "executed":
|
||||
axes["calculation_status"] = "partial"
|
||||
return axes
|
||||
|
||||
|
||||
_INDEX_ROWS = ("External Oracle Progress", "Interpretation Source Pack")
|
||||
|
||||
|
||||
def technique_audit_text(row, axes, language):
|
||||
calculation = axes["calculation_status"]
|
||||
interpretation = axes["interpretation_status"]
|
||||
|
||||
@@ -163,7 +163,13 @@ def tithi_lord_lines(module: Any, language: str, dignity_label=None) -> list[str
|
||||
cancellation = _record(module.get("cancellation"))
|
||||
state = cancellation.get("status")
|
||||
conditions = [item for item in cancellation.get("conditions") or [] if isinstance(item, dict)]
|
||||
condition_words = (";" if zh else "; ").join(condition_text(item, language) for item in conditions)
|
||||
# BUG-2370: a self-reference condition stays visible but is marked, as on the yoga page.
|
||||
def _marked(item: dict) -> str:
|
||||
text = condition_text(item, language)
|
||||
if item.get("self_reference") or item.get("witness_is_reference") or item.get("independent_confirmation_allowed") is False:
|
||||
text += "(自我参照,不作独立印证)" if zh else " (self-reference, not independent support)"
|
||||
return text
|
||||
condition_words = (";" if zh else "; ").join(_marked(item) for item in conditions)
|
||||
roles = neecha_roles({"name": "Neecha Bhanga", "planets": [lord], "cancellation_conditions": conditions}) if conditions else None
|
||||
if state == "conditions_met":
|
||||
cancel = (f"有化解条件:{condition_words}。见证星:{witness_list_text(roles, language)}。原始尊贵仍是落陷,化解条件不改写它。" if zh
|
||||
|
||||
@@ -307,8 +307,9 @@ def _cusp_text(row: dict, language: str) -> str:
|
||||
|
||||
|
||||
def _promise_judgement(significators: dict, language: str) -> str:
|
||||
# BUG-2368: a very strong significator is a lead, not a cuspal promise (KP promise is the cusp sub-lord's job).
|
||||
if significators.get("A") not in (None, "", [], ()):
|
||||
return ("宫头承诺线索清晰,可作为该主题的专项核对入口", "Clear cusp promise; a usable entry for this theme")[_lang(language)]
|
||||
return ("有很强层级的显著星,可作为该主题的核对线索", "A very strong significator is present; a lead to check for this theme")[_lang(language)]
|
||||
if any(significators.get(key) not in (None, "", [], ()) for key in ("B", "C")):
|
||||
return ("宫头已有局部牵连,但不足以单独支撑结论", "Partial links; not enough on its own")[_lang(language)]
|
||||
return ("宫头牵连偏弱,只作补充观察", "Weak links; supplementary only")[_lang(language)]
|
||||
@@ -340,9 +341,9 @@ def _kp_section(packet: dict, language: str) -> list[str]:
|
||||
"",
|
||||
"### KP Cuspal Promise (house-level judgement)" if en else "### KP Cuspal Promise(宫头承诺 / 宫位判断)",
|
||||
"",
|
||||
("Each cusp with its theme and the planets signifying it. A house with a planet at the very strong level has a clear promise; "
|
||||
"this is still not an event chain." if en else
|
||||
"每个宫头连同主题与牵连它的行星。「很强」一层有星的宫,宫头承诺较清晰;这仍不是事件链,也不单独给出应期。"),
|
||||
("Each cusp with its theme and the planets signifying it. A planet at the very strong level makes the house a lead worth checking; "
|
||||
"it is not a promise of an event and gives no timing." if en else
|
||||
"每个宫头连同主题与牵连它的行星。「很强」一层有星的宫,是值得核对的线索;不等于事件承诺,也不单独给出应期。"),
|
||||
"",
|
||||
*_table(("House", "Cusp", "Theme", *levels, "Judgement", "Status") if en
|
||||
else ("宫位", "宫头", "主题", *levels, "宫位判断", "状态"),
|
||||
@@ -467,6 +468,27 @@ def _sign_changes(previous: dict, current: dict, language: str) -> list[str]:
|
||||
return out
|
||||
|
||||
|
||||
def _monthly_profile_line(monthly: dict, language: str) -> list[str]:
|
||||
"""BUG-2375 (占星师 2026-11-25 E06): say which profile seeds these dasha levels.
|
||||
|
||||
The monthly table counts Vimshottari from the Moon under the KP profile, so its lords can differ from
|
||||
the main dasha tables (report ayanamsa). Without this line the two read as one result.
|
||||
"""
|
||||
natal = _dict(monthly.get("natal_kp"))
|
||||
if _dict(natal.get("kp_profile")).get("ayanamsa") != "kp":
|
||||
return []
|
||||
moon = _dict(_dict(_dict(natal.get("planets")).get("Moon")).get("kp_lords"))
|
||||
star = moon.get("nakshatra")
|
||||
if language == "en":
|
||||
where = f" (Moon in {star})" if star else ""
|
||||
return [f"These dasha levels are counted from the Moon under the KP profile: Krishnamurti ayanamsa, mean node, "
|
||||
f"Placidus cusps{where}. They can differ from the main Vimshottari tables, which use this report's ayanamsa; "
|
||||
"read each table in its own system and do not mix their dates.", ""]
|
||||
where = f"(月亮在 {star})" if star else ""
|
||||
return [f"本表的大运层级按 KP 口径从月亮起算:Krishnamurti 岁差、平交点、Placidus 宫头{where}。它可能与前面主大运表"
|
||||
"(本报告所用岁差)不同;两张表各按自己的口径读,日期不要混用。", ""]
|
||||
|
||||
|
||||
def _monthly_section(packet: dict, language: str) -> list[str]:
|
||||
en = language == "en"
|
||||
sensitive = _status("parameter_sensitive", language)
|
||||
@@ -486,6 +508,7 @@ def _monthly_section(packet: dict, language: str) -> list[str]:
|
||||
f"{months[0]['month']} 至 {months[-1]['month']},共 {len(months)} 个月。每月列出月锚点(当月 1 日本地正午)的五层 "
|
||||
"Vimshottari、出生时刻主宰星、当月触发的宫头与慢行星换座。只是支持层,不是事件预测。"),
|
||||
"",
|
||||
*_monthly_profile_line(monthly, language),
|
||||
])
|
||||
by_year: dict[str, list[dict]] = {}
|
||||
for row in months:
|
||||
|
||||
@@ -253,7 +253,9 @@ def _derived_named_yoga_rows(
|
||||
continue
|
||||
faster = max(pair, key=lambda planet: abs(float(planets[planet]["speed"])))
|
||||
for malefic in ("Mars", "Saturn"):
|
||||
if malefic == faster:
|
||||
# BUG-2374 (upstream 322e2f30): PVR 29.2.7 needs the other malefic when one already belongs to the
|
||||
# applying pair; a pair member never interferes with itself (was `malefic == faster`).
|
||||
if malefic in pair:
|
||||
continue
|
||||
separation = _angular_distance(float(planets[malefic]["longitude"]), float(planets[faster]["longitude"]))
|
||||
aspect, residual = min(((angle, abs(separation - angle)) for angle in (0.0, 90.0, 180.0)), key=lambda item: item[1])
|
||||
|
||||
@@ -299,9 +299,18 @@ def build_expression_paths(modules, pages=()):
|
||||
if not item:
|
||||
varga=next((v for k,v in (modules.get('varga_full') or {}).items() if k.startswith(div+'_')), {})
|
||||
item=varga.get(p) if isinstance(varga,dict) else None
|
||||
# BUG-2366: varga_full rows carry sign_idx but no house; the house is counted from
|
||||
# that varga's own Ascendant (the data tables print it), never left as "not supplied".
|
||||
asc=(varga.get('Ascendant') or {}) if isinstance(varga,dict) else {}
|
||||
if item and item.get('house') is None and isinstance(item.get('sign_idx'),int) and isinstance(asc.get('sign_idx'),int):
|
||||
item={**item,'house':(item['sign_idx']-asc['sign_idx'])%12+1}
|
||||
if item and item.get('sign'):
|
||||
facts.append(pair(f'{div}: {p} in {item["sign"]}, house {item.get("house", "not supplied")}; separate divisional scope.',
|
||||
f'{div}:{p}在{item["sign"]},宫位{item.get("house", "未提供")};属于独立分盘范围。'))
|
||||
if item.get('house') is not None:
|
||||
facts.append(pair(f'{div}: {p} in {item["sign"]}, house {item["house"]}; separate divisional scope.',
|
||||
f'{div}:{p}在{item["sign"]},第{item["house"]}宫;属于独立分盘范围。'))
|
||||
else:
|
||||
facts.append(pair(f'{div}: {p} in {item["sign"]}; separate divisional scope.',
|
||||
f'{div}:{p}在{item["sign"]};属于独立分盘范围。'))
|
||||
chain=chains.get(p) or [];state=chain_state(chain)
|
||||
path=' → '.join([x['planet'] for x in chain]+[chain[-1]['dispositor']]) if chain and state!='missing' else 'unavailable'
|
||||
facts.append(pair(f'Dispositor path: {path}; termination: {state}. A link does not automatically transmit beneficial results.',
|
||||
|
||||
@@ -69,7 +69,11 @@ def test_each_year_has_its_own_range_method_events_and_rows():
|
||||
assert "| 换座 | 金星 | 白羊座 → 金牛座 | Muntha 主星 |" in text
|
||||
assert "| 停滞 | 土星 | 转逆行 | 年主星 |" in text
|
||||
assert "| 精确成相 | 太阳、土星 | 180° | 年主星 |" not in text # Sun is neither lord
|
||||
assert "月亮、火星 | 60°" not in text
|
||||
# 原值:整章不出现月亮事件;新值:精选表不出现,每年末「全部事件」列出全部;原因:BUG-2376(负责人 11-25 同意全表放附录)。
|
||||
selected = re.sub(r"#### \d{4} 年全部事件\n\n(?:\|.*\n)+", "", text + "\n")
|
||||
assert selected.count("### ") == 3 and "年全部事件" not in selected
|
||||
assert "月亮、火星 | 60°" not in selected
|
||||
assert "月亮、火星 | 60°" in text
|
||||
assert "其余事件:精确成相 2 次、换座 1 次、停滞 0 次。" in text
|
||||
# Row evidence, window-bounded wording, the interfering planet named.
|
||||
assert "| Ithasala | 火星、木星 | — | 1 次(只计 120°) | 2026-03-01 18:00,120° | 2 次 |" in text
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
"""BUG-2364 / BUG-2365: KP sub-lords and the birth-time sensitivity KP cusps share the formal KP sources.
|
||||
|
||||
BUG-2364: ``nakshatra_advanced.calc_sub_lord`` split each nakshatra into nine equal parts while the
|
||||
report's 「星宿参照」 table claimed Vimshottari proportions; five planets of the reviewed chart got a
|
||||
different sub-lord from the one ``kp_system.get_kp_lords`` gives for the same longitude.
|
||||
|
||||
BUG-2365: the birth-time sensitivity sample read the natal chart's whole-sign ascendant degree
|
||||
(Raman ayanamsa) as the KP cusp, so its centre minute disagreed with the formal KP cusp table
|
||||
(Placidus + Krishnamurti).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
from scripts.kp_system import get_kp_lords
|
||||
from scripts.nakshatra_advanced import calc_sub_lord
|
||||
|
||||
|
||||
def test_calc_sub_lord_equals_kp_lords_across_the_zodiac():
|
||||
step = 0.0137
|
||||
longitude = 0.0005
|
||||
while longitude < 360.0:
|
||||
assert calc_sub_lord(longitude)["sub_lord"] == get_kp_lords(longitude)["sub_lord"], longitude
|
||||
longitude += step
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("longitude", "equal_ninths", "proportional"),
|
||||
[
|
||||
# Ashwini 4.95°: equal ninths gave Moon, proportional is Mars.
|
||||
(4.9501, "Moon", "Mars"),
|
||||
# Jyeshtha 5.81°: equal ninths gave Sun, proportional is Moon.
|
||||
(232.4756, "Sun", "Moon"),
|
||||
],
|
||||
)
|
||||
def test_calc_sub_lord_is_not_equal_ninths(longitude, equal_ninths, proportional):
|
||||
result = calc_sub_lord(longitude)
|
||||
assert result["sub_lord"] == proportional != equal_ninths
|
||||
assert result["method"] == "kp_vimshottari_proportional"
|
||||
|
||||
|
||||
def test_sensitivity_centre_minute_equals_formal_kp_cusps():
|
||||
swe = pytest.importorskip("swisseph")
|
||||
del swe
|
||||
from scripts import domain_calculation_service
|
||||
from scripts.active_rectification_questions import recast_candidate_layers
|
||||
from scripts.rectification.kp_cusp_observation import observe_kp_cusps
|
||||
|
||||
# Public fixture: Steve Jobs (AA), San Francisco.
|
||||
birth = dict(lat=37.7749, lon=-122.4194, tz=-8.0)
|
||||
moment = datetime(1955, 2, 24, 19, 15)
|
||||
chart = domain_calculation_service.compute_chart({
|
||||
"year": 1955, "month": 2, "day": 24, "hour": 19, "minute": 15, "second": 0,
|
||||
**birth, "ayanamsa": "raman", "node_mode": "mean",
|
||||
})
|
||||
formal = observe_kp_cusps(chart["birth_info"]["julian_day"], birth["lat"], birth["lon"])
|
||||
assert formal["status"] == "executed"
|
||||
sample = recast_candidate_layers(moment, **birth, ayanamsa="raman", node_mode="mean")
|
||||
cusps = sample["kp_cusps"]
|
||||
assert set(cusps) == {"house_1", "house_4", "house_7", "house_10"}
|
||||
for number in (1, 4, 7, 10):
|
||||
row = cusps[f"house_{number}"]
|
||||
expected = formal["houses"][str(number)]
|
||||
assert row["cusp_degree"] == expected["cusp_degree"]
|
||||
assert (row["nakshatra_lord"], row["sub_lord"]) == (expected["nakshatra_lord"], expected["sub_lord"])
|
||||
# The whole-sign ascendant degree is not a KP cusp.
|
||||
assert cusps["house_1"]["cusp_degree"] != round(chart["houses"]["house_1"]["cusp_degree"], 4)
|
||||
@@ -0,0 +1,145 @@
|
||||
"""占星师 2026-11-25 网站稿与本地导出对照的报告修复:BUG-2366–2376(E03–E10、E06、M09、M12、M20/M21、Manahoo)。
|
||||
|
||||
只用虚构数据和公开盘(Steve Jobs / Barack Obama,AA)。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from scripts import pl9_interpretation_packs as packs
|
||||
from scripts.report_render import opening_guide
|
||||
from scripts.report_render.technique_status_axes import technique_audit_axes, technique_audit_text
|
||||
from scripts.tajika_named_yoga_governed_draft import _derived_named_yoga_rows
|
||||
from tests.public_chart_reports import public_chart_reports
|
||||
|
||||
PUBLIC = ("steve_jobs_1955_aa", "barack_obama_1961_aa")
|
||||
|
||||
|
||||
def test_varga_houses_are_counted_not_left_unsupplied() -> None:
|
||||
"""BUG-2366: D2 / D11 / D24 / D4 rows in the expression paths carry the house from that chart's own ascendant."""
|
||||
for case in PUBLIC:
|
||||
_packet, chinese, english = public_chart_reports(case)
|
||||
assert "house not supplied" not in english
|
||||
assert "宫位未提供" not in chinese
|
||||
|
||||
|
||||
def test_bhavesh_table_never_says_yes_for_an_excluded_pd() -> None:
|
||||
"""BUG-2367: a lord that is only the current PD lord is labelled so unless the PD range is stable."""
|
||||
packet, chinese, english = public_chart_reports("steve_jobs_1955_aa")
|
||||
assert (packet.get("pd_range_stability") or {}).get("status") != "stable"
|
||||
table_en = english.split("### House lords (Bhavesh)", 1)[1].split("\n\n", 2)[1]
|
||||
assert "PD only, at the entered birth minute" in table_en
|
||||
assert "仅为细运主星(按填写的出生时刻)" in chinese
|
||||
|
||||
|
||||
def test_kp_very_strong_level_is_a_lead_not_a_promise() -> None:
|
||||
"""BUG-2368."""
|
||||
for case in PUBLIC:
|
||||
_packet, chinese, english = public_chart_reports(case)
|
||||
assert "clear promise" not in english.lower() and "Clear cusp promise" not in english
|
||||
assert "宫头承诺线索清晰" not in chinese and "宫头承诺较清晰" not in chinese
|
||||
|
||||
|
||||
def test_yoga_wording_matches_what_was_checked() -> None:
|
||||
"""BUG-2369: no blanket 'cancellation not checked'; a detector match is not 'conditions hold'."""
|
||||
for case in PUBLIC:
|
||||
_packet, chinese, english = public_chart_reports(case)
|
||||
assert "Cancellation conditions and real events are not checked" not in english
|
||||
assert "取消条件与现实事件没有核对" not in chinese
|
||||
assert "this rule's conditions hold" not in english
|
||||
assert "本规则的条件满足" not in chinese
|
||||
|
||||
|
||||
def test_self_reference_is_marked_on_the_condition() -> None:
|
||||
"""BUG-2370: Moon judged from the Moon is marked even when the Moon also meets an independent condition."""
|
||||
roles = {
|
||||
"witnesses_returned": True,
|
||||
"self_reference_witnesses": [], # the Moon is also an independent witness elsewhere
|
||||
"conditions": [
|
||||
{"condition": "dispositor_kendra_from_lagna", "planet": "Moon", "reference": "Lagna"},
|
||||
{"condition": "dispositor_kendra_from_moon", "planet": "Moon", "reference": "Moon",
|
||||
"self_reference": True, "independent_confirmation_allowed": False},
|
||||
],
|
||||
}
|
||||
text = packs._neecha_condition_lines(roles, "en", lambda item, _language: item["condition"])
|
||||
first, second = text.split("Condition 2 met")
|
||||
assert "self-reference" not in first
|
||||
assert "(self-reference, not independent support)" in second
|
||||
zh = packs._neecha_condition_lines(roles, "zh", lambda item, _language: item["condition"])
|
||||
assert zh.count("(自我参照,不作独立印证)") == 1
|
||||
|
||||
|
||||
def test_reading_guide_feedback_isolation_and_all_systems() -> None:
|
||||
"""BUG-2371 (M20 / M21)."""
|
||||
zh = opening_guide.reading_guide("zh")
|
||||
en = opening_guide.reading_guide("en")
|
||||
assert "只在明确进行出生时间纠正时使用" in zh and "only in an explicit birth-time rectification" in en
|
||||
assert "至少 Vimshottari 与 Narayana" in zh and "at least Vimshottari and Narayana" in en
|
||||
assert "投票" in zh and "votes" in en
|
||||
|
||||
|
||||
def test_progress_and_index_rows_are_not_a_primary_basis() -> None:
|
||||
"""BUG-2372 (E10)."""
|
||||
for technique in ("External Oracle Progress", "Interpretation Source Pack"):
|
||||
row = {"technique": technique, "status": "used", "result": "x"}
|
||||
axes = technique_audit_axes({}, row)
|
||||
assert axes["interpretation_status"] == "observation_only"
|
||||
assert "primary interpretive basis" not in technique_audit_text(row, axes, "en")
|
||||
oracle = technique_audit_axes({}, {"technique": "External Oracle Progress", "status": "used", "result": "x"})
|
||||
assert oracle["calculation_status"] == "partial"
|
||||
|
||||
|
||||
def test_saptavargaja_is_shown_by_chart() -> None:
|
||||
"""BUG-2373 (M12)."""
|
||||
for case in PUBLIC:
|
||||
_packet, chinese, english = public_chart_reports(case)
|
||||
assert "Saptavargaja by chart (Virupa):" in english
|
||||
assert "| Planet | D1 | D2 | D3 | D7 | D9 | D12 | D30 | Total |" in english
|
||||
assert "Saptavargaja 各分盘分值(Virupa):" in chinese
|
||||
|
||||
|
||||
def test_manahoo_interferer_is_never_one_of_the_pair() -> None:
|
||||
"""BUG-2374: Saturn applying to Mercury cannot be 'interfered with' by Saturn itself."""
|
||||
planets = {
|
||||
"Sun": {"longitude": 10.0, "speed": 1.0, "house": 1},
|
||||
"Moon": {"longitude": 200.0, "speed": 13.0, "house": 7},
|
||||
"Mars": {"longitude": 250.0, "speed": 0.6, "house": 9},
|
||||
"Mercury": {"longitude": 100.0, "speed": 1.5, "house": 4},
|
||||
"Jupiter": {"longitude": 160.0, "speed": 0.1, "house": 6},
|
||||
"Venus": {"longitude": 40.0, "speed": 1.2, "house": 2},
|
||||
"Saturn": {"longitude": 102.0, "speed": 1.6, "house": 4},
|
||||
}
|
||||
base = [{"named_yoga": "Ithasala", "planets": ["Mercury", "Saturn"]}]
|
||||
rows = _derived_named_yoga_rows(planets, {"interactions": []}, base)
|
||||
for row in rows:
|
||||
if row["named_yoga"] == "Manahoo":
|
||||
assert row["interfering_planet"] not in row["planets"]
|
||||
for case in PUBLIC:
|
||||
packet, _chinese, _english = public_chart_reports(case)
|
||||
for year in ((packet.get("worksheets") or {}).get("timing_and_predictive_systems") or {}).values():
|
||||
for row in ((year or {}).get("rows") or []) if isinstance(year, dict) else []:
|
||||
if isinstance(row, dict) and row.get("named_yoga") == "Manahoo":
|
||||
assert row.get("interfering_planet") not in (row.get("planets") or [])
|
||||
|
||||
|
||||
def test_kp_monthly_table_uses_and_states_the_kp_profile() -> None:
|
||||
"""BUG-2375 (E06): the monthly dasha is seeded under the KP profile, and the table says so."""
|
||||
for case in PUBLIC:
|
||||
packet, chinese, english = public_chart_reports(case)
|
||||
monthly = packet["worksheets"]["advanced_systems"]["kp_monthly_report"]
|
||||
assert monthly["natal_kp"]["kp_profile"]["ayanamsa"] == "kp"
|
||||
assert "counted from the Moon under the KP profile" in english
|
||||
assert "按 KP 口径从月亮起算" in chinese
|
||||
|
||||
|
||||
def test_annual_motion_lists_every_event() -> None:
|
||||
"""BUG-2376 (M09): each year ends with the full ordered event list; the counts match the timeline."""
|
||||
packet, chinese, english = public_chart_reports("steve_jobs_1955_aa")
|
||||
years = packet["worksheets"]["timing_and_predictive_systems"]["annual_tajika_series"]["years"]
|
||||
for year, pack in years.items():
|
||||
events = ((pack.get("tajika_condition_status_pack") or {}).get("motion_timeline") or {}).get("events") or []
|
||||
if not events:
|
||||
continue
|
||||
heading = f"#### {year}: all events"
|
||||
assert heading in english and f"#### {year} 年全部事件" in chinese
|
||||
block = english.split(heading, 1)[1].split("\n\n", 2)[1]
|
||||
assert block.count("\n") + 1 == len(events) + 2 # header, rule, one row per event
|
||||
@@ -106,7 +106,7 @@ def test_kp_house_view_cuspal_promise_and_domain_checks() -> None:
|
||||
assert "### KP 宫位显著星(宫位视角 / Significations of the Houses)" in text
|
||||
# BUG-2019(占星师 2026-11-19 第 16 条): 原值 北交点 / 南交点(附录里是 北交点/罗睺、南交点/计都);新值 罗睺 / 计都。
|
||||
assert "| 1 | 罗睺 | 太阳 | 月亮 | 月亮 | 参数敏感 |" in text
|
||||
assert "| 1 | 巨蟹座 14.0195° | 自我、健康、性格 | 罗睺 | 太阳 | 月亮 | 月亮 | 宫头承诺线索清晰" in text
|
||||
assert "| 1 | 巨蟹座 14.0195° | 自我、健康、性格 | 罗睺 | 太阳 | 月亮 | 月亮 | 有很强层级的显著星,可作为该主题的核对线索" in text # 原值:宫头承诺线索清晰;新值:显著星线索;原因:BUG-2368
|
||||
assert "| 4 | 天秤座 4.1707° | 母亲、房产、情感 | — | — | 水星 | 金星 | 宫头已有局部牵连" in text
|
||||
for heading in ("### KP 事业宫位核对(2 / 6 / 10 / 11 宫)", "### KP 财务宫位核对(2 / 5 / 9 / 11 宫)",
|
||||
"### KP 关系宫位核对(2 / 7 / 11 宫)"):
|
||||
|
||||
@@ -11,8 +11,9 @@ def _page(row):
|
||||
def test_a_detector_hit_is_not_called_formed_under_the_named_definition():
|
||||
page = _page({"rule_id": "amala_yoga", "name": "Amala Yoga", "name_cn": "无瑕格局", "planets": ["Jupiter"],
|
||||
"combination": "吉星在10/11宫", "formation_assessment": {"status": "candidate"}})
|
||||
assert page["sections"]["formation"].startswith("构型:本规则的条件满足;是否完全符合")
|
||||
assert page["section_order"][:4] == ["detected", "formation", "limits", "activation"]
|
||||
assert page["sections"]["formation"].startswith("构型:检测规则匹配到这个格局;是否完全符合") # 原值:本规则的条件满足;新值:检测规则匹配;原因:BUG-2369
|
||||
# 原值:[:4] == detected, formation, limits, activation;新值:limits 之后是 strength(BUG-2292 加的强弱段),activation 仍在;原因:staging 上本条已失败,BUG-2369 顺手修。
|
||||
assert page["section_order"][:4] == ["detected", "formation", "limits", "strength"] and "activation" in page["section_order"]
|
||||
|
||||
|
||||
def test_confirmed_definition_and_returned_limits_are_named():
|
||||
|
||||
Reference in New Issue
Block a user