base

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type Acquisition struct {
	ProviderOnly 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 {
	Cache *cache.Cache
	Store *store.Store
	Tasks *task.Service

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

	Missing *depwait.MissingPolicy
	// 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 MUST install a real empty policy before standalone assessment.

func (*Controller) CompleteOrphan

func (c *Controller) CompleteOrphan(id manifest.NamedResource, message string) bool

CompleteOrphan MUST run after task drain for an object owned by this controller.

func (*Controller) Configure

func (c *Controller) Configure(opts Options)

Configure MUST install the invocation policy 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) PreviousRender

PreviousRender supplies no history until a concrete controller overrides it.

func (*Controller) SetPendingUnlessReady

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

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) CompleteOrphans

func (c *Controllers) CompleteOrphans(orphans map[manifest.NamedResource]string, message string)

CompleteOrphans MUST run only after all reconcile bodies drain. Each owning controller retires its failure after the final ownership assessment.

func (*Controllers) PreviousRender

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

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

type DataWait struct {
	Inputs []depwait.DataDependency
	// Resume retains authored positions until consumers filter their declarations.
	Resume func(context.Context, manifest.DrainLevel, []values.Result) error
}

DataWait resumes a captured execution after its values inputs settle.

type Deduplication

type Deduplication struct {
	Fingerprint string
	Reused      bool
}

Deduplication omits its fingerprint when no stable content key exists.

type Execution

type Execution struct {
	*Controller

	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

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

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

AdmitQualification settles a negative precondition only without ordinary demand.

func (*Execution) AwaitData

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

func (e *Execution) Checkpoint() error

Checkpoint validates captured inputs and admission before execution continues.

func (*Execution) Close

func (e *Execution) Close()

Close retires all provenance borrowed by the completed invocation.

func (*Execution) Data

func (e *Execution) Data() *values.StoreProvider

Data MUST remain bound to this execution's input capture.

func (*Execution) DataInputs

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

DataInputs MUST assess promotion before capturing values for either render path.

func (*Execution) Dispatch

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

Emit publishes the candidate inventory with its consumed provenance.

func (*Execution) FingerprintDedup

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

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

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

InitProbe MUST NOT publish runtime admission or status.

func (*Execution) Outcome

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

Outcome returns the retained readiness decision without reading the store.

func (*Execution) ParseChildren

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

func (*Execution) Prepare

func (e *Execution) Prepare[T any](destination *Preparation[T], discovery *T, matches func(*T) bool) *T

Prepare MUST NOT transfer input captures or grant publication authority.

func (*Execution) Probe

func (e *Execution) Probe(
	ctx context.Context,
	controller *Controller,
	object manifest.BaseManifest,
	previous schedule.Result,
) (History, []values.Result, error)

Probe MUST return its live assessment after capture starts, including on errors.

func (*Execution) ProbeCurrent

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

ProbeCurrent MUST preserve the declaration authority captured at initialization.

func (*Execution) Progressed

func (e *Execution) Progressed() bool

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

func (*Execution) RenderFailure

func (e *Execution) RenderFailure(
	ctx context.Context,
	err error,
	documents []manifest.DocOccurrence,
	unreadable []manifest.Reference,
) error

RenderFailure MUST precede publication and never excuses a failed readable document.

func (*Execution) Require

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

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

func (e *Execution) Retire()

Retire releases superseded assessment cells while retaining borrowed output.

func (*Execution) Settle

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

Settle classifies retained unresolved gates without rendering again.

func (*Execution) Take

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

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

func (*Execution) Valid

func (e *Execution) Valid() bool

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

type History

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

type Options struct {
	Cache *cache.Cache
	// Loader supplies the invocation's declaration admission boundary.
	Loader *loader.Loader
	// SkipKinds is the immutable visible-output exclusion list.
	SkipKinds []string
	// 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
	Missing   *depwait.MissingPolicy
}

Options contains immutable controller configuration installed before dispatch.

type Preparation

type Preparation[T any] struct {
	// contains filtered or unexported fields
}

Preparation MUST remain inline in its final consumer's storage.

Jump to

Keyboard shortcuts

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