clawft

Mentra HUD Constraints

Constraint-driven rendering rules for the Mentra smart glasses 400x240 monochrome display

Mentra HUD Constraints

The Mentra HUD renderer is a constraint-driven layout engine that takes standard WeftOS block descriptors and renders them for the Mentra smart glasses display. The same JSON descriptor that renders as a full React GUI on desktop renders as a compact, monochrome, voice-controlled view on the HUD.

Deployment Model

WeftOS does NOT run on the glasses. The BES2700 SoC (ARM Cortex-M33 + Cortex-A7, 8MB PSRAM) runs MentraOS (RTOS). WeftOS runs cloud-side or on a companion device (phone running Kernel<AndroidPlatform>). The glasses are a thin terminal that renders pre-computed display frames received over the network.

+-------------------+     BLE/WiFi     +-------------------+
| Mentra Glasses    | <--------------> | Companion Device  |
| BES2700 (RTOS)   |                   | (Phone/Laptop)    |
| - Voice capture   |                   | - Audio processing|
| - HUD renderer    |                   | - Descriptor cache|
| - BT/WiFi radio   |                   | - Offline mode    |
+-------------------+                   +--------+----------+
                                                 | HTTPS/WebSocket
                                                 v
                                        +-------------------+
                                        | MentraOS AppServer|
                                        | (Cloudflare Workers)
                                        +--------+----------+
                                                 | WebSocket (persistent)
                                                 v
                                        +-------------------+
                                        | WeftOS Kernel     |
                                        | - ServiceApi      |
                                        | - StateStore      |
                                        | - GovernanceGate  |
                                        +-------------------+

Display Constraints

These are hardware limits of the Mentra glasses display. The HUD renderer must respect all of them.

ConstraintValueRationale
Resolution400 x 240 pixelsMentra display hardware
Color depthMonochrome (green on black, or limited palette)OLED power efficiency, outdoor readability
Minimum font size16px equivalentReadable at arm's length through the prism
Maximum text lines8-10 visible linesUsable information density at the given font size
Maximum characters per line~40 characters400px / ~10px per character at 16px font
Interaction modelVoice only (no touch, no gesture)Glasses form factor -- hands-free
Data refresh rate2-5 Hz for data updatesBattery life constraint
Animation refresh rate30 HzSmooth enough for simple transitions
Header1 line (always visible)Status/title bar
Footer1 line (always visible)Voice command hints
Content area6-8 linesBetween header and footer

Character Budget

+----------------------------------------+   <- 40 chars wide
|  HEADER LINE (title + status)          |   <- Line 1 (fixed)
|----------------------------------------|
|  Content line 1                        |   <- Line 2
|  Content line 2                        |   <- Line 3
|  Content line 3                        |   <- Line 4
|  Content line 4                        |   <- Line 5
|  Content line 5                        |   <- Line 6
|  Content line 6                        |   <- Line 7
|  Content line 7                        |   <- Line 8
|  Content line 8                        |   <- Line 9
|----------------------------------------|
|  "cmd1" | "cmd2" | "cmd3"             |   <- Line 10 (fixed)
+----------------------------------------+

Block Descriptor Adaptation Rules

The HUD renderer applies these rules when converting a standard block descriptor to a 400x240 monochrome display.

Layout Block Adaptation

Block TypeHUD Behavior
ColumnRenders children sequentially, each getting proportional line allocation
RowRenders children side-by-side separated by |. Falls back to Column if total width exceeds 40 chars
GridFalls back to Column layout (grid not supported at 400x240)
TabsRenders only the active tab content. No tab bar. Voice command "tab N" to switch

Data Display Block Adaptation

Block TypeHUD Behavior
MetricSingle line: Label: [======== ] Value Unit (with bar if threshold defined) or Label: Value Unit
DataTableFixed-width columns, max 4 columns visible, truncated to fit content area. Column headers on first line
ChainViewerOne line per event: #Seq Kind Summary. Max 6 events visible
CausalGraphLinearized causal chain (numbered list). Max 6 nodes visible. No graph layout.
DiffViewerNOT rendered. Falls back to summary: N files, +A/-D lines
CodeEditorNOT rendered. Falls back to: File: name.rs (N lines)

Interactive Block Adaptation

Block TypeHUD Behavior
ButtonRendered as a voice command hint in the footer bar
ConsolePanNOT directly rendered. Voice commands route through the same ShellAdapter
ApprovalGateSummary line: Action: risk=N. Voice commands: "approve", "deny"
TextInputNOT interactive on HUD. Renders current value as read-only text
MarkdownPlain text. Headings rendered as UPPERCASE. Bold as-is. Code blocks omitted. Max 6 lines

OS Capability Block Adaptation

Block TypeHUD Behavior
WebBrowserNOT rendered. Shows URL text only
ResourceTreeFlat list of top-level entries, max 8 visible
ServiceMapRadial topology (same rendering as RadialTopology). Max 8 nodes

General Rules

  1. Truncation: Any text longer than 40 characters is truncated with ... at position 37.
  2. Nesting depth: Only the first 2 nesting levels are rendered. Deeper content is collapsed to a summary line.
  3. Color: Only three visual states: normal (green), warning (yellow/brighter), error (red/inverted). Mapped from threshold values and status fields.
  4. Scrolling: Content that exceeds the visible area supports voice-driven pagination: "scroll down", "scroll up", "page 2".

Voice Command Mapping

Voice commands are the sole interaction method on the Mentra HUD. They map to kernel commands through the ShellAdapter.

Global Voice Commands

These are available on any HUD view.

Voice CommandKernel CommandDescription
"status"kernel.status --format hudShow system status card
"agents"process.list --format hudShow agent list
"network"mesh.peers --format hudShow network topology
"back"(navigation)Return to previous view
"refresh"(re-fetch current view data)Force refresh of current view
"scroll down"(pagination)Next page of content
"scroll up"(pagination)Previous page of content
"help"(show command list)Display available voice commands

Contextual Voice Commands

Available only when specific views or blocks are active.

ContextVoice CommandKernel CommandDescription
Agent list"spawn [type]"process.spawn <type>Spawn a new agent
Agent list"kill [pid]"process.stop <pid>Stop an agent
Agent list"detail [pid]"process.info <pid>Show agent detail
Network view"detail [peer]"mesh.peer-detail <peer>Show peer detail
Network view"services on [peer]"mesh.services <peer>List services on a peer
Chain view"expand [seq]"chain.detail <seq>Expand a chain event
Causal graph"expand [N]"ecc.node-detail <id>Expand a causal node
Approval gate"approve"governance.approve <id>Approve the pending action
Approval gate"deny"governance.deny <id>Deny the pending action
Journey"next"(navigation)Go to next journey step
Journey"back"(navigation)Go to previous journey step

Wake Word

The wake word is "Hey WeftOS". The glasses perform on-device wake word detection (low-power always-on audio). After detection, the next utterance is captured and sent to the companion device for parsing.

User: "Hey WeftOS, status"
  |
  +-- Wake word detected on-device
  +-- "status" captured and sent to companion
  +-- Companion parses to kernel_exec("kernel.status --format hud")
  +-- WeftOS returns StatusCard descriptor
  +-- HUD renders it

MVP HUD Wireframes

System Status Card

Default view shown when the user says "status".

+----------------------------------------+
|  WEFTOS STATUS                         |
|----------------------------------------|
|  Kernel:   Running     v0.2.0          |
|  Services: 14 active                   |
|  Agents:   3 running, 1 idle           |
|  Health:   [==========] 100%           |
|  Chain:    block #4,271                |
|  Uptime:   14h 22m                     |
|                                        |
|----------------------------------------|
|  "agents" | "network" | "refresh"      |
+----------------------------------------+

Agent List

Shown when the user says "agents".

+----------------------------------------+
|  AGENTS: 4 total                       |
|----------------------------------------|
|  PID  Agent        State    CPU        |
|  001  weaver       running  12%        |
|  002  coder-1      running   8%        |
|  003  reviewer     idle      0%        |
|  004  tester-1     running   5%        |
|                                        |
|                                        |
|----------------------------------------|
|  "spawn [type]" | "kill [pid]" | "back"|
+----------------------------------------+

Latency Budget

End-to-end latency for voice commands from the glasses to the HUD response.

PhaseTargetMax
Voice capture + VAD50ms100ms
Audio to glasses BLE buffer20ms50ms
BLE/WiFi to companion30ms80ms
Companion to AppServer40ms100ms
AppServer to WeftOS20ms50ms
WeftOS command execution100ms500ms
Response to AppServer20ms50ms
AppServer to companion40ms100ms
Companion to glasses30ms80ms
HUD render10ms30ms
TOTAL (simple command)360ms640ms
TOTAL (search command)400ms800ms

Simple commands (status, agents, network) target under 500ms perceived latency. Analysis commands show immediate "working..." indicator with streaming progress.


Offline Behavior

The companion device maintains a descriptor cache with TTL. When the network connection is lost:

FeatureOffline SupportMechanism
Cached status displayYesLast-known state from companion cache
Cached topology viewYesLast snapshot of peer list
Voice command parsingPartialOn-device wake word + basic local commands
HNSW searchNoRequires kernel
Weaver analysisNoRequires kernel + LLM
Alert historyYesCached on companion
Time/date/batteryYesLocal device

Cached views render with a stale-data indicator:

+----------------------------------------+
|  NETWORK: 5 peers  |  [CACHED 2m ago]  |
|----------------------------------------|

Ambient Layer

Outside of full views, the HUD displays a persistent ambient status bar:

+------------------------------------------+
|  [5 peers] [12ms] [3 agents]  11:42 AM   |
+------------------------------------------+

This is a StatusBar block with $state bindings to peer count, average latency, active agent count, and local time. The ambient layer is always visible when no full view is active. It consumes 1 line of the display. Saying "status", "agents", or "network" replaces the ambient layer with the full view. Saying "back" from any full view returns to the ambient layer.


Testing Strategy

Until Mentra hardware is available, testing uses:

  1. Text-based HUD simulator: A terminal program that renders descriptors within a 40x10 character box, simulating the exact HUD constraints. Validates that every descriptor produces output within bounds.
  2. Mock WebSocket client: Simulates glasses traffic patterns (voice commands, descriptor requests, latency profiles).
  3. Constraint validation unit tests: For each block type, verify that the HUD renderer output fits within 40 characters per line and the content area line count.

Test matrix entry for the HUD renderer:

INPUT:   Any valid BlockDescriptor (from block-descriptor-schema.json)
OUTPUT:  Vec<String> where each string.len() <= 40 and vec.len() <= 10
ASSERT:  No output line exceeds 40 characters
ASSERT:  Total output lines do not exceed 10
ASSERT:  Header line is always present
ASSERT:  Footer (HintBar) line is always present

On this page