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 ¶
- Variables
- func DataReferences(references iter.Seq[manifest.Reference]) iter.Seq[manifest.Reference]
- func OrderingGates(obj manifest.BaseManifest, reads *store.ReadSet) []manifest.DependencyRef
- func SelectGates(references iter.Seq[manifest.Reference], stage manifest.GateStage, ...) []manifest.DependencyRef
- type AssessmentStage
- type BlockedError
- type Classification
- type DataAssessment
- type DataDependency
- type ExistenceLookup
- type MissingPolicy
- type Waiter
- func (w *Waiter) Assess(ctx context.Context, reads *store.ReadSet, level manifest.DrainLevel, ...) error
- func (w *Waiter) Available(ctx context.Context, dep DataDependency, level manifest.DrainLevel) availability
- func (w *Waiter) Classify(ctx context.Context, dep manifest.DependencyRef, level manifest.DrainLevel) Classification
- func (w *Waiter) Prediction(ctx context.Context, reads *store.ReadSet, ...) error
Constants ¶
This section is empty.
Variables ¶
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
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.
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 ¶
func (c Classification) DiagnosticReason(id manifest.NamedResource) manifest.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.
type DataDependency ¶
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 ¶
func (p *MissingPolicy) Admission(ref *manifest.Reference, input *store.ReferenceFacts) selection.InputAdmission
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 ¶
func (w *Waiter) Classify(ctx context.Context, dep manifest.DependencyRef, level manifest.DrainLevel) Classification
Classify resolves readiness and required content from one captured snapshot.