{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://beyondrocketry.com/federation/research-artifact.schema.json",
  "title": "Propulsion Research Federation Research Artifact",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "artifact_id",
    "artifact_type",
    "producer",
    "created_at",
    "research_state",
    "inputs",
    "method_summary",
    "uncertainty",
    "provenance"
  ],
  "properties": {
    "schema_version": {
      "const": "0.1.0"
    },
    "artifact_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "artifact_type": {
      "enum": [
        "evidence_packet",
        "literature_synthesis",
        "simulation_result",
        "benchmark_report",
        "replication_report",
        "contradiction_report",
        "experiment_proposal",
        "dataset_descriptor",
        "model_card",
        "compute_result_receipt"
      ]
    },
    "producer": {
      "type": "string",
      "minLength": 1,
      "maxLength": 240
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "research_state": {
      "enum": [
        "hypothesis",
        "analysis",
        "simulation",
        "experiment",
        "replication",
        "validated_result"
      ]
    },
    "inputs": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reference",
          "rights"
        ],
        "properties": {
          "reference": {
            "type": "string",
            "maxLength": 2000
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{64}$"
          },
          "rights": {
            "type": "string",
            "maxLength": 500
          }
        }
      }
    },
    "method_summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000
    },
    "uncertainty": {
      "type": "string",
      "minLength": 1,
      "maxLength": 5000
    },
    "limitations": {
      "type": "string",
      "maxLength": 5000
    },
    "provenance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "node_identity",
        "human_review_state"
      ],
      "properties": {
        "node_identity": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "task_id": {
          "type": "string",
          "maxLength": 200
        },
        "compute_receipt": {
          "type": "string",
          "maxLength": 2000
        },
        "human_review_state": {
          "enum": [
            "unreviewed",
            "reviewed",
            "approved_for_publication"
          ]
        }
      }
    },
    "artifact_sha256": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{64}$"
    },
    "attribution": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "public_credit": {
          "type": "boolean",
          "default": false
        },
        "display_name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 240
        },
        "organization": {
          "type": "string",
          "minLength": 1,
          "maxLength": 240
        },
        "profile_url": {
          "type": "string",
          "format": "uri"
        },
        "preferred_citation": {
          "type": "string",
          "maxLength": 1000
        }
      },
      "description": "Optional contributor-controlled public attribution. Omission or public_credit=false means the artifact must not be publicly credited by name solely from this field."
    }
  }
}
