feat(FN-5052): complete Step 2 — gate in-review stall helper on autoMerge

Fusion-Task-Id: FN-5052
Fusion-Task-Lineage: 607cd9e6-e4d0-4572-b183-8253d127209f
This commit is contained in:
Fusion (runfusion.ai)
2026-05-18 08:25:02 -07:00
committed by gsxdsm
parent cf9d5f0b76
commit c9902bd948

View File

@@ -7,6 +7,9 @@ import type { Task, TaskLogEntry } from "./types.js";
*
* Returning a signal is diagnostic-only and does not trigger any mutation by
* itself. Callers MUST NOT use this helper as an auto-completion signal.
*
* When `context.autoMerge === false`, the signal is unconditionally suppressed
* because in-review tasks are expected to remain on the PR-based manual flow.
*/
export type InReviewStallCode =
| "merge-blocker"
@@ -22,6 +25,7 @@ export interface InReviewStallSignal {
export interface InReviewStallContext {
now?: number;
autoMerge?: boolean;
activeMergeTaskId?: string | null;
executingTaskIds?: ReadonlySet<string>;
staleMergingMinAgeMs?: number;
@@ -73,6 +77,10 @@ export function getInReviewStallReason(
return undefined;
}
if (context.autoMerge === false) {
return undefined;
}
const now = context.now ?? Date.now();
const observedAt = new Date(now).toISOString();
const staleMergingMinAgeMs = context.staleMergingMinAgeMs ?? DEFAULT_STALE_MERGING_MIN_AGE_MS;