graflo.architecture.evolution.rewrite¶
Structured rewrite of vertex names in pipeline dicts and related resource fields.
collect_endpoint_selectors(pipeline)
¶
(vertex_name, selector) for every endpoint matched on a secondary identity.
Endpoints resolving through the primary identity are omitted — they carry no dependency on a named secondary identity.
Source code in graflo/architecture/evolution/rewrite.py
pipeline_mentions_any_vertex(steps, names)
¶
Return True if any pipeline step references a vertex name in names.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_edge_endpoints_in_pipeline(pipeline, mapping)
¶
Repoint edge steps whose EdgeId appears in mapping at new endpoints.
Keyed on the full (source, target, relation) triple rather than on vertex
names, so an edge step between the same pair of types under a different relation
is left alone.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_edge_properties_in_pipeline(pipeline, *, renames_by_relation=None, removals_by_relation=None)
¶
Rewrite edge actor properties declarations by relation.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_endpoint_selectors_in_pipeline(pipeline, selectors)
¶
Pin primary-identity edge endpoints of selectors keys to a secondary identity.
selectors maps a vertex name to the secondary identity name its endpoints
should select. Used by ReplaceIdentityOp with endpoints: pin_to_retired so
edge steps keep matching on the identity that was just retired.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_entity_names_in_pipeline(step, *, vertices=None, edges=None)
¶
Mutate a pipeline payload in place to rename vertices/relations.
Source code in graflo/architecture/evolution/rewrite.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
rewrite_extra_weights_vertex_field_names(entries, renames_by_vertex)
¶
Rewrite extra_weights[*].vertex_weights for vertex field renames.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_remove_edge_ids_in_pipeline(pipeline, removed_edge_ids)
¶
Drop edge/create_edge steps (and links) targeting removed edge triples.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_remove_relations_in_pipeline(pipeline, removed_relations)
¶
Drop edge/create_edge steps (and links) targeting removed relations.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_remove_vertex_properties_in_pipeline(pipeline, removals)
¶
Remove references to dropped vertex fields from pipeline steps.
Source code in graflo/architecture/evolution/rewrite.py
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 | |
rewrite_vertex_field_names_in_pipeline(pipeline, renames, *, available_vertices=None)
¶
Rewrite vertex field names across a resource pipeline.
Walks the dict pipeline (no runtime tree mutation):
vertexsteps: ensurefrom:covers the rename. Existing{old_field: doc_col}becomes{new_field: doc_col}; missing entries are injected as{new_field: old_field}so the doc can still address the property by its original name.transformsteps withrename: rewrite values that pointed at renamed vertex fields.callsteps are unchanged.edgesteps: rewritevertex_weightsfield/map/filter keys perWeight.name.descendsteps: recurse with an extendedavailable_verticesset.
available_vertices is the set of vertex names visible from the parent
scope. Vertex names introduced at the current level are added automatically.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_vertex_names_in_pipeline(pipeline, mapping)
¶
Rewrite all steps in a resource pipeline.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_vertex_names_in_step(step, mapping)
¶
Return a deep-copied step with vertex names rewritten per mapping.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_vertex_names_in_value(obj, mapping)
¶
Deep-rewrite obj (pipelines, infer specs, extra_weights, nested dicts).
Source code in graflo/architecture/evolution/rewrite.py
rewrite_vertex_weight_names(payload, vertex_name)
¶
Rewrite vertex_weights[].name in place.
Weight.name on an edge step is a vertex name — it selects which endpoint's
observation columns the weight reads — and collect_vertex_names_from_pipeline
counts it as a vertex reference. Missing it leaves a pipeline pointing at a type
the schema no longer has.
Source code in graflo/architecture/evolution/rewrite.py
rewrite_vertex_weights_vertex_field_names(weights, renames_by_vertex)
¶
Rewrite :class:~graflo.architecture.graph_types.Weight field/map/filter keys.
Each weight's name selects the logical vertex whose renames_by_vertex[name]
map applies (old field name -> new field name).