graflo.architecture.contract.ingestion.steps.ref¶
Addressing edge steps inside a pipeline.
A pipeline is a list of authored step mappings, nested through descend
steps, and an edge step may carry several intents in links. Anything that
reasons about which step writes which edge -- an audit, an evolution op that
flips a step option -- needs one way to walk those and one way to name a
position. This module is both, and nothing else: it reads the authored shape
and never validates a step beyond normalizing its spelling.
Attributes¶
__all__ = ['EdgeStepRef', 'EdgeStepView', 'find_edge_step', 'iter_edge_steps', 'with_emit_inverse']
module-attribute
¶
Classes¶
EdgeStepRef
¶
Bases: ConfigBaseModel
The position of one edge intent in a pipeline.
at descends through nested pipelines by step index, step is the
index within the pipeline reached, and link selects one entry of that
step's links. A ref is positional: it names a place, so it stays valid
only while the steps before it are not reordered.
Source code in graflo/architecture/contract/ingestion/steps/ref.py
Attributes¶
at = PydanticField(default_factory=list, description='Step indexes of the enclosing descend steps, outermost first.')
class-attribute
instance-attribute
¶
link = PydanticField(default=None, ge=0, description="Index into the step's `links`, if it has them.")
class-attribute
instance-attribute
¶
sort_key
property
¶
step = PydanticField(..., ge=0, description='Index within its pipeline.')
class-attribute
instance-attribute
¶
Methods:¶
EdgeStepView
dataclass
¶
One edge intent as authored, with the fields that decide what it writes.
Source code in graflo/architecture/contract/ingestion/steps/ref.py
Attributes¶
emit_inverse
property
¶
payload
instance-attribute
¶
The normalized step, or the link entry for a multi-link step.
ref
instance-attribute
¶
relation
property
¶
relation_is_data_driven
property
¶
Whether the relation is resolved per document rather than fixed here.
source
property
¶
static_edge_id
property
¶
(source, target, relation) when all three are fixed by the step.
target
property
¶
Methods:¶
__init__(ref, payload)
¶
relations_written()
¶
Relation names the step can write, or None when that is open-ended.
A fixed relation is one name. A mapped relation_field that writes
only what it maps (relation_map_only) is the map's values, plus the
fixed fallback. Anything else -- an unmapped field, a relation taken
from a document key -- can name any relation the data carries.
Source code in graflo/architecture/contract/ingestion/steps/ref.py
Functions:¶
find_edge_step(pipeline, ref)
¶
The edge intent at ref, or None when ref names no edge intent.
Source code in graflo/architecture/contract/ingestion/steps/ref.py
iter_edge_steps(pipeline, *, at=())
¶
Every edge intent of pipeline, nested pipelines and links included, in order.
Source code in graflo/architecture/contract/ingestion/steps/ref.py
with_emit_inverse(pipeline, ref, enabled)
¶
pipeline with emit_inverse set or cleared on the intent at ref.
The step keeps the spelling it was authored in (edge: wrapper or flat
fields, pipeline or apply); only the one key changes, and clearing
removes it rather than writing false, which is the default.
Raises:
| Type | Description |
|---|---|
ValueError
|
when ref names no edge intent. |