Schema Contract =============== **2 probes** Validates dataset schemas against a declared YAML contract and detects schema drift over time. Contracts specify column names, data types, nullable flags, and ordering. Drift detection compares the live schema against the last known baseline and emits ``CheckResult`` alerts for added, removed, or type-changed columns. Configuration ------------- .. code-block:: yaml sources: - type: schema_contract dataset_path: /data/curated/orders.parquet contract: /etc/metapod/contracts/orders.yaml fail_on_drift: true Contract file example: .. code-block:: yaml # /etc/metapod/contracts/orders.yaml dataset: orders columns: - name: order_id type: int64 nullable: false - name: customer_email type: string nullable: true - name: amount type: float64 nullable: false Probes ------ .. list-table:: :header-rows: 1 :widths: 40 60 * - Probe - Description * - ``schema_contract.quality.validate`` - Validate live schema against YAML contract (missing/extra/mistyped columns) * - ``schema_contract.quality.drift`` - Detect schema drift vs. last recorded baseline Usage ----- .. code-block:: bash metapod run "schema_contract.quality.*" --config config.yaml Output ------ .. code-block:: json { "probe": "schema_contract.quality.validate", "source": "schema_contract", "collected_at": "2026-03-31T08:00:00Z", "results": [ { "dataset": "orders.parquet", "contract": "orders.yaml", "status": "fail", "violations": [ { "column": "amount", "expected_type": "float64", "actual_type": "string", "issue": "type_mismatch" } ] } ] }