flayer.extensions.contracts¶
flayer.extensions.contracts ¶
Typed, versioned extension identities and bounded credential-free contexts.
VERSION_PATTERN
module-attribute
¶
VERSION_PATTERN = re.compile('(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)\\Z')
DISTRIBUTION_PATTERN
module-attribute
¶
DISTRIBUTION_PATTERN = re.compile('[a-z0-9]+(?:-[a-z0-9]+)*\\Z')
TARGET_PATTERN
module-attribute
¶
TARGET_PATTERN = re.compile('[A-Za-z][A-Za-z0-9_]*(?:\\.[A-Za-z][A-Za-z0-9_]*)*:[A-Za-z][A-Za-z0-9_]*(?:\\.[A-Za-z][A-Za-z0-9_]*)*\\Z')
ExtensionError ¶
Bases: ContractError
An extension violates discovery, identity, compatibility, or loading policy.
ExtensionKind ¶
ExtensionDescriptor
dataclass
¶
ExtensionDescriptor(kind: ExtensionKind, plugin_id: str, distribution: str, version: str, group: str, target: str, metadata_directory: Path | None = None, metadata_sha256: str | None = None)
A static identity; external metadata snapshots are not package authenticity proof.
ProviderContext
dataclass
¶
ProviderContext(scope_id: str, authentication_reference: str, command_timeout: float = 45.0, inventory_limit: int = 10000)
Explicit scope, external CLI authentication reference, and bounded execution limits.
ProfileContext
dataclass
¶
ProfileContext(identity: StackIdentity)
Exact stack ownership context; profile configuration and artifacts stay separate.
ProviderExtension ¶
Bases: Protocol
Factory for the existing read-only provider contract, without mandatory mutation.
Descriptor
property
¶
Descriptor: ExtensionDescriptor
Return the exact static identity registered before factory loading.
CreateProvider ¶
CreateProvider(context: ProviderContext) -> CloudProvider
Construct a scoped read-only adapter without probing or mutating infrastructure.
Source code in installed/flayer/extensions/contracts.py
144 145 146 147 | |
LifecycleProviderExtension ¶
Bases: ProviderExtension, Protocol
Optional separate factory for the existing owned resource lifecycle contract.
CreateLifecycleProvider ¶
CreateLifecycleProvider(context: ProviderContext) -> LifecycleProvider
Construct a mutation-capable adapter without performing provider operations.
Source code in installed/flayer/extensions/contracts.py
154 155 156 157 | |
CompiledProfile ¶
Bases: Protocol
Validated profile adapter that preserves existing artifact and lifecycle boundaries.
Identity
property
¶
Identity: StackIdentity
Return the exact identity validated during profile compilation.
BuildServerBundle ¶
BuildServerBundle() -> ArtifactBundle
Generate owned server initialization bytes without writing or deploying them.
Source code in installed/flayer/extensions/contracts.py
170 171 172 173 | |
RenderPlan ¶
RenderPlan(*, user_data_file: str | Path) -> str
Render lifecycle TOML after verifying the exact owned server artifact.
Source code in installed/flayer/extensions/contracts.py
175 176 177 178 | |
ProfileExtension ¶
Bases: Protocol
Compile explicit profile configuration using its own strict versioned schema.
Descriptor
property
¶
Descriptor: ExtensionDescriptor
Return the exact static identity registered before factory loading.
CompileProfile ¶
CompileProfile(configuration: Mapping[str, object], context: ProfileContext) -> CompiledProfile
Validate configuration and exact ownership without accessing infrastructure.
Source code in installed/flayer/extensions/contracts.py
191 192 193 194 195 196 | |