graflo.architecture.evolution.ops.resources¶
Ops that rewrite ingestion resources.
Classes¶
AddResourceTransformsOp
¶
Bases: ConfigBaseModel
Append transform steps to named resources' pipelines.
The first op whose primary effect is ingestion: graph_schema is
untouched. Steps land at the root level of each pipeline unless at
names a deeper one; at whichever level they land, actor type-priority
sorting (transform runs before vertex extraction at the same level) makes
the position safe.
The level is load-bearing rather than cosmetic. An actor reads its
transform buffer at its own LocationIndex with no ancestor fallback,
and a descend subtree runs before its own level's transforms, so a
step appended at the root is invisible to a vertex produced under a
descend — and a transform whose declared inputs are missing skips
silently by default. Target the level that produces the vertex.
Steps may reference a registry transform via call.use (resolved
against the manifest's existing ingestion_model.transforms union the
op's own transforms) or carry a fully inline call
(module + foo + params), which cannot collide by name.
Source code in graflo/architecture/evolution/ops/resources.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
Attributes¶
additions = PydanticField(..., description='Per-resource transform steps to append: ``{resource_name: [step_dict, ...]}``.', min_length=1)
class-attribute
instance-attribute
¶
at = PydanticField(default_factory=dict, description='Per-resource pipeline level to append into: ``{resource_name: [step_index, ...]}``. Each index must address a ``descend`` step, descending one level per element; an omitted or empty path means the root level.')
class-attribute
instance-attribute
¶
op = 'add_resource_transforms'
class-attribute
instance-attribute
¶
transforms = PydanticField(default_factory=list, description='Named transforms to register in ``ingestion_model.transforms`` for steps that reference them via ``call.use``. A name already registered with a different body is an error at apply time.')
class-attribute
instance-attribute
¶
AddResourcesOp
¶
Bases: ConfigBaseModel
Introduce ingestion resources, in the shape the ingestion block accepts.
The unary way to grow ingestion_model: without it a change set could
only ever rename or narrow the resources it started with, and the differ
had to report an added resource as inexpressible.
Source code in graflo/architecture/evolution/ops/resources.py
Attributes¶
op = 'add_resources'
class-attribute
instance-attribute
¶
resources = PydanticField(..., description='Full resource definitions.', min_length=1)
class-attribute
instance-attribute
¶
transforms = PydanticField(default_factory=list, description='Named transforms to register in ``ingestion_model.transforms`` for steps of the new resources that reference them via ``call.use``. Unioned by name exactly as ``add_resource_transforms`` does: an identical body already registered dedupes, a different one is an error at apply time.')
class-attribute
instance-attribute
¶
EnsureExtractedFields
¶
Bases: ConfigBaseModel
Fields that must survive extraction for one vertex type at one level.
Source code in graflo/architecture/evolution/ops/resources.py
Attributes¶
at = PydanticField(default_factory=list, description='Pipeline level holding the producing step, as ``descend`` step indices. Empty means the root level.')
class-attribute
instance-attribute
¶
fields = PydanticField(..., min_length=1, description='Property names that must reach the extracted vertex document.')
class-attribute
instance-attribute
¶
vertex = PydanticField(..., description='The vertex type whose extraction must keep ``fields``.')
class-attribute
instance-attribute
¶
EnsureExtractedFieldsOp
¶
Bases: ConfigBaseModel
Widen a producing step's projection so named fields are not dropped.
Needed because a vertex_router delivers differently from a vertex
step. The router builds its child VertexActor at
lindex.extend((role, 0)), where the transform buffer is empty, so
derived fields reach the child only through the merged observation — that
is, through passthrough or from. A plain vertex step instead reads
the buffer directly, which bypasses keep_fields and
extraction_scope entirely.
So on a router, extraction_scope: mapped_only or a keep_fields list
that does not name the fields drops them silently. This op restores them:
keep_fields gains the names, and under mapped_only the per-type
vertex_from_map entry gains identity mappings — seeded from the
router-level from when the entry does not exist yet, since creating it
otherwise replaces the author's projection rather than extending it.
A plain vertex step, or a router that restricts nothing, is a no-op:
the fields already survive.
Source code in graflo/architecture/evolution/ops/resources.py
RemoveResourcesOp
¶
Bases: ConfigBaseModel
Remove ingestion resources and the bindings that wired them.
Source code in graflo/architecture/evolution/ops/resources.py
RenameResourcesOp
¶
Bases: ConfigBaseModel
Rename ingestion resource names and bindings references.
Source code in graflo/architecture/evolution/ops/resources.py
Attributes¶
op = 'rename_resources'
class-attribute
instance-attribute
¶
renames = PydanticField(..., validation_alias=AliasChoices('renames', 'resources'), description='Ingestion resource rename map: ``{old_resource: new_resource}``. Must be injective. ``resources`` is accepted as a legacy alias.', min_length=1)
class-attribute
instance-attribute
¶
ReplaceResourcesOp
¶
Bases: ConfigBaseModel
Replace the definitions of existing resources, matched by name.
Each resource keeps its position in ingestion_model.resources and its
bindings; only its definition changes. This is how an edited pipeline is
expressed, since a pipeline is an ordered program no finer op can patch.