This commit is contained in:
ponzischeme89
2026-08-16 12:13:51 +12:00
parent bd3732fba5
commit b9374baaf1
47 changed files with 2793 additions and 364 deletions
+32
View File
@@ -174,6 +174,38 @@ type CandidateSource interface {
Candidates(ctx context.Context) ([]Candidate, error)
}
// ConfigurableCandidateSource accepts live operator tuning without rebuilding the worker.
type ConfigurableCandidateSource interface {
Configure(Config)
}
// ScanAttempt is the durable operational account of one claimed candidate. Unlike the
// queue, this is history rather than scheduling state, so retaining it does not turn the
// worker into a persistent job system.
type ScanAttempt struct {
ItemID string
SeriesID string
Season int
Episode int
Reason string
Priority int
Outcome string
MarkerMs int64
Confidence float64
Method string
Frames int
Error string
StartedAt time.Time
FinishedAt time.Time
}
// HistoryRepository records completed scans and answers which speculative candidates are
// still inside their retry cooldown.
type HistoryRepository interface {
SaveScanAttempt(ctx context.Context, attempt ScanAttempt) error
RecentScanTimes(ctx context.Context, itemIDs []string, since time.Time) (map[string]time.Time, error)
}
// Repository is the marker store. Narrow on purpose — the scheduler must not be able to
// write anything else, because "one row per successful scan and nothing else" is the
// performance claim this subsystem is making.