Skip to content

Latest commit

 

History

History
71 lines (56 loc) · 1.43 KB

File metadata and controls

71 lines (56 loc) · 1.43 KB

VeriSimDB: ReScript Registry Type Definitions

These definitions form the backbone of the "Tiny Core". They ensure that every Octad resolved by the WASM proxy is type-safe and consistent with the KRaft controller’s state.

1. Core Octad Types

type uuid = string // 128-bit UUID represented as hex
type did = string  // Decentralized Identifier for the owner

type modalityType =
  | Graph
  | Vector
  | Tensor
  | Semantic
  | Document
  | Temporal

type storeMeta = {
  endpoint: string,
  supportedModalities: array<modalityType>,
  policyHash: string,
}

type octad = {
  id: uuid,
  owner: did,
  modalities: Belt.Map.String.t<storeMeta>,
  policyHash: string,
  lastModified: float,
}

2. KRaft Metadata Log Types

To support the KRaft-style quorum, the registry must understand log indices and terms.

type term = int
type index = int

type logEntry = {
  term: term,
  index: index,
  command:
    | RegisterOctad(octad)
    | UpdatePolicy(uuid, string)
    | RevokeStore(string)
}

type registryState = {
  lastIncludedIndex: index,
  lastIncludedTerm: term,
  octads: Belt.Map.String.t<octad>,
}

3. The Resolution Logic

This is the primary function invoked by the WASM proxy during a lookup.

let resolveOctad = (registry: registryState, id: uuid): option<octad> => {
  Belt.Map.String.get(registry.octads, id)
}