Documentation
¶
Overview ¶
Package cleanup runs the server-side near-duplicate scanner and its Telegram notifier: on a fixed interval, walk every tenant, upsert pending queue 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 Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier posts cleanup summaries to a Telegram chat. Both token and chat ID must be set; if either is empty, pass nil (Scanner treats nil as silent).
func NewNotifier ¶
NewNotifier returns a Notifier, or nil if either credential is empty (pass the nil to Scanner unchanged — it treats nil as silent mode).
type ScanStats ¶
type ScanStats struct {
TenantsScanned int
PairsFound int
PairsInserted int
PairsSkipped int // already enqueued
Errors int
DocsArchived int
DocsDeleted 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, retentionRepo *repository.RetentionRepository, thresholds *staleness.ThresholdStore, multiplier int, graceDays int, notifier *Notifier, logger *slog.Logger, ) *Scanner
NewScanner constructs the scanner. A nil notifier means silent scans.