Skip to content

@codesoul-co/hypha-core / modules/execution-cache/runtime

Using this module

Use the Runtime module for executing runtime behavior at this boundary. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  ExecutionResultCache,
} from '@codesoul-co/hypha-core';

import type {
  ExecutionResultCacheOptions,
} from '@codesoul-co/hypha-core';

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
ExecutionResultCacheclassnew ExecutionResultCache(options: ExecutionResultCacheOptions): ExecutionResultCacheConservative Result Cache for deterministic, read-only command executions. It returns an Execution-owned projection and never fabricates a new receipt, mutates a Workspace, or treats a hit as an executed side effect.
ExecutionResultCacheOptionsinterfaceinterface ExecutionResultCacheOptionsExecution Result Cache Options interface with 9 public fields or methods.

ExecutionResultCache

Conservative Result Cache for deterministic, read-only command executions. It returns an Execution-owned projection and never fabricates a new receipt, mutates a Workspace, or treats a hit as an executed side effect.

Declaration

text
export declare class ExecutionResultCache {
    constructor(options: ExecutionResultCacheOptions);
    lookup(rawInput: ExecutionCacheLookupInput): Promise<ExecutionCacheLookupResult>;
    write(rawInput: ExecutionCacheWriteInput): Promise<boolean>;
    invalidate(rawInput: ExecutionCacheLookupInput): Promise<boolean>;
    close(): Promise<void>;
}

Public members

MemberKindSignatureDescription
closemethodclose(): Promise<void>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: ExecutionResultCacheOptions): ExecutionResultCacheCreates an instance of this class.
invalidatemethodinvalidate(rawInput: ExecutionCacheLookupInput): Promise<boolean>Public method; parameters and return type are shown in the signature.
lookupmethodlookup(rawInput: ExecutionCacheLookupInput): Promise<ExecutionCacheLookupResult>Public method; parameters and return type are shown in the signature.
writemethodwrite(rawInput: ExecutionCacheWriteInput): Promise<boolean>Public method; parameters and return type are shown in the signature.

ExecutionResultCacheOptions

Execution Result Cache Options interface with 9 public fields or methods.

Declaration

text
export interface ExecutionResultCacheOptions {
    store: ExecutionCacheStore;
    hasher: ExecutionFingerprintHasher;
    artifactVerifier?: ExecutionCacheArtifactVerifier;
    failureMode?: ExecutionCacheFailureMode;
    operationTimeoutMs?: number;
    ttlMs?: number;
    maxEntryBytes?: number;
    now?: () => number;
    trace?: (event: ExecutionCacheEvent) => Promise<void> | void;
}

Contract members

MemberKindSignatureDescription
artifactVerifierpropertyartifactVerifier?: ExecutionCacheArtifactVerifierPublic property; its type, readonly modifier and optionality are shown in the signature.
failureModepropertyfailureMode?: ExecutionCacheFailureModePublic property; its type, readonly modifier and optionality are shown in the signature.
hasherpropertyhasher: ExecutionFingerprintHasherPublic property; its type, readonly modifier and optionality are shown in the signature.
maxEntryBytespropertymaxEntryBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): numberPublic method; parameters and return type are shown in the signature.
operationTimeoutMspropertyoperationTimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
storepropertystore: ExecutionCacheStorePublic property; its type, readonly modifier and optionality are shown in the signature.
tracemethodtrace?(event: ExecutionCacheEvent): Promise<void> | voidPublic method; parameters and return type are shown in the signature.
ttlMspropertyttlMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.