Documentation
¶
Overview ¶
Package resolvedplan compiles the Architecture v2 intent, immutable kit definition, observed inventory, and a governed contract catalog into the one deterministic plan consumed by later generators and runtimes.
CUE remains the schema authority. The document types deliberately retain a JSON-shaped boundary instead of duplicating the full CUE type system in Go. Compile performs the cross-document and catalog resolution that CUE alone cannot perform, and MarshalCanonical emits a CUE-compatible JSON document.
Index ¶
- Constants
- func AdmittedComponentReleases(catalog Catalog, moduleRef string) []string
- func AssessCapacity(plan ResolvedPlan) (capacityfit.Assessment, error)
- func AssessCapacityWithContext(plan ResolvedPlan, context CapacityContext) (capacityfit.Assessment, error)
- func CanonicalJSON(value any) ([]byte, error)
- func CanonicalPlanHash(plan ResolvedPlan) (string, error)
- func CanonicalSHA256(value any) (string, error)
- func CapacityPolicyFromDefinition(definition KitDefinition) (*capacityfit.Policy, error)
- func ComputeBackupTargetRequirementHash(requirement BackupTargetRequirement) (string, error)
- func ComputeExternalBackupTargetBindingHash(binding ExternalBackupTargetBinding) (string, error)
- func ComputeExternalFederationLinkBindingHash(binding ExternalFederationLinkBinding) (string, error)
- func ComputeExternalHomeAccessBindingHash(binding ExternalHomeAccessBinding) (string, error)
- func ComputeExternalHomeBackupTargetBindingHash(binding ExternalHomeBackupTargetBinding) (string, error)
- func ComputeExternalHostBindingHash(binding ExternalHostBinding) (string, error)
- func ComputeExternalHostRequirementsHash(plan ResolvedPlan, nodeRef string) (string, error)
- func ComputeFederationLinkRequirementHash(requirement FederationLinkRequirement) (string, error)
- func ComputeHomeAccessOverlayRealizationHash(realization map[string]any) (string, error)
- func ComputeHomeAccessRequirementHash(requirement HomeAccessRequirement) (string, error)
- func ComputeHomeBackupTargetRequirementHash(requirement HomeBackupTargetRequirement) (string, error)
- func ComputeHostConformanceReceiptDigest(receipt HostConformanceReceipt) (string, error)
- func DecodeDocument[T ~map[string]any](data []byte) (T, error)
- func ProjectCapacityModules(modules []any) ([]capacityfit.Module, error)
- func ProjectNotificationChannel(channel map[string]any) (map[string]any, error)
- func ProjectRecoveryObjectives(data map[string]any, applications []localbackuppolicy.ApplicationVolume) ([]localbackuppolicy.RecoveryObjective, error)
- func ReissueInventoryExternalBindings(inventory InventoryFacts, ...) (InventoryFacts, []ReissuedExternalBinding, error)
- func ValidateExternalBackupTargetBindingsFreshness(plan ResolvedPlan, at time.Time) error
- func ValidateExternalFederationLinkBinding(binding ExternalFederationLinkBinding, requirement FederationLinkRequirement) error
- func ValidateExternalFederationLinkBindingsFreshness(plan ResolvedPlan, at time.Time) error
- func ValidateExternalHomeAccessBindingsFreshness(plan ResolvedPlan, at time.Time) error
- func ValidateExternalHomeBackupTargetBindingsFreshness(plan ResolvedPlan, at time.Time) error
- func ValidateExternalHostBindingForReceipt(binding ExternalHostBinding, at time.Time) error
- func ValidateExternalHostBindingFreshness(binding ExternalHostBinding, at time.Time) error
- func ValidateExternalHostBindingsFreshness(plan ResolvedPlan, at time.Time) error
- func ValidateHostConformanceReceiptsForApply(plan ResolvedPlan, at time.Time) error
- func VerifyPlanHash(plan ResolvedPlan) (string, error)
- func VersionAtLeast(actual, minimum string) (bool, error)
- type AddOnContract
- type ApplicationLifecycleContract
- type BackupTargetRequirement
- type CUEContractValidator
- func NewCUEContractValidator(moduleRoot string) (*CUEContractValidator, error)
- func NewCUEContractValidatorForAuthority(moduleRoot string, authority PlanAuthority) (*CUEContractValidator, error)
- func NewCUEContractValidatorFromSources(virtualModuleRoot string, sources map[string][]byte) (*CUEContractValidator, error)
- func NewCUEContractValidatorFromSourcesForAuthority(virtualModuleRoot string, sources map[string][]byte, authority PlanAuthority) (*CUEContractValidator, error)
- func (v *CUEContractValidator) NormalizeStackSpecBinding(definition KitDefinition, spec StackSpecV2) (StackSpecV2, error)
- func (v *CUEContractValidator) ValidateCanonicalPlan(plan ResolvedPlan) error
- func (v *CUEContractValidator) ValidateFederationRemoteActionEnvelope(raw []byte) error
- func (v *CUEContractValidator) VerifyNormalizedCatalog(catalog Catalog) error
- type CapabilityContract
- type CapabilityProvider
- type CapacityContext
- type Catalog
- type CompileError
- type Compiler
- type CompilerVersionMismatchError
- type ErrorCode
- type ExternalBackupTargetBinding
- type ExternalFederationLinkBinding
- type ExternalHomeAccessBinding
- type ExternalHomeBackupTargetBinding
- type ExternalHostBinding
- type FederationLinkRequirement
- type HomeAccessRequirement
- type HomeBackupTargetRequirement
- type HostConformanceReceipt
- type Input
- type InventoryFacts
- type KitDefinition
- type ModuleComputeProfileInput
- type ModuleContract
- type ModuleLoadResolver
- type Options
- type PlanArtifactContract
- type PlanAuthority
- type PrivilegedInterfaceApproval
- type RILActionExecutorContract
- type RILActionPrimitiveContract
- type ReissuedExternalBinding
- type ResolvedPlan
- type StackSpecV2
- type WorkloadComputeTierFit
- type WorkloadContract
Constants ¶
const ( ReissuedHomeBackupTargetBinding = "home-backup-target" ReissuedFederationLinkBinding = "federation-link" )
Binding kinds of ReissuedExternalBinding.
const ( // ResolvedPlanAPIVersion is the only plan contract emitted by the // Architecture v2 compiler. A StackSpec v1 document is never accepted as a // ResolvedPlan through the integrity helpers below. ResolvedPlanAPIVersion = "stackkit.resolved-plan/v1" ResolvedPlanKind = "ResolvedPlan" )
const ComponentReleaseSetting = componentReleaseSetting
ComponentReleaseSetting is the workload setting that selects a release.
const NotificationIntentAPIVersion = "stackkit.notification-intent/v1"
NotificationIntentAPIVersion identifies the secret-free owner notification projection carried by a ResolvedPlan.
Variables ¶
This section is empty.
Functions ¶
func AdmittedComponentReleases ¶
AdmittedComponentReleases names the releases a catalog module admits for its entry component, default first; it is empty without a release choice.
func AssessCapacity ¶ added in v0.53.1
func AssessCapacity(plan ResolvedPlan) (capacityfit.Assessment, error)
AssessCapacity projects a freshly compiled plan and its exact inventory into the shared numeric engine without a resident-load policy. It grants no execution or host-attestation rights.
func AssessCapacityWithContext ¶ added in v0.53.17
func AssessCapacityWithContext(plan ResolvedPlan, context CapacityContext) (capacityfit.Assessment, error)
AssessCapacityWithContext is AssessCapacity plus the resident-load policy and the per-module declared load. The assessment stays advisory and never changes the plan or any plan hash.
func CanonicalJSON ¶
CanonicalJSON exposes the compiler's canonical JSON implementation for versioned downstream contracts such as generation manifests. Callers must not introduce a second JSON-normalization or object-hashing algorithm.
func CanonicalPlanHash ¶
func CanonicalPlanHash(plan ResolvedPlan) (string, error)
CanonicalPlanHash returns the compiler-compatible hash of a plan with its declared planHash omitted. It preserves the established secret-redaction semantics and never mutates the supplied map.
func CanonicalSHA256 ¶
CanonicalSHA256 returns the compiler canonical hash without applying secret redaction. ResolvedPlan integrity must instead use VerifyPlanHash, which applies the exact compiler rules and rejects unsafe secret material first.
func CapacityPolicyFromDefinition ¶ added in v0.53.17
func CapacityPolicyFromDefinition(definition KitDefinition) (*capacityfit.Policy, error)
CapacityPolicyFromDefinition reads the resident-load thresholds the kit Definition declares next to its host requirements: headroomFactor and maxAlwaysOnPerCPU. It returns nil when the Definition declares neither, and never supplies a default: every threshold comes from the bound CUE policy.
func ComputeBackupTargetRequirementHash ¶
func ComputeBackupTargetRequirementHash(requirement BackupTargetRequirement) (string, error)
func ComputeExternalBackupTargetBindingHash ¶
func ComputeExternalBackupTargetBindingHash(binding ExternalBackupTargetBinding) (string, error)
func ComputeExternalFederationLinkBindingHash ¶
func ComputeExternalFederationLinkBindingHash(binding ExternalFederationLinkBinding) (string, error)
func ComputeExternalHomeAccessBindingHash ¶
func ComputeExternalHomeAccessBindingHash(binding ExternalHomeAccessBinding) (string, error)
ComputeExternalHomeAccessBindingHash binds the opaque external realization envelope. No provider, endpoint, address, transport, or credential is part of this authority.
func ComputeExternalHomeBackupTargetBindingHash ¶
func ComputeExternalHomeBackupTargetBindingHash(binding ExternalHomeBackupTargetBinding) (string, error)
func ComputeExternalHostBindingHash ¶
func ComputeExternalHostBindingHash(binding ExternalHostBinding) (string, error)
ComputeExternalHostBindingHash returns the canonical digest of a normalized ExternalHostBinding with bindingHash omitted. It performs no provider action.
func ComputeExternalHostRequirementsHash ¶
func ComputeExternalHostRequirementsHash(plan ResolvedPlan, nodeRef string) (string, error)
ComputeExternalHostRequirementsHash returns the exact provider-free host requirements digest for one node in a canonical plan. Binding issuers use this value without learning or transferring any server-provider identity.
func ComputeFederationLinkRequirementHash ¶
func ComputeFederationLinkRequirementHash(requirement FederationLinkRequirement) (string, error)
func ComputeHomeAccessOverlayRealizationHash ¶ added in v0.53.14
ComputeHomeAccessOverlayRealizationHash binds the complete overlay realization body while avoiding a self-referential digest.
func ComputeHomeAccessRequirementHash ¶
func ComputeHomeAccessRequirementHash(requirement HomeAccessRequirement) (string, error)
ComputeHomeAccessRequirementHash binds the complete provider-neutral requirement body while avoiding a self-referential digest.
func ComputeHomeBackupTargetRequirementHash ¶
func ComputeHomeBackupTargetRequirementHash(requirement HomeBackupTargetRequirement) (string, error)
func ComputeHostConformanceReceiptDigest ¶
func ComputeHostConformanceReceiptDigest(receipt HostConformanceReceipt) (string, error)
ComputeHostConformanceReceiptDigest returns the canonical digest of a normalized HostConformanceReceipt with receiptDigest omitted.
func DecodeDocument ¶
DecodeDocument decodes a CUE-exported JSON object into a typed document map. It rejects trailing JSON values and preserves numbers as json.Number so canonical hashes do not depend on float conversion.
func ProjectCapacityModules ¶ added in v0.53.9
func ProjectCapacityModules(modules []any) ([]capacityfit.Module, error)
ProjectCapacityModules decodes catalog-bound profile bodies for read-only previews. Callers own the catalog binding; this grants no plan or Apply trust.
func ProjectNotificationChannel ¶ added in v0.53.10
ProjectNotificationChannel returns the secret-free plan projection of one declared #NotificationChannelV1. The delivery adapter recomputes it from the StackSpec to prove that the channel it is about to use is the one the verified plan binds.
func ProjectRecoveryObjectives ¶
func ProjectRecoveryObjectives(data map[string]any, applications []localbackuppolicy.ApplicationVolume) ([]localbackuppolicy.RecoveryObjective, error)
ProjectRecoveryObjectives projects only objectives represented by the target-local application volumes. The complete binding/source coverage is checked by validateRecoveryObjectives before rendering the policy.
func ReissueInventoryExternalBindings ¶ added in v0.53.10
func ReissueInventoryExternalBindings(inventory InventoryFacts, homeRequirements, federationRequirements map[string]any) (InventoryFacts, []ReissuedExternalBinding, error)
ReissueInventoryExternalBindings re-issues every Home backup target and federation link binding in the Inventory whose requirement in the successor plan changed only by its spec binding. A binding without an exact successor requirement is left as it is, so compilation still refuses it. It returns the Inventory holding the successors and what changed; the input is not modified.
func ValidateExternalBackupTargetBindingsFreshness ¶
func ValidateExternalBackupTargetBindingsFreshness(plan ResolvedPlan, at time.Time) error
func ValidateExternalFederationLinkBinding ¶
func ValidateExternalFederationLinkBinding(binding ExternalFederationLinkBinding, requirement FederationLinkRequirement) error
ValidateExternalFederationLinkBinding verifies the complete closed external custody receipt against its exact compiler-owned requirement, including opaque reference shapes, semantic version, canonical hashes, UTC timestamps, and the normative maximum validity window.
func ValidateExternalFederationLinkBindingsFreshness ¶
func ValidateExternalFederationLinkBindingsFreshness(plan ResolvedPlan, at time.Time) error
func ValidateExternalHomeAccessBindingsFreshness ¶
func ValidateExternalHomeAccessBindingsFreshness(plan ResolvedPlan, at time.Time) error
ValidateExternalHomeAccessBindingsFreshness revalidates exact requirement parity and the externally issued validity window at execution time.
func ValidateExternalHomeBackupTargetBindingsFreshness ¶
func ValidateExternalHomeBackupTargetBindingsFreshness(plan ResolvedPlan, at time.Time) error
func ValidateExternalHostBindingForReceipt ¶
func ValidateExternalHostBindingForReceipt(binding ExternalHostBinding, at time.Time) error
ValidateExternalHostBindingForReceipt validates the closed, provider-free handoff envelope before an on-host receipt producer trusts it. Intent and inventory equality are revalidated later by the final plan compiler.
func ValidateExternalHostBindingFreshness ¶
func ValidateExternalHostBindingFreshness(binding ExternalHostBinding, at time.Time) error
ValidateExternalHostBindingFreshness is the deterministic apply-time staleness check. The compiler deliberately does not read wall-clock time; the caller supplies the execution instant that will be recorded in evidence.
func ValidateExternalHostBindingsFreshness ¶
func ValidateExternalHostBindingsFreshness(plan ResolvedPlan, at time.Time) error
ValidateExternalHostBindingsFreshness applies the execution-time validity decision to every provider-free host handoff in an already verified plan. Empty bindings are valid for plans that execute entirely on the current host. The caller owns the execution instant so the same value can be written to apply evidence; the compiler remains deterministic and clock-free.
func ValidateHostConformanceReceiptsForApply ¶
func ValidateHostConformanceReceiptsForApply(plan ResolvedPlan, at time.Time) error
ValidateHostConformanceReceiptsForApply admits external hosts only when each binding has one fresh, identity-bound and conformant StackKits receipt. Plans without external host bindings remain valid for local execution.
func VerifyPlanHash ¶
func VerifyPlanHash(plan ResolvedPlan) (string, error)
VerifyPlanHash verifies the self-declared hash against the canonical plan with planHash removed. It also rejects plaintext secret material, the wrong contract kind/version, malformed hashes, and never mutates the caller's map.
func VersionAtLeast ¶
VersionAtLeast applies the compiler's semantic-version ordering for downstream compatibility gates. Keeping this comparison here prevents generation/apply adapters from drifting onto a second version algorithm.
Types ¶
type AddOnContract ¶
AddOnContract is a JSON-decoded foundation.#AddOnContract document.
type ApplicationLifecycleContract ¶
ApplicationLifecycleContract is a JSON-decoded foundation.#ApplicationLifecycleContractV1 document. It binds a selected application workload to the reusable lifecycle and its Application Kit package without exposing either choice as StackSpec input.
type BackupTargetRequirement ¶
BackupTargetRequirement is StackKits-owned provider-free intent for one Cloud offsite backup destination.
type CUEContractValidator ¶
type CUEContractValidator struct {
// contains filtered or unexported fields
}
CUEContractValidator is the non-substitutable schema authority used by Compiler. Its state can only be initialized by NewCUEContractValidator, so a caller cannot inject a no-op implementation and bypass #KitSpecBinding or #ResolvedPlan validation.
func NewCUEContractValidator ¶
func NewCUEContractValidator(moduleRoot string) (*CUEContractValidator, error)
NewCUEContractValidator binds validation to a concrete StackKits CUE module. moduleRoot must contain cue.mod/module.cue, the authority profile projection, foundation/architecture_v2.cue, and the semantic Definition binding.
func NewCUEContractValidatorForAuthority ¶
func NewCUEContractValidatorForAuthority(moduleRoot string, authority PlanAuthority) (*CUEContractValidator, error)
NewCUEContractValidatorForAuthority binds filesystem-backed validation to one exact plan authority class.
func NewCUEContractValidatorFromSources ¶
func NewCUEContractValidatorFromSources(virtualModuleRoot string, sources map[string][]byte) (*CUEContractValidator, error)
NewCUEContractValidatorFromSources binds validation to an immutable, in-memory CUE module. virtualModuleRoot is an absolute namespace only; the constructor and subsequent validation never trust or materialize authority from that host path. Source keys are module-relative slash paths such as cue.mod/module.cue.
func NewCUEContractValidatorFromSourcesForAuthority ¶
func NewCUEContractValidatorFromSourcesForAuthority(virtualModuleRoot string, sources map[string][]byte, authority PlanAuthority) (*CUEContractValidator, error)
NewCUEContractValidatorFromSourcesForAuthority additionally binds every verified plan to one exact product or contract-fixture authority class.
func (*CUEContractValidator) NormalizeStackSpecBinding ¶
func (v *CUEContractValidator) NormalizeStackSpecBinding(definition KitDefinition, spec StackSpecV2) (StackSpecV2, error)
NormalizeStackSpecBinding validates desired intent against the canonical StackSpec contract and the selected Kit Definition without inventing host inventory or compiling a target-specific ResolvedPlan.
func (*CUEContractValidator) ValidateCanonicalPlan ¶
func (v *CUEContractValidator) ValidateCanonicalPlan(plan ResolvedPlan) error
ValidateCanonicalPlan re-runs the governed CUE #ResolvedPlan contract and requires the supplied plan to already equal the fully normalized result. This is deliberately a method on the non-substitutable concrete validator: downstream apply/generation gates cannot claim semantic verification from a self-consistent planHash alone or inject a no-op schema validator.
func (*CUEContractValidator) ValidateFederationRemoteActionEnvelope ¶
func (v *CUEContractValidator) ValidateFederationRemoteActionEnvelope(raw []byte) error
ValidateFederationRemoteActionEnvelope applies the closed catalog-owned wire shape. Signatures, present-time TTL and replay decisions remain runtime checks.
func (*CUEContractValidator) VerifyNormalizedCatalog ¶ added in v0.50.2
func (v *CUEContractValidator) VerifyNormalizedCatalog(catalog Catalog) error
VerifyNormalizedCatalog reports whether catalog is exactly what the governed CUE #ArchitectureV2CatalogContract normalizes it to, so a trusted producer's export can skip re-evaluating that contract. It runs the full CUE normalization and is meant for generation and test gates, not for runtime.
type CapabilityContract ¶
CapabilityContract is a JSON-decoded foundation.#CapabilityContract document.
type CapabilityProvider ¶
CapabilityProvider is a JSON-decoded foundation.#CapabilityProvider document.
type CapacityContext ¶ added in v0.53.17
type CapacityContext struct {
Policy *capacityfit.Policy
ModuleLoad ModuleLoadResolver
}
CapacityContext carries the CUE-owned facts a compiled plan does not embed: the kit's resident-load policy and each module's declared load. The zero value assesses numeric demand only, so every resident-load check stays off.
type Catalog ¶
type Catalog struct {
Capabilities []CapabilityContract
Providers []CapabilityProvider
AddOns []AddOnContract
Modules []ModuleContract
Workloads []WorkloadContract
ApplicationLifecycles []ApplicationLifecycleContract
PrivilegedInterfaceApprovals []PrivilegedInterfaceApproval
RILActionExecutors []RILActionExecutorContract
RILActionPrimitives []RILActionPrimitiveContract
PlanArtifacts []PlanArtifactContract
}
Catalog is the governed set of contracts the compiler may resolve. Unknown IDs and capabilities without exactly one selected realization fail closed.
type CompileError ¶
CompileError identifies a fail-closed compiler decision.
func (*CompileError) Error ¶
func (e *CompileError) Error() string
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler owns an immutable governed catalog and produces ResolvedPlan v1. It is safe for concurrent use after construction.
func NewCompiler ¶
NewCompiler validates and freezes the governed contract catalog.
func (*Compiler) Compile ¶
func (c *Compiler) Compile(input Input) (ResolvedPlan, error)
Compile resolves one profile-bound desired spec and its observed inventory. The returned plan contains no plaintext secret values and its planHash covers the complete plan except the planHash field itself.
func (*Compiler) ComputeExternalHostInventoryHash ¶
func (c *Compiler) ComputeExternalHostInventoryHash(inventory InventoryFacts) (string, error)
ComputeExternalHostInventoryHash returns the canonical provider-free digest an ExternalHostBinding must carry. It first applies the same CUE inventory normalization as Compile, then excludes the self-referential binding and conformance envelopes exactly as plan compilation does.
type CompilerVersionMismatchError ¶ added in v0.53.10
CompilerVersionMismatchError reports a plan that a different compiler release produced. Read-only callers (status) detect it with errors.As to describe the plan as stale; Apply and upgrade keep refusing it.
func (*CompilerVersionMismatchError) Error ¶ added in v0.53.10
func (e *CompilerVersionMismatchError) Error() string
type ErrorCode ¶
type ErrorCode string
ErrorCode is stable enough for CLI/API adapters to map without parsing text.
const ( ErrInvalidInput ErrorCode = "invalid_input" ErrContractValidation ErrorCode = "contract_validation" ErrProfileMismatch ErrorCode = "profile_spec_mismatch" ErrUnknownCapability ErrorCode = "unknown_capability" ErrForbiddenCapability ErrorCode = "forbidden_capability" ErrUnrealizedCapability ErrorCode = "unrealized_capability" ErrAmbiguousProvider ErrorCode = "ambiguous_provider" ErrUnknownProvider ErrorCode = "unknown_provider" ErrUnknownAddOn ErrorCode = "unknown_addon" ErrUnsupportedAddOn ErrorCode = "unsupported_addon" ErrUnknownModule ErrorCode = "unknown_module" ErrUnrealizedModule ErrorCode = "unrealized_module" ErrUndeclaredComputeProfile ErrorCode = "undeclared_compute_profile" ErrUnknownWorkload ErrorCode = "unknown_workload" ErrForbiddenWorkload ErrorCode = "forbidden_workload" ErrUnknownWorkloadAlternative ErrorCode = "unknown_workload_alternative" ErrContractConflict ErrorCode = "contract_conflict" ErrUnresolvedPlacement ErrorCode = "unresolved_placement" ErrUnsafeSecretReference ErrorCode = "unsafe_secret_reference" ErrPlanHashMismatch ErrorCode = "plan_hash_mismatch" ErrNonCanonicalPlan ErrorCode = "non_canonical_plan" )
const ( ErrExternalHostBindingStale ErrorCode = "external_host_binding_stale" ErrHostConformanceReceiptMissing ErrorCode = "host_conformance_receipt_missing" ErrHostConformanceReceiptStale ErrorCode = "host_conformance_receipt_stale" ErrHostConformanceReceiptRejected ErrorCode = "host_conformance_receipt_rejected" ErrExternalHomeAccessBindingStale ErrorCode = "external_home_access_binding_stale" ErrExternalHomeAccessBindingMismatch ErrorCode = "external_home_access_binding_mismatch" ErrExternalBackupTargetBindingStale ErrorCode = "external_backup_target_binding_stale" ErrExternalBackupTargetBindingMismatch ErrorCode = "external_backup_target_binding_mismatch" ErrExternalHomeBackupTargetBindingStale ErrorCode = "external_home_backup_target_binding_stale" ErrExternalHomeBackupTargetBindingMismatch ErrorCode = "external_home_backup_target_binding_mismatch" ErrExternalFederationLinkBindingStale ErrorCode = "external_federation_link_binding_stale" ErrExternalFederationLinkBindingMismatch ErrorCode = "external_federation_link_binding_mismatch" )
type ExternalBackupTargetBinding ¶
ExternalBackupTargetBinding is the opaque, time-bound custody attestation supplied by the external backup-target authority.
func IssueExternalBackupTargetBinding ¶
func IssueExternalBackupTargetBinding(requirement BackupTargetRequirement, targetRef, custodyRef, version, candidateDigest string, at time.Time) (ExternalBackupTargetBinding, error)
IssueExternalBackupTargetBinding projects a local owner's opaque custody commitments onto the existing provider-neutral external target contract.
func ReissueExternalBackupTargetBinding ¶ added in v0.51.3
func ReissueExternalBackupTargetBinding(previous ExternalBackupTargetBinding, requirement BackupTargetRequirement) (ExternalBackupTargetBinding, error)
ReissueExternalBackupTargetBinding carries an issued binding over to the requirement of a successor StackSpec. The requirement hash binds the spec hash, so every spec change invalidates the binding although the target and its custody are unchanged. The successor names the same target and custody attestation, the same release and Candidate, and the same validity window as the binding it succeeds: re-issuing never renews an authority, and the same inputs always yield the same bytes. A requirement that names another Stack, Site, capability, contract owner or contract is refused.
type ExternalFederationLinkBinding ¶
ExternalFederationLinkBinding is the opaque, time-bound attestation for one exact FederationLinkRequirement.
func ReissueExternalFederationLinkBinding ¶ added in v0.53.10
func ReissueExternalFederationLinkBinding(previous ExternalFederationLinkBinding, requirement FederationLinkRequirement) (ExternalFederationLinkBinding, error)
ReissueExternalFederationLinkBinding is the federation link counterpart of ReissueExternalHomeBackupTargetBinding: same fabric, custody attestation, release, Candidate and validity window under the successor requirement, and the same Sites, target nodes and bridge contract.
type ExternalHomeAccessBinding ¶
ExternalHomeAccessBinding is an opaque external realization binding. It carries no transport, endpoint, credential, or provider lifecycle data.
type ExternalHomeBackupTargetBinding ¶
ExternalHomeBackupTargetBinding is the opaque, time-bound custody attestation supplied by the external Home backup-target authority.
func ReissueExternalHomeBackupTargetBinding ¶ added in v0.53.10
func ReissueExternalHomeBackupTargetBinding(previous ExternalHomeBackupTargetBinding, requirement HomeBackupTargetRequirement) (ExternalHomeBackupTargetBinding, error)
ReissueExternalHomeBackupTargetBinding carries a Home backup target binding over to the requirement of a successor StackSpec. Home and federation bindings are issued from admission evidence, not by the node, so a re-issue widens nothing only when it adds no authority: the successor keeps the same target and custody attestation, the same release and Candidate, and the same validity window as the binding it succeeds (never renewed), and a requirement naming another Stack, Site, capability, contract owner or contract is refused. The same inputs always yield the same bytes.
type ExternalHostBinding ¶
ExternalHostBinding is the provider-free handoff for a host that has already been selected and supplied by the platform control plane.
type FederationLinkRequirement ¶
FederationLinkRequirement is the compiler-owned, provider-free Modern Home-to-Cloud fabric requirement.
type HomeAccessRequirement ¶
HomeAccessRequirement is the StackKits-owned, provider-neutral Shadow-Plan contract for one Home access capability.
type HomeBackupTargetRequirement ¶
HomeBackupTargetRequirement is StackKits-owned provider-free intent for one encrypted Home offsite backup destination.
type HostConformanceReceipt ¶
HostConformanceReceipt is StackKits-owned OS/host diagnostic evidence for one exact ExternalHostBinding. It is never server-provider compatibility.
type Input ¶
type Input struct {
Definition KitDefinition
Spec StackSpecV2
Inventory InventoryFacts
}
Input contains the only deployment-specific compiler inputs. Catalog data is immutable compiler configuration and is therefore supplied to NewCompiler.
type InventoryFacts ¶
InventoryFacts is a JSON-decoded foundation.#InventoryFacts document.
func ApplyReissuedExternalBindings ¶ added in v0.53.10
func ApplyReissuedExternalBindings(inventory InventoryFacts, reissued []ReissuedExternalBinding) (InventoryFacts, error)
ApplyReissuedExternalBindings writes re-issued bindings into the Inventory they were derived from. Each replaces exactly the binding it succeeds; a raced or missing predecessor is refused.
func AttachExternalBackupTargetBinding ¶
func AttachExternalBackupTargetBinding(inventory InventoryFacts, requirement BackupTargetRequirement, binding ExternalBackupTargetBinding, previousHash string) (InventoryFacts, error)
AttachExternalBackupTargetBinding preserves all other Inventory authority. Renewal requires the exact previous hash; a caller cannot replace a raced target.
type KitDefinition ¶
KitDefinition is a JSON-decoded foundation.#KitDefinition document.
type ModuleComputeProfileInput ¶ added in v0.53.4
type ModuleComputeProfileInput struct {
ModuleRef string `json:"moduleRef"`
ProfileRef string `json:"profileRef"`
ProfileHash string `json:"profileHash"`
Profile map[string]any `json:"profile"`
}
ModuleComputeProfileInput projects the selected catalog body, not a second resource policy. Fit, capacity and renderers consume the same hashed body.
func ParseModuleComputeProfileInput ¶ added in v0.53.4
func ParseModuleComputeProfileInput(data []byte, moduleID string) (ModuleComputeProfileInput, error)
ParseModuleComputeProfileInput verifies module ownership and the canonical profile hash using the compiler's existing hash authority.
type ModuleContract ¶
ModuleContract is a JSON-decoded foundation.#ModuleContractV2 document.
type ModuleLoadResolver ¶ added in v0.53.17
type ModuleLoadResolver func(moduleID, computeProfile string) *capacityfit.Load
ModuleLoadResolver returns the load a module declares for its selected compute profile, or nil when none is declared. Callers bind it to the owning CUE authority; an undeclared load stays unknown and is never defaulted.
type Options ¶
type Options struct {
CompilerVersion string
ContractValidator *CUEContractValidator
PlanAuthority PlanAuthority
// AuthorityDefinitions is the complete CUE-exported Definition set owned
// by the service constructing this compiler. When present, persisted-plan
// verification is bound to those exact normalized definition hashes.
AuthorityDefinitions []KitDefinition
// CatalogIsNormalizedExport declares that Catalog is the verbatim CUE
// export of the governed catalog contract (the embedded product bundle:
// hash-verified and gated by VerifyNormalizedCatalog), so the compiler does
// not evaluate #ArchitectureV2CatalogContract over it again. That
// evaluation peaks near a gigabyte of heap; never set it for a catalog from
// any other source.
CatalogIsNormalizedExport bool
MinimumCLIVersion string
MinimumRuntimeVersion string
MinimumGeneratorVersion string
RendererID string
RendererVersion string
}
Options records compiler identity in every plan. CompilerVersion must be a stable release/build identifier and must not contain timestamps.
type PlanArtifactContract ¶
PlanArtifactContract is a JSON-decoded foundation.#CatalogPlanArtifactV2 document. It is CUE catalog authority, not caller-supplied compiler configuration.
type PlanAuthority ¶
type PlanAuthority struct {
Class string `json:"class"`
Document string `json:"document"`
GraduationEligible bool `json:"graduationEligible"`
Issuer string `json:"issuer"`
AuthorityFingerprint string `json:"authorityFingerprint,omitempty"`
CatalogHash string `json:"catalogHash,omitempty"`
}
PlanAuthority is plan-bound provenance, not sidecar fixture metadata. The exact class/document/eligibility tuple is CUE constrained and carried into generation manifests and receipts so evidence consumers cannot graduate a contract fixture as a product kit.
func ContractFixturePlanAuthority ¶
func ContractFixturePlanAuthority() PlanAuthority
func DevelopmentPlanAuthority ¶
func DevelopmentPlanAuthority() PlanAuthority
DevelopmentPlanAuthority is the non-graduating default for filesystem and caller-supplied CUE sources. Product eligibility is reserved for the embedded authority bundle shipped inside the binary.
func ProductPlanAuthority ¶
func ProductPlanAuthority() PlanAuthority
type PrivilegedInterfaceApproval ¶
PrivilegedInterfaceApproval is centrally owned catalog authority for one narrowly scoped direct runtime-interface exception.
type RILActionExecutorContract ¶
RILActionExecutorContract is the CUE-governed, provider-free identity and operation-class boundary for one authenticated in-process action owner.
type RILActionPrimitiveContract ¶
RILActionPrimitiveContract is a CUE-governed approved-action catalog entry. Presence in the catalog is not execution support; the contract's support field remains contract-only until an authenticated runtime owner is bound.
type ReissuedExternalBinding ¶ added in v0.53.10
type ReissuedExternalBinding struct {
Kind string
SiteRef string
CapabilityRef string
PreviousHash string
Binding map[string]any
}
ReissuedExternalBinding is one Inventory binding carried over to a successor StackSpec. SiteRef is empty for a federation link, which is not site keyed.
type ResolvedPlan ¶
ResolvedPlan is a JSON-decoded foundation.#ResolvedPlan document. It must only be constructed through Compiler.Compile so its source and plan hashes agree.
func DecodeCanonicalPlan ¶
func DecodeCanonicalPlan(data []byte) (ResolvedPlan, error)
DecodeCanonicalPlan accepts only byte-for-byte canonical JSON. Requiring the canonical representation rejects duplicate object keys and representation ambiguity before a persisted plan reaches a renderer or apply gate.
func (ResolvedPlan) MarshalCanonical ¶
func (p ResolvedPlan) MarshalCanonical() ([]byte, error)
MarshalCanonical emits stable JSON suitable for persisting or handing to CUE. It never applies secret redaction; plans are already sanitized before they are constructed.
type StackSpecV2 ¶
StackSpecV2 is a JSON-decoded foundation.#StackSpecV2 document.
type WorkloadComputeTierFit ¶
type WorkloadComputeTierFit struct {
Declared bool
Included bool
AlternativeID string
Reason string
}
WorkloadComputeTierFit is the catalog binding of one workload to one install.computeTier graph. Undeclared fits admit the default alternative.
func CatalogWorkloadComputeTierFit ¶
func CatalogWorkloadComputeTierFit(contract map[string]any, tier string) WorkloadComputeTierFit
CatalogWorkloadComputeTierFit reads #WorkloadContractV2.computeTiers. Missing computeTiers or a missing tier admits the caller to use defaultAlternative.
type WorkloadContract ¶
WorkloadContract is a JSON-decoded foundation.#WorkloadContractV2 document. It owns logical workload and alternative selection; StackSpec never supplies the referenced provider or module implementation IDs.
Source Files
¶
- accelerator_admission.go
- artifacts.go
- authority_binding.go
- availability.go
- basement_identity_verification.go
- bridge_realizations.go
- canonical.go
- capacity_assessment.go
- capacity_data_projection.go
- catalog.go
- catalog_body_binding.go
- catalog_body_modules.go
- catalog_body_selection.go
- catalog_body_workloads.go
- cloud_identity_authority.go
- compiler.go
- component_release.go
- compute_tier.go
- cue_scope_schema.go
- cue_validator.go
- data_capacity_admission.go
- delivery_route_core.go
- document.go
- errors.go
- external_backup_target_boundary.go
- external_backup_target_issue.go
- external_binding_reissue.go
- external_federation_link_boundary.go
- external_home_access_boundary.go
- external_home_backup_target_boundary.go
- external_host_boundary.go
- federation_action.go
- home_lan_discovery.go
- home_policy_input_bindings.go
- identity_trust.go
- implementation_interface_approvals.go
- implementation_interfaces.go
- implementation_interfaces_catalog.go
- local_kopia_source_projection.go
- local_reachability.go
- modern_identity_projections.go
- module_compute_profile_input.go
- module_input_bindings.go
- module_input_companions.go
- module_plan_inputs.go
- module_profiles.go
- module_secret_input_bindings.go
- modules.go
- notification_projection.go
- plan_fields.go
- readiness.go
- recovery_objective.go
- resolution.go
- route_capability_realizations.go
- runtime_admission_binding.go
- runtime_listeners.go
- runtime_networks.go
- sandbox_runtime_admission.go
- service_controls.go
- service_endpoints.go
- storage_filesystem_admission.go
- types.go
- unix_socket_paths.go
- validation.go
- version.go
- workloads.go