{
  "project_brief": {
    "document": "Village Zero.md",
    "file_sha256": "664e677fdeba1f991172920591dfd1dc2c1bc444c3e1deefe8901d0c6512a05f",
    "excerpts": [
      {
        "lines": "3–16",
        "verbatim": "**Исследовательский проект Networked Software Systems Laboratory (NSSL), факультет ECE, Технион.**\n\n## Зачем мы это делаем\n\nVillage Zero — эксперимент по созданию **небольшого автономного общества**, а не игры с заранее написанным сюжетом. Мы исследуем, могут ли независимые персонажи на базе локальной языковой модели, живя в общем изменяющемся мире, самостоятельно принимать решения, пользоваться прошлым опытом, заводить знакомства, договариваться и постепенно выстраивать собственную жизнь.\n\nНас интересует не правдоподобие красивых рассказов само по себе, а **возникновение проверяемых действий и последствий**: персонаж может пообещать помощь, но выполнение подтверждается только изменением состояния мира.\n\n## Основные принципы\n\n- **Независимые жители.** У каждого есть характер, личная память, занятия, интересы и право отказаться или передумать.\n- **Мир живёт по собственным правилам.** Время, места, ресурсы, перемещения, сделки и другие объективные изменения контролирует World Engine.\n- **Никакой телепатии или режиссуры.** Жители узнают о других через доступные наблюдения, разговоры и публичные источники; движок не навязывает дружбу, торговлю или совместные цели.\n- **Проверяемость.** Мы сохраняем решения, источники информации, результаты действий и воспроизводимые экспериментальные данные. Положительные и отрицательные результаты одинаково важны."
      },
      {
        "lines": "18–20",
        "verbatim": "## Где мы сейчас\n\nВ деревне живут пять персонажей: **Мара, Илан, Нэсса, Талия и Торен**. Уже проверены память, разговоры, самостоятельное перемещение, производство, торговля, услуги и отдельные формы досуга. **Способность к некоторым совместным действиям подтверждена**, но устойчивое развитие отношений и насыщенная автономная общественная жизнь пока остаются открытыми исследовательскими задачами."
      }
    ]
  },
  "technical_document": {
    "document": "Village Zero · Architecture and boundaries",
    "file_sha256": "1ed4ff237d523756bbef38eaf8db4bf293ab57888d4e6873e80b98a21e4d856c",
    "excerpts": [
      {
        "lines": "11–38",
        "verbatim": "### World engine and resident state\n\n- The engine owns the authoritative state in SQLite. [World](village_zero/world.py)\n  handles events and core transitions. [LivingWorld](village_zero/living.py)\n  layers places, journeys, co-location, supplies, local work and everyday rest\n  onto the earlier engine. Eligibility is checked in the relevant engine module.\n  Rules can produce events without an NPC model call, for example arrivals and\n  eligible tavern evening service.\n- Resident IDs and character seeds are pinned by the world profile. In the\n  five-resident profile Mara keeps the tavern, Ilan is the merchant, Nessa is the\n  village gossip, Talia is the gardener and Toren is the smith. Each call is scoped\n  to one resident. The model receives that resident's view and menu, including\n  eligible options to speak, move, work, rest, read or stay.\n- An event can produce observations visible to authorized recipients. Committed\n  messages travel through a durable queue and generate a local memory, a\n  delivery receipt and a recipient job as applicable. Message/source links are\n  inspectable. Spatial speech requires the applicable co-location and reply\n  constraints. [Message delivery](village_zero/propagation.py) ·\n  [Spatial dialogue](village_zero/spatial.py) · [Resident reads](village_zero/services.py)\n- A resident's memories and beliefs are stored separately. The hybrid index uses\n  lexical retrieval and `embeddinggemma:300m` vectors scoped to the resident.\n  Context packing prioritizes the required current view and selects eligible\n  history within budget. Source IDs can verify access and provenance. The\n  semantic accuracy of a paraphrase or inference requires separate evaluation.\n  Private plans, beliefs and future intentions are records of resident state.\n  A plan alone records an intention. A subsequent world transition needs its\n  own evidence. [Memory index](village_zero/memory_index.py) ·\n  [Context builder](village_zero/context.py) · [Future intentions](village_zero/future_intentions.py)"
      },
      {
        "lines": "40–59",
        "verbatim": "### Scheduler and model\n\nThe [Scheduler](village_zero/fair_attention.py) ranks residents with eligible\nlocal work using the saved queue, time since service and the profile's ranking\nrules. In the Long-Life Run, arm A allowed one resident decision per tick. Arm B\nallowed up to three **serial** decisions by different residents at the same tick.\nAfter each round, effects and deliveries are committed and eligible work is\nrefreshed before the next prompt is built. An available recipient can therefore\nrespond before the next tick. Each resident gets at most one decision per tick.\nVacancies stay empty. The shared history uses A's one-decision limit. The study\nuses two ticks per game-day. Branch widths change opportunities and call cost\nwhile the underlying action and world rules are shared. [Decision rounds](temporal_experiment63.py#L122) ·\n[Run coordinator](long_life_run.py)\n\nThe run used Ollama with `qwen3.8:27b` (`q4_K_M`), `think:false`, temperature\n`0.6`, `num_ctx=16384` and `num_predict=460`. The native context packer budget\nwas 4,096 input tokens. The runner checked actual input against that limit,\nGPU placement and the transport log for truncation. The Qwen instance ran in a\nseparate experiment service on A5000. The hybrid memory index used the embedding\nservice for retrieval. [Native context implementation](village_zero/native_context.py) ·"
      },
      {
        "lines": "62–92",
        "verbatim": "### Action validation, receipts and recovery\n\n1. The runner reserves a logical call and its scheduled work, persists the exact\n   request, then records a transport attempt. A reply is saved before application.\n2. The handler checks the response against its contract, actor and scoped\n   sources. The engine rechecks the selected action and its preconditions in\n   the current world. It applies a legal transition in SQLite with its result\n   and job update. Delivery then records receipt and recipient state through the\n   durable queue. A rejected action retains diagnostic evidence.\n3. Use committed engine events and ledgers for claims about world state.\n   `world_transactions` lists committed transfers. Journey records support\n   movement and arrivals. Activity and service use their engine events. A\n   delivered message confirms who said what and when. A saved plan confirms\n   that the plan was recorded. The resident receipt interface can query\n   eligible visible events by ID. [Action application](village_zero/social.py#L269) ·\n   [Action receipts](village_zero/action_receipts.py) ·\n   [Transaction projection](village_zero/objects.py)\n4. The registered runner allows one writer per run directory. Its\n   [TurnJournal and tick cursor](mid_tick_runner.py) preserve prepared and\n   finished ticks, request hashes, attempts and event/call watermarks. On resume\n   the coordinator reconciles saved transport records with the pinned logical\n   call. A verified saved response can be applied without new inference.\n   Applied actions return their recorded result. Recovery preserves the tick\n   and the already used resident slots. A possibly sent request without a\n   verified reply consumes budget. The state/journal checks stop advancement if\n   the evidence is inconsistent.\n5. Checkpoints hash the world SQLite file and the transport journal. The\n   cohort gate checks hashes, SQLite integrity and foreign keys, then restores\n   each phase's last decision checkpoint on a copy and verifies replay without\n   fresh inference. It also checks the first paired prompts, delivered\n   conversations and objective receipts. This is a local durability boundary."
      }
    ]
  },
  "profile_readme": {
    "document": "Village Zero · Decentralized LLM Society Simulator",
    "file_sha256": "910e135b331c2ca5090dc6a72215e00007bca4092c2be546e620288ee7b60e25",
    "excerpts": [
      {
        "lines": "3–7",
        "verbatim": "Village Zero is an independent, text-based research simulator written in Python.\nA deterministic SQLite world engine applies rules and keeps an audit trail.\nLanguage models choose resident actions from local observations, memories and\nlegal options. The interactive CLI and registered research runners use different\nprofiles."
      }
    ]
  },
  "registered_revision": "4f5a2bf3e2331bde4b88f4d69917c6e1409e2a19"
}