Skip to content

@codesoul-co/hypha-core / contracts/recovery

Using this module

Use the Recovery module for declaring and runtime-validating contracts. It exports 4 constants, 5 functions, 9 interfaces, 5 types.

Import from the package entrypoint

ts
import {
  defaultRecoveryConvergencePolicy,
  RECOVERY_CATEGORIES,
  RECOVERY_MODULES,
  RECOVERY_STRATEGIES,
  recoveryEvidenceHash,
  recoveryFailureFingerprint,
  recoveryKnowledgeKeyMatches,
  recoveryKnowledgeScopeMatches,
} from '@codesoul-co/hypha-core';

import type {
  RecoveryAttemptRecord,
  RecoveryCaseSnapshot,
  RecoveryConvergencePolicy,
  RecoveryEvidence,
  RecoveryFailure,
  RecoveryKnowledge,
  RecoveryKnowledgeKey,
  RecoveryKnowledgePort,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • Use the 14 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 5 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • The 4 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Public exports

SymbolKindSignatureDescription
defaultRecoveryConvergencePolicyconstantconst defaultRecoveryConvergencePolicy: RecoveryConvergencePolicyDefault Recovery Convergence Policy constant exported by the contracts/recovery module.
RECOVERY_CATEGORIESconstantconst RECOVERY_CATEGORIES: readonly ["validation", "policy_denied", "authentication", "authorization", "rate_limit", "timeout", "transient_dependency", "permanent_dependency", "concurrency_conflict", "resource_exhausted", "tool_failure", "inference_failure", "memory_failure", "execution_failure", "storage_failure", "message_failure", "cache_failure", "invariant_violation", "cancellation", "unknown"]RECOVERY CATEGORIES constant exported by the contracts/recovery module.
RECOVERY_MODULESconstantconst RECOVERY_MODULES: readonly ["fsm", "inference", "tool", "memory", "execution", "mcp", "workspace", "storage", "message_bus", "cache", "policy", "domain", "unknown"]RECOVERY MODULES constant exported by the contracts/recovery module.
RECOVERY_STRATEGIESconstantconst RECOVERY_STRATEGIES: readonly ["retry", "reconcile", "fallback", "degrade", "compensate", "wait", "human_review", "quarantine", "fail", "cancel"]RECOVERY STRATEGIES constant exported by the contracts/recovery module.
recoveryEvidenceHashfunctionrecoveryEvidenceHash(evidence: RecoveryEvidence): stringRecovery Evidence Hash function with 1 public call signature; parameters and return types are listed below.
recoveryFailureFingerprintfunctionrecoveryFailureFingerprint(failure: RecoveryFailure): stringRecovery Failure Fingerprint function with 1 public call signature; parameters and return types are listed below.
recoveryKnowledgeKeyMatchesfunctionrecoveryKnowledgeKeyMatches(expected: RecoveryKnowledgeKey, actual: RecoveryKnowledgeKey): booleanRecovery Knowledge Key Matches function with 1 public call signature; parameters and return types are listed below.
recoveryKnowledgeScopeMatchesfunctionrecoveryKnowledgeScopeMatches(expected: RecoveryKnowledgeScope | undefined, actual: RecoveryKnowledgeScope | undefined): booleanRecovery Knowledge Scope Matches function with 1 public call signature; parameters and return types are listed below.
stableRecoveryHashfunctionstableRecoveryHash(value: unknown): stringStable Recovery Hash function with 1 public call signature; parameters and return types are listed below.
RecoveryAttemptRecordinterfaceinterface RecoveryAttemptRecordRecovery Attempt Record interface with 12 public fields or methods.
RecoveryCaseSnapshotinterfaceinterface RecoveryCaseSnapshotRecovery Case Snapshot interface with 15 public fields or methods.
RecoveryConvergencePolicyinterfaceinterface RecoveryConvergencePolicyRecovery Convergence Policy interface with 6 public fields or methods.
RecoveryEvidenceinterfaceinterface RecoveryEvidenceFacts that can prove whether a recovery attempt changed the underlying state. Callers should prefer stable revisions, receipts, checksums, and provider state over human-readable messages.
RecoveryFailureinterfaceinterface RecoveryFailureRecovery Failure interface with 14 public fields or methods.
RecoveryKnowledgeinterfaceinterface RecoveryKnowledgeRecovery Knowledge interface with 7 public fields or methods.
RecoveryKnowledgeKeyinterfaceinterface RecoveryKnowledgeKeyRecovery Knowledge Key interface with 6 public fields or methods.
RecoveryKnowledgePortinterfaceinterface RecoveryKnowledgePortCache implementations are hints only. The supervisor must revalidate a hit.
RecoveryKnowledgeScopeinterfaceinterface RecoveryKnowledgeScopeRecovery Knowledge Scope interface with 6 public fields or methods.
RecoveryCaseStatustypetype RecoveryCaseStatus = 'active' | 'suspended' | 'recovered' | 'degraded' | 'compensated' | 'quarantined' | 'failed' | 'cancelled'Public type alias for Recovery Case Status; the declaration contains its complete type expression.
RecoveryCategorytypetype RecoveryCategory = (typeof RECOVERY_CATEGORIES)[number]Public type alias for Recovery Category; the declaration contains its complete type expression.
RecoveryModuletypetype RecoveryModule = (typeof RECOVERY_MODULES)[number]Public type alias for Recovery Module; the declaration contains its complete type expression.
RecoverySideEffectStatetypetype RecoverySideEffectState = 'none' | 'not_started' | 'committed' | 'unknown'Public type alias for Recovery Side Effect State; the declaration contains its complete type expression.
RecoveryStrategytypetype RecoveryStrategy = (typeof RECOVERY_STRATEGIES)[number]Public type alias for Recovery Strategy; the declaration contains its complete type expression.

defaultRecoveryConvergencePolicy

Default Recovery Convergence Policy constant exported by the contracts/recovery module.

  • Kind: constant
  • Import: import { defaultRecoveryConvergencePolicy } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export declare const defaultRecoveryConvergencePolicy: RecoveryConvergencePolicy;

RECOVERY_CATEGORIES

RECOVERY CATEGORIES constant exported by the contracts/recovery module.

  • Kind: constant
  • Import: import { RECOVERY_CATEGORIES } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export declare const RECOVERY_CATEGORIES: readonly ["validation", "policy_denied", "authentication", "authorization", "rate_limit", "timeout", "transient_dependency", "permanent_dependency", "concurrency_conflict", "resource_exhausted", "tool_failure", "inference_failure", "memory_failure", "execution_failure", "storage_failure", "message_failure", "cache_failure", "invariant_violation", "cancellation", "unknown"];

RECOVERY_MODULES

RECOVERY MODULES constant exported by the contracts/recovery module.

  • Kind: constant
  • Import: import { RECOVERY_MODULES } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export declare const RECOVERY_MODULES: readonly ["fsm", "inference", "tool", "memory", "execution", "mcp", "workspace", "storage", "message_bus", "cache", "policy", "domain", "unknown"];

RECOVERY_STRATEGIES

RECOVERY STRATEGIES constant exported by the contracts/recovery module.

  • Kind: constant
  • Import: import { RECOVERY_STRATEGIES } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export declare const RECOVERY_STRATEGIES: readonly ["retry", "reconcile", "fallback", "degrade", "compensate", "wait", "human_review", "quarantine", "fail", "cancel"];

recoveryEvidenceHash

Recovery Evidence Hash function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { recoveryEvidenceHash } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export declare function recoveryEvidenceHash(evidence: RecoveryEvidence): string;

Call signature

text
recoveryEvidenceHash(evidence: RecoveryEvidence): string

Parameters

ParameterTypeRequiredDescription
evidenceRecoveryEvidenceYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: string
  • Description: The return contract is defined by the type shown above.

recoveryFailureFingerprint

Recovery Failure Fingerprint function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { recoveryFailureFingerprint } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export declare function recoveryFailureFingerprint(failure: RecoveryFailure): string;

Call signature

text
recoveryFailureFingerprint(failure: RecoveryFailure): string

Parameters

ParameterTypeRequiredDescription
failureRecoveryFailureYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: string
  • Description: The return contract is defined by the type shown above.

recoveryKnowledgeKeyMatches

Recovery Knowledge Key Matches function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { recoveryKnowledgeKeyMatches } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export declare function recoveryKnowledgeKeyMatches(expected: RecoveryKnowledgeKey, actual: RecoveryKnowledgeKey): boolean;

Call signature

text
recoveryKnowledgeKeyMatches(expected: RecoveryKnowledgeKey, actual: RecoveryKnowledgeKey): boolean

Parameters

ParameterTypeRequiredDescription
expectedRecoveryKnowledgeKeyYesRequired parameter; accepted values are defined by the type column.
actualRecoveryKnowledgeKeyYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: boolean
  • Description: The return contract is defined by the type shown above.

recoveryKnowledgeScopeMatches

Recovery Knowledge Scope Matches function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { recoveryKnowledgeScopeMatches } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export declare function recoveryKnowledgeScopeMatches(expected: RecoveryKnowledgeScope | undefined, actual: RecoveryKnowledgeScope | undefined): boolean;

Call signature

text
recoveryKnowledgeScopeMatches(expected: RecoveryKnowledgeScope | undefined, actual: RecoveryKnowledgeScope | undefined): boolean

Parameters

ParameterTypeRequiredDescription
expectedRecoveryKnowledgeScopeYesRequired parameter; accepted values are defined by the type column.
actualRecoveryKnowledgeScopeYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: boolean
  • Description: The return contract is defined by the type shown above.

stableRecoveryHash

Stable Recovery Hash function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { stableRecoveryHash } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export declare function stableRecoveryHash(value: unknown): string;

Call signature

text
stableRecoveryHash(value: unknown): string

Parameters

ParameterTypeRequiredDescription
valueunknownYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: string
  • Description: The return contract is defined by the type shown above.

RecoveryAttemptRecord

Recovery Attempt Record interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { RecoveryAttemptRecord } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export interface RecoveryAttemptRecord {
    cycle: number;
    participantId: string;
    module: RecoveryModule;
    strategy: RecoveryStrategy;
    fingerprint: string;
    startedAt: string;
    completedAt?: string;
    status: 'started' | 'succeeded' | 'failed' | 'no_progress' | 'skipped';
    evidenceBeforeHash: string;
    evidenceAfterHash?: string;
    errorCode?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
completedAtpropertycompletedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
cyclepropertycycle: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
errorCodepropertyerrorCode?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
evidenceAfterHashpropertyevidenceAfterHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
evidenceBeforeHashpropertyevidenceBeforeHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
fingerprintpropertyfingerprint: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
modulepropertymodule: "memory" | "domain" | "mcp" | "policy" | "workspace" | "tool" | "unknown" | "execution" | "fsm" | "inference" | "storage" | "message_bus" | "cache"Public property; its type, readonly modifier and optionality are shown in the signature.
participantIdpropertyparticipantId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
startedAtpropertystartedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "failed" | "started" | "succeeded" | "no_progress" | "skipped"Public property; its type, readonly modifier and optionality are shown in the signature.
strategypropertystrategy: "fail" | "retry" | "human_review" | "reconcile" | "fallback" | "degrade" | "compensate" | "wait" | "quarantine" | "cancel"Public property; its type, readonly modifier and optionality are shown in the signature.

RecoveryCaseSnapshot

Recovery Case Snapshot interface with 15 public fields or methods.

  • Kind: interface
  • Import: import type { RecoveryCaseSnapshot } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export interface RecoveryCaseSnapshot {
    id: string;
    runId: string;
    fsmState: string;
    rootFingerprint: string;
    status: RecoveryCaseStatus;
    openedAt: string;
    updatedAt: string;
    cycles: number;
    noProgressCycles: number;
    lastEvidenceHash: string;
    lastFailure?: RecoveryFailure;
    attempts: RecoveryAttemptRecord[];
    outputs: Record<string, unknown>;
    degradedParticipants: string[];
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
attemptspropertyattempts: RecoveryAttemptRecord[]Public property; its type, readonly modifier and optionality are shown in the signature.
cyclespropertycycles: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
degradedParticipantspropertydegradedParticipants: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
fsmStatepropertyfsmState: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastEvidenceHashpropertylastEvidenceHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastFailurepropertylastFailure?: RecoveryFailurePublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
noProgressCyclespropertynoProgressCycles: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
openedAtpropertyopenedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outputspropertyoutputs: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
rootFingerprintpropertyrootFingerprint: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: RecoveryCaseStatusPublic property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RecoveryConvergencePolicy

Recovery Convergence Policy interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { RecoveryConvergencePolicy } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export interface RecoveryConvergencePolicy {
    maxCycles: number;
    maxNoProgressCycles: number;
    maxSameStrategyAttempts: number;
    maxElapsedMs: number;
    onNoProgress: Extract<RecoveryStrategy, 'fallback' | 'degrade' | 'human_review' | 'quarantine' | 'fail'>;
    onExhausted: Extract<RecoveryStrategy, 'human_review' | 'quarantine' | 'fail'>;
}

Contract members

MemberKindSignatureDescription
maxCyclespropertymaxCycles: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxElapsedMspropertymaxElapsedMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxNoProgressCyclespropertymaxNoProgressCycles: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxSameStrategyAttemptspropertymaxSameStrategyAttempts: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
onExhaustedpropertyonExhausted: "fail" | "human_review" | "quarantine"Public property; its type, readonly modifier and optionality are shown in the signature.
onNoProgresspropertyonNoProgress: "fail" | "human_review" | "fallback" | "degrade" | "quarantine"Public property; its type, readonly modifier and optionality are shown in the signature.

RecoveryEvidence

Facts that can prove whether a recovery attempt changed the underlying state. Callers should prefer stable revisions, receipts, checksums, and provider state over human-readable messages.

  • Kind: interface
  • Import: import type { RecoveryEvidence } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export interface RecoveryEvidence {
    observedAt: string;
    operationKey: string;
    dependencyKey?: string;
    state?: string;
    revision?: string | number;
    receiptStatus?: 'accepted' | 'completed' | 'rejected' | 'unknown';
    idempotencyKey?: string;
    inputHash?: string;
    outputHash?: string;
    policyRevision?: string;
    specRevision?: string;
    providerRevision?: string;
    sourceHashes?: Record<string, string>;
    markers?: Record<string, string | number | boolean | null>;
}

Contract members

MemberKindSignatureDescription
dependencyKeypropertydependencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputHashpropertyinputHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
markerspropertymarkers?: Record<string, string | number | boolean>Public property; its type, readonly modifier and optionality are shown in the signature.
observedAtpropertyobservedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
operationKeypropertyoperationKey: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outputHashpropertyoutputHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRevisionpropertypolicyRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerRevisionpropertyproviderRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
receiptStatuspropertyreceiptStatus?: "unknown" | "accepted" | "completed" | "rejected"Public property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision?: string | numberPublic property; its type, readonly modifier and optionality are shown in the signature.
sourceHashespropertysourceHashes?: Record<string, string>Public property; its type, readonly modifier and optionality are shown in the signature.
specRevisionpropertyspecRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statepropertystate?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RecoveryFailure

Recovery Failure interface with 14 public fields or methods.

  • Kind: interface
  • Import: import type { RecoveryFailure } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export interface RecoveryFailure {
    id: string;
    module: RecoveryModule;
    category: RecoveryCategory;
    code: string;
    message: string;
    occurredAt: string;
    retryable: boolean;
    sideEffectState: RecoverySideEffectState;
    compensationAvailable?: boolean;
    retryAfterMs?: number;
    circuitKey?: string;
    rootCauseKey?: string;
    evidence: RecoveryEvidence;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
categorypropertycategory: "unknown" | "cancellation" | "timeout" | "validation" | "policy_denied" | "authentication" | "authorization" | "rate_limit" | "transient_dependency" | "permanent_dependency" | "concurrency_conflict" | "resource_exhausted" | "tool_failure" | "inference_failure" | "memory_failure" | "execution_failure" | "storage_failure" | "message_failure" | "cache_failure" | "invariant_violation"Public property; its type, readonly modifier and optionality are shown in the signature.
circuitKeypropertycircuitKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
codepropertycode: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
compensationAvailablepropertycompensationAvailable?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
evidencepropertyevidence: RecoveryEvidencePublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
messagepropertymessage: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
modulepropertymodule: "memory" | "domain" | "mcp" | "policy" | "workspace" | "tool" | "unknown" | "execution" | "fsm" | "inference" | "storage" | "message_bus" | "cache"Public property; its type, readonly modifier and optionality are shown in the signature.
occurredAtpropertyoccurredAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
retryablepropertyretryable: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
retryAfterMspropertyretryAfterMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
rootCauseKeypropertyrootCauseKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sideEffectStatepropertysideEffectState: RecoverySideEffectStatePublic property; its type, readonly modifier and optionality are shown in the signature.

RecoveryKnowledge

Recovery Knowledge interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { RecoveryKnowledge } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export interface RecoveryKnowledge {
    key: RecoveryKnowledgeKey;
    strategy: RecoveryStrategy;
    outcome: Extract<RecoveryCaseStatus, 'recovered' | 'degraded' | 'compensated' | 'failed'>;
    evidenceHash: string;
    learnedAt: string;
    expiresAt?: string;
    validation: {
        status: 'verified' | 'negative';
        sourceEventId?: string;
        proof?: Record<string, unknown>;
    };
}

Contract members

MemberKindSignatureDescription
evidenceHashpropertyevidenceHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expiresAtpropertyexpiresAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
keypropertykey: RecoveryKnowledgeKeyPublic property; its type, readonly modifier and optionality are shown in the signature.
learnedAtpropertylearnedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outcomepropertyoutcome: "degraded" | "failed" | "recovered" | "compensated"Public property; its type, readonly modifier and optionality are shown in the signature.
strategypropertystrategy: "fail" | "retry" | "human_review" | "reconcile" | "fallback" | "degrade" | "compensate" | "wait" | "quarantine" | "cancel"Public property; its type, readonly modifier and optionality are shown in the signature.
validationpropertyvalidation: { status: "verified" | "negative"; sourceEventId?: string; proof?: Record<string, unknown>; }Public property; its type, readonly modifier and optionality are shown in the signature.

RecoveryKnowledgeKey

Recovery Knowledge Key interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { RecoveryKnowledgeKey } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export interface RecoveryKnowledgeKey {
    fingerprint: string;
    participantId: string;
    /**
     * New runtime writes always include scope. Absence is accepted only for
     * legacy Provider migration and must not be persisted by strict adapters.
     */
    scope?: RecoveryKnowledgeScope;
    policyRevision?: string;
    specRevision?: string;
    providerRevision?: string;
}

Contract members

MemberKindSignatureDescription
fingerprintpropertyfingerprint: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
participantIdpropertyparticipantId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRevisionpropertypolicyRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerRevisionpropertyproviderRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope?: RecoveryKnowledgeScopeNew runtime writes always include scope. Absence is accepted only for legacy Provider migration and must not be persisted by strict adapters.
specRevisionpropertyspecRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RecoveryKnowledgePort

Cache implementations are hints only. The supervisor must revalidate a hit.

  • Kind: interface
  • Import: import type { RecoveryKnowledgePort } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export interface RecoveryKnowledgePort {
    get(key: RecoveryKnowledgeKey): Promise<RecoveryKnowledge | null>;
    put(knowledge: RecoveryKnowledge): Promise<void>;
    invalidate(key: RecoveryKnowledgeKey, reason: string): Promise<void>;
}

Contract members

MemberKindSignatureDescription
getmethodget(key: RecoveryKnowledgeKey): Promise<RecoveryKnowledge | null>Public method; parameters and return type are shown in the signature.
invalidatemethodinvalidate(key: RecoveryKnowledgeKey, reason: string): Promise<void>Public method; parameters and return type are shown in the signature.
putmethodput(knowledge: RecoveryKnowledge): Promise<void>Public method; parameters and return type are shown in the signature.

RecoveryKnowledgeScope

Recovery Knowledge Scope interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { RecoveryKnowledgeScope } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export interface RecoveryKnowledgeScope {
    tenantId?: string;
    userId: string;
    workspaceId?: string;
    sessionId?: string;
    agentId?: string;
    domainPackId?: string;
}

Contract members

MemberKindSignatureDescription
agentIdpropertyagentId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
domainPackIdpropertydomainPackId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RecoveryCaseStatus

Public type alias for Recovery Case Status; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RecoveryCaseStatus } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export type RecoveryCaseStatus = 'active' | 'suspended' | 'recovered' | 'degraded' | 'compensated' | 'quarantined' | 'failed' | 'cancelled';

RecoveryCategory

Public type alias for Recovery Category; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RecoveryCategory } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export type RecoveryCategory = (typeof RECOVERY_CATEGORIES)[number];

RecoveryModule

Public type alias for Recovery Module; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RecoveryModule } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export type RecoveryModule = (typeof RECOVERY_MODULES)[number];

RecoverySideEffectState

Public type alias for Recovery Side Effect State; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RecoverySideEffectState } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export type RecoverySideEffectState = 'none' | 'not_started' | 'committed' | 'unknown';

RecoveryStrategy

Public type alias for Recovery Strategy; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { RecoveryStrategy } from '@codesoul-co/hypha-core';
  • Source module: contracts/recovery

Declaration

text
export type RecoveryStrategy = (typeof RECOVERY_STRATEGIES)[number];