graflo.architecture.evolution.aspects.recipe¶
What a lift was asked to do, recorded so that it can be done again.
A lift is a join, so what it adds cannot be told apart from vocabulary the
manifest declared itself, and the spec that produced it cannot be read back
from the result. A :class:LiftRecipe keeps both: the aspects as named, the
version of each, and the spec. A lift commit carries one, the way a merge
commit carries a MergeRecipe, and :func:plan_relift plans the same lift
again on a manifest that has moved on since.
Attributes¶
__all__ = ['LiftRecipe', 'build_lift_recipe', 'plan_relift', 'recipe_drift', 'recorded_spec']
module-attribute
¶
Classes¶
LiftRecipe
¶
Bases: ConfigBaseModel
The aspects a manifest was lifted with, their versions and the spec.
Source code in graflo/architecture/evolution/aspects/recipe.py
Attributes¶
aspects = PydanticField(..., min_length=1, description='The aspects lifted, in the order named.')
class-attribute
instance-attribute
¶
base = PydanticField(..., description='Content hash of the manifest the lift was planned on.')
class-attribute
instance-attribute
¶
graflo_version = PydanticField(default=None, description='The graflo that planned the lift, when known.')
class-attribute
instance-attribute
¶
kind = 'lift'
class-attribute
instance-attribute
¶
spec = PydanticField(default_factory=dict, description='The lift spec, without its defaults (see `recorded_spec`).')
class-attribute
instance-attribute
¶
versions = PydanticField(..., description='The version of each aspect at the time of the lift.')
class-attribute
instance-attribute
¶
Methods:¶
content_hash()
¶
Content address of what the lift declared.
graflo_version is left out: it says which tool planned the lift,
not what was asked of it, and the aspect versions already say whether
the vocabulary differs.
Source code in graflo/architecture/evolution/aspects/recipe.py
Functions:¶
build_lift_recipe(manifest, spec=None, *, aspects)
¶
The recipe of lifting manifest with aspects under spec.
Raises:
| Type | Description |
|---|---|
LiftError
|
an aspect name no aspect has. |
Source code in graflo/architecture/evolution/aspects/recipe.py
plan_relift(recipe, manifest, *, authored=None)
¶
The ops that lift manifest again as recipe records.
manifest need not be the one the recipe was planned on: a re-lift is
for a manifest that has moved on, or for an aspect whose version has
(see :func:recipe_drift). A manifest that already carries everything
plans no ops.
Raises:
| Type | Description |
|---|---|
LiftError
|
as :func: |
Source code in graflo/architecture/evolution/aspects/recipe.py
recipe_drift(recipe)
¶
The aspects whose version moved since recipe: {name: (recorded, now)}.
Raises:
| Type | Description |
|---|---|
LiftError
|
an aspect the recipe names that no longer exists. |
Source code in graflo/architecture/evolution/aspects/recipe.py
recorded_spec(spec)
¶
spec as a recipe records it: no defaults, set-like lists sorted.
Without defaults, a field added to :class:LiftSpec later does not move
the hash of a recipe recorded before it. The lists the planners read as
sets are sorted, so two declarations that plan the same lift are the same
recipe.