{
  "schema": "project2050-energy-scenario-tests/1",
  "date": "2026-11-03",
  "scope": "Hypothetical clause arithmetic and supplied rule tests; actual evidence limits remain unknown. No finite catalogue proves all scenarios or field delivery.",
  "sovereign_route_and_basin_cases": [
    {
      "id": "public_route_without_lender_permission",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": true,
        "no_effective_order_barring_action": true,
        "current_control_dependencies_resolved": true,
        "usable_operating_and_access_rights": true,
        "actual_public_payment_route": true,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": true,
        "safe_physical_supply": true,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": true,
        "lender_consent": false
      },
      "result": {
        "result": "SUPPLIED_RULES_SATISFIED",
        "failed": [],
        "unresolved": [],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "private_underwriting_refused",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": true,
        "no_effective_order_barring_action": true,
        "current_control_dependencies_resolved": true,
        "usable_operating_and_access_rights": true,
        "actual_public_payment_route": true,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": true,
        "safe_physical_supply": true,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": true,
        "private_subscription": false
      },
      "result": {
        "result": "SUPPLIED_RULES_SATISFIED",
        "failed": [],
        "unresolved": [],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "new_act_not_enacted",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": false,
        "no_effective_order_barring_action": true,
        "current_control_dependencies_resolved": true,
        "usable_operating_and_access_rights": true,
        "actual_public_payment_route": true,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": true,
        "safe_physical_supply": true,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": true
      },
      "result": {
        "result": "BLOCKED",
        "failed": [
          "competent_domestic_authority"
        ],
        "unresolved": [],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "effective_court_order",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": true,
        "no_effective_order_barring_action": false,
        "current_control_dependencies_resolved": true,
        "usable_operating_and_access_rights": true,
        "actual_public_payment_route": true,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": true,
        "safe_physical_supply": true,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": true
      },
      "result": {
        "result": "BLOCKED",
        "failed": [
          "no_effective_order_barring_action"
        ],
        "unresolved": [],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "software_key_missing",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": true,
        "no_effective_order_barring_action": true,
        "current_control_dependencies_resolved": true,
        "usable_operating_and_access_rights": false,
        "actual_public_payment_route": true,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": true,
        "safe_physical_supply": true,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": true
      },
      "result": {
        "result": "BLOCKED",
        "failed": [
          "usable_operating_and_access_rights"
        ],
        "unresolved": [],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "unresolved_current_amendment",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": true,
        "no_effective_order_barring_action": true,
        "current_control_dependencies_resolved": null,
        "usable_operating_and_access_rights": true,
        "actual_public_payment_route": true,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": true,
        "safe_physical_supply": true,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": true
      },
      "result": {
        "result": "UNDEMONSTRATED",
        "failed": [],
        "unresolved": [
          "current_control_dependencies_resolved"
        ],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "cash_only_forecast",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": true,
        "no_effective_order_barring_action": true,
        "current_control_dependencies_resolved": true,
        "usable_operating_and_access_rights": true,
        "actual_public_payment_route": null,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": true,
        "safe_physical_supply": true,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": true
      },
      "result": {
        "result": "UNDEMONSTRATED",
        "failed": [],
        "unresolved": [
          "actual_public_payment_route"
        ],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "crew_claimed_twice",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": true,
        "no_effective_order_barring_action": true,
        "current_control_dependencies_resolved": true,
        "usable_operating_and_access_rights": true,
        "actual_public_payment_route": true,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": false,
        "safe_physical_supply": true,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": true
      },
      "result": {
        "result": "BLOCKED",
        "failed": [
          "qualified_willing_paid_shifts"
        ],
        "unresolved": [],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "billed_energy_only",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": true,
        "no_effective_order_barring_action": true,
        "current_control_dependencies_resolved": true,
        "usable_operating_and_access_rights": true,
        "actual_public_payment_route": true,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": true,
        "safe_physical_supply": null,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": true
      },
      "result": {
        "result": "UNDEMONSTRATED",
        "failed": [],
        "unresolved": [
          "safe_physical_supply"
        ],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "public_board_but_no_remedy",
      "type": "hypothetical_rule_test",
      "inputs": {
        "competent_domestic_authority": true,
        "no_effective_order_barring_action": true,
        "current_control_dependencies_resolved": true,
        "usable_operating_and_access_rights": true,
        "actual_public_payment_route": true,
        "lawful_claim_treatment": true,
        "qualified_willing_paid_shifts": true,
        "safe_physical_supply": true,
        "repair_spares_and_reserves": true,
        "binding_public_control_and_outside_remedy": false
      },
      "result": {
        "result": "BLOCKED",
        "failed": [
          "binding_public_control_and_outside_remedy"
        ],
        "unresolved": [],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "eland_new_common_transition_not_demonstrated",
      "type": "actual_packet_evidence_limit",
      "inputs": {},
      "result": {
        "result": "UNDEMONSTRATED",
        "failed": [],
        "unresolved": [
          "competent_domestic_authority",
          "no_effective_order_barring_action",
          "current_control_dependencies_resolved",
          "usable_operating_and_access_rights",
          "actual_public_payment_route",
          "lawful_claim_treatment",
          "qualified_willing_paid_shifts",
          "safe_physical_supply",
          "repair_spares_and_reserves",
          "binding_public_control_and_outside_remedy"
        ],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "pampa_new_common_transition_not_demonstrated",
      "type": "actual_packet_evidence_limit",
      "inputs": {},
      "result": {
        "result": "UNDEMONSTRATED",
        "failed": [],
        "unresolved": [
          "competent_domestic_authority",
          "no_effective_order_barring_action",
          "current_control_dependencies_resolved",
          "usable_operating_and_access_rights",
          "actual_public_payment_route",
          "lawful_claim_treatment",
          "qualified_willing_paid_shifts",
          "safe_physical_supply",
          "repair_spares_and_reserves",
          "binding_public_control_and_outside_remedy"
        ],
        "lender_consent_is_a_gate": false,
        "establishes_actual_delivery": false
      }
    },
    {
      "id": "promised_bridge_does_not_supply_water",
      "type": "hypothetical_rule_test",
      "inputs": {
        "usable_m3h": 100,
        "protected_and_committed_m3h": 80,
        "new_consumptive_m3h": 30,
        "replacement_m3h": 20,
        "replacement_usable": false
      },
      "result": {
        "result": "REDUCE_OR_SUSPEND",
        "remaining_m3h": "-10",
        "establishes_actual_authorization": false
      }
    },
    {
      "id": "verified_bridge_can_replace_supply",
      "type": "hypothetical_rule_test",
      "inputs": {
        "usable_m3h": 100,
        "protected_and_committed_m3h": 80,
        "new_consumptive_m3h": 30,
        "replacement_m3h": 20,
        "replacement_usable": true
      },
      "result": {
        "result": "WITHIN_SUPPLIED_ALLOCATION",
        "remaining_m3h": "10",
        "establishes_actual_authorization": false
      }
    },
    {
      "id": "drought_reduces_existing_permitted_use",
      "type": "hypothetical_rule_test",
      "inputs": {
        "usable_m3h": 70,
        "protected_and_committed_m3h": 60,
        "new_consumptive_m3h": 20
      },
      "result": {
        "result": "REDUCE_OR_SUSPEND",
        "remaining_m3h": "-10",
        "establishes_actual_authorization": false
      }
    },
    {
      "id": "unrelated_noncompeting_work_continues",
      "type": "hypothetical_rule_test",
      "inputs": {
        "usable_m3h": null,
        "protected_and_committed_m3h": null,
        "new_consumptive_m3h": 0,
        "verified_noncompeting": true
      },
      "result": {
        "result": "NO_COMPETING_WITHDRAWAL_BLOCK",
        "remaining_m3h": null,
        "establishes_actual_authorization": false
      }
    },
    {
      "id": "hif_process_intake_not_consumptive_basin_budget",
      "type": "actual_packet_evidence_limit",
      "inputs": {
        "usable_m3h": null,
        "protected_and_committed_m3h": null,
        "new_consumptive_m3h": null
      },
      "result": {
        "result": "UNDEMONSTRATED",
        "remaining_m3h": null,
        "establishes_actual_authorization": false
      }
    }
  ],
  "eland_historical_contract_cases": [
    {
      "id": "S01",
      "input": {
        "hours": 50,
        "mw": 200
      },
      "result": {
        "eligible_event": true,
        "free_hours_used": "50",
        "compensable_hours": "0",
        "deemed_mwh": "0",
        "payment_usd": "0.00",
        "effective_price_usd_mwh": "32.97",
        "basis": "historical2019clause counterfactual, not an observed curtailment invoice"
      },
      "assumption": "Invented uniform-output event tests only the dated2019clause arithmetic. Fullperiod50hourallowance assumed; stubproration notderived here. Actual irradiance, instructions, notice, previous use and amendments must be reconciled."
    },
    {
      "id": "S02",
      "input": {
        "hours": 60,
        "mw": 200
      },
      "result": {
        "eligible_event": true,
        "free_hours_used": "50",
        "compensable_hours": "10",
        "deemed_mwh": "2000",
        "payment_usd": "65940.00",
        "effective_price_usd_mwh": "32.97",
        "basis": "historical2019clause counterfactual, not an observed curtailment invoice"
      },
      "assumption": "Invented uniform-output event tests only the dated2019clause arithmetic. Fullperiod50hourallowance assumed; stubproration notderived here. Actual irradiance, instructions, notice, previous use and amendments must be reconciled."
    },
    {
      "id": "S03",
      "input": {
        "hours": 60,
        "mw": 200,
        "emergency": true
      },
      "result": {
        "eligible_event": false,
        "free_hours_used": "0",
        "compensable_hours": "0",
        "deemed_mwh": "0",
        "payment_usd": "0.00",
        "effective_price_usd_mwh": "32.97",
        "basis": "historical2019clause counterfactual, not an observed curtailment invoice"
      },
      "assumption": "Invented uniform-output event tests only the dated2019clause arithmetic. Fullperiod50hourallowance assumed; stubproration notderived here. Actual irradiance, instructions, notice, previous use and amendments must be reconciled."
    },
    {
      "id": "S04",
      "input": {
        "hours": 60,
        "mw": 200,
        "third_party_price": 20
      },
      "result": {
        "eligible_event": true,
        "free_hours_used": "50",
        "compensable_hours": "10",
        "deemed_mwh": "2000",
        "payment_usd": "25940.00",
        "effective_price_usd_mwh": "32.97",
        "basis": "historical2019clause counterfactual, not an observed curtailment invoice"
      },
      "assumption": "Invented uniform-output event tests only the dated2019clause arithmetic. Fullperiod50hourallowance assumed; stubproration notderived here. Actual irradiance, instructions, notice, previous use and amendments must be reconciled."
    },
    {
      "id": "S05",
      "input": {
        "hours": 60,
        "mw": 200,
        "third_party_price": 40
      },
      "result": {
        "eligible_event": true,
        "free_hours_used": "50",
        "compensable_hours": "10",
        "deemed_mwh": "2000",
        "payment_usd": "0.00",
        "effective_price_usd_mwh": "32.97",
        "basis": "historical2019clause counterfactual, not an observed curtailment invoice"
      },
      "assumption": "Invented uniform-output event tests only the dated2019clause arithmetic. Fullperiod50hourallowance assumed; stubproration notderived here. Actual irradiance, instructions, notice, previous use and amendments must be reconciled."
    },
    {
      "id": "S06",
      "input": {
        "hours": 60,
        "mw": 200,
        "excess": true
      },
      "result": {
        "eligible_event": true,
        "free_hours_used": "50",
        "compensable_hours": "10",
        "deemed_mwh": "2000",
        "payment_usd": "23079.00",
        "effective_price_usd_mwh": "11.5395",
        "basis": "historical2019clause counterfactual, not an observed curtailment invoice"
      },
      "assumption": "Invented uniform-output event tests only the dated2019clause arithmetic. Fullperiod50hourallowance assumed; stubproration notderived here. Actual irradiance, instructions, notice, previous use and amendments must be reconciled."
    },
    {
      "id": "S07",
      "input": {
        "hours": 60,
        "mw": 200,
        "after_circuit_cod": false
      },
      "result": {
        "eligible_event": false,
        "free_hours_used": "0",
        "compensable_hours": "0",
        "deemed_mwh": "0",
        "payment_usd": "0.00",
        "effective_price_usd_mwh": "32.97",
        "basis": "historical2019clause counterfactual, not an observed curtailment invoice"
      },
      "assumption": "Invented uniform-output event tests only the dated2019clause arithmetic. Fullperiod50hourallowance assumed; stubproration notderived here. Actual irradiance, instructions, notice, previous use and amendments must be reconciled."
    },
    {
      "id": "S08",
      "input": {
        "hours": 15,
        "mw": 200,
        "prior_free_hours": 40
      },
      "result": {
        "eligible_event": true,
        "free_hours_used": "10",
        "compensable_hours": "5",
        "deemed_mwh": "1000",
        "payment_usd": "32970.00",
        "effective_price_usd_mwh": "32.97",
        "basis": "historical2019clause counterfactual, not an observed curtailment invoice"
      },
      "assumption": "Invented uniform-output event tests only the dated2019clause arithmetic. Fullperiod50hourallowance assumed; stubproration notderived here. Actual irradiance, instructions, notice, previous use and amendments must be reconciled."
    },
    {
      "id": "S09",
      "input": {
        "delivered_mwh": 100,
        "imported_mwh": 10,
        "round_trip_losses_mwh": 2
      },
      "result": {
        "paid_delivered_mwh": "90",
        "paid_loss_mwh": "2",
        "payment_usd": "3033.24",
        "basis": "historical2019clause supplied units; no current invoice or profit inference"
      },
      "assumption": "Supplied settlement quantities, no current invoice or national saving inferred."
    },
    {
      "id": "S10",
      "input": {
        "delivered_mwh": 90,
        "imported_mwh": 10,
        "round_trip_losses_mwh": 2,
        "already_net_imports": true
      },
      "result": {
        "paid_delivered_mwh": "90",
        "paid_loss_mwh": "2",
        "payment_usd": "3033.24",
        "basis": "historical2019clause supplied units; no current invoice or profit inference"
      },
      "assumption": "Supplied settlement quantities, no current invoice or national saving inferred."
    },
    {
      "id": "S11",
      "input": {
        "delivered_mwh": 100,
        "imported_mwh": 0,
        "round_trip_losses_mwh": 0,
        "excess": true
      },
      "result": {
        "paid_delivered_mwh": "100",
        "paid_loss_mwh": "0",
        "payment_usd": "1153.95",
        "basis": "historical2019clause supplied units; no current invoice or profit inference"
      },
      "assumption": "Supplied settlement quantities, no current invoice or national saving inferred."
    },
    {
      "id": "S12",
      "input": {
        "enacted_authority": true,
        "usable_operating_rights": true,
        "paid_qualified_roster": true,
        "funded_payment_route": true,
        "verified_physical_supply": true,
        "independent_review": true,
        "lender_consent": false
      },
      "result": {
        "supplied_route_complete": true,
        "missing": [],
        "lender_consent_is_precondition": false,
        "basis": "proposed route evidence checklist; actual authority and field delivery require separate proof"
      },
      "assumption": "Hypothetical fully evidenced public route does not require private lender permission. None of these inputs is established for a Project2050 takeover of Eland."
    },
    {
      "id": "S13",
      "input": {
        "enacted_authority": true,
        "usable_operating_rights": true,
        "paid_qualified_roster": false,
        "funded_payment_route": true,
        "verified_physical_supply": true,
        "independent_review": true,
        "lender_consent": false
      },
      "result": {
        "supplied_route_complete": false,
        "missing": [
          "paid_qualified_roster"
        ],
        "lender_consent_is_precondition": false,
        "basis": "proposed route evidence checklist; actual authority and field delivery require separate proof"
      },
      "assumption": "A public financing statute alone supplies no qualified crew; missing component remains explicit."
    }
  ],
  "historical_pampa_predicate_adopted": false,
  "root_model_source": "\"\"\"Scoped rule checks for proposed public continuity and new competing water use.\n\nThese functions test supplied evidence, not current legal authority, engineering,\nan operating roster or national sufficiency. Monetary settlement and physical\ndelivery remain distinct. No old model is imported or modified.\n\"\"\"\nfrom decimal import Decimal\n\nCONTINUITY_EVIDENCE = (\n    'competent_domestic_authority', 'no_effective_order_barring_action',\n    'current_control_dependencies_resolved',\n    'usable_operating_and_access_rights', 'actual_public_payment_route',\n    'lawful_claim_treatment', 'qualified_willing_paid_shifts',\n    'safe_physical_supply', 'repair_spares_and_reserves',\n    'binding_public_control_and_outside_remedy',\n)\n\n\ndef continuity(evidence):\n    \"\"\"A lender's decision is deliberately not a vote on the sovereign route.\"\"\"\n    invalid = [key for key in CONTINUITY_EVIDENCE\n               if evidence.get(key) is not None and type(evidence[key]) is not bool]\n    if invalid:\n        raise ValueError('Evidence must be true, false or unresolved: '+','.join(invalid))\n    failed = [key for key in CONTINUITY_EVIDENCE if evidence.get(key) is False]\n    unknown = [key for key in CONTINUITY_EVIDENCE if evidence.get(key) is None]\n    return {\n        'result': 'BLOCKED' if failed else 'UNDEMONSTRATED' if unknown else 'SUPPLIED_RULES_SATISFIED',\n        'failed': failed, 'unresolved': unknown,\n        'lender_consent_is_a_gate': False,\n        'establishes_actual_delivery': False,\n    }\n\n\ndef quantity(value):\n    if value is None:\n        return None\n    result = Decimal(str(value))\n    if not result.is_finite() or result < 0:\n        raise ValueError('Expected a finite nonnegative quantity')\n    return result\n\n\ndef water_permission(*, usable_m3h, protected_and_committed_m3h,\n                     new_consumptive_m3h, replacement_m3h=0,\n                     replacement_usable=False, verified_noncompeting=False):\n    \"\"\"Consumptive flows only; raw intake or recycled water is not that measure.\n\nThe competent basin decision must independently establish quality, season,\nrights and the stated protected/committed amount. A supplied permitted example\nnever grants a permit. Unknown flows stay unknown, including for real HIF.\n    \"\"\"\n    if type(replacement_usable) is not bool or type(verified_noncompeting) is not bool:\n        raise ValueError('Usability and noncompetition need explicit evidence')\n    available = quantity(usable_m3h)\n    reserved = quantity(protected_and_committed_m3h)\n    new = quantity(new_consumptive_m3h)\n    replacement = quantity(replacement_m3h)\n    if verified_noncompeting:\n        return {'result': 'NO_COMPETING_WITHDRAWAL_BLOCK', 'remaining_m3h': None,\n                'establishes_actual_authorization': False}\n    # A replacement that is only funded/promised cannot augment available water.\n    effective = replacement if replacement_usable else Decimal(0)\n    if any(value is None for value in (available, reserved, new, effective)):\n        return {'result': 'UNDEMONSTRATED', 'remaining_m3h': None,\n                'establishes_actual_authorization': False}\n    remaining = available + effective - reserved - new\n    return {'result': 'REDUCE_OR_SUSPEND' if remaining < 0 else 'WITHIN_SUPPLIED_ALLOCATION',\n            'remaining_m3h': str(remaining),\n            'establishes_actual_authorization': False}\n\n\ndef cases():\n    ready = {key: True for key in CONTINUITY_EVIDENCE}\n    rows = []\n    def add(name, inputs, expected, kind='hypothetical_rule_test'):\n        actual = continuity(inputs)\n        assert actual['result'] == expected\n        rows.append({'id': name, 'type': kind, 'inputs': inputs, 'result': actual})\n    add('public_route_without_lender_permission', ready | {'lender_consent': False}, 'SUPPLIED_RULES_SATISFIED')\n    add('private_underwriting_refused', ready | {'private_subscription': False}, 'SUPPLIED_RULES_SATISFIED')\n    add('new_act_not_enacted', ready | {'competent_domestic_authority': False}, 'BLOCKED')\n    add('effective_court_order', ready | {'no_effective_order_barring_action': False}, 'BLOCKED')\n    add('software_key_missing', ready | {'usable_operating_and_access_rights': False}, 'BLOCKED')\n    add('unresolved_current_amendment', ready | {'current_control_dependencies_resolved': None}, 'UNDEMONSTRATED')\n    add('cash_only_forecast', ready | {'actual_public_payment_route': None}, 'UNDEMONSTRATED')\n    add('crew_claimed_twice', ready | {'qualified_willing_paid_shifts': False}, 'BLOCKED')\n    add('billed_energy_only', ready | {'safe_physical_supply': None}, 'UNDEMONSTRATED')\n    add('public_board_but_no_remedy', ready | {'binding_public_control_and_outside_remedy': False}, 'BLOCKED')\n    # Both operating references lack an evidenced complete common transition.\n    add('eland_new_common_transition_not_demonstrated', {}, 'UNDEMONSTRATED', 'actual_packet_evidence_limit')\n    add('pampa_new_common_transition_not_demonstrated', {}, 'UNDEMONSTRATED', 'actual_packet_evidence_limit')\n    waters = [\n        ('promised_bridge_does_not_supply_water', dict(usable_m3h=100, protected_and_committed_m3h=80, new_consumptive_m3h=30, replacement_m3h=20, replacement_usable=False), 'REDUCE_OR_SUSPEND'),\n        ('verified_bridge_can_replace_supply', dict(usable_m3h=100, protected_and_committed_m3h=80, new_consumptive_m3h=30, replacement_m3h=20, replacement_usable=True), 'WITHIN_SUPPLIED_ALLOCATION'),\n        ('drought_reduces_existing_permitted_use', dict(usable_m3h=70, protected_and_committed_m3h=60, new_consumptive_m3h=20), 'REDUCE_OR_SUSPEND'),\n        ('unrelated_noncompeting_work_continues', dict(usable_m3h=None, protected_and_committed_m3h=None, new_consumptive_m3h=0, verified_noncompeting=True), 'NO_COMPETING_WITHDRAWAL_BLOCK'),\n        ('hif_process_intake_not_consumptive_basin_budget', dict(usable_m3h=None, protected_and_committed_m3h=None, new_consumptive_m3h=None), 'UNDEMONSTRATED'),\n    ]\n    for name, inputs, expected in waters:\n        result = water_permission(**inputs)\n        assert result['result'] == expected\n        rows.append({'id': name, 'type': 'actual_packet_evidence_limit' if name.startswith('hif_') else 'hypothetical_rule_test', 'inputs': inputs, 'result': result})\n    return rows\n",
  "root_model_sha256": "3e7efc531b998cde626405981fc08090d278094a622e7d9d0fdbdd12efac9154",
  "eland_arithmetic_source": "\"\"\"Bounded Eland2019 clause arithmetic, not current invoice reconstruction.\nAll event quantities are explicitly supplied counterfactuals. This module does\nnot authenticate legal authority, infer profit, prescribe a dispatch or assert\na complete existing PPA amendment chain.\n\"\"\"\nfrom decimal import Decimal, ROUND_HALF_UP\nD=Decimal\n\ndef n(value):\n x=D(str(value))\n if not x.is_finite() or x<0:raise ValueError('Nonnegative finite quantity required')\n return x\n\ndef cents(x):return str(x.quantize(D('.01'),rounding=ROUND_HALF_UP))\n\ndef curtailment_payment(hours,mw,price='32.97',*,prior_free_hours=0,allowance_hours=50,emergency=False,after_circuit_cod=True,third_party_price=0,excess=False):\n \"\"\"2019 PPA7.5 single uniform-output event with known two-year allowance use.\n prior_free_hours is a supplied validated rolling-two-year count, not a reset\n every year. allowance_hours defaults to50 ONLY for a full contract-period\n comparison; the caller must supply the correct prorated allowance for\n initial/final stub periods. This does not derive that proration from dates.\n Does not replace actual irradiance, telemetry or notice evidence.\n \"\"\"\n h,power,rate,used,resale=map(n,[hours,mw,price,prior_free_hours,third_party_price])\n allowance=n(allowance_hours)\n if allowance>D(50):raise ValueError('2019allowance cannot exceed50hours')\n if used>allowance:raise ValueError('Used hours exceed supplied available allowance')\n if excess:rate*=D('.35')\n eligible=after_circuit_cod and not emergency\n free=min(h,allowance-used) if eligible else D(0)\n payable_h=h-free if eligible else D(0)\n energy=payable_h*power\n # Third-party sale proceeds offset buyer payment, never negative buyer debit.\n payment=energy*max(D(0),rate-resale)\n return {'eligible_event':eligible,'free_hours_used':str(free),'compensable_hours':str(payable_h),'deemed_mwh':str(energy),'payment_usd':cents(payment),'effective_price_usd_mwh':str(rate),'basis':'historical2019clause counterfactual, not an observed curtailment invoice'}\n\ndef priced_units(delivered_mwh,imported_mwh,round_trip_losses_mwh,price='32.97',*,already_net_imports=False,excess=False):\n \"\"\"AppendixA B1/B7 unit arithmetic below any separately priced annual tiers.\n The supplied delivered quantity excludes loss energy; gross battery discharge\n must not be added again to delivered energy at the settlement point.\n \"\"\"\n delivered,imports,losses,rate=map(n,[delivered_mwh,imported_mwh,round_trip_losses_mwh,price])\n if imports>delivered and not already_net_imports:raise ValueError('Negative delivered-energy settlement not modeled')\n net=delivered if already_net_imports else delivered-imports\n if excess:rate*=D('.35')\n return {'paid_delivered_mwh':str(net),'paid_loss_mwh':str(losses),'payment_usd':cents((net+losses)*rate),'basis':'historical2019clause supplied units; no current invoice or profit inference'}\n\ndef report_reconciliation():\n # FiscalYTD source amounts are rounded thousands. Keep source residual zero.\n fields={'direct_admin_usd':46000,'indirect_admin_usd':99000,'project_manager_usd':5000,'combined_working_capital_interest_usd':2590000,'ppa_test_energy_usd':20782000}\n total=sum(fields.values());mwh=D(360876)\n return {'period':'fiscalYTD endingJune30,2025','source_rounding':'USD thousands','components':fields,'reported_total_usd':23522000,'component_sum_usd':total,'rounding_residual_usd':total-23522000,'reported_mwh_delivered':str(mwh),'reported_ratio_usd_mwh':'65.18','recomputed_ratio_usd_mwh':cents(D(total)/mwh),'ppa_test_ratio_usd_mwh':cents(D(fields['ppa_test_energy_usd'])/mwh),'interpretation':'PPA/test ratio is not the base contract price; total includes combined working capital/interest and cannot be called private profit or all resource cost.','private_profit_usd':None,'all_in_public_replacement_cost_usd':None}\n\ndef public_continuity(*,enacted_authority,usable_operating_rights,paid_qualified_roster,funded_payment_route,verified_physical_supply,independent_review,lender_consent=False):\n \"\"\"Evidence gate for a proposed independent public route; no investorconsent gate.\n False is a missing demonstrated required component. A passing supplied gate\n is not independent real-world commissioning or a constitutional holding.\n \"\"\"\n supplied=locals().copy()\n required={k:v for k,v in supplied.items()if k!='lender_consent'}\n if any(v is not None and type(v)is not bool for v in required.values()):\n  raise ValueError('Required evidence must be explicit boolean or unresolvedNone')\n missing=[k for k,v in required.items()if v is not True]\n return {'supplied_route_complete':not missing,'missing':missing,'lender_consent_is_precondition':False,'basis':'proposed route evidence checklist; actual authority and field delivery require separate proof'}\n",
  "eland_arithmetic_source_sha256": "37d784675c583c551fc233e12e65237eb7a432eb87f7b6f2bf9cb65b59895173"
}
