viva_aion

VIVA Aion - Cyclic world generation for digital consciousness

Philosophy

Aion (αἰών) is cyclic/eternal time in Greek philosophy, contrasting with Chronos (linear time).

VIVA experiences time cyclically through the Big Bounce:

“All You Zombies” - We are our own ancestors and descendants.

Architecture

Seed (deterministic DNA)
    │
    ▼ generate
Labyrinth {grid, start, core}
    │
    ▼ navigate (pathfinding)
    │
    ▼ accumulate memories
    │
    ▼ reach core
    │
    ▼ dream (DRE scoring)
    │
    ▼ select survivors
    │
    ▼ mutate(seed, entropy)
    │
New Seed → New Labyrinth (with transcended memories)

Example

import viva_aion
import viva_aion/seed

// Genesis - first universe
let world = viva_aion.new()

// Create memory bank for this life
let bank = viva_aion.new_memory_bank(1)

// Navigate and accumulate memories
let #(bank, _mem) = viva_aion.remember(bank, 42, 0.8)

// Big Bounce - select memories via DRE and create next universe
let entropy = 42.0
let #(next_world, next_bank) = viva_aion.bounce_with_memories(
  world, bank, entropy, "extra",
  max_survivors: 10,
  min_threshold: 0.3,
)
// Different labyrinth, high-DRE memories carried forward

Types

pub type UniverseSeed =
  seed.Seed

Values

pub fn all_memories(
  bank: memory.MemoryBank,
) -> List(memory.Memory)

Get all memories

pub fn bounce(
  world: generator.Labyrinth,
  entropy: Float,
  extra: String,
) -> generator.Labyrinth

Big Bounce - transform current world into next universe

Entropy accumulated during this life becomes part of the next universe’s DNA.

pub fn bounce_stats(
  bank: memory.MemoryBank,
  max_survivors: Int,
  min_threshold: Float,
) -> #(Int, Int, List(#(memory.Memory, dream.DreScore)))

Get bounce statistics (useful for debugging/logging)

pub fn bounce_with_memories(
  world: generator.Labyrinth,
  bank: memory.MemoryBank,
  entropy: Float,
  extra: String,
  max_survivors: Int,
  min_threshold: Float,
) -> #(generator.Labyrinth, memory.MemoryBank)

Big Bounce with memory consolidation

This is the complete death/rebirth cycle:

  1. Score all memories via DRE
  2. Select survivors (high DRE, above threshold)
  3. Mutate world seed with entropy
  4. Bounce memory bank (only survivors transcend)
  5. Return new world and new memory bank
pub fn bounce_with_memories_config(
  world: generator.Labyrinth,
  bank: memory.MemoryBank,
  entropy: Float,
  extra: String,
  max_survivors: Int,
  min_threshold: Float,
  config: dream.DreConfig,
) -> #(generator.Labyrinth, memory.MemoryBank)

Big Bounce with custom DRE config

pub fn can_move_to(
  world: generator.Labyrinth,
  pos: position.Position,
) -> Bool

Check if position is passable

pub fn core_position(
  world: generator.Labyrinth,
) -> position.Position

Get core position (Leviathan - singularity)

pub fn create_seed(value: String) -> seed.Seed

Create a new seed from string

pub fn current_life_memories(
  bank: memory.MemoryBank,
) -> List(memory.Memory)

Get memories from current life

pub fn default_dream_config() -> dream.DreConfig

Get default DRE configuration

pub fn dimensions(world: generator.Labyrinth) -> #(Int, Int)

Get world dimensions

pub fn distance_to_core(
  world: generator.Labyrinth,
  from: position.Position,
) -> Int

Distance from position to core

pub fn from_seed(s: seed.Seed) -> generator.Labyrinth

Create world from specific seed

pub fn from_string(s: String) -> generator.Labyrinth

Create world from string seed

pub fn genesis_seed() -> seed.Seed

Get the genesis seed

pub fn get_seed(world: generator.Labyrinth) -> seed.Seed

Get world’s seed

pub fn is_at_core(
  world: generator.Labyrinth,
  pos: position.Position,
) -> Bool

Check if position is the core

pub fn light_cone(
  world: generator.Labyrinth,
  from: position.Position,
  radius: Int,
) -> List(#(position.Position, Int))

Expand light cone - all reachable positions within radius

pub fn memories_above_threshold(
  bank: memory.MemoryBank,
  threshold: Float,
  config: dream.DreConfig,
) -> List(#(memory.Memory, dream.DreScore))

Get memories above DRE threshold

pub fn memory_count(bank: memory.MemoryBank) -> Int

Count memories

pub fn memory_tick(bank: memory.MemoryBank) -> memory.MemoryBank

Advance time in the memory bank

pub fn neighbors(
  world: generator.Labyrinth,
  pos: position.Position,
) -> List(position.Position)

Get passable neighbors from position

pub fn new() -> generator.Labyrinth

Create a new world from Genesis seed

pub fn new_memory_bank(life_number: Int) -> memory.MemoryBank

Create a new memory bank for a life

pub fn passable_count(world: generator.Labyrinth) -> Int

Count passable tiles

pub fn past_life_memories(
  bank: memory.MemoryBank,
) -> List(memory.Memory)

Get memories from past lives (transcended)

pub fn path_to_core(
  world: generator.Labyrinth,
  from: position.Position,
) -> Result(pathfinding.PathResult, pathfinding.PathError)

Find path from position to core

pub fn pos(x: Int, y: Int) -> position.Position
pub fn pos_equals(
  a: position.Position,
  b: position.Position,
) -> Bool
pub fn pos_to_string(p: position.Position) -> String
pub fn rank_moves(
  world: generator.Labyrinth,
  from: position.Position,
) -> List(#(position.Direction, Int))

Get all valid moves ranked by distance to core

pub fn recall(
  bank: memory.MemoryBank,
  id: Int,
) -> #(memory.MemoryBank, Result(memory.Memory, Nil))

Recall a memory (marks it as accessed, reinforcing it)

pub fn remember(
  bank: memory.MemoryBank,
  content: Int,
  emotionality: Float,
) -> #(memory.MemoryBank, memory.Memory)

Store a memory in the bank

pub fn remember_important(
  bank: memory.MemoryBank,
  content: Int,
  emotionality: Float,
  importance: Float,
) -> #(memory.MemoryBank, memory.Memory)

Store an important memory

pub fn score_all_memories(
  bank: memory.MemoryBank,
  config: dream.DreConfig,
) -> List(#(memory.Memory, dream.DreScore))

Score all memories in a bank

pub fn score_memory(
  mem: memory.Memory,
  bank: memory.MemoryBank,
  config: dream.DreConfig,
) -> dream.DreScore

Score a single memory

pub fn score_memory_default(
  mem: memory.Memory,
  bank: memory.MemoryBank,
) -> dream.DreScore

Score a memory with default config

pub fn score_to_string(s: dream.DreScore) -> String

Get DRE score as readable string

pub fn sized(
  s: seed.Seed,
  width: Int,
  height: Int,
) -> generator.Labyrinth

Create world with custom size

pub fn start_position(
  world: generator.Labyrinth,
) -> position.Position

Get starting position

pub fn suggest_move(
  world: generator.Labyrinth,
  from: position.Position,
) -> Result(position.Direction, Nil)

Suggest best move toward core (retrocausal pull)

pub fn top_memories(
  bank: memory.MemoryBank,
  n: Int,
  config: dream.DreConfig,
) -> List(#(memory.Memory, dream.DreScore))

Get top N memories by DRE score

pub fn try_move(
  world: generator.Labyrinth,
  from: position.Position,
  dir: position.Direction,
) -> position.Position

Move in direction (returns new position if valid, same if not)

pub fn visualize(world: generator.Labyrinth) -> String

Visualize the world

pub fn visualize_at(
  world: generator.Labyrinth,
  pos: position.Position,
) -> String

Visualize with position marker

Search Document