{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://kinra.ai/docs/truth-machine/schemas/declaration.schema.json",
  "title": "Truth Machine adoption declaration",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "spec_version",
    "patterns"
  ],
  "properties": {
    "spec_version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
    },
    "patterns": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "front_door": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "status_lines": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "status_document": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "authority_boundary": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "evidence_hygiene": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "frozen_archive": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "decision_records": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "current_projection": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "human_index": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "governed_read": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "sealed_baseline": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "declared_versus_observed": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "untrusted_intake": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "evidence_packet": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "change_packet": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "atomic_transition": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "exact_review": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "publication_freeze": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        },
        "generated_artifacts": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "adopted"
          ],
          "properties": {
            "adopted": {
              "type": "boolean"
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "index": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "notes": {
              "type": "string",
              "minLength": 1
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "adopted": {
                    "const": false
                  }
                }
              },
              "then": {
                "required": [
                  "reason"
                ]
              }
            }
          ]
        }
      }
    }
  }
}
