{
  "version": 1,
  "ruleset_id": "fengshui-default-2026.1",
  "generated": "2026-10-21",
  "methodology": "每条内核规则登记其古典出处与考订状态。出处冲突以本站《Classical Texts Register》（/texts/）的考订为准；伪托典籍显式标注不隐藏；内核未闭合的规则显式登记为 fail-closed。出处是「这个算法从哪部书传下来」，不是「这本书说得对」。",
  "families": [
    {
      "family": "xuankong",
      "name_en": "Flying Stars (Xuan Kong)",
      "name_zh": "玄空飞星",
      "rules": [
        {
          "rule_id": "xuankong.yun_periods",
          "name_en": "Three Cycles, Nine Periods (1864–2043), Lichun boundary",
          "name_zh": "三元九运（立春换运）",
          "kernel_output": "yun_json / flying chart period chip",
          "sources": [
            { "text_id": "shen-shi-xuankong", "title": "沈氏玄空学", "note": "periodisation per the Shen lineage; period boundaries are astronomical (exact Lichun instants), not textual" }
          ],
          "attribution": "late-Qing compilation, posthumous (author d. 1906) — see text register",
          "verification": "period anchor dates cross-checked; boundary instants from the solar engine (HKO-verified 1901–2100)"
        },
        {
          "rule_id": "xuankong.luoshu_path",
          "name_en": "Luoshu flying path (centre → Qian → Dui → Gen → Li → Kan → Kun → Zhen → Xun)",
          "name_zh": "洛书飞泊轨迹",
          "kernel_output": "all three star layers of the chart",
          "sources": [
            { "text_id": "shen-shi-xuankong", "title": "沈氏玄空学", "note": "the single flight trajectory used by the whole tradition" }
          ],
          "attribution": "universal in the lineage — no known competing path",
          "verification": "kernel unit tests; golden charts"
        },
        {
          "rule_id": "xuankong.xiagua_chart",
          "name_en": "Downward chart (xiagua): yun layer always flies forward; mountain/facing layers by yin-yang of the same-yuan dragon",
          "name_zh": "下卦盘（运恒顺飞；山向星阳顺阴逆）",
          "kernel_output": "flying_chart_json kind=xiagua",
          "sources": [
            { "text_id": "shen-shi-xuankong", "title": "沈氏玄空学", "note": "three-layer construction as systematised by Shen" }
          ],
          "attribution": "Shen lineage",
          "verification": "golden cases (八运子山午向=双星会向 etc.) regressed in kernel tests"
        },
        {
          "rule_id": "xuankong.tigua_thresholds",
          "name_en": "Downward vs replacement thresholds (±4.5° centre, 4.5°–7.5° oblique)",
          "name_zh": "下卦/替卦分界（中心±4.5°，兼向至7.5°）",
          "kernel_output": "flying_chart_json adjudication + direction class",
          "sources": [
            { "text_id": "shen-shi-xuankong", "title": "沈氏玄空学", "note": "angular bands as practised in the Shen lineage" }
          ],
          "attribution": "practitioner convention; degree bands presuppose a modern compass",
          "verification": "24-mountains converter table (kernel-consistent, public page /24-mountains-degrees/)"
        },
        {
          "rule_id": "xuankong.tigua_kunrenyi",
          "name_en": "Replacement-star verse 坤壬乙诀 (Kun-Ren-Yi verse)",
          "name_zh": "替卦坤壬乙诀",
          "kernel_output": "flying_chart_json kind=tigua / tigua_yunpan",
          "sources": [
            { "text_id": "qinnang-aoyu", "title": "青囊奥语", "note": "traditional attribution — the Siku cataloguers doubted the attribution (存疑): flagged, not hidden", "attribution_flag": "attribution_doubted" },
            { "text_id": "tianyu-jing", "title": "天玉经", "note": "secondary attributed carrier of the replacement formulas — same Siku doubt (存疑)", "attribution_flag": "attribution_doubted" }
          ],
          "attribution": "verse as transmitted; both attributed carriers are 存疑 per our text register — the VERSE is the rule, the BOOK attribution is uncertain",
          "verification": "replacement charts recomputed and regressed; adjudication surfaced in output"
        },
        {
          "rule_id": "xuankong.chart_patterns",
          "name_en": "Six closed chart patterns (旺山旺向 / 双星会向 / 双星会坐 / 上山下水 / 下水 / 上山)",
          "name_zh": "六格局（已闭合子集）",
          "kernel_output": "chart pattern badges",
          "sources": [
            { "text_id": "shen-shi-xuankong", "title": "沈氏玄空学", "note": "pattern taxonomy as carried by the Shen lineage" }
          ],
          "attribution": "closed subset by design — the tradition carries more patterns than this kernel closes",
          "verification": "golden charts; empty badge list = no closed pattern matched (never guessed); '未闭合' stated on page"
        }
      ]
    },
    {
      "family": "bazhai",
      "name_en": "Eight Mansions (Ba Zhai)",
      "name_zh": "八宅",
      "rules": [
        {
          "rule_id": "bazhai.ming_gua_formula",
          "name_en": "Person trigram (Ming Gua) formula, Lichun year boundary; female five-yellow substitution",
          "name_zh": "命卦公式（立春年界；女五黄寄宫两约定并列）",
          "kernel_output": "ming_gua_json number/trigram/group",
          "sources": [
            { "text_id": "bazhai-ming-jing", "title": "八宅明镜", "note": "person-trigram computation as carried by the Eight Mansions literature; modern standardised form (2000 pivot); commercial editions print a Tang attribution that does not hold — see register", "attribution_flag": "attribution_doubted" }
          ],
          "attribution": "Tang imprint on editions is doubted; content is Qing-era Eight Mansions practice",
          "verification": "formula↔kernel assertion on all 200 generated year pages; two five-yellow conventions labelled (kernel default 寄艮, labelled in output)"
        },
        {
          "rule_id": "bazhai.dayounian_verse",
          "name_en": "Method A — Dayou-nian verse (大游年歌): clockwise placement from the stability palace",
          "name_zh": "A 法·大游年歌",
          "kernel_output": "palaces (star per direction)",
          "sources": [
            { "text_id": "bazhai-ming-jing", "title": "八宅明镜", "note": "carries the verse" }
          ],
          "attribution": "Eight Mansions transmission",
          "verification": "cross-checked against Method B on all 8 palaces × 8 trigrams (exhaustive, in-kernel)"
        },
        {
          "rule_id": "bazhai.liuyao_bian",
          "name_en": "Method B — six-line transformation (六爻变): XOR of trigram lines",
          "name_zh": "B 法·六爻变",
          "kernel_output": "palaces (independent path)",
          "sources": [
            { "text_id": "yangzhai-san-yao", "title": "阳宅三要", "note": "Zhao Jiufeng, four juan — the three essentials (door/stove/bed) lineage" }
          ],
          "attribution": "Qing; attribution secure",
          "verification": "A ≡ B proven exhaustively in-kernel (8/8 palaces, no divergence); disagreements, if ever found, are surfaced not hidden"
        }
      ]
    },
    {
      "family": "zeri",
      "name_en": "Date Selection (Ze Ri)",
      "name_zh": "择日",
      "rules": [
        {
          "rule_id": "zeri.month_branch_basis",
          "name_en": "Officers keyed to the SOLAR-TERM month (月建), not the lunar month",
          "name_zh": "神煞以节气月建为基准（非农历月）",
          "kernel_output": "all zeri fields",
          "sources": [
            { "text_id": "xieji-bianfang-shu", "title": "协纪辨方书", "note": "imperial commission 1739, 36 juan — the great Qing systematisation that keys the officers to 月建" }
          ],
          "attribution": "official Qing compilation; attribution secure",
          "verification": "month branch computed astronomically from solar terms (the ±7.4-day trap is asserted in kernel docs and surfaced on almanac pages)"
        },
        {
          "rule_id": "zeri.jian_chu",
          "name_en": "Twelve Day Officers (建除十二神)",
          "name_zh": "建除十二神",
          "kernel_output": "jian_chu field",
          "sources": [
            { "text_id": "xieji-bianfang-shu", "title": "协纪辨方书", "note": "officer sequence and month-keyed start" }
          ],
          "attribution": "official Qing compilation",
          "verification": "regressed against date-selection golden months; day officer shown for every almanac day"
        },
        {
          "rule_id": "zeri.huang_hei",
          "name_en": "Yellow/Black path twelve spirits (黄黑道十二神)",
          "name_zh": "黄黑道十二神",
          "kernel_output": "huang_hei / huang_hei_is_yellow",
          "sources": [
            { "text_id": "xieji-bianfang-shu", "title": "协纪辨方书", "note": "卷七 states the two systems 「萬不能與建除相合」— quoted verbatim on our calendar API and almanac pages: TWO INDEPENDENT systems, we report both and take no side" }
          ],
          "attribution": "official Qing compilation",
          "verification": "both systems computed and displayed side by side; the irreconcilability is quoted, not resolved"
        },
        {
          "rule_id": "zeri.liu_yao",
          "name_en": "Six曜 (Rokuyō) — lunar-month officer",
          "name_zh": "六曜",
          "kernel_output": "liu_yao field",
          "sources": [
            { "text_id": "xieji-bianfang-shu", "title": "协纪辨方书", "note": "recorded among the transmitted officers; uses the LUNAR month/day — the one officer family in this module keyed to the lunar calendar, opposite of the others" }
          ],
          "attribution": "transmitted system (flourished in Japan as Rokuyō)",
          "verification": "requires explicit lunar inputs; kernel never guesses the lunar month for it"
        },
        {
          "rule_id": "zeri.zi_bai_year_month",
          "name_en": "Purple-White stars, year and month layers",
          "name_zh": "紫白（年白/月白）",
          "kernel_output": "year_zi_bai / month_zi_bai",
          "sources": [
            { "text_id": "xieji-bianfang-shu", "title": "协纪辨方书", "note": "year/month purple-white cycling as in the imperial compilation" }
          ],
          "attribution": "official Qing compilation",
          "verification": "cycled from the solar-term year/month boundaries"
        },
        {
          "rule_id": "zeri.zi_bai_day_hour",
          "name_en": "Purple-White stars, day and hour layers — NOT CLOSED",
          "name_zh": "紫白（日白/时白）——未闭合，拒绝给数",
          "kernel_output": "KernelError::NotClosed (fail-closed)",
          "sources": [
            { "text_id": "xieji-bianfang-shu", "title": "协纪辨方书", "note": "the literature carries materially different day/hour starting rules; no closure we could defend" }
          ],
          "attribution": "—",
          "verification": "FAIR-CLOSED: the API returns an explicit error object rather than a guess — the fail-closed policy applied"
        }
      ]
    }
  ]
}
