Versions in this module Expand all Collapse all v0 v0.36.0 Sep 12, 2026 v0.35.0 Sep 12, 2026 Changes in this version + const Fresh + const StaleAfter + const TriggerManual + var ErrOccupied = fmt.Errorf("this occurrence already has a run") + func DBPath() (string, error) + func LeaseKey(t task.Task, project string) string + func LeaseKeys(t task.Task, project string) []string + func NewID(now time.Time) string + func OccurrenceID(tr task.Trigger, at time.Time) string + func Spec(tr task.Trigger) occurrence.Spec + func Summarize(results []CheckResult) string + func TriggerKey(tr task.Trigger) string + func Verify(ctx context.Context, dir string, commands []string, env ...string) ([]CheckResult, VerificationStatus) + type AuthSource func() runtimes.Authorizations + type CheckResult struct + Command string + Duration time.Duration + Err string + ExitCode int + Output string + func (c CheckResult) OK() bool + type Decision struct + Advance time.Time + Dropped int + Fire []time.Time + Why string + func Due(tr task.Trigger, last, now time.Time) (Decision, error) + type ErrLeaseHeld struct + Holder Lease + func (e ErrLeaseHeld) Error() string + type Escalation string + const EscalateAttention + const EscalateNone + const EscalatePause + const EscalateRetry + func ParseEscalation(out string) (Escalation, string) + type ExecutionStatus string + const ExecBlocked + const ExecCompleted + const ExecFailed + const ExecInterrupted + const ExecTimedOut + type Lease struct + AcquiredAt time.Time + HeartbeatAt time.Time + Host string + Key string + PID int + RunID string + Task string + func (l Lease) Expired(now time.Time, host string) bool + type Outcome string + const OutcomeBlocked + const OutcomeFailed + const OutcomeInterrupted + const OutcomeNeedsAttention + const OutcomeNoChange + const OutcomeSuccess + func Decide(exec ExecutionStatus, verify VerificationStatus, changed bool, ...) Outcome + type Pause struct + Project string + Reason string + RunID string + Since time.Time + Task string + func (p Pause) String() string + type PollResult struct + Errs []error + Skipped int + Started []Run + type Result struct + BaseRev string + Branch string + Changed bool + Checks string + CommitSHA string + CreatedBranch bool + CreatedCommit bool + CreatedPR bool + Detail string + Escalation Escalation + EscalationWhy string + ExecStatus ExecutionStatus + LogPath string + Outcome Outcome + PRNumber int + PRURL string + Remote string + ResultRev string + Summary string + VerifyStatus VerificationStatus + Worktree string + func (r Result) OKOutcome() bool + type Run struct + AuthID string + AuthScope string + Backlog int + BaseRev string + Branch string + Changed bool + Checks string + CommitSHA string + CreatedBranch bool + CreatedCommit bool + CreatedPR bool + CredSource string + Definition string + Detail string + ExecStatus ExecutionStatus + FinishedAt time.Time + Grants []string + HeartbeatAt time.Time + Host string + ID string + LogPath string + MaxCostUSD float64 + ModelRequested string + ModelResolved string + OccurredAt time.Time + Outcome Outcome + PID int + PRNumber int + PRURL string + Project string + Remote string + ResultRev string + Revision string + RuntimeRequested string + RuntimeResolved string + Seen Seen + StartedAt time.Time + State State + Summary string + Task string + Timeout time.Duration + TriggerID string + TriggerKind string + VerifyStatus VerificationStatus + Worktree string + func Freeze(t task.Task, root, triggerKind, triggerID string, now time.Time) (Run, error) + func FreezeAt(t task.Task, root, triggerKind, triggerID string, occurredAt, now time.Time, ...) (Run, error) + func FreezeWith(t task.Task, root, triggerKind, triggerID string, occurredAt, now time.Time, ...) (Run, error) + func (r Run) OK() bool + func (r Run) Terminal() bool + type Runner struct + Auth AuthSource + Available func() []string + HeartbeatEvery time.Duration + Spawn SpawnFunc + Store *Store + func NewRunner(store *Store, auth AuthSource) *Runner + func (r *Runner) Execute(ctx context.Context, run Run, t task.Task) (Run, error) + func (r *Runner) Poll(ctx context.Context, tasks []task.Task, root string, now time.Time) PollResult + func (r *Runner) Run(ctx context.Context, t task.Task, root, triggerKind, triggerID string) (Run, error) + func (r *Runner) Start(ctx context.Context, t task.Task, root, triggerKind, triggerID string, ...) (Run, error) + type Seen string + const SeenAcknowledged + const SeenSeen + const SeenUnseen + type SpawnFunc func(ctx context.Context, req SpawnRequest) (SpawnResult, error) + type SpawnRequest struct + DenyCommands []string + DenyTools []string + Env []string + Instructions string + Mode permissions.Mode + Project string + ReadOnly bool + RunID string + Timeout time.Duration + WorkDir string + type SpawnResult struct + ExitCode int + LogPath string + Text string + type State string + const StateDone + const StatePending + const StateRunning + type Store struct + func Open(ctx context.Context, path string) (*Store, error) + func OpenDefault(ctx context.Context) (*Store, error) + func (s *Store) Acknowledge(ctx context.Context, id string) error + func (s *Store) Acquire(ctx context.Context, key, runID, taskName string, now time.Time) error + func (s *Store) Active(ctx context.Context, task string) ([]Run, error) + func (s *Store) Claim(ctx context.Context, id string, now time.Time) (bool, error) + func (s *Store) Close() error + func (s *Store) Create(ctx context.Context, r Run) (Run, error) + func (s *Store) Finish(ctx context.Context, id string, outcome Outcome, ...) error + func (s *Store) FinishResult(ctx context.Context, id string, r Result, now time.Time) error + func (s *Store) Get(ctx context.Context, id string) (Run, error) + func (s *Store) Heartbeat(ctx context.Context, id string, now time.Time) error + func (s *Store) MarkSeen(ctx context.Context, ids []string) error + func (s *Store) Note(ctx context.Context, id, note string) error + func (s *Store) Pause(ctx context.Context, p Pause) error + func (s *Store) Paused(ctx context.Context) ([]Pause, error) + func (s *Store) PausedTask(ctx context.Context, taskName, project string) (Pause, bool, error) + func (s *Store) Recent(ctx context.Context, task string, limit int) ([]Run, error) + func (s *Store) Reconcile(ctx context.Context, now time.Time) (int, error) + func (s *Store) Release(ctx context.Context, key, runID string) error + func (s *Store) Renew(ctx context.Context, key, runID string, now time.Time) error + func (s *Store) Resume(ctx context.Context, taskName, project string) (bool, error) + func (s *Store) SetWatermark(ctx context.Context, taskName, triggerKey string, at, now time.Time) error + func (s *Store) Unseen(ctx context.Context, limit int) ([]Run, error) + func (s *Store) Watermark(ctx context.Context, taskName, triggerKey string) (time.Time, error) + type VerificationStatus string + const VerifyFail + const VerifyNone + const VerifyPass + const VerifySkipped