depwait

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 17 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 depwait resolves a controller's NamedResource dependencies for the dag scheduler: Classify decides, WITHOUT blocking, whether each dep is Ready, terminally Failed, or still blocked (parkable). The shared readiness predicates (readyNow, the ReadyExpr evaluator, discovery-record promotion) live here so the gate semantics are single-sourced.

Index

Constants

This section is empty.

Variables

View Source
var ErrDeclarationAbsent = errors.New("object not in store at reconcile time")

ErrDeclarationAbsent identifies a dispatch subject that did not materialize.

Functions

func DataReferences added in v0.8.1

func DataReferences(references iter.Seq[manifest.Reference]) iter.Seq[manifest.Reference]

DataReferences selects authored data inputs, including optional inputs with data policy.

func OrderingGates added in v0.8.1

func OrderingGates(obj manifest.BaseManifest, reads *store.ReadSet) []manifest.DependencyRef

OrderingGates selects the readiness edges from an effective declaration.

func SelectGates added in v0.8.1

func SelectGates(
	references iter.Seq[manifest.Reference], stage manifest.GateStage, capacity int, reads *store.ReadSet,
) []manifest.DependencyRef

SelectGates retains the authored order and applies the checkpoint's content mask.

Types

type AssessmentStage added in v0.8.1

type AssessmentStage uint8

AssessmentStage preserves preparation order and distinguishes the dispatch subject from its prerequisites.

const (
	AssessGates AssessmentStage = iota
	AssessDeclaration
	AssessDispatch
)

A declaration gate MUST NOT wait for the subject to mark itself Ready.

type BlockedError

type BlockedError struct {
	Deps []manifest.NamedResource
}

BlockedError MUST remain separate from user-facing failure sentinels.

func (*BlockedError) Error

func (e *BlockedError) Error() string

type Classification

type Classification struct {
	Kind         schedule.Kind
	ToleratedCRD bool
	Subject      *manifest.DiagnosticIdentity
	Message      string
	Causes       []manifest.DiagnosticReason
	Err          error
}

Classification retains one dependency's readiness decision. Successful decisions MUST not carry an expanded DiagnosticReason.

func (Classification) DiagnosticReason

DiagnosticReason returns captured failure context for the raw dependency id. id MUST be the raw dependency passed to Classify.

type DataAssessment added in v0.8.1

type DataAssessment struct {
	Inputs  []DataDependency
	Blocked []manifest.NamedResource
	Failed  *manifest.DependencyFailedError
	Results []values.Result
	// contains filtered or unexported fields
}

DataAssessment retains failures while unresolved values inputs can still settle.

func (*DataAssessment) Settle added in v0.8.1

func (a *DataAssessment) Settle(
	ctx context.Context,
	w *Waiter,
	reads *store.ReadSet,
	level manifest.DrainLevel,
) error

Settle applies the same availability and failure rules in live and detached assessments.

type DataDependency

type DataDependency struct {
	manifest.Reference

	Input  store.ReferenceFacts
	Result values.Result
}

DataDependency MUST retain the authored reference with its captured facts.

type ExistenceLookup

type ExistenceLookup interface {
	// IsFileIndexed reports whether id has a raw-file discovery record.
	IsFileIndexed(id manifest.NamedResource) bool
	// Promote attempts to materialize id into the Store from the
	// discovery index. Returns true when promotion succeeded
	// and id is now reachable via store.GetObject.
	Promote(context.Context, selection.PrepareRequest, manifest.NamedResource) (bool, error)
}

ExistenceLookup is the seam Classify uses to resolve missing dependencies. Bundled into one interface so the orchestrator (and any future embedder) wires a single object through the controller Options pipe instead of two parallel closures.

The orchestrator's implementation reads from the loader's discovery index — file-indexed objects (CMs/Secrets/HRs the discovery loader kept out of the Store) get lazy-promoted the moment a depwait edge needs them, while render-only ids (no file record) stay absent until a parent render's emitRenderedChildren chain produces them.

type MissingPolicy

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

MissingPolicy MUST remain immutable after construction.

func NewMissingPolicy

func NewMissingPolicy(kinds []string) *MissingPolicy

NewMissingPolicy MUST snapshot selections before concurrent assessment.

func (*MissingPolicy) Admission

Admission MUST project values policy without importing values into selection.

func (*MissingPolicy) AllowsKind

func (p *MissingPolicy) AllowsKind(kind string) bool

AllowsKind MUST share the invocation selection with source acquisition.

type Waiter

type Waiter struct {
	Admission               selection.PrepareRequest
	Decision                *selection.Decision
	Store                   stateReader
	Parent                  manifest.NamedResource
	Missing                 *MissingPolicy
	IncompatibleDeclaration bool
	// Materializer requires readiness even for existence-only dependency kinds.
	Materializer bool

	// Existence, when non-nil, lets Classify lazy-promote a missing dep
	// from the loader's discovery records before deciding it is
	// absent. The orchestrator wires this against the discovery index;
	// tests supply stubs. When nil, an absent dep is simply absent.
	//
	// See ExistenceLookup for the decision matrix.
	Existence ExistenceLookup
	// contains filtered or unexported fields
}

Waiter holds the parameters for one dependency-classification operation.

func (*Waiter) Assess

func (w *Waiter) Assess(
	ctx context.Context,
	reads *store.ReadSet,
	level manifest.DrainLevel,
	stage AssessmentStage,
) error

Assess preserves readiness and dependency provenance without publishing live status.

func (*Waiter) Available

func (w *Waiter) Available(ctx context.Context, dep DataDependency, level manifest.DrainLevel) availability

Available MUST combine structural settlement with the captured values decision.

func (*Waiter) Classify

Classify resolves readiness and required content from one captured snapshot.

func (*Waiter) Prediction

func (w *Waiter) Prediction(
	ctx context.Context,
	reads *store.ReadSet,
	references iter.Seq[manifest.Reference],
	index *manifest.DiscoveryIndex,
) error

Prediction assesses captured references without promotion, publication, or execution authority.

Jump to

Keyboard shortcuts

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