Skip to content

@codesoul-co/hypha-memory / memory-server-permanent-migration-fixtures

Using this module

Use the Memory server permanent migration fixtures module for writing deterministic tests and contract assertions. It exports 1 constant, 2 functions, 2 interfaces, 1 type.

Import from the package entrypoint

ts
import {
  permanentMemoryFailureFixtures,
  createPermanentMemoryMigrationAdapterHarness,
  createReferencePermanentMemoryMigrationHarness,
} from '@codesoul-co/hypha-memory';

import type {
  PermanentMemoryFailureFixture,
  PermanentMemoryMigrationAcceptanceHarness,
  PermanentMemoryMigrationHarnessFactory,
} from '@codesoul-co/hypha-memory';

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.
  • 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

SymbolKindSignatureDescription
permanentMemoryFailureFixturesconstantconst permanentMemoryFailureFixtures: readonly PermanentMemoryFailureFixture[]Permanent Memory Failure Fixtures constant exported by the memory-server-permanent-migration-fixtures module.
createPermanentMemoryMigrationAdapterHarnessfunctioncreatePermanentMemoryMigrationAdapterHarness(fixture: PermanentMemoryFailureFixture): PermanentMemoryMigrationAcceptanceHarnessCreate Permanent Memory Migration Adapter Harness function with 1 public call signature; parameters and return types are listed below.
createReferencePermanentMemoryMigrationHarnessfunctioncreateReferencePermanentMemoryMigrationHarness(fixture: PermanentMemoryFailureFixture): PermanentMemoryMigrationAcceptanceHarnessCreate Reference Permanent Memory Migration Harness function with 1 public call signature; parameters and return types are listed below.
PermanentMemoryFailureFixtureinterfaceinterface PermanentMemoryFailureFixturePermanent Memory Failure Fixture interface with 10 public fields or methods.
PermanentMemoryMigrationAcceptanceHarnessinterfaceinterface PermanentMemoryMigrationAcceptanceHarnessPermanent Memory Migration Acceptance Harness interface with 2 public fields or methods.
PermanentMemoryMigrationHarnessFactorytypetype PermanentMemoryMigrationHarnessFactory = (fixture: PermanentMemoryFailureFixture) => PermanentMemoryMigrationAcceptanceHarnessPublic type alias for Permanent Memory Migration Harness Factory; the declaration contains its complete type expression.

permanentMemoryFailureFixtures

Permanent Memory Failure Fixtures constant exported by the memory-server-permanent-migration-fixtures module.

Declaration

text
export declare const permanentMemoryFailureFixtures: readonly PermanentMemoryFailureFixture[];

createPermanentMemoryMigrationAdapterHarness

Create Permanent Memory Migration Adapter Harness function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function createPermanentMemoryMigrationAdapterHarness(fixture: PermanentMemoryFailureFixture): PermanentMemoryMigrationAcceptanceHarness;

Call signature

text
createPermanentMemoryMigrationAdapterHarness(fixture: PermanentMemoryFailureFixture): PermanentMemoryMigrationAcceptanceHarness

Parameters

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

Returns

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

createReferencePermanentMemoryMigrationHarness

Create Reference Permanent Memory Migration Harness function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function createReferencePermanentMemoryMigrationHarness(fixture: PermanentMemoryFailureFixture): PermanentMemoryMigrationAcceptanceHarness;

Call signature

text
createReferencePermanentMemoryMigrationHarness(fixture: PermanentMemoryFailureFixture): PermanentMemoryMigrationAcceptanceHarness

Parameters

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

Returns

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

PermanentMemoryFailureFixture

Permanent Memory Failure Fixture interface with 10 public fields or methods.

Declaration

text
export interface PermanentMemoryFailureFixture {
    id: string;
    operation: PermanentMemoryMigrationOperation;
    providerError: Record<string, unknown>;
    expectedCode?: NormalizedMemoryError['code'];
    expectedRetryable?: boolean;
    expectedDisposition?: PermanentMemoryFailureDisposition;
    expectedFinalState?: PermanentMemoryFailureFinalState;
    expectedEmpty?: 'null' | 'array' | 'false';
    attempt?: number;
    maxAttempts?: number;
}

Contract members

MemberKindSignatureDescription
attemptpropertyattempt?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedCodepropertyexpectedCode?: "MEMORY_INVALID_INPUT" | "MEMORY_EXTRACTION_SOURCE_UNAVAILABLE" | "MEMORY_EXTRACTION_FAILED" | "MEMORY_EXTRACTION_CURSOR_CONFLICT" | "MEMORY_MAINTENANCE_CONFLICT" | "MEMORY_RANKING_FAILED" | "MEMORY_IDEMPOTENCY_CONFLICT" | "MEMORY_SCOPE_DENIED" | "MEMORY_PERMISSION_DENIED" | "MEMORY_NOT_FOUND" | "MEMORY_REVISION_CONFLICT" | "MEMORY_PROVIDER_NOT_INSTALLED" | "MEMORY_PROVIDER_UNAVAILABLE" | "MEMORY_PR...Public property; its type, readonly modifier and optionality are shown in the signature.
expectedDispositionpropertyexpectedDisposition?: PermanentMemoryFailureDispositionPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedEmptypropertyexpectedEmpty?: "array" | "null" | "false"Public property; its type, readonly modifier and optionality are shown in the signature.
expectedFinalStatepropertyexpectedFinalState?: PermanentMemoryFailureFinalStatePublic property; its type, readonly modifier and optionality are shown in the signature.
expectedRetryablepropertyexpectedRetryable?: booleanPublic 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.
maxAttemptspropertymaxAttempts?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
operationpropertyoperation: PermanentMemoryMigrationOperationPublic property; its type, readonly modifier and optionality are shown in the signature.
providerErrorpropertyproviderError: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.

PermanentMemoryMigrationAcceptanceHarness

Permanent Memory Migration Acceptance Harness interface with 2 public fields or methods.

Declaration

text
export interface PermanentMemoryMigrationAcceptanceHarness {
    port: PermanentMemoryMigrationPort;
    events: PermanentMemoryFailureEvent[];
}

Contract members

MemberKindSignatureDescription
eventspropertyevents: PermanentMemoryFailureEvent[]Public property; its type, readonly modifier and optionality are shown in the signature.
portpropertyport: PermanentMemoryMigrationPortPublic property; its type, readonly modifier and optionality are shown in the signature.

PermanentMemoryMigrationHarnessFactory

Public type alias for Permanent Memory Migration Harness Factory; the declaration contains its complete type expression.

Declaration

text
export type PermanentMemoryMigrationHarnessFactory = (fixture: PermanentMemoryFailureFixture) => PermanentMemoryMigrationAcceptanceHarness;