Skip to content

graflo.architecture.evolution.project

Pure planning for :class:~graflo.architecture.evolution.ops.ProjectManifestOp.

Selector validation and manifest unwrapping live here; the induced-connectivity kernel itself lives at layer 2 in :mod:graflo.architecture.schema.projection so manifest projection and schema context projection cannot drift apart.

compute_projection(manifest, op)

Compute survivor/removal sets without mutating manifest.

Source code in graflo/architecture/evolution/project.py
def compute_projection(
    manifest: GraphManifest, op: ProjectManifestOp
) -> SubschemaSelection:
    """Compute survivor/removal sets without mutating *manifest*."""
    schema = manifest.graph_schema
    if schema is None:
        raise ValueError("project_manifest requires graph_schema")

    if op.strict:
        _validate_strict(manifest, op)

    return select_induced(
        schema.core_schema,
        keep_vertices=op.keep_vertices,
        keep_edge_ids=(
            _selector_edge_ids(op.keep_edges) if op.keep_edges is not None else None
        ),
        connectivity=op.connectivity,
    )