← Files ClaraARCHIVED FILE

contracts/real_data_pilot_mechanical_error_register.v1.schema.json

8.58 KB · Oct 2, 2026 · 00:29 UTC

↓ Download file

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mparanza.com/schemas/clara/real-data-pilot-mechanical-error-register-v1.json",
  "title": "Clara real-data pilot mechanical error register",
  "description": "A producer-owned register of fixed mechanical classes, digest-shaped check/code IDs, and replay-validated output-receipt references. It contains no error prose, semantic findings, row-level values, labels, or amounts.",
  "$comment": "This schema validates portable structure. validate_real_data_pilot_mechanical_error_register is authoritative for exact JSON integer representation, exact pilot/execution identity, output-receipt closure, reference closure, class/code consistency, and derived status/count invariants. Draft 2020-12 treats a mathematically integral JSON number such as 1.0 as an integer, while the runtime deliberately rejects that lexical form. The non-circular output closure omits byte_count and sha256 only from the mechanical_errors self receipt while preserving its role/path; every non-self receipt remains fully bound and the full self receipt must match the exact register path/current bytes.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "pilot_id",
    "execution_id",
    "bindings",
    "check_registry",
    "error_registry",
    "summary",
    "content_policy",
    "publication_status",
    "report_ready",
    "limitations"
  ],
  "properties": {
    "schema_version": {
      "const": "clara.real_data_pilot_mechanical_error_register.v1"
    },
    "pilot_id": {
      "$ref": "#/$defs/pilot_id"
    },
    "execution_id": {
      "$ref": "#/$defs/execution_id"
    },
    "bindings": {
      "$ref": "#/$defs/bindings"
    },
    "check_registry": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/check_id"
      },
      "additionalProperties": {
        "$ref": "#/$defs/check"
      }
    },
    "error_registry": {
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/error_id"
      },
      "additionalProperties": {
        "$ref": "#/$defs/error"
      }
    },
    "summary": {
      "$ref": "#/$defs/summary"
    },
    "content_policy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "error_messages_in_register",
        "row_level_values_in_register",
        "semantic_findings_in_register"
      ],
      "properties": {
        "error_messages_in_register": {
          "const": false
        },
        "row_level_values_in_register": {
          "const": false
        },
        "semantic_findings_in_register": {
          "const": false
        }
      }
    },
    "publication_status": {
      "const": "withheld"
    },
    "report_ready": {
      "const": false
    },
    "limitations": {
      "const": [
        "error_completeness_not_established",
        "identifier_nonidentifiability_not_established",
        "mechanical_classification_is_producer_declared_at_registered_gate",
        "producer_quiescence_not_mechanically_established",
        "publication_not_authorized",
        "report_readiness_not_established",
        "semantic_correctness_not_assessed"
      ]
    }
  },
  "$defs": {
    "id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$(?![\\s\\S])"
    },
    "check_id": {
      "type": "string",
      "pattern": "^check-[0-9a-f]{16}$(?![\\s\\S])"
    },
    "error_id": {
      "type": "string",
      "pattern": "^error-[0-9a-f]{16}$(?![\\s\\S])"
    },
    "error_code": {
      "type": "string",
      "pattern": "^code-[0-9a-f]{16}$(?![\\s\\S])"
    },
    "pilot_id": {
      "type": "string",
      "pattern": "^pilot-[0-9a-f]{16}$(?![\\s\\S])"
    },
    "execution_id": {
      "type": "string",
      "pattern": "^execution-[0-9a-f]{16}$(?![\\s\\S])"
    },
    "sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$(?![\\s\\S])"
    },
    "nonnegative_integer": {
      "type": "integer",
      "minimum": 0
    },
    "mechanical_class": {
      "enum": [
        "contract",
        "mapping_execution",
        "numeric",
        "output_integrity",
        "period",
        "reconciliation",
        "replay",
        "source_structure",
        "storage"
      ]
    },
    "bindings": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "case_contract_sha256",
        "intake_receipt_sha256",
        "output_receipt_closure_sha256",
        "producer_contract_sha256",
        "producer_implementation_sha256",
        "semantic_review_receipt_sha256"
      ],
      "properties": {
        "case_contract_sha256": {
          "$ref": "#/$defs/sha256"
        },
        "intake_receipt_sha256": {
          "$ref": "#/$defs/sha256"
        },
        "output_receipt_closure_sha256": {
          "$ref": "#/$defs/sha256"
        },
        "producer_contract_sha256": {
          "$ref": "#/$defs/sha256"
        },
        "producer_implementation_sha256": {
          "$ref": "#/$defs/sha256"
        },
        "semantic_review_receipt_sha256": {
          "$ref": "#/$defs/sha256"
        }
      }
    },
    "artifact_refs": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/id"
      }
    },
    "check": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mechanical_class",
        "error_codes",
        "status",
        "artifact_refs"
      ],
      "properties": {
        "mechanical_class": {
          "$ref": "#/$defs/mechanical_class"
        },
        "error_codes": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/error_code"
          }
        },
        "status": {
          "enum": [
            "failed",
            "not_run",
            "passed"
          ]
        },
        "artifact_refs": {
          "$ref": "#/$defs/artifact_refs"
        }
      }
    },
    "error": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "check_id",
        "error_code",
        "mechanical_class",
        "artifact_refs"
      ],
      "properties": {
        "check_id": {
          "$ref": "#/$defs/check_id"
        },
        "error_code": {
          "$ref": "#/$defs/error_code"
        },
        "mechanical_class": {
          "$ref": "#/$defs/mechanical_class"
        },
        "artifact_refs": {
          "$ref": "#/$defs/artifact_refs"
        }
      }
    },
    "check_counts": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "passed",
        "failed",
        "not_run"
      ],
      "properties": {
        "passed": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "failed": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "not_run": {
          "$ref": "#/$defs/nonnegative_integer"
        }
      }
    },
    "class_counts": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "contract",
        "mapping_execution",
        "numeric",
        "output_integrity",
        "period",
        "reconciliation",
        "replay",
        "source_structure",
        "storage"
      ],
      "properties": {
        "contract": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "mapping_execution": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "numeric": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "output_integrity": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "period": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "reconciliation": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "replay": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "source_structure": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "storage": {
          "$ref": "#/$defs/nonnegative_integer"
        }
      }
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "overall_status",
        "check_counts",
        "error_count",
        "class_counts"
      ],
      "properties": {
        "overall_status": {
          "enum": [
            "failed",
            "incomplete",
            "passed"
          ]
        },
        "check_counts": {
          "$ref": "#/$defs/check_counts"
        },
        "error_count": {
          "$ref": "#/$defs/nonnegative_integer"
        },
        "class_counts": {
          "$ref": "#/$defs/class_counts"
        }
      }
    }
  }
}

SHA-256: f310c82d677df194f4557487459c575dc6cd93c132f565d5484db11cb05ab6a6