{"version":3,"file":"mission-result.d.ts","sourceRoot":"","sources":["../../../src/core/mission-domain/mission-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMvD,MAAM,MAAM,yBAAyB,GAClC,QAAQ,GACR,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,CAAC;AAEb,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,yBAAyB,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IACnC;;;;;OAKG;IACH,MAAM,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED,wEAAwE;AACxE,MAAM,WAAW,mBAAmB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,cAAc,CAAC,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAA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ured outcome data, not prose. Parent code can\n * distinguish SUCCESS / FAILURE / PARTIAL / BLOCKED / CANCELLED / TIMED_OUT /\n * CRASHED without parsing presentation text. Executor diagnostics (exit code,\n * signal, stderr) live in a dedicated field and never masquerade as domain\n * state: a raw process exit of 0 is NEVER equivalent to mission SUCCEEDED.\n */\n\nimport type { MissionState } from \"./mission-state.js\";\n\n// =============================================================================\n// Component types\n// =============================================================================\n\nexport type StructuredFailureCategory =\n\t| \"LAUNCH\"\n\t| \"EXECUTION\"\n\t| \"VERIFICATION\"\n\t| \"CANCELLED\"\n\t| \"TIMED_OUT\"\n\t| \"CRASHED\"\n\t| \"BLOCKED\";\n\nexport interface StructuredFailure {\n\tcategory: StructuredFailureCategory;\n\tmessage: string;\n\tcode?: string;\n\tdetails?: unknown;\n}\n\nexport interface MissionUsage {\n\tinputTokens?: number;\n\toutputTokens?: number;\n\ttotalTokens?: number;\n\tcostUsd?: number;\n\tturns?: number;\n}\n\nexport interface MissionVerification {\n\t/**\n\t * - `verified`: completion was proven by deterministic verification / the\n\t *   Reliability Kernel Completion Gate.\n\t * - `unverified`: execution finished but mission success was not proven.\n\t * - `failed`: verification ran and did not pass.\n\t */\n\tstatus: \"verified\" | \"unverified\" | \"failed\";\n\tsummary?: string;\n\tcriterionIds?: readonly string[];\n}\n\n/** Executor-specific diagnostics, kept separate from domain outcome. */\nexport interface ExecutorDiagnostics {\n\texecutorId: string;\n\tprocessExitCode?: number | null;\n\tsignal?: string;\n\ttimedOut?: boolean;\n\tlaunchError?: string;\n\tstderr?: string;\n\t/** Remote execution location proof (host/user/cwd/pid/platform). */\n\tremoteLocation?: {\n\t\thost: string;\n\t\tuser: string;\n\t\tcwd: string;\n\t\tpid: number;\n\t\tplatform: string;\n\t};\n\t/** Remote execution evidence items (file hashes, command exits, ...). */\n\tremoteEvidence?: readonly unknown[];\n\t/** Remote target id the work executed on, when remote. */\n\tremoteTargetId?: string;\n}\n\n/**\n * Executor-level completion, independent of the mission-level `MissionState`.\n *\n * This is the single structured answer to \"did the executor/process finish\n * normally?\" It must NOT be conflated with verified mission success:\n *\n *   - `COMPLETED`: the executor finished normally and produced a usable result.\n *     The mission may still be UNVERIFIED (PARTIAL) or have failed verification\n *     (FAILED with a VERIFICATION failure). A raw exit code of 0 maps here.\n *   - `FAILED`/`CANCELLED`/`TIMED_OUT`/`CRASHED`: the execution itself did not\n *     finish normally (non-zero exit, abort, timeout, or failed launch).\n *\n * Consumers use this field (not prose) to decide whether dependent work may\n * continue in a chain.\n */\nexport type MissionExecutionOutcome = \"COMPLETED\" | \"FAILED\" | \"CANCELLED\" | \"TIMED_OUT\" | \"CRASHED\";\n\nexport const MISSION_EXECUTION_OUTCOMES: ReadonlySet<MissionExecutionOutcome> = new Set<MissionExecutionOutcome>([\n\t\"COMPLETED\",\n\t\"FAILED\",\n\t\"CANCELLED\",\n\t\"TIMED_OUT\",\n\t\"CRASHED\",\n]);\n\n/** Runtime type guard for a canonical MissionExecutionOutcome. */\nexport function isMissionExecutionOutcome(value: unknown): value is MissionExecutionOutcome {\n\treturn typeof value === \"string\" && (MISSION_EXECUTION_OUTCOMES as ReadonlySet<string>).has(value);\n}\n\n// =============================================================================\n// MissionResult\n// =============================================================================\n\nexport interface MissionResult {\n\treadonly missionId: string;\n\treadonly parentMissionId?: string;\n\treadonly depth: number;\n\t/** Terminal lifecycle state. */\n\treadonly state: MissionState;\n\t/** Executor-level completion, distinct from mission-level `state`. */\n\treadonly executionOutcome: MissionExecutionOutcome;\n\t/** True only when state === SUCCEEDED (clean, verified mission success). */\n\treadonly success: boolean;\n\t/** Presentation text (optional, never the authority for domain status). */\n\treadonly outputText?: string;\n\t/** Evidence references produced/observed during execution. */\n\treadonly evidenceRefs: readonly string[];\n\treadonly verification: MissionVerification;\n\t/** Completion Gate decision when a gate was consulted; otherwise `unavailable`. */\n\treadonly completionDecision: \"accepted\" | \"rejected\" | \"unavailable\";\n\treadonly failures: readonly StructuredFailure[];\n\treadonly usage?: MissionUsage;\n\treadonly touchedResources?: readonly string[];\n\treadonly executorDiagnostics: ExecutorDiagnostics;\n\treadonly startedAtMs: number;\n\treadonly finishedAtMs: number;\n}\n\nexport interface CreateMissionResultInput {\n\tmissionId: string;\n\tparentMissionId?: string;\n\tdepth: number;\n\tstate: MissionState;\n\texecutionOutcome: MissionExecutionOutcome;\n\toutputText?: string;\n\tevidenceRefs?: readonly string[];\n\tverification?: MissionVerification;\n\tcompletionDecision?: MissionResult[\"completionDecision\"];\n\tfailures?: readonly StructuredFailure[];\n\tusage?: MissionUsage;\n\ttouchedResources?: readonly string[];\n\texecutorDiagnostics: ExecutorDiagnostics;\n\tstartedAtMs: number;\n\tfinishedAtMs: number;\n}\n\nexport function createMissionResult(input: CreateMissionResultInput): MissionResult {\n\treturn Object.freeze({\n\t\tmissionId: input.missionId,\n\t\tparentMissionId: input.parentMissionId,\n\t\tdepth: input.depth,\n\t\tstate: input.state,\n\t\texecutionOutcome: input.executionOutcome,\n\t\tsuccess: input.state === \"SUCCEEDED\",\n\t\toutputText: input.outputText,\n\t\tevidenceRefs: Object.freeze([...(input.evidenceRefs ?? [])]),\n\t\tverification: Object.freeze({\n\t\t\tstatus: input.verification?.status ?? \"unverified\",\n\t\t\tsummary: input.verification?.summary,\n\t\t\tcriterionIds: input.verification?.criterionIds\n\t\t\t\t? Object.freeze([...input.verification.criterionIds])\n\t\t\t\t: undefined,\n\t\t}),\n\t\tcompletionDecision: input.completionDecision ?? \"unavailable\",\n\t\tfailures: Object.freeze([...(input.failures ?? [])]),\n\t\tusage: input.usage ? Object.freeze({ ...input.usage }) : undefined,\n\t\ttouchedResources: input.touchedResources ? Object.freeze([...input.touchedResources]) : undefined,\n\t\texecutorDiagnostics: Object.freeze({ ...input.executorDiagnostics }),\n\t\tstartedAtMs: input.startedAtMs,\n\t\tfinishedAtMs: input.finishedAtMs,\n\t});\n}\n\n// =============================================================================\n// Honest process-outcome classification\n// =============================================================================\n\n/**\n * A plain-data description of an executor outcome. Deliberately has no\n * ChildProcess type so the classification stays portable and testable.\n */\nexport interface ExecutorOutcome {\n\texitCode: number | null;\n\tsignal?: string;\n\ttimedOut?: boolean;\n\tlaunchError?: string;\n\tcancelled?: boolean;\n}\n\nexport interface ExecutorOutcomeClassification {\n\tstate: MissionState;\n\t/** Executor-level completion, always set alongside `state`. */\n\texecutionOutcome: MissionExecutionOutcome;\n\tfailure?: StructuredFailure;\n\t/** Human-readable reason for the classification (diagnostics, not authority). */\n\treason: string;\n}\n\n/**\n * Classify an executor outcome into a terminal mission state.\n *\n * Invariant: a raw exit code of 0 without verification is classified as\n * PARTIAL (\"execution completed but unverified\"), never SUCCEEDED. SUCCEEDED\n * requires `verified: true` and a zero exit code.\n */\nexport function classifyExecutorOutcome(\n\toutcome: ExecutorOutcome,\n\toptions: { verified?: boolean } = {},\n): ExecutorOutcomeClassification {\n\tif (outcome.launchError) {\n\t\treturn {\n\t\t\tstate: \"CRASHED\",\n\t\t\texecutionOutcome: \"CRASHED\",\n\t\t\tfailure: { category: \"LAUNCH\", message: outcome.launchError },\n\t\t\treason: \"executor failed to launch\",\n\t\t};\n\t}\n\tif (outcome.cancelled || outcome.signal === \"SIGTERM\" || outcome.signal === \"SIGINT\") {\n\t\treturn {\n\t\t\tstate: \"CANCELLED\",\n\t\t\texecutionOutcome: \"CANCELLED\",\n\t\t\tfailure: { category: \"CANCELLED\", message: `cancelled (signal ${outcome.signal ?? \"external\"})` },\n\t\t\treason: \"execution was cancelled\",\n\t\t};\n\t}\n\tif (outcome.timedOut) {\n\t\treturn {\n\t\t\tstate: \"TIMED_OUT\",\n\t\t\texecutionOutcome: \"TIMED_OUT\",\n\t\t\tfailure: { category: \"TIMED_OUT\", message: \"execution timed out\" },\n\t\t\treason: \"execution timed out\",\n\t\t};\n\t}\n\tif (outcome.exitCode === 0 && options.verified === true) {\n\t\treturn {\n\t\t\tstate: \"SUCCEEDED\",\n\t\t\texecutionOutcome: \"COMPLETED\",\n\t\t\treason: \"execution completed and verification passed\",\n\t\t};\n\t}\n\tif (outcome.exitCode === 0) {\n\t\treturn {\n\t\t\tstate: \"PARTIAL\",\n\t\t\texecutionOutcome: \"COMPLETED\",\n\t\t\treason: \"execution completed but mission success was not verified\",\n\t\t};\n\t}\n\treturn {\n\t\tstate: \"FAILED\",\n\t\texecutionOutcome: \"FAILED\",\n\t\tfailure: {\n\t\t\tcategory: \"EXECUTION\",\n\t\t\tmessage: `process exited with code ${outcome.exitCode}`,\n\t\t\tcode: String(outcome.exitCode),\n\t\t},\n\t\treason: `process exited with code ${outcome.exitCode}`,\n\t};\n}\n\n// =============================================================================\n// Structured set aggregation (parallel / chain)\n// =============================================================================\n\nexport interface MissionSetResult {\n\treadonly results: readonly MissionResult[];\n\t/** Structured aggregate outcome: SUCCEEDED / PARTIAL / FAILED. */\n\treadonly outcome: \"SUCCEEDED\" | \"PARTIAL\" | \"FAILED\";\n\treadonly succeeded: number;\n\treadonly partial: number;\n\treadonly failed: number;\n\treadonly cancelled: number;\n\treadonly timedOut: number;\n\treadonly crashed: number;\n\treadonly total: number;\n\treadonly allSucceeded: boolean;\n\treadonly someSucceeded: boolean;\n\treadonly allFailed: boolean;\n\t/**\n\t * True when at least one child has a hard failure (FAILED, CANCELLED,\n\t * TIMED_OUT, or CRASHED). Unverified-but-completed children (PARTIAL) do\n\t * NOT set this.\n\t */\n\treadonly anyHardFailure: boolean;\n\t/**\n\t * True when every child's executor finished normally (executionOutcome ===\n\t * \"COMPLETED\"), regardless of mission-level verification. Empty set: false.\n\t */\n\treadonly allCompletedExecution: boolean;\n}\n\n/**\n * Aggregate a set of child MissionResults into a structured outcome.\n *\n *   - SUCCEEDED: every child SUCCEEDED (verified mission success).\n *   - FAILED:    at least one child hard-failed (FAILED / CANCELLED / TIMED_OUT\n *                / CRASHED).\n *   - PARTIAL:   no hard failures, but not every child was verified-successful\n *                (some children remain unverified/partial).\n *\n * An all-unverified set therefore reports PARTIAL (execution completed but\n * success unproven), never FAILED and never SUCCEEDED.\n */\nexport function aggregateMissionResults(results: readonly MissionResult[]): MissionSetResult {\n\tconst summary = {\n\t\tsucceeded: 0,\n\t\tpartial: 0,\n\t\tfailed: 0,\n\t\tcancelled: 0,\n\t\ttimedOut: 0,\n\t\tcrashed: 0,\n\t};\n\n\tfor (const result of results) {\n\t\tswitch (result.state) {\n\t\t\tcase \"SUCCEEDED\":\n\t\t\t\tsummary.succeeded += 1;\n\t\t\t\tbreak;\n\t\t\tcase \"PARTIAL\":\n\t\t\t\tsummary.partial += 1;\n\t\t\t\tbreak;\n\t\t\tcase \"FAILED\":\n\t\t\t\tsummary.failed += 1;\n\t\t\t\tbreak;\n\t\t\tcase \"CANCELLED\":\n\t\t\t\tsummary.cancelled += 1;\n\t\t\t\tbreak;\n\t\t\tcase \"TIMED_OUT\":\n\t\t\t\tsummary.timedOut += 1;\n\t\t\t\tbreak;\n\t\t\tcase \"CRASHED\":\n\t\t\t\tsummary.crashed += 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Non-terminal states are not expected in a completed set; treat as\n\t\t\t\t// a hard failure so a never-finished child cannot look like success.\n\t\t\t\tsummary.failed += 1;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tconst total = results.length;\n\tconst allSucceeded = total > 0 && summary.succeeded === total;\n\tconst allFailed = total > 0 && summary.succeeded === 0 && summary.partial === 0;\n\tconst someSucceeded = summary.succeeded > 0 && !allSucceeded;\n\tconst anyHardFailure = summary.failed + summary.cancelled + summary.timedOut + summary.crashed > 0;\n\tconst allCompletedExecution = total > 0 && results.every((result) => result.executionOutcome === \"COMPLETED\");\n\n\tconst outcome: MissionSetResult[\"outcome\"] = allSucceeded\n\t\t? \"SUCCEEDED\"\n\t\t: anyHardFailure\n\t\t\t? \"FAILED\"\n\t\t\t: summary.partial > 0\n\t\t\t\t? \"PARTIAL\"\n\t\t\t\t: \"FAILED\";\n\n\treturn Object.freeze({\n\t\tresults: Object.freeze([...results]),\n\t\toutcome,\n\t\t...summary,\n\t\ttotal,\n\t\tallSucceeded,\n\t\tsomeSucceeded,\n\t\tallFailed,\n\t\tanyHardFailure,\n\t\tallCompletedExecution,\n\t});\n}\n\n// =============================================================================\n// Chain continuation policy\n// =============================================================================\n\n/**\n * Chain continuation states for the transitional runtime (execution-compatible\n * chain). A child that SUCCEEDED (verified) or PARTIAL (execution completed\n * normally but unverified) may allow the next dependent child to run. Any hard\n * failure — FAILED / CANCELLED / TIMED_OUT / CRASHED — stops the chain.\n *\n * This deliberately does NOT upgrade PARTIAL to SUCCEEDED; it only recognizes\n * that an unverified-but-completed legacy child is not a failure signal.\n */\nexport const MISSION_CHAIN_CONTINUE_STATES: ReadonlySet<MissionState> = new Set<MissionState>([\"SUCCEEDED\", \"PARTIAL\"]);\n\n/** True when a chain should continue to the next child after `result`. */\nexport function shouldContinueMissionChain(result: MissionResult): boolean {\n\treturn MISSION_CHAIN_CONTINUE_STATES.has(result.state);\n}\n"]}