package janitor import ( "context" "time" "vetting/internal/logs" "vetting/internal/store" ) // StoreAdapter bridges the concrete orchestrator stores to the Janitor's // dependency interface. Kept in the janitor package so the orchestrator // wire-up stays a single-line: janitor.New(cfg, &janitor.StoreAdapter{...}). type StoreAdapter struct { Runs *store.Runs Artifacts *store.Artifacts Logs *logs.Hub } func (a *StoreAdapter) CompletedOlderThan(ctx context.Context, cutoff time.Time) ([]int64, error) { return a.Runs.CompletedOlderThan(ctx, cutoff) } func (a *StoreAdapter) DeleteArtifactsForRun(ctx context.Context, runID int64) ([]store.Artifact, error) { return a.Artifacts.DeleteForRun(ctx, runID) } func (a *StoreAdapter) LogPathFor(runID int64) string { if a.Logs == nil { return "" } return a.Logs.PathFor(runID) }