v0.5.4.4.5 DOI: 10.5281/zenodo.22831764 AGPL-3.0

ENIGMA

Executable Epistemic Contracts in Deterministic Agent Simulation

WORLD TRUTH ≠ NPC MEMORY ≠ NPC BELIEF

What is this?

ENIGMA is a research project exploring whether a deterministic game simulation can generate meaningful emergent behavior when agents act based on their own incomplete and potentially erroneous models of the world — rather than on objective truth.

It is not a game. It is a scientific software artifact: a causal simulation engine where every layer — perception, memory, belief, decision, narration — is causally traced and never conflated with the layer above or below.

"The simulation is deep, but mute to the player: the world cannot initiate contact, and the time the player missed leaves no reachable traces. The loop is broken in both directions." — Loop Closure design rationale

The 12-layer canonical construction order

Layers are built in strict order. Each upper layer must use the causal work of the layer below — never imitate it. Dialogue ≠ Memory, Memory ≠ Causality, Belief ≠ Decision.

Architectural Charter — enforced laws

18 laws (§ENIGMA-001..018) are not guidelines — they are executable contracts. Violations raise ArchitecturalViolationError at runtime.

§ENIGMA-001

Causal Depth Priority

Realism is not a standalone criterion. The question is: does the change increase the number of durable causal structures (memory, trust, debt, attachment, reputation, belief, norm)?

§ENIGMA-002

The Two-Domain Rule

A new fundamental primitive cannot be introduced until runtime bugs in at least two independent domains prove the same ontological problem. Hypothesis-driven generalization is forbidden.

§ENIGMA-003

Epistemic Projection

Absence of data is interpreted as absence of a valid projection in the agent's memory graph — not as a neutral or zero value of the objective world. UNKNOWN ≠ NEUTRAL(0.0).

§ENIGMA-S72

Relativistic Perception

The engine produces only raw signals. Meaning arises at the interaction between personality structure (drives + trauma markers) and the raw signal. Fear does not always mean flight — a control-heavy personality redirects it to preemptive aggression.

§14

Law of Singular Time

There is one time — game_time_seconds. All other "times" are either deterministic projections or durations. Parallel time manifolds are forbidden; this is what makes replay possible.

§15

Wall-Clock Isolation

datetime.now(), time.time(), time.monotonic() are forbidden in the simulation layer. Real time is allowed only in logging, persistence metadata, and UI.

§16

Belief Non-Mutation

Beliefs are lenses (weight modifiers), not genes (scalars). A CrystallizedBelief cannot mutate drives_runtime directly or indirectly. Personality drift via interpretation is forbidden.

§17

Epistemological Orthogonality

The causal axis (Reality) and the epistemic axis (Observer Knowledge) are orthogonal. Consumers (UI, DM, replay) receive only epistemic representations — never Reality directly. Five invariants hold, including "truth never increases" and "no causal return".

Causal trace — vertical proof

Every gameplay-relevant change must be traceable through this chain. If any link is missing or imitated, the upper layers are considered unproven.

The vertical test: human description → NPC compilation → NPC lives → perceives → remembers → forms beliefs → wants → decides → acts → changes the world → remembers consequences → changes relationships/expectations → answers the player from its own history.

"Goran? Yes..." — memory reconstruction

The canonical vertical scenario (track MEM, §16.5). The goal is not an NPC that stores the past — it is an NPC whose past has become part of its model of itself.

01

Acquaintance

NPC meets Goran. Several positive interactions. Memory entries with importance 0.5–0.8.

03

Betrayal

The episode is recorded — but with perspective (victim vs witness vs actor), with betrayal-importance (not as a routine event), with emotion-at-encoding.

07

20 years pass

Decay is driven by Δticks, not wall-clock. Salience weights decide what survives. Episodic details fade; the structure of the betrayal persists.

10

Encounter

A query about Goran must trigger a reconstruction — not a lookup. Personal perspective, temporal structure, surviving and lost details, possible errors, influence on prediction.

16

Prediction

Per-source expectations ("Goran usually helps" — or, after betrayal, "Goran usually betrays"). Prediction error feeds back into memory importance and belief revision.

Success criterion: "Goran? Yes..." — and then a reconstruction of the NPC's individual history, distinct from WORLD TRUTH, reproducible by the deterministic engine.

Anti-Bond — the recurring discipline

Every layer must prove causal work that no other layer performs. A new entity named after a phenomenon is forbidden until it demonstrates work that existing mechanisms cannot do.

Citation

If you use ENIGMA in your research, please cite it as below.

BibTeX

@software{gritsaenko_2026_enigma,
  author       = {Gritsaenko, M.},
  title        = {ENIGMA: Executable Epistemic Contracts in Deterministic Agent Simulation},
  version      = {0.5.4.4.5},
  year         = {2026},
  url          = {https://github.com/4Um4/Enigma},
  doi          = {10.5281/zenodo.22831764},
  license      = {AGPL-3.0}
}

APA

Gritsaenko, M. (2026). ENIGMA: Executable Epistemic Contracts in Deterministic Agent Simulation (Version 0.5.4.4.5) [Computer software]. https://doi.org/10.5281/zenodo.22831764

Chicago

Gritsaenko, M. 2026. "ENIGMA: Executable Epistemic Contracts in Deterministic Agent Simulation." Version 0.5.4.4.5. https://doi.org/10.5281/zenodo.22831764.