/** * Stop hook handler — the `/sw:auto` loop driver, plus a one-time close * reminder for ordinary sessions (Stop fires on every turn; handoff automation * lives in PreCompact). * * Decision table (any throw short-circuits to `{}` so ordinary sessions are * never trapped): * * no auto-mode.json | active !== true -> reset counter; close reminder below * every auto increment completed/abandoned -> reset; {} * stale session (auto.maxSessionAge, 7200 s) -> reset; {} * turns > auto.maxTurns (default 20) -> reset; {} // safety stop * stop_hook_active + no progress for 3 turns -> reset; {} // loop guard * no increment to work on -> reset; {} * 0 pending tasks AND all ACs satisfied -> reset; block: all_complete_needs_closure * otherwise (work remains) -> counter + 1; block:

task(s) / AC(s) remain * * Close reminder (no auto session): `task done`/`skip` leaves a marker in * `~/.specweave/close-pending/.json` when an increment's last task * turns terminal. That session's next stop blocks once with the close chain * and the entry is removed; other sessions never see it. Entries also go once * the increment is closed, gets new open tasks, or is a day old. * * Output shapes: pass = `{}`; block = top-level `decision:"block"` + `reason`. * * @module core/hooks/handlers/stop */ import type { HandlerFn } from './types.js'; /** Consecutive no-progress turns (while `stop_hook_active`) before the loop is released. */ export declare const MAX_NO_PROGRESS_TURNS = 3; export declare const handle: HandlerFn; //# sourceMappingURL=stop.d.ts.map