−
100%
+
fit
scroll
Portal boot is a 4-phase process: ## Phase 0:
Proto-Boot Minimal startup. Initialize Forest
(SQLite at ~/.hexos/forest.db). Load db-target
Things from Forest to discover PostgreSQL
hosts. This phase requires ZERO network —
just the local filesystem. ## Phase 1:
Database Discovery Try each db-target host in
order (hexlet first, localhost, remotes).
2-second timeout per host. First successful
connect wins. Auto-create schema if tables
missing. ## Phase 2: Definition Loading From
PostgreSQL (or Forest fallback), load into
OnceLock caches: - GEM_DEFINITIONS (10 gems
from gem ring) - RING_DEFINITIONS (136 rings)
- MESH_NODE_DEFINITIONS (9 nodes) -
COMMAND_DEFINITIONS (104 commands from command
Things) - CONFIG_CHIPS (54 chips) ## Phase 3:
Mesh Awareness Announce to mesh (write
last_boot + last_heartbeat on this node
Thing). Start Pulse heartbeat (60s). Sync FID
pillars. Initialize AT Protocol PDS signing
key. Register XRPC actions. ## Failure Mode:
Forest Sovereignty If ALL PostgreSQL hosts
fail, Portal runs on Forest (SQLite). Commands
degrade gracefully. New Things created
locally. When PostgreSQL returns,
recovery_sync_to_pg pushes offline changes
back. ## Federation Pattern Every node looks
to hexlet for source of truth. Nodes keep
Proto-Boot Things (db-targets, config, gems,
rings) in Forest for offline resilience. If
hexlet goes down, nodes create Things locally.
When hexlet returns, local Things sync back
via HEXPANSE push. Inventory Box: per-Being
portable box that mirrors touched Things to
Forest. Survives disconnect. The start of
federated boxes.
△