flayer.core.lifecycle¶
flayer.core.lifecycle ¶
Owned deployment orchestration with durable progress and fail-closed recovery.
LifecycleError ¶
Bases: ContractError
An operation is blocked or requires explicit interrupted-operation recovery.
DeploymentPlan
dataclass
¶
DeploymentPlan(identity: StackIdentity, resources: tuple[ResourceSpec, ...])
Immutable desired resources with a deterministic dependency order.
OrderedResources ¶
OrderedResources() -> tuple[ResourceSpec, ...]
Return a stable topological ordering or reject cyclic dependencies.
源代码位于: installed/flayer/core/lifecycle.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
Fingerprint ¶
Fingerprint() -> str
Bind recovery to exact intent without persisting desired parameters in state.
源代码位于: installed/flayer/core/lifecycle.py
121 122 123 124 125 126 | |
LifecycleObservation
dataclass
¶
LifecycleObservation(logical_id: str, status: str, resource_id: str | None = None, provider_status: str | None = None)
Sanitized local ownership and remote existence summary for one logical resource.
LifecycleReport
dataclass
¶
LifecycleReport(action: str, status: str, resources: tuple[LifecycleObservation, ...] = (), recovery_required: bool = False)
Truthful operation outcome without raw provider commands, errors, or parameters.
ExitCode ¶
ExitCode() -> int
Report nonzero whenever an operation failed or is awaiting recovery.
源代码位于: installed/flayer/core/lifecycle.py
219 220 221 222 | |
LifecycleEngine ¶
LifecycleEngine(plan: DeploymentPlan, provider: LifecycleProvider, state_path: str | Path)
Compose a scoped provider with durable owned-state lifecycle semantics.
Reject a provider or path that cannot represent the exact desired scope.
源代码位于: installed/flayer/core/lifecycle.py
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 | |
Status ¶
Status() -> LifecycleReport
Read exact owned remote existence without changing state or creating resources.
源代码位于: installed/flayer/core/lifecycle.py
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | |
Create ¶
Create() -> LifecycleReport
Create missing owned resources and roll back only this operation's creations.
源代码位于: installed/flayer/core/lifecycle.py
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 | |
Destroy ¶
Destroy() -> LifecycleReport
Remove only recorded exact-owned resources in reverse dependency order.
源代码位于: installed/flayer/core/lifecycle.py
679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | |
Recover ¶
Recover(rollback: bool = False) -> LifecycleReport
Explicitly resume durable intent, never recreate an unresolved ambiguous create.
源代码位于: installed/flayer/core/lifecycle.py
724 725 726 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 | |
CoreKind ¶
CoreKind(kind: ResourceKind) -> str
Bridge provider enum spelling to the portable hyphenated state contract.
源代码位于: installed/flayer/core/lifecycle.py
55 56 57 58 | |
ProviderKind ¶
ProviderKind(kind: str) -> ResourceKind
Accept only an explicitly recognized portable lifecycle resource kind.
源代码位于: installed/flayer/core/lifecycle.py
61 62 63 64 65 66 67 68 | |
LoadDeploymentPlan ¶
LoadDeploymentPlan(path: str | Path) -> DeploymentPlan
Load explicit version-one lifecycle TOML without resolving credential material.
源代码位于: installed/flayer/core/lifecycle.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 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 | |