base

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package base owns shared controller lifecycle, execution acceptance and publication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acquisition added in v0.7.3

type Acquisition struct {
	// AllowMissingSecrets permits unavailable authored Secret material.
	AllowMissingSecrets bool
	// AllowAnonymousDenied permits a proven registry denial without a credential.
	AllowAnonymousDenied bool
	// Fetch acquires content with this execution's captured inputs.
	Fetch func(context.Context) (source.PreparedFetch, error)
	// Select MUST classify discovery-admitted content before remote credential preparation.
	Select  func(context.Context) (bool, error)
	Resolve func(context.Context, manifest.DrainLevel) (*store.SourceArtifact, error)
	// Complete receives acquired content or an allowed unavailable-material error.
	Complete func(context.Context, *store.SourceArtifact, error, manifest.DrainLevel) error
}

Acquisition retains credential policy and continuations for acquired content.

type Controller

type Controller struct {
	Store *store.Store
	Tasks *task.Service

	// SkipKinds is the immutable visible-output exclusion list.
	SkipKinds []string

	// DependencySubstitutions binds emitted dependency projection to accepted history.
	DependencySubstitutions values.DependencySubstitutions

	// AllowMissingKinds permits unavailable Helm valuesFrom kinds and absent CRDs.
	AllowMissingKinds []string
	// contains filtered or unexported fields
}

Controller owns shared reconciliation lifecycle, dependency gates and publication. Configure MUST complete before StartLifecycle or dispatch.

func New

func New(s *store.Store, t *task.Service) *Controller

New constructs a controller with the shared store and task service.

func (*Controller) Configure added in v0.3.4

func (c *Controller) Configure(opts Options)

Configure installs immutable setup before dispatch.

func (*Controller) KeepEmitted

func (c *Controller) KeepEmitted(
	ctx context.Context,
	parent manifest.NamedResource,
	request selection.PrepareRequest,
) (bool, error)

KeepEmitted MUST admit every child in the immutable generation before publication.

func (*Controller) MissingCRDsAllowed added in v0.7.3

func (c *Controller) MissingCRDsAllowed() bool

MissingCRDsAllowed reports whether unresolved CRD dependencies are allowed.

func (*Controller) PreviousRender added in v0.7.3

PreviousRender supplies no history until a concrete controller overrides it.

func (*Controller) SetPendingUnlessReady added in v0.3.4

func (c *Controller) SetPendingUnlessReady(id manifest.NamedResource, msg string)

SetPendingUnlessReady initializes progress without changing an existing condition.

func (*Controller) StartLifecycle

func (c *Controller) StartLifecycle()

StartLifecycle freezes reconcile-shaping configuration before dispatch.

type Controllers added in v0.7.3

type Controllers struct {
	Kustomization     nodeController
	HelmRelease       nodeController
	ResourceSet       nodeController
	Source            nodeController
	ArtifactGenerator nodeController
}

Controllers binds objects to their controller for execution and render history. Bindings MUST remain immutable after dispatch begins.

func (*Controllers) PreviousRender added in v0.7.3

func (c *Controllers) PreviousRender(ctx context.Context, obj manifest.BaseManifest, previous schedule.Result) History

PreviousRender returns accepted history for the immutable declaration candidate.

func (*Controllers) ReconcileNode added in v0.7.3

func (c *Controllers) ReconcileNode(
	ctx context.Context,
	id manifest.NamedResource,
	level manifest.DrainLevel,
	previous schedule.Result,
) *Execution

ReconcileNode dispatches id to its owning controller.

type DataWait added in v0.7.3

type DataWait struct {
	Inputs []depwait.DataDependency
	Resume func(context.Context, manifest.DrainLevel, []manifest.NamedResource) error
}

DataWait resumes a captured execution after its values inputs settle.

type Deduplication added in v0.7.3

type Deduplication struct {
	Fingerprint string
	Reused      bool
}

Deduplication omits its fingerprint when no stable content key exists.

type Execution added in v0.7.3

type Execution struct {
	*Controller

	Preparation           preparation
	AdmissionPreparation  *selection.Preparation
	ProbeLeft, ProbeRight *Execution
	ProbeConsumed         bool

	Reads       store.ReadSet
	Unreadable  []manifest.NamedResource
	Blocked     []manifest.NamedResource
	Disposition store.AssessmentKind
	// contains filtered or unexported fields
}

Execution MUST retain its input capture through every output borrower.

func (*Execution) Acquire added in v0.7.3

func (e *Execution) Acquire(
	ctx context.Context,
	obj manifest.BaseManifest,
	acquisition Acquisition,
	level manifest.DrainLevel,
) (resultErr error)

Acquire fetches content or retains credential settlement before completing its consumer.

func (*Execution) AdmitQualification added in v0.7.3

func (e *Execution) AdmitQualification(possible bool) bool

AdmitQualification settles a negative precondition only without ordinary demand.

func (*Execution) AwaitData added in v0.7.3

func (e *Execution) AwaitData(ctx context.Context, wait DataWait, level manifest.DrainLevel) error

AwaitData retains availability separately from required authored readiness gates.

func (*Execution) Checkpoint added in v0.7.3

func (e *Execution) Checkpoint() error

Checkpoint validates captured inputs and admission before execution continues.

func (*Execution) Close added in v0.7.3

func (e *Execution) Close()

Close retires all provenance borrowed by the completed invocation.

func (*Execution) DataInputs added in v0.7.3

func (e *Execution) DataInputs(
	ctx context.Context,
	obj manifest.BaseManifest,
	provider dataLookup,
) ([]depwait.DataDependency, error)

DataInputs captures authored values and substitution inputs through the shared gate.

func (*Execution) Dispatch added in v0.7.3

func (e *Execution) Dispatch[T manifest.BaseManifest, S any](
	ctx context.Context,
	level manifest.DrainLevel,
	state S,
	reconcile func(S, context.Context, T, manifest.DrainLevel) error,
)

Dispatch runs a captured declaration through the common acceptance path.

func (*Execution) Emit added in v0.7.3

Emit publishes the candidate inventory with its consumed provenance.

func (*Execution) FingerprintDedup added in v0.7.3

func (e *Execution) FingerprintDedup(
	ctx context.Context,
	id manifest.NamedResource,
	content any,
	attempt *store.Emission,
) (Deduplication, error)

FingerprintDedup derives the replay key from content and reuses accepted children. Nil or unmarshalable content MUST bypass replay; preflight failures still win.

func (*Execution) Init added in v0.7.3

func (e *Execution) Init(c *Controller, id manifest.NamedResource)

Init starts capture in caller-owned storage before declaration or dependency assessment. The execution MUST remain live until its registrations and output borrowers retire.

func (*Execution) InitProbe added in v0.7.3

func (e *Execution) InitProbe(c *Controller, object manifest.BaseManifest)

InitProbe MUST NOT publish runtime admission or status.

func (*Execution) Outcome added in v0.7.3

func (e *Execution) Outcome() schedule.Kind

Outcome returns the retained readiness decision without reading the store.

func (*Execution) ParseChildren added in v0.7.3

ParseChildren selects output and retains authoritative sanitized child documents. The returned objects and maps MUST remain immutable after publication.

func (*Execution) ProbeCurrent added in v0.7.3

func (e *Execution) ProbeCurrent(indexed manifest.BaseManifest) bool

ProbeCurrent MUST preserve the declaration authority captured at initialization.

func (*Execution) Progressed added in v0.7.3

func (e *Execution) Progressed() bool

Progressed reports an execution that performed work beyond equal-input replay.

func (*Execution) Require added in v0.7.3

func (e *Execution) Require(ctx context.Context, deps []manifest.DependencyRef, level manifest.DrainLevel) error

Require assesses and retains readiness gates from the captured inputs.

func (*Execution) RequireRefresh added in v0.7.3

func (e *Execution) RequireRefresh[T manifest.BaseManifest](
	ctx context.Context,
	effective T,
	stage manifest.GateStage,
	level manifest.DrainLevel,
) (T, error)

RequireRefresh gates effective inputs against the execution's captured canonical declaration. Prepared clones MUST remain distinct from the canonical snapshot that produced them.

func (*Execution) Retire added in v0.7.3

func (e *Execution) Retire()

Retire releases superseded assessment cells while retaining borrowed output.

func (*Execution) Settle added in v0.7.3

func (e *Execution) Settle(ctx context.Context, level manifest.DrainLevel)

Settle classifies retained unresolved gates without rendering again.

func (*Execution) Take added in v0.7.3

func (e *Execution) Take(previous schedule.Result)

Take MUST precede retirement of the predecessor's preparation owner.

func (*Execution) Valid added in v0.7.3

func (e *Execution) Valid() bool

Valid reports whether the assessment and its admitted output are current.

type History added in v0.7.3

type History struct {
	Assessment *Execution
	Records    iter.Seq2[manifest.NamedResource, manifest.DiscoveryRecord]
	Complete   bool
}

History MUST retain its assessment through every possible preparation consumer.

type Options added in v0.3.4

type Options struct {
	// Loader supplies the invocation's declaration admission boundary.
	Loader *loader.Loader
	// SkipKinds is the immutable visible-output exclusion list.
	SkipKinds []string
	// DependencySubstitutions is the frozen discovered lookup used before child publication.
	DependencySubstitutions values.DependencySubstitutions
	// Session owns restricted reconciliation membership.
	Session *selection.Session
	// Index contains immutable source-qualified discovery evidence.
	Index *manifest.DiscoveryIndex
	// Existence is the file-existence lookup depwait uses to lazy-promote
	// file-indexed deps and to distinguish a render-only dep still in flight
	// from a typo'd one. See depwait.ExistenceLookup.
	Existence depwait.ExistenceLookup
	// AllowMissingKinds permits unavailable Helm valuesFrom kinds and absent CRDs.
	AllowMissingKinds []string
	// PreflightFailure reports dependency-graph errors discovered before
	// reconcile; when set for an id the controller marks it Failed and renders
	// nothing.
	PreflightFailure func(manifest.NamedResource) (string, bool)
}

Options contains immutable controller configuration installed before dispatch.

Jump to

Keyboard shortcuts

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