Skip to content

Conformance and evidence ​

Acceptance for proposed v0.2 in Draft ADR#8612050910 is tied to exact profile, bundle and fixture revisions. Structural validation, generation support and observed execution are separate evidence. None implies the others.

Offline artifact check ​

With Python, jsonschema and PyYAML available, run from the repository root:

sh
mise exec -- uv run --offline --no-project --with jsonschema --with pyyaml \
  python src/adrs/8612050910/scripts/check-contract-examples.py

Offline execution requires those packages to be cached. The checker never fetches schema references. Supply a local official AsyncAPI 3.1.0 schema with --asyncapi-schema to add standard structural validation. The helper checks selected static properties and pure completion vectors; it is not a compiler, broker runtime or complete compatibility prover.

--update-lock explicitly refreshes native/import digests and exact-byte lock entries, then checks them. Normal validation never repairs mismatches. Fixtures contain valid/invalid tokens, parse/render outputs, invalid-contract mutations with named diagnostics, deterministic identity and pure completion cases. Unknown fixture kinds fail. Both language backends consume the same expected values and diagnostics.

Required capabilities ​

Contract interpretation ​

Reject duplicate keys, unsafe paths, missing files, wrong identities, hash mismatches and unresolved references. Validate standard/profile schemas, adapters, directions, cross-app links, domains/overlap, filters, bindings and required payload fields. Check native authority, features and adapter kinds. Reject generated-name collisions and unsupported features. No renderer warning, network lookup or validator tolerance may supply missing semantics.

Pipeline operation bindings share subject/payload coverage checks. The helper validates the explicit stageInput pointer form, payload literal types, transform adjacency and known payload source types. It compares resolved schemas exactly and rejects unsupported dataflow instead of inferring a prior result. Interaction stages pass their declared argument object through without partial binding overrides or caller-supplied generated identities.

Rust and TypeScript subjects ​

Prove identical value acceptance/rejection, byte rendering and parse round trips. Test enum/prefix/length boundaries, filters versus concrete addresses, unknown addresses, literal/parameter collisions and stable generated names. Carry contract ID/version/digest and source channel/operation identity. Descriptor-only support advertises no execution capability.

Core and replies ​

Test first checked response, invalid response, timeout, inbox lifetime, receiver ownership, publisher namespace and response permissions. Show matching-stream capture of Core traffic without claiming storage acknowledgment. Exercise live and durable views separately.

Durable delivery and recovery ​

Test independent obligations, discard-new capacity refusal, retention periods, outcome-before-consumer-ack and stable delivery identity. Crash before send, after send/before PubAck, after result/before consumer ack and during reconciliation. Recover without inventing a new attempt. Resource discontinuity becomes indeterminate, not presumed delivery. Effect evidence is separate.

State, time and ownership ​

Test create-if-absent, conflicting invocation input, deterministic operation identity, authoritative admission stamping, expected-revision writes, immutable manifests/decisions and bounded record admission. Race result/deadline under the same serialized time guard. Test the exclusive upper bound, expired writes without mutation, clock rollback and stale reads. Plain KV CAS or a timestamp after an unconditional write does not prove the complete store contract.

Test lease acquire/renew/loss, revocation, stale-owner/fence rejection, stable anycast branch IDs, deterministic reassignment, retry backoff and attempt/deadline budgets. Prove effect fencing independently against its actual commit boundary.

Gathering, cancellation and pipelines ​

Cover duplicate/conflicting/wrong-peer/stale results, distinct-branch/peer votes, fixed/fractional thresholds, empty/impossible audiences, all-terminal versus all-successful, timeout and immutable closure. Membership cannot grow a frozen quorum. Aggregation errors cannot rewrite accepted facts.

Cover stopped/already-completed/unknown cancellation, stale commands, absent replies, grace expiry and indeterminate survivors. Test waitFor, stage input/output compatibility, transforms and stop-on-partial/failure/indeterminate. Recovery reuses stage invocation keys rather than repeating an accepted effect under a new identity.

Workflows ​

Run Open Workflow 1.0.4 conformance and this profile's interaction/invocation cases. Verify locked source/schema, authenticated typed HTTP invocation, pending polling, idempotent retries and workflow timeout. Fork/compete does not imply peer authorization or quorum. Selecting the language does not certify an engine.

Reports and adoption ​

Reports record implementation name/version/revision, profile version, contract/bundle/fixture digests, tested binding and time, and pass/fail/unsupported per capability. Required failures block execution. A subject-only generator can be adopted for its proven surface without claiming runtime support. Reports are immutable revision-specific evidence, not permanent product badges.

No surveyed transport generator, executor or workflow engine is certified here. The selected implementation direction is a profile-owned compiler with Rust/TypeScript subject backends. Building it and testing providers are implementation work under these acceptance criteria, not unresolved architecture choices.

Shared fixture data ​

The checker consumes this exact source. Runtime/broker requirements above remain separate from these offline vectors.

Fixture definitions
json
{
  "version": 1,
  "evidence": "Offline structure, subject algebra and pure completion vectors only; not broker or executor certification.",
  "cases": [
    {
      "id": "peer-domain",
      "kind": "token",
      "contract": "review-coordinator.asyncapi.yaml",
      "tokenType": "PeerId",
      "valid": ["alfa", "bravo", "peer_1"],
      "invalid": ["", "*", ">", "alfa.extra", "alfa beta", "ALFA", "\u00f1", "alfa\n", "alfa\r\n"]
    },
    {
      "id": "operation-domain",
      "kind": "token",
      "contract": "review-coordinator.asyncapi.yaml",
      "tokenType": "OperationId",
      "valid": [
        "opaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "op0000000000000000000000000000000000000000000000000000000000000000"
      ],
      "invalid": [
        "wrong",
        "op.x",
        "opaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "opaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "opgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg",
        "OPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      ]
    },
    {
      "id": "request-round-trip",
      "kind": "render-parse",
      "contract": "review-coordinator.asyncapi.yaml",
      "channel": "reviewRequests",
      "parameters": {
        "scopeId": "lab",
        "peerId": "alfa"
      },
      "subject": "demo.v1.lab.peer.alfa.review.request",
      "invalidSubjects": [
        "demo.v1.lab.peer.*.review.request",
        "demo.v1.lab.peer.alfa.extra.review.request",
        "demo.v1.lab.peer.ALFA.review.request"
      ]
    },
    {
      "id": "result-round-trip",
      "kind": "render-parse",
      "contract": "review-coordinator.asyncapi.yaml",
      "channel": "reviewResults",
      "parameters": {
        "scopeId": "lab",
        "operationId": "opaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "peerId": "alfa"
      },
      "subject": "demo.v1.lab.review.opaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.result.alfa",
      "invalidSubjects": [
        "demo.v1.lab.review.opaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.result",
        "demo.v1.lab.review.opaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.result.*"
      ]
    },
    {
      "id": "core-cannot-claim-storage-ack",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/operations/sendReview/publish/confirmation",
          "value": "stream-ack"
        }
      ],
      "diagnostic": "PROFILE_STRUCTURE"
    },
    {
      "id": "operation-direction",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/operations/sendReview/action",
          "value": "receive"
        }
      ],
      "diagnostic": "DIRECTION_MISMATCH"
    },
    {
      "id": "missing-required-request-binding",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "remove",
          "path": "/x-nats-contract/interactions/reviewGroup/bindings/payload/~1documentRef"
        }
      ],
      "diagnostic": "UNBOUND_PAYLOAD"
    },
    {
      "id": "wrong-token-domain",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/channels/reviewRequests/parameters/peerId",
          "value": "Missing"
        }
      ],
      "diagnostic": "TOKEN_TYPE"
    },
    {
      "id": "overlapping-channel-families",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "copy",
          "from": "/channels/reviewRequests",
          "path": "/channels/otherReviewRequests"
        },
        {
          "op": "copy",
          "from": "/x-nats-contract/channels/reviewRequests",
          "path": "/x-nats-contract/channels/otherReviewRequests"
        }
      ],
      "diagnostic": "CHANNEL_OVERLAP"
    },
    {
      "id": "quorum-must-have-threshold",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "remove",
          "path": "/x-nats-contract/interactions/reviewGroup/completion/count"
        }
      ],
      "diagnostic": "PROFILE_STRUCTURE"
    },
    {
      "id": "single-peer-quorum-impossible",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/interactions/reviewGroup/audience/kind",
          "value": "peer"
        }
      ],
      "diagnostic": "IMPOSSIBLE_QUORUM"
    },
    {
      "id": "quorum-fraction-cannot-exceed-one",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "remove",
          "path": "/x-nats-contract/interactions/reviewGroup/completion/count"
        },
        {
          "op": "set",
          "path": "/x-nats-contract/interactions/reviewGroup/completion/fraction",
          "value": {
            "numerator": 3,
            "denominator": 2
          }
        }
      ],
      "diagnostic": "IMPOSSIBLE_QUORUM"
    },
    {
      "id": "lease-renewal-needs-margin",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/interactions/reviewGroupDurable/delivery/ownership/renewEveryMs",
          "value": 1500
        }
      ],
      "diagnostic": "LEASE_RENEWAL"
    },
    {
      "id": "durable-requires-limits-retention",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/streams/requests",
          "value": {
            "authority": "contract",
            "config": {
              "name": "REVIEW_REQUESTS",
              "subjects": ["demo.v1.*.peer.*.review.request"],
              "retention": "workqueue",
              "storage": "file",
              "num_replicas": 3,
              "max_age": 86400000000000,
              "max_msgs": 100000,
              "max_bytes": 67108864,
              "discard": "new",
              "duplicate_window": 120000000000
            }
          }
        }
      ],
      "diagnostic": "DURABLE_RETENTION"
    },
    {
      "id": "adapter-role-mismatch",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/adapters/verifiedResults/kind",
          "value": "transform"
        }
      ],
      "diagnostic": "ADAPTER_KIND"
    },
    {
      "id": "missing-import-alias",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/interactions/reviewGroup/receiverOperation",
          "value": {
            "contract": "missing",
            "operation": "receiveReview"
          }
        }
      ],
      "diagnostic": "REFERENCE_NOT_FOUND"
    },
    {
      "id": "duplicate-branch-is-one-vote",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1
        }
      ],
      "policy": {
        "mode": "quorum",
        "unit": "distinct-branches",
        "count": 2,
        "onTimeout": "partial"
      },
      "events": [
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        }
      ],
      "expected": {
        "outcome": "success",
        "counted": 2,
        "rejected": 1,
        "threshold": 2
      }
    },
    {
      "id": "late-result-cannot-reopen",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1
        }
      ],
      "policy": {
        "mode": "quorum",
        "unit": "distinct-branches",
        "count": 2,
        "onTimeout": "partial"
      },
      "events": [
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        }
      ],
      "expected": {
        "outcome": "success",
        "counted": 2,
        "rejected": 1,
        "threshold": 2
      }
    },
    {
      "id": "wrong-peer-is-not-a-vote",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1
        }
      ],
      "policy": {
        "mode": "quorum",
        "unit": "distinct-branches",
        "count": 2,
        "onTimeout": "partial"
      },
      "events": [
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        }
      ],
      "expected": {
        "outcome": "pending",
        "counted": 0,
        "rejected": 1,
        "threshold": 2
      }
    },
    {
      "id": "stale-fence-is-not-a-vote",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 2,
          "fence": 2
        }
      ],
      "policy": {
        "mode": "quorum",
        "unit": "distinct-branches",
        "count": 1,
        "onTimeout": "partial"
      },
      "events": [
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 2,
          "fence": 2,
          "status": "success"
        }
      ],
      "expected": {
        "outcome": "success",
        "counted": 1,
        "rejected": 1,
        "threshold": 1
      }
    },
    {
      "id": "fraction-is-ceiling-of-admitted-units",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1
        }
      ],
      "policy": {
        "mode": "quorum",
        "unit": "distinct-branches",
        "onTimeout": "partial",
        "fraction": {
          "numerator": 2,
          "denominator": 3
        }
      },
      "events": [
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        }
      ],
      "expected": {
        "outcome": "success",
        "counted": 2,
        "rejected": 0,
        "threshold": 2
      }
    },
    {
      "id": "whole-fraction-requires-all-admitted-units",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1
        }
      ],
      "policy": {
        "mode": "quorum",
        "unit": "distinct-branches",
        "onTimeout": "partial",
        "fraction": {
          "numerator": 3,
          "denominator": 3
        }
      },
      "events": [
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        }
      ],
      "expected": {
        "outcome": "success",
        "counted": 3,
        "rejected": 0,
        "threshold": 3
      }
    },
    {
      "id": "deadline-precedes-later-result",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1
        }
      ],
      "policy": {
        "mode": "quorum",
        "unit": "distinct-branches",
        "count": 2,
        "onTimeout": "partial"
      },
      "events": [
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "deadline"
        },
        {
          "kind": "result",
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        }
      ],
      "expected": {
        "outcome": "partial",
        "counted": 1,
        "rejected": 1,
        "threshold": 2
      }
    },
    {
      "id": "quorum-impossibility-closes",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1
        }
      ],
      "policy": {
        "mode": "quorum",
        "unit": "distinct-branches",
        "count": 2,
        "onTimeout": "partial"
      },
      "events": [
        {
          "kind": "result",
          "branchId": "alfa",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1,
          "status": "failure"
        },
        {
          "kind": "result",
          "branchId": "charlie",
          "peerId": "charlie",
          "attempt": 1,
          "fence": 1,
          "status": "revoked"
        }
      ],
      "expected": {
        "outcome": "failed",
        "counted": 1,
        "rejected": 0,
        "threshold": 2
      }
    },
    {
      "id": "peer-votes-do-not-count-branches",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "a1",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "a2",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "bravo",
          "peerId": "bravo",
          "attempt": 1,
          "fence": 1
        }
      ],
      "policy": {
        "mode": "quorum",
        "unit": "distinct-peers",
        "count": 2,
        "onTimeout": "partial"
      },
      "events": [
        {
          "kind": "result",
          "branchId": "a1",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        },
        {
          "kind": "result",
          "branchId": "a2",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        }
      ],
      "expected": {
        "outcome": "pending",
        "counted": 1,
        "rejected": 0,
        "threshold": 2
      }
    },
    {
      "id": "all-terminal-waits-for-sibling-settlement",
      "kind": "completion",
      "manifest": [
        {
          "branchId": "a1",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        },
        {
          "branchId": "a2",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1
        }
      ],
      "policy": {
        "mode": "all-terminal",
        "unit": "distinct-peers",
        "onTimeout": "partial"
      },
      "events": [
        {
          "kind": "result",
          "branchId": "a1",
          "peerId": "alfa",
          "attempt": 1,
          "fence": 1,
          "status": "success"
        }
      ],
      "expected": {
        "outcome": "pending",
        "counted": 1,
        "rejected": 0,
        "threshold": 1
      }
    },
    {
      "id": "duplicate-yaml-key",
      "kind": "invalid-yaml",
      "source": "name: first\nname: second\n",
      "diagnostic": "DUPLICATE_KEY"
    },
    {
      "id": "result-identity-needs-deployment-binding",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "remove",
          "path": "/x-nats-contract/channels/reviewResults/publisherIdentity"
        }
      ],
      "diagnostic": "IDENTITY_BINDING"
    },
    {
      "id": "anycast-counts-logical-branches",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/interactions/reviewGroup/dispatch/mode",
          "value": "one-eligible"
        },
        {
          "op": "set",
          "path": "/x-nats-contract/interactions/reviewGroup/completion/unit",
          "value": "distinct-peers"
        },
        {
          "op": "set",
          "path": "/x-nats-contract/interactions/reviewGroup/dispatch/selector",
          "value": "pickPeer"
        },
        {
          "op": "set",
          "path": "/x-nats-contract/interactions/reviewGroup/completion/count",
          "value": 1
        },
        {
          "op": "set",
          "path": "/components/schemas/SelectionInput",
          "value": {
            "$ref": "./adapter-contracts.schema.json#/definitions/SelectionInput"
          }
        },
        {
          "op": "set",
          "path": "/components/schemas/SelectionOutput",
          "value": {
            "$ref": "./adapter-contracts.schema.json#/definitions/SelectionOutput"
          }
        },
        {
          "op": "set",
          "path": "/x-nats-contract/adapters/pickPeer",
          "value": {
            "kind": "selection",
            "version": "0.2.0",
            "inputSchema": "#/components/schemas/SelectionInput",
            "outputSchema": "#/components/schemas/SelectionOutput",
            "description": "Choose the first authorized lexicographic candidate."
          }
        }
      ],
      "diagnostic": "PROFILE_STRUCTURE"
    },
    {
      "id": "cancel-command-identity",
      "kind": "schema-value",
      "definition": "CancelRequest",
      "valid": true,
      "value": {
        "operationId": "opaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "branchId": "alfa",
        "peerId": "alfa",
        "attempt": 1,
        "fence": 1,
        "reason": "early-decision",
        "cancelDeadlineMs": 11000
      }
    },
    {
      "id": "cancel-command-rejects-extra-context",
      "kind": "schema-value",
      "definition": "CancelRequest",
      "valid": false,
      "value": {
        "operationId": "opaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "branchId": "alfa",
        "peerId": "alfa",
        "attempt": 1,
        "fence": 1,
        "reason": "early-decision",
        "cancelDeadlineMs": 11000,
        "trustedPeer": "bravo"
      }
    },
    {
      "id": "deterministic-invocation-id",
      "kind": "invocation-id",
      "principalId": "principal-alfa",
      "contractDigest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "invocationKey": "review-001",
      "expected": "op5a143a584fcfbc6dc20d45401a66bbd043bd08baf3496a9ad391da533b9bdfd3"
    },
    {
      "id": "time-guard-includes-lower-bound",
      "kind": "time-guard",
      "guard": {
        "notBeforeMs": 1000,
        "notAfterMs": 2000
      },
      "committedAtMs": 1000,
      "allowed": true
    },
    {
      "id": "time-guard-excludes-deadline",
      "kind": "time-guard",
      "guard": {
        "notBeforeMs": 1000,
        "notAfterMs": 2000
      },
      "committedAtMs": 2000,
      "allowed": false
    },
    {
      "id": "time-guard-rejects-early-commit",
      "kind": "time-guard",
      "guard": {
        "notBeforeMs": 1000,
        "notAfterMs": 2000
      },
      "committedAtMs": 999,
      "allowed": false
    },
    {
      "id": "filter-wildcard-must-be-whole-final-token",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/channels/reviewRequests/filters/byScope",
          "value": "demo.>.peer.*.review.request"
        }
      ],
      "diagnostic": "FILTER_GRAMMAR"
    },
    {
      "id": "filter-must-intersect-channel-family",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/channels/reviewRequests/filters/byScope",
          "value": "demo.v1.{scopeId}.peer.*.review.other"
        }
      ],
      "diagnostic": "FILTER_CHANNEL"
    },
    {
      "id": "durable-result-cannot-use-live-core-only",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/interactions/reviewGroupDurable/resultOperation",
          "value": "receiveReview"
        }
      ],
      "diagnostic": "DURABLE_RESULT_TRANSPORT"
    },
    {
      "id": "pending-branch-has-positive-initial-fence",
      "kind": "schema-value",
      "definition": "BranchRecord",
      "valid": true,
      "value": {
        "branchId": "alfa",
        "peerId": "alfa",
        "attempt": 1,
        "fence": 1,
        "status": "pending",
        "retryable": false,
        "result": null,
        "input": {},
        "leaseUntilMs": null,
        "nextAttemptAtMs": null,
        "outboxStatus": "pending",
        "cancellation": {
          "status": "none",
          "deadlineMs": null
        },
        "seenResultIds": []
      }
    },
    {
      "id": "pending-branch-rejects-zero-fence",
      "kind": "schema-value",
      "definition": "BranchRecord",
      "valid": false,
      "value": {
        "branchId": "alfa",
        "peerId": "alfa",
        "attempt": 1,
        "fence": 0,
        "status": "pending",
        "retryable": false,
        "result": null,
        "input": {},
        "leaseUntilMs": null,
        "nextAttemptAtMs": null,
        "outboxStatus": "pending",
        "cancellation": {
          "status": "none",
          "deadlineMs": null
        },
        "seenResultIds": []
      }
    },
    {
      "id": "pipeline-requires-subject-bindings",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "remove",
          "path": "/x-nats-contract/pipelines/reviewAndAnnounce/steps/1/bindings/subject/scopeId"
        }
      ],
      "diagnostic": "SUBJECT_BINDING"
    },
    {
      "id": "pipeline-requires-payload-bindings",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/pipelines/reviewAndAnnounce/steps/1/bindings/payload",
          "value": {}
        }
      ],
      "diagnostic": "UNBOUND_PAYLOAD"
    },
    {
      "id": "pipeline-rejects-undeclared-input",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/pipelines/reviewAndAnnounce/steps/1/bindings/payload/",
          "value": {
            "input": "previous"
          }
        }
      ],
      "diagnostic": "PROFILE_STRUCTURE"
    },
    {
      "id": "pipeline-rejects-overlapping-payload-bindings",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/pipelines/reviewAndAnnounce/steps/1/bindings/payload/~1outcome",
          "value": {
            "literal": "quorum-met"
          }
        }
      ],
      "diagnostic": "OVERLAPPING_BINDINGS"
    },
    {
      "id": "pipeline-rejects-invalid-payload-literal",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/pipelines/reviewAndAnnounce/steps/1/bindings/payload/",
          "value": {
            "literal": 42
          }
        }
      ],
      "diagnostic": "PAYLOAD_BINDING_TYPE"
    },
    {
      "id": "pipeline-checks-transform-input",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/adapters/completedEvent/inputSchema",
          "value": "#/components/schemas/DocumentRef"
        }
      ],
      "diagnostic": "PIPELINE_SCHEMA"
    },
    {
      "id": "pipeline-rejects-interaction-overrides",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/pipelines/reviewAndAnnounce/steps/0/bindings/subject/scopeId",
          "value": {
            "literal": "lab"
          }
        }
      ],
      "diagnostic": "PROFILE_STRUCTURE"
    },
    {
      "id": "pipeline-rejects-missing-stage-input-field",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/x-nats-contract/pipelines/reviewAndAnnounce/steps/1/bindings/payload/",
          "value": {
            "stageInput": "/missing"
          }
        }
      ],
      "diagnostic": "PAYLOAD_BINDING"
    },
    {
      "id": "pipeline-requires-declared-prior-output",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "remove",
          "path": "/x-nats-contract/interactions/reviewGroup/aggregation"
        }
      ],
      "diagnostic": "PIPELINE_OUTPUT_UNSUPPORTED"
    },
    {
      "id": "pipeline-constructed-object-requires-siblings",
      "kind": "invalid-contract",
      "contract": "review-coordinator.asyncapi.yaml",
      "edits": [
        {
          "op": "set",
          "path": "/components/schemas/ReviewSummary",
          "value": {
            "type": "object",
            "required": ["nested"],
            "properties": {
              "nested": {
                "type": "object",
                "required": ["a", "b"],
                "properties": {
                  "a": {
                    "type": "string"
                  },
                  "b": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        {
          "op": "set",
          "path": "/x-nats-contract/pipelines/reviewAndAnnounce/steps/1/bindings/payload",
          "value": {
            "/nested/a": {
              "literal": "value"
            }
          }
        }
      ],
      "diagnostic": "UNBOUND_PAYLOAD"
    },
    {
      "id": "authorization-dispatch-rejects-attempt-zero",
      "kind": "schema-value",
      "definition": "AuthorizationInput",
      "valid": false,
      "value": {
        "action": "dispatch",
        "peerId": "alfa",
        "branchId": "alfa",
        "attempt": 0
      }
    },
    {
      "id": "authorization-result-rejects-attempt-zero",
      "kind": "schema-value",
      "definition": "AuthorizationInput",
      "valid": false,
      "value": {
        "action": "result",
        "peerId": "alfa",
        "branchId": "alfa",
        "attempt": 0
      }
    },
    {
      "id": "authorization-cancel-rejects-attempt-zero",
      "kind": "schema-value",
      "definition": "AuthorizationInput",
      "valid": false,
      "value": {
        "action": "cancel",
        "peerId": "alfa",
        "branchId": "alfa",
        "attempt": 0
      }
    },
    {
      "id": "authorization-claim-rejects-attempt-zero",
      "kind": "schema-value",
      "definition": "AuthorizationInput",
      "valid": false,
      "value": {
        "action": "claim",
        "peerId": "alfa",
        "branchId": "alfa",
        "attempt": 0
      }
    },
    {
      "id": "authorization-first-attempt-allows-null-branch-id",
      "kind": "schema-value",
      "definition": "AuthorizationInput",
      "valid": true,
      "value": {
        "action": "dispatch",
        "peerId": "alfa",
        "branchId": null,
        "attempt": 1
      }
    },
    {
      "id": "authorization-allows-maximum-attempt",
      "kind": "schema-value",
      "definition": "AuthorizationInput",
      "valid": true,
      "value": {
        "action": "claim",
        "peerId": "alfa",
        "branchId": "alfa",
        "attempt": 16
      }
    },
    {
      "id": "authorization-rejects-attempt-above-maximum",
      "kind": "schema-value",
      "definition": "AuthorizationInput",
      "valid": false,
      "value": {
        "action": "result",
        "peerId": "alfa",
        "branchId": "alfa",
        "attempt": 17
      }
    }
  ]
}

Checker CLI regression suite ​

sh
mise exec -- uv run --offline --no-project --with jsonschema --with pyyaml \
  python src/adrs/8612050910/scripts/test-contract-examples.py

This exercises intact and mutated bundles through the public CLI. It proves rejection of nested referenced payload type mismatches, symlinked parent paths, unsupported literal alphabets and quorum fractions above one. Fractions equal to or below one are accepted for peer, group and scope audiences, alongside acceptance of the unchanged fixture bundle. Pipeline cases cover missing/overlapping bindings, undeclared inputs, wrong payload literal types, incompatible transform inputs, invalid stage-input pointers, undefined previous output and partial interaction overrides, as well as successful field-by-field stage-input bindings. Nested required-field coverage has a CLI regression. A focused inferred token-schema check compares value acceptance with the finite domain, including trailing newlines; the CLI does not expose the inferred schema as an output artifact.

Except as otherwise noted, the content of this repository is licensed under the Creative Commons Attribution 4.0 License and code samples are licensed under the MIT