service

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package service is the application boundary shared by installer frontends. It owns registry load/save around the canonical apply engine; frontends never compose a second apply path or persist transient results as authority.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CellRequest

type CellRequest struct {
	Cell    cell.Cell
	Enabled bool
	Scope   apply.Scope
	Source  apply.Source
}

type Config

type Config struct {
	Registry   Registry
	Contracts  map[ir.HarnessID]activation.ActivationContract
	Activators []apply.Activator
	// Group is the one statically selected selection-wide native transition.
	// It never receives registry persistence and cannot create another authority.
	Group GroupReconciler
}

Config supplies the complete static activation graph and real side-effect seams. Contracts are copied and validated exhaustively by every operation.

type FileRegistry

type FileRegistry struct {
	// contains filtered or unexported fields
}

FileRegistry is the production registry implementation.

func NewFileRegistry

func NewFileRegistry(path string) (FileRegistry, error)

func (FileRegistry) Load

func (FileRegistry) Path

func (r FileRegistry) Path() string

func (FileRegistry) Save

func (r FileRegistry) Save(ctx context.Context, store registry.Store) error

type GroupAction

type GroupAction struct {
	// contains filtered or unexported fields
}

func NewGroupAction

func NewGroupAction(row apply.ActionRow, record *registry.Record) (GroupAction, error)

func (GroupAction) Record

func (a GroupAction) Record() (registry.Record, bool)

func (GroupAction) Row

func (a GroupAction) Row() apply.ActionRow

type GroupActionKind

type GroupActionKind uint8

func EnsureCellGroupAction

func EnsureCellGroupAction() GroupActionKind

func InspectGroupAction

func InspectGroupAction() GroupActionKind

func RemoveCellGroupAction

func RemoveCellGroupAction() GroupActionKind

func RemoveSharedGroupAction

func RemoveSharedGroupAction() GroupActionKind

func (GroupActionKind) IsValid

func (k GroupActionKind) IsValid() bool

type GroupCell

type GroupCell struct {
	Cell       cell.Cell
	Enabled    bool
	Scope      apply.Scope
	Source     apply.Source
	Prior      map[cell.Cell]registry.Record
	Activation map[cell.Cell]activation.ComponentActivation
}

type GroupFacts

type GroupFacts struct {
	// contains filtered or unexported fields
}

GroupFacts is one complete, live-inspected three-cell fact set.

func NewGroupFacts

func NewGroupFacts(actions ...GroupAction) (GroupFacts, error)

func (GroupFacts) Actions

func (f GroupFacts) Actions() []GroupAction

type GroupPlan

type GroupPlan struct {
	// contains filtered or unexported fields
}

func NewGroupPlan

func NewGroupPlan(results []GroupResultCell, actions []GroupStep) (GroupPlan, error)

func (GroupPlan) Actions

func (p GroupPlan) Actions() []GroupStep

func (GroupPlan) Handled

func (p GroupPlan) Handled() bool

func (GroupPlan) ResultCells

func (p GroupPlan) ResultCells() []GroupResultCell

type GroupResultCell

type GroupResultCell struct {
	// contains filtered or unexported fields
}

GroupResultCell is one of the exactly three canonical output cells. Result cells are intentionally independent from native action count.

func NewGroupResultCell

func NewGroupResultCell(c cell.Cell, key registry.Key, operation apply.Operation) (GroupResultCell, error)

func (GroupResultCell) Cell

func (r GroupResultCell) Cell() cell.Cell

func (GroupResultCell) Key

func (r GroupResultCell) Key() registry.Key

func (GroupResultCell) Operation

func (r GroupResultCell) Operation() apply.Operation

type GroupSelection

type GroupSelection struct {
	Selection  selection.Selection
	Scope      apply.Scope
	Source     apply.Source
	Prior      map[cell.Cell]registry.Record
	Activation map[cell.Cell]activation.ComponentActivation
}

func (GroupSelection) Harness

func (s GroupSelection) Harness() ir.HarnessID

type GroupStep

type GroupStep struct {
	// contains filtered or unexported fields
}

GroupStep is one typed native action. It contains no command, callback, argument vector, or session identity.

func NewGroupStep

func NewGroupStep(kind GroupActionKind, control cell.Cell) (GroupStep, error)

func (GroupStep) ControlCell

func (s GroupStep) ControlCell() cell.Cell

func (GroupStep) Kind

func (s GroupStep) Kind() GroupActionKind

func (GroupStep) Operation

func (s GroupStep) Operation() apply.Operation

type GroupTerminalStage

type GroupTerminalStage uint8
const (
	GroupTerminalInvalid GroupTerminalStage = iota
	GroupTerminalPlanInvalid
	GroupTerminalCanceled
	GroupTerminalExecuteFailed
	GroupTerminalInspectFailed
	GroupTerminalFactInvalid
	GroupTerminalSaveFailed
	GroupTerminalSucceeded
)

func (GroupTerminalStage) IsValid

func (s GroupTerminalStage) IsValid() bool

type Registry

type Registry interface {
	Load(context.Context) (registry.Store, error)
	Save(context.Context, registry.Store) error
}

Registry is the injected atomic persistence boundary. Implementations must make Save replace one complete registry or leave the prior registry intact.

type SelectionRequest

type SelectionRequest struct {
	Selection selection.Selection
	Scope     apply.Scope
	Source    apply.Source
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Service, error)

func (*Service) ApplyCell

func (s *Service) ApplyCell(ctx context.Context, request CellRequest) (apply.Result, error)

func (*Service) ApplySelection

func (s *Service) ApplySelection(ctx context.Context, request SelectionRequest) (apply.Result, error)

ApplySelection and ApplyCell deliberately share load, canonical binding, execution, and per-fact atomic persistence.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL