selection

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package selection defines the transient effective-selection document that the installer TUI and Home Manager both hand to the apply engine.

The document is never the preference YAML: it carries only already-normalized effective cell state (harness enabled AND that global extension axis enabled). Neither apply-selection nor apply-cell reads or writes preference YAML; they consume this effective state and mutate only factual operational inventory.

The schema requires all and only the three harnesses, each with all and only the three extension axes. Missing or extra harnesses/axes are rejected so an under-specified document can never silently disable a cell.

Index

Constants

View Source
const SchemaID = "pasture.install.effective-selection/v1"

SchemaID is the frozen schema identifier for the effective-selection document.

Variables

This section is empty.

Functions

This section is empty.

Types

type CellState

type CellState struct {
	Cell    cell.Cell
	Enabled bool
}

CellState is one ordered cell and its effective desired state.

type Selection

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

Selection is a validated effective-selection over exactly the nine cells.

func New

func New(states map[cell.Cell]bool) (Selection, error)

New constructs a Selection from an exhaustive cell->enabled mapping. The map must contain exactly the nine canonical cells; missing or extra keys are rejected.

func Parse

func Parse(data []byte) (Selection, error)

Parse decodes and validates an effective-selection document. Unknown keys, missing harnesses, and missing axes are all rejected.

func (Selection) Enabled

func (s Selection) Enabled(c cell.Cell) bool

Enabled returns the effective desired state for a cell.

func (Selection) IsValid

func (s Selection) IsValid() bool

IsValid reports whether the selection was validly constructed.

func (Selection) Marshal

func (s Selection) Marshal() ([]byte, error)

Marshal encodes the selection in canonical harness order.

func (Selection) Ordered

func (s Selection) Ordered() []CellState

Ordered returns the nine (cell, enabled) pairs in canonical order.

Jump to

Keyboard shortcuts

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