refactor: collapse single-implementation interfaces
Nine interfaces had exactly one implementation and no test double — they existed only to be named twice in a DI registration: IFindingsStore, IFindingsStoreLocator, IPrimeScheduleSignal, IRefineRunner, IWeekReportService, IMergeCoordinator, IMissionControlPane, IOnlineLoginService, ITaskListFilter. Consumers now depend on the concrete type; the DTO records that shared those files moved next to their implementation. IInteractiveLaunchSpecService stays — it carries 54 lines of contract documentation, which is not ceremony. IMergeCoordinator in particular had a redundant null object: MergeCoordinator with a null Handler already no-ops, and every test used the real class with Handler set. Filtering/ collapses from 8 files to 1. ITaskListFilter and TaskListFilterBase were a double abstraction over four predicates, with MatchesAsContext => false declared in both. SmartFlagFilter also compiled its expression twice (its own _flag plus the inherited Matches cache) — it now uses the cache. StaticTokenAuthProvider was in src but production uses ZitadelAuthProvider; it is a test double, so it moves to the test project. Its own test goes away with it.
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
namespace ClaudeDo.Worker.Prime;
|
||||
public interface IPrimeScheduleSignal
|
||||
{
|
||||
void Signal();
|
||||
CancellationToken CurrentToken { get; }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace ClaudeDo.Worker.Prime;
|
||||
|
||||
public sealed class PrimeScheduleSignal : IPrimeScheduleSignal, IDisposable
|
||||
public sealed class PrimeScheduleSignal : IDisposable
|
||||
{
|
||||
private CancellationTokenSource _cts = new();
|
||||
private readonly object _lock = new();
|
||||
|
||||
@@ -21,7 +21,7 @@ public sealed class PrimeScheduler : BackgroundService
|
||||
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
|
||||
private readonly IPrimeRunner _runner;
|
||||
private readonly IPrimeClock _clock;
|
||||
private readonly IPrimeScheduleSignal _signal;
|
||||
private readonly PrimeScheduleSignal _signal;
|
||||
private readonly IPrimeBroadcaster _broadcaster;
|
||||
private readonly PrimeSchedulerOptions _options;
|
||||
private readonly ILogger<PrimeScheduler> _logger;
|
||||
@@ -30,7 +30,7 @@ public sealed class PrimeScheduler : BackgroundService
|
||||
IDbContextFactory<ClaudeDoDbContext> dbFactory,
|
||||
IPrimeRunner runner,
|
||||
IPrimeClock clock,
|
||||
IPrimeScheduleSignal signal,
|
||||
PrimeScheduleSignal signal,
|
||||
IPrimeBroadcaster broadcaster,
|
||||
PrimeSchedulerOptions options,
|
||||
ILogger<PrimeScheduler> logger)
|
||||
|
||||
Reference in New Issue
Block a user