Skip to content

Engineering reference

System architecture

Follow the boundary between what a resident can know, what a model can propose and what the engine can commit.

One world with selective access

The Long-Life runner advances a common clock. For each allowed turn it finds a resident with eligible work, constructs their view and requests a decision. In wider schedules, that decision settles before the next decision packet is formed.

Local evidence and eligible actions enter a resident’s decision packet. The full request is reserved in world.sqlite. A separate transport journal records the attempt, request hash and reply or failure. The engine validates the proposed action and commits its effects.
In the registered Long-Life runner each turn has a resident, a reserved request and an independent record of the transport attempt. A world receipt identifies the outcome of an applied operation.

Sources · Implementation references  ·  Long-Life runtime record

Eight choices and their costs

The mechanisms below belong to the registered Long-Life implementation. The alternatives illustrate which scientific observations would change under a different design.

World Engine

spatial.py · living.py · social.py

The engine owns time, positions, journeys, stock, coins, offers and receipts. It computes legal operations from state. A local sale changes inventories and balances under the same rules in every world.

A narrator with authority over the ledger could invent new actions on demand. Fixed operations make transfer and eligibility checks inspectable. New physical or economic behavior needs a corresponding engine rule.

Scheduler

fair_attention.py · temporal_experiment63.py

The fair-attention routine checks pending work, eligibility and recent turns. A resident who has already acted in the current tick cannot take another slot. The runner refreshes opportunities after every slot.

Calling everybody at every tick would give an idle resident model time as readily as someone with a deadline. A capped schedule saves computation, but an invitation can expire before its recipient gets a useful turn.

Local perception

local_perception.py · propagation.py

Location and co-presence determine which encounters a resident can observe. A routed message reaches a named recipient and becomes that resident’s memory, with a delivery record.

A broadcast transcript would simplify coordination and erase the information paths we want to study. A local view preserves those paths at the cost of ambiguity when an agent has never seen a relevant fact.

Personal memory and retrieval

memory_index.py · context.py

Memories have owners and source identifiers. Search restricts candidates to one owner before lexical or semantic ranking. Stored embeddings support semantic similarity. The same event can therefore leave different evidence with different residents.

A shared memory store would make relevant information easier to find. Individual storage makes provenance and information asymmetry measurable. Retrieval ranking and packet capacity can still omit a useful record.

Context Builder

context.py · registered call payload

The builder assembles the triggering evidence, local view and current choices. It checks the required packet against the logical budget before fitting optional memories and other history. A recorded request shows what actually fit.

Replaying every prior turn would make prompts grow with world age and entangle cost with experiment length. A bounded packet controls that cost while making the selection and ordering of evidence experimental variables.

Language-model decision layer

social.py · runtime configuration

Five resident identities share one local language model in Long-Life. Its input supplies the acting resident’s role, view, history and present options. The response can select an operation or produce language under the action contract.

Scripted choices make excellent mechanical controls. They would also determine many social outcomes in advance. Model decisions leave room for variation, including repetition, inaction and invalid combinations.

Action validation and receipts

social.py · Experiment 72 result rows

A response is saved before application. The handler decodes the request contract, checks the actor and operation, then applies valid effects in a database transaction. An expired offer or an invalid combination cannot produce a purchase receipt.

Inferring success directly from a sentence is cheaper to implement but leaves no independent test of the claim. Validation provides one. A rejected response can consume a turn even when a valid purchase was available.

Persistent state and audit

mid_tick_runner.py · TurnJournal.provider and settle

The world database reserves the complete request in world.sqlite, in calls.request. Each row of transport.sqlite’s attempt table identifies a call and attempt sequence, stores the request’s SHA-256 hash, and can hold the returned response or a failure.

Keeping the attempt separate from the committed action lets the single-writer runner check the reserved request and recover a saved reply. Checkpoints retain the world and transport state needed to resume.

Sources · Implementation references  ·  Long-Life runtime record  ·  Six replay outcomes · CSV

Which memories reached the smith?

Before Toren decided whether to buy Ilan’s crate, the builder counted 83 available records in his own notebook. The packet sent to the model contained nine. Its measured input occupied 3,912 of the 4,096 tokens budgeted for this turn.

83Available to Toren
9Included in the packet
3Cited in the reply

What the record shows

The builder kept two required records, one recent record and six selected for relevance. Toren’s reply cited records 461, 332 and 76. On the same turn he chose to accept offer 10. Event 275 records the transfer of one crate for two coins.

What would test influence?

The offer and the option to buy were also visible in the packet. To estimate the effect of selected memories, replay the same pre-decision state with a specified record replaced or withheld, hold the action menu and input budget fixed, and compare receipts over matched seeds.

Sources · R07/B · memory selection for call 294  ·  Implementation references

Three records for one claim

A resident’s utterance, the decoded operation and the independently committed result answer different questions. Matching their identifiers makes an episode auditable.

An invitation in the tavern
LayerExample from R06/AWhat it establishes
Request and replyTick 52, call 52. Mara selects an invitation addressed to Nessa.The model selected that option from the packet.
World stateEvent 101 records a live invitation in encounter 7 at the tavern.The engine opened the opportunity for a later response.
ReceiptTick 55, call 55. Event 105 cites offer 101 and marks the shared rest complete.The two residents completed this activity. Lasting friendship would require separate evidence.

Recovery with a saved reply

The transport row is opened before dispatch. A successful reply is saved before the engine applies the chosen operation. Recovery checks the reserved request against the saved hash and the original tick. Applying an already committed turn returns its stored result. A lost reply can still leave uncertainty about whether the remote inference ran.

A new model decision

Restoring an earlier checkpoint and requesting another inference creates a continuation. Model, seed, opportunity, prompt and observation horizon all matter when comparing it with the original. Experiment 72 records the starting state and outcomes of each such continuation.

Sources · R06/A · job 79, offer 101 and receipt 105  ·  Implementation references  ·  Six replay outcomes · CSV

Inside the Long-Life profile

A single local Ollama 0.40.15 decision service ran qwen3.8:27b, Q4_K_M, at temperature 0.6 with a 460-token generation cap. The registered implementation used SQLite and owner-scoped retrieval with embeddinggemma:300m, a 768-dimensional embedding model.

Two context limits

The packer targets a 4,096-token decision packet. The runner was configured with a 16,384-token model context. Increasing the runner allocation alone would leave the resident’s evidence budget at 4,096.

Recorded machine

NVIDIA RTX A5000 with 24,564 MiB of reported VRAM. Peak sampled device use reached 19,029 MiB. The host log identifies an Intel Core i7-12700K and the operating system reports 61.29 GiB of accessible RAM.

Model evaluation, summed across all eight roots
PhaseCallsInput tokensOutput tokensModel minutes
Shared histories3841,340,50668,86949.0
Post-fork A1,1524,404,893194,508148.9
Post-fork B2,94311,485,331505,144387.6
All phases4,47917,230,730768,521585.5

Model minutes sum the provider’s prompt-evaluation and generation durations. Rows are rounded independently. HTTP requests took 36,658.51 cumulative seconds, and include time outside those two counters.

Scaling the schedule

B allowed up to three turns, compared with one in A. That yielded 2,943 versus 1,152 calls over the same simulated horizon. A later decision can use an earlier outcome in the same tick, so executing all three concurrently would change the experiment.

What these timers cover

The 4,479-call ledger covers decision generation. Embedding work, bookkeeping and checkpoint I/O have no separate inference-cost line here. Generation alone averaged 43.62 output tokens per second, calculated from the provider’s 17,618.67 seconds of decoding. Monetary cost and power consumption remain unmeasured.

Sources · Long-Life runtime record  ·  Runtime by phase · CSV  ·  Implementation references