Model
hexa.model
Summary
Shared neutral model for hexa port trees.
All utilities (parse_yaml, generate_abc, parse_abc,
generate_yaml, check_matches) serialize through this single model.
It is NOT tied to any sample — any port tree fits.
Classes
MethodSpec
dataclass
Specification of a single abstract method.
PortNode
dataclass
A node in the hexa port tree.
Parameters
name : str
Slot name, e.g. "parser", "amount_balance".
kind : str
One of "leaf", "port", or "parent".
- "leaf": no children (e.g. NumberPort)
- "port": has children (e.g. TransactionParserPort)
- "parent": the root of the tree (e.g. ExtractionPipeline)
port_cls : str
ABC class name that gives this port its shape, e.g.
"TransactionParserPort". Every port has a concrete typed shape.
attributes : dict[str, ConfigValue]
Annotated attributes: name -> type_expr for scalars, or a nested
dict of sub-attributes (a struct) for grouped/structured values.
children : list[PortNode]
Nested port slots.
methods : dict[str, MethodSpec]
Abstract methods keyed by method name.
Functions
diff
Return a list of human-readable difference strings.
An empty list means the trees are equal.