{
  "openapi": "3.1.0",
  "info": {
    "title": "M.I.A.Lock runtime",
    "version": "0.1.1",
    "description": "Purpose-bound missing-person event map, Doe descriptor matching, coverage reports, and map-layer descriptions (uncertainty ellipses + coverage heat). Hosted map is a stub; live Leaflet map is local CLI mialock map. Doe hit ≠ ID. Coverage heat ≠ presence. Search broadly. Match probabilistically. Challenge every hit. Preserve provenance. Verify before action."
  },
  "servers": [
    {
      "url": "https://mialock-download-tracker.vibelock.workers.dev"
    }
  ],
  "paths": {
    "/v1/example": {
      "get": {
        "operationId": "mialockExample",
        "summary": "Sample JSON payload. Does not increment downloads.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/skill": {
      "get": {
        "operationId": "mialock_skill",
        "summary": "Return skill markdown. Does not increment download KV.",
        "responses": {
          "200": {
            "description": "markdown"
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/map": {
      "get": {
        "operationId": "map",
        "summary": "Sample casebook index stub. Live Leaflet map is local CLI mialock map (uncertainty ellipses + coverage heat toggles; doe_cold shows lead cards). Not live tracking.",
        "responses": {
          "200": {
            "description": "sample index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/search-options": {
      "get": {
        "operationId": "searchOptions",
        "summary": "List archive / Doe / cold-case search modes.",
        "responses": {
          "200": {
            "description": "modes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/queries": {
      "get": {
        "operationId": "queriesGet",
        "summary": "Render query families for a search mode (query string). Search plans only. Doe leads ≠ ID.",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "jurisdiction",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "rendered queries"
          }
        }
      },
      "post": {
        "operationId": "queries",
        "summary": "Render query families for a search mode. Search plans only. Doe leads ≠ ID.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "mode"
                ],
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "active",
                      "archives",
                      "doe_cold",
                      "cold_missing"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "aliases": {
                    "type": "string"
                  },
                  "jurisdiction": {
                    "type": "string"
                  },
                  "year_from": {
                    "type": "string"
                  },
                  "year_to": {
                    "type": "string"
                  },
                  "age_band": {
                    "type": "string"
                  },
                  "sex": {
                    "type": "string"
                  },
                  "height_cm": {
                    "type": "number"
                  },
                  "scars_marks": {
                    "type": "string"
                  },
                  "clothing": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "rendered queries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/doe-match": {
      "get": {
        "operationId": "doeMatchGet",
        "summary": "Rank Doe / unidentified notices vs a named-subject descriptor (query string). Compatibility leads only. Doe hit ≠ ID.",
        "parameters": [
          {
            "name": "age_band",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sex",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "jurisdiction",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scars_marks",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clothing",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "time_window_from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "time_window_to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ranked compatibility leads + field breakdown"
          }
        }
      },
      "post": {
        "operationId": "doeMatch",
        "summary": "Rank Doe / unidentified notices vs a named-subject descriptor. Compatibility leads only with score and field-level match/mismatch. Never an identification.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "age_band": {
                    "type": "string"
                  },
                  "sex": {
                    "type": "string"
                  },
                  "height_cm": {
                    "type": "number"
                  },
                  "height_band": {
                    "type": "string"
                  },
                  "build": {
                    "type": "string"
                  },
                  "scars_marks": {
                    "type": "string"
                  },
                  "clothing": {
                    "type": "string"
                  },
                  "jurisdiction": {
                    "type": "string"
                  },
                  "time_window_from": {
                    "type": "string"
                  },
                  "time_window_to": {
                    "type": "string"
                  },
                  "notices": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ranked compatibility leads + excluded mismatches"
          }
        }
      }
    },
    "/v1/coverage": {
      "get": {
        "operationId": "coverage",
        "summary": "Adapter coverage report and heat cells. Heat = search coverage intensity / negative-evidence weight — not a probability of presence.",
        "parameters": [
          {
            "name": "subject",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Subject id (default subj-elena-cold-demo)"
          }
        ],
        "responses": {
          "200": {
            "description": "coverage report + geojson heat cells"
          }
        }
      }
    }
  }
}