/** * KNOWN LIMITATION: completion classification is heuristic and fail-safe-biased. * It nudges only explicit task-incomplete assertions and surfaces everything * else—including finished, ambiguous, and awaiting-parent replies—to the parent. * A rare mis-nudge costs at most MAX_STOP_NUDGES redundant continue-messages to * a done child and then self-corrects. The real contract is structural: * delegation provenance, an atomic once-per-idle claim, and startup recovery * for orphaned claims. */ import type { Session } from "../shared/types.js"; export declare const DELEGATION_COMPLETION_TRACKED_META_KEY = "delegationCompletionTracked"; export declare const DELEGATION_COMPLETION_NUDGE_DISPLAY = "Completion contract: continuing this delegated task to a final report."; export type DelegationCompletionOutcome = "pass" | "nudged" | "surface" | "suppress"; export interface DelegationCompletionDeps { postFollowUp: (sessionId: string, message: string, displayMessage: string) => Promise; } /** * Gate the ordinary parent-completion callback for a narrowly qualified child. * * DESIGN BIAS — conservative and fail-safe: * The auto-nudge is only an additive optimization over the existing parent * callback. Structural provenance is mandatory and text is only a secondary * refinement. Any missing evidence, ambiguity, parse collision, or failed CAS * returns `pass`, preserving the normal surface-to-parent behavior. Missed * nudges are acceptable; false nudges are the harm this contract prevents. * * The persisted guard is deliberately independent of engine attempt ids: each * contract nudge creates a new attempt, and the settlement of that attempt is * counted against the same MAX_STOP_NUDGES budget. Once the budget is spent, or * once the child stops narrating, the settlement surfaces to the parent. */ export declare function enforceDelegationCompletionContract(session: Session, result: { result?: string | null; error?: string | null; }, deps: DelegationCompletionDeps): Promise; /** A genuine operator/user follow-up starts a fresh completion-contract cycle. */ export declare function clearDelegationCompletionContract(session: Session): Session; //# sourceMappingURL=delegation-completion-contract.d.ts.map