Documentation
¶
Overview ¶
Package queuescanner drives the queue-scan loop: listing queued prompts, validating them, handling blockers, and dispatching to a PromptProcessor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PromptManager ¶
type PromptManager interface {
ListQueued(ctx context.Context) ([]prompt.Prompt, error)
Load(ctx context.Context, path string) (*prompt.PromptFile, error)
AllPreviousCompleted(ctx context.Context, n int) bool
FindMissingCompleted(ctx context.Context, n int) []int
FindPromptStatusInProgress(ctx context.Context, number int) string
SetStatus(ctx context.Context, path string, status string) error
// Per-spec predecessor lookup (spec 092)
AllPreviousInSpecCompleted(ctx context.Context, n int, specID string) bool
FindMissingInSpecCompleted(ctx context.Context, n int, specID string) int
}
PromptManager is the minimal subset this package needs. Defined locally to avoid an import cycle (pkg/processor imports queuescanner).
type PromptProcessor ¶
PromptProcessor executes a single prompt end-to-end. Implemented by *processor (avoids a cycle: scanner depends on processor's per-prompt entrypoint).
type Scanner ¶
type Scanner interface {
// ScanAndProcess returns the count of prompts that completed during this scan.
// The count feeds into the post-#337 NothingToDoCallback (no-progress detection in one-shot mode).
ScanAndProcess(ctx context.Context) (completed int, err error)
// HasPendingVerification returns true if any prompt in the queue dir has pending_verification status.
HasPendingVerification(ctx context.Context) bool
// ClearSkippedCache clears the skip cache so all files are re-evaluated on the next scan.
// Called by the processor on fsnotify wakeup events.
ClearSkippedCache()
}
Scanner drives the queue-scan loop: list queued, validate, dispatch to PromptProcessor, handle blockers.
func NewScanner ¶
func NewScanner( promptManager PromptManager, promptProcessor PromptProcessor, failureHandler failurehandler.Handler, queueDir string, fileLockFactory func(path string) lock.FileLock, lockTimeout time.Duration, ) Scanner
NewScanner creates a new Scanner.
fileLockFactory may be nil — it defaults to lock.NewFileLock. The factory is used to acquire a per-prompt lock right before the daemon hands a candidate to the processor, so a concurrent `prompt reject` (spec 092 AC "concurrent-reject-advance") cannot interleave its own save/rename with our processing. lockTimeout may be zero — it defaults to 5 seconds; on timeout the advance emits the `project-lock-timeout` blocked reason and re-polls on the next cycle.