Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Planner ¶ added in v0.12.0
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 ¶ added in v0.12.0
func NewPlanner( cfg *config.Github, preflights []Preflight, workers []Worker, repoRepo *repositories.RepositoryRepository, ) *Planner
func (*Planner) InfraClassifier ¶ added in v0.14.0
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 ¶ added in v0.12.0
func (p *Planner) Preflights() []PreflightUnit
Preflights returns one-shot units for all repositories × all preflight specs.
func (*Planner) Workers ¶ added in v0.12.0
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 ¶ added in v0.12.0
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 ¶ added in v0.12.0
func NewPreflights( repoValidator *preflights.RepositoryValidator, ) []Preflight
NewPreflights registers all preflight tasks. Add new preflights here when extending the system.
type PreflightUnit ¶ added in v0.12.0
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.
Scheduler is generic — it doesn't know about repositories, GitHub, or issues. It only knows phases and task units provided by Planner.
type Worker ¶ added in v0.12.0
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 ¶ added in v0.12.0
func NewWorkers( issueParser *workers.IssuePoller, ) []Worker
NewWorkers registers all worker tasks. Add new workers here when extending the system.
type WorkerUnit ¶ added in v0.12.0
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.