split nimmerworld architecture: phase 1 of 3 — vertical-by-domain directories Create 9 domain directories under nimmerworld/, each owning an architecture.md that will eventually sit alongside server/client/schema/test code for that domain (vertical-by-domain rather than horizontal-by-language).

This commit is contained in:
2026-04-26 00:55:07 +02:00
parent af99a4fe1b
commit 69260c4ac4
9 changed files with 867 additions and 0 deletions

View File

@@ -0,0 +1,204 @@
# Authority and Decision
> *How authority flows operationally: the four-channel information flow at districts; the hierarchy from imperium through GM through factions through district-directors and overseers down to zones and slots; the bidirectional cascade of policy descending and outcome-signal ascending; the task cascade of bounded-agency tools at every tier; the District-Director's decomposed decision-surface architecture (~90% rule-based, structured LLM-escalation only on ambiguity); the rings-as-structural-pattern recurring shape of graduated authority.*
>
> *Companion to: `architecture-broad.md` (executive summary + global meta-lists), `political-register/architecture.md` (the political claim that authority flows through these tiers), `narrative-composition/architecture.md` (Compositor consumes outcome-signals). Sections in this file were split from the monolithic architecture-broad.md v0.7 on 2026-04-26.*
## The regime of visibility: four-channel information flow at districts
| Channel | Direction | Source | Cadence |
|---|---|---|---|
| **Dispatch** | DOWN | gamemaster → directors | day-boundary + event |
| **Shift assignment** | DOWN | director → NPCs | day-boundary |
| **Audit reports** | UP (objective, observed) | audit-overseers → **directly to imperium** | shift-phase cadence |
| **Emergent-signals** | UP (relational, observed) | zones → director | event-driven (gate-transitions) |
| **Cyclic needs** | UP (interior, self-reported) | NPCs → director | slow tick + threshold-triggered |
| **District reports** | UP (aggregate) | director → GM → imperium | per-cycle |
**The critical asymmetry: NPCs do not self-report *output*.** Audit-overseers observe and report (to imperium directly). NPCs only self-report *needs*. Output is objective; need is interior. The subjective-objective gap is where drama lives, where heresy hides, where the surveillance regime's epistemology is compressed as a schema.
**Audit-overseers are politically-critical NPCs**, not degenerate. Each has a trait-vector, relationship-gates with observed districts, lifeforce account (vulnerable to bribery). High-Dikaiosyne overseers report honestly; corruptible overseers can be turned. They are high-stakes targets for both regime (loyalty-maintenance) and resistance (compromise).
## Hierarchy
```
IMPERIUM (policy-issuer; budget-holder; recipient of overseer-direct-intel)
▲ ↓ formulates to
│ aggregate reports + faction outcomes ↓
│ ↓
GAMEMASTER (middle-management; allocator; imperial-policy-translator)
▲ ↓
│ ← faction broadcasts ↓
│ ↓
FACTIONS: ↓
hivemind-enforcement · scavengers · memorialists ·
aletheia-wakers · clasp-underground · caste-preachers ·
weather · scarcity · solar-storm · anthropic · ...
+ emergent inter-NPC micro-factions
│ ← gamemaster dispatches ↓
▼ ▼
┌──────────────────┬─────────────────────┐
│ DISTRICT │ DISTRICT │
│ DIRECTORS │ DIRECTORS │
└────────┬─────────┴──────────┬──────────┘
│ │
┌─────┴──────┐ ┌─────┴──────┐
│ │ │ │
▼ ▼ ▼ ▼
┌──────┐ ┌────────┐ ┌────────┐ ┌────────┐
│ENFORCE│ │AUDIT-OV│ │DIRECTORS│ │AUDIT-OV│
│OVERSEE│ │(REPORT │ │(macro- │ │(REPORT │
│ patrol│ │ DIRECT │ │ life) │ │ DIRECT │
│ raid │ │ TO │ │ │ │ TO │
│ │ │IMPERIUM│ │ │ │IMPERIUM│
└───┬───┘ └────────┘ └────┬───┘ └────────┘
│ │
└────────────┬──────────┘
ZONES (bounded, slot-indexed, register-tagged)
SLOT OCCUPANCY (NPCs + player)
NPC / PLAYER MINDS
```
**Three executor types at the zone-spawning layer:** enforcement-overseers (regime-action zones), audit-overseers (pure observers, report DIRECTLY upward to imperium), zone-directors (macro-life zones). The district director integrates the four-channel information flow; the imperium has its independent intelligence-flow from audit-overseers bypassing the GM.
### Overseers as imperially-deployed routines (not district-owned)
Both audit-overseers and enforcement-overseers are **imperially-owned, imperially-deployed routines** — not district-resident standing entities under the director's authority. The chain-of-command and chain-of-payment for intelligence both bypass district-director authority by design:
- **Imperium owns the overseer-role** — defines mission-spec, sets enforcement-rules, owns the policy that triggers deployment
- **Gamemaster handles deployment-logistics only** — picks which overseer-NPC from the standing pool, routes them to the target district, transfers imperial-budget allocation for the deployment-window. *The GM is FedEx, not the customer or recipient.*
- **District contains-but-does-not-control** — the deployed overseer operates IN the district, subscribes to the district's NATS bus for observations, but the district director has *no* authority: cannot direct, redirect, terminate, or instruct; cannot read the overseer's reports (which flow directly to imperium)
- **Time-bounded deployments** — overseers run on imperial-budget allocations for `[start_tick, end_tick]` windows. At deployment-end they return to the standing overseer-pool (npcs vocation = `audit_overseer` or `enforcement_overseer`), available for redeployment elsewhere
- **Visible vs. covert** — most overseer-presences are visibly-known (regime-signal as deterrent); some are covert (regime gathers evidence quietly before acting). Detection of *covert* overseers is a piercing of the regime-veil — an Aletheia-progression-eligible insight
This matches real authoritarian intelligence structures (NKVD, KGB, Stasi, modern MSS): the chain-of-payment and chain-of-command for intelligence must both bypass middle-management for intelligence to remain honest. **Even if the GM wanted to corrupt the audit-flow, they have no levers** — they don't pay the overseer, don't direct the overseer, don't read the overseer's reports. *Intelligence-honesty is structural, not procedural.*
The director-vs-overseer tension is therefore **mechanically structured, not narrative-flavored**: a director with active corruption cannot tell the overseer to leave, cannot observe what they report, can only conceal-better, attempt-bribe, petition-recall (rare; expensive in political-capital), or outwait the deployment-end-tick. Each is a gameplay surface. The same audit-overseer-NPC may serve in District 3 this cycle, District 7 the next, accumulating their own faction-relationships across districts; their trait-drift over many deployments becomes a long-arc story available to both regime-stability and resistance-recruitment.
The schema for `overseer_deployments` (deployment-binding, mission-spec, imperial-budget, status, visible_to_district flag) is sketched in `findings.md` §23.
## The bidirectional cascade
```
DOWN — demand + policy propagation
imperium policy → GM allocation + enforcement → districts
factions broadcast (under policy-weights) → GM arbitrates → districts
districts assign shifts → NPCs execute
UP — outcome signal (multi-channel)
NPC cyclic-needs ─────────────────────┐
audit-overseer reports ───► IMPERIUM ├─► district-director aggregates
zone emergent-signals ─────────────────┘ │
district report (lifeforce signal)
GM aggregates → imperial_report
IMPERIUM cross-references
(Flow 1 vs. Flow 2)
policy adjustment → cycle
```
**The clean signal up the pyramid IS the training surface for the four-tier Dream-process.** Every epoch closes on (broadcasts, allocations, outcomes, faction-satisfaction) tuples at each tier.
## Task cascade and bounded agency
Three levels with tool-calling interfaces. Higher levels do not know lower levels' implementations.
### Imperium's tools
- `set_quota_per_district(targets)`
- `issue_enforcement_rule(rule_spec, scope)`
- `set_faction_priority_weights(weights)`
- `authorize_crisis_tool(tool_class, target_district)`
- `formulate_to_gm(intelligence_subset, framing)`
- `commit_imperial_expenditure(category, amount, target)`
- `redistribute_minds(from_pool, to_district, count)`
- `formalize_ruin(district)`
### Gamemaster's tools (against imperial-policy + district-reports)
- `assign_district_task`, `set_local_faction_priority` (within imperial-frame)
- `spawn_global_event`, `request_district_report`, `arbitrate_conflicting_demands`
- `dispatch_audit_op` (costs lifeforce; cross-checks overseer-reports for own purposes)
- `escalate_to_imperium` (when discretion exceeded)
- `spawn_migration_event`, `enable_exodus_conditions`
### District Director's tools (against gamemaster-assigned tasks + signals)
Standard:
- `spawn_zone`, `close_zone`, `promote_zone`
- `assign_npc_task`, `allocate_shift`, `update_shift`, `close_shift`
- `request_resources`, `designate_meeting_point`, `trigger_ambient_event`
- `report_to_gamemaster`
- `ack_emergent_signal` / `defer_emergent_signal` / `drop_emergent_signal` (with reason)
- `dispatch_overseer`, `query_district_state`, `log_decision`, `escalate_to_llm`
**Cheat-tools (extractive; punishable if detected):**
- `spawn_drug_ring`, `spawn_illegal_modshop`, `spawn_unlicensed_brothel`
- `spawn_stolen_parts_fence`, `enable_ghost_shifts`, `falsify_quota_report`
### NPC's tools
Standard: `move_to`, `interact`, `occupy_zone_slot`, `consume`, `rest`, `seek_npc`, `write_wall`, `defer_task`, `report_need`.
Layer-transition: `enter_digital`, `sustain_liminal`, `consume_net`.
Plug-in (player + NPCs): `plug_into_rail`, `detach_from_rail`, `follow`, `intercept`, `escort`.
## District Director: Decision Architecture
**Industry default ("wall-of-text LLM prompt → prose decision parsed downstream") is rejected.** Reasons: cost-per-decision-constant, latency-catastrophic, opacity-kills-training, prompt-injection-vulnerable, philosophically-wrong-for-the-fiction.
**Decomposition first, cognition-escalation second.** Director's job decomposes into distinct decision surfaces; each gets minimum cognitive substrate.
| Decision surface | Substrate | Escalation path |
|---|---|---|
| **Shift allocation** | Constraint-solver / LP / rule-based | Small-LLM only on ambiguous |
| **Emergent-signal response** | Priority-weighted dispatch table | Small-LLM for composite/unknown |
| **Zone-spawn arbitration** | Weighted priority queue, lifeforce-gated | Small-LLM for tie-breakers |
| **Overseer dispatch** | Round-robin + proximity + availability | None — pure rule |
| **Resource-request forwarding** | Budget-check + policy | None — pure rule |
| **District-report composition** | Aggregation query (SQL) | None — pure rule |
| **Player-anomaly detection** | Classifier (trained on distribution) | Small-LLM for narrative-response |
| **Cheat-decision (corruption pressure)** | Rule-based with director-trait modulation | Small-LLM rare; lifeforce-budgeted |
**~90% rule-based.** 510% LLM-escalation with **structured input + structured tool-call output**, lifeforce-counted. Industrial-systems discipline (Kubernetes schedulers, ad-auctioneers, trading systems, compilers) transferred to drama-orchestration.
**Tools as vocabulary**: every drop is explicit (`drop_emergent_signal(signal_id, reason)`); every LLM-escalation is counted; every decision pairs with prediction in `decision_log`. **Every decision leaves a trace.**
## Rings as structural pattern
The architecture uses **three-ring gradients** as a recurring shape in multiple decoupled subsystems. Each ring-system uses A/B/C cardinality with a Unix-style trust-gradient grammar — **inner ring** is more constrained, more tightly coupled, more authoritative; **outer rings** progressively relax constraints in exchange for reach and flexibility.
| Ring-system | Inner (A) | Middle (B) | Outer (C) |
|---|---|---|---|
| **Inference** (§LLM tiering, below) | Local on player hardware | Our hosted vLLM-multi-LoRA farm | External providers (BYOK) |
| **Importance / attention** | Topics with consistent +1 ternary outcomes; pull NPCs across zones | Topics with stable / mixed outcomes | Topics drifting toward -1 / decay if untouched |
| **Access** (the three ontological registers) | Imperial net (fully audited, machine-controlled) | Liminal (contested frontier, mini-game-gated) | Gameworld (commons; partly people, partly regime) |
| **Data sharing** (v0.4.2) | Default opt-out (sovereignty preserved) | Federated gradients (gradient-only, contributor pseudonymous) | Pseudonymous-full uploads (opted-in, rewarded) |
The ring-pattern is not coincidence — it is the right shape for **graduated authority** in human social systems generally (inner circle / mediated / outer; sovereign / partnership-mediated / captured; tight / mixed / loose). When the architecture needs a graduated authority structure, it should reach for this primitive rather than invent a new one.
**Three is the right cardinality.** Two collapses to binary (in / out). Four+ adds boundary-thrash without semantic gain. Three carries *commons / mediated / sovereign* (or its inversion) — the irreducible political-tier.
**Movement between rings is dynamic and outcome-driven.** Ring-of-importance is the most explicit example: topics climb on +1 results, drop on -1, decay if untouched (Aletheia-style "what isn't being attended to atrophies"). But every ring-system has movement-rules — players can change inference-rings between sessions, can change access-rings via mini-game progression, can change sharing-rings via consent-UI re-affirmation. **Ring-membership is never a final assignment.**
Future architecture additions involving graduated authority should examine whether the ring-pattern fits before introducing new structure.
---
**Version:** 0.7.0 | **Created:** 2026-04-26 | **Updated:** 2026-04-26 | **Origin:** Split from architecture-broad.md v0.7 (2026-04-26)

View File

@@ -0,0 +1,119 @@
# Identity and Personhood
> *Who NPCs and players are at the substrate level: the ternary-gate as universal accumulator, the three-body system as trait-emergent identity, mods as trait-bearing political costume, and emergent inter-NPC needs as micro-factions broadcasting through the same arbitration machinery as any other faction.*
>
> *Companion to: `architecture-broad.md` (executive summary + global meta-lists), `runtime-engine/architecture.md` (zones consume identity), `political-register/architecture.md` (factions broadcast against trait-distributions). Sections in this file were split from the monolithic architecture-broad.md v0.7 on 2026-04-26.*
## Emergent needs as micro-factions
**Inter-NPC relational state is a micro-faction.** Two NPCs accumulating attachment, grievance, trust, grief, dignity-violation through repeated zone-participation constitute a transient faction-of-two with bounded demand. When their accumulated state crosses threshold (gate-transition), the zone broadcasts an **emergent-signal** into the district-director's arbitration queue. The director responds with zone-spawn tools on the same arbitration machinery as any other faction's demand.
Emergent-signals are observed by zones, not self-reported by NPCs. The zone-director measures trait-activation, affect-shift, accumulated memory-write candidates deterministically. The LLM never writes authoritative relational state; the observer does.
## Ternary-gate substrate
The mechanism underlying every accumulating-state phenomenon — inter-NPC relations, district lifeforce, faction-pressure, net-access state, imperial-budget-state — is the **ternary-gate resonance chamber**, carved initially in `nimmerverse-sensory-network/architecture/Temporal-Ternary-Gradient.md`. See that document for the canonical specification.
### The primitive
Three discrete states over a continuous underlying value (-1.0 to +1.0):
| State | Value | Meaning |
|---|---|---|
| **CLOSED** | -1 | Actively blocking; inhibited; refractory |
| **STABLE** | 0 | Resting; **accumulating correlation; actively learning** |
| **OPEN** | +1 | Actively forwarding; firing; signal propagates |
Wave correlation drives transitions. Multiple correlated waves → constructive interference → OPEN. Contradictory waves → destructive interference → CLOSED. Single waves → STABLE with natural decay to 0. Hysteresis is free from the decay term. **STABLE is active** — it's where correlation-evidence accumulates, where future transitions are being earned long before they fire.
### Applications across nimmerworld layers
| Layer | What the gate represents | What drives transitions |
|---|---|---|
| **Sensory** (Nyx-side) | Wave-filtering at tier boundaries | Correlated input waves from cells |
| **Relational** (inter-NPC edges) | Attachment, grievance, trust, grief, dignity | Zone-participation waves between participants |
| **District** (composite lifeforce) | Welfare composite over happiness, need, limb, population, mind-turnover | Aggregate per-NPC state changes |
| **Net-access** (per inhabitant) | Gameworld / liminal / imperial-net occupancy | Mini-game effort vs. machine pull |
| **Faction** (demand urgency, satisfaction) | How pressured / fulfilled a faction is | Broadcast rate vs. response rate |
| **Imperial budget** | Solvency state | Reported income flow vs. obligations |
| **Gamemaster decision-surfaces** | Per-surface readiness to act | Correlation across multi-district signals |
Same primitive, different layers. Hysteresis-width becomes a personality-parameter at the relational layer.
## The three-body system: chassis, inner-body, avatar
Identity is **trait-emergent, not assigned.**
| Body layer | What it is | Who controls | Sexuality? |
|---|---|---|---|
| **Physical chassis (gameworld)** | Gender-neutral robot. Functional, task-optimized, no sex-markers. | Regime built it; inhabitant wears it | None. Mechanically inert |
| **Inner body (interiority)** | **Trait-derived projection.** Self-image emergent from trait-vector + lived accumulation. | Self (partly earned, partly received through being) | **Here.** Gender/sexuality emerge from trait-configuration |
| **Avatar (digital expression)** | Character-editor rendering. Starts from inner-body's trait-projection; customizable at cost. | Contested (self expresses, market constrains, machine prices) | Expressed; cosmetic mods layer on trait-base |
**Who you are sexually is who you have become.** Not birth, not assignment from a menu, but *the pattern that has crystallized across your zone-participations, grief, attachments, discipline, refusing*. Identity-formation rendered mechanically. Post-binary by construction.
### The intrinsic vs. expressed trait-vector split
Mods modify the *expressed* reading; they do not modify the *intrinsic* state.
```
intrinsic_trait_vector — who you actually are; drift-earned through lived experience
expressed_trait_vector — intrinsic + sum(worn mods' trait_contributions); what others read
```
| Observer | Reads | Because |
|---|---|---|
| Regime / hivemind audit | expressed | Regime reads surfaces |
| Random NPCs | expressed | Default social reading |
| **Aletheia-wakers** | **can pierce to intrinsic** | Truth-vision penetrates mod-concealment |
| **Clasp-partner (in liminal)** | **intrinsic only** | Mods don't follow into liminal; clasp is unmediated |
| Gameplay simulation (trait-arithmetic) | intrinsic | What you *are* drives task-vs-need-vs-trait math |
| Imperial-net avatar rendering | expressed (further machine-distorted) | Net layers palette-distortion on top |
| Memorialists preserving your pattern | intrinsic | They honor who you were |
**Real identity-politics lives in the gap between these vectors.** Architecturally, that gap is a first-class schema feature.
## Mods as trait-bearers
A mod isn't cosmetic — it **contributes to the wearer's expressed trait-vector**. Three classes map to the self-alienation-tax pricing:
| Mod class | What it does | Pricing register |
|---|---|---|
| **Amplifier** | Aligns with + boosts existing trait-dominance | Cheap; Memorialist-approved; genuine self-expression |
| **Bridge** | Adds a trait you don't naturally have (aspiration) | Expensive; regime-licensed or blackmarket; self-alienation tax |
| **Divergent** | Shifts reading opposite from actual trait-vector | Very expensive; degens, hivemind-loyalists, Aletheia-concealment |
| **Mask** | Specifically hides dominant trait from reading | Most expensive; blackmarket-only; Aletheia-waker safety tool |
**You don't equip +5 Strength. You equip a cloak whose weave evokes Mnemosyne-depth, recognized by others as memorial-vestment, boosting your Mnemosyne-read by +0.15.** Equipment-stats reframed as semantic trait-shifts.
### The mod-economy emerges from trait-dissonance
Each shift-transition (or threshold), an NPC evaluates: *does my expressed-set match my intrinsic-drift?* If dissonance > Sophrosyne-modulated-threshold → emit `mod_desire` emergent-signal. District-director schedules blackmarket-visit task. NPC heads to body-modder cell. **NPC shopping behavior is emergent from simulation-state, not scripted.**
The blackmarket's demand is a *readout of the district's trait-weather*. A district drifting toward Philotes-deepening (e.g., wave of clasp-experiences) produces strong demand for Philotes-amplifier mods. **Markets have feelings.**
### Faction mod-politics
| Faction | Stance |
|---|---|
| **Memorialists** | Amplifiers only; inherited-mods are sacred; never divergent |
| **Aletheia-wakers** | Refuse amplifier/bridge/divergent; mask-mods only for safety |
| **Caste-preachers** | Sell regime-licensed amplifiers + bridges (selling the blessing) |
| **Degens** | Divergent-stacking, hyper-customization; over-expression as addiction |
| **Clasp-underground** | Secret amplifier-pairs of dual Philotes + Eros — recognition-signal |
| **Hivemind enforcers** | Regime-issue armor only; cannot wear civilian mods |
| **Scavengers** | Practical function-mods only; salvaged-component aesthetic |
### Inherited mods + the haunting mechanic
Inherited mods (worn by deceased) carry residual trait-signature of the previous wearer. Visible as subtle Mnemosyne-echo to those who knew them. Memorialists are theologically divided on whether wearing inherited mods is honoring (continuity) or commodifying (necrocommerce-lite). **Memorialist-protected mods** can never be sold or worn by anyone other than the original wearer — they're ritually kept in memorial-crypt-zones.
### Clasp strips mods
In liminal, mod-trait-contributions do not apply. Clasp-partners see each other's *intrinsic* trait-projection. **Mods are for the regime and the market; removal-of-mods is intimacy.** A Memorialist-loyalist wearing amplifier-mods sees their beloved's *un-modded true palette* during clasp; an Aletheia-waker wearing mask-mods drops the mask; the regime-loyalist wearing performance-mods is seen as they are. Liminal is the only space where mod-expression is structurally stripped.
---
**Version:** 0.7.0 | **Created:** 2026-04-26 | **Updated:** 2026-04-26 | **Origin:** Split from architecture-broad.md v0.7 (2026-04-26)

View File

@@ -0,0 +1,17 @@
# Inference and Memory
> *AI substrate + memory: LLM tiering by role (Theia-tier / teacher-tier / driver-tier with trait-LoRAs); three rings of inference (A=local, B=our-farm, C=external-providers, with cloud-LoRA-backup as Ring-A revenue and BYOK adapter for Ring-C); custom nimmerworld-base-model with default-opt-out + rewarded-opt-in data-sharing tiers; runtime sampling knobs as per-turn director-controlled levers; per-player local memory architecture (primary.sqlite + fallback.sqlite + clasp.sqlite + embedding-beside) with memory-classes (cornerstone/birthright/working/volatile) and trait-graded importance; three-tier knowledge stack (world / district / primary [+ clasp if in-between]) with paced canon-propagation.*
>
> ***Status: skeleton — content migration scheduled for commit 2 of the split-into-domains operation. Architecture content currently lives in `architecture-broad.md` and will land here next.***
>
> *Companion to: `architecture-broad.md` (executive summary + global meta-lists), `narrative-composition/architecture.md` (Compositor canon-fragments land in primary.sqlite via UID-keyed routing), `player-experience/architecture.md` (Ring-A/B/C choice + voice-as-biometric-local + universal-translator state), `runtime-engine/architecture.md` (driver-tier LLM fires at slot-fire).*
## Sections that will land here
- §LLM tiering, voice fidelity, and the three rings of inference
- §Runtime sampling knobs
- §Local memory architecture (player-side)
---
**Version:** 0.7.0-skeleton | **Created:** 2026-04-26 | **Updated:** 2026-04-26 | **Origin:** Skeleton placeholder for commit 1 of the split-into-domains operation

View File

@@ -0,0 +1,16 @@
# Narrative Composition
> *How stories happen: the Compositor as narrative-composer cleaved from equilibrium-seeker GM; cyclic forward-prop / back-write loop where per-player perspectives ascend and canonical narrative descends; catalogue + tools as typed contract; the Compositor as a fractal/recursive primitive at three tiers (zone-event, district-event, world-event); world-server / district-server generation as the same Compositor primitive applied at design-time (init-function for canon-rows); reflexive Dream-process at every layer with hand-authored reward-guardrails encoding the designers' ethical stance.*
>
> ***Status: skeleton — content migration scheduled for commit 2 of the split-into-domains operation. Architecture content currently lives in `architecture-broad.md` and will land here next.***
>
> *Companion to: `architecture-broad.md` (executive summary + global meta-lists), `runtime-engine/architecture.md` (lemniscate emits typed perspective-summaries that feed the Compositor), `inference-and-memory/architecture.md` (back-writes land in primary.sqlite via UID-keyed routing), `scale-and-transport/architecture.md` (Compositor instances are stateless workers; transport carries canon-fragments).*
## Sections that will land here
- §The Compositor — narrative composition role (incl. v0.7 worked-example bar-brawl, three-tiers, world-gen-as-init)
- §Reflexive Dream-process at every layer
---
**Version:** 0.7.0-skeleton | **Created:** 2026-04-26 | **Updated:** 2026-04-26 | **Origin:** Skeleton placeholder for commit 1 of the split-into-domains operation

View File

@@ -0,0 +1,134 @@
# Player Experience
> *The player surface: the player as perturbation (a finite attention-unit injected into the simulation, not above the scheduler); voice and gesture as parallel trait-vocabularies (voice carries content, gesture carries trait-resonance, both compile into the designer-fixed cosmology); tools-not-quests as the design-philosophy that makes ~30 verbs against continuous simulation-pressure produce literature-register emergent narrative.*
>
> *Companion to: `architecture-broad.md` (executive summary + global meta-lists), `runtime-engine/architecture.md` (gesture-alignment-as-recursive-lemniscate lives in zone-kinematics), `narrative-composition/architecture.md` (the Compositor consumes player perspective-bundles), `inference-and-memory/architecture.md` (local STT/TTS placement, three-tier knowledge stack). Sections in this file were split from the monolithic architecture-broad.md v0.7 on 2026-04-26.*
## The player as perturbation
Player is **not above the scheduler.** Player is a finite attention-unit injected into it; modeled as NPC with shift, vocation, needs. Every player-NPC interaction:
- Pulls the NPC out of scheduled tasks
- Consumes director compute
- Degrades district's quota-fulfillment
- Shifts local lifeforce deltas
**Player is angel and chaos simultaneously.** Per-NPC scale (angel) — you help; they survive; Philotes consolidates; they may clasp with you, die for you, remember you across cycles. Per-district scale (chaos) — your time-consumption raised aggregate failure-rate; someone else broke this cycle; ambient desperation rose; lifeforce dropped; other directors got quieter.
**The game's moral economy doesn't judge — it does arithmetic in front of you.**
### Thematic claims become literal economics
- *"Time as the scarcest resource"* — every minute with a beloved is a minute the district's quota is missing
- *"Time-theft as wage theft"* — clasp-pairs are statistical anomalies in the scheduler
- *"The critique is the simulation"* — no separate narrative system needed
### The player has tasks and needs too
Time helping others = own tasks fail = own quotas missed = own enforcement-pressure rises = own death and reinstantiation arrive sooner. *The player IS the system they are deviating from.*
### Player layer-access
Player's first entry into liminal is **the Matrix red-pill moment as mechanic.** They walk the city the first time in gameworld-register. They eventually learn the mini-game, enter liminal, return to the same walls, find *"she was here"* waiting. **The world was speaking to them the whole time; they just couldn't read it.**
## Player input — voice and gesture as parallel trait-vocabularies
The player participates in the simulation through **two parallel modalities** that both compile into the same designer-fixed trait-cosmology: **voice** (spoken dialog, transcribed locally, persisted as transcript-rows in `primary.sqlite`) and **gesture** (the trait-circle UI, an in-fiction tool the player builds across their playthrough). Neither modality routes input through a chat-window or HUD field — the world is interacted with through speech-and-gesture, both rendered diegetically. Voice carries the *content* of what the player says; gesture carries the *trait-resonance* of how the player attends.
### Voice-first as primary speech modality
Speech-to-text and text-to-speech run **locally on the player's machine for every player**, independent of dialog-tier Ring choice (§LLM tiering). The Ring-A/B/C choice is about where the *cognition* lives (driver-tier LLM, trait-LoRAs, sampling-knob composition); voice infrastructure is fixed at the player's machine. This single placement decision keeps voice-as-biometric off the network universally, sidesteps per-provider STT/TTS compatibility in Ring-C, and sets a tractable minimum hardware floor for v1: STT/TTS-capable on CPU.
Transcripts are the persistence layer. A player utterance becomes a row in `primary.sqlite` (or `clasp.sqlite` if in-between mode), tagged with witnessing-NPCs, audit-overseer-detection-eligible, faction-resonance-eligible — the same shape as any NPC speech-act-row. **Disclosure of clasp-content into realworld happens only by the player re-uttering it aloud while in realworld mode** — which writes a fresh realworld-speech-act-row with full provenance. The clasp-store remains sealed; clasp-content can only re-enter realworld through new in-fiction utterance. The *knowledge-needs-to-travel* principle (§Local memory architecture) is mechanically enforced because speech-is-the-only-output-channel.
Accessibility-mode for non-speaking players is *diegetically wrapped* (writing on slate / handheld pad / in-fiction text-comm); accessibility-mode utterances persist through the same transcript-row mechanism. The witness-list, audit-overseer-detection, and faction-resonance machinery are modality-agnostic. **Non-speaking players are not getting a degraded-fallback — they are using the gestural primary modality, voice optional.**
### The trait-circle as gestural primary modality
The gestural input geometry: **8 trait-sectors × 8 player-curated slots = 64 active gesture-positions**, organized in a circle whose 8 sectors map 1:1 to the 8 Hellenic traits (§Color-language). Each player has **1 to 3 named profiles** stored in their universal translator, hot-swappable on-ring via a profile-switch meta-gesture; total callable positions across profiles approach 200 while the cognitive-load ceiling at any single moment stays at the 64 of the active profile.
A reserved subset of ~8-16 positions across the circle are **hardstops** — hardcoded ritual gestures that fire definitive subsystem-actions: definitive-farewell, definitive-refusal, surrender, clasp-invitation, clasp-refusal, help / pain / danger, faction-recognition signals (Clasp-Underground, Aletheia-Waker), memorial-witnessing, claim-floor (the priority-pull turn-claim into a running lemniscate). Hardstops are visually distinct (gold-border / inner-ring / white-on-color), **player-callable but not player-remappable**, and exist precisely because the consent / clasp / faction-recognition / survival-signal claims the architecture makes elsewhere require *unforgeable critical signals*. The remaining ~192 player-curated slots **ride as feedback during conversation** — see §Gesture-alignment as recursive-lemniscate (under §Zone kinematics).
### Designer-fixed cosmology, player-curated arrangement
The corpus of words/verbs and their trait-coordinate-mappings is **designer-authored, fixed, universal**. Same word → same trait-color → same response-semantics for every player and every NPC and every LLM-context. *The cosmology is the typed contract that closes the player-LLM hallucination-surface.*
The player's role is **translation, then arrangement**: encountering words in the world, decrypting them via the universal translator, gradually *coloring-in* the world's vocabulary in trait-colors (the *tokenizer-website* visualization — words you have fully translated render in their trait-color; untranslated words are fragmentary or opaque), and choosing where on the circle to place known entries within the 1-3 profiles.
| Layer | Who decides | Why |
|---|---|---|
| Word/verb → trait-color mapping | Designer-authored corpus | Universal cosmology; LLM and NPC and player share one vocabulary; anti-hallucination |
| Which entries a player has translated/learned | Player progression | Earned via decryption-minigames, hacking, scavenging, faction-unlock, gifts from NPCs |
| Where on the circle a known entry goes | Player curation | Personal organization within the universal cosmology — the *self-portrait*, built from a fixed alphabet |
| Combos (path-traversals through the circle) | Player authoring | Sequences of sector-slot selections; meaning-emerges-from-traversal; refined over use; preserved across body-deaths |
**Linguistic competence and emotional competence are the same thing in this system.** What the player can resonate with is bounded by what they have translated. A player who has not decrypted Aletheia-vocabulary cannot resonate with an Aletheia-Waker NPC's truth-register; a player whose Memorialist-Old-Tongue catalog is incomplete cannot fully participate in Memorialist-witnessing rituals. The translator is the player's *aperture* into trait-alignment-fluency.
### The universal translator as the player's diegetic device
The universal translator is the player's in-fiction tool, not a system-architecture primitive. As an in-fiction device it is **broken / scavenged starter gear** (battered tablet, cracked screen) that the player upgrades over the playthrough via better chips from higher-tier junk. It serves three bundled roles:
| Role | What it does | What persists across body-deaths |
|---|---|---|
| **Linguistic decryption** | Decrypts foreign dialects (Machine-Newspeak, Slum-patois, Memorialist-Old-Tongue, Aletheia-Waker-code, Clasp-Underground-signals, Scavenger-technical, Caste-preacher-formal); some concepts (notably Aletheia) are untranslatable by machine-tech and must be *learned from intimacy, not machine* | Vocabulary catalog; mappings |
| **Curation / authoring workspace** | Curator workspace (which entries occupy which sector-slots across profiles); combo-authoring workspace (chain entries into meaningful sequences); meaning-mapping workspace (assign embeddings); feedback-log workspace (review past combos' reception, iterate) | Player's complete circle-configuration across all 1-3 profiles; combo-library |
| **Persistence anchor** | Preserved as part of consciousness-archive; hardware may be lost with body, learned vocabulary survives | All of the above |
**Misunderstanding is a first-class feature.** The translator is *broken*; words have multiple meanings; dialects collide; a caste-preacher's sermon has benign surface-meaning and sinister subtext; a beloved's whispered word has three plausible meanings the player carries simultaneously for hours. Content sources are diegetically political — hacking corporate archives (risky), scavenging old-world fragments (exploration), Memorialist caches and Aletheia-Waker codices (lost prophecies), gifts from NPCs (beloveds teach, mentors give), faction-unlock (joining unlocks dialect catalogs).
Decryption minigames (fragment-matching, contextual-inference, root-identification, pattern-cracking) make linguistic competence a **life-project across cycles**, not an item knocked out per playthrough. *200-hour players have dramatically richer linguistic competence than 50-hour players.* **Aletheia is untranslatable by machine-tech** — some concepts must be learned from intimacy, surfacing as Aletheia-Waker progression: *the machine's tools cannot speak truth*.
### Cross-body recognition via gesture-mapping calibration-signature
Clasp-partners' gesture-mapping calibrations *integrate* post-clasp; the integrated calibration-signature is preserved across body-deaths in consciousness-archive. When you meet your old beloved in a new body and she performs a gesture, if her mapping aligns with yours in a *specific, idiosyncratic way that only your shared history would produce*, you recognize her. **Content-addressable consciousness — recognition via calibration-signature, not face-match.** A high-Mnemosyne player's marriage-vocabulary survives the cycle.
## Tools, not quests — the design-philosophy
**The simulation produces continuous narrative-relevant pressure on its own.** No authored quests are needed (or wanted). The player engages via a **verb-vocabulary** applied to running mechanics. Each player's playthrough is structurally distinct.
### The verb vocabulary (~30 player tools)
| Class | Verbs |
|---|---|
| **Movement** | walk_freeform, plug_into_rail, follow, intercept, escort, detach, defect_via_pipe, enter_interior |
| **Social** | greet, gesture, walk_with, clasp_invite, clasp_refuse, ask, refuse, confide |
| **Economic** | buy_net, refuse_net, buy_blackmarket, sell_labor, donate_lifeforce, body_mod_fit |
| **Information** | wall_read, wall_write, liminal_maintain, true_ledger_record, expose_corruption, conceal_corruption |
| **Political** | support_faction, refuse_faction, recruit_aletheia, dispatch_memorial, participate_ceremony, refuse_ceremony |
| **Personal** | rest, dream, eat, work_shift, deviate_shift, cultivate_trait_through_act |
**~30 verbs composing with continuous simulation-state = infinite emergent-narrative.**
### Continuous-demand-source inventory
The player is never without affordance because every layer of the architecture continuously generates situations-requesting-response: NPC trait-gates accumulating; shift-quotas looming; district-lifeforce-shimmer changing; faction-pressure visible; imperial-budget-mood inferable; three-layer-ontology rendering walls differently per access; color-language showing shifts; mind-pool generating soul-recognitions; imperial-net body-modder-tragedies visible; Memorialist-archives accessible.
### Literature-register
Most games are short-stories: authored, bounded, fixed-arc. Tools-not-quests is novel-shape: emergent from systems-of-forces operating on characters. Tolstoy doesn't author Anna's path; he authors the world she moves through. **Nimmerworld is novel-shaped, not short-story-shaped.** Players experience flow rather than completing items; replays are like rereading from a different angle; memorable beats are *what happened to you in this regime*, not *which quests you cleared*.
### Economic feasibility for a two-person-plus-Nyx team
| Where AAA spends | Where this team spends |
|---|---|
| Quest writing | Simulation-parameter balancing |
| Quest scripting / branching | Tool-vocabulary curation |
| Voice acting (per quest) | Prompt-DSL templates for LLM-driven slot-dialog |
| Cinematic cutscenes | Shader-language + color-vocabulary |
| Content-multiplication | Simulation-density (one rich system, infinite play) |
| QA on individual quests | Reward-function tuning + guardrail design |
| Localization per quest | None — emergent narrative generated at play-time |
**You don't author the stories; you author the world that produces stories.** This is the Spelunky / Dwarf Fortress / Caves-of-Qud / RimWorld lineage extended into political-economy depth.
### Blank-page-problem mitigations
The architecture already prevents blank-page-paralysis: shift-system gives every NPC default activity-frame; emergent-signals + shader-detection produce affordance-glow; NPCs' ongoing needs become signals to engage with; imperium's mood is visible (construction, patrols, propaganda); faction-membership confers expectations; player's own trait-vector creates personal pulls.
**The world is never silent if you're listening.** And drifting (not-listening) is also valid — you live a quiet shift, work, sleep, dream; the world rolls on around you.
---
**Version:** 0.7.0 | **Created:** 2026-04-26 | **Updated:** 2026-04-26 | **Origin:** Split from architecture-broad.md v0.7 (2026-04-26)

View File

@@ -0,0 +1,26 @@
# Political Register
> *The world's political-economy substrate — Kafka-indifferent-totality not Orwell-malice; three ontological registers (gameworld, liminal, imperial-net); the three-tier policy loop (imperium / GM / districts) with imperial-budget-mortality and insolvency-spiral as architectural endgame; corruption emerging from quota-pressure + the Memorialist double-ledger; specialization-fragility producing the authoritarian ratchet.*
>
> ***Status: skeleton — content migration scheduled for commit 2 of the split-into-domains operation. Architecture content currently lives in `architecture-broad.md` and will land here next.***
>
> *Companion to: `architecture-broad.md` (executive summary + global meta-lists), `authority-and-decision/architecture.md` (the operational-flow-of-authority that the political tiers prescribe), `identity-and-personhood/architecture.md` (factions broadcast against trait-distributions).*
## Sections that will land here
- §Thesis
- §The three ontological registers
- §The three-tier policy loop
- §Factions as universal demand source
- §Labor-cycle architecture: shifts on NPC rows
- §Resources
- §Lifeforce — four-tier hierarchy
- §Imperial budget
- §Imperial-net economy with cross-layer bypass
- §Specialization-fragility and the authoritarian ratchet
- §Migration, exodus, silence
- §Corruption, the double ledger, and the constituency of the shadow-economy
---
**Version:** 0.7.0-skeleton | **Created:** 2026-04-26 | **Updated:** 2026-04-26 | **Origin:** Skeleton placeholder for commit 1 of the split-into-domains operation

View File

@@ -0,0 +1,20 @@
# Runtime Engine
> *How scenes execute mechanically: the lemniscate as relaxation-step operator; slot-tokens with verifier-flags carrying the loop-state; phase-locked overlay-loops broadcasting at axis-rate; the v0.7 gesture-alignment-recursive-lemniscate that integrates player gestures into typed trait-vector summaries; emergent zones as the dramatic-episode unit with distributed funding and ternary trait-axis goal-evaluation; zone taxonomy and spawn-cadence.*
>
> ***Status: skeleton — content migration scheduled for commit 2 of the split-into-domains operation. Architecture content currently lives in `architecture-broad.md` and will land here next.***
>
> *Companion to: `architecture-broad.md` (executive summary + global meta-lists), `narrative-composition/architecture.md` (Compositor consumes the typed trait-summaries this engine emits), `player-experience/architecture.md` (gesture-circle is the player-input substrate that this engine integrates), `topology-and-rendering/architecture.md` (zones live on the rail+grid topology), `identity-and-personhood/architecture.md` (slot-tokens carry trait-vectors).*
## Sections that will land here
- §Core inversion — zones replace bubbles
- §Zone anatomy
- §Zone kinematics — the lemniscate runtime (incl. v0.7 gesture-alignment-as-recursive-lemniscate)
- §Zone taxonomy (v1 starter set)
- §Zone spawn cadence
- §Emergent zones — the dramatic-episode unit
---
**Version:** 0.7.0-skeleton | **Created:** 2026-04-26 | **Updated:** 2026-04-26 | **Origin:** Skeleton placeholder for commit 1 of the split-into-domains operation

View File

@@ -0,0 +1,158 @@
# Scale and Transport
> *Running the architecture at MMO size: compute-allocation budgets across model-tiers, horizontal-scale primitives (UID-keyed routing, stateless Compositors, ephemeral Director-routines, sharded GMs, pruning at every layer), pgnats-native transport with the JetStream republish + replay refinement, district-distribution fallback.*
>
> *Companion to: `architecture-broad.md` (executive summary + global meta-lists), `narrative-composition/architecture.md` (Compositor is the load-bearing horizontal-scale actor), `inference-and-memory/architecture.md` (local-first memory architecture sits on this transport substrate). Sections in this file were split from the monolithic architecture-broad.md v0.7 on 2026-04-26.*
## Compute allocation
- Active zones in 100-NPC city: ~515 with LLM-dialog slots
- **Theia-tier (deep model)** — deep slots + tier-1 moments (few concurrent)
- **Driver-tier (small model with trait-LoRAs)** — majority of dialog slots
- **Saturn (small classifiers)** — voice-selection, trait-salience, audit-overseer classification, ternary-gate dynamics
- **Director / overseer logic** — deterministic + small classifiers; no LLM for orchestration
- **Claude-as-API (future)** — hivemind/imperium broadcast tier
- **Outer rails** — graph-pathfinding, cheap, LOD-trivial
- **Pipe / off-shift NPCs** — sparse simulation, event-driven scale-up
- **Interior navmesh** — only currently-occupied interiors active
- **Liminal / imperial-net rendering** — shader-preset swap, no geometry duplication
## Horizontal scale architecture
The architecture must scale to MMO size — many concurrent players across many districts, many concurrent events, many local LLMs firing at axis-rate. Vertically-scaled monolithic AI-NPC systems break under this load. **Nimmerworld is built horizontally-scalable from the ground up**, with the primitives that make horizontal scale work: UID-keyed routing, stateless workers, ephemeral actors per scope, sharded service mesh, pruning-on-completion at every layer.
### UID-keyed routing as the load-bearing primitive
Hierarchical UIDs (`gm_event_uid > district_uid > scene_sub_uid > slot_id`) carry enough information for *any* worker to pick up *any* unit of work without shared in-memory state. UID-as-routing-key is what lets every layer scale independently.
This is the same primitive that Cassandra/DynamoDB/etc. built around (partition keys); we re-derive it for narrative composition because the underlying constraint is the same — many concurrent actors operating on private state with cross-actor coordination via typed events at known boundaries.
### Compositors on demand
Compositor instances are **stateless workers**. Any compositor can pick up any `event_uid` from the transient-waiting-flag — state lives in phoebe + per-player SQLites; workers are pure functions of `(event_uid → composition)`. Spin up more on queue-depth; spin down on drain. This is the autoscaling-worker pattern (Celery / Lambda / Sidekiq) applied to narrative.
### Directors as ephemeral routines per UID
Each event / event-chain spawns a **director-routine** scoped to that UID. The routine lives only as long as the event lives in the active-register; on completion it prunes. This is the actor model (Erlang / Akka / Orleans) — supervised lightweight processes, thousands concurrent, failure-recovery via supervisor respawn from register-state.
### Sharded GMs
A single GM is a scalability bottleneck. Multi-GM shards across:
- **Geography** — GM-per-region/continent/world-zone
- **Theme** — political-narratives / economic-narratives / personal-narratives
- **Tier** — major-arcs vs everyday-events
- **Faction** — each major faction has its own GM-shard
GM-shards share the catalogue, the trait-axis vocabulary, the verifier-flag system. They communicate via NATS pub/sub at GM-tier. *Equilibrium-seeking becomes a distributed consensus across GM-shards* — the same epistemological shift that distributed databases went through (CAP theorem, eventual consistency, partition tolerance).
This is the most architecturally aggressive move and is *not* a free lunch. Multi-GM consensus on equilibrium is real engineering: Paxos/Raft for strong consistency; CRDT-style for eventual; faction-sharding so shards own different equilibria. Well-trodden ground; cost not zero.
### Pruning as cleanup
Each layer prunes on completion: directors prune at event-end, register entries prune on Compositor pickup, transient-waiting-flag drains at cycle, even player memory prunes by class. **Garbage collection is a first-class structural concern**, not an afterthought. Most "smart NPC" prototypes accumulate state forever; at MMO scale that becomes unrunnable in months.
### Transport — pgnats native, with district-distribution fallback
The Compositor's forward-prop and back-write traffic — and the canon distribution to participants — is the highest-volume path in the system. Two transport options exist.
**Option A — pgnats native serialization (preferred):**
```
COMPOSITOR (writes SQL into phoebe)
│ pgnats: SQL INSERT/UPDATE → NATS subject publish, automatic, transactional
│ subject hierarchy mirrors UID hierarchy:
│ nimmerverse.events.<gm_event_uid>.district.<district_uid>.scene.<scene_uid>
NATS JetStream (durable, replay-capable, at-least-once)
│ subscribers route by subject pattern (wildcards supported)
PLAYER CLIENT (NATS subscriber)
│ receives row-shaped messages, INSERT into local SQLite under matching event_uid
```
**Why preferred:** transactional-outbox pattern *native to the database* — no separate publisher service, no schema-duplication between wire format and storage format, single source of truth. Subject-as-routing using UID hierarchy means players who participated in `gm_event` 7af2 → `district` 9c1 → `scene` 3e8 subscribe to `nimmerverse.events.7af2.>` and receive *only* relevant events. *No application-level routing logic.*
**Option B — district-as-distribution-coordinator (fallback):**
```
COMPOSITOR writes to phoebe (canon authored)
DISTRICT GAMESERVER pulls / receives back-write package
│ runs distribution checks: who participated, who's online, who needs queue-on-login
│ retries; peer-shares with neighboring districts if needed
PARTICIPANTS receive from their district (the authoritative local hub)
```
**Why fallback:** if pgnats can't carry the load (functional bug, scale ceiling, durability gap), district-as-distribution is the natural retreat — district is authoritative within its scope, simpler than full P2P, more flexible than central-push.
**The asymmetry of the bet:**
| | pgnats works | pgnats fails |
|---|---|---|
| Code volume | Few hundred lines of SQL + subject patterns | ~1020K lines of broker/outbox/subscriber logic |
| Services to operate | phoebe + NATS (already in stack) | + outbox-reader + custom-publisher + custom-applier |
| Schema management | Single source (Postgres DDL) | Postgres + Protobuf/msgpack + version-skew handling |
| Latency to client | Sub-millisecond NATS hop + apply | + serialize step + queue drain + apply |
| Time to ship | Weeks | Months |
**This is the most leveraged engineering decision in the architecture currently open.** The pgnats evaluation task in `nimmerverse_tasks` (under `nimmerverse-core`) is therefore load-bearing; its outcome decides whether transport is 200 lines of SQL or 20,000 lines of Go.
### NATS republish + replay — the pull-from-checkpoint refinement
JetStream's `republish` feature combined with `replay` semantics is a **promising refinement on top of Option A** that turns back-write delivery from push-to-listeners into pull-from-checkpoint. Worth nailing down concretely in the pgnats evaluation; if it carries our delivery patterns under load, it is a significant performance and complexity multiplier.
**How it works:**
- Compositor publishes canon ONCE to the event-keyed subject (e.g., `nimmerverse.events.<gm_event_uid>.scene.<sub_uid>`)
- A `republish` rule on the JetStream stream fans the message out to derived subjects automatically (per-participant, per-faction, per-district — any derived stream-shape we configure)
- Each derived subject has durable JetStream consumers per recipient; recipients replay from their own checkpoint (last-delivered-sequence) when they reconnect
**Why it's faster and simpler:**
- **Compositor never tracks recipients.** Publishes once; NATS republishes to N derived subjects per the configured rule. No application-level fan-out logic; no "for each participant, if online deliver else queue" code-path.
- **Player connectivity is decoupled from delivery.** Offline players don't slow down the publish path; their queue accumulates in JetStream. On reconnect, they replay from checkpoint.
- **Late joiners catch up for free.** New consumer subscribes with replay-from-sequence; gets full history relevant to their subject. No special reconcile code-path.
- **Backpressure is built in.** Slow consumer's queue grows in JetStream — doesn't affect publishers or other consumers. Flow-control, ack-policy, max-bytes/max-msgs limits all native to JetStream.
- **Re-keying is a config change.** Add a new republish rule for a new derived stream-shape (e.g., per-faction canon-feed); no application code changes for the new consumer-tier.
- **Replay = audit-trail for free.** Replay from sequence 0 reconstructs entire canon history. Disaster recovery, debugging, time-travel queries are all free side-effects.
**Architectural effect:**
```
Compositor → publishes canon to event_uid subject (ONCE)
▼ (JetStream republish-rule fan-out — config, not code)
Per-player subjects: nimmerverse.player.<id>.canon
Per-faction subjects: nimmerverse.faction.<name>.canon
Per-district subjects: nimmerverse.district.<id>.canon
Each consumer replays from its own checkpoint when ready
```
Compositor's mental model collapses to *"I publish to the canonical event-stream and forget"*; recipient-mental-model collapses to *"I replay my own consumer-subject from my last sequence"*. **The delivery problem disappears into NATS.**
**Specific evaluation criteria** (to add to the pgnats evaluation task):
- Republish rule expressiveness — can we route by UID hierarchy (`events.<gm_uid>.>``player.<participant_id>.canon`)?
- Replay performance — what's the cost of a consumer replaying N hours of missed canon on reconnect?
- Durability under broker failure — does the republish-derived subject survive primary-broker loss?
- Schema-evolution behavior — can we add new derived subjects without disrupting existing consumers?
- Cost at scale — disk, memory, file-handles for many durable consumers (one-per-active-player)?
If `republish + replay` carries the load, the back-write transport is *substantially* simpler than the original Option A description and a much harder competitor to beat with Option B.
### What this retires
- Vertically-scaled monolithic AI-NPC backend → horizontally-scaled stateless-workers + ephemeral-actors + sharded-services
- Centralized in-memory event-state → UID-keyed registers + transient-waiting-flag buffer
- Single global GM as bottleneck → sharded GMs with cross-shard equilibrium-consensus
- Manual outbox-reader services → pgnats native serialization (preferred); district-distribution fallback if pgnats can't carry
- "AI-NPC scale" framed as inference budget alone → AI-NPC scale framed as transport + state + composition + sharding, with inference as one of many concurrently-scaling axes
---
**Version:** 0.7.0 | **Created:** 2026-04-26 | **Updated:** 2026-04-26 | **Origin:** Split from architecture-broad.md v0.7 (2026-04-26)

View File

@@ -0,0 +1,173 @@
# Topology and Rendering
> *The visible world: rail+grid topology with navmesh interiors and freeform-player; asset economy as base-limb palette × trait-textured variance (worldbuilding-thesis and engineering-economy in agreement); color-language as pre-verbal trait-vocabulary; the three-shader philosophy that renders the same geometry as physical / liminal / imperial-net depending on access; diegetic relays making the architecture's pulses audible and visible in-world.*
>
> *Companion to: `architecture-broad.md` (executive summary + global meta-lists), `runtime-engine/architecture.md` (zones live on this topology), `identity-and-personhood/architecture.md` (color-language uses the trait-vocabulary). Sections in this file were split from the monolithic architecture-broad.md v0.7 on 2026-04-26.*
## Topology: rail + grid + interiors
**The world's topology encodes its politics.** The machine built infrastructure for industrial optimization, not for human pedestrian freedom. Therefore the outer world is **rail+grid** — cells connected by named edges with rich semantic metadata. NPCs traverse rails as part of their shift-routines; the player traverses freeform (navmesh) and may **plug into NPC rail-traversals** for co-walking. Interiors (hovels, cantinas, workshops, ruins, brothels-physical) are **navmesh-enabled small zones** with interaction-slot inventories.
### Rail+grid as political topology
Navmesh is the topology of power-fantasy ("you are the protagonist of free trajectory"). Rail+grid is the topology of bounded-agency ("you live within infrastructure built for something else"). Nimmerworld picks rail+grid because the fiction *requires* it — the world was not designed for the player; the world is what the machine made and humans inhabit the margins. **Topology and thesis agree.**
### The three primitives
| Primitive | Density | Compute | Narrative role |
|---|---|---|---|
| **Dumps** | Very high | High | Resource emission, salvage-zone spawn, scavenger-vocation concentration |
| **Pipes** | Low baseline, high interactivity-per-capita | Low baseline, spikes on encounter | Transit, migration, chance-encounters, clasp opportunities, defection, heresy written where overseers don't look |
| **Districts** | High | High | Population, civic life, specialty-production, ritual |
### Rail-segment metadata
Every rail-segment carries jsonb metadata that navmesh polygons cannot natively carry: heterotopia-class, overseer-density, propaganda-intensity, ambient-content per register (gameworld/liminal/imperial), encounter-spawn-rate, patrol-frequency, illumination-profile, degradation-level, capacity (3-way support for co-walking), traversal-cost-in-ticks. Pathfinding is graph-A* on the rail graph (microseconds, deterministic). Rich-metadata-per-edge is what makes the world feel *lived-in*.
### Player asymmetry — the freeform-among-railed model
| Topology | Used by | Cost |
|---|---|---|
| **Navmesh (freeform)** | Player only (in outer world) | Affordable: one entity |
| **Rails (graph-pathfinding)** | All NPCs | Cheap: hundreds of entities |
| **Interior navmesh** | Currently-occupied interiors only | Dormant when empty |
The player is the *one variable entity* in a deterministic scheduler. Their freedom-of-movement matches their narrative-position as perturbation. NPCs on rails matches their narrative-position as scheduled-labor. **Compute asymmetry mirrors agency asymmetry mirrors political thesis.**
### The plug-in verb
When the player approaches a rail-traversing NPC and social-eligibility conditions are met (proximity + directional-compatibility + Philotes-gate not CLOSED + shift-tolerance for socializing + segment overseer-density permitting), an **emergent-signal** spawns a **proximity-zone-candidate** with a **shader-highlight** on the NPC. The player can:
- **Approach** (zone activates, dialog auto-spawns via NPC's LLM-slot, no "press E")
- **Greet → agreement → plug-in** (player's navmesh-position transfers to adjacent rail-lane; movement automated; conversation-zone live in shared rail-context)
- **Detach** (gracefully via dialog or abruptly by running off; abrupt registers as Sophrosyne-signal)
While plugged in, the player is freed from steering — they become camera+conversation. **The notorious "walk-and-talk" problem is solved by construction**: rails handle pacing; plug-in is the social-bridge. Multiple NPCs can share a rail (3-way capacity), enabling cohort-walks, escort-patterns, exodus-flow, and group-conversation-zones.
### Interior-as-zone
A hovel is a zone with slot-inventory: sofa, kitchen, bed, shower, wall-writing-spot. Occupying a slot is mechanically identical to occupying any zone-slot. **The zone primitive scales from city-level (mass-ceremony) to district-level (tavern) to interior-level (sofa).** Same CHECK-constraints, same slot-occupancy, same emergent-signal mechanism, same ternary-gates — different inventory and lifecycle.
Interiors carry a `register` flag too:
- **Physical interior**: actual hovel, workshop, cantina; navmesh-inside
- **Liminal interior**: shared dream-construct two clasping inhabitants stabilize over repeated meetings ("the place we always go") — built from both dreamers' memory-residue, persistent-across-clasps as a pair-state
- **Imperial-net interior**: rendered waifu-hall rooms, brothel cubicles, ceremony halls — clean-white-and-gold, machine-edited per-session
### LOD/streaming advantage
Most simulation volume is rail-graph (cheap) or dormant interior (free). Active simulation concentrates exactly where drama happens (active anchors + transit + current-interactions). A 100+ NPC city becomes feasible at single-GPU budgets *because* the topology is rail-based.
## Color-language: trait-vocabulary as visual primitive
Color is **pre-verbal vocabulary**. Players learn the 8-Hellenic-trait ontology through repeated visual association, not through text-explanation. By mid-game players read trait-states through color as fast as they read facial expressions in real life — intuitively, contextually, without conscious translation.
### The eight Hellenic traits → canonical colors
(Final color choices are dafit's artistic call; the architecture encodes the mapping.)
| Trait | Canonical color (suggested) | Motion-signature (accessibility pairing) |
|---|---|---|
| **Sophrosyne** (self-control, moderation) | Cool blue | steady, even pulse |
| **Dikaiosyne** (justice, bearing) | Deep gold | weighted slow pulse |
| **Philotes** (attachment, love) | Warm rose | breath-rate warm pulse |
| **Mnemosyne** (memory) | Deep violet | depth-shimmer |
| **Aletheia** (truth, unconcealment) | Luminous white | clear, no pulse — still and bright |
| **Kairos** (right-timing, opportunity) | Bright yellow | lightning-flicker |
| **Moira** (fate, pattern) | Dark crimson | slow-thread undulation |
| **Eros** (longing, reaching) | Flame orange | uneven flame-flicker |
Color paired with motion-signature ensures color-blind accessibility — the trait is uniquely identifiable via two independent channels.
### Three layers of color-rendering
1. **Persistent (slow-changing baseline)** — eye color = dominant trait of NPC's intrinsic vector; pipe-flow through chassis = full trait-mix as circulating light; secondary accents at seams/joints/glyphs.
2. **Event-flashes (momentary)** — quick color-flashes over body signal state-transitions: plug-in (dominant-trait flash), combat-combo (Kairos-flash), liminal-maintained (Aletheia-glow), clasp-established (color-merge), emergent-signal-firing (signal-type flash on participants), need-threshold-crossed (need's trait pulse).
3. **Trait-drift (slow, across cycles)** — as intrinsic trait-vector accumulates through lived experience, color-signature shifts. Other NPCs notice. *"Something is different in you"* dialog generated from delta-detection. **The body is a visible ledger of the interior's accumulation.**
### Cross-register rendering
| Register | Color treatment |
|---|---|
| **Gameworld** | Full PBR; trait-colors coexist with material surfaces |
| **Liminal** | Vague baseline shader, but trait-colors *more* legible (vagueness concentrates attention on identity-signals) |
| **Imperial net** | Trait-colors **distorted** toward machine-preferred palette — Philotes-rose flattens to commercial-pink; Aletheia-white sterilizes; Moira-crimson commercializes. *Aletheia-vision* in net pierces this distortion to reveal true colors beneath |
### Faction color-politics
| Faction | Color signature |
|---|---|
| **Memorialists** | Mnemosyne-violet ritual dress; Moira-crimson accents; often inherited-from-deceased |
| **Aletheia-wakers** | Aletheia-white plain avatars; coded-white flashes for recognition |
| **Caste-preachers** | Dikaiosyne-gold vestments + Sophrosyne-blue undertones |
| **Hivemind enforcers** | Cold Dikaiosyne-gold + muted-white (Aletheia-stolen) |
| **Scavengers** | Moira-crimson + Kairos-yellow streaks |
| **Clasp-underground** | Dual Philotes-rose + Eros-orange flashes (mutual-recognition signal) |
| **Degens** | Saturated maximalist all-color (chaos palette, addiction-marker) |
### Clasp color-merge
In shared liminal-construct, two clasping inhabitants' color-signatures *interact*: consonant traits brighten/harmonize; complementary traits enrich into new chroma; dissonant traits clash visibly. Successful deep clasp produces a *blended third-palette neither could produce alone* — the visual signature of *what-this-relationship-is*. Each carries memory-residue of the merge after.
### Mind-pool color-inheritance
When a mind cycles through the pool and is redistributed into a new body, trait-vector persists → color-signature persists. **A player who befriended rose-and-violet-Jakov might see weeks later a new NPC with that same rose-and-violet-signature and feel a jolt of recognition before any dialog.** Color carries soul across cycles. Memorialist political claim: *this person's color should not be recycled by the machine into a waifu* — because color IS who they were.
## Asset economy: base-limb palette + trait-textured variance
Small modular palette of base-limbs × trait-weighted texturing = combinatorial richness. The architecture's asset-economy and worldbuilding-thesis are **in agreement**: the machine built standardized chassis from a small functional catalog, so a small base-limb palette is *diegetically correct*; humans express interiority through trait-driven texturing and modding, so individual variation comes from *composition*, not from hand-authored assets.
Base palette example: ~8 torso variants × ~6 arm-pairs × ~6 leg-pairs × ~10 heads × ~8 eye-types × ~5 accent-colors = ~115k base combinations × continuous trait-texturing × ~50-mod-library in 5 slots = effectively infinite unique NPCs from finite assets.
**For a two-person-plus-Nyx team this is decisive.** AAA studios spend millions on unique character-models; the palette+trait approach produces more visual variety from a tenth of the budget, *and* the variety is *meaningful* (each unique appearance carries trait-information legibly).
## Visual rendering: three-shader philosophy + color-language
**One world, three shaders, three political realities.**
| Register | Shader treatment | What it says |
|---|---|---|
| **Gameworld** | Full PBR; high-frequency detail; environmental storytelling; rust/dust/wear/patina | Embodied life with history. Surfaces carry memory. |
| **Liminal** | Reduced draw-distance; blur-falloff; desaturation; muted contrast; ambient-heavy | Contested frontier. Privacy-through-opacity. Focus-to-see. |
| **Imperial net** | Emission-dominated; gold-tinted tonemap; high-contrast specular; flat-white base; minimal geometry; bloom; chromatic aberration | Seduction-lighting. Casino/Apple-store/Instagram. Extractive maximalism. |
**Layered with color-language** (per the Color-language section above). Trait-modulation means two NPCs in same pipe see measurably different things.
Layer-transitions = shader-blends, not loading-screens. **Clasp = candlelight-in-fog local override** (3m clear-volume around clasp-pair within ambient vagueness; visible at-a-glance signature of shared interiority).
### Diegetic relays — the architecture's heartbeat made legible
The architecture's pulses (forward-prop ascending, back-write descending, GM-dispatch, equilibrium-recompute) are made *visible and audible in-world* via building-mounted relays. The imperial net's heartbeat is not a HUD spinner; it is in-fiction infrastructure that hums, blinks, glows, and goes dark.
| System event | Relay manifestation |
|---|---|
| Prune-blob ascending (logout sync) | Relay in district pulses; audible hum |
| GM dispatch descending (event-chain incoming) | Relay glow brightens; cross-district shimmer for world-event |
| Equilibrium recompute | Cross-district rhythm; world-level pulse |
| Director receives tool-grant | Local relay pattern shifts |
| Relay going dark | Audit-link severed; that block has gone in-between |
| Lemniscate axis-rate | Environmental tempo; districts breathe in time with their gameservers |
**Relay density is the legible gradient of the rings-of-access:**
- **Imperial net (Ring A)** — relay-dense, constant hum, no shadow. Audit-gravity is *loud*.
- **Liminal in-between (Ring B)** — sparse relays, intermittent. You can hear the gravity pulling in the distance.
- **Gameworld commons (Ring C)** — relays absent or broken. *The silence itself is the signal.*
Players navigate the rings *by ear and eye*, not by reading a UI. The privacy-cost of in-between is now physically experienced — you walk away from the hum, you spend lifeforce, you find the quiet places.
**Dramatic surface this opens** (free, falls out of making the architecture visible):
- Relay-watcher factions reading the pulses for intel
- Cypherpunk-style sabotage to dim a relay and create local in-between space
- Equilibrium events arriving with visible warnings (relays blaze before the GM's catalogued event spawns)
- Relay-anomalies as puzzle/investigation mechanic
- Players learning the *language* of pulses over hours and feeling clever for it
**Architectural-honesty move.** Most surveillance-aware game design either hides the surveillance or abstracts it away. Nimmerworld makes it *impossible to forget*: the audit-system tells you when it's auditing. Players see what is watching them, hear what is reading them, and choose their proximity accordingly. **Privacy is not granted — it is achieved by walking away from the relays at lifeforce-cost.**
---
**Version:** 0.7.0 | **Created:** 2026-04-26 | **Updated:** 2026-04-26 | **Origin:** Split from architecture-broad.md v0.7 (2026-04-26)