graflo.architecture.evolution.aspects.state.plan¶
Planning the state aspect: validity intervals, observations, units, groundings.
A pure planner: it emits :data:~graflo.architecture.evolution.ops.ManifestOp
values and applies nothing. apply_evolution applies them, invert_ops
undoes them, and the op list itself is the reviewable artifact -- an operator
reads what the lift proposes before any of it runs. That is the whole argument
for expressing this as Operations rather than as a bespoke transform: a
transform is a black box that either did the right thing or did not.
What a lift does not do. It changes the contract, not the data flow. A
lifted manifest declares <Type>State, but no resource populates it, so a
manifest that carries an ingestion_model will still report the profile's
"provenance materialised at ingest" finding afterwards -- correctly.
Scaffolding the pipelines needs resource-level ops and a statement of which
resource feeds which type, and is deliberately out of scope here. This is the
misreading the next reader will have, so it is also in the CLI help.
Attributes¶
__all__ = ['StatePlan', 'plan_state']
module-attribute
¶
Classes¶
StatePlan
¶
Bases: ConfigBaseModel
What the state aspect planned, in the two halves a composed lift needs apart.
Attributes:
| Name | Type | Description |
|---|---|---|
ops |
list[ManifestOp]
|
The additive ops, in application order: grounding first, then structure, then the scaffolding. |
scaffolded |
list[str]
|
Names of the |
retire |
list[ManifestOp]
|
The destructive half, to be applied last. |
Source code in graflo/architecture/evolution/aspects/state/plan.py
Functions:¶
plan_state(manifest, spec, *, authored=None)
¶
The ops that lift manifest into one that tracks state and measurements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
GraphManifest
|
the manifest to lift, already |
required |
spec
|
LiftSpec
|
the semantic declarations the planner cannot infer. |
required |
authored
|
dict[str, Any] | None
|
the manifest as written, when available. Only an authored document distinguishes "this vertex declared no identity" from "this vertex declared every property as its identity", so without it the planner cannot detect the fallback and does not try. |
None
|
Returns:
| Type | Description |
|---|---|
StatePlan
|
The additive ops, the scaffolded type names, and the removals kept |
StatePlan
|
apart so they can run last. Ordering matters -- a property is moved |
StatePlan
|
onto its |
Raises:
| Type | Description |
|---|---|
LiftError
|
a declaration the planner needs is missing, or a name it would mint is already taken. |