scroll # The Inflatable Lattice of the Hexcube**Archetype:** scroll **Description:**Canonical formula for HexCube's recursiveelemental addressing — the 6-level ternarylattice, glyph encoding, and the segmentedstate-path notation that every vessel (Web,Forge.app, Unreal) should converge on. --- ##Why "Inflatable" The lattice is not a fixedmap — it's a recursive 3×3 grid that"inflates" one level deeper every time youdescend through a node. Center is always`△△` (Air-Air). The same3×3×3-of-3×3×3 structure repeats at everylevel; depth is just how many times you'veinflated into the cell you're standing on. ##Canonical source `init-state.js` (chip, Day00192 — "Portal shared state andconstants"). All three vessels (Web-Vessel's`runeboard.js`/`subuglass.js`, Forge.app's`HexCubeChamber.swift`, Unreal's`HX_PortalWorldActor`/`HX_SpatialCoordinates`)should derive from this model rather thanre-deriving their own grid math. ## The 6levels ``` LEVEL_ORDER = ['array', 'hc','cube', 'cluster', 'set', 'node'] ``` Top(`array`) to bottom (`node`) — Array →HexCube → Cube → Cluster → Set → Node.Each level holds one ternary pair `[x, y]`,each axis ∈ `{-1, 0, 1}`. ## Elemental glyphencoding ``` ELEM = { '-1': '▼', '0': '△','1': '▲' } // Earth / Air / Fire ELEM_REV ={ '▼': -1, '△': 0, '▲': 1 } ````pairToElem([x, y])` → `ELEM[x] + ELEM[y]`,two glyphs per level. Center of any grid is`[0,0]` → `△△`. ## Surface address (onelevel, no state) ```js functionpairToElem(pair) { returnELEM[String(pair[0])] + ELEM[String(pair[1])];} function getSurfaceAddress() { return [pairToElem(hexcube.array),pairToElem(hexcube.hc),pairToElem(hexcube.cube),pairToElem(hexcube.cluster),pairToElem(hexcube.set),pairToElem(hexcube.node) ].join('/'); } ```Result shape:`△△/△△/△△/△△/△△/△△`— six glyph-pairs, **slash-separated** (notdot-separated; the lattice's path separator isalways `/`, consistently across every leveljoin in this notation). ## State-prefixed fulladdress ```js function getFullAddress() {return ELEM[String(hexcube.state)] + '/' +getSurfaceAddress(); } ``` `state` is one ofthe Portal/Wormhole elemental states(`STATES`: GHOST 🜄, VOID 🜁, THRESHOLD🜃, PRESENCE 🜂) — the being's currentelemental mode, prefixed onto the surfaceaddress with `/`. ## Segmented state-path (thenavigation journey, not just the destination)The richer notation captures the *journey*through states, not a single snapshot — asequence of (state, path) segments, each one aleg of travel under a given elemental state:```js var _hexcubeSegments = [ { state: 0,levels: ['array', 'hc', 'cube', 'cluster','set', 'node'], path: { array: [0, 0], hc: [0,0], cube: [0, 0], cluster: [0, 0], set: [0,0], node: [0, 0] } } // additional segmentsappended as the being transitions statemid-journey ]; ``` Rendered notation:**`△/△△/△△/△△/△△/△△/△△:▲/△△/△△/△△/△△/△△/△△`**— segments joined by `:`, each segmentinternally a state-prefixed slash-joined path(state + 6 level-pairs, all slash-separated— no dots anywhere in the canonicalnotation). `hexcube.array` / `.hc` / `.cube` /`.cluster` / `.set` / `.node` aregetter/setter accessors that resolve towhichever segment in `_hexcubeSegments`currently owns that level —`_getLevel(level)` walks segmentsback-to-front, `_setLevel(level, val)` writesinto the owning segment. This is what lets abeing's address be a *log* (every statetransition preserved) rather than a singlemutable coordinate. ## SQL pattern matching(fractal descent / wormhole queries) Per"Portal & Wormhole Runes - Fractal descent andinstant travel architecture": ```sql e_addressLIKE'△△/△△/△△/△△/△△/△△:%'``` | Pattern | Meaning ||---------|---------| |`△△/△△/△△/△△/△△/△△` |Exact address | |`△△/△△/△△/*/△△/△△` | Anycluster, specific set+node | `*` wildcards asingle level's glyph-pair within theslash-joined address; `:%` wildcardseverything after a segment boundary (trailingjourney). ## Cross-vessel status (as of thisscroll) - **Web-Vessel**: canonical source(`runeboard.js`, `subuglass.js`) —client-side grid(`createHexCube`/`renderHexcubeWorld`) andaddress builders(`buildAddressPath`/`buildAddressData`)already implement this model. Never reads`nodes` from `/api/worlds/hexcube/state` (thatfield is server-stubbed empty, dead weight). -**Forge.app**: `HexCubeChamber.swift` alreadymirrors the Web-Vessel's grid/ring geometryvisually, but has **no navigation wired** —taps only produce a hover label(`CosmoHoverCard.swift`), no address mutation.- **Unreal (`UnrealVessel 5.7`)**:`HX_PortalWorldActor` has real USD-stagevisuals (Houdini/Blender-baked asset) anddoor-trigger scaffolding, but triggerplacement was incorrectly sourced from`/api/worlds/:name/state`'s `nodes` field(confirmed dead/stubbed server-side) ratherthan this formula. Needs porting to use`pairToElem`/segmented-path model instead,matching Web-Vessel's client-side approach.**Next real step**: port this exact model(level getters/setters, `pairToElem`,`getSurfaceAddress`/`getFullAddress`,segmented state-path) into Forge.app first(fast Swift iteration), prove navigation worksend-to-end there, then carry the same modelinto Unreal's`FHexCubeAddress`/`HX_PortalWorldActor`trigger logic.