Adds a project setting that controls how many auto-merge conflict retries run before recovery paths give up. - Add maxAutoMergeRetries to project settings defaults, schema, types, and dashboard controls. - Resolve the retry cap in engine merge handling, self-healing recovery, stall detection, and blocker fanout logic. - Cover custom retry caps with core, dashboard, and engine regression tests. Files changed: .changeset/fn-6569-max-auto-merge-retries.md | 5 ++ docs/architecture.md | 2 +- docs/settings-reference.md | 1 + .../core/src/__tests__/settings-defaults.test.ts | 12 ++++ packages/core/src/in-review-stall.ts | 16 ++++- packages/core/src/index.ts | 1 + packages/core/src/settings-schema.ts | 6 ++ packages/core/src/task-priority.ts | 4 +- packages/core/src/types.ts | 8 +++ .../dashboard/app/components/SettingsModal.tsx | 8 +++ .../components/settings/sections/MergeSection.tsx | 26 +++++++ .../app/hooks/__tests__/useBlockerFanout.test.ts | 5 +- packages/dashboard/app/hooks/useBlockerFanout.ts | 3 +- .../auto-merge-retry-cap-settings.test.ts | 79 ++++++++++++++++++++++ packages/engine/src/project-engine.ts | 77 +++++++++++++-------- packages/engine/src/self-healing.ts | 30 +++++--- 16 files changed, 236 insertions(+), 47 deletions(-) Fusion-Task-Id: FN-6569 Fusion-Task-Lineage: 42242d6a-68bc-41f1-b2d9-af2e6f168eed
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { useMemo } from "react";
|
|
import { type Task } from "@fusion/core";
|
|
import {
|
|
computeBlockerFanoutMap as computeBlockerFanoutMapCore,
|
|
type BlockerFanoutEntry,
|
|
} from "../../../core/src/blocker-fanout";
|
|
|
|
export type { BlockerFanoutEntry };
|
|
|
|
// Keep in sync with packages/engine/src/self-healing.ts default export.
|
|
// FNXC:AutoMergeRetries 2026-06-17-04:20: Dashboard fanout copy uses this as a display fallback until task-card surfaces receive live project settings; engine/self-healing decisions use resolveMaxAutoMergeRetries(settings) and are authoritative.
|
|
export const MAX_AUTO_MERGE_RETRIES = 3;
|
|
|
|
export interface UseBlockerFanoutOptions {
|
|
staleHighFanoutAgeThresholdMs?: number;
|
|
}
|
|
|
|
export function computeBlockerFanoutMap(
|
|
tasks: Task[],
|
|
options: UseBlockerFanoutOptions = {},
|
|
): Map<string, BlockerFanoutEntry> {
|
|
return computeBlockerFanoutMapCore(tasks, MAX_AUTO_MERGE_RETRIES, {
|
|
staleHighFanoutAgeThresholdMs: options.staleHighFanoutAgeThresholdMs,
|
|
});
|
|
}
|
|
|
|
export function useBlockerFanout(
|
|
tasks: Task[],
|
|
options: UseBlockerFanoutOptions = {},
|
|
): Map<string, BlockerFanoutEntry> {
|
|
return useMemo(
|
|
() => computeBlockerFanoutMap(tasks, options),
|
|
[tasks, options.staleHighFanoutAgeThresholdMs],
|
|
);
|
|
}
|