graflo.architecture.evolution.preview_identity¶
How a merged class is keyed, as the merge preview reports it.
One :class:PreviewIdentity per vertex group: the funnel branches in the
order a record tries them, every source that feeds each branch -- the raw
fields a resource reads, the transform and guard that turn them into the
branch value, the tag a local key carries -- and the member keys the new
identity demotes to lookups. Everything is read from the group's effective
declaration (the closed group, with the local keys merge adds itself), the
same one merge lowers, so nothing here restates a rule.
Attributes¶
BranchKind = Literal['raw', 'derived', 'local_key']
module-attribute
¶
IdentityMode = Literal['natural', 'funnel', 'carried']
module-attribute
¶
Classes¶
BranchSource
¶
Bases: ConfigBaseModel
One thing that feeds a branch: a resource's derivation or local key, or a member that carries a property branch.
Source code in graflo/architecture/evolution/preview_identity.py
Attributes¶
auto = PydanticField(default=False, description='Merge added this local key: nothing declared one.')
class-attribute
instance-attribute
¶
derive_at = PydanticField(default=None, description='The declared descend step path for the resource.')
class-attribute
instance-attribute
¶
exists = PydanticField(default=True, description='False when no side has a resource of this name.')
class-attribute
instance-attribute
¶
field = PydanticField(default=None, description='Raw field a local key reads.')
class-attribute
instance-attribute
¶
foo = PydanticField(default=None, description='Transform function.')
class-attribute
instance-attribute
¶
input = PydanticField(default_factory=list, description='Raw fields a derivation reads.')
class-attribute
instance-attribute
¶
label = PydanticField(default='', description='One-line caption: transform and guard, or tag.')
class-attribute
instance-attribute
¶
member = PydanticField(default=None, description='The member a member-keyed entry is for, or the member carrying a property branch.')
class-attribute
instance-attribute
¶
module = PydanticField(default=None, description='Transform module.')
class-attribute
instance-attribute
¶
params = PydanticField(default_factory=dict, description='Transform keyword arguments.')
class-attribute
instance-attribute
¶
produces = PydanticField(default_factory=list, description='Members of the group the resource produces on its side.')
class-attribute
instance-attribute
¶
resource = PydanticField(default=None, description='Union resource name; None for a property branch.')
class-attribute
instance-attribute
¶
side = PydanticField(default=None, description='The side the resource or member comes from.')
class-attribute
instance-attribute
¶
tag = PydanticField(default=None, description="The tag a local key value carries; '' is untagged.")
class-attribute
instance-attribute
¶
tag_omitted = PydanticField(default=False, description='The tag was left out and defaults to the origin.')
class-attribute
instance-attribute
¶
when = PydanticField(default=None, description='The declared guard, as written.')
class-attribute
instance-attribute
¶
PreviewBranch
¶
Bases: ConfigBaseModel
One funnel branch, or one derive attribute.
Source code in graflo/architecture/evolution/preview_identity.py
Attributes¶
fields = PydanticField(default_factory=list, description='Merged attributes the branch reads.')
class-attribute
instance-attribute
¶
id = PydanticField(..., description='Branch id, as the funnel names it.')
class-attribute
instance-attribute
¶
kind = PydanticField(..., description='What the branch keys on.')
class-attribute
instance-attribute
¶
position = PydanticField(..., description='1-based order a record tries it in; 0 for a `derive` entry.')
class-attribute
instance-attribute
¶
sep = PydanticField(default=None, description="What joins a local key's tag and value; None for other kinds.")
class-attribute
instance-attribute
¶
sources = PydanticField(default_factory=list)
class-attribute
instance-attribute
¶
PreviewDemotion
¶
Bases: ConfigBaseModel
A member key the new identity demotes to a lookup-only secondary.
Source code in graflo/architecture/evolution/preview_identity.py
Attributes¶
fields = PydanticField(default_factory=list, description='The key fields, as the member spells them after its vocabulary renames.')
class-attribute
instance-attribute
¶
key_space = PydanticField(..., description='What names the demoted key.')
class-attribute
instance-attribute
¶
member
instance-attribute
¶
merged_fields = PydanticField(default_factory=list, description='Their names on the merged class.')
class-attribute
instance-attribute
¶
side
instance-attribute
¶
tags = PydanticField(default_factory=list, description="Every key space the op's tags name for it.")
class-attribute
instance-attribute
¶
PreviewIdentity
¶
Bases: ConfigBaseModel
How a merged class is keyed, and where every key value comes from.
Source code in graflo/architecture/evolution/preview_identity.py
Attributes¶
branches = PydanticField(default_factory=list)
class-attribute
instance-attribute
¶
demoted = PydanticField(default_factory=list)
class-attribute
instance-attribute
¶
derive = PydanticField(default_factory=list, description='`derive` entries: attributes a branch keys on, computed per resource.')
class-attribute
instance-attribute
¶
derive_at = PydanticField(default_factory=dict)
class-attribute
instance-attribute
¶
digest_field = PydanticField(default=None, description='Where a funnel stores its digest.')
class-attribute
instance-attribute
¶
mode
instance-attribute
¶
retire = PydanticField(default=None, description="What happens to each member's own key.")
class-attribute
instance-attribute
¶
Methods:¶
role_of(attribute)
¶
Positions of the branches that key on merged attribute.
Functions:¶
declared_identity(declaration)
¶
The identity declaration states, read without the manifests.
What :func:identity_block reports minus everything only the manifests
settle: no resource has a side, no member carries a property branch, an
omitted tag stays unresolved, and nothing is demoted or added
automatically.
Source code in graflo/architecture/evolution/preview_identity.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | |
derivation_label(spec)
¶
normalized_key(serial_number), with params, module and guard when set.
Source code in graflo/architecture/evolution/preview_identity.py
identity_block(cluster, resolution, sides, composite)
¶
The :class:PreviewIdentity of one vertex group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cluster
|
Cluster
|
The group, with its effective declaration. |
required |
resolution
|
ClusterResolution
|
The naming resolution it came from. |
required |
sides
|
Mapping[str, GraphManifest]
|
Both manifests, resources renamed as the union names them. |
required |
composite
|
Mapping[Side, CanonicalizeOp]
|
Each side's composite relabel. |
required |
Source code in graflo/architecture/evolution/preview_identity.py
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 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
local_key_label(source, *, origin, auto)
¶
tag maintenance, tag left (default), untagged; · auto when merge added it.