<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 4Um4 LegoGo</title>
    <description>The latest articles on DEV Community by 4Um4 LegoGo (@4um4).</description>
    <link>https://dev.to/4um4</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4210190%2F43d661e4-41ed-4296-b3b0-237dac0a4457.png</url>
      <title>DEV Community: 4Um4 LegoGo</title>
      <link>https://dev.to/4um4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/4um4"/>
    <language>en</language>
    <item>
      <title>Building ENIGMA: a deterministic agent simulation, solo, via free-tier LLM access</title>
      <dc:creator>4Um4 LegoGo</dc:creator>
      <pubDate>Tue, 27 Oct 2026 07:43:41 +0000</pubDate>
      <link>https://dev.to/4um4/building-enigma-a-deterministic-agent-simulation-solo-via-free-tier-llm-access-e58</link>
      <guid>https://dev.to/4um4/building-enigma-a-deterministic-agent-simulation-solo-via-free-tier-llm-access-e58</guid>
      <description>&lt;h1&gt;
  
  
  What is ENIGMA
&lt;/h1&gt;

&lt;p&gt;In March 2026 I started building a deterministic causal simulation engine — agents that act on their own incomplete and potentially erroneous models of the world, not on objective truth. The principle is &lt;code&gt;WORLD TRUTH ≠ NPC MEMORY ≠ NPC BELIEF&lt;/code&gt;, enforced at runtime.&lt;/p&gt;

&lt;p&gt;Today, 7.5 months later: &lt;strong&gt;v0.5.4.4.5&lt;/strong&gt;, &lt;strong&gt;729 commits&lt;/strong&gt;, &lt;strong&gt;18 enforced architectural laws&lt;/strong&gt; (§ENIGMA-001..018), &lt;strong&gt;12-layer canonical construction order&lt;/strong&gt;, AGPL-3.0, Zenodo DOI.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source code:&lt;/strong&gt; &lt;a href="https://github.com/4Um4/Enigma" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visual overview:&lt;/strong&gt; &lt;a href="https://huggingface.co/spaces/Um44/ENIGMA" rel="noopener noreferrer"&gt;HuggingFace Space&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Archived version:&lt;/strong&gt; &lt;a href="https://doi.org/10.5281/zenodo.22831764" rel="noopener noreferrer"&gt;Zenodo DOI&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is &lt;strong&gt;not a game&lt;/strong&gt;. A scientific software artifact in active development.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;not a tutorial&lt;/strong&gt;. Architectural documentation for researchers and engineers working on agent systems, epistemic logic, deterministic simulation, or LLM-assisted engineering.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;not a product&lt;/strong&gt;. Solo-maintained research project, no support SLAs, no roadmap commitments to external stakeholders.&lt;/p&gt;




&lt;h1&gt;
  
  
  The workflow that made this possible
&lt;/h1&gt;

&lt;p&gt;I want to share the engineering methodology, because it's the most interesting part and probably the most reproducible.&lt;/p&gt;

&lt;p&gt;I don't use agent swarms. I don't use API access. I use &lt;strong&gt;free-tier web access to multiple models in parallel, three browser windows, and a human-as-router architecture&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Window 1: GLM&lt;/strong&gt; as architect (final ADRs and code)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Window 2: GPT/Claude&lt;/strong&gt; for design pushback and alternatives&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Window 3: Kimi/DeepSeek/Gemini&lt;/strong&gt; for sanity checks and edge cases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The models argue with each other through me. I synthesize. The final decision goes to GLM as an architect with a strict format contract (original Russian names kept):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;БЫЛО:       &amp;lt;one line of code to be replaced&amp;gt;
СТАЛО:      &amp;lt;new code&amp;gt;
IPT:        &amp;lt;invariant checked&amp;gt;
КРАСНЫЕ ИНВАРИАНТЫ: N red → M red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Translation: БЫЛО = before, СТАЛО = after, IPT = invariant probe test, КРАСНЫЕ ИНВАРИАНТЫ = red invariants count)&lt;/p&gt;

&lt;p&gt;This is faster than any agent swarm I've tried. Context window optimization is done by me — I extract relevant fragments from 200K+ lines of code, the models never see the full codebase. Latency hides through parallelism (while model A is thinking, I formulate task for model B, review result from model C).&lt;/p&gt;




&lt;h1&gt;
  
  
  Why this matters: model drift is real
&lt;/h1&gt;

&lt;p&gt;I've observed that newer model versions tend to "drift". GLM 5.3 vs 5.2 — 5.3 wants to design inside its own environment, ignoring the working mode protocol. Similar patterns in Claude and GPT between versions.&lt;/p&gt;

&lt;p&gt;The defense is architectural:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Archaeological protocol&lt;/strong&gt; — no code change without grep/PowerShell archaeology first (§13 of the charter)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ADR-PRE-FLIGHT checklist&lt;/strong&gt; — before any code, fill: type, affected domains, downstream consumers, resource budget, rollback plan, regression test&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Executable invariants&lt;/strong&gt; — 18 laws raise &lt;code&gt;ArchitecturalViolationError&lt;/code&gt; at runtime when violated&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Format enforcement&lt;/strong&gt; — every change must list the invariant it checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The architecture is &lt;strong&gt;model-agnostic&lt;/strong&gt;. If GLM disappears tomorrow, I switch to another model and continue — because my asset is the discipline, not the model.&lt;/p&gt;




&lt;h1&gt;
  
  
  The 12-layer canonical construction order
&lt;/h1&gt;

&lt;p&gt;Each layer must use the causal work of the layer below, never imitate it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; 0. Authoring → Compiler          (LLM translates, Python validates)
 1. Identity / History            (past exists as data, not text)
 2. Body → Need                   (states have consequences, not decoration)
 3. Desire → Object → Activity   (NPC wants something, chooses activity)
 4. Decision → Action → Outcome  (CAN ≠ WANT ≠ INTEND ≠ ATTEMPT ≠ SUCCESS)
 5. Perception → Experience → Memory (NPC knows only what it could perceive)
 6. Salience → Consolidation      (memory becomes selective)
 7. Relationships as History      (relationship = consequence of history)
 8. Belief → Expectation → Decision (NPC acts on its picture of the world)
 9. NPC as Interface              (player learns complexity through NPC)
10. Self-Interpretation           (WHAT HAPPENED ≠ HOW EXPLAINS)
11. Appraisal / Prediction        (surprise as measurable prediction error)
12. Deception                     (lie ≠ ignorance ≠ error ≠ withholding)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Anti-Bond rule:&lt;/strong&gt; each layer must prove causal work no other layer performs. No parallel truth-stores. No decorative state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dialogue ≠ Memory
Memory ≠ Causality
Belief ≠ Decision
Relationship scalar ≠ History
Self-interpretation ≠ Motivation
LLM ≠ Canonical Truth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Key architectural principles
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Epistemic grounding&lt;/strong&gt; — LLM is never a source of canonical truth; Python = causal authority&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic replay&lt;/strong&gt; — KernelRNG-protocol, no &lt;code&gt;random.*&lt;/code&gt; or wall-clock in simulation layer (§15)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Causal layering&lt;/strong&gt; — upper layers must use the causal work of lower layers, never imitate&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anti-Bond&lt;/strong&gt; — no parallel truth-stores, no decorative state&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Belief non-mutation&lt;/strong&gt; — beliefs are lenses (weight modifiers), not genes (scalars); personality drift via interpretation is forbidden (§16)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Epistemological orthogonality&lt;/strong&gt; — &lt;code&gt;Reality&lt;/code&gt; and &lt;code&gt;Observer Knowledge&lt;/code&gt; are orthogonal axes; consumers receive only epistemic representations (§17)&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  What's open right now
&lt;/h1&gt;

&lt;p&gt;Active fronts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;BC-2&lt;/strong&gt; (Conclusion → Expectation) — epistemic circuit&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MOT&lt;/strong&gt; (Motive &amp;amp; Decision Trace) — decision stores "why", not just "what"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MEM&lt;/strong&gt; (Memory Architecture) — long-term memory with decay, consolidation, reconstruction&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NL-01 phase 1&lt;/strong&gt; (Narrative Grounding) — NPC as interface, three control questions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The canonical vertical proof is the &lt;strong&gt;"Goran? Yes..." memory scenario&lt;/strong&gt; (track MEM §16.5): an NPC reconstructs its individual history with perspective, temporal structure, surviving and lost details, possible errors, and prediction of future behavior — distinct from &lt;code&gt;WORLD TRUTH&lt;/code&gt;, reproducible by the deterministic engine.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why I'm writing this
&lt;/h1&gt;

&lt;p&gt;Mostly to share the methodology. The "human-as-router with three LLM windows" workflow is something I haven't seen documented, and it's been more effective for me than any agent framework.&lt;/p&gt;

&lt;p&gt;If you're doing similar long-context LLM-assisted work, I'd like to hear your patterns. The comments are open.&lt;/p&gt;

&lt;p&gt;The project itself is research-grade — AGPL-3.0, so if you serve it over network, share the source.&lt;/p&gt;




&lt;h1&gt;
  
  
  Links
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/4Um4/Enigma" rel="noopener noreferrer"&gt;4Um4/Enigma&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HuggingFace Space:&lt;/strong&gt; &lt;a href="https://huggingface.co/spaces/Um44/ENIGMA" rel="noopener noreferrer"&gt;Um44/ENIGMA&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DOI:&lt;/strong&gt; &lt;a href="https://doi.org/10.5281/zenodo.22831764" rel="noopener noreferrer"&gt;10.5281/zenodo.22831764&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architectural Charter:&lt;/strong&gt; &lt;a href="https://github.com/4Um4/Enigma/blob/main/docs/%D0%90%D0%A0%D0%A5%D0%98%D0%A2%D0%95%D0%9A%D0%A2%D0%A3%D0%A0%D0%9D%D0%AB%D0%99_%D0%A3%D0%A1%D0%A2%D0%90%D0%92_ENIGMA.md" rel="noopener noreferrer"&gt;АРХИТЕКТУРНЫЙ_УСТАВ_ENIGMA.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Roadmap v4.12:&lt;/strong&gt; &lt;a href="https://github.com/4Um4/Enigma/blob/main/docs/ENIGMA_ROADMAP_v4_12_WPS.md" rel="noopener noreferrer"&gt;ENIGMA_ROADMAP_v4_12_WPS.md&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Citation
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight bibtex"&gt;&lt;code&gt;&lt;span class="nc"&gt;@software&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;gritsaenko_2026_enigma&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;author&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{Gritsaenko, M.}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{ENIGMA: Executable Epistemic Contracts in Deterministic Agent Simulation}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;version&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{0.5.4.4.5}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;year&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{2026}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{https://github.com/4Um4/Enigma}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;doi&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{10.5281/zenodo.22831764}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;license&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{AGPL-3.0}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Happy to answer technical questions about the architecture, the deterministic replay protocol, the KernelRNG, the anti-Bond discipline, or the LLM workflow.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>architecture</category>
      <category>python</category>
    </item>
  </channel>
</rss>
