Documentation
¶
Overview ¶
Package scheduler turns durable intake evidence into frozen consolidation windows. It owns retry mechanics only; semantic eligibility and every Seed transition remain inside the consolidation engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrLeaseLost = errors.New("consolidation Job lease lost")
ErrLeaseLost means another process no longer recognizes the caller's lease.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
QuietPeriod time.Duration
LeaseDuration time.Duration
WorkerTimeout time.Duration
RetryDelay time.Duration
PollInterval time.Duration
MaxEpisodes int
Overlap int
OnError func(error)
}
Config controls batching and retry frequency, not learning meaning.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig waits for a short quiet period, while a full window is ready immediately. One complete Episode is enough after the quiet period.
type Engine ¶
type Engine interface {
ConsolidateWindow(context.Context, consolidation.Window, consolidation.Worker) (consolidation.Receipt, error)
}
Engine is the single semantic commit entry. Scheduler never branches on FORM, REENACT, INHIBIT, or REVISE.
type Job ¶
Job is one immutable leased window. Stable refs remain Core-owned and are never generated or rewritten by the inference Worker.
type LeaseRequest ¶
LeaseRequest carries only runtime timing and bounded-window policy.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor leases, consolidates, and acknowledges one durable Job at a time.
func New ¶
New constructs a background processor. Non-positive timing values fall back to safe defaults so environment parsing cannot create a busy loop.
func (*Processor) ProcessOne ¶
ProcessOne runs exactly one frozen Job. A failed semantic call releases the same window for retry; a commit followed by a lost ack is safe because the engine freezes its own receipt by Job ref and window hash.
type Queue ¶
type Queue interface {
LeaseConsolidationJob(context.Context, LeaseRequest) (Job, bool, error)
CompleteConsolidationJob(context.Context, string, string) error
RetryConsolidationJob(context.Context, string, string, time.Time) error
}
Queue is the minimal durable work boundary implemented by PostgreSQL.