{
  "metadata": {
    "title": "LLMS Canonical Quantitative Model Rules Registry",
    "version": "1.0.0",
    "author": "Ersoy Toptaş",
    "license": "CC BY-NC-ND 4.0",
    "description": "scripts/calculate_models.py hesap eşikleri ile llms-formulas-*.txt formül dokümanı şablonlarının tek kaynağı."
  },
  "models": {
    "MODEL_1": {
      "description": "1 Aylık ABD Tahvil Faizi (DGS1MO) ile Fed Politika Faizi arasındaki makas (bps) eşikleri.",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "1",
      "thresholds": {
        "hawkish_bps": 4.0,
        "aggressive_easing_bps": -15.0,
        "moderate_easing_bps": -4.0
      },
      "output_interpretation_template": "Fed policy market stance: (DGS1MO - Fed_Rate) * 100 bps. Easing pressure (<= {aggressive_easing_bps:g} bps aggressive, < {moderate_easing_bps:g} bps moderate) vs hawkish stress (> {hawkish_bps:+g} bps).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if spread > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{hawkish_bps}:"
        },
        {
          "pattern": "(?m)^(\\s*elif spread <= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{aggressive_easing_bps}:"
        },
        {
          "pattern": "(?m)^(\\s*elif spread < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{moderate_easing_bps}:"
        }
      ],
      "txt_interpretation_lines": [
        "Spread > {hawkish_bps:+g} bps : HAWKISH_MARKET_PRESSURE (Market demands yield above Fed policy ceiling / Acute liquidity tightness / Hawkish stress)",
        "Spread <= {aggressive_easing_bps:g} bps : AGGRESSIVE_EASING_PRESSURE (Market forces aggressive Fed easing / Heavy dovish pressure / Front-running rate cuts)",
        "{aggressive_easing_bps:g} bps < Spread < {moderate_easing_bps:g} bps : MODERATE_EASING_BIAS (Moderate dovish tilt / Emerging rate cut expectations)",
        "{moderate_easing_bps:g} bps to {hawkish_bps:+g} bps : BALANCED_POLICY_EQUILIBRIUM (Fed policy ceiling and market pricing are in full alignment and equilibrium)"
      ]
    },
    "MODEL_2": {
      "description": "Reel Politika Faizi (DFF - CPI YoY) kısıtlayıcı ve gevşeklik eşikleri (%).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "2",
      "thresholds": {
        "restrictive_pct": 1.5,
        "accommodative_pct": 0.0
      },
      "output_interpretation_template": "Real policy stance: DFF - CPI_YoY (%). Restrictive (> {restrictive_pct:g}%), neutral ({accommodative_pct:.1f}% to {restrictive_pct:g}%), accommodative (< {accommodative_pct:.1f}%).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if rate > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{restrictive_pct:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif rate < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{accommodative_pct:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Real_Rate > {restrictive_pct:g}% : RESTRICTIVE (Restrictive stance / Supporting disinflation)",
        "{accommodative_pct:.1f}% to {restrictive_pct:g}% : NEUTRAL (Neutral monetary policy)",
        "Real_Rate < {accommodative_pct:.1f}% : ACCOMMODATIVE (Accommodative policy / Negative real yield)"
      ]
    },
    "MODEL_3": {
      "description": "Sahm Resesyon Kuralı eşikleri (yüzde puan).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "3",
      "thresholds": {
        "recession_confirmed_ppt": 0.5,
        "pre_recession_warning_ppt": 0.3
      },
      "output_interpretation_template": "Sahm Rule: MA_3M(UNRATE) - Min_3M_Prior_12M(UNRATE) ppt. Triggers RECESSION_CONFIRMED (>= {recession_confirmed_ppt:.2f} ppt) or PRE_RECESSION_WARNING (>= {pre_recession_warning_ppt:.2f} ppt).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if diff >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{recession_confirmed_ppt:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif diff >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{pre_recession_warning_ppt:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Sahm_Indicator >= {recession_confirmed_ppt:.2f} : RECESSION_CONFIRMED (Official historical recession trigger)",
        "{pre_recession_warning_ppt:.2f} to {recession_confirmed_ppt:.2f} : PRE_RECESSION_WARNING (Dangerous labor market cooling)",
        "Sahm_Indicator < {pre_recession_warning_ppt:.2f} : NORMAL_LABOR_MARKET (Healthy employment path)"
      ]
    },
    "MODEL_4": {
      "description": "3 Aylık ve 1 Aylık ABD Hazine Bonosu (DGS3MO - DGS1MO) ön uç eğim ve likidite makası eşiği (bps).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "4",
      "thresholds": {
        "inversion_threshold_bps": 0.0
      },
      "output_interpretation_template": "Front-end T-bill slope: (DGS3MO - DGS1MO) * 100 bps. Spread < {inversion_threshold_bps:g} bps signals INVERTED_FRONT_END squeeze; >= {inversion_threshold_bps:g} bps NORMAL_SLOPE.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if spread < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{inversion_threshold_bps:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Spread < {inversion_threshold_bps:g} : INVERTED_FRONT_END (Inverted front-end slope / Collateral & liquidity squeeze)",
        "Spread >= {inversion_threshold_bps:g} : NORMAL_SLOPE (Healthy front-end liquidity distribution)"
      ]
    },
    "MODEL_5": {
      "description": "Net Fed Likiditesi (WALCL - TGA - RRP) genişlemeci ve daraltıcı eşikleri (Trilyon USD).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "5",
      "thresholds": {
        "expansive_trillions": 6.2,
        "restrictive_trillions": 5.5
      },
      "output_interpretation_template": "Unencumbered commercial bank liquidity: WALCL - (TGA + ON_RRP). Direct fuel for equity asset valuations (>= ${expansive_trillions:.2f}T surplus, <= ${restrictive_trillions:.2f}T drain).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if net_liq_tril >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{expansive_trillions:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif net_liq_tril <= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{restrictive_trillions:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Net_Liquidity >= ${expansive_trillions:.2f}T : EXPANSIVE_LIQUIDITY_SURPLUS (Ample central bank reserve liquidity / Risk asset tailwind)",
        "${restrictive_trillions:.2f}T to ${expansive_trillions:.2f}T : NEUTRAL_LIQUIDITY_EQUILIBRIUM (Balanced money market reserves / Baseline funding conditions)",
        "Net_Liquidity <= ${restrictive_trillions:.2f}T : RESTRICTIVE_LIQUIDITY_DRAIN (Contracting reserve liquidity / QT drain / Risk-off headwind)",
        "Delta Net_Liquidity > 0 : LIQUIDITY_EXPANSION (Positive week-on-week reserve impulse)",
        "Delta Net_Liquidity < 0 : LIQUIDITY_CONTRACTION (Negative reserve impulse)"
      ]
    },
    "MODEL_6": {
      "description": "10 Yıllık - 2 Yıllık ABD Hazine Getiri Eğrisi Makası (T10Y2Y) rejim eşikleri (bps).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "6",
      "thresholds": {
        "inversion_bps": 0.0,
        "flattening_max_bps": 25.0,
        "normal_max_bps": 100.0
      },
      "output_interpretation_template": "10Y-2Y yield curve slope: T10Y2Y * 100 bps. Inverted (< {inversion_bps:g} bps), flattening ({inversion_bps:g} to {flattening_max_bps:.1f} bps), normal ({flattening_max_bps:.1f} to {normal_max_bps:.1f} bps), steep (> {normal_max_bps:.1f} bps).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if spread < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{inversion_bps:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif spread <= )[-+]?\\d+(?:\\.\\d+)?:(?=\\r?\\n\\s*status = \"FLATTENING_TRANSITION_PHASE\")",
          "replacement": "\\g<1>{flattening_max_bps:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif spread <= )[-+]?\\d+(?:\\.\\d+)?:(?=\\r?\\n\\s*status = \"NORMAL_CURVE_EXPANSION\")",
          "replacement": "\\g<1>{normal_max_bps:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Yield_Spread_bps < {inversion_bps:g} : INVERTED_CURVE_RECESSION_SIGNAL (Inverted yield curve / Recessionary pricing)",
        "{inversion_bps:g} <= Yield_Spread_bps <= {flattening_max_bps:.1f} : FLATTENING_TRANSITION_PHASE (Flattening yield curve / Cyclical transition)",
        "{flattening_max_bps:.1f} < Yield_Spread_bps <= {normal_max_bps:.1f} : NORMAL_CURVE_EXPANSION (Positive yield curve slope / Economic expansion)",
        "Yield_Spread_bps > {normal_max_bps:.1f} : STEEPENING_GROWTH_REFLATION (Steepening yield curve / Growth reflation)"
      ]
    },
    "MODEL_7": {
      "description": "10 Yıllık Başabaş Enflasyon Beklentisi (DGS10 - DFII10) çıpa bozulma ve deflasyon eşikleri (%).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "7",
      "thresholds": {
        "de_anchoring_pct": 2.5,
        "deflation_pct": 2.0
      },
      "output_interpretation_template": "10Y breakeven inflation: DGS10 - DFII10 (%). De-anchoring risk (> {de_anchoring_pct:.2f}%), Fed equilibrium ({deflation_pct:.2f}% to {de_anchoring_pct:.2f}%), deflation risk (< {deflation_pct:.2f}%).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if rate > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{de_anchoring_pct:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif rate < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{deflation_pct:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Breakeven > {de_anchoring_pct:.2f}% : DE_ANCHORING_RISK (Inflation de-anchoring risk)",
        "{deflation_pct:.2f}% to {de_anchoring_pct:.2f}% : FED_ALIGNED_EQUILIBRIUM (Balanced pricing aligned with Fed target)",
        "Breakeven < {deflation_pct:.2f}% : DEFLATION_RISK (Deflation / Insufficient aggregate demand pricing)"
      ]
    },
    "MODEL_8": {
      "description": "Beveridge Eğrisi İşgücü Sıkılığı (JTSJOL / UNEMPLOY) aşırı ısınma ve soğuma eşikleri (oran).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "8",
      "thresholds": {
        "overheated_ratio": 1.5,
        "cooling_ratio": 1.0
      },
      "output_interpretation_template": "Beveridge labor tightness: JTSJOL / UNEMPLOY ratio. Overheated (> {overheated_ratio:.2f}), balanced ({cooling_ratio:.2f} to {overheated_ratio:.2f}), cooling (< {cooling_ratio:.2f}).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if ratio > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{overheated_ratio:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif ratio < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{cooling_ratio:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Ratio > {overheated_ratio:.2f} : OVERHEATED_LABOR (Overheated labor market / Wage inflation risk)",
        "{cooling_ratio:.2f} to {overheated_ratio:.2f} : BALANCED_LABOR_TIGHTNESS (Soft landing trajectory / Balanced employment)",
        "Ratio < {cooling_ratio:.2f} : COOLING_LABOR (Weakening labor demand / Rising unemployment pressure)"
      ]
    },
    "MODEL_9": {
      "description": "Finansal Baskılama ve Borç Baskısı Endeksi ((DGS10 - CPI_YoY) * (GFDEGDQ188S / 100)) rejim eşikleri.",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "9",
      "thresholds": {
        "repression_max_score": 0.0,
        "debt_crisis_min_score": 1.5
      },
      "output_interpretation_template": "Financial repression index: (DGS10 - CPI_YoY) * (GFDEGDQ188S / 100). Repression (< {repression_max_score:.2f}), sustainable ({repression_max_score:.2f} to {debt_crisis_min_score:.2f}), debt crisis (> {debt_crisis_min_score:.2f}).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if index < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{repression_max_score:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif index > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{debt_crisis_min_score:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Index < {repression_max_score:.2f} : REPRESSION_REGIME (Financial repression regime / Inflation eroding public debt in real terms)",
        "{repression_max_score:.2f} to {debt_crisis_min_score:.2f} : SUSTAINABLE_CYCLE (Sustainable public debt service cycle)",
        "Index > {debt_crisis_min_score:.2f} : DEBT_CRISIS_ALARM (Severe debt service crisis threshold / Interest expenses crowding out fiscal budget)"
      ]
    },
    "MODEL_10": {
      "description": "Triffin Dış Denge Gerilim Oranı (DTWEXBGS / (-BOPGSTB / 1000)) offshore dolar kıtlığı ve bolluğu eşikleri.",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "10",
      "thresholds": {
        "reserve_strain_ratio": 1.25,
        "abundant_liquidity_ratio": 1.0
      },
      "output_interpretation_template": "Triffin tension ratio: DTWEXBGS / (-BOPGSTB / 1000). Strain (> {reserve_strain_ratio:.2f}), balanced ({abundant_liquidity_ratio:.2f} to {reserve_strain_ratio:.2f}), abundant offshore liquidity (< {abundant_liquidity_ratio:.2f}).",
      "surplus_interpretation_template": "Triffin surplus drain: DTWEXBGS / (BOPGSTB / 1000). BOPGSTB > 0 US trade surplus drains offshore dollar reserves (OFFSHORE_DOLLAR_DRAIN_SURPLUS).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*status = \"RESERVE_CURRENCY_STRAIN\" if tension > )[-+]?\\d+(?:\\.\\d+)?( else \\(\"ABUNDANT_OFFSHORE_LIQUIDITY\" if tension < )[-+]?\\d+(?:\\.\\d+)?( else \"BALANCED_TRIFFIN_EQUILIBRIUM\"\\))$",
          "replacement": "\\g<1>{reserve_strain_ratio:.2f}\\g<2>{abundant_liquidity_ratio:.2f}\\g<3>"
        }
      ],
      "txt_interpretation_lines": [
        "Rising Index (> {reserve_strain_ratio:.2f}) : Strong Dollar & External Deficit Fragility (Offshore dollar shortage and funding stress)",
        "Falling Index (< {abundant_liquidity_ratio:.2f}) : Global Financial Conditions Easing",
        "Surplus Regime : Global Dollar Drain (US net drain on world dollar liquidity)"
      ]
    },
    "MODEL_11": {
      "description": "Taylor Kuralı Politika Faizi Açığı (r*, pi*, alpha, beta katsayıları ve sapma eşikleri ppt).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "11",
      "thresholds": {
        "neutral_real_rate_pct": 2.0,
        "target_inflation_pct": 2.0,
        "inflation_weight": 0.5,
        "output_gap_weight": 0.5,
        "behind_curve_ppt": -1.0,
        "over_restrictive_ppt": 1.0
      },
      "output_interpretation_template": "Taylor gap: DFF - ({neutral_real_rate_pct:g} + CPI_YoY + {inflation_weight:g}*(CPI_YoY - {target_inflation_pct:g}) + {output_gap_weight:g}*Output_Gap). Behind curve (< {behind_curve_ppt:.2f} ppt), aligned ({behind_curve_ppt:.2f} to {over_restrictive_ppt:+.2f} ppt), over-restrictive (> {over_restrictive_ppt:+.2f} ppt).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*Taylor_Optimal_Rate = )[-+]?\\d+(?:\\.\\d+)?( \\+ CPI_YoY \\+ )[-+]?\\d+(?:\\.\\d+)?( \\* \\(CPI_YoY - )[-+]?\\d+(?:\\.\\d+)?(\\) \\+ )[-+]?\\d+(?:\\.\\d+)?( \\* Output_Gap_Pct)$",
          "replacement": "\\g<1>{neutral_real_rate_pct:.1f}\\g<2>{inflation_weight:g}\\g<3>{target_inflation_pct:.1f}\\g<4>{output_gap_weight:g}\\g<5>"
        },
        {
          "pattern": "(?m)^(\\s*optimal_rate = round\\()[-+]?\\d+(?:\\.\\d+)?( \\+ cpi_yoy \\+ )[-+]?\\d+(?:\\.\\d+)?( \\* \\(cpi_yoy - )[-+]?\\d+(?:\\.\\d+)?(\\) \\+ )[-+]?\\d+(?:\\.\\d+)?( \\* output_gap, 2\\))$",
          "replacement": "\\g<1>{neutral_real_rate_pct:.1f}\\g<2>{inflation_weight:g}\\g<3>{target_inflation_pct:.1f}\\g<4>{output_gap_weight:g}\\g<5>"
        },
        {
          "pattern": "(?m)^(\\s*if gap < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{behind_curve_ppt:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif gap > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{over_restrictive_ppt:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Taylor_Policy_Gap < {behind_curve_ppt:.2f} : BEHIND_THE_CURVE (Fed behind the curve / Excessively loose)",
        "{behind_curve_ppt:.2f} to {over_restrictive_ppt:+.2f} : OPTIMAL_ALIGNMENT (Balanced monetary policy stance)",
        "Taylor_Policy_Gap > {over_restrictive_ppt:+.2f} : OVER_RESTRICTIVE (Excessively restrictive / Recession risk stance)"
      ]
    },
    "MODEL_12": {
      "description": "Chicago Fed Ulusal Finansal Koşullar Endeksi (NFCI) ve makro ayrışma (NFCI - ANFCI) rejim eşiği.",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "12",
      "thresholds": {
        "equilibrium_level": 0.0
      },
      "output_interpretation_template": "Chicago Fed financial conditions: NFCI (macro_div = NFCI - ANFCI). Tight (> {equilibrium_level:.2f}), balanced (== {equilibrium_level:.2f}), loose (< {equilibrium_level:.2f}).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if n > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{equilibrium_level:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif n == )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{equilibrium_level:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "NFCI > {equilibrium_level:.2f} : TIGHT_FINANCIAL_CONDITIONS (Tight financial conditions / Tighter than historical average / Financial stress)",
        "NFCI == {equilibrium_level:.2f} : BALANCED_FINANCIAL_CONDITIONS (Historically balanced financial conditions)",
        "NFCI < {equilibrium_level:.2f} : LOOSE_FINANCIAL_CONDITIONS (Loose financial conditions / Abundant liquidity / Risk-on support)"
      ]
    },
    "MODEL_13": {
      "description": "Yüksek Getirili Kurumsal Tahvil Kredi Makası (BAMLH0A0HYM2 * 100) temerrüt ve risk iştahı eşikleri (bps).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "13",
      "thresholds": {
        "credit_crunch_bps": 500,
        "elevated_risk_bps": 350
      },
      "output_interpretation_template": "US high yield OAS: BAMLH0A0HYM2 * 100 bps. Credit crunch (>= {credit_crunch_bps:g} bps), elevated risk ({elevated_risk_bps:g} to {credit_crunch_bps:g} bps), healthy appetite (< {elevated_risk_bps:g} bps).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if bps >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{credit_crunch_bps:g}:"
        },
        {
          "pattern": "(?m)^(\\s*elif bps >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{elevated_risk_bps:g}:"
        }
      ],
      "txt_interpretation_lines": [
        "HY_Spread >= {credit_crunch_bps:g} bps : CREDIT_CRUNCH_ALARM (Credit crunch alarm / Default surge / Recession signal)",
        "{elevated_risk_bps:g} bps to {credit_crunch_bps:g} bps : ELEVATED_RISK (Softening risk appetite / Caution zone)",
        "HY_Spread < {elevated_risk_bps:g} bps : RISK_APPETITE_HEALTHY (Low default risk / Healthy corporate funding)"
      ]
    },
    "MODEL_14": {
      "description": "Reel M2 Para Arzı İvmesi (M2_YoY_Growth_Pct - CPI_YoY_Pct) likidite daralması ve parasal genişleme eşiği (ppt).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "14",
      "thresholds": {
        "equilibrium_ppt": 0.0
      },
      "output_interpretation_template": "Real broad money momentum: M2SL YoY - CPIAUCSL YoY (ppt). Contraction (< {equilibrium_ppt:g} ppt), neutral (== {equilibrium_ppt:g} ppt), monetary expansion (> {equilibrium_ppt:g} ppt).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if diff == )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{equilibrium_ppt:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif diff < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{equilibrium_ppt:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Real_M2_Growth < {equilibrium_ppt:g} : LIQUIDITY_CONTRACTION (Real money contraction / Disinflationary demand collapse)",
        "Real_M2_Growth == {equilibrium_ppt:g} : NEUTRAL (Neutral monetary equilibrium)",
        "Real_M2_Growth > {equilibrium_ppt:g} : MONETARY_EXPANSION (Real money expansion / Expanding aggregate demand / Inflationary pressure)"
      ]
    },
    "MODEL_15": {
      "description": "NY Fed ACM 10 Yıllık Vade Primi (THREEFYTP10) ve beklenen kısa vadeli faiz ayrıştırması (DGS10 - THREEFYTP10) eşik ve doğrulama sınırları (%).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "15",
      "thresholds": {
        "fiscal_supply_pressure_pct": 0.5,
        "flight_to_safety_pct": -0.5,
        "nominal_yield_min_pct": 0.0,
        "nominal_yield_max_pct": 25.0,
        "term_premium_min_pct": -5.0,
        "term_premium_max_pct": 5.0
      },
      "output_interpretation_template": "NY Fed ACM 10Y decomposition: Expected_Short_Rate = DGS10 - THREEFYTP10 (%). Fiscal supply pressure (>= {fiscal_supply_pressure_pct:+.2f}%), balanced ({flight_to_safety_pct:.2f}% to {fiscal_supply_pressure_pct:+.2f}%), flight-to-safety (<= {flight_to_safety_pct:.2f}%).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if dgs10 < )[-+]?\\d+(?:\\.\\d+)?( or dgs10 > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{nominal_yield_min_pct:.1f}\\g<2>{nominal_yield_max_pct:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*if term_premium < )[-+]?\\d+(?:\\.\\d+)?( or term_premium > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{term_premium_min_pct:.1f}\\g<2>{term_premium_max_pct:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*if tp >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{fiscal_supply_pressure_pct:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif tp <= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{flight_to_safety_pct:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Term_Premium >= {fiscal_supply_pressure_pct:.2f}% : FISCAL_SUPPLY_PRESSURE (Duration risk, fiscal supply pressure, or inflation uncertainty)",
        "{flight_to_safety_pct:.2f}% to {fiscal_supply_pressure_pct:.2f}% : BALANCED_PREMIUM (Balanced risk premium / Normalized Treasury demand)",
        "Term_Premium <= {flight_to_safety_pct:.2f}% : FLIGHT_TO_SAFETY (Safe-haven duration demand / Central bank asset purchase scarcity)"
      ]
    },
    "MODEL_16": {
      "description": "CBOE Volatilite Endeksi (VIXCLS) piyasa korku ve risk rejimi eşikleri (puan).",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "16",
      "thresholds": {
        "complacency_max": 15.0,
        "normal_max": 20.0,
        "elevated_max": 30.0
      },
      "output_interpretation_template": "CBOE VIX regime: VIXCLS (30D S&P 500 implied vol). Complacency (< {complacency_max:.1f}), normal ({complacency_max:.1f}-{normal_max:.1f}), elevated stress ({normal_max:.1f}-{elevated_max:.1f}), crisis shock (>= {elevated_max:.1f}).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if raw_vix < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{complacency_max:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif raw_vix < )[-+]?\\d+(?:\\.\\d+)?:(?=\\r?\\n\\s*return \\{\"vix\": val, \"regime\": \"NORMAL_VOLATILITY\")$",
          "replacement": "\\g<1>{normal_max:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif raw_vix < )[-+]?\\d+(?:\\.\\d+)?:(?=\\r?\\n\\s*return \\{\"vix\": val, \"regime\": \"ELEVATED_STRESS\")$",
          "replacement": "\\g<1>{elevated_max:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "VIX < {complacency_max:.1f} : COMPLACENCY (Complacency / Low volatility / Broad risk appetite / Risk-on)",
        "{complacency_max:.1f} to {normal_max:.1f} : NORMAL_VOLATILITY (Historically balanced market volatility / Balanced)",
        "{normal_max:.1f} to {elevated_max:.1f} : ELEVATED_STRESS (Elevated uncertainty / Portfolio hedging demand / Risk-off)",
        "VIX > {elevated_max:.1f} : CRISIS_SHOCK (Market shock / Liquidity crunch & panic selling alarm / Extreme risk-off)"
      ]
    },
    "MODEL_17": {
      "description": "Makro Hisse Senedi Risk Primi ((CPATAX * 1000 / NCBEILQ027S) * 100 - DGS10) değerleme eşikleri (%).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "17",
      "thresholds": {
        "overvalued_max_pct": 0.5,
        "attractive_min_pct": 2.5
      },
      "output_interpretation_template": "US Macro Equity Risk Premium: ((CPATAX * 1000 / NCBEILQ027S) * 100) - DGS10 (%). Overvalued stocks (< {overvalued_max_pct:.2f}%), fair value ({overvalued_max_pct:.2f}% to {attractive_min_pct:.2f}%), attractive stocks (> {attractive_min_pct:.2f}%).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if erp < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{overvalued_max_pct:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif erp > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{attractive_min_pct:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "ERP < {overvalued_max_pct:.2f}% : OVERVALUED_STOCKS (Equities severely overvalued / Bond yields significantly more attractive / Capital rotates to fixed income)",
        "{overvalued_max_pct:.2f}% to {attractive_min_pct:.2f}% : FAIR_VALUE (Macro balanced equity valuation zone)",
        "ERP > {attractive_min_pct:.2f}% : ATTRACTIVE_STOCKS (Equities undervalued / Attractive risk premium / Supportive for equity allocations)"
      ]
    },
    "MODEL_18": {
      "description": "Okun Sefalet Endeksi (UNRATE + CPI_YoY) stagflasyon ve hane halkı refah kaybı eşikleri (endeks puanı).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "18",
      "thresholds": {
        "acute_crisis_min": 12.0,
        "elevated_stress_min": 10.0,
        "moderate_min": 6.0
      },
      "output_interpretation_template": "Okun Misery Index: UNRATE + CPIAUCSL YoY (index pts). Goldilocks (< {moderate_min:.1f}), moderate ({moderate_min:.1f}-{elevated_stress_min:.1f}), elevated stress ({elevated_stress_min:.1f}-{acute_crisis_min:.1f}), acute crisis (> {acute_crisis_min:.1f}).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if score >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{acute_crisis_min:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif score >= )[-+]?\\d+(?:\\.\\d+)?:(?=\\r?\\n\\s*status = \"ELEVATED_STRESS\")$",
          "replacement": "\\g<1>{elevated_stress_min:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif score >= )[-+]?\\d+(?:\\.\\d+)?:(?=\\r?\\n\\s*status = \"MODERATE\")$",
          "replacement": "\\g<1>{moderate_min:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Misery_Index > {acute_crisis_min:.1f}% : ACUTE_CRISIS (Severe welfare loss / Stagflationary shock threshold)",
        "{elevated_stress_min:.1f}% to {acute_crisis_min:.1f}% : ELEVATED_STRESS (Elevated household and consumer pressure)",
        "{moderate_min:.1f}% to {elevated_stress_min:.1f}% : MODERATE (Manageable macroeconomic equilibrium)",
        "Misery_Index < {moderate_min:.1f}% : GOLDILOCKS (Low unemployment & stable prices)"
      ]
    },
    "MODEL_19": {
      "description": "Buffett Göstergesi ((NCBEILQ027S / (GDP * 1000)) * 100) piyasa değeri / GSYİH değerleme eşikleri (%).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "19",
      "thresholds": {
        "severely_overvalued_min_pct": 180.0,
        "overvalued_min_pct": 140.0,
        "fair_valued_min_pct": 100.0
      },
      "output_interpretation_template": "Buffett Indicator: (NCBEILQ027S / (GDP * 1000)) * 100 (%). Undervalued (< {fair_valued_min_pct:.1f}%), fair ({fair_valued_min_pct:.1f}%-{overvalued_min_pct:.1f}%), overvalued ({overvalued_min_pct:.1f}%-{severely_overvalued_min_pct:.1f}%), severely overvalued (>= {severely_overvalued_min_pct:.1f}%).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if ratio >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{severely_overvalued_min_pct:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif ratio >= )[-+]?\\d+(?:\\.\\d+)?:(?=\\r?\\n\\s*status = \"OVERVALUED\")$",
          "replacement": "\\g<1>{overvalued_min_pct:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif ratio >= )[-+]?\\d+(?:\\.\\d+)?:(?=\\r?\\n\\s*status = \"FAIR_VALUED\")$",
          "replacement": "\\g<1>{fair_valued_min_pct:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Ratio >= {severely_overvalued_min_pct:.1f}% : SEVERELY_OVERVALUED (Critical bubble threshold / Sharp correction risk)",
        "{overvalued_min_pct:.1f}% to {severely_overvalued_min_pct:.1f}% : OVERVALUED (Market decoupled from real economy / Stretched valuation)",
        "{fair_valued_min_pct:.1f}% to {overvalued_min_pct:.1f}% : FAIR_VALUED (Balanced market valuation)",
        "Ratio < {fair_valued_min_pct:.1f}% : UNDERVALUED (Equity market undervalued / Attractive entry territory)"
      ]
    },
    "MODEL_20": {
      "description": "Bakır / Altın Makro Duyarlılık Oranı (PCOPPUSDM / IND_WB_GOLD) önceki dönem mevcut olmadığında kullanılan tarihsel referans eşiği.",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "20",
      "thresholds": {
        "historical_benchmark_ratio": 3.0
      },
      "output_interpretation_template": "Copper/Gold ratio: PCOPPUSDM / IND_WB_GOLD (USD/MT per USD/oz). Cyclical expansion if ratio >= prior ratio (or >= {historical_benchmark_ratio:.2f} benchmark when prior unavailable); else flight-to-safety.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "Rising Trend : CYCLICAL_EXPANSION (Robust industrial demand / Growth acceleration / Rising bond yields)",
        "Falling Trend : FLIGHT_TO_SAFETY (Safe-haven demand dominates / Growth cooling / Recessionary bond buying)"
      ]
    },
    "MODEL_21": {
      "description": "Altın / Petrol Kriz ve Durgunluk Oranı (IND_WB_GOLD / DCOILWTICO) eşik ve tarihsel denge bandı sınırları (varil/ons).",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "21",
      "thresholds": {
        "crisis_recession_min": 25.0,
        "supply_shock_max": 12.0
      },
      "output_interpretation_template": "Gold/Oil ratio: IND_WB_GOLD / DCOILWTICO (bbl/oz). Supply shock inflation (< {supply_shock_max:.1f}), equilibrium ({supply_shock_max:.1f}-{crisis_recession_min:.1f}), macro crisis recession (> {crisis_recession_min:.1f}).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if ratio > )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{crisis_recession_min:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif ratio < )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{supply_shock_max:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Ratio > {crisis_recession_min:.1f} : MACRO_CRISIS_RECESSION (Severe economic slowdown / Demand collapse or systemic crisis pricing)",
        "{supply_shock_max:.1f} to {crisis_recession_min:.1f} : HISTORICAL_EQUILIBRIUM (Historical equilibrium band / {supply_shock_max:g}-{crisis_recession_min:g} barrels range)",
        "Ratio < {supply_shock_max:.1f} : SUPPLY_SHOCK_INFLATION (Supply-driven oil shock / Cost-push inflation pressure)"
      ]
    },
    "MODEL_22": {
      "description": "Hane Halkı Kredi Stres Göstergesi (DRCCLACBS / PSAVERT) yüksek baskı ve ağır stres eşik oranları.",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "22",
      "thresholds": {
        "severe_stress_min_ratio": 1.0,
        "elevated_pressure_min_ratio": 0.5
      },
      "output_interpretation_template": "Household stress ratio: DRCCLACBS / PSAVERT. Healthy balance sheet (< {elevated_pressure_min_ratio:.2f}), elevated pressure ({elevated_pressure_min_ratio:.2f}-{severe_stress_min_ratio:.2f}), severe stress (> {severe_stress_min_ratio:.2f} or PSAVERT <= 0).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if ratio >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{severe_stress_min_ratio:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif ratio >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{elevated_pressure_min_ratio:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Ratio > {severe_stress_min_ratio:.2f} : SEVERE_CONSUMER_STRESS (Delinquencies exceed savings / Sudden brake on consumer spending and recession risk)",
        "{elevated_pressure_min_ratio:.2f} to {severe_stress_min_ratio:.2f} : ELEVATED_PRESSURE (Depleting saving cushion / Rising debt repayment strain)",
        "Ratio < {elevated_pressure_min_ratio:.2f} : HEALTHY_BALANCE_SHEET (Robust savings / Healthy consumer balance sheets)"
      ]
    },
    "MODEL_23": {
      "description": "Okun Açığı (Büyüme-İstihdam Ayrışması) potansiyel büyüme, beta katsayısı ve rejim eşikleri (ppt).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "23",
      "thresholds": {
        "okun_beta": -0.5,
        "potential_gdp_growth_pct": 2.0,
        "jobless_growth_min_ppt": 0.5,
        "labor_hoarding_max_ppt": -0.5
      },
      "output_interpretation_template": "Okun Gap: dUNRATE_YoY - ({okun_beta:g} * (GDPC1_YoY - {potential_gdp_growth_pct:.1f})) ppt. Labor hoarding (< {labor_hoarding_max_ppt:.2f}), balanced ({labor_hoarding_max_ppt:.2f} to {jobless_growth_min_ppt:+.2f}), jobless growth (> {jobless_growth_min_ppt:+.2f}).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*- Potential Real GDP Growth: )[-+]?\\d+(?:\\.\\d+)?%$",
          "replacement": "\\g<1>{potential_gdp_growth_pct:.1f}%"
        },
        {
          "pattern": "(?m)^(\\s*- Okun Beta Coefficient: )[-+]?\\d+(?:\\.\\d+)?$",
          "replacement": "\\g<1>{okun_beta:g}"
        },
        {
          "pattern": "(?m)^(\\s*Expected_Unemployment_Delta = )[-+]?\\d+(?:\\.\\d+)?( \\* \\(Real_GDP_YoY - )[-+]?\\d+(?:\\.\\d+)?(\\))$",
          "replacement": "\\g<1>{okun_beta:g}\\g<2>{potential_gdp_growth_pct:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)^(\\s*expected_delta = )[-+]?\\d+(?:\\.\\d+)?( \\* \\(real_gdp_yoy - )[-+]?\\d+(?:\\.\\d+)?(\\))$",
          "replacement": "\\g<1>{okun_beta:g}\\g<2>{potential_gdp_growth_pct:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)^(\\s*if gap >= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{jobless_growth_min_ppt:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif gap <= )[-+]?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{labor_hoarding_max_ppt:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "Okun_Gap > {jobless_growth_min_ppt:+.2f} : JOBLESS_GROWTH_WARNING (Unemployment rising despite growth / Productivity or structural disruption)",
        "{labor_hoarding_max_ppt:.2f} to {jobless_growth_min_ppt:+.2f} : BALANCED_OKUN_EQUILIBRIUM (Growth and employment in historical balance)",
        "Okun_Gap < {labor_hoarding_max_ppt:.2f} : LABOR_HOARDING (Firms retaining employees despite sluggish growth / Resilient employment)"
      ]
    },
    "MODEL_23.1": {
      "description": "Çift Kulvarlı İşgücü Piyasası Dinamiği (PAYEMS, UNRATE, CIVPART) rejim eşikleri (bin kişi ve ppt).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "23.1",
      "thresholds": {
        "benign_min_payems_k": 150.0,
        "benign_min_unrate_delta": 0.0,
        "benign_min_civpart_delta": 0.0,
        "recession_max_payems_k": 100.0,
        "recession_min_unrate_delta": 0.10
      },
      "output_interpretation_template": "Dual-track matrix on PAYEMS MoM (k), UNRATE MoM delta (ppt), CIVPART MoM delta (ppt); benign supply expansion if PAYEMS_MoM > {benign_min_payems_k:.1f}k & UNRATE_Delta >= {benign_min_unrate_delta:.1f} & CIVPART_Delta > {benign_min_civpart_delta:.1f}, recession warning if PAYEMS_MoM < {recession_max_payems_k:.1f}k & UNRATE_Delta > {recession_min_unrate_delta:.2f}.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*- Breakeven Growth Band: )\\d+k - \\d+k$",
          "replacement": "\\g<1>{recession_max_payems_k:.0f}k - {benign_min_payems_k:.0f}k"
        },
        {
          "pattern": "(?m)^(\\s*if p_mom > )-?\\d+(?:\\.\\d+)?( and u_diff >= )-?\\d+(?:\\.\\d+)?( and c_diff > )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{benign_min_payems_k:.1f}\\g<2>{benign_min_unrate_delta:.1f}\\g<3>{benign_min_civpart_delta:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif p_mom < )-?\\d+(?:\\.\\d+)?( and u_diff > )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{recession_max_payems_k:.1f}\\g<2>{recession_min_unrate_delta:.2f}:"
        }
      ],
      "txt_interpretation_lines": [
        "status == BENIGN_SUPPLY_EXPANSION (PAYEMS_MoM > {benign_min_payems_k:.1f}k, UNRATE_Delta >= {benign_min_unrate_delta:.1f}, CIVPART_Delta > {benign_min_civpart_delta:.1f}) : Unemployment steady/elevated due to rising participation (Healthy labor expansion)",
        "status == RECESSION_EARLY_WARNING (PAYEMS_MoM < {recession_max_payems_k:.1f}k, UNRATE_Delta > {recession_min_unrate_delta:.2f}) : Job growth falls below population threshold while unemployment rises (Early recession warning)",
        "status == BALANCED_LABOR_MARKET : Balanced labor market dynamics"
      ]
    },
    "MODEL_23.2": {
      "description": "Toplam Fon Akışı ve Parasal Dolaşım Hızı Momentum (M2SL * M2V) QoQ rejim eşikleri (%).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "23.2",
      "thresholds": {
        "excess_velocity_min_qoq_pct": 2.0,
        "stagnation_max_qoq_pct": 0.0
      },
      "output_interpretation_template": "Total_Funds_Flow = M2SL * M2V (Billions USD); excess velocity inflation if TFF_QoQ > {excess_velocity_min_qoq_pct:.1f}%, balanced ({stagnation_max_qoq_pct:.1f}% to {excess_velocity_min_qoq_pct:.1f}%), liquidity stagnation if TFF_QoQ < {stagnation_max_qoq_pct:.1f}%.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if mom_change > )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{excess_velocity_min_qoq_pct:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif mom_change < )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{stagnation_max_qoq_pct:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "status == EXCESS_VELOCITY_INFLATION : Excessive Liquidity Acceleration & Asset Bubble Inflation Risk (TFF QoQ > {excess_velocity_min_qoq_pct:.1f}%)",
        "status == BALANCED_LIQUIDITY_FLOW : Balanced Liquidity Flow ({stagnation_max_qoq_pct:.1f}% <= TFF QoQ <= {excess_velocity_min_qoq_pct:.1f}%)",
        "status == LIQUIDITY_STAGNATION : Velocity Collapse, Liquidity Freeze & Deflationary Contraction Risk (TFF QoQ < {stagnation_max_qoq_pct:.1f}%)"
      ]
    },
    "MODEL_23.3": {
      "description": "Konut Erişilebilirliği ve Balon Göstergesi (MSPUS / CES0500000003) çalışma saati rejim eşikleri.",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "23.3",
      "thresholds": {
        "severe_bubble_min_hours": 13500.0,
        "elevated_stress_min_hours": 11000.0
      },
      "output_interpretation_template": "Affordability_Ratio = MSPUS / CES0500000003 (Labor Hours per Home); severe bubble if > {severe_bubble_min_hours:.0f}h, elevated stress ({elevated_stress_min_hours:.0f}h to {severe_bubble_min_hours:.0f}h), accessible if <= {elevated_stress_min_hours:.0f}h.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if ratio > )\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{severe_bubble_min_hours:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif ratio > )\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{elevated_stress_min_hours:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "status == SEVERE_HOUSING_BUBBLE : Acute housing affordability crisis & bubble alarm (Ratio exceeds {severe_bubble_min_hours:,.0f} hours)",
        "status == ELEVATED_STRESS : Stretched housing costs and consumer affordability pressure ({elevated_stress_min_hours:,.0f} to {severe_bubble_min_hours:,.0f} hours)",
        "status == ACCESSIBLE_MARKET : Historical equilibrium and affordable housing market (Ratio below {elevated_stress_min_hours:,.0f} hours)"
      ]
    },
    "MODEL_23.4": {
      "description": "Erken İşten Çıkarma ve Resesyon Sinyali (INDPRO_YoY + AWHAETP_YoY * ağırlık) katsayı ve rejim eşikleri.",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "23.4",
      "thresholds": {
        "hours_weight": 2.0,
        "acute_layoff_max_index": -2.50,
        "early_recession_max_index": 0.0
      },
      "output_interpretation_template": "Early_Layoff_Index = INDPRO_YoY + (AWHAETP_YoY * {hours_weight:.1f}); acute layoff if < {acute_layoff_max_index:.2f}, early recession ({acute_layoff_max_index:.2f} to {early_recession_max_index:.1f}), expansion if >= {early_recession_max_index:.1f}.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*Early_Layoff_Index = INDPRO_YoY \\+ \\(AWHAETP_YoY \\* )-?\\d+(?:\\.\\d+)?(\\))$",
          "replacement": "\\g<1>{hours_weight:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*raw_index = float\\(indpro_yoy\\) \\+ \\(float\\(awhaetp_yoy\\) \\* )-?\\d+(?:\\.\\d+)?(\\))$",
          "replacement": "\\g<1>{hours_weight:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*if index < )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{acute_layoff_max_index:.2f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif index < )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{early_recession_max_index:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "status == ACUTE_LAYOFF_CONTRACTION : Overtime cuts paired with industrial contraction (Early layoff wave & deep recession risk / Index < {acute_layoff_max_index:.2f})",
        "status == EARLY_RECESSION_SIGNAL : Production losing momentum and work hours softening (Latent unemployment onset / {acute_layoff_max_index:.2f} to {early_recession_max_index:.1f})",
        "status == EXPANSION_EMPLOYMENT_MOMENTUM : Resilient industrial activity and robust work hours (Index >= {early_recession_max_index:.1f})"
      ]
    },
    "MODEL_23.5": {
      "description": "Reel Tüketim Çöküş Radarı (RSAFS_YoY - CPIAUCSL_YoY) büyüme rejim eşikleri (%).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "23.5",
      "thresholds": {
        "severe_contraction_max_pct": -2.0,
        "demand_contraction_max_pct": 0.0,
        "strong_expansion_min_pct": 2.0
      },
      "output_interpretation_template": "Real_Consumption_Growth = RSAFS_YoY - CPIAUCSL_YoY (ppt); severe contraction < {severe_contraction_max_pct:.1f}%, demand contraction ({severe_contraction_max_pct:.1f}% to {demand_contraction_max_pct:.1f}%), strong expansion > {strong_expansion_min_pct:.1f}%.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if growth < )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{severe_contraction_max_pct:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif growth < )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{demand_contraction_max_pct:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif growth > )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{strong_expansion_min_pct:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "status == SEVERE_REAL_CONTRACTION : Severe volume collapse & consumer stagnation (Real growth < {severe_contraction_max_pct:.1f}%)",
        "status == REAL_DEMAND_CONTRACTION : Price illusion and contracting retail sales volume ({severe_contraction_max_pct:.1f}% to {demand_contraction_max_pct:.1f}%)",
        "status == MODERATE_VOLUME_EXPANSION : Balanced and healthy consumption growth ({demand_contraction_max_pct:.1f}% to {strong_expansion_min_pct:.1f}%)",
        "status == STRONG_VOLUME_EXPANSION : Robust consumer demand and volumetric growth acceleration (> {strong_expansion_min_pct:.1f}%)"
      ]
    },
    "MODEL_23.6": {
      "description": "Erken İstihdam Çatlağı Sinyali (IC4WSA_YoY, UNRATE_Delta) ağırlık ve rejim eşikleri.",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "23.6",
      "thresholds": {
        "unrate_delta_weight": 10.0,
        "hidden_crisis_min_claims_yoy_pct": 15.0,
        "hidden_crisis_min_index": 15.0,
        "early_warning_min_claims_yoy_pct": 8.0,
        "early_warning_min_index": 5.0
      },
      "output_interpretation_template": "Early_Crack_Index = IC4WSA_YoY - (max(0, UNRATE_Delta) * {unrate_delta_weight:.1f}); hidden crisis if IC4WSA_YoY >= {hidden_crisis_min_claims_yoy_pct:.1f}% & Index >= {hidden_crisis_min_index:.1f}, early crack if >= {early_warning_min_claims_yoy_pct:.1f}% & >= {early_warning_min_index:.1f}.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*Early_Crack_Index = ICSA_YoY - \\(Effective_Unrate_Delta \\* )-?\\d+(?:\\.\\d+)?(\\))$",
          "replacement": "\\g<1>{unrate_delta_weight:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*raw_index = claims_yoy - \\(effective_u_delta \\* )-?\\d+(?:\\.\\d+)?(\\))$",
          "replacement": "\\g<1>{unrate_delta_weight:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*if claims_yoy >= )-?\\d+(?:\\.\\d+)?( and index > )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{hidden_crisis_min_claims_yoy_pct:.1f}\\g<2>{hidden_crisis_min_index:.1f}:"
        },
        {
          "pattern": "(?m)^(\\s*elif claims_yoy >= )-?\\d+(?:\\.\\d+)?( and index > )-?\\d+(?:\\.\\d+)?:$",
          "replacement": "\\g<1>{early_warning_min_claims_yoy_pct:.1f}\\g<2>{early_warning_min_index:.1f}:"
        }
      ],
      "txt_interpretation_lines": [
        "status == HIDDEN_CRISIS_UNFOLDING : Weekly claims surging rapidly while official unemployment has not reacted (Latent recession onset / Claims growth >= {hidden_crisis_min_claims_yoy_pct:.1f}% & Index >= {hidden_crisis_min_index:.1f})",
        "status == EARLY_WARNING_CRACK : Initial cracks emerging in the labor market (Leading crack signal / Claims growth >= {early_warning_min_claims_yoy_pct:.1f}% & Index >= {early_warning_min_index:.1f})",
        "status == LABOR_MARKET_ALIGNED : Data balanced or official unemployment moving in lockstep with claims (Healthy employment path)"
      ]
    },
    "MODEL_23.7": {
      "description": "Inventory to Sales Glut Ratio",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "23.7",
      "thresholds": {
        "glut_min_ratio": 1.45,
        "shortage_max_ratio": 1.28
      },
      "output_interpretation_template": "Formula: Ratio = ISRATIO (BUSINV / TOTBUSSALES). Regimes: ratio > {glut_min_ratio:.2f} -> SYSTEMIC_INVENTORY_GLUT; ratio < {shortage_max_ratio:.2f} -> SUPPLY_SHOCK_SHORTAGE; otherwise BALANCED_SUPPLY_CHAIN.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if ratio > )\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{glut_min_ratio:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*elif ratio < )\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{shortage_max_ratio:.2f}\\g<2>"
        }
      ],
      "txt_interpretation_lines": [
        "status == SYSTEMIC_INVENTORY_GLUT : Excessive inventory stockpiling paired with demand deficiency; manufacturers will slash output and shifts (Inventory recession alarm / Ratio > {glut_min_ratio:.2f})",
        "status == BALANCED_SUPPLY_CHAIN : Production and retail sales in equilibrium (Healthy inventory turnover / {shortage_max_ratio:.2f} to {glut_min_ratio:.2f})",
        "status == SUPPLY_SHOCK_SHORTAGE : Inventory depletion and supply chain bottlenecking; empty shelves and cost-push inflation pressure (Ratio < {shortage_max_ratio:.2f})"
      ]
    },
    "MODEL_23.8": {
      "description": "Mortgage and Permit Divergence (Housing Freeze Index)",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "23.8",
      "thresholds": {
        "permit_yoy_divisor": 10.0,
        "severe_freeze_min_index": 8.0,
        "supply_contraction_min_index": 5.0
      },
      "output_interpretation_template": "Formula: Housing_Freeze_Index = MORTGAGE30US - (PERMIT_YoY / {permit_yoy_divisor:.1f}). Regimes: index > {severe_freeze_min_index:.1f} -> SEVERE_HOUSING_FREEZE; index > {supply_contraction_min_index:.1f} -> SUPPLY_CONTRACTION; otherwise HEALTHY_EXPANSION.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*Housing_Freeze_Index = MORTGAGE30US - \\(PERMIT_YoY / )\\d+(?:\\.\\d+)?(\\))$",
          "replacement": "\\g<1>{permit_yoy_divisor:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*raw_index = float\\(mortgage_rate\\) - \\(float\\(permit_yoy\\) / )\\d+(?:\\.\\d+)?(\\))$",
          "replacement": "\\g<1>{permit_yoy_divisor:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*if index > )\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{severe_freeze_min_index:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*elif index > )\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{supply_contraction_min_index:.1f}\\g<2>"
        }
      ],
      "txt_interpretation_lines": [
        "status == SEVERE_HOUSING_FREEZE : Severe mortgage rate shock causing permit collapse; home construction frozen, acute supply crisis (Index > {severe_freeze_min_index:.1f})",
        "status == SUPPLY_CONTRACTION : High borrowing costs depressing builder activity; new housing supply contracting (Index {supply_contraction_min_index:.1f} to {severe_freeze_min_index:.1f})",
        "status == HEALTHY_EXPANSION : Supportive financing conditions; healthy expansion in residential supply (Index <= {supply_contraction_min_index:.1f})"
      ]
    },
    "MODEL_24": {
      "description": "Safe Haven Flight Index",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "24",
      "thresholds": {
        "score_scale_divisor": 100.0,
        "extreme_panic_min_ratio": 2.50,
        "high_flight_min_ratio": 1.80,
        "moderate_hedging_min_ratio": 1.00
      },
      "output_interpretation_template": "Formula: Dollar_Bond_Ratio = DTWEXBGS / DGS10; Safe_Haven_Score = Dollar_Bond_Ratio * BAMLH0A0HYM2; Flight_Ratio = Safe_Haven_Score / {score_scale_divisor:.1f}. Regimes: ratio > {extreme_panic_min_ratio:.2f} -> EXTREME_LIQUIDITY_PANIC; ratio > {high_flight_min_ratio:.2f} -> HIGH_FLIGHT_TO_SAFETY; ratio > {moderate_hedging_min_ratio:.2f} -> MODERATE_HEDGING; otherwise NORMAL_MARKET_REGIME.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*Flight_To_Safety_Ratio = Safe_Haven_Score / )\\d+(?:\\.\\d+)?()$",
          "replacement": "\\g<1>{score_scale_divisor:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*raw_ratio = raw_score / )\\d+(?:\\.\\d+)?()$",
          "replacement": "\\g<1>{score_scale_divisor:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*if raw_ratio > )\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{extreme_panic_min_ratio:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*elif raw_ratio > )\\d+(?:\\.\\d+)?(:\\s*\\n\\s*regime = \"HIGH_FLIGHT_TO_SAFETY\")$",
          "replacement": "\\g<1>{high_flight_min_ratio:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*elif raw_ratio > )\\d+(?:\\.\\d+)?(:\\s*\\n\\s*regime = \"MODERATE_HEDGING\")$",
          "replacement": "\\g<1>{moderate_hedging_min_ratio:.2f}\\g<2>"
        }
      ],
      "txt_interpretation_lines": [
        "regime == EXTREME_LIQUIDITY_PANIC : Systemic liquidity shock, aggressive dash for cash, and heavy asset liquidation (Ratio > {extreme_panic_min_ratio:.2f})",
        "regime == HIGH_FLIGHT_TO_SAFETY : Acute geopolitical tension and flight to safety (Ratio {high_flight_min_ratio:.2f} to {extreme_panic_min_ratio:.2f})",
        "regime == MODERATE_HEDGING : Moderate defensive portfolio posture and cautious stance (Ratio {moderate_hedging_min_ratio:.2f} to {high_flight_min_ratio:.2f})",
        "regime == NORMAL_MARKET_REGIME : Routine risk appetite and balanced market pricing (Ratio <= {moderate_hedging_min_ratio:.2f})"
      ]
    },
    "MODEL_25": {
      "description": "Terms of Trade (TOT)",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "25",
      "thresholds": {
        "index_base": 100.0
      },
      "output_interpretation_template": "Formula: Terms_Of_Trade = (IQ / IR) * {index_base:.1f}. Regimes: tot > {index_base:.1f} -> FAVORABLE_TRADE; tot == {index_base:.1f} -> BASELINE_EQUILIBRIUM; tot < {index_base:.1f} -> DETERIORATING_TERMS.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*Terms_Of_Trade = \\(Export_Price_Index / Import_Price_Index\\) \\* )\\d+(?:\\.\\d+)?()$",
          "replacement": "\\g<1>{index_base:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*res = \\(export_idx / import_idx\\) \\* )\\d+(?:\\.\\d+)?()$",
          "replacement": "\\g<1>{index_base:.1f}\\g<2>"
        }
      ],
      "txt_interpretation_lines": [
        "TOT > {index_base:.1f} : FAVORABLE_TRADE (Export revenue purchasing power expanding / Positive terms of trade)",
        "TOT == {index_base:.1f} : BASELINE_EQUILIBRIUM (Historical baseline equilibrium)",
        "TOT < {index_base:.1f} : DETERIORATING_TERMS (Imported goods relatively more expensive / Real income loss & current account pressure)"
      ]
    },
    "MODEL_25.12": {
      "description": "Brent-WTI Benchmark Price Spread",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.12",
      "thresholds": {
        "wide_spread_min_usd": 8.0,
        "narrow_spread_max_usd": 1.5
      },
      "output_interpretation_template": "Formula: Brent_WTI_Spread = DCOILBRENTEU - DCOILWTICO. Regimes: spread > ${wide_spread_min_usd:.2f} -> WIDE_BRENT_WTI_SPREAD; spread < ${narrow_spread_max_usd:.2f} -> NARROW_BRENT_WTI_SPREAD; otherwise TYPICAL_BRENT_WTI_SPREAD.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if spread > )\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{wide_spread_min_usd:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*elif spread < )\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{narrow_spread_max_usd:.2f}\\g<2>"
        }
      ],
      "txt_interpretation_lines": [
        "Spread > ${wide_spread_min_usd:.2f} : WIDE_BRENT_WTI_SPREAD (Brent is priced at a wide premium to WTI)",
        "${narrow_spread_max_usd:.2f} to ${wide_spread_min_usd:.2f} : TYPICAL_BRENT_WTI_SPREAD (The benchmark price difference is within the model's middle band)",
        "Spread < ${narrow_spread_max_usd:.2f} : NARROW_BRENT_WTI_SPREAD (The benchmark price difference is narrow or WTI is priced above Brent)",
        "These are descriptive bands using the model's existing thresholds; the spread indicates relative benchmark pricing, not the cause of the difference. Commercial crude stocks and U.S. field production are context metrics only and do not affect the spread or status."
      ]
    },
    "MODEL_25.2": {
      "description": "Sticky vs. Flexible CPI Spread thresholds and output interpretation",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "25.2",
      "thresholds": {
        "structural_trap_min_ppt": 2.0,
        "transitory_surge_max_ppt": -2.0
      },
      "output_interpretation_template": "Evaluates core inflation persistence versus transient price shocks by measuring the spread between sticky CPI (services, shelter) and flexible CPI (fuel, food). Spreads > {structural_trap_min_ppt:.1f} ppt reflect structural service-shelter inflation entrapment.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s+)if impulse > [0-9.]+:$",
          "replacement": "\\g<1>if impulse > {structural_trap_min_ppt}:"
        },
        {
          "pattern": "(?m)^(\\s+)elif impulse < -?[0-9.]+:$",
          "replacement": "\\g<1>elif impulse < {transitory_surge_max_ppt}:"
        }
      ],
      "txt_interpretation_lines": [
        "Sticky_Impulse > {structural_trap_min_ppt:.1f}% : STRUCTURAL_INFLATION_TRAP (Sticky inflation pressure / Shelter & services rigidity / Core inflation trap)",
        "Sticky_Impulse < {transitory_surge_max_ppt:.1f}% : TRANSITORY_INFLATION_SURGE (Transient commodity/energy price surge / Flexible price spike)",
        "{transitory_surge_max_ppt:.1f}% to {structural_trap_min_ppt:.1f}% : BALANCED_DISINFLATION_PATH (Coherent and balanced disinflation trajectory)"
      ]
    },
    "MODEL_25.3": {
      "description": "Global Supply Chain Pressure Logistics Engine (NY Fed GSCPI) thresholds and output interpretation",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.3",
      "thresholds": {
        "supply_shock_min_zscore": 1.5,
        "deflation_slack_max_zscore": -1.0
      },
      "output_interpretation_template": "Tracks standard deviations of global freight rates, shipping costs, and delivery times from historical mean. Values > {supply_shock_min_zscore:.1f} indicate supply chain shocks.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s+)if z_score > [0-9.]+:$",
          "replacement": "\\g<1>if z_score > {supply_shock_min_zscore}:"
        },
        {
          "pattern": "(?m)^(\\s+)elif z_score < -?[0-9.]+:$",
          "replacement": "\\g<1>elif z_score < {deflation_slack_max_zscore}:"
        }
      ],
      "txt_interpretation_lines": [
        "GSCPI_ZScore > {supply_shock_min_zscore:.1f} : SUPPLY_CHAIN_SHOCK (Supply-side cost inflation shock / Logistics bottlenecks / Elevated freight and shipping delays)",
        "GSCPI_ZScore < {deflation_slack_max_zscore:.1f} : LOGISTICS_DEFLATION_SLACK (Excess supply chain slack / Disinflationary goods pricing)",
        "{deflation_slack_max_zscore:.1f} to {supply_shock_min_zscore:.1f} : NORMALIZED_GLOBAL_TRADE (Normalized global trade and logistics flows)"
      ]
    },
    "MODEL_25.5": {
      "description": "Repo Liquidity Friction Spread Engine (SOFR - EFFR) thresholds and output interpretation",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "25.5",
      "thresholds": {
        "bps_scale_multiplier": 100.0,
        "liquidity_crunch_min_bps": 10.0,
        "cash_drain_min_bps": 5.0,
        "collateral_scarcity_max_bps": -5.0
      },
      "output_interpretation_template": "Measures funding market friction tracking the spread between secured repo financing (SOFR) and unsecured Fed funds (EFFR). Spreads between {collateral_scarcity_max_bps:.1f} and +{cash_drain_min_bps:.1f} bps indicate healthy monetary transmission.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*)raw_spread = \\(f_sofr - f_effr\\) \\* [0-9.]+$",
          "replacement": "\\g<1>raw_spread = (f_sofr - f_effr) * {bps_scale_multiplier}"
        },
        {
          "pattern": "(?m)^(\\s*)if spread > [0-9.]+:$",
          "replacement": "\\g<1>if spread > {liquidity_crunch_min_bps}:"
        },
        {
          "pattern": "(?m)^(\\s*)elif spread >= [0-9.]+:$",
          "replacement": "\\g<1>elif spread >= {cash_drain_min_bps}:"
        },
        {
          "pattern": "(?m)^(\\s*)elif spread < -?[0-9.]+:$",
          "replacement": "\\g<1>elif spread < {collateral_scarcity_max_bps}:"
        }
      ],
      "txt_interpretation_lines": [
        "Repo_Friction_bps > {liquidity_crunch_min_bps:.1f} bps : REPO_MARKET_LIQUIDITY_CRUNCH (Acute overnight repo funding strain / Cash scarcity / Fed intervention risk)",
        "{cash_drain_min_bps:.1f} bps to {liquidity_crunch_min_bps:.1f} bps : SYSTEMIC_CASH_DRAIN_WARNING (Systemic cash drain warning / Constrained balance sheet capacity)",
        "{collateral_scarcity_max_bps:.1f} bps to {cash_drain_min_bps:.1f} bps : HEALTHY_MONETARY_TRANSMISSION (Healthy, balanced monetary transmission mechanism)",
        "Repo_Friction_bps < {collateral_scarcity_max_bps:.1f} bps : COLLATERAL_SCARCITY_GLUT (Excess cash liquidity / Treasury bill scarcity / Collateral squeeze)"
      ]
    },
    "MODEL_25.6": {
      "description": "Gold / Real Yield Debasement Gauge thresholds and output interpretation",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.6",
      "thresholds": {
        "panic_real_yield_min_pct": 1.5,
        "panic_gold_yoy_min_pct": 15.0,
        "accommodative_real_yield_max_pct": 0.0,
        "accommodative_gold_yoy_min_pct": 0.0
      },
      "output_interpretation_template": "Detects de-dollarization trends and fiat debasement by measuring breakdowns in the traditional inverse correlation between 10-year TIPS real yields and gold prices. Gold rallying above {panic_gold_yoy_min_pct:.0f}% alongside real yields > {panic_real_yield_min_pct:.1f}% signals systemic de-dollarization.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*)if ry_val > [0-9.]+ and gy_val > [0-9.]+:$",
          "replacement": "\\g<1>if ry_val > {panic_real_yield_min_pct} and gy_val > {panic_gold_yoy_min_pct}:"
        },
        {
          "pattern": "(?m)^(\\s*)elif ry_val <= -?[0-9.]+ and gy_val > -?[0-9.]+:$",
          "replacement": "\\g<1>elif ry_val <= {accommodative_real_yield_max_pct} and gy_val > {accommodative_gold_yoy_min_pct}:"
        }
      ],
      "txt_interpretation_lines": [
        "Real_Yield > {panic_real_yield_min_pct:.1f}% and Gold_YoY > {panic_gold_yoy_min_pct:.1f}% : DEBALANCING_DEDOLLARIZATION_PANIC (Systemic fiat distrust / Geopolitical de-dollarization / Reserve diversification)",
        "Real_Yield <= {accommodative_real_yield_max_pct:.1f}% and Gold_YoY > {accommodative_gold_yoy_min_pct:.1f}% : ACCOMMODATIVE_GOLD_BULL (Classic negative real yield gold bull / Monetary expansion tailwind)",
        "Otherwise : TRADITIONAL_REAL_RATE_DOMINANCE (Traditional market equilibrium / Real yields exerting downward pressure on gold)"
      ]
    },
    "MODEL_25.7": {
      "description": "OVX / VIX Geopolitical Energy Shock Engine thresholds and output interpretation",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.7",
      "thresholds": {
        "energy_shock_min_ratio": 2.2,
        "equity_panic_max_ratio": 1.0
      },
      "output_interpretation_template": "Evaluates the ratio between crude oil volatility (OVX) and equity volatility (VIX). Ratios > {energy_shock_min_ratio:.1f} signal severe geopolitical oil supply shocks and stagflationary headwinds.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*)if ratio > [0-9.]+:$",
          "replacement": "\\g<1>if ratio > {energy_shock_min_ratio}:"
        },
        {
          "pattern": "(?m)^(\\s*)elif ratio < [0-9.]+:$",
          "replacement": "\\g<1>elif ratio < {equity_panic_max_ratio}:"
        }
      ],
      "txt_interpretation_lines": [
        "Vol_Ratio > {energy_shock_min_ratio:.1f} : ENERGY_SUPPLY_SHOCK_ALARM (Geopolitical energy supply shock / Stagflation risk / Energy price spike)",
        "Vol_Ratio < {equity_panic_max_ratio:.1f} : EQUITY_PANIC_OVER_ENERGY (Equity panic dominates / Oil market calm)",
        "{equity_panic_max_ratio:.1f} to {energy_shock_min_ratio:.1f} : BALANCED_ENERGY_VOLATILITY (Normalized energy volatility equilibrium)"
      ]
    },
    "MODEL_25.8": {
      "description": "Natgas / Crude Oil Price-Ratio Disconnect Engine thresholds and output interpretation",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.8",
      "thresholds": {
        "crisis_max_ratio": 6.0,
        "glut_min_ratio": 35.0
      },
      "output_interpretation_template": "Tracks relative purchasing power: at current quotes, the price of one WTI barrel buys {ratio:.2f} MMBtu of Henry Hub gas. Ratios below {crisis_max_ratio:g} mark the near-thermal-equivalence band around 5.8 MMBtu per barrel; ratios above {glut_min_ratio:g} flag the empirical high-ratio tail of the matched post-2009 daily series. EIA underground gas storage is supplied as context alongside the price ratio.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if ratio < )\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{crisis_max_ratio:.1f}\\2"
        },
        {
          "pattern": "(?m)^(\\s*elif ratio > )\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{glut_min_ratio:.1f}\\2"
        }
      ],
      "txt_interpretation_lines": [
        "WTI_HH_Purchasing_Power_Ratio < {crisis_max_ratio:.1f} : NATGAS_CRISIS_BLACKOUT_RISK (Near-thermal-parity / high relative Henry Hub price band)",
        "WTI_HH_Purchasing_Power_Ratio > {glut_min_ratio:.1f} : NATGAS_GLUT_ENERGY_CHEAP (High WTI-to-Henry Hub purchasing-power band)",
        "{crisis_max_ratio:.1f} to {glut_min_ratio:.1f} : ENERGY_PARITY_EQUILIBRIUM (Intermediate price-ratio band; not an energy-equivalence finding)"
      ]
    },
    "MODEL_25.9": {
      "description": "Gasoline / Distillate / Crude 3:2:1 Crack Spread thresholds and output interpretation",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.9",
      "thresholds": {
        "gallons_per_barrel": 42.0,
        "refinery_bottleneck_min_pct": 93.0,
        "refinery_maintenance_max_pct": 85.0
      },
      "output_interpretation_template": "The same-date 3:2:1 crack spread is {spread:.2f} USD/bbl, {direction} {change_text} from {prior_year_spread:.2f} USD/bbl one year earlier. Status describes the year-over-year direction, not whether the absolute spread is high or low. Gasoline inventory is contextual only.",
      "unclassified_interpretation": "Calculates the same-date New York Harbor 3:2:1 spot crack spread. A year-over-year classification requires all three prior-year prices; gasoline inventory is contextual only.",
      "partial_year_ago_interpretation": "Calculates the same-date New York Harbor 3:2:1 spot crack spread. Year-over-year classification is unavailable because all three prior-year prices are required; gasoline inventory is contextual only.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*raw_spread = \\(\\(2 \\* f_gasoline \\* )\\d+(?:\\.\\d+)?(\\) \\+ \\(f_ulsd \\* )\\d+(?:\\.\\d+)?(\\)\\) / 3\\.0 - f_wti)$",
          "replacement": "\\g<1>{gallons_per_barrel:.1f}\\g<2>{gallons_per_barrel:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)^(\\s*prior_spread = round\\(\\(\\(2 \\* f_gas \\* )\\d+(?:\\.\\d+)?(\\) \\+ \\(f_ulsd \\* )\\d+(?:\\.\\d+)?(\\)\\) / 3\\.0 - f_wti, 2\\))$",
          "replacement": "\\g<1>{gallons_per_barrel:.1f}\\g<2>{gallons_per_barrel:.1f}\\g<3>"
        }
      ],
      "txt_interpretation_lines": [
        "The status says whether the spread expanded, contracted, or was unchanged versus the provider's year-ago values; it does not label the absolute spread high or low.",
        "EIA gasoline stocks remain a separate context metric; no fixed consumption value is substituted for missing demand data."
      ]
    },
    "MODEL_25.10": {
      "description": "SLOOS Lending Standards Recession Gauge thresholds and output interpretation",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "25.10",
      "thresholds": {
        "crunch_min_pct": 40.0,
        "restrictive_min_pct": 20.0,
        "expansion_max_pct": -10.0
      },
      "output_interpretation_template": "Tracks the net percentage of domestic US banks tightening lending standards on commercial and industrial (C&I) loans. Values > {crunch_min_pct:g}% signal an acute credit channel freeze and recession.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if tightness > )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{crunch_min_pct:.1f}\\2"
        },
        {
          "pattern": "(?m)^(\\s*elif tightness >= )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{restrictive_min_pct:.1f}\\2"
        },
        {
          "pattern": "(?m)^(\\s*elif tightness <= )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{expansion_max_pct:.1f}\\2"
        }
      ],
      "txt_interpretation_lines": [
        "Credit_Tightening_Net_Pct > {crunch_min_pct:.1f}% : ACUTE_CREDIT_CRUNCH_RECESSION_SIGNAL (Acute credit channel freeze / Historical recession benchmark / Liquidity crisis alarm)",
        "{restrictive_min_pct:.1f}% to {crunch_min_pct:.1f}% : RESTRICTIVE_CREDIT_CONTRACTION (Noticeable lending standards tightening / Business investment and hiring headwinds)",
        "{expansion_max_pct:.1f}% to {restrictive_min_pct:.1f}% : NEUTRAL_CREDIT_CONDITIONS (Balanced credit flow and standard bank lending appetite)",
        "Credit_Tightening_Net_Pct < {expansion_max_pct:.1f}% : AGGRESSIVE_CREDIT_EXPANSION (Loose credit standards / Aggressive credit expansion / Asset bubble risk)"
      ]
    },
    "MODEL_25.11": {
      "description": "Full-Time vs. Involuntary Part-Time Crack Gauge thresholds and output interpretation",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "25.11",
      "thresholds": {
        "fracture_min_spread_pct": 30.0,
        "fracture_min_pt_yoy_pct": 15.0,
        "weakening_min_spread_pct": 18.0,
        "expansion_max_spread_pct": -10.0
      },
      "output_interpretation_template": "Detects hidden labor market fragility by comparing the annual surge in involuntary part-time workers against changes in full-time employment. Spreads > {weakening_min_spread_pct:.1f} ppt signal structural weakening obscured by headline data.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*if spread > )-?\\d+(?:\\.\\d+)?( and pt_yoy_rounded > )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{fracture_min_spread_pct:.1f}\\g<2>{fracture_min_pt_yoy_pct:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)^(\\s*elif spread > )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{weakening_min_spread_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*elif spread < )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{expansion_max_spread_pct:.1f}\\g<2>"
        }
      ],
      "txt_interpretation_lines": [
        "Crack_Spread > {fracture_min_spread_pct:.1f}% and Part_Time_YoY > {fracture_min_pt_yoy_pct:.1f}% : ACUTE_LABOR_MARKET_FRACTURE_RECESSION (Acute labor market fracture / Companies replacing full-time with part-time staff / High-conviction recession signal)",
        "Crack_Spread > {weakening_min_spread_pct:.1f}% : STRUCTURAL_EMPLOYMENT_WEAKENING_SIGNAL (Structural labor softening / Emerging cracks obscured by headline data)",
        "{expansion_max_spread_pct:.1f}% to {weakening_min_spread_pct:.1f}% : STABLE_EMPLOYMENT_COMPOSITION (Stable employment composition / No unusual labor market distortion)",
        "Crack_Spread < {expansion_max_spread_pct:.1f}% : ROBUST_FULL_TIME_EXPANSION (Robust full-time job creation / Resilient labor market)"
      ]
    },
    "MODEL_25.13": {
      "description": "Labor Market Momentum Index (LMMI / EMME) thresholds and output interpretation",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "25.13",
      "thresholds": {
        "strong_expansion_min_lmmi": 1.0,
        "moderate_expansion_min_lmmi": 0.2,
        "deterioration_max_lmmi": -0.2
      },
      "output_interpretation_template": "Couples nonfarm payroll expansion with unemployment change to gauge labor slack and wage inflation momentum. LMMI > {strong_expansion_min_lmmi:.2f} signals strong expansion, {moderate_expansion_min_lmmi:.2f} to {strong_expansion_min_lmmi:.2f} moderate expansion, and < {deterioration_max_lmmi:.2f} deterioration risk.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^( {18}if lmmi > )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{moderate_expansion_min_lmmi:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^( {14}if lmmi > )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{strong_expansion_min_lmmi:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*elif lmmi > )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{moderate_expansion_min_lmmi:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^( {18}elif lmmi < )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{deterioration_max_lmmi:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^( {14}elif lmmi < )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{deterioration_max_lmmi:.2f}\\g<2>"
        }
      ],
      "txt_interpretation_lines": [
        "LMMI > +{strong_expansion_min_lmmi:.2f} (or rising): STRONG_LABOR_EXPANSION (Robust payroll expansion and declining/stable unemployment; accelerating labor market strength; lowers dovish Fed cut urgency)",
        "+{moderate_expansion_min_lmmi:.2f} < LMMI <= +{strong_expansion_min_lmmi:.2f} (or declining vs previous month): DECELERATING_LABOR_MOMENTUM / MODERATE_LABOR_EXPANSION (Employment expanding but losing velocity or unemployment ticking higher; late-cycle cooling)",
        "{deterioration_max_lmmi:.2f} <= LMMI <= +{moderate_expansion_min_lmmi:.2f}: BALANCED_LABOR_MARKET (Neutral labor signals; payroll creation roughly in line with labor force demographics)",
        "LMMI < {deterioration_max_lmmi:.2f}: LABOR_MARKET_DETERIORATION_RISK (Weakening payroll growth and rising unemployment; recessionary cracks widening)"
      ]
    },
    "MODEL_25.14": {
      "description": "AI Hardware & Semiconductor Supply Chain Stress Gauge thresholds and output interpretation",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.14",
      "thresholds": {
        "gscpi_weight": 0.4,
        "sox_yoy_scale": 50.0,
        "sox_weight": -0.35,
        "vix_baseline": 20.0,
        "vix_weight": 0.25,
        "crunch_min_score": 1.2,
        "bottleneck_min_score": 0.5,
        "abundance_max_score": -0.4
      },
      "output_interpretation_template": "Normalized composite metric monitoring semiconductor physical supply bottlenecks, hardware inflation, and space-grade tactical defense processor conduits (SEC_DEF_STARSHIELD). Scores >= {bottleneck_min_score:.2f} signal elevated bottleneck and >= {crunch_min_score:.2f} acute supply crunch.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(\\s*gscpi_comp = g \\* )-?\\d+(?:\\.\\d+)?$",
          "replacement": "\\g<1>{gscpi_weight:.2f}"
        },
        {
          "pattern": "(?m)^(\\s*sox_comp = \\(s / )\\d+(?:\\.\\d+)?(\\) \\* )-?\\d+(?:\\.\\d+)?$",
          "replacement": "\\g<1>{sox_yoy_scale:.1f}\\g<2>{sox_weight:.2f}"
        },
        {
          "pattern": "(?m)^(\\s*vix_comp = \\(v / )\\d+(?:\\.\\d+)?(\\) \\* )-?\\d+(?:\\.\\d+)?$",
          "replacement": "\\g<1>{vix_baseline:.1f}\\g<2>{vix_weight:.2f}"
        },
        {
          "pattern": "(?m)^(\\s*if stress_score >= )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{crunch_min_score:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*elif stress_score >= )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{bottleneck_min_score:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)^(\\s*elif stress_score <= )-?\\d+(?:\\.\\d+)?(:)$",
          "replacement": "\\g<1>{abundance_max_score:.2f}\\g<2>"
        }
      ],
      "txt_interpretation_lines": [
        "Stress >= +{crunch_min_score:.2f} : ACUTE_CHIP_SUPPLY_CRUNCH (Severe physical supply chain disruption, foundry shutdown or Taiwan maritime embargo risk; tech Capex delays)",
        "+{bottleneck_min_score:.2f} <= Stress < +{crunch_min_score:.2f} : ELEVATED_SEMICONDUCTOR_BOTTLENECK (Supply constraints outpacing delivery capacity; hardware inflation and extended lead times)",
        "{abundance_max_score:.2f} < Stress < +{bottleneck_min_score:.2f} : BALANCED_HARDWARE_FLOW (Normal semiconductor cycle and functioning global logistics channels)",
        "Stress <= {abundance_max_score:.2f} : CHIP_SUPPLY_ABUNDANCE_EXPANSION (High fabrication throughput, robust capacity expansion, and subdued market volatility)"
      ]
    },
    "MODEL_25.15": {
      "description": "Domestic Governance Gridlock & External Tariff Friction Engine",
      "shelf": "llms-formulas-geopolitics.txt",
      "formula_number": "25.15",
      "on_demand_placeholder": {
        "unit": "Friction Bias",
        "status": "ON_DEMAND_INPUT_UNAVAILABLE",
        "execution_mode": "ON_DEMAND_ONLY",
        "inputs": {
          "country_code": null,
          "majority_seat_margin": null,
          "executive_decree_power": null
        },
        "metrics": {
          "gridlock_index": null,
          "external_friction_bias": null
        },
        "interpretation": "ON_DEMAND_ONLY: Not calculated in live loop; requires manual inputs (country_code, majority_seat_margin, executive_decree_power). Agents: call get_formula_router('25.15') to evaluate."
      },
      "thresholds": {
        "valid_countries": [
          "GEO_US",
          "GEO_CN",
          "GEO_RU",
          "GEO_DE",
          "GEO_IL",
          "GEO_JP"
        ],
        "centralized_countries": [
          "GEO_CN",
          "GEO_RU"
        ],
        "decree_min": 0.0,
        "decree_max": 1.0,
        "centralized_gridlock_index": 0.0,
        "centralized_decree_multiplier": 0.75,
        "negative_margin_base_gridlock": 0.60,
        "negative_margin_slope": 0.02,
        "positive_margin_base_gridlock": 0.40,
        "positive_margin_slope": 0.015,
        "gridlock_min": 0.0,
        "gridlock_max": 1.0,
        "divided_min_gridlock": 0.60,
        "divided_min_friction": 0.45,
        "fragile_min_gridlock": 0.35,
        "fragile_max_friction": 0.45,
        "unified_max_gridlock": 0.25,
        "unified_min_margin": 15.0
      },
      "centralized_interpretation": "Centralized vertical strategic command deploying external trade and economic leverage without domestic legislative gridlock.",
      "output_interpretation_template": "Quantifies domestic legislative gridlock driving unilateral executive trade tariffs, foreign sanctions, and cross-border economic friction.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)External_Friction_Bias = Executive_Decree_Power \\* [0-9.]+",
          "replacement": "\\g<ind>External_Friction_Bias = Executive_Decree_Power * {centralized_decree_multiplier:.2f}"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)Gridlock_Index = min\\([0-9.]+, [0-9.]+ \\+ abs\\(Majority_Seat_Margin\\) \\* [0-9.]+\\)",
          "replacement": "\\g<ind>Gridlock_Index = min({gridlock_max:.1f}, {negative_margin_base_gridlock:.2f} + abs(Majority_Seat_Margin) * {negative_margin_slope:.2f})"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)Gridlock_Index = max\\([0-9.]+, [0-9.]+ - \\(Majority_Seat_Margin \\* [0-9.]+\\)\\)",
          "replacement": "\\g<ind>Gridlock_Index = max({gridlock_min:.1f}, {positive_margin_base_gridlock:.2f} - (Majority_Seat_Margin * {positive_margin_slope:.3f}))"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)ext_friction = round\\(decree \\* [0-9.]+, 3\\)",
          "replacement": "\\g<ind>ext_friction = round(decree * {centralized_decree_multiplier:.2f}, 3)"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)gridlock = round\\(min\\([0-9.]+, [0-9.]+ \\+ abs\\(margin\\) \\* [0-9.]+\\), 3\\)",
          "replacement": "\\g<ind>gridlock = round(min({gridlock_max:.1f}, {negative_margin_base_gridlock:.2f} + abs(margin) * {negative_margin_slope:.2f}), 3)"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)gridlock = round\\(max\\([0-9.]+, [0-9.]+ - \\(margin \\* [0-9.]+\\)\\), 3\\)",
          "replacement": "\\g<ind>gridlock = round(max({gridlock_min:.1f}, {positive_margin_base_gridlock:.2f} - (margin * {positive_margin_slope:.3f})), 3)"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)if gridlock >= [0-9.]+ and ext_friction >= [0-9.]+:",
          "replacement": "\\g<ind>if gridlock >= {divided_min_gridlock:.2f} and ext_friction >= {divided_min_friction:.2f}:"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)elif gridlock >= [0-9.]+ and ext_friction < [0-9.]+:",
          "replacement": "\\g<ind>elif gridlock >= {fragile_min_gridlock:.2f} and ext_friction < {fragile_max_friction:.2f}:"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)elif gridlock < [0-9.]+ and margin >= [0-9.]+:",
          "replacement": "\\g<ind>elif gridlock < {unified_max_gridlock:.2f} and margin >= {unified_min_margin:.0f}:"
        }
      ]
    },
    "MODEL_25.16": {
      "description": "Yen Carry Trade Dissolution & Cross-Currency Stress Gauge (JPY_CARRY_CRACK)",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "25.16",
      "thresholds": {
        "unwind_max_buffer": -1.0,
        "unwind_max_fx_mom": -5.0,
        "unwind_max_spread": 3.0,
        "compression_max_buffer": 1.5,
        "compression_max_fx_mom": -3.0,
        "calm_min_buffer": 3.5,
        "calm_min_fx_mom": -1.0
      },
      "output_interpretation_template": "Monitors cross-currency Yen Carry Trade buffer, unwinding risk, and global leverage liquidation shocks.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)if net_buffer <= -?[0-9.]+ or \\(fx_mom <= -?[0-9.]+ and rate_spread <= -?[0-9.]+\\):",
          "replacement": "\\g<ind>if net_buffer <= {unwind_max_buffer:.1f} or (fx_mom <= {unwind_max_fx_mom:.1f} and rate_spread <= {unwind_max_spread:.1f}):"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)elif net_buffer < -?[0-9.]+ or fx_mom <= -?[0-9.]+:",
          "replacement": "\\g<ind>elif net_buffer < {compression_max_buffer:.1f} or fx_mom <= {compression_max_fx_mom:.1f}:"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)elif net_buffer >= -?[0-9.]+ and fx_mom >= -?[0-9.]+:",
          "replacement": "\\g<ind>elif net_buffer >= {calm_min_buffer:.1f} and fx_mom >= {calm_min_fx_mom:.1f}:"
        }
      ]
    },
    "MODEL_25.17": {
      "description": "Liquidity & Commodity Macro Regime Matrix",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.17",
      "thresholds": {
        "brent_high_min_yoy": 15.0,
        "brent_deflation_max_yoy": 0.0,
        "slope_inversion_max_bps": 0.0,
        "acute_stagflation_max_slope_bps": -25.0
      },
      "output_interpretation_template": "Evaluates front-end money market liquidity (3M-1M T-Bill spread) against crude oil cost inflation (Brent YoY %) in a 2x2 macro matrix to identify systemic liquidity and cost shock regimes.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)if brent_yoy > -?[0-9.]+:",
          "replacement": "\\g<ind>if brent_yoy > {brent_high_min_yoy:.1f}:"
        },
        {
          "pattern": "(?m)(if brent_yoy > [^\\n]+\\n(?P<ind>[ \\t]*)if slope_bps < )-?[0-9.]+:",
          "replacement": "\\g<1>{slope_inversion_max_bps:.1f}:"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)if slope_bps <= -?[0-9.]+:",
          "replacement": "\\g<ind>if slope_bps <= {acute_stagflation_max_slope_bps:.1f}:"
        },
        {
          "pattern": "(?m)^(?P<ind>[ \\t]*)elif brent_yoy < -?[0-9.]+:",
          "replacement": "\\g<ind>elif brent_yoy < {brent_deflation_max_yoy:.1f}:"
        },
        {
          "pattern": "(?m)(elif brent_yoy < [^\\n]+\\n(?P<ind>[ \\t]*)if slope_bps < )-?[0-9.]+:",
          "replacement": "\\g<1>{slope_inversion_max_bps:.1f}:"
        },
        {
          "pattern": "(?m)(# Moderate / Neutral Cost Zone[^\\n]*\\n(?P<ind>[ \\t]*)if slope_bps < )-?[0-9.]+:",
          "replacement": "\\g<1>{slope_inversion_max_bps:.1f}:"
        }
      ]
    },
    "MODEL_25.18": {
      "description": "Non-Contiguous Alliance Dynamic Transmission Engine (Mecca Pact)",
      "shelf": "llms-formulas-geopolitics.txt",
      "formula_number": "25.18",
      "thresholds": {
        "delta_treaty_baseline": 0.1,
        "surplus_min_oil_ratio": 1.05,
        "surplus_energy_component": 0.05,
        "restraint_max_oil_ratio": 0.9,
        "restraint_energy_component": -0.05,
        "equilibrium_energy_component": 0.0,
        "dollar_stress_min_sofr": 5.25,
        "dollar_stress_component": -0.03,
        "dollar_benign_component": 0.0,
        "delta_clamp_min": -0.3,
        "delta_clamp_max": 0.3
      },
      "output_interpretation_template": "Non-contiguous trilateral defense integration linking Turkish aerospace/defense co-production, Saudi sovereign liquidity, and Pakistani strategic deterrence under dynamic oil and dollar regimes.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?Delta_treaty = )\\+?[0-9.]+",
          "replacement": "\\g<1>+{delta_treaty_baseline:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?If R_oil >= )[0-9.]+(: S_energy = )\\+?[0-9.]+",
          "replacement": "\\g<1>{surplus_min_oil_ratio:.2f}\\g<2>+{surplus_energy_component:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?Else If R_oil < )[0-9.]+(: S_energy = )-?[0-9.]+",
          "replacement": "\\g<1>{restraint_max_oil_ratio:.2f}\\g<2>{restraint_energy_component:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?Else: S_energy = )-?[0-9.]+",
          "replacement": "\\g<1>{equilibrium_energy_component:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?If SOFR >= )[0-9.]+(%: delta_dollar = )-?[0-9.]+",
          "replacement": "\\g<1>{dollar_stress_min_sofr:.2f}\\g<2>{dollar_stress_component:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?Else: delta_dollar = )-?[0-9.]+",
          "replacement": "\\g<1>{dollar_benign_component:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?dynamic_delta\\(TR_SA\\) = round\\(clamp\\(Delta_treaty \\+ S_energy \\+ delta_dollar, )-?[0-9.]+(, )-?[0-9.]+(\\), 2\\))",
          "replacement": "\\g<1>{delta_clamp_min:.2f}\\g<2>{delta_clamp_max:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?dynamic_delta\\(SA_PK\\) = round\\(clamp\\(Delta_treaty \\+ S_energy \\+ delta_dollar, )-?[0-9.]+(, )-?[0-9.]+(\\), 2\\))",
          "replacement": "\\g<1>{delta_clamp_min:.2f}\\g<2>{delta_clamp_max:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?dynamic_delta\\(TR_PK\\) = round\\(clamp\\(Delta_treaty \\+ min\\(0\\.0, delta_dollar\\), )-?[0-9.]+(, )-?[0-9.]+(\\), 2\\))",
          "replacement": "\\g<1>{delta_clamp_min:.2f}\\g<2>{delta_clamp_max:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?^[ \\t]*delta_treaty = )-?[0-9.]+",
          "replacement": "\\g<1>{delta_treaty_baseline:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?^[ \\t]*if r_oil >= )[0-9.]+(:\\n[ \\t]*s_energy = )-?[0-9.]+",
          "replacement": "\\g<1>{surplus_min_oil_ratio:.2f}\\g<2>{surplus_energy_component:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?^[ \\t]*elif r_oil < )[0-9.]+(:\\n[ \\t]*s_energy = )-?[0-9.]+",
          "replacement": "\\g<1>{restraint_max_oil_ratio:.2f}\\g<2>{restraint_energy_component:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?^[ \\t]*else:\\n[ \\t]*s_energy = )-?[0-9.]+",
          "replacement": "\\g<1>{equilibrium_energy_component:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?^[ \\t]*delta_dollar = )-?[0-9.]+( if f_sofr >= )[0-9.]+( else )-?[0-9.]+",
          "replacement": "\\g<1>{dollar_stress_component:.2f}\\g<2>{dollar_stress_min_sofr:.2f}\\g<3>{dollar_benign_component:.2f}"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?^[ \\t]*delta_tr_sa = round\\(min\\()-?[0-9.]+(, max\\()-?[0-9.]+(, delta_treaty \\+ s_energy \\+ delta_dollar\\)\\), 2\\))",
          "replacement": "\\g<1>{delta_clamp_max:.2f}\\g<2>{delta_clamp_min:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?^[ \\t]*delta_sa_pk = round\\(min\\()-?[0-9.]+(, max\\()-?[0-9.]+(, delta_treaty \\+ s_energy \\+ delta_dollar\\)\\), 2\\))",
          "replacement": "\\g<1>{delta_clamp_max:.2f}\\g<2>{delta_clamp_min:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?^[ \\t]*delta_tr_pk = round\\(min\\()-?[0-9.]+(, max\\()-?[0-9.]+(, delta_treaty \\+ min\\(0\\.0, delta_dollar\\)\\)\\), 2\\))",
          "replacement": "\\g<1>{delta_clamp_max:.2f}\\g<2>{delta_clamp_min:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?Brent >= )[0-9.]+( \\* Breakeven)",
          "replacement": "\\g<1>{surplus_min_oil_ratio:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?\\()[0-9.]+( <= R_oil < )[0-9.]+(\\))",
          "replacement": "\\g<1>{restraint_max_oil_ratio:.2f}\\g<2>{surplus_min_oil_ratio:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.18\\.[\\s\\S]*?\\(R_oil < )[0-9.]+(\\))",
          "replacement": "\\g<1>{restraint_max_oil_ratio:.2f}\\g<2>"
        }
      ]
    },
    "MODEL_25.20": {
      "description": "Broad Dollar Shortage & Offshore Liquidity Strain Index (BDSI)",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "25.20",
      "thresholds": {
        "broad_dollar_scale_pct": 5.0,
        "repo_spread_scale_bps": 15.0,
        "chokepoint_scale_pct": 100.0,
        "weight_broad_dollar": 0.35,
        "weight_repo_spread": 0.35,
        "weight_chokepoint": 0.3,
        "acute_min_bdsi": 0.65,
        "acute_min_repo_score": 0.6,
        "acute_min_choke_score": 0.7,
        "latent_min_bdsi": 0.35,
        "latent_min_repo_score": 0.0
      },
      "output_interpretation_template": "Detects covert offshore USD scarcity via Trade-Weighted Broad Dollar, secured repo spread (SOFR-EFFR), and maritime energy flow shock.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?S_broad = clamp\\(\\(Broad_Dollar_YoY_pct - 0\\.0\\) / )[0-9.]+(, 0\\.0, 1\\.0\\))",
          "replacement": "\\g<1>{broad_dollar_scale_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?S_repo = clamp\\(Spread_repo_bps / )[0-9.]+(, 0\\.0, 1\\.0\\))",
          "replacement": "\\g<1>{repo_spread_scale_bps:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?S_choke = clamp\\(abs\\(Hormuz_AIS_drop_pct\\) / )[0-9.]+(, 0\\.0, 1\\.0\\))",
          "replacement": "\\g<1>{chokepoint_scale_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?BDSI = \\()[0-9.]+( \\* S_broad\\) \\+ \\()[0-9.]+( \\* S_repo\\) \\+ \\()[0-9.]+( \\* S_choke\\))",
          "replacement": "\\g<1>{weight_broad_dollar:.2f}\\g<2>{weight_repo_spread:.2f}\\g<3>{weight_chokepoint:.2f}\\g<4>"
        },
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?^[ \\t]*s_broad = max\\(0\\.0, min\\(1\\.0, yoy / )[0-9.]+(\\)\\))",
          "replacement": "\\g<1>{broad_dollar_scale_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?^[ \\t]*s_repo = max\\(0\\.0, min\\(1\\.0, spread_bps / )[0-9.]+(\\)\\))",
          "replacement": "\\g<1>{repo_spread_scale_bps:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?^[ \\t]*s_choke = max\\(0\\.0, min\\(1\\.0, abs\\(choke\\) / )[0-9.]+(\\)\\))",
          "replacement": "\\g<1>{chokepoint_scale_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?^[ \\t]*bdsi = round\\()[0-9.]+( \\* s_broad \\+ )[0-9.]+( \\* s_repo \\+ )[0-9.]+( \\* s_choke, 4\\))",
          "replacement": "\\g<1>{weight_broad_dollar:.2f}\\g<2>{weight_repo_spread:.2f}\\g<3>{weight_chokepoint:.2f}\\g<4>"
        },
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?^[ \\t]*if bdsi >= )[0-9.]+( or \\(s_repo >= )[0-9.]+( and s_choke >= )[0-9.]+(\\):)",
          "replacement": "\\g<1>{acute_min_bdsi:.2f}\\g<2>{acute_min_repo_score:.2f}\\g<3>{acute_min_choke_score:.2f}\\g<4>"
        },
        {
          "pattern": "(?m)(### 25\\.20\\.[\\s\\S]*?^[ \\t]*elif bdsi >= )[0-9.]+( or s_repo > )[0-9.]+(:)",
          "replacement": "\\g<1>{latent_min_bdsi:.2f}\\g<2>{latent_min_repo_score:.1f}\\g<3>"
        }
      ]
    },
    "MODEL_25.21": {
      "description": "Russia-India Crude Import Value Concentration Engine",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.21",
      "thresholds": {
        "critical_min_concentration_pct": 30.0,
        "elevated_min_concentration_pct": 20.0,
        "moderate_min_concentration_pct": 10.0
      },
      "output_interpretation_template": "The customs value of India's crude oil imports from Russia accounts for {concentration_pct:.2f}% of total crude oil import value in the reporting period. This reflects the import value share on a customs basis; it does not in itself establish actual capital transfer or physical import volume change.",
      "output_divergence_suffix_template": " Price-value divergence ({pvd:+.2f} ppt vs Brent FY YoY) indicates an explanatory divergence between import value and global oil price growth; it does not in itself establish physical volume change in the absence of Urals pricing and tonnage data.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 25\\.21\\.[\\s\\S]*?^[ \\t]*if concentration_pct >= )[0-9.]+(:)",
          "replacement": "\\g<1>{critical_min_concentration_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.21\\.[\\s\\S]*?^[ \\t]*elif concentration_pct >= )[0-9.]+(:)",
          "replacement": "\\g<1>{elevated_min_concentration_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.21\\.[\\s\\S]*?^[ \\t]*elif concentration_pct >= [0-9.]+:[\\s\\S]*?^[ \\t]*elif concentration_pct >= )[0-9.]+(:)",
          "replacement": "\\g<1>{moderate_min_concentration_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.21\\.[\\s\\S]*?CRITICAL_IMPORT_DEPENDENCE : Russian crude accounts for >= )[0-9.]+(%)",
          "replacement": "\\g<1>{critical_min_concentration_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.21\\.[\\s\\S]*?ELEVATED_IMPORT_CONCENTRATION : Russian crude supplies )[0-9.]+(% to )",
          "replacement": "\\g<1>{elevated_min_concentration_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.21\\.[\\s\\S]*?MODERATE_EXPOSURE : Russian crude supplies )[0-9.]+(% to )",
          "replacement": "\\g<1>{moderate_min_concentration_pct:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.21\\.[\\s\\S]*?MINIMAL_EXPOSURE : Russian crude supplies < )[0-9.]+(%)",
          "replacement": "\\g<1>{moderate_min_concentration_pct:.1f}\\g<2>"
        }
      ]
    },
    "MODEL_25.22": {
      "description": "Toptas Opaque Corridor Index (TOCI)",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.22",
      "chokepoint_weights": {
        "CHOKE_TURKISH_STRAITS": 0.50,
        "CHOKE_SUEZ": 0.35,
        "CHOKE_MALACCA": 0.15
      },
      "thresholds": {
        "critical_min_toci": 45.0,
        "elevated_min_toci": 30.0,
        "moderate_min_toci": 15.0,
        "max_toci": 100.0
      },
      "output_interpretation_template": "TOCI measures {toci:.2f}/100 ({status}): Official CN+IN+TR customs Russian energy/crude share is {customs_russian_share_pct:.2f}% (${total_ru_usd_bn:.2f}B) alongside a {ais_contraction_pct:.2f}% weighted AIS transit contraction. Estimated opaque corridor USD exposure: ${opaque_corridor_exposure_usd_bn:.2f}B (Comtrade_Obs: {comtrade_obs}; PortWatch_Obs: {portwatch_obs}).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 25\\.22\\.[\\s\\S]*?^[ \\t]*if toci >= )[0-9.]+(:)",
          "replacement": "\\g<1>{critical_min_toci:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.22\\.[\\s\\S]*?^[ \\t]*elif toci >= )[0-9.]+(:)",
          "replacement": "\\g<1>{elevated_min_toci:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.22\\.[\\s\\S]*?^[ \\t]*elif toci >= [0-9.]+:[\\s\\S]*?^[ \\t]*elif toci >= )[0-9.]+(:)",
          "replacement": "\\g<1>{moderate_min_toci:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.22\\.[\\s\\S]*?CRITICAL_OPAQUE_BYPASS : TOCI >= )[0-9.]+",
          "replacement": "\\g<1>{critical_min_toci:.1f}"
        },
        {
          "pattern": "(?m)(### 25\\.22\\.[\\s\\S]*?ELEVATED_SHADOW_CORRIDOR : TOCI )[0-9.]+( to )",
          "replacement": "\\g<1>{elevated_min_toci:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.22\\.[\\s\\S]*?MODERATE_REROUTING : TOCI )[0-9.]+( to )",
          "replacement": "\\g<1>{moderate_min_toci:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.22\\.[\\s\\S]*?NORMAL_TRANSPARENT_FLOW : TOCI < )[0-9.]+",
          "replacement": "\\g<1>{moderate_min_toci:.1f}"
        }
      ]
    },
    "MODEL_25.23": {
      "description": "Toptas Geo-Yield Trap & Flight Index (TGYTI)",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.23",
      "component_weights": {
        "corridor_energy": 0.35,
        "yield_stress": 0.35,
        "safe_haven_flight": 0.30
      },
      "thresholds": {
        "brent_yoy_cap_pct": 80.0,
        "neutral_yield_pct": 2.0,
        "stress_yield_cap_pct": 6.0,
        "gold_yoy_cap_pct": 50.0,
        "vix_calm_floor": 12.0,
        "vix_panic_cap": 45.0,
        "systemic_min_tgyti": 85.0,
        "stagflation_min_tgyti": 60.0,
        "elevated_min_tgyti": 35.0,
        "max_tgyti": 100.0
      },
      "output_interpretation_template": "TGYTI measures {tgyti:.2f}/100 ({status}): Corridor & Brent pressure={corridor_energy_score:.2f}/100, Sovereign Yield Stress={yield_stress_score:.2f}/100 (10Y={us_10y:.2f}%), Safe-Haven Flight={flight_score:.2f}/100 (WB Gold YoY={gold_yoy:+.2f}%, VIX={vix:.2f}).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 25\\.23\\.[\\s\\S]*?^[ \\t]*if tgyti >= )[0-9.]+(:)",
          "replacement": "\\g<1>{systemic_min_tgyti:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.23\\.[\\s\\S]*?^[ \\t]*elif tgyti >= )[0-9.]+(:)",
          "replacement": "\\g<1>{stagflation_min_tgyti:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.23\\.[\\s\\S]*?^[ \\t]*elif tgyti >= [0-9.]+:[\\s\\S]*?^[ \\t]*elif tgyti >= )[0-9.]+(:)",
          "replacement": "\\g<1>{elevated_min_tgyti:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.23\\.[\\s\\S]*?SYSTEMIC_YIELD_TRAP_AND_FLIGHT : TGYTI >= )[0-9.]+",
          "replacement": "\\g<1>{systemic_min_tgyti:.1f}"
        },
        {
          "pattern": "(?m)(### 25\\.23\\.[\\s\\S]*?STRUCTURAL_STAGFLATION_RISK : TGYTI )[0-9.]+( to )",
          "replacement": "\\g<1>{stagflation_min_tgyti:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.23\\.[\\s\\S]*?ELEVATED_MACRO_FRICTION : TGYTI )[0-9.]+( to )",
          "replacement": "\\g<1>{elevated_min_tgyti:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.23\\.[\\s\\S]*?FIAT_SYSTEM_EQUILIBRIUM : TGYTI < )[0-9.]+",
          "replacement": "\\g<1>{elevated_min_tgyti:.1f}"
        }
      ]
    },
    "MODEL_25.24": {
      "description": "Semiconductor Friendshoring & Bridge Corridor Index (SFBCI)",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.24",
      "component_weights": {
        "fcr": 0.45,
        "cn_decoupling": 0.25,
        "bloc_friction": 0.30
      },
      "thresholds": {
        "cn_contraction_cap_pct": 25.0,
        "high_min_sfbci": 65.0,
        "moderate_min_sfbci": 40.0,
        "max_sfbci": 100.0
      },
      "output_interpretation_template": "SFBCI measures {sfbci:.2f}/100 ({status}): Pax Silica Core Share (FCR)={fcr_pct:.2f}%, US->CN Export MoM={cn_export_mom_pct:+.2f}% (Decoupling={cn_decoupling_score:.2f}/100), Pax-WAICO Polarity={bloc_polarity:+.2f} (Friction={bloc_friction_score:.2f}/100).",
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 25\\.24\\.[\\s\\S]*?^[ \\t]*if sfbci >= )[0-9.]+(:)",
          "replacement": "\\g<1>{high_min_sfbci:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.24\\.[\\s\\S]*?^[ \\t]*elif sfbci >= )[0-9.]+(:)",
          "replacement": "\\g<1>{moderate_min_sfbci:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.24\\.[\\s\\S]*?HIGH_BIFURCATION_STRAIN : SFBCI >= )[0-9.]+",
          "replacement": "\\g<1>{high_min_sfbci:.1f}"
        },
        {
          "pattern": "(?m)(### 25\\.24\\.[\\s\\S]*?MODERATE_FRIENDSHORING_SHIFT : SFBCI )[0-9.]+( to )",
          "replacement": "\\g<1>{moderate_min_sfbci:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.24\\.[\\s\\S]*?INTEGRATED_SUPPLY : SFBCI < )[0-9.]+",
          "replacement": "\\g<1>{moderate_min_sfbci:.1f}"
        }
      ]
    },
    "MODEL_28.4": {
      "description": "Chokepoint Macro Spillover Bridge (Hormuz - Live EIA SPR)",
      "shelf": "llms-formulas-geopolitics.txt",
      "formula_number": "28.4",
      "thresholds": {
        "severity_weights": {
          "CATASTROPHIC": 1.0,
          "HIGH": 0.7,
          "MODERATE-HIGH": 0.45,
          "MODERATE": 0.2
        },
        "spr_max_drawdown_mbpd": 4.4,
        "regional_bypass_capacity_mbpd": 4.0,
        "spr_drawdown_days": 90.0,
        "spr_decay_short_max_days": 60,
        "spr_decay_mid_max_days": 90,
        "spr_decay_short": 1.0,
        "spr_decay_mid": 0.5,
        "spr_decay_long": 0.25,
        "sigmoid_k": 0.15,
        "sigmoid_t0_days": 14.0,
        "duration_scale_base": 0.4,
        "duration_scale_span": 0.6,
        "physical_disruption_weight": 70.0,
        "polarity_friction_weight": 30.0,
        "critical_min_score": 85,
        "high_min_score": 60,
        "moderate_min_score": 30,
        "trigger_ais_shift_pct": -50.0,
        "trigger_consecutive_runs": 2,
        "reset_ais_shift_pct": -20.0,
        "reset_consecutive_runs": 5,
        "partial_recovery_decay_days": 2.0,
        "partial_recovery_consecutive_runs": 5,
        "refinery_normal_ceiling_pct": 88.0,
        "refinery_acute_floor_pct": 70.0,
        "base_friction_alpha": 0.20,
        "physical_shortage_alpha_weight": 0.80,
        "transponder_dark_refinery_min_pct": 85.0,
        "spr_phase_labels": {
          "short": "PHASE_1_FULL_100PCT",
          "mid": "PHASE_2_HALVED_50PCT",
          "long": "PHASE_3_EMERGENCY_25PCT"
        }
      },
      "output_interpretation_template": "Couples maritime chokepoint severity ({severity_enum}) with live EIA SPR inventory ({spr_drawdown} mbpd sustainable release), regional pipeline bypass, and dynamic PortWatch/MODI effective crisis duration ({duration_days}d; {spr_phase}, conditional runway to 60d/90d: {days_to_60d}/{days_to_90d}) to evaluate macroeconomic spillover under acute crisis.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?SPR_Sustainable_mbpd = min\\()[0-9.]+(, \\(spr_stocks_kbbl / 1000\\.0\\) / )[0-9.]+(\\))",
          "replacement": "\\g<1>{spr_max_drawdown_mbpd:.1f}\\g<2>{spr_drawdown_days:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?Effective_SPR = SPR_Sustainable_mbpd \\* \\()[0-9.]+( if t <= )[0-9]+( else \\()[0-9.]+( if t <= )[0-9]+( else )[0-9.]+(\\)\\))",
          "replacement": "\\g<1>{spr_decay_short:.1f}\\g<2>{spr_decay_short_max_days}\\g<3>{spr_decay_mid:.2f}\\g<4>{spr_decay_mid_max_days}\\g<5>{spr_decay_long:.2f}\\g<6>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?M_duration\\(t\\) = 1\\.0 / \\(1\\.0 \\+ exp\\(-)[0-9.]+( \\* \\(t - )[0-9.]+(\\)\\)\\))",
          "replacement": "\\g<1>{sigmoid_k:.2f}\\g<2>{sigmoid_t0_days:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?Duration_Scale = )[0-9.]+( \\+ )[0-9.]+( \\* M_duration\\(t\\))",
          "replacement": "\\g<1>{duration_scale_base:.2f}\\g<2>{duration_scale_span:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?Base_Shock = \\(Severity_Weight \\* Net_Deficit_Ratio \\* )[0-9.]+(\\) \\+ \\(Friction_Factor \\* )[0-9.]+(\\))",
          "replacement": "\\g<1>{physical_disruption_weight:.1f}\\g<2>{polarity_friction_weight:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?^[ \\t]*raw_spr = round\\(min\\()[0-9.]+(, max\\(0\\.0, spr_mbbl / )[0-9.]+(\\)\\), 2\\))",
          "replacement": "\\g<1>{spr_max_drawdown_mbpd:.1f}\\g<2>{spr_drawdown_days:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?^[ \\t]*if t <= )[0-9]+(:\\n[ \\t]*spr_decay = )[0-9.]+(\\n[ \\t]*elif t <= )[0-9]+(:\\n[ \\t]*spr_decay = )[0-9.]+(\\n[ \\t]*else:\\n[ \\t]*spr_decay = )[0-9.]+",
          "replacement": "\\g<1>{spr_decay_short_max_days}\\g<2>{spr_decay_short:.1f}\\g<3>{spr_decay_mid_max_days}\\g<4>{spr_decay_mid:.2f}\\g<5>{spr_decay_long:.2f}"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?^[ \\t]*sigmoid_val = 1\\.0 / \\(1\\.0 \\+ math\\.exp\\(-)[0-9.]+( \\* \\(t - )[0-9.]+(\\)\\)\\))",
          "replacement": "\\g<1>{sigmoid_k:.2f}\\g<2>{sigmoid_t0_days:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?^[ \\t]*duration_scale = round\\()[0-9.]+( \\+ )[0-9.]+( \\* sigmoid_val, 4\\))",
          "replacement": "\\g<1>{duration_scale_base:.2f}\\g<2>{duration_scale_span:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?^[ \\t]*base_shock = \\(w_sev \\* net_deficit_ratio \\* )[0-9.]+(\\) \\+ \\(friction \\* )[0-9.]+(\\))",
          "replacement": "\\g<1>{physical_disruption_weight:.1f}\\g<2>{polarity_friction_weight:.1f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?^[ \\t]*if score >= )[0-9]+(:\\n[ \\t]*transmission_regime = \"CRITICAL_SYSTEMIC_SHOCK\")",
          "replacement": "\\g<1>{critical_min_score}\\g<2>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?^[ \\t]*elif score >= )[0-9]+(:\\n[ \\t]*transmission_regime = \"HIGH_SPILLOVER\")",
          "replacement": "\\g<1>{high_min_score}\\g<2>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?^[ \\t]*elif score >= )[0-9]+(:\\n[ \\t]*transmission_regime = \"MODERATE_FRICTION\")",
          "replacement": "\\g<1>{moderate_min_score}\\g<2>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?- bridge_score >= )[0-9]+( : CRITICAL_SYSTEMIC_SHOCK)",
          "replacement": "\\g<1>{critical_min_score}\\g<2>"
        },
        {
          "pattern": "(?m)(### 28\\.4\\.[\\s\\S]*?- )[0-9]+( <= bridge_score < )[0-9]+( : HIGH_SPILLOVER)",
          "replacement": "\\g<1>{high_min_score}\\g<2>{critical_min_score}\\g<3>"
        }
      ]
    },
    "MODEL_26": {
      "description": "Central Bank Committee Dispersion & Hawkishness Index",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "26",
      "thresholds": {
        "strong_hawkish_min_h_index": 0.5,
        "moderate_hawkish_min_h_index": 0.15,
        "strong_dovish_max_h_index": -0.5,
        "moderate_dovish_max_h_index": -0.15,
        "strong_consensus_max_dispersion": 0.3,
        "moderate_dissent_max_dispersion": 0.48
      },
      "output_interpretation_template": "Quantifies FOMC monetary policy committee voting distribution across hawkish, dovish, and neutral members to compute directional policy stance and internal voting fracture.",
      "on_demand_placeholder": {
        "model_name": "Central Bank Committee Dispersion & Hawkishness Index",
        "formula_ref": "https://analysisreports.github.io/llms-formulas-rates-liquidity.txt#26",
        "unit": "H-Index",
        "status": "ON_DEMAND_INPUT_UNAVAILABLE",
        "execution_mode": "ON_DEMAND_ONLY",
        "agent_alert": "WARNING: Model not actively calculated in live loop. Requires manual voting counts (n_hawkish, n_dovish, n_neutral) via get_formula_router('26').",
        "inputs": {
          "n_hawkish": null,
          "n_dovish": null,
          "n_neutral": null,
          "n_total": null
        },
        "metrics": {
          "h_index": null,
          "dispersion": null,
          "consensus_regime": null
        },
        "interpretation": "Evaluates central bank monetary policy committee (FOMC, ECB, BOE, TCMB) voting distribution and internal consensus dispersion. Requires manual vote count inputs for live execution. Agents: Call get_formula_router('26') to execute scenario."
      },
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?^[ \\t]*if h_index >= )[0-9.]+(:\\n[ \\t]*directional_stance = \"STRONG_HAWKISH_TILT\")",
          "replacement": "\\g<1>{strong_hawkish_min_h_index:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?^[ \\t]*elif h_index >= )[0-9.]+(:\\n[ \\t]*directional_stance = \"MODERATE_HAWKISH_BIAS\")",
          "replacement": "\\g<1>{moderate_hawkish_min_h_index:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?^[ \\t]*elif h_index <= )-?[0-9.]+(:\\n[ \\t]*directional_stance = \"STRONG_DOVISH_TILT\")",
          "replacement": "\\g<1>{strong_dovish_max_h_index:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?^[ \\t]*elif h_index <= )-?[0-9.]+(:\\n[ \\t]*directional_stance = \"MODERATE_DOVISH_BIAS\")",
          "replacement": "\\g<1>{moderate_dovish_max_h_index:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?^[ \\t]*if dispersion <= )[0-9.]+(:\\n[ \\t]*consensus_regime = \"STRONG_CONSENSUS\")",
          "replacement": "\\g<1>{strong_consensus_max_dispersion:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?^[ \\t]*elif dispersion <= )[0-9.]+(:\\n[ \\t]*consensus_regime = \"MODERATE_DISSENT\")",
          "replacement": "\\g<1>{moderate_dissent_max_dispersion:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?\\* H_Index >= )[0-9.]+( : STRONG_HAWKISH_TILT)",
          "replacement": "\\g<1>{strong_hawkish_min_h_index:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?\\* )[0-9.]+( <= H_Index < )[0-9.]+( : MODERATE_HAWKISH_BIAS)",
          "replacement": "\\g<1>{moderate_hawkish_min_h_index:.2f}\\g<2>{strong_hawkish_min_h_index:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?\\* )-?[0-9.]+( < H_Index < )[0-9.]+( : BALANCED_NEUTRAL_STANCE)",
          "replacement": "\\g<1>{moderate_dovish_max_h_index:.2f}\\g<2>{moderate_hawkish_min_h_index:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?\\* )-?[0-9.]+( < H_Index <= )-?[0-9.]+( : MODERATE_DOVISH_BIAS)",
          "replacement": "\\g<1>{strong_dovish_max_h_index:.2f}\\g<2>{moderate_dovish_max_h_index:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?\\* H_Index <= )-?[0-9.]+( : STRONG_DOVISH_TILT)",
          "replacement": "\\g<1>{strong_dovish_max_h_index:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?\\* Dispersion <= )[0-9.]+( : STRONG_CONSENSUS)",
          "replacement": "\\g<1>{strong_consensus_max_dispersion:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?\\* )[0-9.]+( < Dispersion <= )[0-9.]+( : MODERATE_DISSENT)",
          "replacement": "\\g<1>{strong_consensus_max_dispersion:.2f}\\g<2>{moderate_dissent_max_dispersion:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 26\\.[\\s\\S]*?\\* Dispersion > )[0-9.]+( : HIGH_DISPERSION)",
          "replacement": "\\g<1>{moderate_dissent_max_dispersion:.2f}\\g<2>"
        }
      ]
    },
    "MODEL_25.19": {
      "description": "Multi-Layer Macroeconomic Transmission Engine",
      "shelf": "llms-formulas-geopolitics.txt",
      "formula_number": "25.19",
      "output_target": "llms-relationships.json",
      "thresholds": {
        "chip_weight_gscpi": 0.4,
        "chip_weight_sox": 0.35,
        "chip_sox_divisor": 50.0,
        "chip_weight_vix": 0.25,
        "chip_vix_divisor": 20.0,
        "secondary_damping_weight": 0.2,
        "transmission_scale": 0.2,
        "delta_clamp_min": -0.2,
        "delta_clamp_max": 0.2,
        "baltic_floor_min": -0.09
      },
      "output_interpretation_template": "Each trigger is a bounded proxy for a documented macroeconomic pressure channel, not direct evidence of a geopolitical event. A missing input invalidates the dependent relationship transmission; it must remain null with an explicit status instead of being treated as zero or replaced by a fallback.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 25\\.19\\.[\\s\\S]*?chip_index = )[0-9.]+( \\* GSCPI - )[0-9.]+( \\* \\(sox_yoy / )[0-9]+(\\) \\+ )[0-9.]+( \\* \\(VIX / )[0-9]+(\\))",
          "replacement": "\\g<1>{chip_weight_gscpi:.2f}\\g<2>{chip_weight_sox:.2f}\\g<3>{chip_sox_divisor:.0f}\\g<4>{chip_weight_vix:.2f}\\g<5>{chip_vix_divisor:.0f}\\g<6>"
        },
        {
          "pattern": "(?m)(### 25\\.19\\.[\\s\\S]*?raw_delta = dominant \\+ )[0-9.]+( \\* sum\\(other signed contributions\\))",
          "replacement": "\\g<1>{secondary_damping_weight:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.19\\.[\\s\\S]*?dynamic_delta = round\\(clamp\\()[0-9.]+( \\* raw_delta, )-?[0-9.]+(, )-?[0-9.]+(\\), 6\\))",
          "replacement": "\\g<1>{transmission_scale:.2f}\\g<2>{delta_clamp_min:.2f}\\g<3>{delta_clamp_max:.2f}\\g<4>"
        },
        {
          "pattern": "(?m)(### 25\\.19\\.[\\s\\S]*?dynamic_delta = max\\(dynamic_delta, )-?[0-9.]+(\\))",
          "replacement": "\\g<1>{baltic_floor_min:.2f}\\g<2>"
        }
      ]
    },
    "MODEL_25.1": {
      "description": "Dynamic Polarity & Regime Engine",
      "shelf": "llms-formulas-geopolitics.txt",
      "formula_number": "25.1",
      "output_target": "llms-relationships.json",
      "valid_conflict_severities": [
        "CRITICAL",
        "HIGH",
        "MODERATE",
        "LOW"
      ],
      "thresholds": {
        "alliance_min_p_net": 0.85,
        "strategic_alignment_min_p_net": 0.5,
        "tactical_cooperation_min_p_net": 0.1,
        "neutral_min_p_net": -0.1,
        "strategic_friction_min_p_net": -0.5,
        "proxy_war_min_p_net": -0.95,
        "conflict_heat_critical_min": 80.0,
        "conflict_heat_high_min": 55.0,
        "conflict_heat_moderate_min": 30.0,
        "p_net_clamp_min": -1.0,
        "p_net_clamp_max": 1.0
      },
      "output_interpretation_template": "Classifies bilateral net polarity P_net into deterministic regime states using schema-driven conflict_severity rather than hardcoded country pairs.",
      "txt_code_replacements": [
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?^[ \\t]*if score >= )[0-9.]+(:\\n[ \\t]*return \"CRITICAL\")",
          "replacement": "\\g<1>{conflict_heat_critical_min:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?^[ \\t]*elif score >= )[0-9.]+(:\\n[ \\t]*return \"HIGH\")",
          "replacement": "\\g<1>{conflict_heat_high_min:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?^[ \\t]*elif score >= )[0-9.]+(:\\n[ \\t]*return \"MODERATE\")",
          "replacement": "\\g<1>{conflict_heat_moderate_min:.1f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?^[ \\t]*if p_net >= )[0-9.]+(:\\n[ \\t]*regime = \"ALLIANCE\")",
          "replacement": "\\g<1>{alliance_min_p_net:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?^[ \\t]*elif p_net >= )[0-9.]+(:\\n[ \\t]*regime = \"STRATEGIC_ALIGNMENT\")",
          "replacement": "\\g<1>{strategic_alignment_min_p_net:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?^[ \\t]*elif p_net >= )[0-9.]+(:\\n[ \\t]*regime = \"TACTICAL_COOPERATION\")",
          "replacement": "\\g<1>{tactical_cooperation_min_p_net:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?^[ \\t]*elif p_net >= )-?[0-9.]+(:\\n[ \\t]*regime = \"NEUTRAL\")",
          "replacement": "\\g<1>{neutral_min_p_net:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?^[ \\t]*elif p_net >= )-?[0-9.]+(:\\n[ \\t]*regime = \"STRATEGIC_FRICTION\")",
          "replacement": "\\g<1>{strategic_friction_min_p_net:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?^[ \\t]*elif p_net >= )-?[0-9.]+(:\\n[ \\t]*regime = \"PROXY_WAR\")",
          "replacement": "\\g<1>{proxy_war_min_p_net:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?- p_net >= )[0-9.]+( : ALLIANCE)",
          "replacement": "\\g<1>{alliance_min_p_net:.2f}\\g<2>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?- )[0-9.]+( <= p_net < )[0-9.]+( : STRATEGIC_ALIGNMENT)",
          "replacement": "\\g<1>{strategic_alignment_min_p_net:.2f}\\g<2>{alliance_min_p_net:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?- )[0-9.]+( <= p_net < )[0-9.]+( : TACTICAL_COOPERATION)",
          "replacement": "\\g<1>{tactical_cooperation_min_p_net:.2f}\\g<2>{strategic_alignment_min_p_net:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?- )-?[0-9.]+( <= p_net < )[0-9.]+( : NEUTRAL)",
          "replacement": "\\g<1>{neutral_min_p_net:.2f}\\g<2>{tactical_cooperation_min_p_net:.2f}\\g<3>"
        },
        {
          "pattern": "(?m)(### 25\\.1\\.[\\s\\S]*?- )-?[0-9.]+( <= p_net < )-?[0-9.]+( : STRATEGIC_FRICTION)",
          "replacement": "\\g<1>{strategic_friction_min_p_net:.2f}\\g<2>{neutral_min_p_net:.2f}\\g<3>"
        }
      ]
    },
    "MODEL_25.25": {
      "description": "PCE-CPI Fed Policy Path Model thresholds and output interpretation",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "25.25",
      "thresholds": {
        "inflation_rate_min_pct": -20.0,
        "inflation_rate_max_pct": 50.0,
        "yield_min_pct": -2.0,
        "yield_max_pct": 25.0,
        "breakeven_min_pct": -5.0,
        "breakeven_max_pct": 15.0,
        "fed_target_pct": 2.0,
        "hawkish_core_pce_min_pct": 2.5,
        "sticky_core_pce_min_pct": 2.2,
        "core_wedge_sticky_min_ppt": 0.25,
        "market_path_hawkish_min_bps": 25.0,
        "market_path_dovish_max_bps": -25.0,
        "anchor_break_t5yie_min_pct": 2.6
      },
      "output_interpretation_template": "Cross-checks Core PCE ({fed_target_pct:.1f}% Fed target) against Core CPI, 5Y breakeven expectations, and the 2Y Treasury minus EFFR policy path spread. Core PCE >= {hawkish_core_pce_min_pct:.1f}% with 2Y-EFFR >= +{market_path_hawkish_min_bps:.0f} bps signals HAWKISH_REPRICING; 5Y breakeven >= {anchor_break_t5yie_min_pct:.1f}% with accelerating Core PCE momentum signals ANCHOR_BREAK_RISK.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "T5YIE >= {anchor_break_t5yie_min_pct:.1f}% & PCEPILFE_SAAR > T5YIE : ANCHOR_BREAK_RISK (Inflation expectations de-anchoring / Hawkish shock risk)",
        "PCEPILFE_YoY >= {hawkish_core_pce_min_pct:.1f}% & 2Y_EFFR_bps >= {market_path_hawkish_min_bps:.0f} : HAWKISH_REPRICING (Rate cuts priced out / Hike or higher-for-longer repricing)",
        "PCEPILFE_YoY >= {sticky_core_pce_min_pct:.1f}% or Core_Wedge > {core_wedge_sticky_min_ppt:.2f} : STICKY_HOLD (Elevated core persistence / Fed hold regime)",
        "PCEPILFE_YoY < {sticky_core_pce_min_pct:.1f}% & 2Y_EFFR_bps <= {market_path_dovish_max_bps:.0f} : DISINFLATION_PIVOT (Disinflation aligned with market easing path)"
      ]
    },
    "MODEL_25.26": {
      "description": "2s10s30s Yield Butterfly & Inflation Shock Model thresholds and output interpretation",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "25.26",
      "thresholds": {
        "yield_min_pct": -2.0,
        "yield_max_pct": 25.0,
        "breakeven_min_pct": -5.0,
        "breakeven_max_pct": 15.0,
        "anchor_unhinged_t10yie_min_pct": 2.5,
        "anchor_unhinged_t5yie_min_pct": 2.5,
        "short_term_shock_slope_min_bps": 20.0,
        "belly_selloff_butterfly_min_bps": 20.0,
        "fiscal_long_end_butterfly_max_bps": -20.0,
        "fiscal_long_end_10s30s_min_bps": 35.0,
        "recession_inversion_2s10s_max_bps": 0.0
      },
      "output_interpretation_template": "Decomposes Treasury curve curvature via 2s10s30s Butterfly = (2*DGS10 - DGS2 - DGS30)*100 bps alongside 2s10s/10s30s slopes and 5Y-10Y breakeven inflation term slope (T5YIE - T10YIE)*100 bps. Both breakevens >= {anchor_unhinged_t10yie_min_pct:.1f}% signals INFLATION_ANCHOR_UNHINGED; 5Y-10Y breakeven >= +{short_term_shock_slope_min_bps:.0f} bps signals SHORT_TERM_INFLATION_SHOCK; Butterfly <= {fiscal_long_end_butterfly_max_bps:.0f} bps with 10s30s >= +{fiscal_long_end_10s30s_min_bps:.0f} bps signals LONG_END_FISCAL_STEEPENING; Butterfly >= +{belly_selloff_butterfly_min_bps:.0f} bps signals BELLY_POLICY_PRESSURE; 2s10s <= {recession_inversion_2s10s_max_bps:.0f} bps signals FRONT_END_INVERSION_STRESS.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "T10YIE >= {anchor_unhinged_t10yie_min_pct:.1f}% & T5YIE >= {anchor_unhinged_t5yie_min_pct:.1f}% : INFLATION_ANCHOR_UNHINGED (Both 5Y and 10Y inflation expectations de-anchored above target)",
        "Breakeven_Term_Slope_bps >= {short_term_shock_slope_min_bps:.0f} : SHORT_TERM_INFLATION_SHOCK (Near-term energy or supply inflation shock priced into 5Y breakevens)",
        "Butterfly_2s10s30s_bps <= {fiscal_long_end_butterfly_max_bps:.0f} & Slope_10s30s_bps >= {fiscal_long_end_10s30s_min_bps:.0f} : LONG_END_FISCAL_STEEPENING (30Y long-end steepening driven by fiscal supply and term premium)",
        "Butterfly_2s10s30s_bps >= {belly_selloff_butterfly_min_bps:.0f} : BELLY_POLICY_PRESSURE (10Y belly cheapening vs 2Y and 30Y wings under Fed policy path repricing)",
        "Slope_2s10s_bps <= {recession_inversion_2s10s_max_bps:.0f} : FRONT_END_INVERSION_STRESS (2s10s yield curve inverted / Restrictive front-end tightening stress)",
        "Otherwise : BALANCED_CURVE_REGIME (Anchored breakevens and balanced yield curve curvature)"
      ]
    },
    "MODEL_25.27": {
      "description": "Income-Consumption-Credit Wall Model thresholds and output interpretation",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "25.27",
      "thresholds": {
        "psavert_min_pct": 0.0,
        "psavert_max_pct": 50.0,
        "growth_min_pct": -50.0,
        "growth_max_pct": 100.0,
        "gap_stress_min_ppt": 0.5,
        "psavert_thin_max_pct": 4.5,
        "psavert_critical_max_pct": 3.5,
        "credit_surge_min_ppt": 1.0,
        "income_contraction_max_pct": 0.0,
        "consumption_contraction_max_pct": 0.0
      },
      "output_interpretation_template": "Measures household demand sustainability via Consumption-Income Gap = PCEC96_YoY - DSPIC96_YoY (ppt), Personal Saving Rate (PSAVERT %), and Credit-Income Leverage = TOTALSL_YoY - DSPIC96_YoY (ppt). Both PCEC96_YoY <= {consumption_contraction_max_pct:.1f}% and DSPIC96_YoY <= {income_contraction_max_pct:.1f}% signals CONSUMER_RECESSION_WALL; Gap >= +{gap_stress_min_ppt:.1f} ppt with PSAVERT <= {psavert_critical_max_pct:.1f}% and Credit Leverage >= +{credit_surge_min_ppt:.1f} ppt signals CREDIT_FUELED_WALL; Gap >= +{gap_stress_min_ppt:.1f} ppt with PSAVERT <= {psavert_thin_max_pct:.1f}% or Credit Leverage >= +{credit_surge_min_ppt:.1f} ppt signals SAVINGS_CREDIT_STRAIN; DSPIC96_YoY > PCEC96_YoY with PSAVERT > {psavert_thin_max_pct:.1f}% signals ORGANIC_INCOME_BUFFER.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "PCEC96_YoY <= {consumption_contraction_max_pct:.1f}% & DSPIC96_YoY <= {income_contraction_max_pct:.1f}% : CONSUMER_RECESSION_WALL (Both real income and real consumption contracting)",
        "Gap >= {gap_stress_min_ppt:.1f} & PSAVERT <= {psavert_critical_max_pct:.1f}% & Credit_Leverage >= {credit_surge_min_ppt:.1f} : CREDIT_FUELED_WALL (Consumption outpacing real income via depleted savings and credit leverage)",
        "Gap >= {gap_stress_min_ppt:.1f} & (PSAVERT <= {psavert_thin_max_pct:.1f}% or Credit_Leverage >= {credit_surge_min_ppt:.1f}) : SAVINGS_CREDIT_STRAIN (Consumption outpacing real income with thin saving buffer or elevated credit growth)",
        "DSPIC96_YoY > PCEC96_YoY & PSAVERT > {psavert_thin_max_pct:.1f}% : ORGANIC_INCOME_BUFFER (Real income growth exceeds consumption with healthy saving cushion)",
        "Otherwise : BALANCED_HOUSEHOLD_DEMAND (Real income, consumption, and consumer credit broadly aligned)"
      ]
    },
    "MODEL_25.28": {
      "description": "Inertial Core PCE Taylor Rule Policy Gap (Atlanta Fed / FOMC-style Core PCE + rho=0.85 smoothing, r*=1.0%, pi*=2.0%, alpha=0.5, beta=0.5).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "25.28",
      "thresholds": {
        "neutral_real_rate_pct": 1.0,
        "target_inflation_pct": 2.0,
        "inflation_weight": 0.5,
        "output_gap_weight": 0.5,
        "smoothing_rho": 0.85,
        "behind_curve_ppt": -0.5,
        "over_restrictive_ppt": 0.5,
        "rate_min_pct": 0.0,
        "rate_max_pct": 25.0,
        "inflation_min_pct": -20.0,
        "inflation_max_pct": 50.0,
        "output_gap_abs_max_pct": 50.0
      },
      "output_interpretation_template": "Inertial Core PCE Taylor gap: DFF - ({smoothing_rho:.2f}*FEDFUNDS_lag + (1-{smoothing_rho:.2f})*({neutral_real_rate_pct:g} + Core_PCE_YoY + {inflation_weight:g}*(Core_PCE_YoY - {target_inflation_pct:g}) + {output_gap_weight:g}*Output_Gap)). Behind curve (< {behind_curve_ppt:.2f} ppt), aligned ({behind_curve_ppt:.2f} to {over_restrictive_ppt:+.2f} ppt), over-restrictive (> {over_restrictive_ppt:+.2f} ppt).",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "Inertial_Taylor_Policy_Gap < {behind_curve_ppt:.2f} : BEHIND_THE_CURVE (Fed behind inertial Core PCE Taylor path / Excessively loose)",
        "{behind_curve_ppt:.2f} to {over_restrictive_ppt:+.2f} : OPTIMAL_ALIGNMENT (Balanced FOMC policy stance aligned with inertial Core PCE Taylor path)",
        "Inertial_Taylor_Policy_Gap > {over_restrictive_ppt:+.2f} : OVER_RESTRICTIVE (Excessively restrictive vs inertial Core PCE Taylor path / Recession risk stance)"
      ]
    },
    "MODEL_25.29": {
      "description": "Semiconductor Supply-Chain Cascade & Pass-Through Model (3-link NAICS 3344 butterfly chain: IZ3344 Import Price YoY -> PCU33443344 Producer Price YoY -> IPG3344S Industrial Production YoY).",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.29",
      "thresholds": {
        "import_price_weight": 0.5,
        "ppi_weight": 0.5,
        "price_shock_min_pct": 5.0,
        "ppi_pass_through_min_pct": 5.0,
        "output_contraction_max_pct": 0.0,
        "pass_through_min_denom_pct": 1.0,
        "yoy_min_pct": -100.0,
        "yoy_max_pct": 300.0
      },
      "output_interpretation_template": "3-link NAICS 3344 semiconductor supply-chain cascade: Cascade_Price_Pressure = {import_price_weight:g}*IZ3344_YoY + {ppi_weight:g}*PCU33443344_YoY, Import-to-PPI Spread = IZ3344_YoY - PCU33443344_YoY, Real Output vs Price Gap = IPG3344S_YoY - PCU33443344_YoY. Both prices >= {price_shock_min_pct:.1f}% with IPG3344S_YoY <= {output_contraction_max_pct:.1f}% signals SUPPLY_BOTTLENECK_CASCADE; both prices >= {price_shock_min_pct:.1f}% with IPG3344S_YoY > {output_contraction_max_pct:.1f}% signals DEMAND_PASS_THROUGH_BOOM; IZ3344_YoY >= {price_shock_min_pct:.1f}% with PCU33443344_YoY < {ppi_pass_through_min_pct:.1f}% signals PRODUCER_MARGIN_SQUEEZE; IZ3344_YoY < {price_shock_min_pct:.1f}% with PCU33443344_YoY >= {ppi_pass_through_min_pct:.1f}% and IPG3344S_YoY <= {output_contraction_max_pct:.1f}% signals DOMESTIC_PPI_BOTTLENECK; both prices < {price_shock_min_pct:.1f}% with IPG3344S_YoY <= {output_contraction_max_pct:.1f}% signals SEMICONDUCTOR_DEMAND_COOLING.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "IZ3344_YoY >= {price_shock_min_pct:.1f}% & PCU33443344_YoY >= {ppi_pass_through_min_pct:.1f}% & IPG3344S_YoY <= {output_contraction_max_pct:.1f}% : SUPPLY_BOTTLENECK_CASCADE (Import & producer prices surging while physical semiconductor output contracts / Stagflationary chip bottleneck)",
        "IZ3344_YoY >= {price_shock_min_pct:.1f}% & PCU33443344_YoY >= {ppi_pass_through_min_pct:.1f}% & IPG3344S_YoY > {output_contraction_max_pct:.1f}% : DEMAND_PASS_THROUGH_BOOM (Import & producer prices surging alongside expanding physical output / AI-capex pass-through boom)",
        "IZ3344_YoY >= {price_shock_min_pct:.1f}% & PCU33443344_YoY < {ppi_pass_through_min_pct:.1f}% : PRODUCER_MARGIN_SQUEEZE (Import input costs spiking faster than producer pass-through / Margin compression & delayed PPI risk)",
        "IZ3344_YoY < {price_shock_min_pct:.1f}% & PCU33443344_YoY >= {ppi_pass_through_min_pct:.1f}% & IPG3344S_YoY <= {output_contraction_max_pct:.1f}% : DOMESTIC_PPI_BOTTLENECK (Domestic producer prices surging while physical output contracts despite contained import prices)",
        "IZ3344_YoY < {price_shock_min_pct:.1f}% & PCU33443344_YoY < {ppi_pass_through_min_pct:.1f}% & IPG3344S_YoY <= {output_contraction_max_pct:.1f}% : SEMICONDUCTOR_DEMAND_COOLING (Subdued prices with contracting physical output / Chip destocking cycle)",
        "Otherwise : BALANCED_SUPPLY_CHAIN (Contained upstream/producer price pressure with positive physical output)"
      ]
    },
    "MODEL_25.30": {
      "description": "Agri-Food Supply Cascade & Pass-Through Model (PWHEAMTUSDM Wheat YoY & PMAIZMTUSDM Corn YoY -> PFOODINDEXM Global Food Index YoY).",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.30",
      "thresholds": {
        "wheat_weight": 0.6,
        "corn_weight": 0.4,
        "grain_shock_min_pct": 30.0,
        "food_pass_through_min_pct": 8.0,
        "grain_moderate_min_pct": 15.0,
        "disinflation_max_pct": 0.0,
        "pass_through_min_denom_pct": 1.0,
        "yoy_min_pct": -100.0,
        "yoy_max_pct": 300.0
      },
      "output_interpretation_template": "Agri-food supply cascade: Grain_Basket_YoY = {wheat_weight:g}*PWHEAMTUSDM_YoY + {corn_weight:g}*PMAIZMTUSDM_YoY, Grain-to-Food Spread = Grain_Basket_YoY - PFOODINDEXM_YoY, Pass-Through = PFOODINDEXM_YoY / Grain_Basket_YoY. Grain_Basket_YoY >= {grain_shock_min_pct:.1f}% with PFOODINDEXM_YoY >= {food_pass_through_min_pct:.1f}% signals GLOBAL_FOOD_SUPPLY_CASCADE; Grain_Basket_YoY >= {grain_shock_min_pct:.1f}% with PFOODINDEXM_YoY < {food_pass_through_min_pct:.1f}% signals UPSTREAM_GRAIN_SHOCK_PENDING; Grain_Basket_YoY >= {grain_moderate_min_pct:.1f}% or PFOODINDEXM_YoY >= {food_pass_through_min_pct:.1f}% signals ELEVATED_AGRI_COST_PRESSURE; both <= {disinflation_max_pct:.1f}% signals AGRI_FOOD_DISINFLATION.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "Grain_Basket_YoY >= {grain_shock_min_pct:.1f}% & PFOODINDEXM_YoY >= {food_pass_through_min_pct:.1f}% : GLOBAL_FOOD_SUPPLY_CASCADE (Upstream grain surge transmitting into broad global food inflation / Import & CPI shock)",
        "Grain_Basket_YoY >= {grain_shock_min_pct:.1f}% & PFOODINDEXM_YoY < {food_pass_through_min_pct:.1f}% : UPSTREAM_GRAIN_SHOCK_PENDING (Severe grain price surge not yet fully reflected in broad food index / Delayed retail food pass-through)",
        "Grain_Basket_YoY >= {grain_moderate_min_pct:.1f}% or PFOODINDEXM_YoY >= {food_pass_through_min_pct:.1f}% : ELEVATED_AGRI_COST_PRESSURE (Elevated agricultural input or food basket inflation above trend)",
        "Grain_Basket_YoY <= {disinflation_max_pct:.1f}% & PFOODINDEXM_YoY <= {disinflation_max_pct:.1f}% : AGRI_FOOD_DISINFLATION (Broad grain and food basket deflationary easing)",
        "Otherwise : BALANCED_FOOD_SUPPLY (Contained grain and global food index price dynamics)"
      ]
    },
    "MODEL_25.31": {
      "description": "European Gas Storage-Price Shield Index (EU-6 Eurostat natural gas closing stocks DE/FR/IT/ES/NL/PL YoY & PNGASEUUSDM European gas price YoY).",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.31",
      "thresholds": {
        "stock_weight": 0.6,
        "price_weight": 0.4,
        "stock_deficit_ceiling_pct": 25.0,
        "price_yoy_ceiling_pct": 100.0,
        "critical_min": 75.0,
        "high_min": 50.0,
        "moderate_min": 25.0,
        "stock_max_mcm": 200000.0,
        "price_yoy_min_pct": -100.0,
        "price_yoy_max_pct": 500.0
      },
      "output_interpretation_template": "European gas storage-price shield co-movement proxy: EU_Gas_Shield_Stress = {stock_weight:g}*Stock_Stress + {price_weight:g}*Price_Stress (0-100 scale), where Stock_Stress scales EU-6 aggregate closing-stock YoY deficit (DE, FR, IT, ES, NL, PL; worst-country YoY tracked in metrics) up to -{stock_deficit_ceiling_pct:.1f}% = 100 and Price_Stress scales PNGASEUUSDM YoY up to +{price_yoy_ceiling_pct:.1f}% = 100. Score >= {critical_min:.1f} signals CRITICAL_ENERGY_SQUEEZE; {high_min:.1f} to <{critical_min:.1f} signals HIGH_VULNERABILITY; {moderate_min:.1f} to <{high_min:.1f} signals MODERATE_PRESSURE; <{moderate_min:.1f} signals SHIELD_INTACT.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "Score >= {critical_min:.1f} : CRITICAL_ENERGY_SQUEEZE (Severe concurrent EU-6 physical gas storage drawdown and European gas price surge)",
        "{high_min:.1f} <= Score < {critical_min:.1f} : HIGH_VULNERABILITY (Dual-track storage erosion and elevated European gas price pressure)",
        "{moderate_min:.1f} <= Score < {high_min:.1f} : MODERATE_PRESSURE (Single-leg stress: price spike with intact storage shield or early storage drawdown)",
        "Score < {moderate_min:.1f} : SHIELD_INTACT (Adequate EU-6 storage buffer and contained European gas price dynamics)"
      ]
    },
    "MODEL_25.32": {
      "description": "Israel Imported Energy Pass-Through & Reserve Shield (BOI_CPI_ENERGY_EX_DOM_YOY vs. BOI_CPI_EX_ENERGY_YOY wedge paired with DCOILBRENTEU YoY external crude shock and BOI_FX_RESERVES_GDP_PCT reserve buffer).",
      "shelf": "llms-formulas-commodities-shock.txt",
      "formula_number": "25.32",
      "thresholds": {
        "wedge_shock_min_pp": 5.0,
        "wedge_moderate_min_pp": 2.0,
        "wedge_disinflation_max_pp": -2.0,
        "brent_shock_min_yoy_pct": 15.0,
        "reserve_shield_floor_pct": 25.0,
        "reserve_yoy_erosion_max_pp": -5.0,
        "pass_through_min_denom_pct": 10.0,
        "cpi_yoy_min_pct": -50.0,
        "cpi_yoy_max_pct": 100.0,
        "brent_yoy_min_pct": -95.0,
        "brent_yoy_max_pct": 500.0,
        "reserves_gdp_min_pct": 0.0,
        "reserves_gdp_max_pct": 200.0,
        "reserves_yoy_chg_min_pp": -100.0,
        "reserves_yoy_chg_max_pp": 100.0
      },
      "output_interpretation_template": "Israel imported energy pass-through & reserve shield proxy: Energy_Wedge_pp = BOI_CPI_ENERGY_EX_DOM_YOY - BOI_CPI_EX_ENERGY_YOY (isolating imported fuel inflation from domestic gas/electricity and core CPI), Pass_Through_Ratio = Energy_Wedge_pp / DCOILBRENTEU_YoY (computed when |DCOILBRENTEU_YoY| >= {pass_through_min_denom_pct:.1f}%), paired with Bank of Israel FX reserves (% of GDP and YoY pp change). Wedge >= +{wedge_shock_min_pp:.1f} pp with Brent YoY >= +{brent_shock_min_yoy_pct:.1f}% and (FX reserves < {reserve_shield_floor_pct:.1f}% of GDP or YoY change <= {reserve_yoy_erosion_max_pp:.1f} pp) signals ENERGY_PASS_THROUGH_SHIELD_STRAINED; same wedge and Brent shock with intact reserves signals EXTERNAL_ENERGY_PASS_THROUGH_SHIELD_INTACT; Wedge >= +{wedge_moderate_min_pp:.1f} pp signals DOMESTIC_OR_MODERATE_ENERGY_PRESSURE; Wedge <= {wedge_disinflation_max_pp:.1f} pp signals IMPORTED_ENERGY_DISINFLATION; otherwise CONTAINED_ENERGY_PASS_THROUGH.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "Energy_Wedge_pp >= +{wedge_shock_min_pp:.1f} pp & Brent_YoY >= +{brent_shock_min_yoy_pct:.1f}% & (FX_Reserves_GDP < {reserve_shield_floor_pct:.1f}% or FX_Reserves_YoY_Chg <= {reserve_yoy_erosion_max_pp:.1f} pp) : ENERGY_PASS_THROUGH_SHIELD_STRAINED (External crude shock co-moving with elevated imported-energy CPI wedge alongside FX reserve shield erosion)",
        "Energy_Wedge_pp >= +{wedge_shock_min_pp:.1f} pp & Brent_YoY >= +{brent_shock_min_yoy_pct:.1f}% & intact FX reserves : EXTERNAL_ENERGY_PASS_THROUGH_SHIELD_INTACT (External crude shock passing into imported-energy CPI while Bank of Israel FX reserve shield remains stable)",
        "Energy_Wedge_pp >= +{wedge_moderate_min_pp:.1f} pp : DOMESTIC_OR_MODERATE_ENERGY_PRESSURE (Moderate imported-energy CPI divergence or domestic fuel-price pressure without concurrent severe Brent shock)",
        "Energy_Wedge_pp <= {wedge_disinflation_max_pp:.1f} pp : IMPORTED_ENERGY_DISINFLATION (Imported energy prices acting as a disinflationary drag relative to core ex-energy CPI)",
        "Otherwise : CONTAINED_ENERGY_PASS_THROUGH (Imported energy CPI closely tracking core ex-energy CPI)"
      ]
    },
    "MODEL_25.33": {
      "description": "Israel-US Sovereign Yield & Policy Spread (BOI_YIELD_10Y_NOM vs. DGS10 nominal 10Y spread, BOI_YIELD_10Y_REAL vs. DFII10 real 10Y spread, BOI_POLICY_RATE vs. DFF policy spread, and Fisher implied breakeven spread).",
      "shelf": "llms-formulas-rates-liquidity.txt",
      "formula_number": "25.33",
      "thresholds": {
        "stress_spread_min_bps": 100.0,
        "moderate_premium_min_bps": 25.0,
        "discount_max_bps": -50.0,
        "policy_divergence_max_bps": -50.0,
        "nominal_yield_min_pct": -5.0,
        "nominal_yield_max_pct": 30.0,
        "real_yield_min_pct": -15.0,
        "real_yield_max_pct": 25.0,
        "policy_rate_min_pct": -2.0,
        "policy_rate_max_pct": 30.0
      },
      "output_interpretation_template": "Israel-US sovereign yield & policy spread: Nominal_10Y_Spread_bps = (BOI_YIELD_10Y_NOM - DGS10) * 100, Real_10Y_Spread_bps = (BOI_YIELD_10Y_REAL - DFII10) * 100, Policy_Spread_bps = (BOI_POLICY_RATE - DFF) * 100, and Implied_Breakeven_Spread_bps = Nominal_10Y_Spread_bps - Real_10Y_Spread_bps. Nominal_10Y_Spread_bps >= +{stress_spread_min_bps:.0f} bps or Real_10Y_Spread_bps >= +{stress_spread_min_bps:.0f} bps signals SOVEREIGN_RISK_PREMIUM_STRESS; Nominal_10Y_Spread_bps >= +{moderate_premium_min_bps:.0f} bps signals MODERATE_IL_YIELD_PREMIUM; Nominal_10Y_Spread_bps <= {discount_max_bps:.0f} bps and Policy_Spread_bps <= {policy_divergence_max_bps:.0f} bps signals NEGATIVE_SPREAD_POLICY_DIVERGENCE; Nominal_10Y_Spread_bps <= {discount_max_bps:.0f} bps alone signals IL_YIELD_DISCOUNT_BELOW_US; otherwise PARITY_CONVERGENCE.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "Nominal_10Y_Spread_bps >= +{stress_spread_min_bps:.0f} bps or Real_10Y_Spread_bps >= +{stress_spread_min_bps:.0f} bps : SOVEREIGN_RISK_PREMIUM_STRESS (Elevated Israeli sovereign nominal or real 10Y risk premium over US Treasuries)",
        "Nominal_10Y_Spread_bps >= +{moderate_premium_min_bps:.0f} bps : MODERATE_IL_YIELD_PREMIUM (Moderate Israeli 10Y yield premium above US Treasuries)",
        "Nominal_10Y_Spread_bps <= {discount_max_bps:.0f} bps & Policy_Spread_bps <= {policy_divergence_max_bps:.0f} bps : NEGATIVE_SPREAD_POLICY_DIVERGENCE (Israel 10Y yields trading at a discount below US Treasuries alongside a more accommodative Bank of Israel policy rate vs. Fed)",
        "Nominal_10Y_Spread_bps <= {discount_max_bps:.0f} bps : IL_YIELD_DISCOUNT_BELOW_US (Israel 10Y nominal yield trading at a discount below US Treasuries without equivalent policy-rate divergence)",
        "Otherwise : PARITY_CONVERGENCE (Israel-US 10Y sovereign yields trading near parity within the neutral corridor)"
      ]
    },
    "MODEL_25.34": {
      "description": "Israel External Trade & Hi-Tech Cushion (BOI_HITECH_SVC_EX_USD monthly hi-tech services exports coverage of BOI_TRADE_DEFICIT_USD merchandise trade deficit, paired with BOI_MINERAL_FUEL_IM_USD fuel-import share of deficit).",
      "shelf": "llms-formulas-macro-labor.txt",
      "formula_number": "25.34",
      "thresholds": {
        "breach_max_ratio": 1.0,
        "robust_min_ratio": 1.35,
        "fuel_pressure_min_pct": 25.0,
        "hitech_ex_min_usd": 0.0,
        "hitech_ex_max_usd": 50000.0,
        "trade_deficit_min_usd": 0.0,
        "trade_deficit_max_usd": 50000.0,
        "fuel_import_min_usd": 0.0,
        "fuel_import_max_usd": 50000.0
      },
      "output_interpretation_template": "Israel external trade & hi-tech cushion: HiTech_Coverage_Ratio = BOI_HITECH_SVC_EX_USD / BOI_TRADE_DEFICIT_USD, Net_HiTech_Trade_Balance_USD = BOI_HITECH_SVC_EX_USD - BOI_TRADE_DEFICIT_USD, Fuel_Share_of_Deficit_Pct = (BOI_MINERAL_FUEL_IM_USD / BOI_TRADE_DEFICIT_USD) * 100, and Non_Fuel_Trade_Deficit_USD = BOI_TRADE_DEFICIT_USD - BOI_MINERAL_FUEL_IM_USD (separating core non-fuel goods deficit from mineral fuel imports). Regime classification evaluates unrounded ratios: Coverage < {breach_max_ratio:.2f}x signals EXTERNAL_CUSHION_BREACHED; {breach_max_ratio:.2f}x to <{robust_min_ratio:.2f}x with Fuel_Share >= {fuel_pressure_min_pct:.1f}% signals FUEL_DRIVEN_CUSHION_STRAIN; {breach_max_ratio:.2f}x to <{robust_min_ratio:.2f}x otherwise signals THIN_HITECH_CUSHION; Coverage >= {robust_min_ratio:.2f}x with Fuel_Share >= {fuel_pressure_min_pct:.1f}% signals ROBUST_HITECH_CUSHION_FUEL_PRESSURE; otherwise ROBUST_HITECH_CUSHION.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "HiTech_Coverage_Ratio < {breach_max_ratio:.2f}x : EXTERNAL_CUSHION_BREACHED (Hi-Tech services exports no longer cover the merchandise trade deficit)",
        "{breach_max_ratio:.2f}x <= HiTech_Coverage_Ratio < {robust_min_ratio:.2f}x & Fuel_Share_of_Deficit_Pct >= {fuel_pressure_min_pct:.1f}% : FUEL_DRIVEN_CUSHION_STRAIN (Thinning hi-tech trade cushion with mineral fuel imports driving >= {fuel_pressure_min_pct:.1f}% of the goods deficit)",
        "{breach_max_ratio:.2f}x <= HiTech_Coverage_Ratio < {robust_min_ratio:.2f}x : THIN_HITECH_CUSHION (Narrow external buffer with hi-tech services exports only marginally exceeding goods deficit)",
        "HiTech_Coverage_Ratio >= {robust_min_ratio:.2f}x & Fuel_Share_of_Deficit_Pct >= {fuel_pressure_min_pct:.1f}% : ROBUST_HITECH_CUSHION_FUEL_PRESSURE (Strong hi-tech export buffer absorbing elevated mineral fuel import drag)",
        "Otherwise : ROBUST_HITECH_CUSHION (Hi-Tech services exports comfortably covering the merchandise trade deficit with contained fuel-import drag)"
      ]
    },
    "MODEL_28.7": {
      "description": "Maritime Reroute Strain & Food Cascade Model (PortWatch CHOKE_SUEZ contraction -> CHOKE_CAPE_OF_GOOD_HOPE diversion -> PFOODINDEXM / PWHEAMTUSDM food-inflation cascade).",
      "shelf": "llms-formulas-geopolitics.txt",
      "formula_number": "28.7",
      "thresholds": {
        "suez_weight": 0.5,
        "cape_weight": 0.5,
        "strain_high_min": 40.0,
        "strain_elevated_min": 20.0,
        "food_cascade_min_pct": 8.0,
        "wheat_cascade_min_pct": 25.0,
        "recovery_suez_min_pct": -10.0,
        "recovery_cape_max_pct": 15.0,
        "diversion_min_denom_pct": 1.0,
        "portwatch_pct_min": -100.0,
        "portwatch_pct_max": 500.0,
        "yoy_min_pct": -100.0,
        "yoy_max_pct": 300.0
      },
      "output_interpretation_template": "Maritime reroute strain & food cascade: Suez_Contraction = max(0, -CHOKE_SUEZ_pct), Cape_Surge = max(0, CHOKE_CAPE_OF_GOOD_HOPE_pct), Reroute_Strain_Index = {suez_weight:g}*Suez_Contraction + {cape_weight:g}*Cape_Surge, Diversion_Ratio = Cape_Surge / Suez_Contraction. Strain >= {strain_high_min:.1f} with PFOODINDEXM_YoY >= {food_cascade_min_pct:.1f}% or PWHEAMTUSDM_YoY >= {wheat_cascade_min_pct:.1f}% signals MARITIME_REROUTE_FOOD_CASCADE; Strain >= {strain_high_min:.1f} alone signals SEVERE_MARITIME_REROUTE_STRAIN; Strain >= {strain_elevated_min:.1f} signals ELEVATED_MARITIME_REROUTE; Suez_pct >= {recovery_suez_min_pct:.1f}% and Cape_pct <= {recovery_cape_max_pct:.1f}% signals NORMALIZED_MARITIME_FLOW.",
      "txt_code_replacements": [],
      "txt_interpretation_lines": [
        "Reroute_Strain >= {strain_high_min:.1f} & (PFOODINDEXM_YoY >= {food_cascade_min_pct:.1f}% or PWHEAMTUSDM_YoY >= {wheat_cascade_min_pct:.1f}%) : MARITIME_REROUTE_FOOD_CASCADE (Suez-to-Cape diversion strain coinciding with food/wheat inflation cascade)",
        "Reroute_Strain >= {strain_high_min:.1f} : SEVERE_MARITIME_REROUTE_STRAIN (Severe Suez contraction and Cape of Good Hope transit surge without concurrent food inflation threshold)",
        "Reroute_Strain >= {strain_elevated_min:.1f} : ELEVATED_MARITIME_REROUTE (Moderate maritime rerouting pressure along the Red Sea / Cape corridor)",
        "CHOKE_SUEZ_pct >= {recovery_suez_min_pct:.1f}% & CHOKE_CAPE_pct <= {recovery_cape_max_pct:.1f}% : NORMALIZED_MARITIME_FLOW (Suez and Cape of Good Hope transit flows near 2023 baseline)",
        "Otherwise : MODERATE_ROUTE_ADJUSTMENT (Transitional shipping route reallocation)"
      ]
    }
  }
}