Skip to content

@codesoul-co/hypha-core / contracts/runtime-integrity-audit

Using this module

Use the Runtime integrity audit module for declaring and runtime-validating contracts. It exports 9 interfaces.

Import from the package entrypoint

ts
import type {
  CanonicalEventScanPort,
  RuntimeIntegrityRepairCommand,
  RuntimeIntegrityRepairEvidence,
  RuntimeIntegrityRepairPort,
  RuntimeIntegrityRepairResult,
  RuntimeIntegrityStore,
  RuntimeIntegrityWatermark,
  ScanCanonicalEventsRequest,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • Use the 9 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.

Public exports

SymbolKindSignatureDescription
CanonicalEventScanPortinterfaceinterface CanonicalEventScanPortCanonical Event Scan Port interface with 1 public fields or methods.
RuntimeIntegrityRepairCommandinterfaceinterface RuntimeIntegrityRepairCommandRuntime Integrity Repair Command interface with 6 public fields or methods.
RuntimeIntegrityRepairEvidenceinterfaceinterface RuntimeIntegrityRepairEvidenceRuntime Integrity Repair Evidence interface with 8 public fields or methods.
RuntimeIntegrityRepairPortinterfaceinterface RuntimeIntegrityRepairPortRuntime Integrity Repair Port interface with 1 public fields or methods.
RuntimeIntegrityRepairResultinterfaceinterface RuntimeIntegrityRepairResultRuntime Integrity Repair Result interface with 3 public fields or methods.
RuntimeIntegrityStoreinterfaceinterface RuntimeIntegrityStoreRuntime Integrity Store interface with 4 public fields or methods.
RuntimeIntegrityWatermarkinterfaceinterface RuntimeIntegrityWatermarkRuntime Integrity Watermark interface with 7 public fields or methods.
ScanCanonicalEventsRequestinterfaceinterface ScanCanonicalEventsRequestScan Canonical Events Request interface with 3 public fields or methods.
ScanCanonicalEventsResultinterfaceinterface ScanCanonicalEventsResultScan Canonical Events Result interface with 4 public fields or methods.

CanonicalEventScanPort

Canonical Event Scan Port interface with 1 public fields or methods.

Declaration

text
export interface CanonicalEventScanPort {
    scanCanonicalEvents(request: ScanCanonicalEventsRequest): Promise<ScanCanonicalEventsResult>;
}

Contract members

MemberKindSignatureDescription
scanCanonicalEventsmethodscanCanonicalEvents(request: ScanCanonicalEventsRequest): Promise<ScanCanonicalEventsResult>Public method; parameters and return type are shown in the signature.

RuntimeIntegrityRepairCommand

Runtime Integrity Repair Command interface with 6 public fields or methods.

Declaration

text
export interface RuntimeIntegrityRepairCommand {
    version: '1.0.0';
    repairId: string;
    findingHash: string;
    requestedRevision: string;
    requestedBy: string;
    requestedAt: string;
}

Contract members

MemberKindSignatureDescription
findingHashpropertyfindingHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
repairIdpropertyrepairId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requestedAtpropertyrequestedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requestedBypropertyrequestedBy: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requestedRevisionpropertyrequestedRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: "1.0.0"Public property; its type, readonly modifier and optionality are shown in the signature.

RuntimeIntegrityRepairEvidence

Runtime Integrity Repair Evidence interface with 8 public fields or methods.

Declaration

text
export interface RuntimeIntegrityRepairEvidence {
    version: '1.0.0';
    repairId: string;
    findingHash: string;
    repairedRevision: string;
    evidenceRef: string;
    evidenceHash: string;
    repairedBy: string;
    repairedAt: string;
}

Contract members

MemberKindSignatureDescription
evidenceHashpropertyevidenceHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
evidenceRefpropertyevidenceRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
findingHashpropertyfindingHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
repairedAtpropertyrepairedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
repairedBypropertyrepairedBy: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
repairedRevisionpropertyrepairedRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
repairIdpropertyrepairId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: "1.0.0"Public property; its type, readonly modifier and optionality are shown in the signature.

RuntimeIntegrityRepairPort

Runtime Integrity Repair Port interface with 1 public fields or methods.

Declaration

text
export interface RuntimeIntegrityRepairPort {
    repair(command: RuntimeIntegrityRepairCommand): Promise<RuntimeIntegrityRepairResult>;
}

Contract members

MemberKindSignatureDescription
repairmethodrepair(command: RuntimeIntegrityRepairCommand): Promise<RuntimeIntegrityRepairResult>Public method; parameters and return type are shown in the signature.

RuntimeIntegrityRepairResult

Runtime Integrity Repair Result interface with 3 public fields or methods.

Declaration

text
export interface RuntimeIntegrityRepairResult {
    evidenceRef: string;
    evidenceHash: string;
    repairedRevision: string;
}

Contract members

MemberKindSignatureDescription
evidenceHashpropertyevidenceHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
evidenceRefpropertyevidenceRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
repairedRevisionpropertyrepairedRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeIntegrityStore

Runtime Integrity Store interface with 4 public fields or methods.

Declaration

text
export interface RuntimeIntegrityStore {
    getWatermark(): Promise<RuntimeIntegrityWatermark | null>;
    putWatermark(watermark: RuntimeIntegrityWatermark, expectedLastGlobalSequence: number | null): Promise<void>;
    getRepair(repairId: string): Promise<RuntimeIntegrityRepairEvidence | null>;
    putRepair(evidence: RuntimeIntegrityRepairEvidence): Promise<void>;
}

Contract members

MemberKindSignatureDescription
getRepairmethodgetRepair(repairId: string): Promise<RuntimeIntegrityRepairEvidence | null>Public method; parameters and return type are shown in the signature.
getWatermarkmethodgetWatermark(): Promise<RuntimeIntegrityWatermark | null>Public method; parameters and return type are shown in the signature.
putRepairmethodputRepair(evidence: RuntimeIntegrityRepairEvidence): Promise<void>Public method; parameters and return type are shown in the signature.
putWatermarkmethodputWatermark(watermark: RuntimeIntegrityWatermark, expectedLastGlobalSequence: number | null): Promise<void>Public method; parameters and return type are shown in the signature.

RuntimeIntegrityWatermark

Runtime Integrity Watermark interface with 7 public fields or methods.

Declaration

text
export interface RuntimeIntegrityWatermark {
    version: '1.0.0';
    lastGlobalSequence: number;
    projectionRevision: string;
    schemaCatalogHash: string;
    streamFingerprintRevision: string;
    reportHash: string;
    auditedAt: string;
}

Contract members

MemberKindSignatureDescription
auditedAtpropertyauditedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastGlobalSequencepropertylastGlobalSequence: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
projectionRevisionpropertyprojectionRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reportHashpropertyreportHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
schemaCatalogHashpropertyschemaCatalogHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
streamFingerprintRevisionpropertystreamFingerprintRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: "1.0.0"Public property; its type, readonly modifier and optionality are shown in the signature.

ScanCanonicalEventsRequest

Scan Canonical Events Request interface with 3 public fields or methods.

Declaration

text
export interface ScanCanonicalEventsRequest {
    afterGlobalSequence: number;
    limit: number;
    maxBytes: number;
}

Contract members

MemberKindSignatureDescription
afterGlobalSequencepropertyafterGlobalSequence: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
limitpropertylimit: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxBytespropertymaxBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ScanCanonicalEventsResult

Scan Canonical Events Result interface with 4 public fields or methods.

Declaration

text
export interface ScanCanonicalEventsResult {
    events: PersistedFrameworkEvent[];
    scannedBytes: number;
    lastGlobalSequence: number;
    hasMore: boolean;
}

Contract members

MemberKindSignatureDescription
eventspropertyevents: PersistedFrameworkEvent<unknown>[]Public property; its type, readonly modifier and optionality are shown in the signature.
hasMorepropertyhasMore: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
lastGlobalSequencepropertylastGlobalSequence: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
scannedBytespropertyscannedBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.