{
  "capability_id": "electrical.energy_cost",
  "tool_id": "energy-cost",
  "engine": "energy-cost",
  "calculation_version": "1.4.2",
  "generated_at": "2026-09-17T02:42:41.752Z",
  "engine_build": "2026-09-13",
  "test_count": 28,
  "passed": 28,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 10,
      "passed": 10
    },
    "boundary": {
      "total": 13,
      "passed": 13
    },
    "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/energy-cost",
  "api": "https://www.calculatorx.com/api/v1/calc/energy-cost",
  "schema_input": "https://www.calculatorx.com/schemas/electrical.energy_cost.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/electrical.energy_cost.output.json",
  "assumptions": [
    "Constant average power over the period",
    "Single flat unit rate"
  ],
  "limitations": [
    "Usage cost only — standing charge and tax not included",
    "W, hours, days, kWh, and rate must be ≥ 0",
    "Hours per day must be ≤ 24 (HOURS_PER_DAY_OUT_OF_RANGE)",
    "Zero W/hours/days/kWh/rate → 0"
  ],
  "boundary_conditions": [
    "Standing charge and tax not included — usage cost only",
    "Missing rate / W / hours / days / kWh → MISSING_REQUIRED_INPUT; rate / W / hours / days / kWh < 0 → VALUE_MUST_BE_NON_NEGATIVE",
    "hours > 24 in watts mode → HOURS_PER_DAY_OUT_OF_RANGE",
    "Bad mode → INVALID_MODE; non-finite → INVALID_NUMBER",
    "Zero W / hours / days / kWh / rate → 0 cost — soft boundary",
    "mode=watts uses W×hours×days/1000×rate; mode=kwh uses kWh×rate"
  ],
  "sources": [
    {
      "title": "NIST Guide to the SI (SP 811)",
      "section": "Kilowatt-hour as a common commercial unit of electrical energy",
      "url": "https://www.nist.gov/pml/special-publication-811",
      "supports": "Cost = kWh × rate; kWh = W × h × days / 1000",
      "kind": "reference"
    },
    {
      "title": "U.S. Energy Information Administration (EIA)",
      "section": "Electricity prices reported per kilowatt-hour",
      "url": "https://www.eia.gov/electricity/monthly/epm_table_grapher.php?t=epmt_5_6_a",
      "supports": "Rate input ($/kWh) is user-supplied from local tariffs",
      "kind": "reference"
    }
  ],
  "methods": [],
  "fingerprint": "sha256:1d89897cd7c3a32f55a70b81d1f55258199ef0655d42352bb14163bbd0d01192",
  "tests": [
    {
      "id": "watts-mode",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "watts",
        "W": 1000,
        "hours": 4,
        "days": 30,
        "rate": 0.15
      },
      "expect": 18,
      "expectWarning": null,
      "actual": 18,
      "tol": 0.01
    },
    {
      "id": "kwh-mode",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 120,
        "rate": 0.15
      },
      "expect": 18,
      "expectWarning": null,
      "actual": 18,
      "tol": 0.01
    },
    {
      "id": "linear-2x-W",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "watts",
        "W": 2000,
        "hours": 4,
        "days": 30,
        "rate": 0.15
      },
      "expect": 36,
      "expectWarning": null,
      "actual": 36,
      "tol": 0.01
    },
    {
      "id": "linear-2x-rate",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "watts",
        "W": 1000,
        "hours": 4,
        "days": 30,
        "rate": 0.3
      },
      "expect": 36,
      "expectWarning": null,
      "actual": 36,
      "tol": 0.01
    },
    {
      "id": "soft-zero-W",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "watts",
        "W": 0,
        "hours": 4,
        "days": 30,
        "rate": 0.15
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 1e-12
    },
    {
      "id": "soft-zero-days",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "watts",
        "W": 1000,
        "hours": 4,
        "days": 0,
        "rate": 0.15
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 1e-12
    },
    {
      "id": "soft-zero-rate",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "watts",
        "W": 1000,
        "hours": 4,
        "days": 30,
        "rate": 0
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 1e-12
    },
    {
      "id": "soft-zero-kwh",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "kwh",
        "kWh": 0,
        "rate": 0.15
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 1e-12
    },
    {
      "id": "500W-2h-30d",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "watts",
        "W": 500,
        "hours": 2,
        "days": 30,
        "rate": 0.2
      },
      "expect": 6,
      "expectWarning": null,
      "actual": 6,
      "tol": 0.01
    },
    {
      "id": "daily-1d",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "watts",
        "W": 1500,
        "hours": 6,
        "days": 1,
        "rate": 0.25
      },
      "expect": 2.25,
      "expectWarning": null,
      "actual": 2.25,
      "tol": 0.01
    },
    {
      "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": "joules",
        "kWh": 10,
        "rate": 0.1
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be \"watts\" or \"kwh\""
    },
    {
      "id": "neg-rate",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "kwh",
        "kWh": 10,
        "rate": -1
      },
      "expectError": "VALUE_MUST_BE_NON_NEGATIVE",
      "code": "VALUE_MUST_BE_NON_NEGATIVE",
      "error": "rate must be ≥ 0"
    },
    {
      "id": "boundary-zero-rate",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "kwh",
        "kWh": 100,
        "rate": 0
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 1e-12
    },
    {
      "id": "boundary-neg-W",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "watts",
        "W": -1000,
        "hours": 4,
        "days": 30,
        "rate": 0.15
      },
      "expectError": "VALUE_MUST_BE_NON_NEGATIVE",
      "code": "VALUE_MUST_BE_NON_NEGATIVE",
      "error": "W must be ≥ 0"
    },
    {
      "id": "boundary-neg-hours",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "watts",
        "W": 1000,
        "hours": -4,
        "days": 30,
        "rate": 0.15
      },
      "expectError": "VALUE_MUST_BE_NON_NEGATIVE",
      "code": "VALUE_MUST_BE_NON_NEGATIVE",
      "error": "hours must be ≥ 0"
    },
    {
      "id": "boundary-hours-gt-24",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "watts",
        "W": 1000,
        "hours": 25,
        "days": 30,
        "rate": 0.15
      },
      "expectError": "HOURS_PER_DAY_OUT_OF_RANGE",
      "code": "HOURS_PER_DAY_OUT_OF_RANGE",
      "error": "hours per day must be ≤ 24"
    },
    {
      "id": "boundary-neg-days",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "watts",
        "W": 1000,
        "hours": 4,
        "days": -30,
        "rate": 0.15
      },
      "expectError": "VALUE_MUST_BE_NON_NEGATIVE",
      "code": "VALUE_MUST_BE_NON_NEGATIVE",
      "error": "days must be ≥ 0"
    },
    {
      "id": "boundary-neg-kWh",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "kwh",
        "kWh": -10,
        "rate": 0.15
      },
      "expectError": "VALUE_MUST_BE_NON_NEGATIVE",
      "code": "VALUE_MUST_BE_NON_NEGATIVE",
      "error": "kWh must be ≥ 0"
    },
    {
      "id": "boundary-missing-W",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "watts",
        "hours": 4,
        "days": 30,
        "rate": 0.15
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "W is required"
    },
    {
      "id": "boundary-missing-hours",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "watts",
        "W": 1000,
        "days": 30,
        "rate": 0.15
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "hours is required"
    },
    {
      "id": "boundary-missing-days",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "watts",
        "W": 1000,
        "hours": 4,
        "rate": 0.15
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "days is required"
    },
    {
      "id": "boundary-missing-kWh",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "kwh",
        "rate": 0.15
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "kWh is required"
    },
    {
      "id": "property-cost",
      "ok": true,
      "kind": "property",
      "detail": "cost = kWh·rate",
      "expect": 18,
      "actual": 18
    },
    {
      "id": "property-kwh-mode",
      "ok": true,
      "kind": "property",
      "detail": "kWh mode matches watts path",
      "expect": 18,
      "actual": 18
    },
    {
      "id": "property-linear-load",
      "ok": true,
      "kind": "property",
      "detail": "cost ∝ W",
      "expect": 36,
      "actual": 36
    },
    {
      "id": "property-linear-rate",
      "ok": true,
      "kind": "property",
      "detail": "cost ∝ rate",
      "expect": 36,
      "actual": 36
    },
    {
      "id": "property-linear-hours",
      "ok": true,
      "kind": "property",
      "detail": "cost ∝ hours",
      "expect": 36,
      "actual": 36
    }
  ],
  "tier": "internally_reviewed",
  "verification": {
    "tests": {
      "passed": 28,
      "total": 28,
      "golden": 10,
      "boundary": 13,
      "property": 5
    },
    "contract_checks": {
      "passed": 4,
      "total": 4
    }
  },
  "evidence_core_generated_at": "2026-09-13T13:02:01.815Z",
  "rendered_at": "2026-09-17T02:42:41.752Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.4.2",
    "artifacts": {
      "engine": "1.4.2",
      "page": "1.4.2",
      "capability": "1.4.2",
      "evidence": "1.4.2",
      "input_schema": "1.4.2",
      "output_schema": "1.4.2",
      "mcp_contract": "1.4.2"
    },
    "digests": {
      "input_schema_sha256": "12262cc56ba4bd37d19d307cb4bd0bc5d9dce4fde5270bd9146c57e088dabaf9",
      "output_schema_sha256": "e11e90e9c7aa944658f65c395d04a726024128cf3a15b9b48dae535fb46aa2fa",
      "evidence_sha256": "3c233b6d9c6bb5c27f2530246be721bf3d9f1d5a4c01529fc775fe968cedbaf0",
      "evidence_core_sha256": "3c233b6d9c6bb5c27f2530246be721bf3d9f1d5a4c01529fc775fe968cedbaf0",
      "capability_sha256": "86abc3703f583dfe38020c175bb55de7b9491340a9b65b346679e025035bd34c",
      "engine_sha256": "a3e8effccaf4677aec4d1da78c13b5dc595ff97e52b074d5de5ab5cb5a87b094",
      "mcp_contract_sha256": "a942c221699a25eb2b10fc462c0b321092558cb5ffda32cf521d31ee83e3fe87"
    },
    "contract_checks": {
      "total": 4,
      "passed": 4,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.4.2"
        },
        {
          "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"
  }
}
