Schema: configuration

{
  "$id": "https://australis.systems/schemas/htmx-ui-template-scaffold/configuration.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Target-side configuration document. Authoritative target-local state for a code base: package identity, intake location, corpus and template roots, target state root, backup root, the declared roots with their ownership class and purge_allowed flag, and the lists of compatibility / scaffold profiles in use.",
  "properties": {
    "application_anchor": {
      "description": "Optional path of the application anchor (typically '.'). All root paths MUST resolve beneath this anchor.",
      "minLength": 1,
      "type": "string"
    },
    "backup_root": {
      "description": "Optional target-relative path to where backups are created. Required when destructive replace is enabled.",
      "minLength": 1,
      "type": "string"
    },
    "compatibility_profile": {
      "description": "Optional default compatibility profile applied when corpus_profiles does not already cover the operation.",
      "minLength": 1,
      "type": "string"
    },
    "corpus_profiles": {
      "description": "Compatibility profile identifiers active for this target. Strings reference the profile document under profiles/ by id.",
      "items": {
        "minLength": 1,
        "type": "string"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "corpus_root": {
      "description": "Target-relative path to the canonical corpus root (e.g. 'assets'). Assets are derived from here.",
      "minLength": 1,
      "type": "string"
    },
    "destination_provider": {
      "description": "Optional destination provider identifier (e.g. 'filesystem').",
      "minLength": 1,
      "type": "string"
    },
    "intake_path": {
      "description": "Target-relative path to the verified-copy intake directory. Must already exist and be isolated at copy time.",
      "minLength": 1,
      "type": "string"
    },
    "roots": {
      "description": "Declared application roots. The schema rejects roots outside the application anchor, overlapping roots, state or backup roots nested inside purge roots, and protected repository paths.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "Stable root identifier used in receipts and receipt links.",
            "minLength": 1,
            "type": "string"
          },
          "ownership": {
            "description": "Root ownership class. Allowed values mirror ARCHITECTURE.md.",
            "enum": [
              "MIXED",
              "TOOL_MANAGED",
              "ROUTE_OWNED",
              "USER_OWNED",
              "PROTECTED"
            ],
            "type": "string"
          },
          "path": {
            "description": "Target-relative path of the root.",
            "minLength": 1,
            "type": "string"
          },
          "purge_allowed": {
            "description": "Whether destructive replace may purge this root. True only when the root is exclusively tool-managed or otherwise replaceable.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "path",
          "ownership",
          "purge_allowed"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "scaffold": {
      "additionalProperties": false,
      "description": "Scaffold profile set and policy.",
      "properties": {
        "backup_required": {
          "description": "Whether destructive operations MUST capture a verified backup by default. ARCHITECTURE.md mandates true.",
          "type": "boolean"
        },
        "profiles": {
          "description": "Scaffold profile identifiers. See profile.schema.json.",
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        }
      },
      "required": [
        "profiles"
      ],
      "type": "object"
    },
    "schema_version": {
      "description": "Major-version-locked envelope. Documents with any value other than 1.0.0 MUST fail validation, which enforces the major-version-1 contract.",
      "enum": [
        "1.0.0"
      ],
      "type": "string"
    },
    "source_provider": {
      "description": "Optional source provider identifier (e.g. 'rust-axum'). Required when scaffold policies depend on it.",
      "minLength": 1,
      "type": "string"
    },
    "state_root": {
      "description": "Target-relative path to the target-local state directory (config, ownership, history, journals, receipts).",
      "minLength": 1,
      "type": "string"
    },
    "target": {
      "additionalProperties": false,
      "description": "Target package identity. Package is the canonical name used in receipts, journals, and provenance.",
      "properties": {
        "package": {
          "description": "Target package name; the canonical short identifier under which the tool writes its receipts.",
          "minLength": 1,
          "type": "string"
        },
        "version": {
          "description": "Optional target application semantic version. Inclusion is for human-readable evidence; not used for gates.",
          "type": "string"
        }
      },
      "required": [
        "package"
      ],
      "type": "object"
    },
    "template_root": {
      "description": "Target-relative path where route-owned page adapters are scaffolded.",
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "schema_version",
    "target",
    "intake_path",
    "corpus_root",
    "template_root",
    "state_root",
    "corpus_profiles",
    "scaffold"
  ],
  "title": "Target Configuration",
  "type": "object"
}