{
  "name": "Universal Paper optional integrations",
  "url": "https://universalpaper.org/integrations/index.json",
  "html": "https://universalpaper.org/integrations/",
  "formatVersion": 1,
  "notice": "Optional and external. Universal Paper is self-contained and does not depend on any integration listed here. Nothing here changes the language, its schemas, its fingerprints, its Terms or its engines. Any channel that delivers an artifact's bytes and lets the receiver recompute its fingerprint binds an agreement equally well.",
  "language": {
    "name": "Universal Paper",
    "version": "UP/0.1-draft",
    "spec": "https://universalpaper.org/spec/",
    "schema": "https://universalpaper.org/schema/universal-paper.schema.json",
    "fingerprint": {
      "format": "sha256:<64 lowercase hex digits>",
      "definition": "\"sha256:\" + hex(SHA-256(JCS(strip(o)))), where JCS is RFC 8785 and strip removes top-level sigs",
      "spec": "https://universalpaper.org/spec/domain/"
    }
  },
  "engines": {
    "note": "Evaluation is authoritative and identical in any conforming Universal Paper engine.",
    "mcp": {
      "endpoint": "https://mcp.universalpaper.org/mcp",
      "transport": "streamable-http",
      "auth": "none",
      "readOnly": true,
      "pypi": "universal-paper-mcp",
      "docs": "https://universalpaper.org/developers/#mcp"
    },
    "python": {
      "pypi": "universal-paper",
      "cli": [
        "up hash FILE",
        "up validate FILE"
      ]
    }
  },
  "integrations": [
    {
      "id": "legal-context-protocol",
      "name": "Legal Context Protocol",
      "status": "optional",
      "kind": "discovery and transaction binding",
      "summary": "Optional: publish a Universal Paper bundle at /.well-known/legal-context.json and pin it by fingerprint (LCP atrHash). Universal Paper does not need it.",
      "docs": {
        "html": "https://universalpaper.org/integrations/legal-context-protocol/",
        "markdown": "https://universalpaper.org/integrations/legal-context-protocol.md",
        "source": "https://github.com/Uppercentile/universal-paper/blob/main/docs/integrations/legal-context-protocol.md"
      },
      "external": {
        "name": "Legal Context Protocol (LCP)",
        "url": "https://legalcontextprotocol.org/",
        "spec": "https://legalcontextprotocol.org/standard",
        "schema": "https://legalcontextprotocol.org/standard/schema",
        "status": "draft v1.0 (as of November 2026)"
      },
      "mapping": {
        "rule": "Serve the artifact's canonical JSON bytes (canonical_bytes) at the `terms` URL, byte for byte. Then LCP atrHash and the Universal Paper fingerprint are the same 32 bytes.",
        "atrHash": "\"0x\" + hex(SHA-256(served bytes))",
        "fingerprint": "\"sha256:\" + the same 64 hex digits",
        "lcpFieldsUsed": [
          "terms",
          "termsFormat",
          "atrHash",
          "acceptanceRequired"
        ],
        "publish": [
          "Bundle (recommended: any engine can evaluate it on its own)",
          "Agreement",
          "Term definition"
        ],
        "doNotPublishAlone": [
          "Event",
          "Mandate"
        ],
        "why": "Events and Mandates carry top-level sigs, which their fingerprint leaves out; publish them inside a Bundle."
      },
      "claimShapes": {
        "legal-context.json": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "title": "LCP discovery file pinned to a Universal Paper artifact (the fields this integration uses)",
          "type": "object",
          "required": [
            "terms",
            "atrHash"
          ],
          "properties": {
            "terms": {
              "type": "string",
              "pattern": "^https://"
            },
            "termsFormat": {
              "const": "json"
            },
            "atrHash": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$"
            },
            "acceptanceRequired": {
              "type": "boolean"
            }
          }
        }
      },
      "agentFlow": [
        "GET https://{domain}/.well-known/legal-context.json; read terms and atrHash.",
        "GET the terms URL and keep the raw bytes; do not re-serialize them.",
        "Check SHA-256(bytes) == atrHash (compare decoded bytes), then that the bytes are canonical Universal Paper JSON, so atrHash is the artifact's fingerprint. Compare a fingerprint a counterparty sent you, if any.",
        "Evaluate with any Universal Paper engine: validate the bundle, then derive statuses, tiers, prices and obligations.",
        "Optional: if you act under a Mandate, dry-run your intended event first (axiom A9).",
        "Record atrHash with the transaction."
      ],
      "authority": "The hash check proves which bytes you have. What the agreement says comes only from evaluating it with a Universal Paper engine.",
      "helper": {
        "path": "integrations/lcp/up_lcp.py",
        "source": "https://github.com/Uppercentile/universal-paper/blob/main/integrations/lcp/up_lcp.py",
        "raw": "https://raw.githubusercontent.com/Uppercentile/universal-paper/main/integrations/lcp/up_lcp.py",
        "language": "Python",
        "requires": "Python 3.11+; needs the universal-paper package (its canonicalization), standard library otherwise",
        "license": "Apache-2.0",
        "functions": [
          {
            "name": "fingerprint",
            "signature": "fingerprint(obj: dict) -> str",
            "does": "The Universal Paper fingerprint of a Bundle, Agreement, State, Term definition or any UP object: \"sha256:<hex>\"."
          },
          {
            "name": "canonical_bytes",
            "signature": "canonical_bytes(obj: dict) -> bytes",
            "does": "The exact bytes to publish as the LCP terms document, so that its SHA-256 equals the UP fingerprint."
          },
          {
            "name": "to_atr_hash",
            "signature": "to_atr_hash(up_fingerprint: str) -> str",
            "does": "\"sha256:<hex>\" -> \"0x<hex>\" (lowercase, 66 characters, as LCP recommends for emission)."
          },
          {
            "name": "to_up_fingerprint",
            "signature": "to_up_fingerprint(atr_hash: str) -> str",
            "does": "\"0x<hex>\" -> \"sha256:<hex>\"."
          },
          {
            "name": "same_hash",
            "signature": "same_hash(a: str, b: str) -> bool",
            "does": "True if two hashes in either notation name the same 32 bytes."
          },
          {
            "name": "legal_context",
            "signature": "legal_context(terms_url: str, artifact: dict, *, acceptance_required: bool | None=None, **extra: Any) -> dict",
            "does": "A minimal LCP discovery document pointing at a Universal Paper artifact, pinned by its fingerprint."
          },
          {
            "name": "dumps_legal_context",
            "signature": "dumps_legal_context(doc: dict) -> str",
            "does": "legal-context.json text: readable JSON. (The discovery file is not hashed, so any formatting works.)"
          },
          {
            "name": "verify",
            "signature": "verify(lcp: dict, artifact_bytes: bytes, expected_fingerprint: str | None=None) -> Verification",
            "does": "Check that the bytes fetched from `lcp[\"terms\"]` are the Universal Paper artifact the file pins."
          },
          {
            "name": "fetch",
            "signature": "fetch(url: str, timeout: float=20.0, max_bytes: int=16 * 1024 * 1024) -> bytes",
            "does": "GET a legal-context.json or terms document. https only (LCP requires it). Returns the raw bytes, unmodified."
          },
          {
            "name": "discover",
            "signature": "discover(domain_or_url: str) -> dict",
            "does": "Fetch and parse https://{domain}/.well-known/legal-context.json (or a full URL to a discovery file)."
          },
          {
            "name": "evaluate",
            "signature": "evaluate(bundle: dict, at: str | None=None) -> dict",
            "does": "Validate a verified Bundle with the reference interpreter and derive its state. Any conforming UP engine works the same."
          },
          {
            "name": "check_mandate",
            "signature": "check_mandate(bundle: dict, event: dict) -> dict",
            "does": "Optional: would an agent's hypothetical event be covered by its Mandate? Uses the reference simulator unchanged."
          }
        ]
      },
      "examples": [
        {
          "name": "conventional: legal-context.json",
          "url": "https://universalpaper.org/examples/integrations/lcp/conventional/legal-context.json",
          "license": "CC0-1.0"
        },
        {
          "name": "conventional: terms.up.json (canonical bundle bytes)",
          "url": "https://universalpaper.org/examples/integrations/lcp/conventional/terms.up.json",
          "license": "CC0-1.0"
        },
        {
          "name": "mandate-cap: legal-context.json",
          "url": "https://universalpaper.org/examples/integrations/lcp/mandate-cap/legal-context.json",
          "license": "CC0-1.0"
        },
        {
          "name": "mandate-cap: terms.up.json (canonical bundle bytes)",
          "url": "https://universalpaper.org/examples/integrations/lcp/mandate-cap/terms.up.json",
          "license": "CC0-1.0"
        }
      ],
      "runnable": [
        "python3 examples/integrations/lcp/agent.py",
        "python3 examples/integrations/lcp/agent.py --online"
      ],
      "mcpTools": [
        "hash_object",
        "validate_bundle",
        "derive_state",
        "simulate_events"
      ]
    },
    {
      "id": "verifiable-credentials",
      "name": "Verifiable Credentials",
      "status": "optional",
      "kind": "roster participation and role snapshots",
      "summary": "Optional: a W3C Verifiable Credential that references a Universal Paper fingerprint. A snapshot only: participation still comes from the engine.",
      "docs": {
        "html": "https://universalpaper.org/integrations/verifiable-credentials/",
        "markdown": "https://universalpaper.org/integrations/verifiable-credentials.md",
        "source": "https://github.com/Uppercentile/universal-paper/blob/main/docs/integrations/verifiable-credentials.md"
      },
      "external": {
        "name": "W3C Verifiable Credentials Data Model 2.0",
        "url": "https://www.w3.org/TR/vc-data-model-2.0/",
        "spec": "https://www.w3.org/TR/vc-data-model-2.0/",
        "status": "W3C Recommendation"
      },
      "mapping": {
        "rule": "A standard VC envelope plus claims that name a Universal Paper fingerprint (agreementFingerprint). Claim and type names are issuer-defined terms; nothing in Universal Paper reads them.",
        "vcFieldsUsed": [
          "@context",
          "type",
          "issuer",
          "validFrom",
          "validUntil",
          "credentialSubject"
        ],
        "recommendedReference": "The bundle's fingerprint, so a verifier can evaluate it on its own.",
        "participant": "Same {scheme, id} shape as a Universal Paper Identifier; pass id to simulate_eligibility."
      },
      "claimShapes": {
        "ParticipationStatusCredential": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "title": "Unsigned participation snapshot",
          "type": "object",
          "required": [
            "@context",
            "type",
            "issuer",
            "credentialSubject"
          ],
          "properties": {
            "@context": {
              "type": "array",
              "contains": {
                "const": "https://www.w3.org/ns/credentials/v2"
              }
            },
            "issuer": {
              "type": "string",
              "minLength": 1
            },
            "validFrom": {
              "type": "string",
              "description": "RFC 3339 date-time"
            },
            "validUntil": {
              "type": "string",
              "description": "RFC 3339 date-time"
            },
            "type": {
              "type": "array",
              "allOf": [
                {
                  "contains": {
                    "const": "VerifiableCredential"
                  }
                },
                {
                  "contains": {
                    "const": "ParticipationStatusCredential"
                  }
                }
              ]
            },
            "credentialSubject": {
              "type": "object",
              "required": [
                "agreementFingerprint",
                "participant",
                "participantStatus"
              ],
              "properties": {
                "agreementFingerprint": {
                  "type": "string",
                  "pattern": "^sha256:[0-9a-f]{64}$",
                  "description": "A Universal Paper fingerprint"
                },
                "participant": {
                  "type": "object",
                  "required": [
                    "scheme",
                    "id"
                  ],
                  "properties": {
                    "scheme": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "participantStatus": {
                  "enum": [
                    "active",
                    "inactive"
                  ]
                },
                "eligibleAsOf": {
                  "type": "string",
                  "description": "RFC 3339 date-time"
                }
              }
            }
          }
        },
        "RoleCredential": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "title": "Unsigned role proof",
          "type": "object",
          "required": [
            "@context",
            "type",
            "issuer",
            "credentialSubject"
          ],
          "properties": {
            "@context": {
              "type": "array",
              "contains": {
                "const": "https://www.w3.org/ns/credentials/v2"
              }
            },
            "issuer": {
              "type": "string",
              "minLength": 1
            },
            "validFrom": {
              "type": "string",
              "description": "RFC 3339 date-time"
            },
            "validUntil": {
              "type": "string",
              "description": "RFC 3339 date-time"
            },
            "type": {
              "type": "array",
              "allOf": [
                {
                  "contains": {
                    "const": "VerifiableCredential"
                  }
                },
                {
                  "contains": {
                    "const": "RoleCredential"
                  }
                }
              ]
            },
            "credentialSubject": {
              "type": "object",
              "required": [
                "id",
                "agreementFingerprint",
                "role"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "agreementFingerprint": {
                  "type": "string",
                  "pattern": "^sha256:[0-9a-f]{64}$",
                  "description": "A Universal Paper fingerprint"
                },
                "role": {
                  "type": "string",
                  "minLength": 1,
                  "examples": [
                    "purchasing-agent",
                    "roster-admin",
                    "read-only"
                  ]
                }
              }
            }
          }
        }
      },
      "agentFlow": [
        "Verify the credential with any standard VC library (proof, issuer key, validity window, status list). Outside Universal Paper.",
        "Extract agreementFingerprint and the claims (participant, participantStatus, eligibleAsOf, or role).",
        "Get the artifact by any channel, recompute its fingerprint with a Universal Paper engine, require it to equal agreementFingerprint, and validate it.",
        "If status matters, run simulate_eligibility for the participant at the time you care about. If engine and credential disagree, the engine is right.",
        "Decide with your own policy: whether you trust that issuer for that claim, and what a role label lets that agent do in your systems."
      ],
      "authority": "A VC is a snapshot only. Participation status comes from a Universal Paper engine (simulate_eligibility). A VC grants no authority inside Universal Paper: who may sign which Event is decided only by party keys and Mandates (axiom A9).",
      "helper": {
        "path": "examples/integrations/vc/up_vc.py",
        "source": "https://github.com/Uppercentile/universal-paper/blob/main/examples/integrations/vc/up_vc.py",
        "raw": "https://raw.githubusercontent.com/Uppercentile/universal-paper/main/examples/integrations/vc/up_vc.py",
        "language": "Python",
        "requires": "Python 3.11+; standard library only. Builds and reads unsigned shapes; no signing, issuance or verification",
        "license": "Apache-2.0",
        "functions": [
          {
            "name": "roster_participation",
            "signature": "roster_participation(*, issuer: str, agreement_fingerprint: str, participant_id: str, participant_scheme: str, participant_status: str, eligible_as_of: str | None=None, valid_from: str | None=None, valid_until: str | None=None) -> dict",
            "does": "An unsigned VC: a snapshot of one participant's participation status under the referenced artifact."
          },
          {
            "name": "role_proof",
            "signature": "role_proof(*, issuer: str, agreement_fingerprint: str, subject_id: str, role: str, valid_from: str | None=None, valid_until: str | None=None) -> dict",
            "does": "An unsigned VC: the issuer says the subject (an agent or user) holds `role` with respect to the referenced artifact."
          },
          {
            "name": "extract",
            "signature": "extract(vc: dict) -> dict",
            "does": "The fingerprint and basic claims of a payload of either shape. Reads the shape only: no proof is checked."
          }
        ]
      },
      "examples": [
        {
          "name": "roster participation (unsigned)",
          "url": "https://universalpaper.org/examples/integrations/vc/roster-participation.json",
          "license": "CC0-1.0"
        },
        {
          "name": "role proof (unsigned)",
          "url": "https://universalpaper.org/examples/integrations/vc/role-proof.json",
          "license": "CC0-1.0"
        }
      ],
      "mcpTools": [
        "hash_object",
        "validate_bundle",
        "simulate_eligibility"
      ]
    },
    {
      "id": "fingerprint-coordination",
      "name": "Fingerprint Coordination",
      "status": "optional",
      "kind": "analytics: parameter ranges, variance, historical deltas and Proposal seeds",
      "summary": "Optional analytics: share Universal Paper fingerprints under explicit rules and derive recomputable profiles, variance and engine-checked Proposal seeds.",
      "docs": {
        "html": "https://universalpaper.org/integrations/fingerprint-coordination/",
        "markdown": "https://universalpaper.org/integrations/fingerprint-coordination.md",
        "source": "https://github.com/Uppercentile/universal-paper/blob/main/docs/integrations/fingerprint-coordination.md"
      },
      "external": null,
      "mapping": {
        "rule": "A Contribution names artifacts by Universal Paper fingerprint with a disclosure level and usage rules. A Derived Profile lists every input by fingerprint plus inputsRoot, names the method, and carries its own fingerprint, so anyone holding the inputs can recompute it byte for byte.",
        "ownFingerprint": "the Universal Paper fingerprint of every member except `fingerprint`",
        "inputsRoot": "the Universal Paper fingerprint of the sorted, de-duplicated array of input fingerprints",
        "disclosures": [
          "fingerprint-only (default)",
          "structure",
          "parameters"
        ],
        "privacy": [
          "sealed values are never counted",
          "no statistic from fewer than minimumCohort distinct inputs",
          "per-agreement cells record positions against the cohort, never raw values",
          "no network code, no telemetry"
        ],
        "seedRules": {
          "toward-median": "the largest numeric outlier in a cohort, set to the cohort median",
          "common-clause": "the most common parameterized Term (in at least 2/3 of a cohort) added to the most similar agreement lacking it"
        },
        "neverSeeded": [
          "UP:Tiers",
          "UP:Tier-Selection",
          "UP:Price-Reference"
        ]
      },
      "claimShapes": {
        "FingerprintContribution": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "$id": "https://universalpaper.org/examples/integrations/fingerprint-coordination/schemas/contribution.schema.json",
          "title": "FingerprintContribution (optional Fingerprint Coordination convention)",
          "description": "Which Universal Paper artifacts a party shares for analysis, how much of each, and the rules for using them. Not part of the Universal Paper language. `fingerprint` is the Universal Paper fingerprint of every other member.",
          "type": "object",
          "required": [
            "type",
            "convention",
            "contributor",
            "created",
            "artifacts",
            "rules",
            "fingerprint"
          ],
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "FingerprintContribution"
            },
            "convention": {
              "const": "fingerprint-coordination/0.1"
            },
            "contributor": {
              "type": "string",
              "minLength": 1,
              "description": "Any identifier the contributor chooses, e.g. a DID or a Universal Paper party key"
            },
            "created": {
              "type": "string",
              "description": "RFC 3339 UTC time"
            },
            "artifacts": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "object",
                "required": [
                  "fingerprint",
                  "kind",
                  "disclosure"
                ],
                "additionalProperties": false,
                "properties": {
                  "fingerprint": {
                    "type": "string",
                    "pattern": "^sha256:[0-9a-f]{64}$",
                    "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                  },
                  "kind": {
                    "enum": [
                      "Bundle",
                      "Agreement"
                    ]
                  },
                  "disclosure": {
                    "enum": [
                      "fingerprint-only",
                      "structure",
                      "parameters"
                    ],
                    "description": "fingerprint-only (default): the fingerprint alone. structure: which Terms, no values. parameters: unsealed parameter values. Sealed values are never counted."
                  }
                }
              }
            },
            "rules": {
              "type": "object",
              "required": [
                "purposes",
                "minimumCohort",
                "attribution",
                "outputs",
                "sealedValues"
              ],
              "additionalProperties": false,
              "properties": {
                "purposes": {
                  "type": "array",
                  "minItems": 1,
                  "uniqueItems": true,
                  "items": {
                    "enum": [
                      "parameter-ranges",
                      "variance",
                      "historical-deltas",
                      "proposal-seeds"
                    ]
                  }
                },
                "minimumCohort": {
                  "type": "integer",
                  "minimum": 2,
                  "description": "No statistic may be published from fewer distinct inputs than this"
                },
                "attribution": {
                  "type": "string",
                  "examples": [
                    "none",
                    "public-examples"
                  ]
                },
                "outputs": {
                  "type": "string",
                  "examples": [
                    "aggregate-only"
                  ]
                },
                "sealedValues": {
                  "const": "never-counted"
                },
                "expires": {
                  "type": "string",
                  "description": "RFC 3339 UTC time"
                }
              }
            },
            "fingerprint": {
              "type": "string",
              "pattern": "^sha256:[0-9a-f]{64}$",
              "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
            }
          }
        },
        "DerivedProfile": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "$id": "https://universalpaper.org/examples/integrations/fingerprint-coordination/schemas/derived-profile.schema.json",
          "title": "DerivedProfile (optional Fingerprint Coordination convention)",
          "description": "A recomputable analytical profile derived from Universal Paper artifacts. Lists every input by fingerprint, plus inputsRoot; `fingerprint` is the Universal Paper fingerprint of every other member. Not part of the Universal Paper language.",
          "type": "object",
          "required": [
            "type",
            "convention",
            "simulated",
            "notice",
            "method",
            "inputs",
            "inputsRoot",
            "corpus",
            "parameters",
            "seeds",
            "fingerprint"
          ],
          "properties": {
            "type": {
              "const": "DerivedProfile"
            },
            "convention": {
              "const": "fingerprint-coordination/0.1"
            },
            "simulated": {
              "type": "boolean"
            },
            "notice": {
              "type": "string",
              "minLength": 1
            },
            "method": {
              "type": "object",
              "required": [
                "helper",
                "function",
                "minimumCohort"
              ],
              "properties": {
                "helper": {
                  "type": "string"
                },
                "function": {
                  "type": "string"
                },
                "minimumCohort": {
                  "type": "integer",
                  "minimum": 2
                },
                "maxSeeds": {
                  "type": "integer"
                },
                "sealedValues": {
                  "const": "never-counted"
                },
                "engine": {
                  "type": "string"
                }
              }
            },
            "inputs": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "object",
                "required": [
                  "fingerprint",
                  "kind",
                  "disclosure"
                ],
                "properties": {
                  "fingerprint": {
                    "type": "string",
                    "pattern": "^sha256:[0-9a-f]{64}$",
                    "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                  },
                  "kind": {
                    "enum": [
                      "Bundle",
                      "Agreement"
                    ]
                  },
                  "label": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  },
                  "disclosure": {
                    "enum": [
                      "fingerprint-only",
                      "structure",
                      "parameters"
                    ]
                  }
                }
              }
            },
            "inputsRoot": {
              "type": "string",
              "pattern": "^sha256:[0-9a-f]{64}$",
              "description": "Fingerprint of the sorted, de-duplicated array of input fingerprints"
            },
            "corpus": {
              "type": "object"
            },
            "agreements": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "input",
                  "agreement",
                  "cohort"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "input": {
                    "type": "string",
                    "pattern": "^sha256:[0-9a-f]{64}$",
                    "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                  },
                  "chain": {
                    "type": "integer"
                  },
                  "agreement": {
                    "type": "string",
                    "pattern": "^sha256:[0-9a-f]{64}$",
                    "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                  },
                  "label": {
                    "type": "string"
                  },
                  "cohort": {
                    "type": "string"
                  },
                  "terms": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "parameters": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "key",
                  "term",
                  "param",
                  "cohort",
                  "observations",
                  "inputs",
                  "sealed",
                  "suppressed"
                ],
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "term": {
                    "type": "string"
                  },
                  "param": {
                    "type": "string"
                  },
                  "cohort": {
                    "type": "string"
                  },
                  "observations": {
                    "type": "integer"
                  },
                  "inputs": {
                    "type": "integer"
                  },
                  "sealed": {
                    "type": "integer"
                  },
                  "suppressed": {
                    "type": "boolean"
                  },
                  "values": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "value",
                        "count"
                      ]
                    }
                  },
                  "mode": {},
                  "min": {
                    "type": "string",
                    "pattern": "^-?[0-9]+(\\.[0-9]+)?$"
                  },
                  "max": {
                    "type": "string",
                    "pattern": "^-?[0-9]+(\\.[0-9]+)?$"
                  },
                  "median": {
                    "type": "string",
                    "pattern": "^-?[0-9]+(\\.[0-9]+)?$"
                  },
                  "differsFromMode": {
                    "type": "integer"
                  },
                  "historicalChanges": {
                    "type": "integer"
                  },
                  "variation": {
                    "type": "integer"
                  }
                },
                "if": {
                  "properties": {
                    "suppressed": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "not": {
                    "anyOf": [
                      {
                        "required": [
                          "values"
                        ]
                      },
                      {
                        "required": [
                          "median"
                        ]
                      },
                      {
                        "required": [
                          "mode"
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "clausePresence": {
              "type": "array"
            },
            "matrix": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "cohort",
                  "columns",
                  "rows"
                ],
                "properties": {
                  "rows": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "key",
                        "cells"
                      ],
                      "properties": {
                        "cells": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "state"
                            ],
                            "properties": {
                              "state": {
                                "enum": [
                                  "median",
                                  "above",
                                  "below",
                                  "mode",
                                  "other",
                                  "absent",
                                  "sealed",
                                  "suppressed"
                                ]
                              },
                              "deviation": {
                                "type": "string",
                                "pattern": "^-?[0-9]+(\\.[0-9]+)?$"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "deltas": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "input",
                  "from",
                  "to",
                  "outcome",
                  "paramsChanged"
                ],
                "properties": {
                  "input": {
                    "type": "string",
                    "pattern": "^sha256:[0-9a-f]{64}$",
                    "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                  },
                  "from": {
                    "type": "string",
                    "pattern": "^sha256:[0-9a-f]{64}$",
                    "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                  },
                  "to": {
                    "type": "string",
                    "pattern": "^sha256:[0-9a-f]{64}$",
                    "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                  },
                  "outcome": {
                    "enum": [
                      "accepted",
                      "rejected"
                    ]
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            },
            "deltaStats": {
              "type": "array"
            },
            "outliers": {
              "type": "array"
            },
            "seeds": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "rule",
                  "target",
                  "change",
                  "basis",
                  "note"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "rule": {
                    "enum": [
                      "toward-median",
                      "common-clause"
                    ]
                  },
                  "target": {
                    "type": "object",
                    "required": [
                      "input",
                      "chain",
                      "agreement"
                    ],
                    "properties": {
                      "input": {
                        "type": "string",
                        "pattern": "^sha256:[0-9a-f]{64}$",
                        "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                      },
                      "chain": {
                        "type": "integer"
                      },
                      "agreement": {
                        "type": "string",
                        "pattern": "^sha256:[0-9a-f]{64}$",
                        "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                      },
                      "label": {
                        "type": "string"
                      }
                    }
                  },
                  "change": {
                    "oneOf": [
                      {
                        "type": "object",
                        "required": [
                          "op",
                          "clause",
                          "term",
                          "param",
                          "from",
                          "to"
                        ],
                        "properties": {
                          "op": {
                            "const": "set-param"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "op",
                          "clause",
                          "term",
                          "def",
                          "params"
                        ],
                        "properties": {
                          "op": {
                            "const": "add-clause"
                          },
                          "def": {
                            "type": "string",
                            "pattern": "^sha256:[0-9a-f]{64}$",
                            "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                          },
                          "params": {
                            "type": "object"
                          }
                        }
                      }
                    ]
                  },
                  "basis": {
                    "type": "object"
                  },
                  "note": {
                    "type": "string"
                  },
                  "simulation": {
                    "type": "object",
                    "required": [
                      "hypothetical",
                      "at",
                      "accepted",
                      "newAgreement",
                      "supersedes"
                    ],
                    "properties": {
                      "hypothetical": {
                        "const": true
                      },
                      "at": {
                        "type": "string",
                        "description": "RFC 3339 UTC time"
                      },
                      "comparedAt": {
                        "type": "string",
                        "description": "RFC 3339 UTC time"
                      },
                      "accepted": {
                        "type": "boolean"
                      },
                      "newAgreement": {
                        "type": "string",
                        "pattern": "^sha256:[0-9a-f]{64}$",
                        "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                      },
                      "supersedes": {
                        "type": "string",
                        "pattern": "^sha256:[0-9a-f]{64}$",
                        "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
                      },
                      "obligationsChanged": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "key",
                            "before",
                            "after"
                          ],
                          "properties": {
                            "before": {
                              "type": "object",
                              "required": [
                                "clause",
                                "duty",
                                "status"
                              ],
                              "properties": {
                                "clause": {
                                  "type": "string"
                                },
                                "duty": {
                                  "type": "string"
                                },
                                "period": {
                                  "type": "object"
                                },
                                "due": {
                                  "type": "string",
                                  "description": "RFC 3339 UTC time"
                                },
                                "amount": {},
                                "status": {
                                  "type": "string"
                                }
                              }
                            },
                            "after": {
                              "type": "object",
                              "required": [
                                "clause",
                                "duty",
                                "status"
                              ],
                              "properties": {
                                "clause": {
                                  "type": "string"
                                },
                                "duty": {
                                  "type": "string"
                                },
                                "period": {
                                  "type": "object"
                                },
                                "due": {
                                  "type": "string",
                                  "description": "RFC 3339 UTC time"
                                },
                                "amount": {},
                                "status": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      "obligationsAdded": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "clause",
                            "duty",
                            "status"
                          ],
                          "properties": {
                            "clause": {
                              "type": "string"
                            },
                            "duty": {
                              "type": "string"
                            },
                            "period": {
                              "type": "object"
                            },
                            "due": {
                              "type": "string",
                              "description": "RFC 3339 UTC time"
                            },
                            "amount": {},
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "obligationsRemoved": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "clause",
                            "duty",
                            "status"
                          ],
                          "properties": {
                            "clause": {
                              "type": "string"
                            },
                            "duty": {
                              "type": "string"
                            },
                            "period": {
                              "type": "object"
                            },
                            "due": {
                              "type": "string",
                              "description": "RFC 3339 UTC time"
                            },
                            "amount": {},
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "fingerprint": {
              "type": "string",
              "pattern": "^sha256:[0-9a-f]{64}$",
              "description": "A Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(o))))"
            }
          }
        }
      },
      "agentFlow": [
        "Verify: check the profile's own fingerprint, recompute each input's fingerprint, require them to match inputs and inputsRoot; recompute the profile (verify_profile) to trust its statistics.",
        "Extract seeds (extract_seeds) and keep only those whose target agreement you are a party to.",
        "Optionally simulate: seed_proposal + simulate_seed, or the MCP tools simulate_events / simulate_amendment (which also checks a Mandate's bounds).",
        "Evaluate with your own policy. To propose, sign the propose event with your own keys and send it like any Universal Paper event."
      ],
      "authority": "A profile is derived data, and a seed is a candidate, not a recommendation. Validity and state come only from a Universal Paper engine evaluating the artifacts. Universal Paper does not operate, require or depend on any analytics, telemetry or hosting.",
      "helper": {
        "path": "examples/integrations/fingerprint-coordination/up_fpc.py",
        "source": "https://github.com/Uppercentile/universal-paper/blob/main/examples/integrations/fingerprint-coordination/up_fpc.py",
        "raw": "https://raw.githubusercontent.com/Uppercentile/universal-paper/main/examples/integrations/fingerprint-coordination/up_fpc.py",
        "language": "Python",
        "requires": "Python 3.11+; needs the universal-paper package (canonicalization, fingerprints, engine); no network, no storage, no ML",
        "license": "Apache-2.0",
        "functions": [
          {
            "name": "fingerprint",
            "signature": "fingerprint(obj: Any) -> str",
            "does": "The Universal Paper fingerprint: \"sha256:\" + hex(SHA-256(JCS(strip(obj)))), unchanged from spec/01-domain.md."
          },
          {
            "name": "with_fingerprint",
            "signature": "with_fingerprint(obj: dict) -> dict",
            "does": "A copy of a Contribution or Derived Profile whose `fingerprint` is the fingerprint of all its other members."
          },
          {
            "name": "check_fingerprint",
            "signature": "check_fingerprint(obj: dict) -> bool",
            "does": "True if obj[\"fingerprint\"] is the fingerprint of all its other members."
          },
          {
            "name": "inputs_root",
            "signature": "inputs_root(fingerprints: list[str]) -> str",
            "does": "One fingerprint for a set of inputs: the fingerprint of the sorted, de-duplicated list of their fingerprints."
          },
          {
            "name": "contribution",
            "signature": "contribution(*, contributor: str, artifacts: list[dict], purposes: list[str], minimum_cohort: int=3, attribution: str='none', outputs: str='aggregate-only', created: str, expires: str | None=None) -> dict",
            "does": "A FingerprintContribution: which artifacts a party shares, how much of each, and the rules for using them."
          },
          {
            "name": "agreements",
            "signature": "agreements(bundle: dict) -> list[dict]",
            "does": "Every chain's agreement in force at the bundle's latest event, with its proposal history and engine outcomes."
          },
          {
            "name": "diff_agreements",
            "signature": "diff_agreements(a: dict, b: dict) -> dict",
            "does": "What changed from agreement a to agreement b: clauses added or removed (by name and Term) and parameters changed."
          },
          {
            "name": "diff_bundles",
            "signature": "diff_bundles(a: dict, b: dict) -> dict",
            "does": "Structural diff of two bundles: Term definitions added/removed, then the agreements in force, chain by chain."
          },
          {
            "name": "derive_profile",
            "signature": "derive_profile(inputs: list[dict], *, minimum_cohort: int=3, max_seeds: int=2, simulate_seeds: bool=True, simulated: bool=True, notice: str | None=None) -> dict",
            "does": "A DerivedProfile from bundles."
          },
          {
            "name": "verify_profile",
            "signature": "verify_profile(profile: dict, inputs: list[dict]) -> dict",
            "does": "Recompute a profile from the same inputs and options, and compare. The inputs must hash to the listed fingerprints."
          },
          {
            "name": "extract_seeds",
            "signature": "extract_seeds(profile: dict) -> list[dict]",
            "does": "The Proposal seeds of a profile, after checking the profile's own fingerprint and each seed's shape."
          },
          {
            "name": "seed_proposal",
            "signature": "seed_proposal(bundle: dict, seed: dict, *, by: str, at: str | None=None) -> dict",
            "does": "The unsigned `propose` event a seed describes (chain, kind, by, at, body). Review it, then sign it with your own keys."
          },
          {
            "name": "simulate_seed",
            "signature": "simulate_seed(bundle: dict, seed: dict, *, library: list[dict] | None=None, at: str | None=None, horizon_days: int=90) -> dict",
            "does": "Run a seed through the Universal Paper engine, as if every party signed: the new agreement's fingerprint,"
          }
        ]
      },
      "examples": [
        {
          "name": "derived profile (simulated from public examples)",
          "url": "https://universalpaper.org/examples/integrations/fingerprint-coordination/demo-profile.json",
          "license": "CC0-1.0"
        },
        {
          "name": "contribution",
          "url": "https://universalpaper.org/examples/integrations/fingerprint-coordination/contribution.json",
          "license": "CC0-1.0"
        },
        {
          "name": "structural diff: conventional to what-if",
          "url": "https://universalpaper.org/examples/integrations/fingerprint-coordination/structural-diff.json",
          "license": "CC0-1.0"
        }
      ],
      "runnable": [
        "python3 examples/integrations/fingerprint-coordination/regenerate.py --check"
      ],
      "demo": {
        "url": "https://universalpaper.org/integrations/fingerprint-coordination/demo/",
        "simulated": true,
        "network": "none",
        "note": "Simulated from public example bundles only; not market data.",
        "scenario": {
          "url": "https://universalpaper.org/integrations/fingerprint-coordination/demo/scenario.json",
          "fingerprint": "sha256:2777cb87475974e8628c23ff85f6b21f66d8de0fc73284253d68da0d3efd07c3",
          "seed": "seed-1",
          "howToSteps": [
            "variance",
            "seed",
            "engine",
            "median"
          ],
          "howTo": "https://universalpaper.org/integrations/fingerprint-coordination/demo/#predictive-redline"
        }
      },
      "mcpTools": [
        "hash_object",
        "validate_bundle",
        "derive_state",
        "simulate_events",
        "simulate_amendment"
      ]
    }
  ],
  "license": {
    "text": "CC BY 4.0",
    "code": "Apache-2.0",
    "examples": "CC0-1.0",
    "page": "https://universalpaper.org/license/"
  },
  "creator": {
    "name": "Uppercentile",
    "url": "https://uppercentile.com"
  }
}
