fix(goal): quiet waits and unify fleet NG ownership (#56, #57, #58)

This commit is contained in:
Dewey
2026-09-06 04:07:09 -05:00
parent 7345f330fc
commit 9a5fbdbda7
14 changed files with 892 additions and 26 deletions
+4 -3
View File
@@ -77,7 +77,7 @@ export interface GoalState {
wakeDispatchedAt?: number;
wakeObserved?: boolean;
};
/** Operator opt-in: suspend waits, with one deadline wake per goal/resume. */
/** Operator opt-in: add one deadline wake to a suspended wait per goal/resume. */
waitTimeoutSeconds?: number;
waitWakeUsed?: boolean;
setAt: string;
@@ -144,7 +144,8 @@ export function blockGoal(state: GoalState, reason: string): GoalState {
}
export function resumeGoal(state: GoalState): GoalState {
if (state.status !== "paused" && state.status !== "blocked") return state;
if (state.status !== "paused" && state.status !== "blocked" &&
!(state.status === "active" && state.activeWait)) return state;
return {
...state,
status: "active",
@@ -152,7 +153,7 @@ export function resumeGoal(state: GoalState): GoalState {
noProgressReports: 0,
workEventSinceReport: false,
pausedReason: undefined,
activeWait: state.waitTimeoutSeconds ? undefined : state.activeWait,
activeWait: undefined,
waitWakeUsed: state.waitTimeoutSeconds ? false : state.waitWakeUsed,
};
}