graflo.architecture.evolution.apply¶
Apply manifest evolution operations to a copy of a :class:~graflo.architecture.contract.manifest.GraphManifest.
Attributes¶
logger = logging.getLogger(__name__)
module-attribute
¶
Classes¶
Functions:¶
apply_add_edge_properties(manifest, op)
¶
Append new edge properties to existing relations.
Source code in graflo/architecture/evolution/apply.py
apply_add_inverse_edges(manifest, op)
¶
Realize declared inverses as explicit edges across schema, profile and ingestion.
Source code in graflo/architecture/evolution/apply.py
apply_add_vertex_properties(manifest, op)
¶
Append new vertex properties to existing vertices.
Source code in graflo/architecture/evolution/apply.py
apply_canonicalize(manifest, op)
¶
Mutate manifest in place: relabel by op's vocabulary map in one step.
Every refusal — unknown names, an undeclared occupied target, an attribute collision, an unacknowledged self-relation or observation fusion — leaves manifest untouched: the work happens on a copy that is swapped in only once it is accepted.
Source code in graflo/architecture/evolution/apply.py
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 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 | |
apply_declare_edge_inverses(manifest, op)
¶
Record inverse pairs and symmetric relations; creates no edge.
Restating a declaration, in either order, is a no-op; giving a relation a second inverse is refused by the one table rule.
Source code in graflo/architecture/evolution/apply.py
apply_evolution(manifest, ops, *, bump_version='minor', finish_init=True, strict_references=False, dynamic_edge_feedback=False)
¶
Return a deep copy of manifest with ops applied and optionally re-initialized.
Compare before/after contract identity with :func:graflo.migrate.io.manifest_hash
(stable hash over schema, ingestion_model, and bindings blocks).
MergeManifestsOp is rejected at dispatch — use
:func:~graflo.architecture.evolution.merge.merge_manifests instead.
Source code in graflo/architecture/evolution/apply.py
apply_manifest_ops_inplace(manifest, ops)
¶
Apply each evolution op to manifest in place.
Does not copy the manifest, bump schema version, or call :meth:GraphManifest.finish_init.
Callers that need re-validation after mutation should invoke finish_init themselves.
MergeManifestsOp is rejected at dispatch — use
:func:~graflo.architecture.evolution.merge.merge_manifests instead.
Source code in graflo/architecture/evolution/apply.py
apply_merge_edges(manifest, op)
¶
Merge edge relation names into one canonical relation.
Source code in graflo/architecture/evolution/apply.py
apply_merge_vertices(manifest, op)
¶
Mutate manifest in place: merge source vertices into into.
Source code in graflo/architecture/evolution/apply.py
apply_project_manifest(manifest, op)
¶
Project manifest to surviving vertices/edges with consistent cascade.
Source code in graflo/architecture/evolution/apply.py
apply_remove_edge_ids(manifest, removed_edge_ids)
¶
Remove edges by logical triple and prune related references.
Source code in graflo/architecture/evolution/apply.py
1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 | |
apply_remove_edge_properties(manifest, op)
¶
Remove edge properties by relation and clean references.
Source code in graflo/architecture/evolution/apply.py
apply_remove_edges(manifest, op)
¶
Remove edges by relation name and/or by triple, pruning related references.
Source code in graflo/architecture/evolution/apply.py
1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 | |
apply_remove_vertex_properties(manifest, op)
¶
Remove vertex properties and clean up ingestion/db profile references.
Source code in graflo/architecture/evolution/apply.py
1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 | |
apply_remove_vertices(manifest, op)
¶
Mutate manifest in place: cascade-remove vertices (schema, ingestion, bindings).
Source code in graflo/architecture/evolution/apply.py
apply_rename_edge_properties(manifest, op)
¶
Rename edge properties by relation and propagate references.
Source code in graflo/architecture/evolution/apply.py
apply_rename_relations(manifest, op)
¶
Rename logical relation names across schema/ingestion/db profile.
Source code in graflo/architecture/evolution/apply.py
apply_rename_resources(manifest, op)
¶
Rename ingestion resources and bindings references.
Source code in graflo/architecture/evolution/apply.py
apply_rename_vertex_properties(manifest, op)
¶
Rename vertex properties (and their references) across the manifest.
Mutates manifest in place:
- Rewrites schema
Field.nameandvertex.identity. - Rewrites :class:
DatabaseProfilefield references (vertex_indexes, edge_specs.indexes, default_property_values). - Rewrites resource pipelines so that
VertexActor.fromcovers the rename andTransformActor.renameproduces the renamed property (see :func:rewrite_vertex_field_names_in_pipeline). - Rewrites
Resource.extra_weights/vertex_weights(and anyvertex_weightsembedded inedgepipeline steps).
Source code in graflo/architecture/evolution/apply.py
apply_rename_vertices(manifest, op)
¶
Rename logical vertex names across schema/ingestion/bindings.
Source code in graflo/architecture/evolution/apply.py
apply_retract_edge_inverses(manifest, op)
¶
Withdraw declarations by relation name; refused while a native inverse realizes one.
Source code in graflo/architecture/evolution/apply.py
apply_sanitize(manifest, op)
¶
Apply DB-flavor-specific sanitization to manifest in place.
Merges:
- Storage-name sanitization on :class:
DatabaseProfile. - Reserved-word vertex field renames (via
apply_rename_vertex_properties). - TigerGraph identity normalization (cross-relation), propagated to ingestion via the same field-rename code path.
Source code in graflo/architecture/evolution/apply.py
relabel_vertex_fields(vertex, renames)
¶
One vertex with its attribute names rewritten, as a new validated model.
Every field-set that names a property follows the rename: properties,
identity, hash_identity_properties, each funnel branch's fields
and when_all_present, and each secondary identity's fields.
A property whose new name is already taken is dropped, not appended.
That is not a shortcut -- _check_property_renames has already refused a
genuine rename collision by then, naming it as one. Appending instead would
hand :meth:Vertex.set_identity two fields of one name, and the
union_field_lists it runs would report a type conflict for what is
really a collision, misclassified and wrapped by pydantic besides.
Pure: the argument is untouched, and the result is built in one
model_validate rather than by assignment, so there is no intermediate
state in which validate_assignment can re-add a stale pre-rename name
as an untyped ghost property.