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 ¶
- type BlockedError
- type Classification
- 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 ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
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 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
Store stateReader
Parent manifest.NamedResource
Missing *MissingPolicy
// 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
}
Waiter holds the parameters for one dependency-classification operation.
func (*Waiter) Assess ¶
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.