feat(FN-4969): merge fusion/fn-4969

This commit is contained in:
gsxdsm
2026-05-17 22:57:15 -07:00
parent e2938114c0
commit 02ba659dd8
8 changed files with 304 additions and 5 deletions

View File

@@ -1,7 +1,8 @@
import {
getCurrentRepo,
resolveDependencyOrder,
sortTasksByPriorityThenAgeAndId,
sortTasksByPriorityFanoutThenAgeAndId,
buildUnblockWeightMap,
computeBlockerFanoutMap,
HIGH_FANOUT_BLOCKER_TODO_THRESHOLD,
type TaskStore,
@@ -812,7 +813,18 @@ export class Scheduler {
if (todo.length === 0) return;
todo = sortTasksByPriorityThenAgeAndId(todo);
const maxAutoMergeRetries =
typeof settings.maxAutoMergeRetries === "number" ? settings.maxAutoMergeRetries : undefined;
const unblockWeights = buildUnblockWeightMap(tasks, {
maxAutoMergeRetries,
});
todo = sortTasksByPriorityFanoutThenAgeAndId(todo, unblockWeights);
const topWeightedTask = todo.find((candidate) => (unblockWeights.get(candidate.id) ?? 0) >= 1);
if (topWeightedTask) {
schedulerLog.log(
`Dispatch ordering: priority+fanout (top: ${topWeightedTask.id}=${unblockWeights.get(topWeightedTask.id) ?? 0})`,
);
}
/**
* Pre-compute file scopes for all currently active tasks (in-progress