{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hogarmas.net/article-50-portfolio/schema.json",
  "title": "H/M Article 50 Portfolio Snapshot",
  "description": "Descriptive Article 50 obligation and evidence matrix for a supplied AI-system inventory. It is not a compliance score or certification.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "ruleset",
    "sourceRuleset",
    "verifiedOn",
    "applicableFrom",
    "article50_2TransitionDate",
    "language",
    "portfolioName",
    "systems",
    "summary",
    "obligationMatrix",
    "evidenceMatrix",
    "privacy",
    "limitations",
    "sources"
  ],
  "properties": {
    "schema": {
      "const": "hm.article50-portfolio.v1"
    },
    "ruleset": {
      "const": "2026-07-29.1"
    },
    "sourceRuleset": {
      "type": "string",
      "maxLength": 40
    },
    "verifiedOn": {
      "const": "2026-07-29"
    },
    "applicableFrom": {
      "const": "2026-08-02"
    },
    "article50_2TransitionDate": {
      "const": "2026-12-02"
    },
    "language": {
      "type": "string",
      "enum": [
        "en",
        "es",
        "zh"
      ]
    },
    "portfolioName": {
      "type": "string",
      "maxLength": 120
    },
    "systems": {
      "type": "array",
      "minItems": 1,
      "maxItems": 250,
      "items": {
        "$ref": "#/$defs/system"
      }
    },
    "summary": {
      "$ref": "#/$defs/summary"
    },
    "obligationMatrix": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "$ref": "#/$defs/obligationAggregate"
      }
    },
    "evidenceMatrix": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "$ref": "#/$defs/evidenceAggregate"
      }
    },
    "privacy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "inputsUploadedByBuilder",
        "browserStorageUsed",
        "rawInputIncludedInMetrics",
        "rawQuestionnaireIncludedInSnapshot",
        "systemNamesIncludedInSnapshot",
        "ownerNamesIncludedInSnapshot"
      ],
      "properties": {
        "inputsUploadedByBuilder": {
          "const": false
        },
        "browserStorageUsed": {
          "const": false
        },
        "rawInputIncludedInMetrics": {
          "const": false
        },
        "rawQuestionnaireIncludedInSnapshot": {
          "const": false
        },
        "systemNamesIncludedInSnapshot": {
          "type": "boolean",
          "description": "True for direct/internal exports; false for privacy-minimized package snapshots."
        },
        "ownerNamesIncludedInSnapshot": {
          "type": "boolean",
          "description": "True for direct/internal exports; false for privacy-minimized package snapshots."
        }
      }
    },
    "limitations": {
      "$ref": "#/$defs/limitations"
    },
    "sources": {
      "type": "object"
    }
  },
  "$defs": {
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "system": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "systemId",
        "systemName",
        "owner",
        "tags",
        "lane",
        "implementationDate",
        "summary",
        "obligations",
        "evidence",
        "disclosures"
      ],
      "properties": {
        "systemId": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$"
        },
        "systemName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "owner": {
          "type": "string",
          "maxLength": 120
        },
        "tags": {
          "type": "array",
          "maxItems": 8,
          "items": {
            "type": "string",
            "maxLength": 40
          }
        },
        "lane": {
          "type": "string",
          "enum": [
            "implement",
            "verify",
            "review",
            "monitor"
          ]
        },
        "implementationDate": {
          "type": "string",
          "enum": [
            "",
            "2026-08-02",
            "2026-12-02-review"
          ]
        },
        "summary": {
          "$ref": "#/$defs/systemSummary"
        },
        "obligations": {
          "type": "array",
          "minItems": 6,
          "maxItems": 6,
          "items": {
            "$ref": "#/$defs/obligation"
          }
        },
        "evidence": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/evidence"
          }
        },
        "disclosures": {
          "type": "array",
          "maxItems": 12,
          "items": {
            "$ref": "#/$defs/disclosure"
          }
        }
      }
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "systems",
        "systemsWithLikelyDuties",
        "systemsNeedingScopeReview",
        "systemsWithMissingEvidence",
        "missingEvidenceItems",
        "disclosureDrafts",
        "lanes"
      ],
      "properties": {
        "systems": {
          "$ref": "#/$defs/count"
        },
        "systemsWithLikelyDuties": {
          "$ref": "#/$defs/count"
        },
        "systemsNeedingScopeReview": {
          "$ref": "#/$defs/count"
        },
        "systemsWithMissingEvidence": {
          "$ref": "#/$defs/count"
        },
        "missingEvidenceItems": {
          "$ref": "#/$defs/count"
        },
        "disclosureDrafts": {
          "$ref": "#/$defs/count"
        },
        "lanes": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "implement",
            "verify",
            "review",
            "monitor"
          ],
          "properties": {
            "implement": {
              "$ref": "#/$defs/count"
            },
            "verify": {
              "$ref": "#/$defs/count"
            },
            "review": {
              "$ref": "#/$defs/count"
            },
            "monitor": {
              "$ref": "#/$defs/count"
            }
          }
        }
      }
    },
    "systemSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "likelyTriggered",
        "reviewRequired",
        "notIndicated",
        "missingEvidence",
        "evidenceToReview",
        "disclosureDrafts"
      ],
      "properties": {
        "likelyTriggered": {
          "$ref": "#/$defs/count"
        },
        "reviewRequired": {
          "$ref": "#/$defs/count"
        },
        "notIndicated": {
          "$ref": "#/$defs/count"
        },
        "missingEvidence": {
          "$ref": "#/$defs/count"
        },
        "evidenceToReview": {
          "$ref": "#/$defs/count"
        },
        "disclosureDrafts": {
          "$ref": "#/$defs/count"
        }
      }
    },
    "obligation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "article",
        "actor",
        "status",
        "title",
        "reasonCode"
      ],
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 80
        },
        "article": {
          "type": "string",
          "maxLength": 40
        },
        "actor": {
          "type": "string",
          "maxLength": 40
        },
        "status": {
          "type": "string",
          "enum": [
            "likely-triggered",
            "review-required",
            "not-indicated"
          ]
        },
        "title": {
          "type": "string",
          "maxLength": 240
        },
        "reasonCode": {
          "type": "string",
          "maxLength": 120
        }
      }
    },
    "evidence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "status",
        "label",
        "requiredFor"
      ],
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 80
        },
        "status": {
          "type": "string",
          "enum": [
            "provided",
            "missing",
            "review"
          ]
        },
        "label": {
          "type": "string",
          "maxLength": 240
        },
        "requiredFor": {
          "type": "array",
          "maxItems": 12,
          "items": {
            "type": "string",
            "maxLength": 80
          }
        }
      }
    },
    "disclosure": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "article",
        "placement",
        "requiredness",
        "text"
      ],
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 80
        },
        "article": {
          "type": "string",
          "maxLength": 40
        },
        "placement": {
          "type": "string",
          "maxLength": 80
        },
        "requiredness": {
          "type": "string",
          "maxLength": 80
        },
        "text": {
          "type": "string",
          "maxLength": 1000
        }
      }
    },
    "obligationAggregate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "article",
        "actor",
        "likelyTriggered",
        "reviewRequired",
        "notIndicated"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "article": {
          "type": "string"
        },
        "actor": {
          "type": "string"
        },
        "likelyTriggered": {
          "$ref": "#/$defs/count"
        },
        "reviewRequired": {
          "$ref": "#/$defs/count"
        },
        "notIndicated": {
          "$ref": "#/$defs/count"
        }
      }
    },
    "evidenceAggregate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "label",
        "provided",
        "missing",
        "review"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "provided": {
          "$ref": "#/$defs/count"
        },
        "missing": {
          "$ref": "#/$defs/count"
        },
        "review": {
          "$ref": "#/$defs/count"
        }
      }
    },
    "limitations": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "legalAdviceProvided",
        "complianceCertified",
        "implementationVerified",
        "productionMarksDetected",
        "portfolioCompletenessVerified",
        "priorityScoreProduced",
        "deadlineEligibilityCertified"
      ],
      "properties": {
        "legalAdviceProvided": {
          "const": false
        },
        "complianceCertified": {
          "const": false
        },
        "implementationVerified": {
          "const": false
        },
        "productionMarksDetected": {
          "const": false
        },
        "portfolioCompletenessVerified": {
          "const": false
        },
        "priorityScoreProduced": {
          "const": false
        },
        "deadlineEligibilityCertified": {
          "const": false
        }
      }
    }
  }
}
