queuescanner

package
v0.199.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: BSD-2-Clause Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type PromptProcessor interface {
	ProcessPrompt(ctx context.Context, pr prompt.Prompt) error
}

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.DirLock,
	lockTimeout time.Duration,
) Scanner

NewScanner creates a new Scanner.

fileLockFactory may be nil — it defaults to lock.NewDirLock. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL