feat(FN-3452): document mesh lease recovery semantics
Documents mesh lease recovery semantics across the agents, architecture, and multi-project reference files, adding 32 lines of clarifying documentation to explain how mesh leases are recovered in the system. Fusion-Task-Id: FN-3452
This commit is contained in:
@@ -20,6 +20,7 @@ import { evaluateSpecStaleness, getPromptPath } from "./spec-staleness.js";
|
||||
import { resolveEffectiveNode } from "./effective-node.js";
|
||||
import { applyUnavailableNodePolicy } from "./node-routing-policy.js";
|
||||
import type { NodeDispatchValidationResult } from "./node-dispatch-validation.js";
|
||||
import type { MeshLeaseManager } from "./mesh-lease-manager.js";
|
||||
|
||||
/**
|
||||
* Check whether two sets of file scope paths overlap.
|
||||
@@ -117,6 +118,8 @@ export interface SchedulerOptions {
|
||||
prMonitor?: PrMonitor;
|
||||
/** Optional MissionStore for slice activation and auto-advance */
|
||||
missionStore?: MissionStore;
|
||||
/** Optional lease manager used to recover stale checkout leases before scheduling. */
|
||||
leaseManager?: MeshLeaseManager;
|
||||
/** Optional MissionAutopilot for autonomous mission progression */
|
||||
missionAutopilot?: import("./mission-autopilot.js").MissionAutopilot;
|
||||
/**
|
||||
@@ -676,6 +679,18 @@ export class Scheduler {
|
||||
for (const taskId of ordered) {
|
||||
const task = tasks.find((t) => t.id === taskId)!;
|
||||
|
||||
if (task.checkedOutBy && this.options.leaseManager) {
|
||||
const recovered = await this.options.leaseManager.recoverAbandonedLease(
|
||||
task.id,
|
||||
"scheduler detected stale todo lease",
|
||||
{ preserveProgress: true },
|
||||
);
|
||||
if (!recovered) {
|
||||
await this.store.updateTask(task.id, { status: "queued" });
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Check all deps are satisfied (done, in-review, or archived)
|
||||
const unmetDeps = task.dependencies.filter((depId) => {
|
||||
const dep = tasks.find((t) => t.id === depId);
|
||||
|
||||
Reference in New Issue
Block a user