Documentation
¶
Overview ¶
Package apply owns the typed request, result, error, and activator contracts plus concrete activation-strategy adapters. Package service alone owns orchestration, canonical execution order, and registry persistence.
Index ¶
- Constants
- type ActionRow
- type Activator
- type ApplyError
- func (e *ApplyError) Error() string
- func (e *ApplyError) Fix() string
- func (e *ApplyError) Impact() string
- func (e *ApplyError) Location() string
- func (e *ApplyError) MarshalJSON() ([]byte, error)
- func (e *ApplyError) Reason() string
- func (e *ApplyError) Remediation() Remediation
- func (e *ApplyError) Source() Source
- func (e *ApplyError) Stage() string
- type DirectFileActivator
- func (a *DirectFileActivator) Ensure(ctx context.Context, source Source, key registry.Key, ...) (Outcome, error)
- func (a *DirectFileActivator) Inspect(ctx context.Context, source Source, key registry.Key, ...) (Outcome, error)
- func (a *DirectFileActivator) Remove(ctx context.Context, source Source, key registry.Key, ...) (Outcome, error)
- func (*DirectFileActivator) StrategyKind() activation.StrategyKind
- func (a *DirectFileActivator) ValidateBindings(bindings []activation.ComponentActivation) error
- type DirectFileDecorationMode
- type DirectFilePolicy
- func NewDirectFilePolicy(c cell.Cell, validate DirectFileValidator, mode DirectFileDecorationMode) (DirectFilePolicy, error)
- func PassThroughDirectFile(c cell.Cell) (DirectFilePolicy, error)
- func PendingNativeTrustDirectFile(c cell.Cell, validate DirectFileValidator, diagnostic string) (DirectFilePolicy, error)
- type DirectFileRequest
- func (r DirectFileRequest) ArtifactID() artifact.BundleID
- func (r DirectFileRequest) Cell() cell.Cell
- func (r DirectFileRequest) DestinationRoot() string
- func (r DirectFileRequest) Key() registry.Key
- func (r DirectFileRequest) Operation() Operation
- func (r DirectFileRequest) Prior() (registry.Record, bool)
- func (r DirectFileRequest) Source() Source
- func (r DirectFileRequest) StrategyKind() activation.StrategyKind
- type DirectFileValidator
- type Management
- type Operation
- type Outcome
- type Remediation
- type Result
- type Scope
- type Source
- type Status
Constants ¶
const ( ResultSchemaID = "pasture.install.apply-result/v1" ErrorSchemaID = "pasture.install.apply-error/v1" )
ResultSchemaID and ErrorSchemaID are the frozen transient document schemas.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionRow ¶
type ActionRow struct {
// contains filtered or unexported fields
}
ActionRow is one ordered cell outcome.
func NewActionRow ¶
func NewActionRow(c cell.Cell, operation Operation, status Status, management Management, observation registry.Observation, diagnostic string) ActionRow
func (ActionRow) Diagnostic ¶
func (ActionRow) Management ¶
func (r ActionRow) Management() Management
func (ActionRow) Observation ¶
func (r ActionRow) Observation() registry.Observation
type Activator ¶
type Activator interface {
StrategyKind() activation.StrategyKind
Inspect(context.Context, Source, registry.Key, activation.ComponentActivation, *registry.Record) (Outcome, error)
Ensure(context.Context, Source, registry.Key, activation.ComponentActivation, *registry.Record) (Outcome, error)
Remove(context.Context, Source, registry.Key, activation.ComponentActivation, registry.Record) (Outcome, error)
}
Activator is the production boundary implemented by each closed activation strategy. Inspect must be read-only. Ensure and Remove must return facts based on a live postcondition check, including when they return an action error.
type ApplyError ¶
type ApplyError struct {
// contains filtered or unexported fields
}
ApplyError is the transient pre-plan apply-error/v1 document.
func NewApplyError ¶
func NewApplyError(source Source, stage, reason, where, impact, fix string, remediation Remediation) *ApplyError
func (*ApplyError) Error ¶
func (e *ApplyError) Error() string
Error implements the error interface.
func (*ApplyError) Fix ¶
func (e *ApplyError) Fix() string
Fix returns the actionable repair instruction.
func (*ApplyError) Impact ¶
func (e *ApplyError) Impact() string
Impact returns what the failure means for the caller and live state.
func (*ApplyError) Location ¶
func (e *ApplyError) Location() string
Location returns the production location that detected the failure.
func (*ApplyError) MarshalJSON ¶
func (e *ApplyError) MarshalJSON() ([]byte, error)
MarshalJSON renders the frozen apply-error/v1 document.
func (*ApplyError) Reason ¶
func (e *ApplyError) Reason() string
Reason returns the concrete reason the stage failed.
func (*ApplyError) Remediation ¶
func (e *ApplyError) Remediation() Remediation
Remediation returns the closed caller action associated with the repair.
func (*ApplyError) Source ¶
func (e *ApplyError) Source() Source
Source returns the controller associated with the failed request.
func (*ApplyError) Stage ¶
func (e *ApplyError) Stage() string
Stage returns the operation stage that rejected the request.
type DirectFileActivator ¶
type DirectFileActivator struct {
// contains filtered or unexported fields
}
DirectFileActivator is the real filesystem implementation for direct-file activation. Source controls registry ownership only; paths come exclusively from validated activation contracts.
func NewDirectFileActivator ¶
func NewDirectFileActivator(policies ...DirectFilePolicy) (*DirectFileActivator, error)
func (*DirectFileActivator) Ensure ¶
func (a *DirectFileActivator) Ensure(ctx context.Context, source Source, key registry.Key, act activation.ComponentActivation, prior *registry.Record) (Outcome, error)
func (*DirectFileActivator) Inspect ¶
func (a *DirectFileActivator) Inspect(ctx context.Context, source Source, key registry.Key, act activation.ComponentActivation, prior *registry.Record) (Outcome, error)
func (*DirectFileActivator) Remove ¶
func (a *DirectFileActivator) Remove(ctx context.Context, source Source, key registry.Key, act activation.ComponentActivation, prior registry.Record) (Outcome, error)
func (*DirectFileActivator) StrategyKind ¶
func (*DirectFileActivator) StrategyKind() activation.StrategyKind
func (*DirectFileActivator) ValidateBindings ¶
func (a *DirectFileActivator) ValidateBindings(bindings []activation.ComponentActivation) error
ValidateBindings proves at service construction that policy dispatch is an exact bijection with the statically bound DirectFile cells.
type DirectFileDecorationMode ¶
type DirectFileDecorationMode struct {
// contains filtered or unexported fields
}
func PassThroughDecoration ¶
func PassThroughDecoration() DirectFileDecorationMode
func PendingNativeTrustDecoration ¶
func PendingNativeTrustDecoration(diagnostic string) (DirectFileDecorationMode, error)
type DirectFilePolicy ¶
type DirectFilePolicy struct {
// contains filtered or unexported fields
}
DirectFilePolicy is one cell-bound validation and outcome-decoration policy. The constructor keeps the cell and functions coupled and rejects zero policy.
func NewDirectFilePolicy ¶
func NewDirectFilePolicy(c cell.Cell, validate DirectFileValidator, mode DirectFileDecorationMode) (DirectFilePolicy, error)
func PassThroughDirectFile ¶
func PassThroughDirectFile(c cell.Cell) (DirectFilePolicy, error)
PassThroughDirectFile preserves the generic direct-file behavior byte for byte while still making the policy binding explicit.
func PendingNativeTrustDirectFile ¶
func PendingNativeTrustDirectFile(c cell.Cell, validate DirectFileValidator, diagnostic string) (DirectFilePolicy, error)
func (DirectFilePolicy) Cell ¶
func (p DirectFilePolicy) Cell() cell.Cell
type DirectFileRequest ¶
type DirectFileRequest struct {
// contains filtered or unexported fields
}
DirectFileRequest is the immutable policy view of one direct-file operation. Policies receive validated typed identities rather than filesystem paths.
func (DirectFileRequest) ArtifactID ¶
func (r DirectFileRequest) ArtifactID() artifact.BundleID
func (DirectFileRequest) Cell ¶
func (r DirectFileRequest) Cell() cell.Cell
func (DirectFileRequest) DestinationRoot ¶
func (r DirectFileRequest) DestinationRoot() string
func (DirectFileRequest) Key ¶
func (r DirectFileRequest) Key() registry.Key
func (DirectFileRequest) Operation ¶
func (r DirectFileRequest) Operation() Operation
func (DirectFileRequest) Source ¶
func (r DirectFileRequest) Source() Source
func (DirectFileRequest) StrategyKind ¶
func (r DirectFileRequest) StrategyKind() activation.StrategyKind
type DirectFileValidator ¶
type DirectFileValidator func(DirectFileRequest) error
type Management ¶
type Management uint8
Management identifies whose authority, if any, the row represents.
const ( ManagementUnknown Management = iota ManagementPasture ManagementExternal ManagementDeclarative )
func (Management) IsValid ¶
func (m Management) IsValid() bool
func (Management) String ¶
func (m Management) String() string
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
Operation is the intended action for a cell.
type Outcome ¶
type Outcome struct {
Status Status
Observation registry.Observation
Record *registry.Record
Diagnostic string
}
Outcome is one live-inspected activator result. Record is the strongest confirmed fact and is persisted before execution advances to another cell.
type Remediation ¶
type Remediation uint8
Remediation is the closed caller action family carried by apply errors.
const ( RemediationInvalid Remediation = iota RemediationApplyCell RemediationApplySelection RemediationRerunInstaller RemediationRerunHomeManager RemediationManualNativeTrust RemediationManualRepair )
func (Remediation) String ¶
func (r Remediation) String() string
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result is the transient apply-result document.
func (Result) MarshalJSON ¶
MarshalJSON renders the frozen apply-result/v1 document with ordered rows.
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope selects one logical registry table. Project scope carries one canonical root, allowing the same service to be reused by project reconciliation.
func GlobalScope ¶
func GlobalScope() Scope
func ProjectScope ¶
func ProjectScope(root registry.ProjectRoot) (Scope, error)
func (Scope) ProjectRoot ¶
func (s Scope) ProjectRoot() registry.ProjectRoot
type Source ¶
type Source uint8
Source identifies the controller applying desired state.
func HomeManagerSource ¶
func HomeManagerSource() Source
func InstallerSource ¶
func InstallerSource() Source
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status is a typed action-row outcome.
func InstalledPendingTrust ¶
func InstalledPendingTrust() Status
func ManagedDeclaratively ¶
func ManagedDeclaratively() Status
func Unattempted ¶
func Unattempted() Status