fix(web): keep unattended planner state auditable
This commit is contained in:
@@ -90,7 +90,17 @@ const collect = () => {
|
||||
const supervisorLock = lockInfo(supervisorLockPath);
|
||||
const handoff = latestHandoff();
|
||||
const active = schedulerLock.alive || (guardianLock.alive && supervisorLock.alive);
|
||||
const blocked = scheduler?.state === "blocked" || guardian?.state === "blocked" || supervisor?.state === "blocked";
|
||||
let terminalQueue = false;
|
||||
try {
|
||||
const manifest = queue.task ? readJson(`tests/golden/${queue.task}/manifest.json`) : null;
|
||||
const index = readJson("tests/golden/WBV2/task-index.json");
|
||||
terminalQueue = !active && index?.activeTask === null && manifest?.status === "done" && manifest?.nextTask === null;
|
||||
} catch { /* A malformed pointer remains visible as a normal checkpoint failure. */ }
|
||||
const checkpointBlocked = scheduler?.state === "blocked" || guardian?.state === "blocked" || supervisor?.state === "blocked";
|
||||
// A terminal task can leave a historical blocked checkpoint behind (for
|
||||
// example, after a push retry). The watchdog owns the next planner attempt;
|
||||
// do not report that stale checkpoint as a live execution block.
|
||||
const blocked = checkpointBlocked && !terminalQueue;
|
||||
const state = blocked ? "BLOCKED" : active ? "RUNNING" : "IDLE";
|
||||
const phase = blocked ? "blocked" : scheduler?.state === "running" ? "scheduler-task" : supervisor?.state === "running" ? "task-or-gate" : scheduler?.state ?? supervisor?.state ?? "unknown";
|
||||
const observed = new Date().toISOString();
|
||||
|
||||
Reference in New Issue
Block a user