fix(FN-2384): schedule triage and todo tasks by priority-aware FIFO
- Sort eligible todo tasks in Scheduler by priority first, then createdAt/id for stable FIFO ordering within each tier - Sort eligible triage tasks using the same priority-aware ordering while preserving existing pause/status/recovery gating - Add regression tests for scheduler and triage ordering, including blocked/paused/recovery-gated edge cases - Update architecture docs to describe priority-first task dispatch behavior
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
import { getCurrentRepo, resolveDependencyOrder, type TaskStore, type Task, type MissionStore, type MissionFeature, type PrInfo } from "@fusion/core";
|
||||
import {
|
||||
getCurrentRepo,
|
||||
resolveDependencyOrder,
|
||||
sortTasksByPriorityThenAgeAndId,
|
||||
type TaskStore,
|
||||
type Task,
|
||||
type MissionStore,
|
||||
type MissionFeature,
|
||||
type PrInfo,
|
||||
} from "@fusion/core";
|
||||
import { existsSync } from "node:fs";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
@@ -563,6 +572,8 @@ export class Scheduler {
|
||||
|
||||
if (todo.length === 0) return;
|
||||
|
||||
todo = sortTasksByPriorityThenAgeAndId(todo);
|
||||
|
||||
/**
|
||||
* Pre-compute file scopes for all currently active tasks (in-progress
|
||||
* AND in-review with unmerged worktrees) so that todo tasks are never
|
||||
|
||||
Reference in New Issue
Block a user