@codesoul-co/hypha-core / contracts/runtime-replay
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/runtime-replay.ts - Exports: 8
Using this module
Use the Runtime replay module for declaring and runtime-validating contracts. It exports 1 constant, 6 interfaces, 1 type.
Import from the package entrypoint
ts
import {
RUNTIME_REPLAY_DIVERGENCE_KINDS,
} from '@codesoul-co/hypha-core';
import type {
RuntimeReplayDivergence,
RuntimeReplayRequest,
RuntimeReplayResult,
RuntimeReplayServiceContract,
RuntimeReplayVerificationRequest,
RuntimeReplayVerificationResult,
RuntimeReplayDivergenceKind,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 7 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The 1 constant/enum export provides stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
RUNTIME_REPLAY_DIVERGENCE_KINDS | constant | const RUNTIME_REPLAY_DIVERGENCE_KINDS: readonly ["workflow_revision", "process_hash", "dependency_snapshot", "projection_version", "snapshot_checksum"] | RUNTIME REPLAY DIVERGENCE KINDS constant exported by the contracts/runtime-replay module. |
RuntimeReplayDivergence | interface | interface RuntimeReplayDivergence | Runtime Replay Divergence interface with 4 public fields or methods. |
RuntimeReplayRequest | interface | interface RuntimeReplayRequest | Runtime Replay Request interface with 7 public fields or methods. |
RuntimeReplayResult | interface | interface RuntimeReplayResult | Runtime Replay Result interface with 16 public fields or methods. |
RuntimeReplayServiceContract | interface | interface RuntimeReplayServiceContract | Runtime Replay Service Contract interface with 2 public fields or methods. |
RuntimeReplayVerificationRequest | interface | interface RuntimeReplayVerificationRequest | Runtime Replay Verification Request interface with 2 public fields or methods. |
RuntimeReplayVerificationResult | interface | interface RuntimeReplayVerificationResult | Runtime Replay Verification Result interface with 3 public fields or methods. |
RuntimeReplayDivergenceKind | type | type RuntimeReplayDivergenceKind = (typeof RUNTIME_REPLAY_DIVERGENCE_KINDS)[number] | Public type alias for Runtime Replay Divergence Kind; the declaration contains its complete type expression. |
RUNTIME_REPLAY_DIVERGENCE_KINDS
RUNTIME REPLAY DIVERGENCE KINDS constant exported by the contracts/runtime-replay module.
- Kind: constant
- Import:
import { RUNTIME_REPLAY_DIVERGENCE_KINDS } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-replay
Declaration
text
export declare const RUNTIME_REPLAY_DIVERGENCE_KINDS: readonly ["workflow_revision", "process_hash", "dependency_snapshot", "projection_version", "snapshot_checksum"];RuntimeReplayDivergence
Runtime Replay Divergence interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeReplayDivergence } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-replay
Declaration
text
export interface RuntimeReplayDivergence {
kind: RuntimeReplayDivergenceKind;
expected: string;
actual: string;
message: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
actual | property | actual: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expected | property | expected: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: "workflow_revision" | "process_hash" | "dependency_snapshot" | "projection_version" | "snapshot_checksum" | Public property; its type, readonly modifier and optionality are shown in the signature. |
message | property | message: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeReplayRequest
Runtime Replay Request interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeReplayRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-replay
Declaration
text
export interface RuntimeReplayRequest {
scope: RuntimeScope;
checkpointId?: string;
expectedWorkflowRevision: string;
expectedProcessHash: string;
expectedDependencySnapshotRef: string;
toSequence?: number;
requestedAt: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
checkpointId | property | checkpointId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expectedDependencySnapshotRef | property | expectedDependencySnapshotRef: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expectedProcessHash | property | expectedProcessHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expectedWorkflowRevision | property | expectedWorkflowRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
requestedAt | property | requestedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: RuntimeScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
toSequence | property | toSequence?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeReplayResult
Runtime Replay Result interface with 16 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeReplayResult } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-replay
Declaration
text
export interface RuntimeReplayResult {
sourceRunId: string;
mode: 'deterministic';
checkpointId: string;
baseEventSequence: number;
targetEventSequence: number;
replayedEventCount: number;
appliedEventCount: number;
eventIds: string[];
workflowRevision: string;
processHash: string;
dependencySnapshotRef: string;
projectionVersion: string;
finalSnapshot: RuntimeOrchestrationProjection;
finalSnapshotChecksum: string;
divergences: RuntimeReplayDivergence[];
completedAt: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
appliedEventCount | property | appliedEventCount: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
baseEventSequence | property | baseEventSequence: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
checkpointId | property | checkpointId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
completedAt | property | completedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
dependencySnapshotRef | property | dependencySnapshotRef: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
divergences | property | divergences: RuntimeReplayDivergence[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventIds | property | eventIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
finalSnapshot | property | finalSnapshot: RuntimeOrchestrationProjection | Public property; its type, readonly modifier and optionality are shown in the signature. |
finalSnapshotChecksum | property | finalSnapshotChecksum: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
mode | property | mode: "deterministic" | Public property; its type, readonly modifier and optionality are shown in the signature. |
processHash | property | processHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
projectionVersion | property | projectionVersion: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
replayedEventCount | property | replayedEventCount: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceRunId | property | sourceRunId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
targetEventSequence | property | targetEventSequence: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
workflowRevision | property | workflowRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeReplayServiceContract
Runtime Replay Service Contract interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeReplayServiceContract } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-replay
Declaration
text
export interface RuntimeReplayServiceContract {
replay(request: RuntimeReplayRequest): Promise<RuntimeReplayResult>;
verify(request: RuntimeReplayVerificationRequest): Promise<RuntimeReplayVerificationResult>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
replay | method | replay(request: RuntimeReplayRequest): Promise<RuntimeReplayResult> | Public method; parameters and return type are shown in the signature. |
verify | method | verify(request: RuntimeReplayVerificationRequest): Promise<RuntimeReplayVerificationResult> | Public method; parameters and return type are shown in the signature. |
RuntimeReplayVerificationRequest
Runtime Replay Verification Request interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeReplayVerificationRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-replay
Declaration
text
export interface RuntimeReplayVerificationRequest {
replay: RuntimeReplayRequest;
expectedSnapshotChecksum: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
expectedSnapshotChecksum | property | expectedSnapshotChecksum: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
replay | property | replay: RuntimeReplayRequest | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeReplayVerificationResult
Runtime Replay Verification Result interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeReplayVerificationResult } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-replay
Declaration
text
export interface RuntimeReplayVerificationResult {
replay: RuntimeReplayResult;
matches: boolean;
divergences: RuntimeReplayDivergence[];
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
divergences | property | divergences: RuntimeReplayDivergence[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
matches | property | matches: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
replay | property | replay: RuntimeReplayResult | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeReplayDivergenceKind
Public type alias for Runtime Replay Divergence Kind; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { RuntimeReplayDivergenceKind } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-replay
Declaration
text
export type RuntimeReplayDivergenceKind = (typeof RUNTIME_REPLAY_DIVERGENCE_KINDS)[number];