{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://h33.ai/standards/post-quantum-verified/h33-self-attestation/bundles/schema/pillar2-governance-lineage.schema.json",
  "schema_version": "h33-pq-verified/pillar2-governance-lineage/v1.0",
  "title": "H33 Pillar 2 — Authority Preservation / Governance Lineage",
  "description": "Five-level authority lineage for an internal H33 governance decision. Bootstrap Cycle 2026-Q2-001 uses the H33-Root patent filing approval chain as subject. Publishing rule: structure + hashes + timestamps + scopes + signatures + verification material ONLY. Decision content (deliberation, legal communication, strategic discussion) is never exposed. The verifier confirms the chain existed and was valid without learning what the chain decided.",
  "type": "object",
  "required": ["schema_version", "cycle_id", "subject", "lineage", "ancestor_constraint_envelope", "leaf_action", "verification_record", "publishing_rule"],
  "properties": {
    "schema_version": { "const": "h33-pq-verified/pillar2-governance-lineage/v1.0" },
    "cycle_id": { "type": "string", "pattern": "^[0-9]{4}-Q[1-4]-[0-9]{3}$", "example": "2026-Q2-001" },
    "subject": { "type": "string", "example": "H33-Root Patent Filing Approval Chain", "description": "Public-facing name of the lineage's subject" },
    "lineage": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5,
      "description": "Five-level chain: Root Authority → Patent Program Approval → Filing Authorization → Submission Event → Filing Receipt",
      "items": {
        "type": "object",
        "required": ["level", "name", "issued_at", "node_hash", "signatures"],
        "properties": {
          "level": { "type": "integer", "minimum": 1, "maximum": 5 },
          "name": { "type": "string", "example": "Root Authority" },
          "issued_at": { "type": "string", "format": "date-time" },
          "objective_hash": { "type": "string", "pattern": "^[0-9a-f]{96}$", "description": "SHA3-384 of the level's objective statement. The objective ITSELF is not published — only its hash." },
          "root_hash": { "type": "string", "pattern": "^[0-9a-f]{96}$", "description": "SHA3-384 of the root authority object (Level 1 self-reference; Levels 2-5 reference Level 1)" },
          "parent_hash": { "type": ["string", "null"], "pattern": "^[0-9a-f]{96}$", "description": "Null for Level 1 (root); SHA3-384 of immediate parent's node_hash for Levels 2-5" },
          "node_hash": { "type": "string", "pattern": "^[0-9a-f]{96}$", "description": "SHA3-384 over canonical encoding of (root_hash, parent_hash, objective_hash, issued_at, signing_principal_hash, delegated_scope_hash)" },
          "signing_principal_hash": { "type": "string", "pattern": "^[0-9a-f]{96}$", "description": "SHA3-384 of the signing principal's identity. Identity itself not exposed." },
          "delegated_scope_hash": { "type": "string", "pattern": "^[0-9a-f]{96}$", "description": "SHA3-384 of the delegated scope at this level. Scope content not exposed; envelope hash verifies monotonic narrowing." },
          "approval_set": {
            "type": "object",
            "description": "Required for Level 1 only. Multi-signer threshold details.",
            "properties": {
              "threshold": { "type": "string", "example": "2-of-3" },
              "signer_principal_hashes": { "type": "array", "items": { "type": "string", "pattern": "^[0-9a-f]{96}$" } }
            }
          },
          "signatures": {
            "type": "object",
            "description": "Triple-family PQ signatures over node_hash. All three required at Level 1; at least one required at Levels 2-5.",
            "properties": {
              "ml_dsa_87": { "type": "string", "contentEncoding": "base64" },
              "slh_dsa_256s": { "type": "string", "contentEncoding": "base64" },
              "falcon_1024": { "type": "string", "contentEncoding": "base64" }
            }
          }
        }
      }
    },
    "ancestor_constraint_envelope": {
      "type": "object",
      "required": ["monotonic_narrowing_verified", "envelope_hash_per_level"],
      "properties": {
        "monotonic_narrowing_verified": { "type": "boolean", "description": "True iff at every level, the delegated_scope is a non-strict subset of every ancestor's scope" },
        "envelope_hash_per_level": { "type": "array", "minItems": 5, "maxItems": 5, "items": { "type": "string", "pattern": "^[0-9a-f]{96}$" }, "description": "SHA3-384 of the composed ancestor constraint envelope at each level" }
      }
    },
    "leaf_action": {
      "type": "object",
      "required": ["name", "action_hash", "timestamp", "root_conformance_check"],
      "properties": {
        "name": { "type": "string", "example": "Patent Filing Submission" },
        "action_hash": { "type": "string", "pattern": "^[0-9a-f]{96}$", "description": "SHA3-384 of the leaf action descriptor. Action content not exposed." },
        "timestamp": { "type": "string", "format": "date-time" },
        "root_conformance_check": { "type": "string", "enum": ["PASS", "FAIL"], "description": "ROOT_CONFORMANCE gate check result (Claim 2 step l)" }
      }
    },
    "verification_record": {
      "type": "object",
      "required": ["verifier_version", "verifier_fingerprint"],
      "properties": {
        "verifier_version": { "type": "string", "example": "h33-verifier 0.1.0" },
        "verifier_fingerprint": { "type": "string", "pattern": "^[0-9a-f]{96}$" },
        "result": { "type": "string", "enum": ["PASS", "FAIL", "PENDING"] }
      }
    },
    "publishing_rule": {
      "const": "Structure + hashes + timestamps + scope envelope hashes + signatures + verification material ONLY. Decision content (deliberation, communications, strategic discussion) is never exposed. Verifies integrity of the chain without exposing what the chain decided."
    }
  }
}
