{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.cordova2028.com/policy-data/federal-public-authority/portal-data-model.schema.json",
  "title": "Federal Public Authority Transparency Portal: public data model",
  "description": "Discussion-draft data model for the portal described in Part X of the Federal Public Authority, Privatization Transparency, and Accountability Initiative (Cordova 2028, November 18, 2026). Public records only. No personal information, classified information, FOIA-exempt information, or individual beneficial-owner data is permitted in any field.",
  "type": "object",
  "properties": {
    "agencies": { "type": "array", "items": { "$ref": "#/$defs/agency" } },
    "functions": { "type": "array", "items": { "$ref": "#/$defs/function" } },
    "arrangements": { "type": "array", "items": { "$ref": "#/$defs/arrangement" } },
    "contractors": { "type": "array", "items": { "$ref": "#/$defs/contractor" } },
    "assessments": { "type": "array", "items": { "$ref": "#/$defs/dependencyAssessment" } },
    "findings": { "type": "array", "items": { "$ref": "#/$defs/finding" } },
    "correctiveActions": { "type": "array", "items": { "$ref": "#/$defs/correctiveAction" } },
    "comments": { "type": "array", "items": { "$ref": "#/$defs/comment" } }
  },
  "$defs": {
    "isoDate": { "type": "string", "format": "date" },
    "provenance": {
      "type": "object",
      "description": "Field-level source tracking returned with every record.",
      "required": ["sourceSystem", "retrievedAt", "sha256"],
      "properties": {
        "sourceSystem": { "type": "string", "enum": ["USAspending.gov", "SAM.gov", "AgencyInventory", "AgencyGeneralCounsel", "GAO", "InspectorGeneral", "SEC", "ContractorDisclosure", "Review"] },
        "sourceUrl": { "type": "string", "format": "uri" },
        "retrievedAt": { "type": "string", "format": "date-time" },
        "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
        "reviewer": { "type": "string", "description": "Role identifier of the reviewing office, never a personal name." }
      }
    },
    "agency": {
      "type": "object",
      "required": ["agencyCode", "name"],
      "properties": {
        "agencyCode": { "type": "string" },
        "name": { "type": "string" },
        "parentDepartment": { "type": "string" },
        "independentRegulatoryAgency": { "type": "boolean", "description": "Independent regulatory agencies participate by request only." }
      }
    },
    "function": {
      "type": "object",
      "required": ["functionId", "agencyCode", "description", "essential"],
      "properties": {
        "functionId": { "type": "string" },
        "agencyCode": { "type": "string" },
        "description": { "type": "string" },
        "essential": { "type": "boolean" },
        "functionType": { "type": "string", "enum": ["inherently-governmental", "closely-associated", "critical", "other-essential", "not-essential"] },
        "statutoryCitations": { "type": "array", "items": { "type": "string" } }
      }
    },
    "arrangement": {
      "type": "object",
      "required": ["arrangementId", "agencyCode", "classification", "reviewTrack"],
      "properties": {
        "arrangementId": { "type": "string" },
        "agencyCode": { "type": "string" },
        "awardId": { "type": "string", "description": "PIID, FAIN, or FAA AMS contract number." },
        "functionIds": { "type": "array", "items": { "type": "string" } },
        "classification": { "type": "string", "enum": ["C-1", "C-2", "C-3", "C-4", "C-5", "C-6", "C-7", "C-8", "C-9", "C-10"] },
        "reviewTrack": { "type": "integer", "enum": [1, 2, 3] },
        "totalValueUsd": { "type": "number", "minimum": 0 },
        "periodStart": { "$ref": "#/$defs/isoDate" },
        "periodEnd": { "$ref": "#/$defs/isoDate" },
        "singleSourceOrSingleAward": { "type": "boolean" },
        "authority": {
          "type": "object",
          "properties": {
            "statutes": { "type": "array", "items": { "type": "string" } },
            "appropriationAccounts": { "type": "array", "items": { "type": "string" } },
            "delegationInstrument": { "type": "string" },
            "legalReviewStatus": { "type": "string", "enum": ["not-required", "pending", "complete", "referred-to-olc"] },
            "legalOpinionUrl": { "type": "string", "format": "uri" }
          }
        },
        "controlProfile": {
          "type": "object",
          "properties": {
            "assetTitleHolder": { "type": "string", "enum": ["government", "contractor", "shared", "third-party", "unknown"] },
            "softwareOwner": { "type": "string", "enum": ["government", "contractor", "commercial-license", "open-source", "unknown"] },
            "dataRights": { "type": "string", "enum": ["unlimited", "government-purpose", "limited-or-restricted", "none", "unknown"] },
            "stepInRights": { "type": "boolean" },
            "sourceCodeEscrow": { "type": "boolean" },
            "personnelEmployer": { "type": "string", "enum": ["government", "contractor", "mixed"] },
            "finalDecisionAuthority": { "type": "string", "enum": ["federal-official", "contractor", "shared", "unclear"] }
          }
        },
        "materialControlChanges": {
          "type": "array",
          "items": { "type": "object", "properties": { "date": { "$ref": "#/$defs/isoDate" }, "description": { "type": "string" } } }
        },
        "provenance": { "type": "array", "items": { "$ref": "#/$defs/provenance" } }
      }
    },
    "contractor": {
      "type": "object",
      "required": ["uei", "legalName"],
      "properties": {
        "uei": { "type": "string", "description": "SAM.gov Unique Entity Identifier." },
        "legalName": { "type": "string" },
        "immediateOwnerUei": { "type": "string" },
        "highestLevelOwnerUei": { "type": "string" },
        "controllingEntityName": { "type": "string", "description": "Published at the controlling-entity level only." },
        "foreignControlFlag": { "type": "boolean", "description": "Public yes/no only; never mitigation terms." },
        "noteOnInterpretation": { "type": "string", "const": "Ownership, private equity sponsorship, and shared institutional investors are recorded for transparency and are not evidence of misconduct." }
      }
    },
    "dependencyAssessment": {
      "type": "object",
      "required": ["arrangementId", "scores", "assessedOn"],
      "properties": {
        "arrangementId": { "type": "string" },
        "scores": {
          "type": "object",
          "required": ["operationalDependence", "publicControl", "concentration", "security", "continuity", "legalCompliance"],
          "properties": {
            "operationalDependence": { "type": "integer", "minimum": 0, "maximum": 4 },
            "publicControl": { "type": "integer", "minimum": 0, "maximum": 4 },
            "concentration": { "type": "integer", "minimum": 0, "maximum": 4 },
            "security": { "type": "integer", "minimum": 0, "maximum": 4 },
            "continuity": { "type": "integer", "minimum": 0, "maximum": 4 },
            "legalCompliance": { "type": "integer", "minimum": 0, "maximum": 4 }
          }
        },
        "replacementPeriodDays": { "type": "integer", "minimum": 0 },
        "assessedOn": { "$ref": "#/$defs/isoDate" },
        "agencyResponseUrl": { "type": "string", "format": "uri" }
      }
    },
    "finding": {
      "type": "object",
      "required": ["findingId", "issuingBody", "reportNumber", "date"],
      "properties": {
        "findingId": { "type": "string" },
        "arrangementIds": { "type": "array", "items": { "type": "string" } },
        "issuingBody": { "type": "string" },
        "reportNumber": { "type": "string" },
        "date": { "$ref": "#/$defs/isoDate" },
        "summary": { "type": "string" },
        "url": { "type": "string", "format": "uri" }
      }
    },
    "correctiveAction": {
      "type": "object",
      "required": ["actionId", "arrangementId", "status"],
      "properties": {
        "actionId": { "type": "string" },
        "arrangementId": { "type": "string" },
        "description": { "type": "string" },
        "responsibleOffice": { "type": "string" },
        "dueDate": { "$ref": "#/$defs/isoDate" },
        "status": { "type": "string", "enum": ["planned", "in-progress", "complete", "deferred"] }
      }
    },
    "comment": {
      "type": "object",
      "required": ["commentId", "date", "text"],
      "properties": {
        "commentId": { "type": "string" },
        "arrangementId": { "type": "string" },
        "date": { "$ref": "#/$defs/isoDate" },
        "text": { "type": "string", "description": "Moderated to remove personal information. Never presented as a verified allegation." },
        "agencyResponse": { "type": "string" },
        "agencyResponseDate": { "$ref": "#/$defs/isoDate" }
      }
    }
  }
}
