fix(cli): simplify nextInstallState's dead hadFired branch (review nit)

Both reviewers (Rames, Magi) independently flagged the same thing: by the
time the return statement executes, hadFired is always false — the guard
above already returns early for every case where hadFired was true. The
merge expression wantFired || hadFired || undefined was defensively
correct but misleading; it reads as "OR the two together" when the
function has already established only one of them can be true here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-07-29 11:28:57 -07:00
co-authored by Claude Opus 5
parent dfe92b2aab
commit ec76985f40
+5 -1
View File
@@ -92,9 +92,13 @@ function writeInstallState(next: InstallState): void {
function nextInstallState(state: InstallState | null, wantFired: boolean): InstallState | null {
const hadFired = state?.deParallelRouterTrialFired === true;
if (state !== null && (hadFired || !wantFired)) return null;
// Every path reaching here has hadFired === false (state is either null, or
// the guard above already returned when hadFired was true) — the field is
// simply wantFired, not a merge of the two (review nit, two independent
// reviewers).
return {
markerAt: state?.markerAt ?? new Date().toISOString(),
deParallelRouterTrialFired: wantFired || hadFired || undefined,
deParallelRouterTrialFired: wantFired || undefined,
};
}