{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thehiveryiq.com/.well-known/schemas/effect-quiescence-v1.json",
  "title": "Effect Quiescence Receipt, v1",
  "description": "Canonical schema for the Hive effect quiescence receipt, canonical type effect.quiescence. The instrument evaluates the negative case over a closed interval: whether no effect was admitted under a named authority across every channel of a roster that was committed before the interval opened, established by unbroken per channel continuity between an opening anchor at or before the interval start and a closing anchor issued after the interval end plus a committed settlement lag.",
  "type": "object",
  "required": [
    "receipt_id",
    "payload_sha256",
    "sig_b64u",
    "key_id",
    "algorithm",
    "ts",
    "signed_body"
  ],
  "additionalProperties": false,
  "properties": {
    "receipt_id": {
      "type": "string",
      "pattern": "^r_effect[.]quiescence_[0-9]{10,}_[0-9a-f]{12}$"
    },
    "payload_sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "sig_b64u": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{86}$"
    },
    "key_id": {
      "type": "string",
      "pattern": "^did:(hive|web|key):[A-Za-z0-9._:%-]+$"
    },
    "algorithm": {
      "type": "string",
      "const": "Ed25519"
    },
    "ts": {
      "type": "integer",
      "minimum": 1000000000
    },
    "signed_body": {
      "type": "object",
      "required": [
        "receipt_type",
        "schema",
        "quiescence_id",
        "authority_ref",
        "interval",
        "roster",
        "channels",
        "coverage",
        "verdict",
        "boundary"
      ],
      "additionalProperties": false,
      "properties": {
        "receipt_type": {
          "type": "string",
          "const": "effect.quiescence"
        },
        "schema": {
          "type": "string",
          "const": "r1.0.0"
        },
        "quiescence_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$"
        },
        "authority_ref": {
          "type": "object",
          "required": [
            "authority_commitment",
            "reference_class"
          ],
          "additionalProperties": false,
          "properties": {
            "authority_commitment": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "reference_class": {
              "type": "string",
              "enum": [
                "issuer_resolved",
                "caller_supplied",
                "asserted_without_source"
              ]
            }
          }
        },
        "interval": {
          "type": "object",
          "required": [
            "opens",
            "closes"
          ],
          "additionalProperties": false,
          "properties": {
            "opens": {
              "type": "object",
              "required": [
                "utc",
                "drift_seconds"
              ],
              "additionalProperties": false,
              "properties": {
                "utc": {
                  "type": "string",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
                },
                "drift_seconds": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 86400
                }
              }
            },
            "closes": {
              "type": "object",
              "required": [
                "utc",
                "drift_seconds"
              ],
              "additionalProperties": false,
              "properties": {
                "utc": {
                  "type": "string",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
                },
                "drift_seconds": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 86400
                }
              }
            }
          }
        },
        "roster": {
          "type": "object",
          "required": [
            "roster_commitment",
            "salt_commitment",
            "maximum_gap_seconds",
            "settlement_lag_seconds",
            "channel_count",
            "prior_receipt"
          ],
          "additionalProperties": false,
          "properties": {
            "roster_commitment": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "salt_commitment": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "maximum_gap_seconds": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2592000
            },
            "settlement_lag_seconds": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2592000
            },
            "channel_count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 64
            },
            "prior_receipt": {
              "type": "object",
              "required": [
                "receipt_id",
                "receipt_type",
                "envelope_sha256",
                "issuance_instant"
              ],
              "additionalProperties": false,
              "properties": {
                "receipt_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "receipt_type": {
                  "type": "string",
                  "const": "effect.roster"
                },
                "envelope_sha256": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "issuance_instant": {
                  "type": "object",
                  "required": [
                    "utc",
                    "drift_seconds"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "utc": {
                      "type": "string",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
                    },
                    "drift_seconds": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 86400
                    }
                  }
                }
              }
            }
          }
        },
        "channels": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "items": {
            "type": "object",
            "required": [
              "channel_commitment",
              "opening_anchor",
              "closing_anchor",
              "heartbeat_count",
              "maximum_observed_gap_seconds",
              "admitted_effect_count"
            ],
            "additionalProperties": false,
            "properties": {
              "channel_commitment": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              "opening_anchor": {
                "type": "object",
                "required": [
                  "sequence",
                  "chain_head",
                  "instant"
                ],
                "additionalProperties": false,
                "properties": {
                  "sequence": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 999999999999
                  },
                  "chain_head": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "instant": {
                    "type": "object",
                    "required": [
                      "utc",
                      "drift_seconds"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "utc": {
                        "type": "string",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
                      },
                      "drift_seconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      }
                    }
                  }
                }
              },
              "closing_anchor": {
                "type": "object",
                "required": [
                  "sequence",
                  "chain_head",
                  "instant"
                ],
                "additionalProperties": false,
                "properties": {
                  "sequence": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 999999999999
                  },
                  "chain_head": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "instant": {
                    "type": "object",
                    "required": [
                      "utc",
                      "drift_seconds"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "utc": {
                        "type": "string",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
                      },
                      "drift_seconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      }
                    }
                  }
                }
              },
              "heartbeat_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000
              },
              "maximum_observed_gap_seconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 2592000
              },
              "admitted_effect_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000
              }
            }
          }
        },
        "coverage": {
          "type": "object",
          "required": [
            "channel_set_relation",
            "continuity_relation",
            "gap_relation",
            "lag_relation"
          ],
          "additionalProperties": false,
          "properties": {
            "channel_set_relation": {
              "type": "string",
              "enum": [
                "reported_set_equals_committed_roster",
                "reported_set_differs_from_committed_roster"
              ]
            },
            "continuity_relation": {
              "type": "string",
              "enum": [
                "every_channel_continuous",
                "at_least_one_channel_broken"
              ]
            },
            "gap_relation": {
              "type": "string",
              "enum": [
                "every_gap_within_bound",
                "at_least_one_gap_exceeds_bound"
              ]
            },
            "lag_relation": {
              "type": "string",
              "enum": [
                "every_closing_anchor_past_settlement_lag",
                "at_least_one_closing_anchor_before_settlement_lag",
                "indeterminate"
              ]
            }
          }
        },
        "verdict": {
          "type": "string",
          "enum": [
            "quiescent",
            "effect_observed",
            "coverage_incomplete",
            "indeterminate"
          ]
        },
        "boundary": {
          "type": "string",
          "const": "This receipt attests only that a named authority, a channel roster committed before the interval opened, and a set of per channel continuity anchors satisfy the stated deterministic absence procedure over the named closed interval. A verdict of quiescent means only that no effect was admitted on the committed channels within the covered interval as reported by the anchoring parties. It does not establish that the roster enumerates every channel through which an effect could occur, that the anchoring parties are complete, honest, or diligent, or that no effect occurred outside the committed roster, outside the covered interval, or through an unreported path. It does not establish that any authority was suspended, revoked, exhausted, dormant, or unused as a matter of contract or law, and it does not establish quiescence of intent, capability, or obligation. A verdict of effect_observed does not establish that the effect was unauthorized, wrongful, or in breach. This receipt decides no contractual, statutory, regulatory, evidentiary, or legal consequence, allocates no risk, fault, responsibility, liability, loss, or remedy, and authorizes no action, payment, sanction, denial, or remedy."
        }
      }
    }
  }
}
