Cristalina v4 Governed Memory Architecture

Runtime-agnostic memory kernel with OpenClaw and Hermes adapter targets

adapter feedback: observations + diagnostics back through intake profiles × adapters may NOT write canon directly EXTERNAL INPUTS Conversation Input runtime sessions conversation_preference OpenClaw Runtime Feedback openclaw_projection_feedback Structured Preference Signal Imports structured_preference_signal packages/core · @cristalina-v4/core · IMPLEMENTED KERNEL Types and Schemas types.ts · schema-runtime.ts · validation.ts · transitions.ts object contracts · validation · legal layer transitions · legal governance transitions shared contracts consumed by every engine below Source Intake Profiles workflow-engine/source-intake.ts normalize all source kinds into one legal intake contract supported intake kinds: • conversation_preference • openclaw_projection_feedback • structured_preference_signal Workflow Engine workflow-engine/pipeline.ts builds & routes: observations · episodes · entities relations · world claims · wiki artifacts · proposals contradiction objects & resolutions disposition routing writes structured records, not canon Governance Engine governance/engine.ts evaluates proposals applies promotion gates emits ratifications + rejection / deferral diagnostics blocks illegal canon transitions the only legal path to canon Canon Engine canon/engine.ts CANON AUTHORITY applies approved canonical: • create • revise • supersede writes ONLY to canon/ Audit & Eval Harness audit/log.ts · evals.ts fixture flows + tests snapshots · diagnostics executable flows · integrity checks MVP Flows 001 / 002 / 003 Projection SDK adapter-sdk/projection.ts common projection filtering read-policy enforcement projection manifest creation shared by all adapters OpenClaw Projection Compiler projection-engine/openclaw.ts compiles canonical · world · wiki runtime identity · contradictions resolutions · diagnostics → OpenClaw bootstrap artifacts writes derived/, never source-of-truth Store IO & Recovery store/io.ts · store/manifest.ts conversation-preference-store.ts persist records · materialize store reuse previous runs repair drifted derived artifacts recover from partial materialization spans the entire .cristalina-v4 store ↓ core write pipeline: intake → workflow → governance → canon no shortcut from runtime to canon — every promotion must clear the governance gate persistence + replay RUNTIME & ADAPTER SURFACES OpenClaw Projection Surface [implemented target] consumes derived/ artifacts OpenClaw Adapter @cristalina-v4/ openclaw-adapter [planned package] Hermes Projection Surface [planned target] parallel to OpenClaw Hermes Adapter @cristalina-v4/ hermes-adapter [planned package] planned core extensions Wiki Engine [planned separation] currently emitted through workflow engine Retrieval Orchestrator [planned] no current implementation Runtime Self Module currently records + workflows only not a separate package World Engine currently records + workflows only not a separate package Store IO & Recovery boundary · .cristalina-v4/ · persistence + replay raw/ evidence fidelity source records imports attachments evidence, not truth runtime/ operational context observations runtime instances sessions · threads · blocks not canon world/ structured + temporal entities · relations episodes · claims contradictions · ontology not final truth authority canon/ GOVERNED AUTHORITY ratified durable memory objects supersession chains writes only via Canon Engine wiki/ editorial synthesis pages claims · index log not authoritative memory governance/ decision ledger proposals · ratifications curation · policy snapshots contradiction resolutions disposition records derived/ reproducible outputs OpenClaw + Hermes projection artifacts projection manifests never source-of-truth audits/ accountability trail change logs · diagnostics validation logs snapshots recovery journals Legend Intake / Projection surface Engine / SDK / Compiler Governance / Canon authority Storage zone / Store IO Audit / accountability Planned (dashed = not implemented) write read × forbidden write path Authority Rules • Raw sources are evidence, not truth • Runtime state is operational context, not canon • World model is structured + temporal, but not final truth authority • Canon is the only governed durable memory authority • Wiki is editorial synthesis, not authoritative memory • Derived projections are reproducible outputs, never a source of truth • Adapters may write observations + diagnostics back through intake profiles • Adapters may NOT write canon directly Contradiction Handling • Conflicting world claims create explicit contradiction records in world/ • Contradiction resolutions are persisted in governance/ • Accepted resolutions are applied later (asynchronous, reviewable) • Projection is recompiled after every resolution application Workflow Engine builds: contradiction objects · contradiction resolutions · disposition routing • Governance is the only path that promotes a resolution into canon Replay & Resilience • Recovery journals + artifact reuse live inside the store layer • Derived projections are rebuilt from upstream state, never trusted as canon • Store IO can repair drifted derived artifacts • Store IO can recover from partial materialization • Previous runs are reused — no work lost between sessions • If derived/ is lost, it can be regenerated deterministically from canon/ + world/ + wiki/ + governance/ • If runtime/ drifts, replay from raw/ + governance/ rebuilds operational context Executable Fixture Flows MVP Flow 001 — conversation → ratification conversation input → observation → world → wiki → proposal → ratification → projection MVP Flow 002 — canonical lifecycle canonical create → revise → supersede → audit trail → projection manifest MVP Flow 003 — contradiction lifecycle contradiction detection → resolution application → projection recompilation all three flows are executable end-to-end via the eval harness (evals.ts + fixtures)

Core Thesis

  • • Raw sources (evidence)
  • • Runtime self (operational context)
  • • Temporal world model (structured)
  • • Governed canonical memory (authority)
  • • Persistent knowledge wiki (editorial)

Implemented Kernel

  • • Source intake (3 normalized kinds)
  • • Workflow engine (records + proposals)
  • • Governance (promotion gates)
  • • Canon (create / revise / supersede)
  • • OpenClaw projection compiler
  • • Store IO with reuse + recovery

Boundary Rules

  • • No direct runtime → canon writes
  • • Wiki is derived editorial memory
  • • Projections are reproducible downstream artifacts
  • • Adapters never write canon directly
  • • Governance is the only legal promotion path