import type { TaskResult } from "../core/types.js"; /** * design/45 §11 Q6 — the **durable-suspend hard boundary** (v1). A `status:"suspended"` result is only * safe to handle at the **top-level `runTask`** boundary: the orchestrators (cascade / verify / teacher / * team) run their work as *nested* `runTask`s, and none of them can drive a resume from the inside. If a * nested task suspends on a durable approval gate, the orchestrator must **fail fast** — not silently * treat it as an ordinary failure (which would escalate/re-run side effects) and not release its pinned * session (which would orphan the checkpoint). It maps `suspended → failed` + `errorCode: * "unexpected.suspended"` and **passes the `checkpointToken`/`checkpointGate` straight through** (via the * spread) so the top-level caller can still resume. * * The structural prevention is upstream — an orchestrator should run nested tasks under a **non-durable** * approval policy (e.g. the verifier already forces `handsReadOnly` + headless auto-deny, DESIGN#5) so a * suspension can't arise. This mapping is the defense-in-depth the council made a must-fix: "write it as * a hard boundary, or a deployment wires durable-suspend into verify and produces silent errors." */ export declare const UNEXPECTED_SUSPENDED = "unexpected.suspended"; /** design/80 D-B: the `needs_review` durable-pause family (dry-run `needs_review` AND `plan_review`) hits the * SAME nested hard boundary as `suspended` — a distinct code so a caller can tell a review pause from an approval. */ export declare const UNEXPECTED_NEEDS_REVIEW = "unexpected.needs_review"; /** * design/80 D-B: the durable-pause hard boundary covers BOTH `suspended` (an approval gate) AND `needs_review` * (a dry-run review OR a `plan_review` plan-gate). Both persist a checkpoint + PIN their session * (prepare-task.ts), and a nested orchestrator can't drive their resume — so it must surface the * `checkpointToken` and NOT release the pinned session (releasing it orphans the checkpoint). The `types.ts` * TaskStatus doc mandates orchestrators map an unexpected `needs_review` the same hard-boundary way as `suspended`. */ export declare function isDurablePause(status: TaskResult["status"]): boolean; /** * If `result` durably paused (suspended OR needs_review), return it mapped to a `failed` result carrying the * checkpoint token; otherwise return it unchanged. The orchestrator should also **stop** (not escalate/re-run) * and **not release** the session when this maps a pause — the checkpoint still references that session. */ export declare function mapNestedSuspend(result: TaskResult): TaskResult; //# sourceMappingURL=suspend-guard.d.ts.map