Release v6.0.41 Yoga source parity
This commit is contained in:
@@ -1,5 +1,46 @@
|
||||
# 印度占星 Skill 更新日志
|
||||
|
||||
## v6.0.41(2026-06-05)—— Yoga F1 92% 源码口径续航
|
||||
|
||||
> **目标**:在 v6.0.40 基础上继续推进残余 Yoga 误差,但仍坚持“准确率优先、源码确认后再改”;本轮只处理 PyJHora 源码定义非常明确且可稳定复现的规则。
|
||||
|
||||
### 引擎与 helper 修复
|
||||
|
||||
- `scripts/yoga_engine.py` 新增 `pyjhora_aspected_planets_of_raasi(h)`,复刻 PyJHora `house.aspected_planets_of_the_raasi()`:返回通过 Rasi Drishti 影响目标 rasi/house 的行星列表。
|
||||
- 新增 `FRIENDLY_PLANETS` 常量与 `natural_friend(a, b)` helper,对齐 PyJHora `const.friendly_planets`,用于 Matru Sneha 等需要自然友谊判断的 Yoga。
|
||||
|
||||
### 高影响规则对齐
|
||||
|
||||
- `bvr_sumukha_precise`:对齐 PyJHora/BVR-166,改为“2宫主在 Kendra 且被 PyJHora natural benefics 影响,或 natural benefics 入2宫”,不再只检查 Jupiter/Venus 入2宫。
|
||||
- `bvr_dama_yoga`:从占位规则改为 PyJHora/BVR-92 Dama/Damni Yoga 源码口径:七曜分布在恰好六个星座。
|
||||
- `bvr_matru_sneha_yoga`:补齐 PyJHora Matru Sneha 的自然友谊分支,并使用 PyJHora natural benefics 判断 L1/L4 是否同受吉星影响。
|
||||
|
||||
### 验证结果
|
||||
|
||||
- `scripts/validate_logic_v2.py`:
|
||||
- Precision **94.82%**(v6.0.40 为 94.63%)
|
||||
- Recall **90.92%**(v6.0.40 为 89.04%)
|
||||
- F1 **92.83%**(v6.0.40 为 91.75%)
|
||||
- FP:53;FN:97
|
||||
- `scripts/run_quality_gate.py --skip-yoga-logic`:通过。
|
||||
- pytest **35 passed**
|
||||
- BPHS/Ashtakavarga 不变量 **18/18**
|
||||
- golden case 通过
|
||||
- capability audit valid,0 problem / 0 warning
|
||||
|
||||
### 规则库状态
|
||||
|
||||
- JSON 规则总数:**475**
|
||||
- 启用规则:**381**
|
||||
- 当前验证报告:`references/validation_logic_report.json`
|
||||
|
||||
### 后续优化点
|
||||
|
||||
- 下一轮 Top residual 建议优先复现输入层后再动规则:`bvr_vanchana_chora_bheethi_yoga`、`bvr_kapata_yoga`、`bvr_mathibhramana_yoga`、`bvr_ayatna_griha_prapta_yoga`、`bvr_dharidhra_11_precise`、`bvr_utthama_graha_yoga`。
|
||||
- 特别注意:`vanchana_chora_bheethi` / `kapata` / `mathibhramana` 的残余差异仍高度依赖 Gulika/Maandi、`benefics_and_malefics()` 动态凶吉和 PyJHora 内部相位函数边界;下一轮不宜盲目扩大条件。
|
||||
|
||||
---
|
||||
|
||||
## v6.0.40(2026-06-05)—— Yoga F1 91% 源码口径续航
|
||||
|
||||
> **目标**:在 v6.0.39 首次突破 F1 90% 后继续推进,但仍保持“准确率优先、源码确认后再改”的路线;优先处理 Top residual 中 PyJHora 源码口径明确、收益高且过拟合风险低的规则。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: jyotish-vedic-astrology
|
||||
version: 6.0.40
|
||||
version: 6.0.41
|
||||
description: 印度占星(Jyotish)专业解盘与推运系统。核心能力:PDF星盘输入→严谨解盘→精确推运应期输出。触发词:印度占星、吠陀占星、Jyotish、解盘、推运、星盘分析、Dasha、Transit、Nakshatra、Yoga、出生时间矫正、PDF星盘、读取PDF、分析PDF星盘、现代解读、误判纠错、Varga分盘、综合分析、过境分析、合盘、婚姻匹配、年运盘、Prashna、Argala、Jaimini、Shadbala、Ashtakavarga、HTML报告、深度解盘。
|
||||
---
|
||||
|
||||
@@ -10,7 +10,7 @@ description: 印度占星(Jyotish)专业解盘与推运系统。核心能力
|
||||
> **严格路由**:`references/strict-workflow-router.md`(⭐涉及事业/婚恋/财务/应期/技法验证时必须优先读取)
|
||||
> **覆盖矩阵**:`references/technique-capability-matrix.md`(⭐判断技法 covered/partial/missing 时必须参考)
|
||||
> **机器注册表**:`references/technique_registry.json` + `scripts/audit_capabilities.py`(⭐用于自动审计与CI门禁)
|
||||
> **版本**:v6.0.40-yoga-f1-91-source-parity | **详细变更**:`CHANGELOG.md`
|
||||
> **版本**:v6.0.41-yoga-f1-92-source-parity | **详细变更**:`CHANGELOG.md`
|
||||
|
||||
---
|
||||
|
||||
@@ -301,9 +301,9 @@ $PYTHON $SCRIPT <子命令> [参数]
|
||||
|
||||
---
|
||||
|
||||
**版本**:v6.0.40-yoga-f1-91-source-parity
|
||||
**版本**:v6.0.41-yoga-f1-92-source-parity
|
||||
**创建日期**:2026-04-20
|
||||
**最后更新**:2026-06-05(v6.0.40 继续坚持 PyJHora 源码口径优先,修复 `bvr_amala_precise`、`bvr_kaalanirdesat_puthranaasa_yoga`、`bvr_bhaga_chumbana_yoga` 并新增 `pyjhora_natural_benefics()` helper;当前 475 条 JSON 规则、381 条启用规则,D1/Rasi 逻辑验证 Precision=94.63%、Recall=89.04%、F1=91.75%,质量门禁通过,报告以 `references/validation_logic_report.json` 为准)
|
||||
**最后更新**:2026-06-05(v6.0.41 继续坚持 PyJHora 源码口径优先,修复 `bvr_sumukha_precise`、`bvr_dama_yoga`、`bvr_matru_sneha_yoga` 并新增 `pyjhora_aspected_planets_of_raasi()` 与 `natural_friend()` helper;当前 475 条 JSON 规则、381 条启用规则,D1/Rasi 逻辑验证 Precision=94.82%、Recall=90.92%、F1=92.83%,质量门禁通过,报告以 `references/validation_logic_report.json` 为准)
|
||||
|
||||
---
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9177,7 +9177,7 @@
|
||||
"category": "auspicious",
|
||||
"logic": {
|
||||
"type": "custom",
|
||||
"expr": "\n# Benefics (Jupiter, Venus) in 2nd house\nbenefics = {'Jupiter', 'Venus'}\nplanets_in_2 = [p for p, info in ctx.planets.items() if info.get('house') == 2]\nany(p in benefics for p in planets_in_2)\n",
|
||||
"expr": "\n# PyJHora/BVR-166 Sumukha Yoga method 1.\n# L2 in a kendra and aspected by PyJHora natural benefics, OR natural benefics join the 2nd house.\nl2 = lord(2)\nif l2 not in ctx.planets:\n False\nelse:\n benefics = pyjhora_natural_benefics()\n cond_1a = kendra(house_of(l2)) and any(b in pyjhora_aspected_planets_of_raasi(house_of(l2)) for b in benefics)\n cond_1b = any(house_of(b) == 2 for b in benefics)\n cond_1a or cond_1b\n",
|
||||
"combo_template": "吉星在第2宫"
|
||||
},
|
||||
"effects": [
|
||||
@@ -10332,14 +10332,14 @@
|
||||
{
|
||||
"id": "bvr_dama_yoga",
|
||||
"name": "Dama Yoga",
|
||||
"name_cn": "TBD",
|
||||
"source": "待查",
|
||||
"bvr_id": null,
|
||||
"name_cn": "达摩/达姆尼瑜伽",
|
||||
"source": "B.V. Raman / PyJHora",
|
||||
"bvr_id": "BVR-92",
|
||||
"category": "special",
|
||||
"logic": {
|
||||
"type": "placeholder",
|
||||
"note": "BVR definition: TBD",
|
||||
"draft": true
|
||||
"type": "custom",
|
||||
"expr": "\n# PyJHora/BVR-92 Dama/Damni Yoga: seven classical planets occupy exactly six signs.\nclassical = ['Sun', 'Moon', 'Mars', 'Mercury', 'Jupiter', 'Venus', 'Saturn']\nlen(set(sign_of(p) for p in classical if p in ctx.planets)) == 6\n",
|
||||
"combo_template": "七曜分布在六个星座"
|
||||
},
|
||||
"effects": [
|
||||
"待补充"
|
||||
@@ -11615,7 +11615,7 @@
|
||||
"category": "special",
|
||||
"logic": {
|
||||
"type": "custom",
|
||||
"expr": "\n# PyJHora: same lord for 1st/4th OR natural/temporal friendship OR both aspected by benefics.\nl1 = lord(1)\nl4 = lord(4)\nif l1 not in ctx.planets or l4 not in ctx.planets:\n False\nelse:\n same_lord = l1 == l4\n temporal_friends = temporal_friend(l1, l4) and temporal_friend(l4, l1)\n both_benefic_aspected = all(any(aspect(b, p) for b in BENEFICS if b in ctx.planets) for p in [l1, l4])\n same_lord or temporal_friends or both_benefic_aspected\n",
|
||||
"expr": "\n# PyJHora Matru Sneha: same L1/L4, mutual temporary or natural friendship, or both aspected by PyJHora natural benefics.\nl1 = lord(1)\nl4 = lord(4)\nif l1 not in ctx.planets or l4 not in ctx.planets:\n False\nelse:\n same_lord = l1 == l4\n temp_friends = temporal_friend(l1, l4) and temporal_friend(l4, l1)\n nat_friends = natural_friend(l1, l4)\n benefics = pyjhora_natural_benefics()\n both_benefic_aspected = any(aspect(b, l1) for b in benefics) and any(aspect(b, l4) for b in benefics)\n same_lord or temp_friends or nat_friends or both_benefic_aspected\n",
|
||||
"combo_template": "1宫主与4宫主同主、友好或同受吉星照拂"
|
||||
},
|
||||
"effects": [
|
||||
|
||||
+28
-1
@@ -37,6 +37,18 @@ MOOLATRIKONA_SIGN = {
|
||||
'Sun': 'Leo', 'Moon': 'Taurus', 'Mars': 'Aries', 'Mercury': 'Virgo',
|
||||
'Jupiter': 'Sagittarius', 'Venus': 'Libra', 'Saturn': 'Aquarius'
|
||||
}
|
||||
# PyJHora const.friendly_planets mapped from planet ids to names.
|
||||
FRIENDLY_PLANETS = {
|
||||
'Sun': ['Moon', 'Mars', 'Jupiter'],
|
||||
'Moon': ['Sun', 'Mercury'],
|
||||
'Mars': ['Sun', 'Moon', 'Jupiter'],
|
||||
'Mercury': ['Sun', 'Venus'],
|
||||
'Jupiter': ['Sun', 'Moon', 'Mars'],
|
||||
'Venus': ['Mercury', 'Saturn', 'Rahu'],
|
||||
'Saturn': ['Mercury', 'Venus', 'Rahu'],
|
||||
'Rahu': ['Venus', 'Saturn'],
|
||||
'Ketu': ['Sun', 'Mars'],
|
||||
}
|
||||
PLANET_CN = {
|
||||
"Ketu": "南交点Ketu", "Venus": "金星Venus", "Sun": "太阳Sun",
|
||||
"Moon": "月亮Moon", "Mars": "火星Mars", "Rahu": "北交点Rahu",
|
||||
@@ -1085,6 +1097,16 @@ class YogaEngine:
|
||||
]
|
||||
return target_rasi_idx in planet_ids_in_aspected_signs
|
||||
|
||||
def pyjhora_aspected_planets_of_raasi(h):
|
||||
"""Replicate PyJHora house.aspected_planets_of_the_raasi(): planets whose rasi drishti hits a target house."""
|
||||
if h is None:
|
||||
return []
|
||||
target_sign = house_sign(h)
|
||||
return [
|
||||
p for p in ctx.planets
|
||||
if p in PLANET_INDEX and target_sign in rasi_drishti_signs_from(ctx.sign_of(p))
|
||||
]
|
||||
|
||||
def rasi_drishti_signs_from(sign_name):
|
||||
if sign_name not in SIGNS:
|
||||
return []
|
||||
@@ -1141,6 +1163,9 @@ class YogaEngine:
|
||||
# PyJHora temporary friends: 2/3/4/10/11/12 from a planet.
|
||||
return offset(ctx.house_of(a), ctx.house_of(b)) in [1, 2, 3, 9, 10, 11]
|
||||
|
||||
def natural_friend(a, b):
|
||||
return a in FRIENDLY_PLANETS.get(b, []) and b in FRIENDLY_PLANETS.get(a, [])
|
||||
|
||||
def occupants(h):
|
||||
return ctx.planets_in_house(h) if h is not None else []
|
||||
|
||||
@@ -1222,6 +1247,7 @@ class YogaEngine:
|
||||
"list": list, "bool": bool,
|
||||
"ctx": ctx, "bindings": bindings, "rule": rule,
|
||||
"SIGNS": SIGNS, "SIGN_LORDS": SIGN_LORDS,
|
||||
"FRIENDLY_PLANETS": FRIENDLY_PLANETS,
|
||||
"RAHU_KETU_OWNED_SIGN_INDEX": RAHU_KETU_OWNED_SIGN_INDEX,
|
||||
"EXALTATION": EXALTATION, "DEBILITATION": DEBILITATION,
|
||||
"PLANET_CN": PLANET_CN, "BENEFICS": BENEFICS, "MALEFICS": MALEFICS,
|
||||
@@ -1250,11 +1276,12 @@ class YogaEngine:
|
||||
"same_house": same_house, "aspect": aspect, "aspects_house": aspects_house,
|
||||
"graha_aspects_house": graha_aspects_house,
|
||||
"pyjhora_planets_aspecting_raasi": pyjhora_planets_aspecting_raasi,
|
||||
"pyjhora_aspected_planets_of_raasi": pyjhora_aspected_planets_of_raasi,
|
||||
"rasi_drishti_signs_from": rasi_drishti_signs_from,
|
||||
"rasi_aspects_house": rasi_aspects_house, "rasi_aspects": rasi_aspects,
|
||||
"rasi_aspected_by_planets": rasi_aspected_by_planets,
|
||||
"house_strength": house_strength, "strong": strong, "weak": weak,
|
||||
"associated": associated, "temporal_friend": temporal_friend,
|
||||
"associated": associated, "temporal_friend": temporal_friend, "natural_friend": natural_friend,
|
||||
"occupants": occupants, "only_benefics_in_house": only_benefics_in_house,
|
||||
"only_malefics_in_house": only_malefics_in_house,
|
||||
"house_has_benefic": house_has_benefic, "house_has_malefic": house_has_malefic,
|
||||
|
||||
Reference in New Issue
Block a user