{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:parasail:kernel-capability-catalog-website:1",
  "title": "Parasail website capability snapshot",
  "$defs": {
    "reference": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "enum": [
            "source",
            "contract",
            "authority",
            "evidence",
            "upstream"
          ]
        },
        "root": {
          "type": "string",
          "enum": [
            "repo",
            "history"
          ]
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "immutable": {
          "type": "boolean"
        },
        "observed_date": {
          "type": "string",
          "format": "date"
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "anchors": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "public_label": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "id",
        "kind",
        "root",
        "path",
        "sha256",
        "immutable",
        "observed_date",
        "description",
        "anchors",
        "public_label"
      ]
    },
    "availability": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "canonical",
            "private",
            "missing",
            "unknown"
          ]
        },
        "app": {
          "type": "string",
          "enum": [
            "installed_route",
            "canonical_api_only",
            "private_only",
            "not_routed",
            "unknown"
          ]
        },
        "installed_validation": {
          "type": "string",
          "enum": [
            "physical_verified",
            "source_bound",
            "pending",
            "not_installed",
            "unknown"
          ]
        }
      },
      "required": [
        "source",
        "app",
        "installed_validation"
      ]
    },
    "implementation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "provider": {
          "type": "string",
          "enum": [
            "ParasailRust",
            "ParasailKernelRust",
            "Installed",
            "SwiftApple",
            "Development"
          ]
        },
        "maturity": {
          "type": "string",
          "enum": [
            "required_unreviewed",
            "required_missing",
            "source_only",
            "bounded_implemented",
            "prototype_tested",
            "integrated_bounded",
            "production_dependency",
            "full_scope_verified"
          ]
        },
        "availability": {
          "$ref": "#/$defs/availability"
        },
        "authority": {
          "type": "string",
          "enum": [
            "bounded_geometry",
            "diagnostic_geometry",
            "topology_only",
            "source_admission",
            "storage_only",
            "display_only",
            "transport_only",
            "mixed_explicit",
            "none",
            "unknown"
          ]
        },
        "profile_id": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "type": "string",
          "minLength": 1
        },
        "limits": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "source_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "evidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "remaining_gates": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "observed_date": {
          "type": "string",
          "format": "date"
        }
      },
      "required": [
        "id",
        "provider",
        "maturity",
        "availability",
        "authority",
        "profile_id",
        "scope",
        "limits",
        "source_refs",
        "evidence_refs",
        "remaining_gates",
        "observed_date"
      ]
    },
    "exit": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "required_for_exit": {
          "type": "boolean"
        },
        "state": {
          "type": "string",
          "enum": [
            "open",
            "unknown",
            "cleared_for_profile",
            "not_applicable"
          ]
        },
        "blockers": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "required": [
        "required_for_exit",
        "state",
        "blockers"
      ]
    },
    "upstream_mapping": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "ParasailRust",
            "ParasailKernelRust",
            "Installed",
            "SwiftApple",
            "Truck",
            "Other"
          ]
        },
        "relation": {
          "type": "string",
          "enum": [
            "candidate_implementation",
            "current_dependency",
            "replacement_target",
            "algorithm_reference",
            "format_reference"
          ]
        },
        "reference_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "symbols": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "scope": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "provider",
        "relation",
        "reference_ids",
        "symbols",
        "scope"
      ]
    },
    "module": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^module\\.[a-z0-9][a-z0-9.-]*$"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "type": "string",
          "minLength": 1
        },
        "contract_version": {
          "type": "integer",
          "minimum": 1
        },
        "reference_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        }
      },
      "required": [
        "id",
        "title",
        "scope",
        "contract_version",
        "reference_ids"
      ]
    },
    "unit": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^unit\\.[a-z0-9][a-z0-9.-]*$"
        },
        "module_id": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "responsibility": {
          "type": "string",
          "minLength": 1
        },
        "contract_version": {
          "type": "integer",
          "minimum": 1
        },
        "required": {
          "type": "boolean"
        },
        "review_state": {
          "type": "string",
          "enum": [
            "unreviewed",
            "draft_source_audit",
            "reviewed"
          ]
        },
        "dependencies": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "requirement_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "reference_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "upstream_mappings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/upstream_mapping"
          }
        },
        "catalog_implementations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/implementation"
          }
        },
        "source_assessment": {
          "type": "object"
        },
        "catalog_remaining_validation": {
          "$ref": "#/$defs/exit"
        },
        "catalog_remaining_gates": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "required": [
        "id",
        "module_id",
        "title",
        "responsibility",
        "contract_version",
        "required",
        "review_state",
        "catalog_implementations",
        "dependencies",
        "requirement_refs",
        "reference_ids",
        "catalog_remaining_validation",
        "upstream_mappings",
        "catalog_remaining_gates",
        "source_assessment"
      ]
    },
    "capability": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^capability\\.[a-z0-9][a-z0-9.-]*$"
        },
        "module_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "behavior": {
          "type": "string",
          "minLength": 1
        },
        "required": {
          "type": "boolean"
        },
        "review_state": {
          "type": "string",
          "enum": [
            "unreviewed",
            "draft_source_audit",
            "reviewed"
          ]
        },
        "unit_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "depends_on_capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "requirement_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "reference_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "catalog_availability": {
          "type": "string",
          "enum": [
            "installed_bounded",
            "canonical_api_only",
            "private_prototype",
            "required_missing",
            "unknown"
          ]
        },
        "catalog_scope": {
          "type": "string",
          "minLength": 1
        },
        "catalog_remaining_gates": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "current_assessment": {
          "type": "object"
        }
      },
      "required": [
        "id",
        "module_ids",
        "title",
        "behavior",
        "required",
        "review_state",
        "unit_ids",
        "depends_on_capabilities",
        "requirement_refs",
        "reference_ids",
        "catalog_availability",
        "catalog_scope",
        "catalog_remaining_gates",
        "current_assessment"
      ]
    },
    "requirement_relation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "requirement_id": {
          "type": "string",
          "minLength": 1
        },
        "capability_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "unit_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "review_state": {
          "type": "string",
          "enum": [
            "unreviewed",
            "related_only",
            "reviewed_mapping"
          ]
        },
        "note": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "requirement_id",
        "capability_ids",
        "unit_ids",
        "review_state",
        "note"
      ]
    },
    "snapshot": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "kind": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "path",
        "sha256",
        "kind"
      ]
    }
  },
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": 1
    },
    "catalog_id": {
      "const": "parasail.kernel-capabilities"
    },
    "as_of": {
      "type": "string",
      "format": "date"
    },
    "review_state": {
      "type": "string",
      "enum": [
        "source_audited"
      ]
    },
    "authority_boundaries": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "modules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/module"
      }
    },
    "units": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/unit"
      }
    },
    "capabilities": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/capability"
      }
    },
    "requirement_relations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/requirement_relation"
      }
    },
    "upstream_catalogs": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "ParasailKernelRust"
            ]
          },
          "revision": {
            "type": "string",
            "pattern": "^[0-9a-f]{40}$"
          },
          "scope": {
            "type": "string",
            "minLength": 1
          },
          "units": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "rust_module": {
                  "type": "string",
                  "minLength": 1
                },
                "upstream_declared_status": {
                  "type": "string",
                  "minLength": 1
                },
                "review_state": {
                  "type": "string",
                  "enum": [
                    "unreviewed",
                    "source_mapped"
                  ]
                },
                "related_unit_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "uniqueItems": true
                },
                "reference_id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "id",
                "rust_module",
                "upstream_declared_status",
                "review_state",
                "related_unit_ids",
                "reference_id"
              ]
            }
          }
        },
        "required": [
          "provider",
          "revision",
          "scope",
          "units"
        ]
      }
    },
    "references": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^reference\\.[0-9a-f]{24}$"
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "observed_date": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "id",
          "label",
          "observed_date"
        ]
      }
    },
    "counts": {
      "type": "object"
    },
    "public_source_revision": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "string",
          "minLength": 1
        },
        "build": {
          "type": "integer",
          "minimum": 1
        },
        "implementation": {
          "type": "string",
          "pattern": "^[0-9a-f]{40}$"
        }
      },
      "required": [
        "version",
        "build",
        "implementation"
      ]
    },
    "installed_snapshot": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "string",
          "minLength": 1
        },
        "build": {
          "type": "integer",
          "minimum": 1
        },
        "implementation": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "physical_acceptance": {
          "type": "string",
          "minLength": 1
        },
        "identity_kind": {
          "const": "candidate_source_fingerprint"
        },
        "validation_state": {
          "const": "provisional_test_build"
        },
        "observed_utc": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "version",
        "build",
        "implementation",
        "physical_acceptance",
        "identity_kind",
        "validation_state",
        "observed_utc"
      ]
    },
    "website_projection": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "source_catalog_sha256": {
          "type": "string",
          "minLength": 1
        },
        "accepted_release_sha256": {
          "type": "string",
          "minLength": 1
        },
        "capability_evidence_date": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "source_catalog_sha256",
        "accepted_release_sha256",
        "capability_evidence_date",
        "scope"
      ]
    },
    "release_preview": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "build": {
          "type": "integer",
          "minimum": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "const": "provisional_installed"
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "updated": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "architecture": {
          "type": "string",
          "minLength": 1
        },
        "source_snapshot_sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "evidence_scope": {
          "type": "string",
          "minLength": 1
        },
        "selected_checks": {
          "const": {
            "build": 168,
            "rust_release": {
              "filter_groups": 18,
              "passed": 368,
              "failed": 8,
              "failed_known_baseline": 8,
              "ignored": 1,
              "ignored_reason": "one multi-turn twist case awaits a release timing run"
            },
            "rust_debug": {
              "complete_receipt": false
            },
            "swift_release": {
              "named": 152,
              "classes": 31,
              "passed": 146,
              "failed": 6,
              "failed_known_baseline": 2,
              "fixture_gated": 4,
              "fixture_gated_rerun_passed": 6,
              "fixture_gated_rerun_total": 6
            },
            "swift_debug": {
              "complete_receipt": false
            },
            "scope": "Selected groups only: the build 154-168 routes through the pinned dependency, the new commands and their neighbours. Not a broad sweep; known baseline failures remain.",
            "backend_inputs": 2687
          }
        },
        "physical_readback_scope": {
          "const": {
            "build": 168,
            "physical_checks_since": 153,
            "physical_ui": "not run for builds 154-168",
            "historical": {
              "xt_source_save": {
                "build": 153,
                "source_bytes": 4957,
                "unit": "millimetres",
                "readback": "independent framing digests, exact original X_T bytes"
              },
              "sphere_refusal": {
                "build": 151,
                "result": "refused with a defined message; no output file"
              },
              "recovery": {
                "build": 152,
                "recover": "pass",
                "do_not_restore": "pass"
              }
            },
            "para_scope": "No .para save/reopen or independent geometry readback ran for build 168; earlier physical results are historical and their source has changed since."
          }
        },
        "recorded_checks": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "qualification_build": {
              "type": "integer",
              "minimum": 0
            },
            "broad_rust_release_passed": {
              "type": "integer",
              "minimum": 0
            },
            "broad_rust_release_failed": {
              "type": "integer",
              "minimum": 0
            },
            "broad_rust_debug_failed": {
              "type": "integer",
              "minimum": 0
            },
            "swift_release_failed_cases": {
              "type": "integer",
              "minimum": 0
            },
            "backend_inputs": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "qualification_build",
            "broad_rust_release_passed",
            "broad_rust_release_failed",
            "broad_rust_debug_failed",
            "swift_release_failed_cases",
            "backend_inputs"
          ]
        },
        "verification": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "full_release_accepted": {
              "const": false
            },
            "canonical_promoted": {
              "const": false
            },
            "provider_validation": {
              "const": "indeterminate"
            },
            "selected_suite_only": {
              "const": true
            },
            "broad_rust_current": {
              "const": false
            },
            "physical_saved_step_readback": {
              "const": false
            },
            "saved_current_semantic_decode": {
              "const": false
            },
            "full_swift_suite_current": {
              "const": false
            }
          },
          "required": [
            "full_release_accepted",
            "canonical_promoted",
            "provider_validation",
            "selected_suite_only",
            "broad_rust_current",
            "physical_saved_step_readback",
            "saved_current_semantic_decode",
            "full_swift_suite_current"
          ]
        }
      },
      "required": [
        "build",
        "version",
        "status",
        "revision",
        "updated",
        "architecture",
        "source_snapshot_sha256",
        "recorded_checks",
        "verification",
        "evidence_scope",
        "selected_checks",
        "physical_readback_scope"
      ]
    },
    "source_audit": {
      "type": "object"
    },
    "build_progress": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "from_build": {
          "const": 197
        },
        "to_build": {
          "const": 199
        },
        "observed_date": {
          "type": "string",
          "format": "date"
        },
        "scope": {
          "type": "string",
          "minLength": 1
        },
        "items": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z]+$"
              },
              "kind": {
                "enum": [
                  "app",
                  "rust"
                ]
              },
              "review_domains": {
                "type": "array",
                "minItems": 1,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "id",
              "kind",
              "review_domains"
            ]
          }
        }
      },
      "required": [
        "from_build",
        "to_build",
        "observed_date",
        "scope",
        "items"
      ]
    }
  },
  "required": [
    "schema_version",
    "catalog_id",
    "as_of",
    "review_state",
    "authority_boundaries",
    "modules",
    "units",
    "capabilities",
    "requirement_relations",
    "upstream_catalogs",
    "references",
    "counts",
    "public_source_revision",
    "installed_snapshot",
    "website_projection",
    "release_preview",
    "source_audit",
    "build_progress"
  ]
}
