{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "exploder-status/1",
 "title": "Where the project is",
 "description": "Written by studio/status.py from the project's own files; read by the Exploder's Project strip and the Conductor. No count is typed by hand. Stages, ids, order and gates come from 'The SFB plan, in one view' in the Mission Studio plan.",
 "type": "object",
 "required": [
  "schema",
  "project",
  "written",
  "build",
  "current",
  "setup",
  "steps",
  "features",
  "next",
  "rfp",
  "watch",
  "plan"
 ],
 "additionalProperties": false,
 "properties": {
  "schema": {
   "const": "exploder-status/1"
  },
  "project": {
   "type": "string"
  },
  "written": {
   "type": "string"
  },
  "build": {
   "type": "string"
  },
  "deadline": {
   "type": [
    "object",
    "null"
   ],
   "required": [
    "date",
    "label"
   ],
   "properties": {
    "date": {
     "type": "string"
    },
    "label": {
     "type": "string"
    },
    "source": {
     "type": "string"
    }
   }
  },
  "current": {
   "enum": [
    "baseline",
    "names",
    "documents",
    "asset-load",
    "i3-setup",
    "map",
    "inventory",
    "validate",
    "sense",
    "pilot",
    "relay",
    "tenant",
    "stream",
    "processing",
    "triggers",
    "analytics",
    "connect",
    "test",
    "ratify",
    "operate"
   ]
  },
  "steps": {
   "type": "array",
   "minItems": 20,
   "items": {
    "type": "object",
    "required": [
     "id",
     "n",
     "name",
     "group",
     "state",
     "count",
     "gate"
    ],
    "properties": {
     "id": {
      "enum": [
       "baseline",
       "names",
       "documents",
       "asset-load",
       "i3-setup",
       "map",
       "inventory",
       "validate",
       "sense",
       "pilot",
       "relay",
       "tenant",
       "stream",
       "processing",
       "triggers",
       "analytics",
       "connect",
       "test",
       "ratify",
       "operate"
      ]
     },
     "n": {
      "type": "string",
      "pattern": "^(S[1-5]|[1-9]|T[1-6])$"
     },
     "name": {
      "type": "string"
     },
     "state": {
      "enum": [
       "done",
       "running",
       "drafted",
       "waiting",
       "next",
       "not started"
      ]
     },
     "count": {
      "type": "object",
      "required": [
       "done",
       "unit"
      ],
      "properties": {
       "done": {
        "type": "integer",
        "minimum": 0
       },
       "total": {
        "type": [
         "integer",
         "null"
        ],
        "minimum": 0
       },
       "unit": {
        "type": "string"
       }
      }
     },
     "waiting_on": {
      "type": [
       "string",
       "null"
      ]
     },
     "gate": {
      "type": "string"
     },
     "flagged": {
      "type": "integer"
     },
     "to_confirm": {
      "type": "integer"
     },
     "group": {
      "enum": [
       "setup",
       "main",
       "track"
      ]
     },
     "planned_start": {
      "type": [
       "string",
       "null"
      ]
     },
     "planned_end": {
      "type": [
       "string",
       "null"
      ]
     },
     "date_basis": {
      "type": "string"
     },
     "critical": {
      "type": "boolean"
     },
     "late": {
      "type": "boolean"
     },
     "days_late": {
      "type": "integer",
      "minimum": 0
     },
     "progress": {
      "type": [
       "number",
       "null"
      ]
     }
    }
   }
  },
  "features": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "name",
     "step",
     "state"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "step": {
      "type": "string"
     },
     "state": {
      "enum": [
       "running",
       "designed",
       "concept"
      ]
     },
     "view": {
      "type": "string"
     },
     "chapter": {
      "type": "string"
     },
     "note": {
      "type": "string"
     },
     "try": {
      "type": "object"
     }
    }
   }
  },
  "next": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "n",
     "step",
     "text"
    ],
    "properties": {
     "n": {
      "type": "integer"
     },
     "step": {
      "type": "string"
     },
     "text": {
      "type": "string"
     },
     "go": {
      "type": [
       "object",
       "null"
      ]
     }
    }
   }
  },
  "rfp": {
   "type": "object",
   "required": [
    "total",
    "covered",
    "in_progress",
    "not_yet"
   ],
   "properties": {
    "total": {
     "type": "integer"
    },
    "covered": {
     "type": "integer"
    },
    "in_progress": {
     "type": "integer"
    },
    "not_yet": {
     "type": "integer"
    },
    "basis": {
     "type": "string"
    },
    "list": {
     "type": [
      "string",
      "null"
     ]
    },
    "demo": {
     "type": "object",
     "properties": {
      "now": {
       "type": "integer"
      },
      "near": {
       "type": "integer"
      },
      "planned": {
       "type": "integer"
      },
      "local": {
       "type": "integer"
      }
     }
    },
    "source": {
     "type": "string"
    },
    "items": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "id",
       "phase",
       "text",
       "stage",
       "plan",
       "demo",
       "show",
       "why"
      ],
      "properties": {
       "id": {
        "type": "string",
        "pattern": "^REQ-SFB-\\d+$"
       },
       "phase": {
        "type": "string"
       },
       "text": {
        "type": "string"
       },
       "rfp": {
        "type": [
         "string",
         "null"
        ]
       },
       "stage": {
        "enum": [
         "baseline",
         "names",
         "documents",
         "asset-load",
         "i3-setup",
         "map",
         "inventory",
         "validate",
         "sense",
         "pilot",
         "relay",
         "tenant",
         "stream",
         "processing",
         "triggers",
         "analytics",
         "connect",
         "test",
         "ratify",
         "operate"
        ]
       },
       "plan": {
        "type": "string"
       },
       "demo": {
        "enum": [
         "now",
         "local",
         "near",
         "planned"
        ]
       },
       "show": {
        "type": [
         "string",
         "null"
        ]
       },
       "why": {
        "type": "string"
       },
       "screens": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "more": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "kind",
          "command",
          "shows",
          "state"
         ],
         "properties": {
          "kind": {
           "const": "command"
          },
          "repo": {
           "type": "string"
          },
          "command": {
           "type": "string"
          },
          "test": {
           "type": [
            "string",
            "null"
           ]
          },
          "shows": {
           "type": "string"
          },
          "not_shown": {
           "type": [
            "string",
            "null"
           ]
          },
          "state": {
           "type": "string"
          }
         }
        }
       },
       "horizon": {
        "type": [
         "string",
         "null"
        ],
        "enum": [
         "june-2027",
         "end-2029",
         "end-2031",
         "end-2036",
         null
        ]
       }
      }
     }
    }
   }
  },
  "watch": {
   "type": "object",
   "required": [
    "state"
   ],
   "properties": {
    "state": {
     "type": "string"
    },
    "what": {
     "type": "string"
    },
    "src": {
     "type": "string"
    }
   }
  },
  "setup": {
   "type": "array",
   "minItems": 5,
   "maxItems": 5,
   "items": {
    "type": "object",
    "required": [
     "id",
     "n",
     "name",
     "state",
     "count"
    ],
    "properties": {
     "id": {
      "type": "string",
      "enum": [
       "baseline",
       "names",
       "documents",
       "asset-load",
       "i3-setup"
      ]
     },
     "n": {
      "type": "string",
      "pattern": "^S[1-5]$"
     },
     "name": {
      "type": "string"
     },
     "state": {
      "enum": [
       "done",
       "running",
       "drafted",
       "waiting",
       "next",
       "not started"
      ]
     },
     "count": {
      "type": "object",
      "required": [
       "done",
       "unit"
      ],
      "properties": {
       "done": {
        "type": "integer",
        "minimum": 0
       },
       "total": {
        "type": [
         "integer",
         "null"
        ],
        "minimum": 0
       },
       "unit": {
        "type": "string"
       }
      }
     },
     "waiting_on": {
      "type": [
       "string",
       "null"
      ]
     },
     "gate": {
      "type": [
       "string",
       "null"
      ]
     },
     "flagged": {
      "type": "integer"
     },
     "to_confirm": {
      "type": "integer"
     },
     "planned_start": {
      "type": [
       "string",
       "null"
      ]
     },
     "planned_end": {
      "type": [
       "string",
       "null"
      ]
     },
     "date_basis": {
      "type": "string"
     },
     "critical": {
      "type": "boolean"
     },
     "late": {
      "type": "boolean"
     },
     "days_late": {
      "type": "integer",
      "minimum": 0
     },
     "progress": {
      "type": [
       "number",
       "null"
      ]
     }
    }
   }
  },
  "pilot": {
   "type": "object",
   "required": [
    "id",
    "n",
    "name",
    "state",
    "gate"
   ],
   "additionalProperties": false,
   "properties": {
    "id": {
     "type": "string"
    },
    "n": {
     "type": "string"
    },
    "name": {
     "type": "string"
    },
    "owner": {
     "type": [
      "string",
      "null"
     ]
    },
    "state": {
     "enum": [
      "done",
      "running",
      "drafted",
      "waiting",
      "next",
      "not started"
     ]
    },
    "gate": {
     "type": "string"
    },
    "waiting_on": {
     "type": [
      "string",
      "null"
     ]
    },
    "planned_start": {
     "type": [
      "string",
      "null"
     ]
    },
    "planned_end": {
     "type": [
      "string",
      "null"
     ]
    },
    "date_basis": {
     "type": "string"
    },
    "critical": {
     "type": "boolean"
    },
    "late": {
     "type": "boolean"
    },
    "days_late": {
     "type": "integer",
     "minimum": 0
    },
    "progress": {
     "type": [
      "number",
      "null"
     ]
    }
   }
  },
  "tracks": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "n",
     "name",
     "state",
     "gate"
    ],
    "additionalProperties": false,
    "properties": {
     "id": {
      "type": "string"
     },
     "n": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "owner": {
      "type": [
       "string",
       "null"
      ]
     },
     "state": {
      "enum": [
       "done",
       "running",
       "drafted",
       "waiting",
       "next",
       "not started"
      ]
     },
     "gate": {
      "type": "string"
     },
     "waiting_on": {
      "type": [
       "string",
       "null"
      ]
     },
     "planned_start": {
      "type": [
       "string",
       "null"
      ]
     },
     "planned_end": {
      "type": [
       "string",
       "null"
      ]
     },
     "date_basis": {
      "type": "string"
     },
     "critical": {
      "type": "boolean"
     },
     "late": {
      "type": "boolean"
     },
     "days_late": {
      "type": "integer",
      "minimum": 0
     },
     "progress": {
      "type": [
       "number",
       "null"
      ]
     }
    }
   }
  },
  "plan": {
   "type": "object",
   "required": [
    "doc",
    "section"
   ],
   "properties": {
    "doc": {
     "type": "string"
    },
    "section": {
     "type": "string"
    }
   }
  },
  "scope2027": {
   "type": "object",
   "description": "June 2027: where we can get, from the Mission Studio store (a draft until ratified)",
   "required": [
    "state",
    "ends",
    "items",
    "horizons"
   ],
   "properties": {
    "state": {
     "type": "string"
    },
    "ratified_by": {
     "type": [
      "string",
      "null"
     ]
    },
    "version": {
     "type": "integer"
    },
    "ends": {
     "type": "string"
    },
    "items": {
     "type": "integer"
    },
    "horizons": {
     "type": "object"
    },
    "go": {
     "type": [
      "object",
      "null"
     ]
    }
   }
  },
  "masterplan": {
   "type": "object",
   "description": "The master plan, 3, 5 and 10 years, from the Mission Studio store (a draft until ratified)",
   "required": [
    "state",
    "horizons"
   ],
   "properties": {
    "state": {
     "type": "string"
    },
    "ratified_by": {
     "type": [
      "string",
      "null"
     ]
    },
    "version": {
     "type": "integer"
    },
    "assumption": {
     "type": "string"
    },
    "horizons": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "id",
       "label",
       "ends"
      ],
      "properties": {
       "id": {
        "type": "string"
       },
       "label": {
        "type": "string"
       },
       "ends": {
        "type": "string"
       }
      }
     }
    },
    "go": {
     "type": [
      "object",
      "null"
     ]
    }
   }
  },
  "schedule": {
   "type": "object",
   "description": "The schedule from the Mission Studio store: its state (assumption, draft, until ratified), the critical path and the late stages",
   "properties": {
    "state": {
     "type": "string"
    },
    "ratified_by": {
     "type": [
      "string",
      "null"
     ]
    },
    "critical_path": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "late": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "today": {
     "type": "string"
    },
    "go": {
     "type": [
      "object",
      "null"
     ]
    }
   }
  }
 }
}
