shapes
The store layout: layer zero.
Module nuspace.shapes.
The store layout: layer zero.
Imports nu and nustd.kv and nothing of nuspace, so everything above
reads it and it reads nothing back. Two stores, each its own root and tag.
Space, what the space is:
Space
planes id -> Plane
<p>
name, meta
props system, ui, made_by, backend
cells [cell id], in order
children [plane id], in order
parent plane id, "" at the top level
version +1 on every write to one of its cells
cells id -> Cell
<c>
name, prog, version, meta
props made_by, has_ui
plane the plane it is on
top [plane id], the top level planes, in order
kernel
runs id -> Run, every plane run ever, its cell runs and live workers inside
running {run id}, live
workers id -> Worker, every worker ever
workers_running {worker id}, live
planes_running plane id -> {run id}, live, of planes with any
connections id -> Connection
state SpaceState
recents [plane id], newest first
info path, opened, versions
pinned [plane id], in orderStates, what the programs remember, by the same ids:
States
planes id -> PlaneStates
<p>
state PlaneState shapes, rerooted here
cells id -> CellStates
<c> CellState shapes, rerooted herePlane and cell hold structure only, but for the plane's backend. What
ran and how it ended is a run. What a program remembers is a state.
cell
Module nuspace.shapes.cell.
Cell: a program, the irreducible thing a space holds, on exactly one plane.
| Name | Call | Meaning |
|---|---|---|
| Cell | A program. Structure only. | |
| CellProps | What nuspace itself reads off a cell to work. Typed, unlike meta. |
kernel
Module nuspace.shapes.kernel.
Kernel records: plane runs, their cell runs, the workers they run on, and what is live.
| Name | Call | Meaning |
|---|---|---|
| CellRun | One execution of one cell, inside a plane run. Never mutated into another. | |
| Kernel | Everything the kernel and the backends record. | |
| PlaneRuns | One plane's live plane runs: the ids in running whose run is of it. | |
| Run | One execution of a plane: the thing started, stopped and killed. | |
| Worker | The executor unit a backend runs cells on: a process today, anything later. |
state
Module nuspace.shapes.state.
Program declared state: the two bases a cell's shapes say whose they are by.
| Name | Call | Meaning |
|---|---|---|
| CellState | Base for state owned by one cell. Lands at States.cells[c]. | |
| PlaneState | Base for state shared by a plane's cells. Lands at States.planes[p].state. |
states
Module nuspace.shapes.states.
States: the state store, where program declared state lives. Apart from Space.
| Name | Call | Meaning |
|---|---|---|
| CellStates | One cell's state. No slots of its own: the program's CellState shapes fill it. | |
| PlaneStates | One plane's state, shared by its cells in state. | |
| States | The state store's root: every plane's state and every cell's, by id. |
connection
Module nuspace.shapes.connection.
Connection: one live client of a device, eg a browser tab.
| Name | Call | Meaning |
|---|---|---|
| Connection | What a device publishes about one client. Written by the device only. |
plane
Module nuspace.shapes.plane.
Plane: a named, ordered group of cells.
| Name | Call | Meaning |
|---|---|---|
| Plane | A group of cells, the runnable thing. How it runs is its backend prop only. | |
| PlaneProps | What nuspace itself reads off a plane to work. Typed, unlike meta. |
space
Module nuspace.shapes.space.
Space: the world. What you open.
| Name | Call | Meaning |
|---|---|---|
| Space | Planes, their cells, the top level, the kernel's records, device and space state. | |
| SpaceInfo | What the host says about the space it opened. Written once per open. | |
| SpaceState | Space wide state: things about the space as a whole, not one plane. |
reroot
Module nuspace.shapes.reroot.
Reroot: land a program's state refs under the plane and cell running it.
| Name | Call | Meaning |
|---|---|---|
| reroot | shapes.reroot(term, plane, cell) | term with its cell state under cell and its plane state under plane. |
| reroot_base | shapes.reroot_base(term, base, at) | term with the chains rooted at a base subclass spliced under at. |