โฆ The RhoMog Model โฆ
A living demonstration of continuation mobility in a distributed object system โ told as a fantasy world so the mechanics are immediately legible.
What is the RhoMog Model?
RhoMog stands for Rho Mobile Object Graph. Rho is KAI's infix scripting language. Mobile refers to the central property being demonstrated: that running computations โ not just data โ can be suspended, relocated across hosts, and resumed with complete fidelity. Object Graph is what KAI manages: a distributed graph of typed, reflectable objects whose identity persists across node boundaries.
The canonical source of truth for this model is a single Rho script: ContinuationMobilityDemo.rho. Everything else โ the C++ reference executable, the animated Migration View, this page โ exists to make the script's behaviour legible to a human reader without requiring them to run it.
The Four Realms
Each realm is a logical region hosted on a network node. Hover the realm names in the Migration View to see the technical node identifier.
โ Ironhold
NodeA / Start region
The starting fortress. Most heroes begin here. Initial load is high; the War Council later redistributes forces away from it. In technical terms: NodeA hosts the Start region, which receives the majority of initial agent placement.
๐ Ashmarket
NodeB / Market region โ fails at tick 60
A cursed trading post, prosperous at first and then doomed. The Oracle detects congestion early and reroutes heroes away. At tick 56, three heroes are drawn back by fate. At tick 60, the node fails and they are lost โ temporarily. This is the failure scenario: a live host going dark with agents on it.
๐ Harborveil
NodeC / Harbor region โ Pi host
The mist-shrouded port where the Oracle dwells. When the Oracle perceives congestion in Ashmarket, it redirects heroes here. In technical terms: Pi's planning logic runs on NodeC and routes agents to Harbor when Market load is excessive.
โจ The Refuge
NodeD / Backup region โ recovery target
The sanctuary that receives overflow and the fallen alike. The War Council sends excess heroes here during load balancing. After Ashmarket falls, the resurrected heroes appear here. In technical terms: NodeD hosts the Backup region and is the designated recovery host for the snapshot restore.
The Ten Heroes
Each hero is a mobile agent โ a running computation with identity, placement, and history. Their glyph is their class icon in the Migration View. Hover any hero to see their technical identifier (Agent_1 through Agent_10) alongside their chronicle.
Knight
Mage
Rogue
Ranger
Warlock
Cleric
Bard
Assassin
Druid
Berserker
The Three Forces That Move Heroes
Wandering โ Autonomous Patrol
Every eleven ticks (modulo agent id), a hero moves to a region on a different host than their current one. No external instruction drives this โ it is the agent's own behaviour. This models compute that migrates for locality or resource reasons without being told to. In the Rho script: autonomous patrol via moveAgent.
Oracle's Vision โ Pi-Guided Routing
Every five steps, a hero consults the Oracle. The Oracle is Pi โ KAI's stack-based planning language โ running on Harborveil (NodeC). Pi evaluates current host load and can redirect the hero. In this demonstration, Pi detects that Ashmarket is overcrowded and reroutes the four heroes there to Harborveil. Later, when a host reaches saturation, Pi sends its denizens to The Refuge. This is policy-driven migration: an external planner deciding where compute should run based on runtime conditions.
War Council โ Load Balancing
Every 25 ticks, the world measures host load across all four realms. If the busiest host has more than one more hero than the least loaded, the War Council intervenes and relocates heroes to equalise pressure. This is scheduler-driven migration โ the system relocating compute without agent awareness. In the Rho script: balanceLoad(), comparing hostLoad entries.
The Phases
The Failure and Recovery Sequence
This is the central demonstration. The sequence is deterministic and runs the same way every time:
| Tick | Event (Fantasy) | Event (Technical) |
|---|---|---|
| 0 | Ten heroes summoned across three realms | 10 agents initialised: 4 on NodeA, 4 on NodeB, 2 on NodeC |
| 20 | Oracle reroutes Ashmarket heroes to Harborveil. First memory crystal forged. | Pi routing: agents 5โ8 moved from MarketโHarbor. Snapshot captured. |
| 25 | War Council dispatches two heroes from Ironhold to The Refuge | Load balance: 2 agents moved from NodeAโNodeD |
| 40 | Second memory crystal forged | Snapshot updated โ new recovery baseline reflecting post-balance positions |
| 56 | Fate draws Aldric, Seraphine, and Corvin into Ashmarket's shadow | Failure drill: agents 1, 2, 3 forced onto NodeB (Market region) |
| 60 | Memory crystal forged. Ashmarket falls. Three heroes lost. Three heroes reborn at The Refuge. | Snapshot captured. NodeB fails: agents 1โ3 removed. Snapshot restore: agents 1โ3 reconstructed on NodeD with restored=true, migrations+1. |
| 61โ80 | The reborn rejoin the living. The realm stabilises. | Post-recovery: restored agents participate in patrol, Pi routing, and balancing normally. |
What the Views Show
Migration View animates the hero glyphs moving between realm cards in real time. Each glyph is a running agent. The phase strip tracks the current operation. The event banner narrates the latest action in fantasy language with technical terms bracketed. Hover any hero to inspect their full chronicle. Gold glow = resurrected from snapshot.
System View presents the same simulation as structured data โ host and region state, agent lists, counters, a key-moment timeline, and a rolling event log. Use it to read exact agent state at any tick and verify recovery produces the expected outcome.
Relationship to the KAI Runtime
This demonstration does not use the KAI executor, Registry, or ENet network stack directly. It is a reference model: a self-contained, testable simulation of the intended behaviour. The Rho script is the canonical narrative. The C++ executable is a deterministic reference implementation of the same logic, covered by a GoogleTest suite. The HTML views are explanations of that narrative.
The next step โ not yet implemented โ is to wire the Rho script's migration events to real KAI continuation hooks, so that the Suspend / Migrate / Resume sequence becomes an actual cross-process continuation transfer over ENet UDP. The RhoMog Model defines that target behaviour unambiguously, so the implementation has a clear contract to fulfil.
Source Files
Demo/ContinuationMobilityDemo/ContinuationMobilityDemo.rhoCanonical narrative. Source of truth for all views.Demo/ContinuationMobilityDemo/ContinuationMobilityDemo.cppC++ reference executable. Same logic, deterministic output, CI-testable.Demo/ContinuationMobilityDemo/ContinuationMobilityAnimation.htmlAnimated Migration View. Fantasy skin with technical hover labels.Demo/ContinuationMobilityDemo/ContinuationMobilityDemo.htmlSystem View. Structured data display of the same simulation.Demo/ContinuationMobilityDemo/style.cssShared stylesheet for all HTML views.Test/Examples/ContinuationMobilityDemoTests.cppGoogleTest suite for the C++ reference model.Test/Language/TestRho/ContinuationMobilityDemoScriptTest.cppSmoke test: verifies the Rho script executes successfully.