✅ fresh
last synced 2026-06-17T22:39:35.514075+00:00 · coverage 100% (
contracts)Validation by Beadloom
doc_sync— same source assync-check.
Contracts (component)
Internal building block of the graph domain.
Source: src/beadloom/graph/contracts.py
Overview
The first-class cross-service contract model and its protocol-agnostic reconciliation. Owns the Contract model, the language-neutral contract_key derivation, the ContractVerdict enum, and reconcile_contracts (which federation.py delegates to). Promotes the contract out of the edge-buried extra.contract blob into a first-class object computed at the federation hub.
Public surface
reconcile_contracts(edges)— group AMQP + GraphQL contract-bearing edges into first-classContracts by key, attaching the producerexposedsurface and consumerreferences(GraphQL), the typedexposed_fields/referenced_fields(GraphQL Tier-A, BDL-060 S2), and theexposed_body/referenced_bodyJSON-Schema (AMQP, BDL-060 S3).classify(contract)— derive the contract-levelContractVerdict. TheBREAKINGverdict is computed natively from depth on both sides: the typed GraphQL surface (graphql_breaking) or the AMQP body JSON-Schema (amqp_body, viaContract.body_breaking_fields), else the BDL-038 name-presence check.contract_key(payload)— the protocol-prefixed, language-neutral key (amqp:<exchange>/<routing>:<message_type>,graphql:<schema>).cross_landscape_keys(edges)/edge_group_key(...)— grouping helpers for landscape-scoped reconciliation.Contract/ContractEndpoint— the model (withContract.to_report_dictfor projecting back to the F1 flat shape).ContractVerdict— the contract-level intent-vs-reality enum.
Collaborators
federation.py delegates all contract reconciliation + classification here. Consumes produces / consumes edges (and their extra.contract payloads) from the graph; the verdicts feed the federation gate and the landscape map. See the federation SPEC.
Component doc (BDL-051). Public surface verified against
contracts.py.