@codesoul-co/hypha-core / modules/execution/recovery
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/modules/execution/recovery.ts - Exports: 5
Using this module
Use the Recovery module for executing runtime behavior at this boundary. It exports 2 functions, 2 interfaces, 1 type.
Import from the package entrypoint
ts
import {
adviseExecutionRecovery,
classifyExecutionFailure,
} from '@codesoul-co/hypha-core';
import type {
ExecutionFailureContext,
ExecutionRecoveryAdvice,
ExecutionRecoveryOperation,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 3 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 2 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
adviseExecutionRecovery | function | adviseExecutionRecovery(failure: RecoveryFailure): ExecutionRecoveryAdvice | Advise Execution Recovery function with 1 public call signature; parameters and return types are listed below. |
classifyExecutionFailure | function | classifyExecutionFailure(error: unknown, context: ExecutionFailureContext): RecoveryFailure | Classify Execution Failure function with 1 public call signature; parameters and return types are listed below. |
ExecutionFailureContext | interface | interface ExecutionFailureContext | Execution Failure Context interface with 14 public fields or methods. |
ExecutionRecoveryAdvice | interface | interface ExecutionRecoveryAdvice | Execution Recovery Advice interface with 4 public fields or methods. |
ExecutionRecoveryOperation | type | type ExecutionRecoveryOperation = 'validate' | 'queue' | 'start' | 'poll' | 'cancel' | 'persist' | 'cleanup' | Public type alias for Execution Recovery Operation; the declaration contains its complete type expression. |
adviseExecutionRecovery
Advise Execution Recovery function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { adviseExecutionRecovery } from '@codesoul-co/hypha-core'; - Source module:
modules/execution/recovery
Declaration
text
export declare function adviseExecutionRecovery(failure: RecoveryFailure): ExecutionRecoveryAdvice;Call signature
text
adviseExecutionRecovery(failure: RecoveryFailure): ExecutionRecoveryAdviceParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
failure | RecoveryFailure | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
ExecutionRecoveryAdvice - Description: The return contract is defined by the type shown above.
classifyExecutionFailure
Classify Execution Failure function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { classifyExecutionFailure } from '@codesoul-co/hypha-core'; - Source module:
modules/execution/recovery
Declaration
text
export declare function classifyExecutionFailure(error: unknown, context: ExecutionFailureContext): RecoveryFailure;Call signature
text
classifyExecutionFailure(error: unknown, context: ExecutionFailureContext): RecoveryFailureParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
error | unknown | Yes | Required parameter; accepted values are defined by the type column. |
context | ExecutionFailureContext | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
RecoveryFailure - Description: The return contract is defined by the type shown above.
ExecutionFailureContext
Execution Failure Context interface with 14 public fields or methods.
- Kind: interface
- Import:
import type { ExecutionFailureContext } from '@codesoul-co/hypha-core'; - Source module:
modules/execution/recovery
Declaration
text
export interface ExecutionFailureContext {
id: string;
operation: ExecutionRecoveryOperation;
occurredAt?: string;
request?: CommandExecutionRequest;
record?: ExecutionRecord;
result?: CommandExecutionResult;
assessment?: ExecutionRecoveryAssessment;
providerId?: string;
providerRevision?: string;
policyRevision?: string;
specRevision?: string;
sideEffectState?: RecoverySideEffectState;
compensationAvailable?: boolean;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
assessment | property | assessment?: ExecutionRecoveryAssessment | Public property; its type, readonly modifier and optionality are shown in the signature. |
compensationAvailable | property | compensationAvailable?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
occurredAt | property | occurredAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
operation | property | operation: ExecutionRecoveryOperation | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyRevision | property | policyRevision?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerId | property | providerId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerRevision | property | providerRevision?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
record | property | record?: ExecutionRecord | Public property; its type, readonly modifier and optionality are shown in the signature. |
request | property | request?: CommandExecutionRequest | Public property; its type, readonly modifier and optionality are shown in the signature. |
result | property | result?: CommandExecutionResult | Public property; its type, readonly modifier and optionality are shown in the signature. |
sideEffectState | property | sideEffectState?: RecoverySideEffectState | Public property; its type, readonly modifier and optionality are shown in the signature. |
specRevision | property | specRevision?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ExecutionRecoveryAdvice
Execution Recovery Advice interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { ExecutionRecoveryAdvice } from '@codesoul-co/hypha-core'; - Source module:
modules/execution/recovery
Declaration
text
export interface ExecutionRecoveryAdvice {
strategy: RecoveryStrategy;
reason: string;
refreshRecordBeforeRetry: boolean;
requireReceiptReconciliation: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
reason | property | reason: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
refreshRecordBeforeRetry | property | refreshRecordBeforeRetry: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
requireReceiptReconciliation | property | requireReceiptReconciliation: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
strategy | property | strategy: "fail" | "retry" | "human_review" | "reconcile" | "fallback" | "degrade" | "compensate" | "wait" | "quarantine" | "cancel" | Public property; its type, readonly modifier and optionality are shown in the signature. |
ExecutionRecoveryOperation
Public type alias for Execution Recovery Operation; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ExecutionRecoveryOperation } from '@codesoul-co/hypha-core'; - Source module:
modules/execution/recovery
Declaration
text
export type ExecutionRecoveryOperation = 'validate' | 'queue' | 'start' | 'poll' | 'cancel' | 'persist' | 'cleanup';