Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type GlobalWorker ¶ added in v0.18.0
type GlobalWorker interface {
TaskSpec() spec.GlobalWorkerSpec
}
GlobalWorker is a long-running interval task not scoped to a repository. Implementations return a GlobalWorkerSpec describing work on shared resources.
Task naming convention: worker:{Resource} Examples:
- worker:issue-explainer
func NewGlobalWorkers ¶ added in v0.18.0
func NewGlobalWorkers( issueExplainer *workers.IssueExplainer, ) []GlobalWorker
NewGlobalWorkers registers all global worker tasks (not multiplied per repository). Add new global workers here when extending the system.
type Planner ¶
type Planner struct {
// contains filtered or unexported fields
}
Planner builds per-repository task units from domain specs. It owns the per-repo concept: each repository in config produces a set of preflight and worker units.
func NewPlanner ¶
func NewPlanner( cfg *config.Github, preflights []Preflight, workers []Worker, repoRepo *repositories.RepositoryRepository, ) *Planner
func (*Planner) InfraClassifier ¶
func (p *Planner) InfraClassifier() longrun.ClassifierFunc
InfraClassifier returns a ClassifierFunc that checks apierr interfaces on errors returned by infrastructure clients.
Classification:
- apierr.WaitHinted with positive WaitDuration → Service + explicit wait
- apierr.ServicePressure → Service
- apierr.Retryable → Service
- unknown → nil (let baseline handle as Unknown/Degraded)
func (*Planner) Preflights ¶
func (p *Planner) Preflights() []PreflightUnit
Preflights returns one-shot units for all repositories × all preflight specs.
func (*Planner) Workers ¶
func (p *Planner) Workers() []WorkerUnit
Workers returns interval units for all repositories × all worker specs. Each unit caches the repository ID on first invocation to avoid repeated lookups.
type Preflight ¶
type Preflight interface {
TaskSpec() spec.PreflightSpec
}
Preflight is a one-shot task that must complete before workers start. Implementations return a PreflightSpec describing the work to be done per tenant.
Task naming convention: preflight:{Resource}:{owner}/{name} Examples:
- preflight:repository-validator:thumbrise/autosolve
func NewPreflights ¶
func NewPreflights( repoValidator *preflights.RepositoryValidator, ) []Preflight
NewPreflights registers all preflight tasks. Add new preflights here when extending the system.
type PreflightUnit ¶
type PreflightUnit struct {
Resource string
Repo config.Repository
Work longrun.WorkFunc
}
PreflightUnit is a ready-to-schedule one-shot task produced by Planner.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler orchestrates execution in two phases:
- Preflights — one-shot tasks, all must pass before workers start.
- Workers — long-running interval tasks (per-repo and global).
Scheduler is generic — it doesn't know about repositories, GitHub, or issues. It only knows phases and task units provided by Planner and global workers.
func NewScheduler ¶
func NewScheduler(planner *Planner, globalWorkers []GlobalWorker, logger *slog.Logger) *Scheduler
type Worker ¶
type Worker interface {
TaskSpec() spec.WorkerSpec
}
Worker is a long-running interval task. Implementations return a WorkerSpec describing the work to be done per tenant.
Task naming convention: worker:{Resource}:{owner}/{name} Examples:
- worker:issue-poller:thumbrise/autosolve
- worker:comment-poller:thumbrise/otelext
func NewWorkers ¶
func NewWorkers( issuePoller *workers.IssuePoller, outboxRelay *workers.OutboxRelay, ) []Worker
NewWorkers registers all per-repository worker tasks. Add new workers here when extending the system.
type WorkerUnit ¶
type WorkerUnit struct {
Resource string
Repo config.Repository
Interval time.Duration
Work longrun.WorkFunc
}
WorkerUnit is a ready-to-schedule interval task produced by Planner.