{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://anthonyveltri.github.io/durable-governance/schemas/commitment-durability-v1.schema.json",
  "title": "Commitment Durability Assessment: Specification (1.0 Draft) by Anthony Veltri",
  "description": "Draft 2020-12 JSON Schema for the Commitment Durability Assessment: Specification (1.0 Draft, pre-Zenodo deposit preview derived from internal review draft 1.02), developed by Anthony Veltri (https://orcid.org/0009-0009-8697-6103). Canonical diagnostic page: https://anthonyveltri.com/commitment-durability-diagnostic/. Living explanatory source: https://anthonyveltri.com/guide/doctrine-18-companion-the-five-levels-of-commitment-durability/. Specification preview: https://anthonyveltri.github.io/durable-governance/commitment-durability/. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
  "$comment": "Author: Anthony Veltri (https://anthonyveltri.com#person, ORCID 0009-0009-8697-6103). Edition: 1.0 Draft (pre-Zenodo deposit; no DOI assigned yet). License: CC BY 4.0. JSON object key order carries no presentation requirement; worksheets and rendered tables preserve the seven-column route profile order. I intend to keep this 1.0 Draft schema available at its published URL; if the post-Zenodo final edition changes instrument_edition, it will either widen the allowed enum backward-compatibly or publish at a new edition-specific schema URI. Technical interoperability recommendation: if you publish a modified validation schema, use a distinct $id URI in a namespace you control alongside CC BY 4.0 modification notices so validators do not confuse adapted rules with the canonical schema.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_id",
    "instrument_edition",
    "assessment_date",
    "assessment_period",
    "actor",
    "capability",
    "material_impairment_threshold",
    "interdependencies",
    "stewardship_layers",
    "routes",
    "excluded_routes",
    "pending_items",
    "rescore_triggers",
    "summary"
  ],
  "properties": {
    "schema_id": {
      "const": "https://anthonyveltri.github.io/durable-governance/schemas/commitment-durability-v1.schema.json",
      "description": "Canonical JSON Schema URI for Commitment Durability Assessment 1.0 Draft."
    },
    "instrument_edition": {
      "const": "1.0 Draft",
      "description": "Public pre-deposit edition identifier corresponding to revised internal review draft 1.02."
    },
    "case_label": {
      "$ref": "#/$defs/nonEmptyString",
      "description": "Optional short title identifying the worked case or assessment record."
    },
    "headline_commitment": {
      "$ref": "#/$defs/nonEmptyString",
      "description": "Optional verbatim or summarized headline assurance being tested across material routes."
    },
    "assessment_date": {
      "type": "string",
      "format": "date",
      "description": "Date on which the rating is taken (ISO 8601 YYYY-MM-DD). Every rating is valid only as of this date."
    },
    "assessment_period": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "start_date",
        "end_date",
        "rationale"
      ],
      "properties": {
        "start_date": {
          "type": "string",
          "format": "date"
        },
        "end_date": {
          "type": "string",
          "format": "date"
        },
        "rationale": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Operational, budgetary, judicial, or contractual reason for the selected assessment window."
        }
      }
    },
    "actor": {
      "$ref": "#/$defs/nonEmptyString",
      "description": "Party that could abandon or disable the capability (agency, vendor, AI provider, board, or operator)."
    },
    "capability": {
      "$ref": "#/$defs/nonEmptyString",
      "description": "Operational statement of what the commitment exists to protect (staff, data, equipment, funding, keys, and access)."
    },
    "material_impairment_threshold": {
      "$ref": "#/$defs/nonEmptyString",
      "description": "Threshold of harm or operational loss at which a route counts as substantially impairing the capability."
    },
    "interdependencies": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/nonEmptyString"
      },
      "description": "Critical operational, legal, technical, or staffing dependencies required for the capability to function."
    },
    "stewardship_layers": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "operational_capacity",
          "custodial_integrity",
          "internal_governance_design",
          "external_governance_protection",
          "translational_accountability"
        ]
      },
      "description": "Affected stewardship layers from Doctrine 25."
    },
    "routes": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/routeEntry"
      },
      "description": "Material routes and plausible routes with unresolved materiality, presented in seven columns when rendered."
    },
    "excluded_routes": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "route_to_loss",
          "exclusion_basis"
        ],
        "properties": {
          "route_to_loss": {
            "$ref": "#/$defs/nonEmptyString"
          },
          "exclusion_basis": {
            "$ref": "#/$defs/nonEmptyString",
            "description": "Explicit reason why this plausible action or omission is non-material or outside the assessment period."
          }
        }
      },
      "description": "Plausible routes excluded from scoring, retained with their documented exclusion basis."
    },
    "pending_items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "instrument",
          "category",
          "stage_or_effective_date",
          "current_weight",
          "rescore_on_commencement"
        ],
        "properties": {
          "instrument": {
            "$ref": "#/$defs/nonEmptyString"
          },
          "category": {
            "type": "string",
            "enum": [
              "pending_proposal",
              "enacted_future_effective_date"
            ]
          },
          "stage_or_effective_date": {
            "$ref": "#/$defs/nonEmptyString",
            "description": "Current legislative/contractual stage for proposals, or future effective date for enacted instruments."
          },
          "current_weight": {
            "const": 0,
            "description": "Pending proposals and instruments not yet in force carry zero weight as current protection."
          },
          "rescore_on_commencement": {
            "type": "boolean"
          },
          "source_locator": {
            "type": "string"
          }
        }
      },
      "description": "Bills in committee, draft contracts, planned controls, or enacted statutes with future effective dates."
    },
    "rescore_triggers": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "trigger_type",
          "condition"
        ],
        "properties": {
          "trigger_type": {
            "type": "string",
            "enum": [
              "principal_or_sponsor_departure",
              "entity_or_custody_transfer",
              "silent_upstream_drift",
              "closure_of_external_scrutiny",
              "scheduled_expiry",
              "clock_change"
            ]
          },
          "condition": {
            "$ref": "#/$defs/nonEmptyString"
          }
        }
      },
      "description": "Events requiring immediate re-scoring of affected routes."
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "summary_status",
        "overall_rating",
        "profile_accompanies_summary",
        "derivation_note"
      ],
      "properties": {
        "summary_status": {
          "type": "string",
          "enum": [
            "reported",
            "withheld"
          ]
        },
        "overall_rating": {
          "enum": [
            "Unprotected",
            "Level 1",
            "Level 2",
            "Level 3",
            "Level 4",
            "Level 5",
            null
          ],
          "description": "Weakest material route rating (Level 5A and 5B summarize as Level 5), or null when summary_status is 'withheld'."
        },
        "withheld_reason": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Required when summary_status is 'withheld' (for example, an Unscored material route could lower the summary)."
        },
        "profile_accompanies_summary": {
          "const": true,
          "description": "Normative invariant: a summary is never reported without the full route profile."
        },
        "derivation_note": {
          "$ref": "#/$defs/nonEmptyString"
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "summary_status": {
                "const": "reported"
              }
            },
            "required": [
              "summary_status"
            ]
          },
          "then": {
            "properties": {
              "overall_rating": {
                "type": "string",
                "enum": [
                  "Unprotected",
                  "Level 1",
                  "Level 2",
                  "Level 3",
                  "Level 4",
                  "Level 5"
                ]
              }
            },
            "not": {
              "required": [
                "withheld_reason"
              ]
            }
          }
        },
        {
          "if": {
            "properties": {
              "summary_status": {
                "const": "withheld"
              }
            },
            "required": [
              "summary_status"
            ]
          },
          "then": {
            "required": [
              "withheld_reason"
            ],
            "properties": {
              "overall_rating": {
                "const": null
              }
            }
          }
        }
      ]
    }
  },
  "$defs": {
    "nonEmptyString": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "nonPlaceholderString": {
      "allOf": [
        {
          "$ref": "#/$defs/nonEmptyString"
        },
        {
          "not": {
            "pattern": "^\\s*(?:[Uu][Nn][Kk][Nn][Oo][Ww][Nn]|[Nn][Oo][Nn][Ee]|[Nn]\\/[Aa]|[Nn][Aa]|[Nn][Uu][Ll][Ll]|[Tt][Bb][Dd]|[Tt][Oo][Dd][Oo]|[Pp][Ee][Nn][Dd][Ii][Nn][Gg]|[Uu][Nn][Vv][Ee][Rr][Ii][Ff][Ii][Ee][Dd]|[Nn][Oo][Tt]\\s+[Rr][Ee][Vv][Ii][Ee][Ww][Ee][Dd]|[Nn][Oo][Tt]\\s+[Aa][Pp][Pp][Ll][Ii][Cc][Aa][Bb][Ll][Ee]|--?)\\s*$"
          }
        }
      ]
    },
    "routeEntry": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "route_id",
        "materiality",
        "route_to_loss",
        "protection_in_effect",
        "rating",
        "reversal_and_enforcement",
        "timing_comparison",
        "execution",
        "expiry_or_next_decision",
        "evidence_basis",
        "evidence_anchor"
      ],
      "properties": {
        "route_id": {
          "$ref": "#/$defs/nonEmptyString"
        },
        "materiality": {
          "type": "string",
          "enum": [
            "material",
            "unresolved_materiality"
          ],
          "description": "Whether the route is established as material within the assessment period or has unresolved materiality."
        },
        "route_to_loss": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Column 1: Specific action or omission by which the actor could abandon or disable the capability."
        },
        "protection_in_effect": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Column 2: Operative instruments in force that cover the route, or candidate/absent protections."
        },
        "rating": {
          "type": "string",
          "enum": [
            "Unprotected",
            "Unscored",
            "Level 1",
            "Level 2",
            "Level 3",
            "Level 4",
            "Level 5A",
            "Level 5B"
          ],
          "description": "Column 3: Demonstrated durability token. Pending is never a rating token."
        },
        "reversal_and_enforcement": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Column 4: Who can reverse, amend, bypass, or waive the protection, and who can enforce it."
        },
        "timing_comparison": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Column 5: Time to irreversible loss compared against earliest credible deterrence or restraint."
        },
        "later_relief_note": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Optional separate record of remedies or orders that arrive after irreversible loss (not credited as timely prevention)."
        },
        "execution": {
          "$ref": "#/$defs/executionRecord",
          "description": "Column 6: Independent execution record (Verified, Unverified, Failed, or explicitly inapplicable)."
        },
        "expiry_or_next_decision": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Column 7: Sunset date, stay expiration, renewal window, or next operational decision."
        },
        "evidence_basis": {
          "type": "string",
          "enum": [
            "public_record_instrument",
            "judicial_order",
            "legislative_record",
            "public_commercial_terms_pattern",
            "api_retention_documentation_pattern",
            "stipulated_agreement_fact",
            "normative_fixture"
          ],
          "description": "Evidentiary basis supporting the route assertion."
        },
        "evidence_anchor": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Source URL and date, docket citation, or fixture identifier grounding the route assertion."
        },
        "buyer_verification_needed": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "question_to_resolve",
            "responsible_owner"
          ],
          "properties": {
            "question_to_resolve": {
              "$ref": "#/$defs/nonEmptyString"
            },
            "responsible_owner": {
              "$ref": "#/$defs/nonEmptyString"
            }
          },
          "description": "Optional action item identifying what a buyer or evaluator must verify and who supplies the evidence."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "rating": {
                "enum": [
                  "Level 3",
                  "Level 4"
                ]
              }
            },
            "required": [
              "rating"
            ]
          },
          "then": {
            "properties": {
              "execution": {
                "properties": {
                  "execution_applicable": {
                    "const": true
                  }
                },
                "required": [
                  "execution_applicable"
                ]
              }
            }
          }
        }
      ]
    },
    "executionRecord": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "execution_applicable",
        "status"
      ],
      "properties": {
        "execution_applicable": {
          "type": "boolean",
          "description": "True when an operational, staffing, audit, or technical control routine applies; false only when no recurring execution obligation applies."
        },
        "status": {
          "type": "string",
          "enum": [
            "verified",
            "unverified",
            "failed",
            "not_applicable"
          ]
        },
        "steward": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Named operational steward, or 'unknown' when not established by the source."
        },
        "evidence": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Operating evidence inspected, or 'unknown' when not established."
        },
        "readiness_deadline": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "ISO date, operational milestone ahead of exposure, or 'unknown' when not established."
        },
        "inapplicable_reason": {
          "$ref": "#/$defs/nonEmptyString",
          "description": "Required when execution_applicable is false, explaining why no operating routine applies."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "execution_applicable": {
                "const": true
              }
            },
            "required": [
              "execution_applicable"
            ]
          },
          "then": {
            "required": [
              "steward",
              "evidence",
              "readiness_deadline"
            ],
            "properties": {
              "status": {
                "enum": [
                  "verified",
                  "unverified",
                  "failed"
                ]
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "execution_applicable": {
                "const": true
              },
              "status": {
                "const": "verified"
              }
            },
            "required": [
              "execution_applicable",
              "status"
            ]
          },
          "then": {
            "properties": {
              "steward": {
                "$ref": "#/$defs/nonPlaceholderString"
              },
              "evidence": {
                "$ref": "#/$defs/nonPlaceholderString"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "execution_applicable": {
                "const": false
              }
            },
            "required": [
              "execution_applicable"
            ]
          },
          "then": {
            "required": [
              "inapplicable_reason"
            ],
            "properties": {
              "status": {
                "const": "not_applicable"
              }
            }
          }
        }
      ]
    }
  }
}
