{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oods-foundry.com/schemas/code.generate.output.json",
  "title": "code_generate output",
  "description": "Versioned generated artifact from a UiSchema. Legacy single-source fields remain as deprecated compatibility aliases.",
  "type": "object",
  "required": [
    "status",
    "framework",
    "code",
    "fileExtension",
    "imports",
    "warnings",
    "validationReceipt"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "status": {
            "type": "string",
            "const": "ok"
          }
        },
        "required": [
          "status"
        ]
      },
      "then": {
        "anyOf": [
          {
            "required": [
              "artifact"
            ]
          },
          {
            "required": [
              "payload"
            ]
          }
        ],
        "properties": {
          "validationReceipt": {
            "allOf": [
              {
                "$ref": "#/$defs/buildChecksCompleted"
              },
              {
                "if": {
                  "properties": {
                    "profile": {
                      "type": "string",
                      "const": "release"
                    }
                  },
                  "required": [
                    "profile"
                  ]
                },
                "then": {
                  "$ref": "#/$defs/releaseSuccessReceipt"
                }
              }
            ]
          }
        }
      },
      "else": {
        "not": {
          "anyOf": [
            {
              "required": [
                "artifact"
              ]
            },
            {
              "required": [
                "payload"
              ]
            }
          ]
        }
      }
    }
  ],
  "properties": {
    "componentContracts": {
      "type": "array",
      "description": "Advisory shared-scenario component reports. Each declared obligation is met, unmet or not checked with a reason; browser availability never blocks generation.",
      "items": {
        "type": "object",
        "required": [
          "schemaVersion",
          "framework",
          "mappingId",
          "component",
          "source",
          "contractVersion",
          "scenarioId",
          "obligations",
          "summary"
        ],
        "additionalProperties": false,
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1"
          },
          "framework": {
            "type": "string",
            "enum": [
              "react",
              "vue"
            ]
          },
          "mappingId": {
            "type": "string"
          },
          "component": {
            "type": "string"
          },
          "contractVersion": {
            "type": "string"
          },
          "scenarioId": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "object",
            "required": [
              "export"
            ],
            "additionalProperties": false,
            "properties": {
              "package": {
                "type": "string"
              },
              "export": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "packageContentHash": {
                "type": "string"
              },
              "shadcn": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "module",
                  "file",
                  "closureHash"
                ],
                "properties": {
                  "framework": {
                    "type": "string",
                    "enum": [
                      "react",
                      "vue"
                    ]
                  },
                  "base": {
                    "type": "string",
                    "enum": [
                      "radix",
                      "base",
                      "reka"
                    ]
                  },
                  "style": {
                    "type": "string"
                  },
                  "themeRequirement": {
                    "type": "string"
                  },
                  "module": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string"
                  },
                  "closureHash": {
                    "type": "string",
                    "pattern": "^sha256:[a-f0-9]{64}$"
                  }
                }
              }
            },
            "oneOf": [
              {
                "required": [
                  "package",
                  "version"
                ],
                "not": {
                  "required": [
                    "shadcn"
                  ]
                }
              },
              {
                "required": [
                  "shadcn"
                ],
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "package"
                      ]
                    },
                    {
                      "required": [
                        "version"
                      ]
                    }
                  ]
                }
              }
            ]
          },
          "checkedAt": {
            "type": "string"
          },
          "browser": {
            "type": "string"
          },
          "adapterContentHash": {
            "type": "string"
          },
          "contractContentHash": {
            "type": "string"
          },
          "obligations": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "requirement",
                "status",
                "reason"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "requirement": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "met",
                    "unmet",
                    "not-checked"
                  ]
                },
                "reason": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "summary": {
            "type": "object",
            "required": [
              "met",
              "unmet",
              "not-checked"
            ],
            "additionalProperties": false,
            "properties": {
              "met": {
                "type": "integer",
                "minimum": 0
              },
              "unmet": {
                "type": "integer",
                "minimum": 0
              },
              "not-checked": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "error"
      ],
      "description": "Whether code generation succeeded."
    },
    "framework": {
      "type": "string",
      "enum": [
        "react",
        "vue",
        "html"
      ],
      "description": "The target framework that was used."
    },
    "artifact": {
      "$ref": "#/$defs/generatedArtifact",
      "description": "Primary versioned, content-addressed file-set payload. Present when status is ok and options.payloadMode is inline (the default); with payloadMode file it is written to payload.directory as artifact.json instead."
    },
    "payload": {
      "type": "object",
      "description": "payloadMode file: where the large output was written instead of being returned inline; the directory is beside the saved-schema store (<store>/../payloads/<tool>-<digest>).",
      "required": [
        "mode",
        "directory",
        "bytes",
        "files"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "const": "file"
        },
        "directory": {
          "type": "string",
          "description": "Absolute directory holding the written files."
        },
        "bytes": {
          "type": "integer",
          "minimum": 0,
          "description": "Total bytes written."
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "bytes",
              "sha256"
            ],
            "properties": {
              "path": {
                "type": "string",
                "description": "Relative POSIX path inside the directory."
              },
              "bytes": {
                "type": "integer",
                "minimum": 0
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "code": {
      "type": "string",
      "deprecated": true,
      "description": "Deprecated v0 compatibility alias for artifact.files[0].contents. Empty string on error."
    },
    "fileExtension": {
      "type": "string",
      "deprecated": true,
      "description": "Deprecated v0 compatibility alias for the primary generated file extension."
    },
    "imports": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "deprecated": true,
      "description": "Deprecated v0 compatibility alias. Use artifact.dependencies for exact versions and dependency kinds."
    },
    "warnings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/codegenIssue"
      },
      "description": "Non-fatal issues encountered during generation."
    },
    "validationReceipt": {
      "$ref": "#/$defs/validationReceipt",
      "description": "Mandatory disclosure of the applied profile, independent policy axes, checks performed, and checks not reached. When generation reaches an artifact, the receipt names its content hash; release receipts retain accepted caller-supplied evidence envelopes for auditability."
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/codegenIssue"
      },
      "description": "Fatal issues that prevented code generation."
    },
    "install": {
      "type": "object",
      "description": "Present on success when the generated code imports @oods packages (react and vue), or mapped team packages: the exact versions it needs and the npm commands that install them, run in the app's directory in order. The @oods packages install from npm. An application's package.json pins the @oods packages its code imports at exact versions, and npm install brings the @oods packages those depend on: @oods/tokens arrives through @oods/component-styles.",
      "required": [
        "note",
        "packages",
        "steps"
      ],
      "properties": {
        "note": {
          "type": "string",
          "description": "Names the packages and where they install from."
        },
        "packages": {
          "type": "array",
          "description": "Every @oods package the app needs, its own @oods dependencies included.",
          "items": {
            "type": "object",
            "required": [
              "name",
              "version"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string",
                "description": "The exact version this runtime generated against."
              }
            },
            "additionalProperties": false
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Shell commands to run in the app's directory, in order."
        }
      },
      "additionalProperties": false
    },
    "meta": {
      "type": "object",
      "properties": {
        "nodeCount": {
          "type": "number"
        },
        "componentCount": {
          "type": "number"
        },
        "unknownComponents": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "$defs": {
    "generatedArtifact": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "framework",
        "files",
        "dependencies",
        "actions",
        "contentHash"
      ],
      "properties": {
        "substitutions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "mappingId",
              "component",
              "source"
            ],
            "additionalProperties": false,
            "properties": {
              "packageContentHash": {
                "type": "string",
                "pattern": "^sha256:[a-f0-9]{64}$"
              },
              "mappingId": {
                "type": "string",
                "minLength": 1
              },
              "component": {
                "type": "string"
              },
              "source": {
                "type": "object",
                "required": [
                  "export"
                ],
                "additionalProperties": false,
                "properties": {
                  "package": {
                    "type": "string",
                    "minLength": 1
                  },
                  "export": {
                    "type": "string",
                    "pattern": "^[A-Za-z_$][\\w$]*$"
                  },
                  "passthrough": {
                    "type": "boolean",
                    "default": true,
                    "description": "Unlisted OODS Foundry props keep their names. False drops unlisted optional props; required props must be translated."
                  },
                  "props": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "required": [
                        "name"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "name": {
                          "type": "string",
                          "pattern": "^[A-Za-z_$][\\w$]*$"
                        },
                        "values": {
                          "type": "object",
                          "additionalProperties": {
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "description": "OODS Foundry prop to team prop, with optional scalar value map; values not in the map are preserved. Children, slots and event bindings keep their framework conventions."
                  },
                  "version": {
                    "type": "string",
                    "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$",
                    "description": "Exact team package version; code generation needs this or an installed package manifest."
                  },
                  "shadcn": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "module",
                      "file",
                      "closureHash",
                      "css",
                      "files",
                      "hashFiles",
                      "paths",
                      "dependencies",
                      "imports"
                    ],
                    "properties": {
                      "framework": {
                        "type": "string",
                        "enum": [
                          "react",
                          "vue"
                        ]
                      },
                      "base": {
                        "type": "string",
                        "enum": [
                          "radix",
                          "base",
                          "reka"
                        ]
                      },
                      "style": {
                        "type": "string"
                      },
                      "themeRequirement": {
                        "type": "string"
                      },
                      "module": {
                        "type": "string"
                      },
                      "file": {
                        "type": "string"
                      },
                      "closureHash": {
                        "type": "string",
                        "pattern": "^sha256:[a-f0-9]{64}$"
                      },
                      "css": {
                        "type": "string"
                      },
                      "files": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "hashFiles": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "skipLibCheck": {
                        "type": "boolean"
                      },
                      "paths": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "dependencies": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "imports": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "oneOf": [
                  {
                    "required": [
                      "package",
                      "version"
                    ],
                    "not": {
                      "required": [
                        "shadcn"
                      ]
                    }
                  },
                  {
                    "required": [
                      "shadcn"
                    ],
                    "not": {
                      "anyOf": [
                        {
                          "required": [
                            "package"
                          ]
                        },
                        {
                          "required": [
                            "version"
                          ]
                        }
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "schemaVersion": {
          "type": "string",
          "const": "1.0.0",
          "description": "Version of the generated artifact envelope contract."
        },
        "framework": {
          "type": "string",
          "enum": [
            "react",
            "vue",
            "html"
          ]
        },
        "files": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/generatedArtifactFile"
          },
          "description": "Generated files in deterministic relative-path order."
        },
        "dependencies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/generatedDependency"
          },
          "description": "Exact install manifest in deterministic kind-and-name order."
        },
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/generatedArtifactAction"
          },
          "description": "Required consumer-supplied domain actions in deterministic name order. An empty array means the generated UI needs no domain-action injection."
        },
        "contentHash": {
          "$ref": "#/$defs/contentHash"
        }
      }
    },
    "generatedArtifactFile": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "path",
        "contents",
        "contentHash"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!/)(?!.*\\\\)(?!.*(?:^|/)\\.\\.?(?:/|$))[^/]+(?:/[^/]+)*$",
          "description": "Safe relative POSIX path within the generated artifact."
        },
        "contents": {
          "type": "string"
        },
        "encoding": {
          "type": "string",
          "const": "base64",
          "description": "Binary contents are base64; omitted for UTF-8 text. File contentHash hashes the serialized contents; payload file receipts hash the decoded bytes."
        },
        "contentHash": {
          "$ref": "#/$defs/contentHash"
        }
      }
    },
    "generatedDependency": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "version",
        "kind"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "pattern": "^(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$",
          "description": "Exact semantic version; ranges, workspace aliases, and repository paths are forbidden."
        },
        "kind": {
          "type": "string",
          "enum": [
            "dependency",
            "peerDependency"
          ]
        }
      }
    },
    "generatedArtifactAction": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "parameters",
        "sources"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[$_\\p{ID_Start}][$_\\u200c\\u200d\\p{ID_Continue}]*$",
          "description": "Consumer injection name shared by all compatible occurrences."
        },
        "parameters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/generatedArtifactActionParameter"
          },
          "description": "Cross-framework parameter contract in canonical semantic call order."
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/generatedArtifactActionSource"
          },
          "description": "Schema declaration sources; component sources are generated-tree events, while screen-root sources drive generated action controls. Deterministic node-event-component order."
        }
      }
    },
    "validationReceipt": {
      "type": "object",
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "profile": {
                "type": "string",
                "const": "release"
              }
            },
            "required": [
              "profile"
            ]
          },
          "then": {
            "required": [
              "evidenceVerification"
            ]
          }
        },
        {
          "$ref": "#/$defs/validationReceiptPartition"
        },
        {
          "$ref": "#/$defs/validationProfilePolicy"
        }
      ],
      "required": [
        "profile",
        "defaulted",
        "rationale",
        "axes",
        "checks",
        "notChecked",
        "evidence"
      ],
      "properties": {
        "evidenceVerification": {
          "type": "string",
          "const": "file-verified-not-re-executed",
          "description": "Release evidence references are format-checked and bound to the generated artifact hash, not independently re-executed."
        },
        "profile": {
          "type": "string",
          "enum": [
            "draft",
            "build",
            "release"
          ]
        },
        "defaulted": {
          "type": "boolean",
          "description": "True only when the caller omitted profile and the build default was applied."
        },
        "rationale": {
          "type": "string",
          "minLength": 1,
          "description": "Why this profile has the disclosed scope and enforcement policy."
        },
        "axes": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "scope",
            "enforcement",
            "fallback",
            "target"
          ],
          "properties": {
            "scope": {
              "type": "string",
              "enum": [
                "structural",
                "generated-artifact",
                "release-evidence"
              ]
            },
            "enforcement": {
              "type": "string",
              "enum": [
                "advisory",
                "blocking"
              ]
            },
            "fallback": {
              "type": "string",
              "enum": [
                "visible",
                "forbidden"
              ]
            },
            "target": {
              "$ref": "#/$defs/targetResolution"
            }
          }
        },
        "checks": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/validationCheck"
          },
          "description": "Checks actually attempted before the response returned."
        },
        "notChecked": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/validationCheck"
          },
          "description": "Profile checks not reached; an empty array means no profile check was silently skipped."
        },
        "evidence": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "required",
            "provided",
            "missing",
            "mismatched",
            "accepted",
            "notApplicable"
          ],
          "properties": {
            "required": {
              "$ref": "#/$defs/evidenceClassList"
            },
            "provided": {
              "$ref": "#/$defs/evidenceClassList"
            },
            "missing": {
              "$ref": "#/$defs/evidenceClassList"
            },
            "mismatched": {
              "$ref": "#/$defs/evidenceClassList"
            },
            "accepted": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/acceptedReleaseEvidence"
              },
              "description": "Caller-supplied release-evidence envelopes accepted for evaluation in canonical class order; references are retained for auditability, not claimed as independently executed."
            },
            "notApplicable": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "class",
                  "rationale"
                ],
                "properties": {
                  "class": {
                    "$ref": "#/$defs/evidenceClass"
                  },
                  "rationale": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            },
            "artifactContentHash": {
              "$ref": "#/$defs/contentHash"
            }
          }
        }
      }
    },
    "targetResolution": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "resolved",
        "source"
      ],
      "properties": {
        "requested": {
          "type": "string",
          "enum": [
            "react",
            "vue",
            "html"
          ]
        },
        "resolved": {
          "type": "string",
          "enum": [
            "react",
            "vue",
            "html"
          ]
        },
        "source": {
          "type": "string",
          "enum": [
            "explicit",
            "options-alias",
            "oodsrc",
            "default"
          ]
        }
      }
    },
    "validationCheck": {
      "type": "string",
      "enum": [
        "schema-structure",
        "component-registry",
        "state-contract",
        "binding-contract",
        "props-contract",
        "slots-contract",
        "events-contract",
        "target-readiness",
        "normalization-fidelity",
        "dependency-closure",
        "fallback-policy",
        "rendered-evidence",
        "interaction-evidence",
        "accessibility-evidence",
        "theme-evidence",
        "determinism-evidence",
        "performance-evidence",
        "certification-evidence"
      ]
    },
    "validationReceiptPartition": {
      "type": "object",
      "allOf": [
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "schema-structure"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "schema-structure"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "component-registry"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "component-registry"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "state-contract"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "state-contract"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "target-readiness"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "target-readiness"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "normalization-fidelity"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "normalization-fidelity"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "binding-contract"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "binding-contract"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "props-contract"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "props-contract"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "slots-contract"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "slots-contract"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "events-contract"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "events-contract"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "dependency-closure"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "dependency-closure"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "fallback-policy"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "fallback-policy"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "rendered-evidence"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "rendered-evidence"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "interaction-evidence"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "interaction-evidence"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "accessibility-evidence"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "accessibility-evidence"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "theme-evidence"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "theme-evidence"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "determinism-evidence"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "determinism-evidence"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "performance-evidence"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "performance-evidence"
                  }
                }
              }
            }
          ]
        },
        {
          "oneOf": [
            {
              "properties": {
                "checks": {
                  "contains": {
                    "type": "string",
                    "const": "certification-evidence"
                  }
                }
              }
            },
            {
              "properties": {
                "notChecked": {
                  "contains": {
                    "type": "string",
                    "const": "certification-evidence"
                  }
                }
              }
            }
          ]
        }
      ]
    },
    "validationProfilePolicy": {
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "profile": {
                "type": "string",
                "const": "draft"
              }
            },
            "required": [
              "profile"
            ]
          },
          "then": {
            "properties": {
              "rationale": {
                "type": "string",
                "const": "Draft reports target and fallback gaps without claiming a runnable artifact."
              },
              "axes": {
                "properties": {
                  "scope": {
                    "type": "string",
                    "const": "structural"
                  },
                  "enforcement": {
                    "type": "string",
                    "const": "advisory"
                  },
                  "fallback": {
                    "type": "string",
                    "const": "visible"
                  }
                }
              },
              "evidence": {
                "properties": {
                  "required": {
                    "type": "array",
                    "const": []
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "profile": {
                "type": "string",
                "const": "build"
              }
            },
            "required": [
              "profile"
            ]
          },
          "then": {
            "properties": {
              "rationale": {
                "type": "string",
                "const": "Build is the default blocking gate: target, bindings, dependencies and fallbacks must resolve under static checks; the static gate does not install or run the generated application."
              },
              "axes": {
                "properties": {
                  "scope": {
                    "type": "string",
                    "const": "generated-artifact"
                  },
                  "enforcement": {
                    "type": "string",
                    "const": "blocking"
                  },
                  "fallback": {
                    "type": "string",
                    "const": "forbidden"
                  }
                }
              },
              "evidence": {
                "properties": {
                  "required": {
                    "type": "array",
                    "const": []
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "profile": {
                "type": "string",
                "const": "release"
              }
            },
            "required": [
              "profile"
            ]
          },
          "then": {
            "properties": {
              "rationale": {
                "type": "string",
                "const": "Release adds six local JSON evidence files with verified byte hashes, passed status and artifact binding to the build gate, and records server-owned certification as not applicable for generated UI targets."
              },
              "axes": {
                "properties": {
                  "scope": {
                    "type": "string",
                    "const": "release-evidence"
                  },
                  "enforcement": {
                    "type": "string",
                    "const": "blocking"
                  },
                  "fallback": {
                    "type": "string",
                    "const": "forbidden"
                  }
                }
              },
              "evidence": {
                "properties": {
                  "required": {
                    "type": "array",
                    "const": [
                      "rendered",
                      "interaction",
                      "accessibility",
                      "theme",
                      "determinism",
                      "performance"
                    ]
                  }
                }
              }
            }
          }
        }
      ]
    },
    "buildChecksCompleted": {
      "type": "object",
      "properties": {
        "checks": {
          "allOf": [
            {
              "contains": {
                "type": "string",
                "const": "schema-structure"
              }
            },
            {
              "contains": {
                "type": "string",
                "const": "component-registry"
              }
            },
            {
              "contains": {
                "type": "string",
                "const": "state-contract"
              }
            },
            {
              "contains": {
                "type": "string",
                "const": "target-readiness"
              }
            },
            {
              "contains": {
                "type": "string",
                "const": "normalization-fidelity"
              }
            },
            {
              "contains": {
                "type": "string",
                "const": "binding-contract"
              }
            },
            {
              "contains": {
                "type": "string",
                "const": "props-contract"
              }
            },
            {
              "contains": {
                "type": "string",
                "const": "slots-contract"
              }
            },
            {
              "contains": {
                "type": "string",
                "const": "events-contract"
              }
            },
            {
              "contains": {
                "type": "string",
                "const": "dependency-closure"
              }
            }
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "axes": {
                "properties": {
                  "target": {
                    "properties": {
                      "resolved": {
                        "type": "string",
                        "const": "html"
                      }
                    }
                  }
                }
              }
            }
          },
          "then": {
            "properties": {
              "checks": {
                "contains": {
                  "type": "string",
                  "const": "fallback-policy"
                }
              }
            }
          }
        }
      ]
    },
    "releaseSuccessReceipt": {
      "type": "object",
      "allOf": [
        {
          "properties": {
            "checks": {
              "allOf": [
                {
                  "contains": {
                    "type": "string",
                    "const": "rendered-evidence"
                  }
                },
                {
                  "contains": {
                    "type": "string",
                    "const": "interaction-evidence"
                  }
                },
                {
                  "contains": {
                    "type": "string",
                    "const": "accessibility-evidence"
                  }
                },
                {
                  "contains": {
                    "type": "string",
                    "const": "theme-evidence"
                  }
                },
                {
                  "contains": {
                    "type": "string",
                    "const": "determinism-evidence"
                  }
                },
                {
                  "contains": {
                    "type": "string",
                    "const": "performance-evidence"
                  }
                },
                {
                  "contains": {
                    "type": "string",
                    "const": "certification-evidence"
                  }
                }
              ]
            },
            "evidence": {
              "properties": {
                "provided": {
                  "type": "array",
                  "const": [
                    "rendered",
                    "interaction",
                    "accessibility",
                    "theme",
                    "determinism",
                    "performance"
                  ]
                },
                "missing": {
                  "type": "array",
                  "const": []
                },
                "mismatched": {
                  "type": "array",
                  "const": []
                },
                "accepted": {
                  "minItems": 6,
                  "maxItems": 6,
                  "prefixItems": [
                    {
                      "properties": {
                        "class": {
                          "type": "string",
                          "const": "rendered"
                        }
                      }
                    },
                    {
                      "properties": {
                        "class": {
                          "type": "string",
                          "const": "interaction"
                        }
                      }
                    },
                    {
                      "properties": {
                        "class": {
                          "type": "string",
                          "const": "accessibility"
                        }
                      }
                    },
                    {
                      "properties": {
                        "class": {
                          "type": "string",
                          "const": "theme"
                        }
                      }
                    },
                    {
                      "properties": {
                        "class": {
                          "type": "string",
                          "const": "determinism"
                        }
                      }
                    },
                    {
                      "properties": {
                        "class": {
                          "type": "string",
                          "const": "performance"
                        }
                      }
                    }
                  ]
                },
                "notApplicable": {
                  "contains": {
                    "properties": {
                      "class": {
                        "type": "string",
                        "const": "certification"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      ]
    },
    "evidenceClass": {
      "type": "string",
      "enum": [
        "rendered",
        "interaction",
        "accessibility",
        "theme",
        "determinism",
        "performance",
        "certification"
      ]
    },
    "evidenceClassList": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/evidenceClass"
      }
    },
    "acceptedReleaseEvidence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "class",
        "status",
        "artifactContentHash",
        "reference",
        "contentHash"
      ],
      "properties": {
        "class": {
          "type": "string",
          "enum": [
            "rendered",
            "interaction",
            "accessibility",
            "theme",
            "determinism",
            "performance"
          ]
        },
        "status": {
          "type": "string",
          "const": "passed"
        },
        "artifactContentHash": {
          "$ref": "#/$defs/contentHash"
        },
        "reference": {
          "type": "string",
          "minLength": 1,
          "description": "Local JSON evidence file, absolute or relative to the server working directory. Opened during release validation."
        },
        "contentHash": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$",
          "description": "SHA-256 of the local JSON evidence file bytes. The file must contain status: passed and this artifactContentHash."
        }
      }
    },
    "generatedArtifactActionParameter": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "minLength": 1,
          "description": "Portable TypeScript-style parameter type shared across framework targets."
        }
      }
    },
    "generatedArtifactActionSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "nodeId",
        "component",
        "event"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "component": {
          "type": "string",
          "minLength": 1
        },
        "event": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "contentHash": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "codegenIssue": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "nodeId": {
          "type": "string"
        },
        "component": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  }
}
