Skip to content

Refactor: Relocate event ID aliasing logic out of cognitive_engine (Resolve Responsibility Leakage) #12

Description

@narv-lab

Description

In our system architecture, the relationship between cognitive_engine and memory closely mirrors that of a user-space application and the OS kernel's memory management.
Currently, we convert absolute event_ids (UUIDs) into short aliases (e.g., REF-1) before passing them to the LLM. This process is analogous to an OS Memory Management Unit (MMU) translating Physical Addresses into Virtual Addresses to provide a limited, safe context window for the application.

The Problem (Responsibility Leakage)

Presently, the cognitive_engine (the "application") holds the alias_map and performs the translation (aliasing and de-aliasing) itself.
In a proper OS architecture, a user-space application should never manage its own page tables or perform physical-to-virtual address translations. Having this logic inside cognitive_engine constitutes a clear responsibility leakage, tightly coupling the pure inference pipeline with memory address resolution mechanics.

Proposed Solution

We need to relocate the alias mapping responsibility outside of the cognitive_engine to act as a proper MMU.

  1. Relocate Mapping Logic: Move the alias_map generation and the UUID ↔ Alias translation logic into the kernel_mediator (or the memory facade).
  2. Transparent Input/Output: The cognitive_engine should receive context data that is already mapped to aliases (Virtual Addresses). It should output its causal_links using those aliases without knowing the underlying UUIDs.
  3. Intercept and Translate: The kernel_mediator will intercept the LLM's output, translate the aliases back to the real UUIDs (Physical Addresses), and pass them to the memory module for storage.

Benefits

  • Enforces strict Separation of Concerns (SoC).
  • cognitive_engine becomes a purer, stateless inference pipeline.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions