diff --git a/src/resources/extensions/sf/auto-dispatch.ts b/src/resources/extensions/sf/auto-dispatch.ts index 630b0af18..ee74aab49 100644 --- a/src/resources/extensions/sf/auto-dispatch.ts +++ b/src/resources/extensions/sf/auto-dispatch.ts @@ -522,6 +522,25 @@ When done, say: "Validation attention remediated; ready for revalidation."`; // ─── Rules ──────────────────────────────────────────────────────────────── export const DISPATCH_RULES: DispatchRule[] = [ + { + // ADR-011 Phase 2 (gsd-2 ADR): mid-execution escalation pause. + // Must evaluate FIRST — phase-agnostic rules below (rewrite-docs gate, + // UAT checks, reassess) cannot bypass a pending user decision. + // state.ts emits phase='escalating-task' only when there's an actionable + // escalation; this rule turns that into a clean 'stop' with the message + // state.nextAction already populated. + name: "escalating-task → pause-for-escalation", + match: async ({ state, mid }) => { + if (state.phase !== "escalating-task") return null; + return { + action: "stop", + reason: + state.nextAction || + `${mid}: task escalation awaits user resolution. Run /sf escalate list to see pending items.`, + level: "info", + }; + }, + }, { name: "rewrite-docs (override gate)", match: async ({ mid, midTitle, state, basePath, session: _session }) => {