{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hsimc.tech/continue-nodes/continuation/graph.schema.json",
  "title": "HSIMC Reality Continuation Graph / compute only",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "id",
    "intent",
    "goal_id",
    "nodes",
    "edges"
  ],
  "properties": {
    "schema": {
      "const": "HSIMC_RCG_1"
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "intent": {
      "type": "string",
      "minLength": 1,
      "maxLength": 3000
    },
    "goal_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "nodes": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "kind",
          "domain",
          "relation",
          "state"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$",
            "maxLength": 120
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 250
          },
          "kind": {
            "enum": [
              "REALITY",
              "CONDITION",
              "WORK",
              "OUTCOME"
            ]
          },
          "domain": {
            "type": "integer",
            "minimum": 1,
            "maximum": 14
          },
          "relation": {
            "enum": [
              "OWNED",
              "SUBSCRIBED",
              "PURCHASED",
              "BOOKED",
              "PLANNED",
              "REFERENCE",
              "BORROWED"
            ]
          },
          "state": {
            "enum": [
              "OBSERVED",
              "CLAIMED",
              "UNKNOWN",
              "MISSING",
              "CANDIDATE"
            ]
          },
          "requires": {
            "enum": [
              "ALL",
              "ANY"
            ]
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cost": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "evidence_ref": {
            "type": "string",
            "maxLength": 1000
          },
          "reality_ref": {
            "type": "string",
            "maxLength": 1000
          },
          "source_id": {
            "type": "string",
            "maxLength": 1000
          },
          "note": {
            "type": "string",
            "maxLength": 1200
          }
        }
      }
    },
    "edges": {
      "type": "array",
      "maxItems": 30000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "type"
        ],
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "type": {
            "enum": [
              "REQUIRES",
              "HANDOFF_TO",
              "PRODUCES",
              "COMPATIBLE_WITH"
            ]
          }
        }
      }
    },
    "budget": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "limit",
        "currency"
      ],
      "properties": {
        "limit": {
          "type": "number",
          "minimum": 0
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        }
      }
    },
    "candidate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title",
        "brief",
        "origin"
      ],
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 250
        },
        "brief": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000
        },
        "origin": {
          "enum": [
            "HUMAN",
            "GENAI_DRAFT",
            "ILLUSTRATIVE_GENAI_DRAFT"
          ]
        }
      }
    }
  },
  "description": "Public source identity is not user entitlement. Observed input is not independent verification. Never include credentials, booking secrets or payment data. Graph references a bounded goal. No execution permission is accepted as an import field."
}
