{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:mc-site-local:analysis-public-projection:3",
  "title": "Local analysis presentation projection (not an MC normative schema)",
  "description": "Presentation data contract for a curated local case. These wrapper fields, status labels and evidence locators are not MC normative definitions. Source support, provenance, implementation and test state remain separate; evidence integrity requires separate checks.",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/id"
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "subtitle": {
      "type": "string",
      "minLength": 1
    },
    "date": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
    },
    "revision": {
      "type": "string",
      "minLength": 1
    },
    "generatedDate": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
    },
    "summary": {
      "type": "string",
      "minLength": 1
    },
    "scopeNote": {
      "type": "string",
      "minLength": 1
    },
    "claims": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/claim"
      },
      "minItems": 1
    },
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/source"
      },
      "minItems": 1
    },
    "maneuvers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/maneuver"
      },
      "minItems": 1
    },
    "interventions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/intervention"
      },
      "minItems": 1
    },
    "challenges": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/challenge"
      },
      "minItems": 1
    },
    "versions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/version"
      },
      "minItems": 1
    },
    "story": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5,
      "prefixItems": [
        {
          "allOf": [
            {
              "$ref": "#/$defs/storyFrame"
            },
            {
              "properties": {
                "phase": {
                  "const": "source"
                }
              }
            }
          ]
        },
        {
          "allOf": [
            {
              "$ref": "#/$defs/storyFrame"
            },
            {
              "properties": {
                "phase": {
                  "const": "evidence"
                }
              }
            }
          ]
        },
        {
          "allOf": [
            {
              "$ref": "#/$defs/storyFrame"
            },
            {
              "properties": {
                "phase": {
                  "const": "behavior"
                }
              }
            }
          ]
        },
        {
          "allOf": [
            {
              "$ref": "#/$defs/storyFrame"
            },
            {
              "properties": {
                "phase": {
                  "const": "model"
                }
              }
            }
          ]
        },
        {
          "allOf": [
            {
              "$ref": "#/$defs/storyFrame"
            },
            {
              "properties": {
                "phase": {
                  "const": "action"
                }
              }
            }
          ]
        }
      ],
      "items": false
    },
    "formalNote": {
      "type": "string",
      "minLength": 1
    },
    "statusContract": {
      "$ref": "#/$defs/statusContract"
    },
    "validation": {
      "$ref": "#/$defs/validation"
    },
    "sourceSummary": {
      "$ref": "#/$defs/sourceSummary"
    },
    "model": {
      "$ref": "#/$defs/model"
    },
    "researchContext": {
      "$ref": "#/$defs/researchContext"
    },
    "assumptions": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "minItems": 1
    },
    "limitations": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "minItems": 1
    },
    "declaredScope": {
      "type": "object",
      "description": "Named wider archive scope, retained separately from the curated local case scope. Values are transcribed from the exact completeness declaration.",
      "properties": {
        "closedOver": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "notClosedOver": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "unassertedWithinScope": {
          "const": "absent"
        },
        "unassertedOutsideScope": {
          "const": "unmodeled"
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        }
      },
      "required": [
        "closedOver",
        "notClosedOver",
        "unassertedWithinScope",
        "unassertedOutsideScope",
        "evidenceRefs"
      ],
      "additionalProperties": false
    },
    "provenanceCorrection": {
      "$ref": "#/$defs/provenanceCorrection"
    }
  },
  "required": [
    "id",
    "title",
    "subtitle",
    "date",
    "revision",
    "generatedDate",
    "summary",
    "scopeNote",
    "claims",
    "sources",
    "maneuvers",
    "interventions",
    "challenges",
    "versions",
    "story",
    "formalNote",
    "statusContract",
    "validation",
    "sourceSummary",
    "model",
    "researchContext",
    "assumptions",
    "limitations"
  ],
  "additionalProperties": false,
  "$defs": {
    "id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
    },
    "claimSupport": {
      "type": "string",
      "enum": [
        "supported",
        "inferred",
        "unknown"
      ]
    },
    "provenanceKind": {
      "type": "string",
      "enum": [
        "asserted",
        "derived",
        "measured"
      ]
    },
    "detectionValidation": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "not-applicable",
            "not-assessed",
            "never-tested",
            "validated",
            "failed"
          ]
        },
        "scope": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "status",
        "scope"
      ],
      "additionalProperties": false,
      "description": "Local presentation/test-state wrapper. This schema does not establish an MC normative enum or evidence of a successful detector."
    },
    "source": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^S[0-9]{2}$"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "url": {
          "type": "string",
          "pattern": "^https://[^ ]+$"
        },
        "kind": {
          "type": "string",
          "enum": [
            "secondary-report",
            "primary-registry",
            "repository-description"
          ]
        },
        "retrieval": {
          "type": "string",
          "minLength": 1
        },
        "statusNote": {
          "type": "string",
          "minLength": 1
        },
        "archivalTitle": {
          "type": "boolean",
          "description": "False when an explicitly labelled editorial display correction replaces a malformed archived title."
        },
        "archiveReferenceId": {
          "type": "integer",
          "minimum": 1
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "originalTitle": {
          "type": "string",
          "minLength": 1
        },
        "displayTitleNote": {
          "type": "string",
          "minLength": 1
        },
        "titleCorrection": {
          "type": "object",
          "properties": {
            "basis": {
              "type": "string",
              "minLength": 1
            },
            "externalVerification": {
              "const": "not-performed"
            }
          },
          "required": [
            "basis",
            "externalVerification"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "title",
        "url",
        "kind",
        "retrieval",
        "statusNote",
        "archivalTitle",
        "archiveReferenceId",
        "evidenceRefs"
      ],
      "additionalProperties": false,
      "description": "Exact archived registry text and access labels, not fresh external retrieval. Archival titles may preserve historical named identifiers."
    },
    "claim": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/id"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "$ref": "#/$defs/claimSupport"
        },
        "sourceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
          },
          "minItems": 0,
          "uniqueItems": true
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "provenanceKind": {
          "$ref": "#/$defs/provenanceKind"
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "detectionValidation": {
          "$ref": "#/$defs/detectionValidation"
        },
        "disputeStatus": {
          "type": "string",
          "minLength": 1
        },
        "maneuverIds": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/id"
          },
          "uniqueItems": true
        },
        "outsideCuratedSelection": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "title",
        "text",
        "status",
        "sourceIds",
        "evidenceRefs",
        "provenanceKind",
        "limitations",
        "detectionValidation",
        "disputeStatus"
      ],
      "additionalProperties": false,
      "description": "Support status, source provenance, dispute and detection validation are independent dimensions. No single score combines them."
    },
    "formalTriple": {
      "type": "object",
      "properties": {
        "preconditions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "mechanism": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "postconditions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        }
      },
      "required": [
        "preconditions",
        "mechanism",
        "postconditions"
      ],
      "additionalProperties": false
    },
    "variation": {
      "type": "object",
      "properties": {
        "againstCore": {
          "$ref": "#/$defs/id"
        },
        "stateVariable": {
          "type": "string",
          "minLength": 1
        },
        "stillRequiredByRecord": {
          "const": true
        },
        "note": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "againstCore",
        "stateVariable",
        "stillRequiredByRecord",
        "note"
      ],
      "additionalProperties": false
    },
    "maneuver": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/id"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "plain": {
          "type": "string",
          "minLength": 1
        },
        "preconditions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "mechanism": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "postconditions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "variant": {
          "type": "string",
          "minLength": 1
        },
        "sourceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
          },
          "minItems": 0,
          "uniqueItems": true
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "provenanceKind": {
          "$ref": "#/$defs/provenanceKind"
        },
        "requirementBasis": {
          "type": "string",
          "minLength": 1
        },
        "formal": {
          "$ref": "#/$defs/formalTriple"
        },
        "variation": {
          "$ref": "#/$defs/variation"
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "provenanceCorrection": {
          "$ref": "#/$defs/provenanceCorrection"
        }
      },
      "required": [
        "id",
        "title",
        "plain",
        "preconditions",
        "mechanism",
        "postconditions",
        "variant",
        "sourceIds",
        "evidenceRefs",
        "provenanceKind",
        "requirementBasis",
        "formal",
        "variation",
        "limitations"
      ],
      "additionalProperties": false,
      "description": "A curated record projection. Required variation stays required beyond its core; raw archived formal text remains separately preserved."
    },
    "intervention": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/id"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "principle": {
          "type": "string",
          "minLength": 1
        },
        "capability": {
          "type": "string",
          "minLength": 1
        },
        "implementation": {
          "type": "string",
          "minLength": 1
        },
        "limits": {
          "type": "string",
          "minLength": 1
        },
        "claimIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
          },
          "minItems": 0,
          "uniqueItems": true
        },
        "maneuverIds": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/id"
          },
          "uniqueItems": true
        },
        "sourceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
          },
          "minItems": 0,
          "uniqueItems": true
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "realizationStatus": {
          "type": "string",
          "enum": [
            "intended",
            "implemented",
            "verified"
          ]
        },
        "detectionValidation": {
          "$ref": "#/$defs/detectionValidation"
        },
        "outsideCuratedSelection": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "title",
        "principle",
        "capability",
        "implementation",
        "limits",
        "claimIds",
        "maneuverIds",
        "sourceIds",
        "evidenceRefs",
        "realizationStatus",
        "detectionValidation"
      ],
      "additionalProperties": false
    },
    "challenge": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/id"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "consequence": {
          "type": "string",
          "minLength": 1
        },
        "claimIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
          },
          "minItems": 0,
          "uniqueItems": true
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "maneuverIds": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/id"
          },
          "uniqueItems": true
        },
        "outsideCuratedSelection": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "title",
        "text",
        "consequence",
        "claimIds",
        "evidenceRefs"
      ],
      "additionalProperties": false
    },
    "version": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string",
          "minLength": 1
        },
        "value": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "label",
        "value",
        "status"
      ],
      "additionalProperties": false
    },
    "storyFrame": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/id"
        },
        "phase": {
          "type": "string",
          "enum": [
            "source",
            "evidence",
            "behavior",
            "model",
            "action"
          ]
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "caption": {
          "type": "string",
          "minLength": 1
        },
        "claimIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
          },
          "minItems": 0,
          "uniqueItems": true
        },
        "sourceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
          },
          "minItems": 0,
          "uniqueItems": true
        },
        "objectIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
          },
          "minItems": 0,
          "uniqueItems": true
        }
      },
      "required": [
        "id",
        "phase",
        "title",
        "text",
        "caption",
        "claimIds",
        "sourceIds",
        "objectIds"
      ],
      "additionalProperties": false
    },
    "statusContract": {
      "type": "object",
      "properties": {
        "authority": {
          "type": "string",
          "minLength": 1
        },
        "claimSupport": {
          "type": "object",
          "properties": {
            "supported": {
              "type": "string",
              "minLength": 1
            },
            "inferred": {
              "type": "string",
              "minLength": 1
            },
            "unknown": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "supported",
            "inferred",
            "unknown"
          ],
          "additionalProperties": false
        },
        "provenance": {
          "type": "string",
          "minLength": 1
        },
        "detection": {
          "type": "string",
          "minLength": 1
        },
        "realization": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "authority",
        "claimSupport",
        "provenance",
        "detection",
        "realization"
      ],
      "additionalProperties": false
    },
    "validation": {
      "type": "object",
      "properties": {
        "requirements": {
          "type": "string",
          "minLength": 1
        },
        "provenanceKind": {
          "$ref": "#/$defs/provenanceKind"
        },
        "measuredElements": {
          "type": "integer",
          "minimum": 0
        },
        "perturbationRuns": {
          "type": "integer",
          "minimum": 0
        },
        "detectionValidation": {
          "$ref": "#/$defs/detectionValidation"
        },
        "deployedPosture": {
          "type": "string",
          "minLength": 1
        },
        "graphReachabilityClaim": {
          "type": "string",
          "enum": [
            "forbidden",
            "not-assessed"
          ]
        },
        "historicalTests": {
          "type": "string",
          "minLength": 1
        },
        "localChecks": {
          "type": "string",
          "minLength": 1
        },
        "ratificationCheck": {
          "const": "not-run"
        },
        "ratificationNote": {
          "type": "string",
          "minLength": 1
        },
        "derivedOutputsProvenance": {
          "const": "derived"
        }
      },
      "required": [
        "requirements",
        "provenanceKind",
        "measuredElements",
        "perturbationRuns",
        "detectionValidation",
        "deployedPosture",
        "graphReachabilityClaim",
        "historicalTests",
        "localChecks"
      ],
      "additionalProperties": false
    },
    "sourceSummary": {
      "type": "object",
      "properties": {
        "registryEntries": {
          "type": "integer",
          "minimum": 0
        },
        "uniqueUrls": {
          "type": "integer",
          "minimum": 0
        },
        "uniqueHosts": {
          "type": "integer",
          "minimum": 0
        },
        "archivedRetrievalCounts": {
          "type": "object",
          "properties": {
            "full-text": {
              "type": "integer",
              "minimum": 0
            },
            "search-excerpt": {
              "type": "integer",
              "minimum": 0
            },
            "repository-description": {
              "type": "integer",
              "minimum": 0
            },
            "not-retrieved": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "full-text",
            "search-excerpt",
            "repository-description",
            "not-retrieved"
          ],
          "additionalProperties": false
        },
        "fullTextMaterialsIncluded": {
          "type": "integer",
          "minimum": 0
        },
        "independenceNote": {
          "type": "string",
          "minLength": 1
        },
        "freshExternalRetrievals": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "registryEntries",
        "uniqueUrls",
        "uniqueHosts",
        "archivedRetrievalCounts",
        "fullTextMaterialsIncluded",
        "independenceNote",
        "freshExternalRetrievals"
      ],
      "additionalProperties": false
    },
    "model": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/id"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "identityStatus": {
          "type": "string",
          "enum": [
            "provisional",
            "established"
          ]
        },
        "provenanceKind": {
          "$ref": "#/$defs/provenanceKind"
        },
        "observedMembers": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*$"
          },
          "minItems": 0,
          "uniqueItems": true
        },
        "support": {
          "type": "integer",
          "minimum": 0
        },
        "belowSupportFloor": {
          "type": "boolean"
        },
        "membershipNote": {
          "type": "string",
          "minLength": 1
        },
        "preconditions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "mechanism": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "postconditions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "plainPreconditions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "plainMechanism": {
          "type": "string",
          "minLength": 1
        },
        "transferRule": {
          "type": "string",
          "minLength": 1
        },
        "responseTransfer": {
          "type": "string",
          "minLength": 1
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "scopeNote": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "id",
        "title",
        "identityStatus",
        "provenanceKind",
        "observedMembers",
        "support",
        "belowSupportFloor",
        "membershipNote",
        "preconditions",
        "mechanism",
        "postconditions",
        "plainPreconditions",
        "plainMechanism",
        "transferRule",
        "responseTransfer",
        "evidenceRefs"
      ],
      "additionalProperties": false
    },
    "researchContext": {
      "type": "object",
      "properties": {
        "scope": {
          "type": "string",
          "minLength": 1
        },
        "C3Support": {
          "type": "integer",
          "minimum": 0
        },
        "C3BelowSupportFloor": {
          "type": "boolean"
        },
        "residualTest": {
          "type": "string",
          "minLength": 1
        },
        "consequenceIfIncidental": {
          "type": "string",
          "minLength": 1
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        }
      },
      "required": [
        "scope",
        "C3Support",
        "C3BelowSupportFloor",
        "residualTest",
        "consequenceIfIncidental",
        "evidenceRefs"
      ],
      "additionalProperties": false
    },
    "provenanceCorrection": {
      "type": "object",
      "properties": {
        "originalKind": {
          "type": "string",
          "minLength": 1
        },
        "correctedKind": {
          "type": "string",
          "minLength": 1
        },
        "basis": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "type": "string",
          "minLength": 1
        },
        "executionNote": {
          "type": "string",
          "minLength": 1
        },
        "modelArtifact": {
          "type": "string",
          "minLength": 1
        },
        "changesArtifact": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "originalKind",
        "correctedKind",
        "basis",
        "scope",
        "executionNote",
        "modelArtifact",
        "changesArtifact"
      ],
      "additionalProperties": false
    }
  }
}
