feat: Workspace filesystem cleanup #391
3 issues
code-simplifier: Found 3 issues (3 low)
Low
runStartupLifecycleSweep defined but not invoked in hunk - `src/daemon.ts:152-171`
The hunk defines a runStartupLifecycleSweep arrow function assigned to a const, replacing the inline try/catch that previously executed immediately. If this function is intended to run at startup, defining it as a callable abstraction without an immediate invocation adds an unnecessary layer of indirection compared to the original direct execution. Per the skill's guidance to avoid redundant abstractions and prefer direct, explicit code, inlining the lifecycle sweep (or invoking it immediately at the definition site) would be simpler than defining a single-use function unless it is awaited later in the file.
Nested ternary reduces clarity in shouldRecoverLockDir - `src/utils/fs-lock.ts:78-82`
The return statement uses a ternary expression embedded within an object-returning expression, which the skill explicitly flags as harder to read than an if/else chain. Replacing it with explicit if/else branches improves readability without changing behavior.
setRuntimeInstanceForTests parameter type is overly complex - `src/utils/runtime-instance.ts:51-53`
The parameter type uses a dense intersection of Omit and Partial<Pick> to express that workspaceKey is optional. This is harder to read than necessary and obscures intent. A simpler approach is to define an explicit type alias or use Partial<RuntimeInstance> & { instanceId: string; pid: number }, or just inline a clear object shape. Per the skill's guidance to choose clarity over brevity, the current form prioritizes type-level cleverness over readability.
Duration: 12m 41s · Tokens: 627.0k in / 2.0k out · Cost: $2.74 (+merge: $0.00)