check_physics_contracts
Validate simulation KPI values against design contracts (range, threshold, exact, pct_change) using direct JSON or saved capsule data, and generate a Markdown validation report.
Instructions
Check physics contracts against KPI values from a capsule or direct JSON.
Validates that simulation results meet design requirements defined as contracts (range, threshold, exact, pct_change). Supports two modes:
Direct mode: provide contracts_json and kpis_json directly.
Capsule mode: provide contracts_json and capsule_id to load KPIs from a previously saved experiment capsule.
Args: contracts_json: JSON array of contract dicts. Each dict must have contract_id, kpi_name, contract_type. Optional: expected, tolerance, severity, description. kpis_json: JSON object mapping KPI names to values, e.g. {"max_stress": 345.6}. Required if capsule_id is empty. capsule_id: Load KPIs from this capsule instead of kpis_json.
Contract types: - range: value must be within [min, max] - threshold_gt: value must be greater than X - threshold_lt: value must be less than X - exact: value must equal X (within tolerance) - pct_change: change from baseline must be within X%
Returns: Markdown-formatted contract validation report.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kpis_json | No | ||
| capsule_id | No | ||
| contracts_json | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |