gds.ir¶
Models¶
Bases: BaseModel
A complete composed system — the top-level IR unit.
Domain packages wrap this with additional metadata (e.g., terminal conditions, action spaces for open games).
Source code in packages/gds-framework/gds/ir/models.py
Bases: BaseModel
A single block in the flat IR representation.
The block_type is a plain string — domain packages define their own
type taxonomies (e.g., "decision", "policy", "mechanism").
Source code in packages/gds-framework/gds/ir/models.py
Bases: BaseModel
A directed connection (edge) between blocks in the IR.
is_feedback and is_temporal flags distinguish special wiring
categories for verification. The category field is an open string
that domain packages can use for domain-specific edge classification;
the generic protocol only interprets "dataflow".
Source code in packages/gds-framework/gds/ir/models.py
Bases: BaseModel
An external input to the system.
Layer 0 defines only name and a generic metadata bag.
Domain packages store their richer fields (e.g., input_type, schema_hint)
inside metadata when projecting to SystemIR.
Source code in packages/gds-framework/gds/ir/models.py
Bases: BaseModel
A node in the composition tree for visualization.
Leaf nodes (composition_type=None) map 1:1 to a BlockIR. Interior nodes represent composition operators and contain children.
Source code in packages/gds-framework/gds/ir/models.py
Bases: StrEnum
Direction of an information flow in a block composition.
- COVARIANT — forward data flow (forward_in → forward_out direction).
- CONTRAVARIANT — backward feedback flow (backward_out → backward_in direction).
Source code in packages/gds-framework/gds/ir/models.py
Bases: StrEnum
How blocks are composed within a system.
- SEQUENTIAL — output of one feeds input of next (stack).
- PARALLEL — blocks run side-by-side with no shared wires.
- FEEDBACK — backward_out→backward_in connections within a timestep.
- TEMPORAL — forward_out→forward_in connections across timesteps.
Source code in packages/gds-framework/gds/ir/models.py
Utilities¶
Convert an arbitrary name to a valid IR/Mermaid identifier.
Replaces any character that is not alphanumeric or underscore with _.
Prepends _ if the result starts with a digit.
Source code in packages/gds-framework/gds/ir/models.py
Serialization¶
Bases: BaseModel
Top-level IR document containing one or more systems.
Source code in packages/gds-framework/gds/ir/serialization.py
Bases: BaseModel
Metadata envelope for an IR document.