declare_performance
Records a quantitative performance spec on a part to re-prove after edits, storing metric-agnostic requirements in the .FCStd so verify_performance can check them.
Instructions
Record a quantitative PERFORMANCE spec on a part so it can be re-proved after every edit — the performance twin of declare_intent, which only covers geometry. Persists in the .FCStd as a JSON property bag; one contract per part, re-declaring replaces it.
Each requirement is metric-agnostic — the contract layer only orchestrates, so the metric is whatever the named tool already returns, and "Cd ≤ 0.30", "Δp ≤ 50 Pa", "first mode ≥ 200 Hz" and "ΔT ≤ 40 K" are the same machinery:
{"name": "drag_at_cruise",
"metric": "cd", # dotted path into the tool's result
"tool": "cfd_external_flow_submit", # what measures it at solver tier
"conditions": {"model": "$handle", "velocity_m_s": 30, "fluid": "air-20c"},
"limit": {"max": 0.30}, # max, min, or both (a window)
"screen": {"tool": "cfd_body_drag", "metric": "cd",
"conditions": {"shape": "sphere", "diameter_mm": 50,
"velocity_m_s": 30}},
"fidelity_floor": "solver", # "screen" if an estimate is proof enough
"trust": {"converged": true, "band_max_pct": 5}}"$handle" anywhere in conditions is replaced with this part's handle at
verification time, so a contract is portable between parts. trust demands are
enforced by verify_performance against the solver's own trust block: a requirement
asking for converged: true can never be satisfied by an unconverged solve.
Returns {handle, contract: {requirements: [...]}, n_requirements}. Raises ValueError on a malformed requirement, naming the offending one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| handle | Yes | ||
| requirements | Yes |