{
  "module": "M09",
  "airlock_states": [
    "SEALED",
    "EQUALISING_INNER",
    "INNER_OPEN",
    "CLOSED_INNER",
    "DEPRESSURISING",
    "OUTER_OPEN",
    "CLOSED_OUTER",
    "REPRESSURISING"
  ],
  "pressure_kpa": {
    "habitat": 101.3,
    "vacuum": 0.0,
    "safe_inner_delta_max": 2.0,
    "safe_outer_delta_max": 2.0
  },
  "door_assemblies": [
    {
      "id": "AL_INNER",
      "clear_width_m": 1.1,
      "clear_height_m": 2.8,
      "actuation_s": 5,
      "default": "closed",
      "mutually_exclusive": [
        "AL_OUTER"
      ]
    },
    {
      "id": "AL_OUTER",
      "clear_width_m": 0.92,
      "clear_height_m": 2.1,
      "actuation_s": 7,
      "default": "closed",
      "mutually_exclusive": [
        "AL_INNER"
      ]
    }
  ],
  "rules": [
    {
      "on": "open AL_INNER",
      "all": [
        "AL_OUTER closed",
        "abs(chamber_kpa-habitat_kpa)<=2.0",
        "seal_healthy"
      ]
    },
    {
      "on": "open AL_OUTER",
      "all": [
        "AL_INNER closed",
        "chamber_kpa<=2.0",
        "seal_healthy"
      ]
    },
    {
      "on": "close AL_INNER",
      "all": [
        "inner_clearance_sensor clear"
      ]
    },
    {
      "on": "close AL_OUTER",
      "all": [
        "outer_clearance_sensor clear"
      ]
    }
  ],
  "state_transitions": [
    {
      "from": "SEALED",
      "to": "EQUALISING_INNER",
      "action": "equalise_chamber_to_cabin",
      "guard": "both_doors_closed"
    },
    {
      "from": "EQUALISING_INNER",
      "to": "INNER_OPEN",
      "action": "open AL_INNER",
      "guard": "pressure_delta<=2.0kPa AND AL_OUTER closed"
    },
    {
      "from": "INNER_OPEN",
      "to": "CLOSED_INNER",
      "action": "close AL_INNER"
    },
    {
      "from": "CLOSED_INNER",
      "to": "DEPRESSURISING",
      "action": "vent_chamber_to_storage",
      "guard": "both_doors_closed"
    },
    {
      "from": "DEPRESSURISING",
      "to": "OUTER_OPEN",
      "action": "open AL_OUTER",
      "guard": "chamber_pressure<=2.0kPa AND AL_INNER closed"
    },
    {
      "from": "OUTER_OPEN",
      "to": "CLOSED_OUTER",
      "action": "close AL_OUTER"
    },
    {
      "from": "CLOSED_OUTER",
      "to": "REPRESSURISING",
      "action": "restore_chamber_pressure",
      "guard": "both_doors_closed"
    },
    {
      "from": "REPRESSURISING",
      "to": "SEALED",
      "action": "return to idle",
      "guard": "chamber_pressure>=99.3kPa"
    }
  ],
  "failures": {
    "power_loss": "both doors remain or move closed via spring",
    "pressure_sensor_fault": "inhibit opens",
    "manual_override": "requires two-person guarded service mode"
  }
}