substitutability_check
Swap a component variant into a gated assembly and rerun all gates to test Form/Fit/Function substitutability, deciding whether to reuse the part number or assign a new one.
Instructions
Liskov-substitutability gate — Form/Fit/Function as code (§7.1, #147). Take an assembly that gates green with variant A in a slot, swap in variant B (a different family row, or any part claiming the same interface), and re-run merge_assembly + all the gates. Still green ⇒ B is interchangeable with A — by construction a compatible (MINOR/PATCH) change ⇒ revise the existing part number; a gate now fails ⇒ the swap broke Form/Fit/Function ⇒ a new part number. Purely deterministic (no API, no judgment); the substitutability test #138 (B1 families) and #146 (the interface registry) call.
manifest: path to a manifest that gates green with variant A in slot.
slot: the component id to swap (variant A → variant B).
variant: the replacement component spec — a dict with exactly one of
file/manifest/library (the same one-source rule merge_assembly enforces).
verify_baseline: re-merge the base assembly first and require it green so the
premise is honest (default True).
Function, not just Form and Fit (#261): if the swapped-in variant declares a
PERFORMANCE contract (#226), it is part of the comparison. A contract measured as
NOT met breaks the performance gate like any other. A contract with NO recorded
verdict yields a THIRD answer — substitutable: null, verdict
'performance_unproven' — because an unverified spec is not a passed spec, and
handing an unproven part an existing part number is the silent pass #226 prevents.
Returns {schema, slot, variant, baseline_ok, swap_ok, substitutable (True | False | null), verdict ('substitutable' | 'not_substitutable' | 'baseline_not_green' | 'performance_unproven'), broken_gates (the NAMED gate(s) the swap broke), broken (gate→violations), classification (compatibility/semver/decision), performance? (only when a component declares a contract), reports}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slot | Yes | ||
| variant | Yes | ||
| manifest | Yes | ||
| verify_baseline | No |