Skip to content

Integration contract

This page is for applications that consume compiled decks. Rule authors can use the validation guide.

Compiled models

CompiledDeck.graph contains inputs, operations, and rules, without local asset paths. local_inputs holds local reference bindings for export; do not transmit the whole CompiledDeck object. requirements lists operation versions and options. Collections are tuples and models are frozen.

DeckModel in fabcheck.models checks model structure. validate_model() also checks references, types, dimensions, duplicate names, cycles, rule outputs, collection scope, and coordinate contexts. It revalidates nested models, including instances made with unchecked Pydantic APIs such as model_copy and model_construct. Consumers must validate received models even if the producer already validated them.

Every operation has a fixed parameter model and input/output types. Unknown operations, wrong parameter types, and extra fields are rejected. Compiled graphs contain no arbitrary native calls or Python callbacks. A new operation needs a descriptor, validation, a defined behavior, and backend support.

Local reference bindings, when supplied, must match every declared reference exactly once. The Deck builder supplies these bindings. Validation checks the declarations; export checks paths and embeds reference files.

Capability manifests

Capabilities lists model versions and OperationSupport entries. Each entry names an operation/version and the supported categorical values in OptionSupport. Missing operations, versions, or option values are errors. Supporting one version does not imply support for another. A declared option domain covers all combinations allowed by that operation's model.

Nested options, such as window placement, are listed explicitly. User-supplied names, paths, numbers, and messages are not capability enums. Requirements are recomputed from the graph on receipt.

Used feature Additional requirement What it does and why
Conditional rule report.rule/v1, when=true The rule may be skipped based on a runtime condition. The backend needs this option so it handles both the calculation and missing report category correctly.
Category text override, including an empty string report.rule/v1, category_description=true The author can replace category text, even with an empty string. The backend needs this option to preserve that report choice rather than use a default message.
Tiled global density region.density/v1, tiled=true The density total is accumulated tile by tile. The backend needs this option because tiled area rounding can change the result.
Density include / exemption masks region.density/v1, has_include=true / has_exempt=true The check includes only selected windows or skips exempt ones. The backend needs the mask option so these sample choices are not silently ignored.

Ordinary rules, untiled density, and absent masks do not add these requirements. These options do not change the graph version or .fcd format.

Source locations

The builder records local Python file/line locations separately from the graph. They are excluded from serialized graphs and may be absent from models created directly. Consumers should use rule IDs and model paths when source locations are unavailable.

See the compiled deck format for file encoding and asset checks.