{
  "$comment": "SealLink v1.0 Authoritative Refusal Code Registry. No normative document may emit a refusal code absent from this file. Verifiers report the FIRST failing code in each pipeline's deterministic check order.",
  "protocol": "SealLink",
  "version": "1.0.0-draft.2",
  "codes": [
    {"code": "WIRE_SIZE", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Document exceeds type max_bytes or nesting depth > 16."},
    {"code": "WIRE_JSON", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Invalid UTF-8, BOM present, trailing bytes, or malformed RFC 8259 JSON object."},
    {"code": "WIRE_DUPLICATE", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Duplicate object member name (after escape resolution) or Unicode fold alias in name value."},
    {"code": "WIRE_VALUE", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Forbidden JSON value (e.g., null)."},
    {"code": "WIRE_NUMBER", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "JSON number has sign, fraction, exponent, leading zero, or exceeds 2^53 - 1."},
    {"code": "WIRE_INTEGER", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Number-form or string-form integer violates grammar or schema bound."},
    {"code": "WIRE_STRING", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "String contains forbidden control character (< U+0020 except U+000A in multiline prose fields, U+007F DEL, C1 U+0080..U+009F) or unpaired surrogate."},
    {"code": "WIRE_NOT_CANONICAL", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Re-encoded Restricted RFC 8785 JCS bytes differ from input octets."},
    {"code": "WIRE_TYPE", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Unregistered, unsupported, or unexpected object type string."},
    {"code": "WIRE_MEMBER", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Missing required member, unknown member, or member type/form mismatch."},
    {"code": "WIRE_KEY", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Malformed public key encoding or invalid curve point."},
    {"code": "WIRE_SIGNATURE", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Malformed signature encoding, failed cryptographic verification, policy mismatch, or SignatureSet threshold unmet."},
    {"code": "WIRE_CONSTRAINT", "category": "wire", "owning_spec": "SPEC-01", "creates_closure": false, "retryable": false, "description": "Malformed or unsupported Constraint Algebra predicate or populated reserved extension."},

    {"code": "CHAIN_MISMATCH", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": false, "description": "Node network or genesis hash does not match verifier's pinned chain."},
    {"code": "CHAIN_UNHEALTHY", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": true, "description": "Reading node is in IBD, unreachable, missing txindex, or lags header tip beyond LAG."},
    {"code": "CHAIN_NODE_DISAGREEMENT", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": true, "description": "A healthy independent comparison node disagrees on chain tip or sits ahead of reading node."},
    {"code": "CHAIN_CLOCK_ERROR", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": true, "description": "Verifier clock regressed below durable monotonic mark or block header exceeds future bound S."},
    {"code": "CHAIN_TIP_STALE", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": true, "description": "Tip age max(now - header_time, now - first_sight) exceeds action risk-class cutoff."},
    {"code": "CHAIN_OBSERVATION_VOID", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": true, "description": "Chain tip changed between start and end reads of a single observation."},
    {"code": "CHAIN_SCRIPT_UNSUPPORTED", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": false, "description": "Output script does not match any supported ScriptPolicy template or compiled scriptPubKey."},
    {"code": "CHAIN_TX_CONSTRUCTION", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": false, "description": "Transaction violates Witness construction profile (non-SegWit input, non-SIGHASH_ALL, unconfirmed funding, bad linkage)."},
    {"code": "CHAIN_FRAME_INVALID", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": false, "description": "Missing, duplicate, reserved, or malformed SLNK OP_RETURN commitment frame or invalid Merkle inclusion proof."},
    {"code": "CHAIN_DEPTH_INSUFFICIENT", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": true, "description": "Required transaction confirmation depth is below max(signed_min_depth, operator_floor)."},
    {"code": "CHAIN_RECENCY_INVALID", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": false, "description": "Recent block hash R is off active chain or anchor height falls outside (R, R + K]."},
    {"code": "SEAL_UNAVAILABLE", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": false, "retryable": true, "description": "Seal UTXO is unconfirmed, has mismatched script, single-use seal not yet spent by grantee, or chain read is inconclusive; never treated as unspent or closed."},
    {"code": "SEAL_SPENT", "category": "ledger", "owning_spec": "SPEC-02", "creates_closure": true, "retryable": false, "description": "Validated revocation spend of a live seal UTXO (mempool or block); recorded as permanent closure."},

    {"code": "NAME_NOT_FOUND", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": true, "description": "Name does not exist or has no confirmed output on active chain."},
    {"code": "NAME_EXPIRED", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Name output has reached or passed expiry height (h + D)."},
    {"code": "NAME_OWNER_MISMATCH", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Name UTXO ScriptPolicy does not match pinned owner policy or transferred away."},
    {"code": "NAME_WRITER_UNVERIFIED", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Current name value was not authored by pinned ScriptPolicy with SIGHASH_ALL on all required signatures."},
    {"code": "NAME_HISTORY_UNAVAILABLE", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": true, "description": "Name transaction history walk exceeded operator step bound or node could not supply history."},
    {"code": "NAME_VALUE_INVALID", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Name value exceeds 520 bytes or violates strict link / m member grammar."},
    {"code": "NAME_ROLE_CHANGED", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": true, "retryable": false, "description": "Owner-signed change or removal of the bound role key or role-policy pin in name history (durable closure for active grants)."},
    {"code": "MANIFEST_UNAVAILABLE", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": true, "description": "Manifest or pinned off-chain set bytes are missing from presentation and configured stores."},
    {"code": "MANIFEST_MISMATCH", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Manifest or set bytes fail SHA-256 pin, name, network, or seq equality."},
    {"code": "MANIFEST_ROLLBACK", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Manifest or set seq decreased (or hash changed at equal seq) while journaled anchoring_txid remains on active chain."},
    {"code": "AUTH_CHALLENGE_EXPIRED", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Auth challenge TTL > 120s or now >= expires_at."},
    {"code": "AUTH_CHALLENGE_INVALID", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Wrong audience, reused/unknown nonce, provisional policy failure, or upgrade binding mismatch."},
    {"code": "AUTH_KEY_UNPINNED", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Manifest lacks paired auth_key/auth_seal or key mismatch."},
    {"code": "DEVICE_UNAUTHORIZED", "category": "identity", "owning_spec": "SPEC-03", "creates_closure": false, "retryable": false, "description": "Device key not in pinned device list, level ceiling insufficient, or presented to a foreign verifier."},

    {"code": "ORIGIN_UNVERIFIED", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": false, "retryable": false, "description": "Origin certificate missing, untrusted issuer policy, class mismatch, or invalid anchor."},
    {"code": "ORIGIN_BINDING_INVALID", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": false, "retryable": false, "description": "Single-use name binding seal missing, out of height order, or registration already bound."},
    {"code": "ORIGIN_STATUS_INCOMPLETE", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": false, "retryable": true, "description": "Origin status_seal or roster_seal was spent on chain, but the corresponding capacity/1, end/1, or guardian-roster/1 record was not presented or failed hash verification."},
    {"code": "WARD_AUTONOMOUS_FORBIDDEN", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": false, "retryable": false, "description": "Subject has ward status; autonomous signature without satisfying guardian quorum is forbidden."},
    {"code": "GUARDIAN_INACTIVE", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": false, "retryable": false, "description": "Guardianship slot is vacant, pending delay, vetoed, contested/burned, halted, expired, or closed."},
    {"code": "GUARDIAN_QUORUM_UNMET", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": false, "retryable": false, "description": "Valid distinct guardian slot signatures do not meet verifier-derived event_class threshold against approved revision_size."},
    {"code": "GUARDIAN_TRANSFER_PENDING", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": false, "retryable": true, "description": "Guardianship ended (majority or capacity/1); admission paused for both sides until confirmed name transfer and update."},
    {"code": "GUARDIAN_TIME_BOUNDARY", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": false, "retryable": true, "description": "Credible wall-clock interval straddles majority boundary T or cannot be established; admission paused."},
    {"code": "SUBJECT_ENDED", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": true, "retryable": false, "description": "Verified seallink-end/1 record permanently terminates all admission for this subject."},
    {"code": "RECOVERY_FORBIDDEN", "category": "origin", "owning_spec": "SPEC-04", "creates_closure": false, "retryable": false, "description": "Origin sets name_recovery=none, recovery delay incomplete, or cancelled by live OwnerPolicy (0x10)."},

    {"code": "CONTRACT_NOT_PRESENTED", "category": "contract", "owning_spec": "SPEC-05", "creates_closure": false, "retryable": true, "description": "Grant or action profile requires a bound contract (and framework if named) that was not presented."},
    {"code": "CONTRACT_ID_MISMATCH", "category": "contract", "owning_spec": "SPEC-05", "creates_closure": false, "retryable": false, "description": "Recomputed salted contract_id (or framework_id) does not match bound reference."},
    {"code": "CONTRACT_ASSENT_INVALID", "category": "contract", "owning_spec": "SPEC-05", "creates_closure": false, "retryable": false, "description": "Missing, expired, replayed, or invalid party seallink-assent/1."},
    {"code": "CONTRACT_SEAL_MISSING", "category": "contract", "owning_spec": "SPEC-05", "creates_closure": false, "retryable": false, "description": "Required contract or framework seal is absent, unconfirmed, or has mismatched ScriptPolicy."},
    {"code": "CONTRACT_TERMS_MISMATCH", "category": "contract", "owning_spec": "SPEC-05", "creates_closure": false, "retryable": false, "description": "Grant window, executor, or machine capabilities violate bound contract, framework nesting, or undisclosed machine_clause_indices."},
    {"code": "CONTRACT_CONFIG_MISMATCH", "category": "contract", "owning_spec": "SPEC-05", "creates_closure": false, "retryable": false, "description": "Agreed configuration manifest hash does not match runtime configuration."},
    {"code": "CRED_ANCHOR_MISSING", "category": "credential", "owning_spec": "SPEC-05", "creates_closure": false, "retryable": true, "description": "Signed-form credential or notary anchor (0x09 / 0x04) missing or below required depth."},
    {"code": "CRED_ISSUER_CLOSED", "category": "credential", "owning_spec": "SPEC-05", "creates_closure": true, "retryable": false, "description": "Credential anchor height >= owner-authenticated compromise height h_c (0x0b)."},
    {"code": "CRED_WINDOW_CLOSED", "category": "credential", "owning_spec": "SPEC-05", "creates_closure": false, "retryable": false, "description": "Current chain height outside credential validity window."},
    {"code": "CRED_REVOKED_FOR_CAUSE", "category": "credential", "owning_spec": "SPEC-05", "creates_closure": true, "retryable": false, "description": "Revocable credential or notary seal spent with verified cause commitment (0x0a / 0x05)."},
    {"code": "NOTARY_REQUIRED", "category": "credential", "owning_spec": "SPEC-05", "creates_closure": false, "retryable": false, "description": "Missing or invalid notary act where required by parent policy or verifier policy."},

    {"code": "GRANT_CLOSED", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": true, "retryable": false, "description": "Grant or ancestor link is permanently closed in durable closure journal."},
    {"code": "GRANT_WINDOW_CLOSED", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Validated tip height outside half-open [not_before_height, not_after_height) window."},
    {"code": "GRANT_SEAL_REQUIRED", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Grant uses revocation=window_only, but executor policy requires a confirmed UTXO seal."},
    {"code": "GRANT_EXECUTOR_MISMATCH", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Grant executor (or resolved executor_ref) does not match this service's pinned identity."},
    {"code": "GRANT_EXECUTOR_REF_FORBIDDEN", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Dynamic executor_ref used with stateful quotas, external mutation, single-use revocation, or re-delegation."},
    {"code": "GRANT_CONTRACT_REQUIRED", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Action profile requires a bilateral contract (requires_contract=true), but grant is unilateral."},
    {"code": "GRANT_TEXT_FORBIDDEN", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Mechanical effect executor refused a grant carrying operative free-text terms."},
    {"code": "GRANT_NOT_DELEGABLE", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Child grant presented under a parent without delegation rights or exceeding depth 2."},
    {"code": "GRANT_CHILD_WIDER", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Child grant fails mechanical Constraint Algebra narrowing, row cap, whole-parent pool aggregate (R8.5), window, or template check against parent."},
    {"code": "GRANT_ROW_INVALID", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Child ordinal out of range, row coin not spent by anchor, overlapping row/stop ranges (R8.6), or stop coin invalid/aliased."},
    {"code": "GRANT_ROW_STOPPED", "category": "grant", "owning_spec": "SPEC-06", "creates_closure": true, "retryable": false, "description": "Notary spent the row stop coin; row permanently closed for cause."},
    {"code": "INVOKE_ACTION_DENIED", "category": "invocation", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Requested action is unsupported by executor or absent from grant capabilities."},
    {"code": "INVOKE_CONSTRAINT_FAILED", "category": "invocation", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Signed invocation target or arguments violate a grant capability where-predicate or profile check."},
    {"code": "INVOKE_TIME_INVALID", "category": "invocation", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Wall-clock now outside invocation half-open [iat, exp) window."},
    {"code": "INVOKE_REPLAY", "category": "invocation", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Duplicate nonce or already-consumed single-use grant."},
    {"code": "QUOTA_EXCEEDED", "category": "invocation", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Request exceeds own grant quota, parent row cap, session cap, or operator ceiling."},
    {"code": "QUOTA_CLOCK_REGRESSION", "category": "invocation", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": true, "description": "Clock regressed below durable period watermark for a seconds-based quota."},
    {"code": "SESSION_INVALID", "category": "invocation", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": false, "description": "Unknown, expired, closed, or slot-mismatched bearer session token."},
    {"code": "JOURNAL_LOST", "category": "journal", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": true, "description": "Local journal or external CAS witness unreadable, mismatched, or behind witness (rollback detected)."},
    {"code": "JOURNAL_FENCED", "category": "journal", "owning_spec": "SPEC-06", "creates_closure": false, "retryable": true, "description": "Writer no longer holds the active external witness fencing token."},

    {"code": "SERVICE_PROVIDER_UNBOUND", "category": "service", "owning_spec": "SPEC-07", "creates_closure": false, "retryable": false, "description": "Resource owner's manifest does not bind this service's pinned NamePin as provider for the claimed label/type."},
    {"code": "SERVICE_MIGRATION_INVALID", "category": "service", "owning_spec": "SPEC-07", "creates_closure": false, "retryable": false, "description": "Export/import handover incomplete, unclosed predecessor grant, credentials leaked in export, or rollback."},
    {"code": "FEDERATION_POLICY_DENIED", "category": "service", "owning_spec": "SPEC-07", "creates_closure": false, "retryable": false, "description": "Peer failed trust policy, screening cap, human disclosure gate, or Contour A PII routing invariant."}
  ]
}
