{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hsimc.tech/whitepaper/global-value/regions/asean/business/applicability-evidence.schema.json",
  "title": "HSIMC applicability, evidence reuse and acceptance record — ASEAN publication",
  "description": "A record structure for a specific claim. Passing schema validation proves structure only; it does not establish legal compliance, competence, authenticity or professional approval.",
  "type": "object",
  "additionalProperties": false,
  "$defs": {
    "artifact": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "minLength": 1
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "media_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "version": {
          "type": [
            "string",
            "null"
          ]
        },
        "access_class": {
          "enum": [
            "PUBLIC",
            "PARTICIPANTS",
            "RESTRICTED"
          ]
        }
      },
      "required": [
        "uri",
        "sha256",
        "media_type",
        "version",
        "access_class"
      ],
      "additionalProperties": false
    },
    "review": {
      "type": "object",
      "properties": {
        "scope": {
          "enum": [
            "LANGUAGE_AND_DOMAIN",
            "PRODUCT_AND_LOCAL_OPERATION",
            "TAX_AND_CUSTOMS",
            "EVIDENCE_REUSE"
          ]
        },
        "reviewer": {
          "type": [
            "string",
            "null"
          ]
        },
        "competence_reference": {
          "type": [
            "string",
            "null"
          ]
        },
        "exact_version_or_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision": {
          "enum": [
            "PENDING",
            "ACCEPTED",
            "CONDITIONAL",
            "REJECTED",
            "REVALIDATION_REQUIRED"
          ]
        },
        "decided_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        }
      },
      "required": [
        "scope",
        "reviewer",
        "competence_reference",
        "exact_version_or_hash",
        "decision",
        "decided_at",
        "conditions",
        "evidence"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "decision": {
                "enum": [
                  "ACCEPTED",
                  "CONDITIONAL",
                  "REJECTED"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "reviewer": {
                "type": "string",
                "minLength": 1
              },
              "competence_reference": {
                "type": "string",
                "minLength": 1
              },
              "exact_version_or_hash": {
                "type": "string",
                "minLength": 1
              },
              "decided_at": {
                "type": "string",
                "minLength": 1
              },
              "evidence": {
                "type": "array",
                "minItems": 1
              }
            }
          }
        }
      ]
    }
  },
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "record_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Stable ID assigned when an actual claim is opened."
    },
    "record_state": {
      "enum": [
        "TEMPLATE",
        "DRAFT",
        "UNDER_REVIEW",
        "APPLICABLE_WITHIN_SCOPE",
        "REVALIDATION_REQUIRED",
        "NOT_APPLICABLE",
        "REVOKED"
      ]
    },
    "claim": {
      "type": "object",
      "properties": {
        "question": {
          "type": [
            "string",
            "null"
          ],
          "description": "The question this evidence is intended to answer."
        },
        "contract_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "task_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "criterion_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "criterion_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "requested_outcome": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "question",
        "contract_id",
        "task_id",
        "criterion_id",
        "criterion_version",
        "requested_outcome"
      ],
      "additionalProperties": false
    },
    "subject": {
      "type": "object",
      "properties": {
        "object_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "object_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "serial_or_lot": {
          "type": [
            "string",
            "null"
          ]
        },
        "configuration_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "bill_of_materials_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "firmware_or_model_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "intended_use": {
          "type": [
            "string",
            "null"
          ]
        },
        "user_or_operator_class": {
          "type": [
            "string",
            "null"
          ]
        },
        "destination_country": {
          "type": [
            "string",
            "null"
          ]
        },
        "destination_territory": {
          "type": [
            "string",
            "null"
          ]
        },
        "site": {
          "type": [
            "string",
            "null"
          ]
        },
        "operating_envelope": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "object_id",
        "object_version",
        "serial_or_lot",
        "configuration_hash",
        "bill_of_materials_version",
        "firmware_or_model_version",
        "intended_use",
        "user_or_operator_class",
        "destination_country",
        "destination_territory",
        "site",
        "operating_envelope"
      ],
      "additionalProperties": false
    },
    "legal_and_method_scope": {
      "type": "object",
      "properties": {
        "applicable_rule_references": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "applicable_rule_versions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rule_effective_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "method_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "method_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "standard_or_procedure_reference": {
          "type": [
            "string",
            "null"
          ]
        },
        "acceptance_thresholds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "measurement_units": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "uncertainty_statement": {
          "type": [
            "string",
            "null"
          ]
        },
        "exclusions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "applicable_rule_references",
        "applicable_rule_versions",
        "rule_effective_date",
        "method_id",
        "method_version",
        "standard_or_procedure_reference",
        "acceptance_thresholds",
        "measurement_units",
        "uncertainty_statement",
        "exclusions"
      ],
      "additionalProperties": false
    },
    "execution": {
      "type": "object",
      "properties": {
        "responsible_node": {
          "type": [
            "string",
            "null"
          ]
        },
        "responsible_person": {
          "type": [
            "string",
            "null"
          ]
        },
        "competence_evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        },
        "performed_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "test_site": {
          "type": [
            "string",
            "null"
          ]
        },
        "environmental_conditions": {
          "type": [
            "string",
            "null"
          ]
        },
        "equipment_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "calibration_records": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        },
        "input_versions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "raw_observations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        },
        "result_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        },
        "deviations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "responsible_node",
        "responsible_person",
        "competence_evidence",
        "performed_at",
        "test_site",
        "environmental_conditions",
        "equipment_ids",
        "calibration_records",
        "input_versions",
        "raw_observations",
        "result_version",
        "results",
        "deviations"
      ],
      "additionalProperties": false
    },
    "applicability": {
      "type": "object",
      "properties": {
        "assessment_owner": {
          "type": [
            "string",
            "null"
          ]
        },
        "target_claim_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "effective_from": {
          "type": [
            "string",
            "null"
          ]
        },
        "valid_until": {
          "type": [
            "string",
            "null"
          ]
        },
        "matching_conditions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "unresolved_differences": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excluded_uses": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "territorial_limits": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reuse_candidate_record_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reuse_assessment": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision": {
          "enum": [
            "PENDING",
            "MATCH",
            "MATCH_WITH_CONDITIONS",
            "DOES_NOT_MATCH",
            "REVALIDATE"
          ]
        },
        "decision_evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        }
      },
      "required": [
        "assessment_owner",
        "target_claim_id",
        "effective_from",
        "valid_until",
        "matching_conditions",
        "unresolved_differences",
        "excluded_uses",
        "territorial_limits",
        "reuse_candidate_record_ids",
        "reuse_assessment",
        "decision",
        "decision_evidence"
      ],
      "additionalProperties": false
    },
    "reviews": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/review"
      }
    },
    "acceptance": {
      "type": "object",
      "properties": {
        "decision": {
          "enum": [
            "PENDING",
            "ACCEPTED",
            "CONDITIONAL",
            "REJECTED"
          ]
        },
        "authorised_acceptor": {
          "type": [
            "string",
            "null"
          ]
        },
        "authority_reference": {
          "type": [
            "string",
            "null"
          ]
        },
        "exact_delivery_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "exact_delivery_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "criteria_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "conditions_or_changes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "unresolved_blockers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "decision_evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        }
      },
      "required": [
        "decision",
        "authorised_acceptor",
        "authority_reference",
        "exact_delivery_version",
        "exact_delivery_hash",
        "criteria_version",
        "decision_date",
        "conditions_or_changes",
        "unresolved_blockers",
        "decision_evidence"
      ],
      "additionalProperties": false
    },
    "value_measurement": {
      "type": "object",
      "properties": {
        "comparison_scope": {
          "type": [
            "string",
            "null"
          ]
        },
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "baseline_cost": {
          "type": [
            "number",
            "null"
          ]
        },
        "actual_all_inclusive_cost": {
          "type": [
            "number",
            "null"
          ]
        },
        "review_cost_included_in_actual": {
          "type": [
            "number",
            "null"
          ]
        },
        "evidence_cost_included_in_actual": {
          "type": [
            "number",
            "null"
          ]
        },
        "validated_value": {
          "type": [
            "number",
            "null"
          ]
        },
        "value_basis": {
          "type": [
            "string",
            "null"
          ]
        },
        "cash_flow_effect_separate": {
          "type": [
            "string",
            "null"
          ]
        },
        "evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        }
      },
      "required": [
        "comparison_scope",
        "currency",
        "baseline_cost",
        "actual_all_inclusive_cost",
        "review_cost_included_in_actual",
        "evidence_cost_included_in_actual",
        "validated_value",
        "value_basis",
        "cash_flow_effect_separate",
        "evidence"
      ],
      "additionalProperties": false
    },
    "invalidation": {
      "type": "object",
      "properties": {
        "reopen_on": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "next_review_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "supersedes_record_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "revocation_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "change_log": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "reopen_on",
        "next_review_date",
        "supersedes_record_id",
        "revocation_reason",
        "change_log"
      ],
      "additionalProperties": false
    },
    "visibility": {
      "enum": [
        "PUBLIC_METADATA",
        "PARTICIPANTS",
        "RESTRICTED"
      ]
    }
  },
  "required": [
    "schema_version",
    "record_id",
    "record_state",
    "claim",
    "subject",
    "legal_and_method_scope",
    "execution",
    "applicability",
    "reviews",
    "acceptance",
    "value_measurement",
    "invalidation",
    "visibility"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "record_state": {
            "const": "APPLICABLE_WITHIN_SCOPE"
          }
        }
      },
      "then": {
        "properties": {
          "record_id": {
            "type": "string",
            "minLength": 1
          },
          "subject": {
            "properties": {
              "object_id": {
                "type": "string",
                "minLength": 1
              },
              "object_version": {
                "type": "string",
                "minLength": 1
              },
              "intended_use": {
                "type": "string",
                "minLength": 1
              },
              "destination_country": {
                "type": "string",
                "minLength": 2
              },
              "destination_territory": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "applicability": {
            "properties": {
              "assessment_owner": {
                "type": "string",
                "minLength": 1
              },
              "decision": {
                "enum": [
                  "MATCH",
                  "MATCH_WITH_CONDITIONS"
                ]
              },
              "matching_conditions": {
                "type": "array",
                "minItems": 1
              },
              "decision_evidence": {
                "type": "array",
                "minItems": 1
              }
            }
          },
          "reviews": {
            "type": "array",
            "minItems": 1,
            "contains": {
              "properties": {
                "scope": {
                  "const": "EVIDENCE_REUSE"
                },
                "decision": {
                  "enum": [
                    "ACCEPTED",
                    "CONDITIONAL"
                  ]
                }
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "acceptance": {
            "properties": {
              "decision": {
                "const": "ACCEPTED"
              }
            }
          }
        }
      },
      "then": {
        "properties": {
          "acceptance": {
            "properties": {
              "authorised_acceptor": {
                "type": "string",
                "minLength": 1
              },
              "authority_reference": {
                "type": "string",
                "minLength": 1
              },
              "exact_delivery_version": {
                "type": "string",
                "minLength": 1
              },
              "exact_delivery_hash": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "criteria_version": {
                "type": "string",
                "minLength": 1
              },
              "decision_date": {
                "type": "string",
                "minLength": 1
              },
              "unresolved_blockers": {
                "type": "array",
                "maxItems": 0
              },
              "decision_evidence": {
                "type": "array",
                "minItems": 1
              }
            }
          }
        }
      }
    }
  ]
}
