export type SessionOutcome = 'succeeded' | 'failed' | 'unknown'; /** * Pure: read `info.outcome` out of an `opencode session export` document. * Missing/malformed output is 'unknown' (fall back to the exit code); any * non-'succeeded' string outcome (failed/interrupted/aborted/...) is 'failed'. */ export declare function parseSessionOutcome(exportJson: string): SessionOutcome; /** * Default probe: `opencode session export ` against the local service. * Best-effort by design - never throws, never blocks longer than the timeout. */ export declare function probeOpencodeOutcome(sessionId: string): SessionOutcome; /** * Pure decision: is a non-zero harness exit actually a COMPLETED run? * * 2026-10 POLICY CHANGE: it is NOT. A non-zero client exit always fails the * run, even when the session record says `succeeded`. The probe is kept to * EXPLAIN the failure (and to keep the session record for diagnosis), never * to turn the failure into success. * * WHY: the recovery used to hide two real failures. A backgrounded * `npm run test:run` (service-owned, outliving the CLI) finished with 230 * unhandled errors, and a client exit 1 was reported as "recovered" because * the session outcome was `succeeded` - so a run whose verification had * failed was marked complete and moved to review. The git pipeline still * commits work on failure, so nothing is lost; the task is reopened for a * real retry instead of being presented as verified. * * The idle kill (124) is OURS and stays a failure. Other harnesses keep the * classic exit-code contract. */ export declare function decideHarnessExit(input: { harness: string; code: number; outcome: SessionOutcome; }): { recovered: boolean; detail: string; };