Documentation
¶
Overview ¶
Package cleanup runs the server-side near-duplicate scanner and its webhook notifier: on the configured interval, walk every tenant, upsert pending entries. Merging happens client-side in a scheduled agent — this package calls no LLMs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalConfig ¶ added in v1.1.1
type GlobalConfig interface {
CleanupEnabled() bool
CleanupIntervalHours() int
HistoryRetentionDays() int
WebhookURL() string
}
GlobalConfig is the live global-config slice the cleanup pipeline reads each cycle; *globalconfig.Accessor satisfies it.
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier POSTs a cleanup-scan JSON summary to the webhook URL from the live config. An empty URL disables it: no request is made.
func NewNotifier ¶
func NewNotifier(gc GlobalConfig) *Notifier
NewNotifier returns a Notifier that reads its target webhook URL live from gc.
type ScanStats ¶
type ScanStats struct {
TenantsScanned int
PairsFound int
PairsInserted int
PairsSkipped int // already enqueued
Errors int
HistoryPruned int
}
ScanStats summarises one sweep across all tenants.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner runs the near-duplicate scan and keeps cleanup_queue populated.
func NewScanner ¶
func NewScanner( lint *repository.LintRepository, tenants *repository.TenantRepository, queue *repository.CleanupQueueRepository, history *repository.MutationHistoryRepository, gc GlobalConfig, notifier *Notifier, logger *slog.Logger, ) *Scanner
NewScanner constructs the scanner. gc supplies the live retention window, interval, and enabled flag; a nil notifier means silent scans.