{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://workspai.dev/contracts/workspace-intelligence/agent-framework-admission-candidate.v2.json",
  "title": "Workspai Agent Framework Admission Candidate v2",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "protocolVersion",
    "generatedAt",
    "sourceCommit",
    "cliVersion",
    "reviewStatus",
    "adapters",
    "verdict",
    "blockers"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspai.agent-framework-admission-candidate.v2"
    },
    "protocolVersion": {
      "const": "workspai.agent-framework-adapter-protocol.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sourceCommit": {
      "type": "string",
      "pattern": "^[a-f0-9]{40}(?:[a-f0-9]{24})?$"
    },
    "cliVersion": {
      "type": "string",
      "minLength": 1
    },
    "reviewStatus": {
      "const": "pending"
    },
    "adapters": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "version",
          "manifestSha256",
          "implementationSha256ByPlatform",
          "framework",
          "lanes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$"
          },
          "version": {
            "type": "string",
            "minLength": 1
          },
          "manifestSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "implementationSha256ByPlatform": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "linux",
              "darwin",
              "win32"
            ],
            "properties": {
              "linux": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "darwin": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "win32": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          },
          "framework": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$"
              }
            }
          },
          "lanes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "platform",
                "runtime",
                "runtimeVersion",
                "frameworkVersion",
                "report",
                "evidence"
              ],
              "properties": {
                "platform": {
                  "enum": [
                    "linux",
                    "darwin",
                    "win32"
                  ]
                },
                "runtime": {
                  "type": "string",
                  "minLength": 1
                },
                "runtimeVersion": {
                  "type": "string",
                  "minLength": 1
                },
                "frameworkVersion": {
                  "type": "string",
                  "minLength": 1
                },
                "report": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "path",
                    "sha256"
                  ],
                  "properties": {
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "not": {
                        "anyOf": [
                          {
                            "pattern": "^/"
                          },
                          {
                            "pattern": "^[A-Za-z]:[\\/]"
                          },
                          {
                            "pattern": "(^|[\\/])\\.\\.([\\/]|$)"
                          }
                        ]
                      }
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    }
                  }
                },
                "evidence": {
                  "type": "array",
                  "minItems": 18,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "path",
                      "sha256"
                    ],
                    "properties": {
                      "path": {
                        "type": "string",
                        "minLength": 1,
                        "not": {
                          "anyOf": [
                            {
                              "pattern": "^/"
                            },
                            {
                              "pattern": "^[A-Za-z]:[\\/]"
                            },
                            {
                              "pattern": "(^|[\\/])\\.\\.([\\/]|$)"
                            }
                          ]
                        }
                      },
                      "sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "verdict": {
      "const": "admitted"
    },
    "blockers": {
      "type": "array",
      "maxItems": 0
    }
  }
}
