DEV Community

Cover image for V.E.L.O.C.I.T.Y.-OS: NDA – The Birth of an AI-Native Language (Part 2)
UnitBuilds for UnitBuilds CC

Posted on

V.E.L.O.C.I.T.Y.-OS: NDA – The Birth of an AI-Native Language (Part 2)

After implementing the Gatekeeper security scanner, I ran into a massive economic and architectural bottleneck: context window accumulation.

As my agents self-corrected bugs and read multi-file contexts, the token counts surged. GLM 5.2's session cost Pascal $1.73 in token fees, while Kimi cost $0.86. If I wanted to run massive multi-agent systems, loading the entire codebase context for every small modification was a non-starter.

I needed a way to let agents query the codebase at a high level of detail, fetch only what they needed, modify it, and commit it without bloating the context.


The V.E.L.O.C.I.T.Y.-OS 12-Part Roadmap

We are building a bare-metal, self-healing operating system running entirely inside the CPU's L3 cache. Here is the roadmap for this 12-part series:

  1. Part 1: The Spark — Exposing the "Safe-Room" security leak and building the compiler gate.
  2. Part 2: The NDA Language — Designing a content-addressed triplet representation to cure context bloat. (You are here)
  3. Part 3: Ditching the Web Stack — Building a native 30MB IDE with 1,500,000x IPC latency drops.
  4. Part 4: The Closure JIT — Compiling AST blocks to nested closures and bypassing borrow checker limits.
  5. Part 5: JIT Math Optimizations — Replacing division operations with precomputed 16-bit lookup tables.
  6. Part 6: x86-64 Assembler & SCEV-Lite — Compiling scalar loops directly to native code in constant time.
  7. Part 7: Classic Compiler Passes — Implementing inter-procedural Dead Code Elimination and loop unrolling.
  8. Part 8: Reclaiming Ring 0 — Exiting UEFI boot services and transitioning the kernel to Ring 0.
  9. Part 9: Bare-Metal Drivers — Writing a PCI scanner, NVMe block storage controller, and FAT32 parser.
  10. Part 10: Synaptic Canvas — Rendering a spatial, force-directed GUI based on model token activation vectors.
  11. Part 11: Swarms & Hot-Patching — Building multi-agent scheduling and zero-downtime RCU driver updates.
  12. Part 12: Self-Evolution — Handing system control over to a local LLM Terminal that self-optimizes via telemetry.


Inverting the Paradigm: Let LLMs Do It Their Way

Most developers spend their time forcing models to write human languages (TypeScript, Python, C++), only to compile those down to machine instructions. This double translation is where hallucinations thrive.

I decided to invert the paradigm. What if I designed a language that was native to the way LLMs represent information?

This led to the design of Neural Document Architecture (NDA)—a proprietary, zero-allocation binary format designed for nanosecond-latency document transmission, storage, and recovery. Instead of bloated code syntax, NDA represents logic as a semantic graph of subject-predicate-object triples.

[bridge] Output vocabulary: 9 opcodes (zero-hallucination mode)
SCOPE INT MATRIX INT MATRIX INT ... END_SCOPE ROOT
Enter fullscreen mode Exit fullscreen mode

By constraining the model's output projection head (NdaHead) to only emit valid opcodes and structured triplets (using stack-depth rules in pipeline_nda.rs), the model physically could not write syntactically invalid code.

The Merkle Call-Graph Parser

To make this execution model deterministic, I wrote a custom recursive descent parser (nda_parser.rs).

Since NDA is content-addressed, function calls are parsed as placeholders and resolved to their exact cryptographic SHA-256 hashes. The parser runs 5 passes over the AST to propagate Merkle roots from leaf nodes to parents.

Here is the exact logic from nda_parser.rs that hashes names and performs the 5-pass Merkle propagation to build the cryptographically bound call graph:

// compiler/nda_parser.rs — Hashing & Merkle Propagation
use sha2::{Digest, Sha256};

pub fn hash_name(name: &str) -> u64 {
    let mut hasher = Sha256::new();
    hasher.update(name.as_bytes());
    let digest = hasher.finalize();
    u64::from_le_bytes(digest[..8].try_into().unwrap())
}

// Inside the compile function: 5-pass Merkle root propagation
let mut fn_hashes: HashMap<String, u64> = functions.keys()
    .map(|name| (name.clone(), hash_name(name)))
    .collect();

for _ in 0..5 {
    let mut next_hashes = fn_hashes.clone();
    for (name, node) in &functions {
        let calls = all_calls.get(name).unwrap();
        // Resolve target call keys to their current Merkle hashes
        let resolved = resolve_calls(node, &fn_hashes, calls);
        next_hashes.insert(name.clone(), resolved.hash());
    }
    fn_hashes = next_hashes;
}
Enter fullscreen mode Exit fullscreen mode

If any part of the program is modified or tampered with, the Merkle root changes instantly. This gives us cryptographic proof of state history at zero runtime cost.

Here is the architectural comparison of how standard call graphs contrast with V.E.L.O.C.I.T.Y.'s content-addressed Merkle call graph:

Diagram comparing standard and Merkle call graphs
Fig 1: Transitioning from traditional address-based calls to content-addressed Merkle roots.

As

remarked:

"The audit trail isn't just for debugging — it's a record of why each change was made and who agreed to it. That's something you almost never get from standard LLM code generation, where the reasoning is implicit."

Pascal's Critique: Consensus over State

When I shared this design with

, he immediately caught the deeper implication:

"At this point you're not building an agent framework, you're building a distributed version control system for agent cognition."

Pascal pointed out that two agents trying to modify the same shared state is essentially a distributed consensus problem. He pushed me to define how I would resolve conflicts.

This led to the creation of the Discourse Board—a lock-free communication bus where agents exchange Merkle-signed constraint tokens to debate and resolve shared state overlap before commits occur.

But compiling and interpreting this triplet structure in a standard runtime was still too slow. I needed to bypass the traditional JS/TypeScript stack entirely.

In the next post, I'll document how I ditched VS Code and Electron to build a standalone IDE running in just 30MB of RAM.

Discussion

How do you handle codebase context in your multi-agent workflows? Have you hit the "context window wall," and how did you solve it? Would you ever consider a binary, content-addressed representation like NDA over standard plain text? Let's discuss in the comments below!


Special thanks to

for helping me realize that the Merkle audit trail was more than a security feature—it was a cognitive version control system.


Disclaimer: AI was used throughout this project, it is just fitting that it would co-author with me, so special thanks to the Foundry for its tireless hours toiling away and Gemini for producing the cover image.

Top comments (2)

Collapse
 
unitbuilds profile image
UnitBuilds UnitBuilds CC

@pascal_cescato_692b7a8a20 If you want to have a look at the NDA system, Here's part 2

Collapse
 
pascal_cescato_692b7a8a20 profile image
Pascal CESCATO

Part 2 already — reading through it now. The pace this week has been something else entirely.