graflo.architecture.evolution.pipeline_dicts¶
The one place pipeline steps cross between actor models and plain dicts.
A resource's pipeline is a list of actor configs. The rewrite walkers of the
evolution engine still edit steps as dicts: they take them from
:func:pipeline_to_dicts and hand the result back through
:func:pipeline_from_dicts, which validates every step again. Nothing else in
the engine sees a step as a dict.
Attributes¶
P = ParamSpec('P')
module-attribute
¶
R = TypeVar('R')
module-attribute
¶
Classes¶
Functions:¶
pipeline_from_dicts(steps)
¶
Steps a walker rewrote, validated back into actor configs.
Raises:
| Type | Description |
|---|---|
ValueError
|
A rewritten step is not a valid step. |
Source code in graflo/architecture/evolution/pipeline_dicts.py
pipeline_to_dicts(steps)
¶
steps as dicts for a rewrite walker; see :func:step_to_dict.
reads_pipeline(walker)
¶
A dict walker that reads a pipeline, taking the typed pipeline.
Source code in graflo/architecture/evolution/pipeline_dicts.py
resolve_pipeline_level(steps, path)
¶
Return the live step list path addresses inside dict steps.
Mutating the returned list mutates steps. Getting that guarantee requires
rewriting each walked descend step into its normalized form and storing
it back: the shorthand spellings ({descend: {apply: [...]}}, a bare
{key, apply}) keep their sub-steps under a different key, so returning
whatever normalize_actor_step built would hand back a list nothing
holds — and an append into it would vanish without a word. Steps off the
path, and the root level itself, are left exactly as they were.
Raises when the path does not resolve. Every index on the way must address
a descend step; those are the only steps that own a nested level.
Source code in graflo/architecture/evolution/pipeline_dicts.py
rewrites_pipeline(walker)
¶
A dict walker that rewrites a pipeline, typed at both ends.
The walker receives :func:pipeline_to_dicts of the pipeline and its
result goes back through :func:pipeline_from_dicts.
Source code in graflo/architecture/evolution/pipeline_dicts.py
router_of(step)
¶
The router a walker holds as a dict, as its model, for the router's own rules.
Raises:
| Type | Description |
|---|---|
ValueError
|
step is not a valid |
Source code in graflo/architecture/evolution/pipeline_dicts.py
step_to_dict(step)
¶
step as a flat dict with its type; a descend's children under pipeline.