{
  "capability_id": "electrical.electricity_bill",
  "tool_id": "electricity",
  "engine": "electricity-bill",
  "calculation_version": "1.3.1",
  "generated_at": "2026-09-16T08:32:56.985Z",
  "engine_build": "2026-09-12",
  "test_count": 21,
  "passed": 21,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 10,
      "passed": 10
    },
    "boundary": {
      "total": 6,
      "passed": 6
    },
    "property": {
      "total": 5,
      "passed": 5
    }
  },
  "engine_tested": true,
  "expert_reviewed": false,
  "internally_reviewed": true,
  "review_kind": "internal",
  "source_checked": true,
  "reviewed_by": "CalculatorX electrical review",
  "reviewer_role": "electrical-engineer",
  "last_reviewed": "2026-09-13",
  "expert_review": {
    "status": "not_applicable",
    "reviewer": null,
    "note": "Internal domain review completed; not a named external expert review.",
    "kind": "internal"
  },
  "internal_review": {
    "status": "approved",
    "reviewer": {
      "name": "CalculatorX electrical review",
      "role": "electrical-engineer"
    },
    "reviewed_at": "2026-09-13",
    "scope": [
      "formula",
      "input semantics",
      "assumptions",
      "limitations",
      "sources",
      "tests"
    ],
    "kind": "internal"
  },
  "page": "https://www.calculatorx.com/calc/electric/electricity",
  "api": "https://www.calculatorx.com/api/v1/calc/electricity",
  "schema_input": "https://www.calculatorx.com/schemas/electrical.electricity_bill.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/electrical.electricity_bill.output.json",
  "assumptions": [
    "Flat unit rate (no automatic slabs or TOU).",
    "Currency symbol is $ for display only; enter numeric values in your local currency. No FX conversion.",
    "Meter mode requires current ≥ previous on the same kWh register; otherwise METER_READING_DECREASED.",
    "Arithmetic is IEEE-754 binary64; only the displayed final amount is rounded to 2 decimal places."
  ],
  "limitations": [
    "Not for TOU / slab tariffs / export credits",
    "Current meter reading must be ≥ previous reading; otherwise METER_READING_DECREASED is returned",
    "Fee is a lump sum only; percentage and per-kWh taxes are not calculated"
  ],
  "boundary_conditions": [
    "mode not kwh|meter → INVALID_MODE",
    "missing rate → MISSING_REQUIRED_INPUT",
    "mode=meter and curr < prev → METER_READING_DECREASED",
    "negative rate/kWh/standing/days/fee → VALUE_MUST_BE_NON_NEGATIVE",
    "Zero kWh or zero rate still OK (standing + fee)",
    "Does not model TOU / slab tariffs / export credits",
    "Percentage / per-kWh taxes are not applied; fee is a lump sum only"
  ],
  "sources": [
    {
      "title": "NIST Guide to the SI (SP 811)",
      "section": "Kilowatt-hour and energy–cost arithmetic",
      "url": "https://www.nist.gov/pml/special-publication-811",
      "supports": "E(kWh) as commercial energy unit; cost = kWh × rate",
      "kind": "reference"
    },
    {
      "title": "Utility billing practice (informational)",
      "section": "Bill = usage + standing + fees",
      "supports": "Bill = kWh × rate + standing × days + fees",
      "kind": "reference"
    },
    {
      "title": "U.S. Energy Information Administration (EIA)",
      "section": "Residential electricity prices per kWh",
      "url": "https://www.eia.gov/electricity/",
      "supports": "Unit rate is user-supplied from local tariffs",
      "kind": "reference"
    }
  ],
  "methods": [],
  "fingerprint": "sha256:f9e59b545171e8e6f6d181dd1fc997dbe94a639f4cd58adfc0fefd842396c396",
  "tests": [
    {
      "id": "flat-63",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 350,
        "rate": 0.18,
        "standing": 0,
        "days": 30,
        "fee": 0
      },
      "expect": 63,
      "expectWarning": null,
      "actual": 63,
      "tol": 0.01
    },
    {
      "id": "with-standing",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 350,
        "rate": 0.18,
        "standing": 0.4,
        "days": 30,
        "fee": 0
      },
      "expect": 75,
      "expectWarning": null,
      "actual": 75,
      "tol": 0.01
    },
    {
      "id": "meter-delta",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "meter",
        "prev": 12450,
        "curr": 12800,
        "rate": 0.18,
        "standing": 0,
        "days": 30,
        "fee": 0
      },
      "expect": 63,
      "expectWarning": null,
      "actual": 63,
      "tol": 0.01
    },
    {
      "id": "appliance-equiv",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 120,
        "rate": 0.15,
        "standing": 0,
        "days": 0,
        "fee": 0
      },
      "expect": 18,
      "expectWarning": null,
      "actual": 18,
      "tol": 0.01
    },
    {
      "id": "with-fee",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 350,
        "rate": 0.18,
        "standing": 0.4,
        "days": 30,
        "fee": 5
      },
      "expect": 80,
      "expectWarning": null,
      "actual": 80,
      "tol": 0.01
    },
    {
      "id": "linear-2x-kwh",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 700,
        "rate": 0.18,
        "standing": 0,
        "days": 0,
        "fee": 0
      },
      "expect": 126,
      "expectWarning": null,
      "actual": 126,
      "tol": 0.01
    },
    {
      "id": "linear-2x-rate",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 350,
        "rate": 0.36,
        "standing": 0,
        "days": 0,
        "fee": 0
      },
      "expect": 126,
      "expectWarning": null,
      "actual": 126,
      "tol": 0.01
    },
    {
      "id": "soft-zero-kwh",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 0,
        "rate": 0.18,
        "standing": 0,
        "days": 0,
        "fee": 0
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 1e-12
    },
    {
      "id": "standing-only",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 350,
        "rate": 0,
        "standing": 0.4,
        "days": 30,
        "fee": 0
      },
      "expect": 12,
      "expectWarning": null,
      "actual": 12,
      "tol": 0.01
    },
    {
      "id": "standing-plus-fee",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 0,
        "rate": 0,
        "standing": 0.4,
        "days": 30,
        "fee": 5
      },
      "expect": 17,
      "expectWarning": null,
      "actual": 17,
      "tol": 0.01
    },
    {
      "id": "meter-decreased",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "meter",
        "prev": 12800,
        "curr": 12450,
        "rate": 0.18,
        "standing": 0,
        "days": 30,
        "fee": 0
      },
      "expectError": "METER_READING_DECREASED",
      "code": "METER_READING_DECREASED",
      "error": "current meter reading must be ≥ previous"
    },
    {
      "id": "missing-rate",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "kwh",
        "kWh": 10
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "rate is required"
    },
    {
      "id": "bad-mode",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "tou",
        "kWh": 10,
        "rate": 0.2
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be \"kwh\" or \"meter\""
    },
    {
      "id": "boundary-zero-kwh",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "kwh",
        "kWh": 0,
        "rate": 0.2,
        "standing": 0,
        "days": 0,
        "fee": 0
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 1e-12
    },
    {
      "id": "boundary-standing-only",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "kwh",
        "kWh": 100,
        "rate": 0,
        "standing": 0.5,
        "days": 30,
        "fee": 0
      },
      "expect": 15,
      "expectWarning": null,
      "actual": 15,
      "tol": 1e-9
    },
    {
      "id": "boundary-bad-mode",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "tou",
        "kWh": 100,
        "rate": 0.2
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be \"kwh\" or \"meter\""
    },
    {
      "id": "property-flat",
      "ok": true,
      "kind": "property",
      "detail": "kWh·rate",
      "expect": 20,
      "actual": 20
    },
    {
      "id": "property-standing",
      "ok": true,
      "kind": "property",
      "detail": "kWh·rate + standing·days",
      "expect": 35,
      "actual": 35
    },
    {
      "id": "property-meter",
      "ok": true,
      "kind": "property",
      "detail": "meter delta·rate",
      "expect": 20,
      "actual": 20
    },
    {
      "id": "property-linear-kwh",
      "ok": true,
      "kind": "property",
      "detail": "cost ∝ kWh",
      "expect": 40,
      "actual": 40
    },
    {
      "id": "property-fee",
      "ok": true,
      "kind": "property",
      "detail": "adds fee",
      "expect": 40,
      "actual": 40
    }
  ],
  "tier": "internally_reviewed",
  "verification": {
    "tests": {
      "passed": 21,
      "total": 21,
      "golden": 10,
      "boundary": 6,
      "property": 5
    },
    "contract_checks": {
      "passed": 4,
      "total": 4
    }
  },
  "evidence_core_generated_at": "2026-09-12T23:31:53.291Z",
  "rendered_at": "2026-09-16T08:32:56.985Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.3.1",
    "artifacts": {
      "engine": "1.3.1",
      "page": "1.3.1",
      "capability": "1.3.1",
      "evidence": "1.3.1",
      "input_schema": "1.3.1",
      "output_schema": "1.3.1",
      "mcp_contract": "1.3.1"
    },
    "digests": {
      "input_schema_sha256": "8e57ad145969881ae2da285855f712bef698997f05f5855af3274f92b9737e57",
      "output_schema_sha256": "49a507d762717fa8939a7268df765f51b15e13725f6e4ba1f9e1952da789a2a3",
      "evidence_sha256": "cf60ca3e7b548695bbc836416ea0012d623fa24ba3c659ea03e1c7bb949f3bb0",
      "evidence_core_sha256": "cf60ca3e7b548695bbc836416ea0012d623fa24ba3c659ea03e1c7bb949f3bb0",
      "capability_sha256": "821c0ec964290c8bf0c867b28c2bcf5a455149441bbb830518df6103f345d934",
      "engine_sha256": "0a1e24e92d5d1c2d39cf8577107541342377f1039590881b86fb08976a3138ef",
      "mcp_contract_sha256": "bf4dd5ff99d70ef6b0f8c0697525610cc133a250f1678b062d4b8df56a91fba0"
    },
    "contract_checks": {
      "total": 4,
      "passed": 4,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.3.1"
        },
        {
          "id": "schema-valid-input-executes",
          "status": "pass"
        },
        {
          "id": "engine-success-output-validates-schema",
          "status": "pass"
        },
        {
          "id": "schema-rejects-incomplete-input",
          "status": "pass"
        }
      ]
    },
    "report": "https://www.calculatorx.com/.well-known/calculatorx-release-integrity.json"
  }
}
