{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://philgear.dev/standards/duty-of-care-schema.json",
  "title": "DigitalDutyOfCareAttestation",
  "description": "Open Statutory Safety by Design (SbD), Cognitive Hospitality, and STRIDE-H Compliance Attestation Schema (v1.0.0)",
  "type": "object",
  "required": [
    "schemaVersion",
    "systemName",
    "targetAudience",
    "evaluatedAt",
    "score",
    "grade",
    "passedStatutoryFloor",
    "controls",
    "strideHMatrix"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0.0"
    },
    "systemName": {
      "type": "string",
      "description": "Name of the application, user flow, or AI system being audited."
    },
    "targetAudience": {
      "type": "string",
      "enum": ["general", "youth-inclusive", "clinical-high-acuity", "older-adults-neurodiverse"]
    },
    "evaluatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "score": {
      "type": "number",
      "minimum": 0,
      "maximum": 100
    },
    "grade": {
      "type": "string",
      "enum": ["A+", "A", "B", "C", "F"]
    },
    "passedStatutoryFloor": {
      "type": "boolean",
      "description": "True only if zero critical statutory dark-pattern or youth/clinical safety violations exist."
    },
    "controls": {
      "type": "object",
      "properties": {
        "isPrivateByDefault": { "type": "boolean" },
        "locationSharingByDefault": { "type": "boolean" },
        "quarantineStrangerDms": { "type": "boolean" },
        "allowCrossSiteTrackingByDefault": { "type": "boolean" },
        "hasReverseChronologicalToggle": { "type": "boolean" },
        "infiniteScrollEnabled": { "type": "boolean" },
        "hasAddictiveStreakMechanic": { "type": "boolean" },
        "quietHoursEnabledByDefault": { "type": "boolean" },
        "preCheckedConsentBoxes": { "type": "boolean" },
        "usesConfirmshaming": { "type": "boolean" },
        "usesArtificialUrgencyTimers": { "type": "boolean" },
        "symmetricCancellationParity": { "type": "boolean" },
        "fourSlotWorkingMemoryCeiling": { "type": "boolean" },
        "wcagAAAHighContrast": { "type": "boolean" },
        "antiSycophancyGuardrails": { "type": "boolean" }
      }
    },
    "strideHMatrix": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["code", "vector", "status", "mitigation"],
        "properties": {
          "code": { "type": "string", "enum": ["S", "T", "R", "I", "D", "E"] },
          "vector": { "type": "string" },
          "status": { "type": "string", "enum": ["MITIGATED", "AT_RISK", "CRITICAL_HAZARD"] },
          "mitigation": { "type": "string" }
        }
      }
    }
  }
}
