@neuroverseos/governance 0.3.4 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/README.md +280 -405
  2. package/dist/adapters/autoresearch.cjs +63 -9
  3. package/dist/adapters/autoresearch.d.cts +2 -1
  4. package/dist/adapters/autoresearch.d.ts +2 -1
  5. package/dist/adapters/autoresearch.js +3 -3
  6. package/dist/adapters/deep-agents.cjs +63 -9
  7. package/dist/adapters/deep-agents.d.cts +3 -2
  8. package/dist/adapters/deep-agents.d.ts +3 -2
  9. package/dist/adapters/deep-agents.js +3 -3
  10. package/dist/adapters/express.cjs +63 -9
  11. package/dist/adapters/express.d.cts +2 -1
  12. package/dist/adapters/express.d.ts +2 -1
  13. package/dist/adapters/express.js +3 -3
  14. package/dist/adapters/index.cjs +961 -9
  15. package/dist/adapters/index.d.cts +4 -2
  16. package/dist/adapters/index.d.ts +4 -2
  17. package/dist/adapters/index.js +54 -17
  18. package/dist/adapters/langchain.cjs +63 -9
  19. package/dist/adapters/langchain.d.cts +3 -2
  20. package/dist/adapters/langchain.d.ts +3 -2
  21. package/dist/adapters/langchain.js +3 -3
  22. package/dist/adapters/mentraos.cjs +2181 -0
  23. package/dist/adapters/mentraos.d.cts +319 -0
  24. package/dist/adapters/mentraos.d.ts +319 -0
  25. package/dist/adapters/mentraos.js +48 -0
  26. package/dist/adapters/openai.cjs +63 -9
  27. package/dist/adapters/openai.d.cts +3 -2
  28. package/dist/adapters/openai.d.ts +3 -2
  29. package/dist/adapters/openai.js +3 -3
  30. package/dist/adapters/openclaw.cjs +63 -9
  31. package/dist/adapters/openclaw.d.cts +3 -2
  32. package/dist/adapters/openclaw.d.ts +3 -2
  33. package/dist/adapters/openclaw.js +3 -3
  34. package/dist/{add-ROOZLU62.js → add-XSANI3FK.js} +1 -1
  35. package/dist/{behavioral-MJO34S6Q.js → behavioral-SLW7ALEK.js} +4 -4
  36. package/dist/{bootstrap-CQRZVOXK.js → bootstrap-2OW5ZLBL.js} +4 -4
  37. package/dist/bootstrap-contract-DcV6t-8M.d.cts +216 -0
  38. package/dist/bootstrap-contract-DcV6t-8M.d.ts +216 -0
  39. package/dist/browser.global.js +149 -5
  40. package/dist/{build-ZHPMX5AZ.js → build-EGBGZFIJ.js} +6 -6
  41. package/dist/{chunk-A7GKPPU7.js → chunk-2VAWP6FI.js} +1 -1
  42. package/dist/{chunk-3WQLXYTP.js → chunk-3AYKQHYI.js} +2 -2
  43. package/dist/{chunk-EMQDLDAF.js → chunk-3NZMMSOW.js} +80 -2
  44. package/dist/chunk-3S5AD4AB.js +421 -0
  45. package/dist/{chunk-VXHSMA3I.js → chunk-6CV4XG3J.js} +1 -1
  46. package/dist/{chunk-BNKJPUPQ.js → chunk-A7SHG75T.js} +2 -2
  47. package/dist/{chunk-U6U7EJZL.js → chunk-AV7XJJWK.js} +2 -2
  48. package/dist/{chunk-ZWI3NIXK.js → chunk-CYDMUJVZ.js} +54 -3
  49. package/dist/{chunk-F66BVUYB.js → chunk-DA5MHFRR.js} +3 -3
  50. package/dist/{chunk-YEKMVDWK.js → chunk-FHXXD2TI.js} +7 -7
  51. package/dist/{chunk-5TPFNWRU.js → chunk-FS2UUJJO.js} +3 -3
  52. package/dist/{chunk-4FLICVVA.js → chunk-FVOGUCB6.js} +2 -2
  53. package/dist/chunk-GTPV2XGO.js +893 -0
  54. package/dist/{chunk-CTZHONLA.js → chunk-I4RTIMLX.js} +2 -2
  55. package/dist/{chunk-B6OXJLJ5.js → chunk-J2IZBHXJ.js} +4 -4
  56. package/dist/{chunk-TG6SEF24.js → chunk-OQU65525.js} +1 -1
  57. package/dist/{chunk-QXBFT7NI.js → chunk-QMVQ6KPL.js} +2 -2
  58. package/dist/{chunk-G7DJ6VOD.js → chunk-RDA7ISWC.js} +2 -2
  59. package/dist/{chunk-O5ABKEA7.js → chunk-YJ34R5NB.js} +2 -2
  60. package/dist/{chunk-PVTQQS3Y.js → chunk-YPCVY4GS.js} +31 -0
  61. package/dist/{chunk-W7LLXRGY.js → chunk-ZAF6JH23.js} +65 -10
  62. package/dist/{chunk-IS4WUH6Y.js → chunk-ZEIT2QLM.js} +4 -4
  63. package/dist/cli/neuroverse.cjs +4436 -1035
  64. package/dist/cli/neuroverse.js +40 -24
  65. package/dist/cli/plan.cjs +176 -12
  66. package/dist/cli/plan.js +2 -2
  67. package/dist/cli/run.cjs +63 -9
  68. package/dist/cli/run.js +2 -2
  69. package/dist/configure-world-XU2COHOZ.js +705 -0
  70. package/dist/{decision-flow-M63D47LO.js → decision-flow-3K4D72G4.js} +2 -2
  71. package/dist/{demo-G43RLCPK.js → demo-6OQYWRR6.js} +4 -4
  72. package/dist/{derive-LMDUTXDD.js → derive-7Y7YWVLU.js} +5 -5
  73. package/dist/{doctor-6BC6X2VO.js → doctor-NHXI7OQW.js} +3 -1
  74. package/dist/engine/bootstrap-emitter.cjs +241 -0
  75. package/dist/engine/bootstrap-emitter.d.cts +27 -0
  76. package/dist/engine/bootstrap-emitter.d.ts +27 -0
  77. package/dist/{bootstrap-emitter-Q7UIJZ2O.js → engine/bootstrap-emitter.js} +2 -2
  78. package/dist/engine/bootstrap-parser.cjs +560 -0
  79. package/dist/engine/bootstrap-parser.d.cts +96 -0
  80. package/dist/engine/bootstrap-parser.d.ts +96 -0
  81. package/dist/{bootstrap-parser-EEF36XDU.js → engine/bootstrap-parser.js} +2 -2
  82. package/dist/engine/guard-engine.cjs +1116 -0
  83. package/dist/engine/guard-engine.d.cts +60 -0
  84. package/dist/engine/guard-engine.d.ts +60 -0
  85. package/dist/engine/guard-engine.js +12 -0
  86. package/dist/engine/simulate-engine.cjs +390 -0
  87. package/dist/engine/simulate-engine.d.cts +105 -0
  88. package/dist/engine/simulate-engine.d.ts +105 -0
  89. package/dist/engine/simulate-engine.js +9 -0
  90. package/dist/{equity-penalties-SG5IZQ7I.js → equity-penalties-NVBAB5WL.js} +4 -4
  91. package/dist/{explain-RHBU2GBR.js → explain-HDFN4ION.js} +1 -1
  92. package/dist/github-TIKTWOGU.js +27 -0
  93. package/dist/{guard-AEEJNWLD.js → guard-6KSCWT2W.js} +4 -4
  94. package/dist/{guard-contract-B7lplwm9.d.cts → guard-contract-C991HDZp.d.cts} +32 -309
  95. package/dist/{guard-contract-B7lplwm9.d.ts → guard-contract-hHjTTjtR.d.ts} +32 -309
  96. package/dist/{impact-3XVDSCBU.js → impact-WIAM66IH.js} +3 -3
  97. package/dist/{improve-TQP4ECSY.js → improve-2PWGGO5B.js} +3 -3
  98. package/dist/index.cjs +682 -14
  99. package/dist/index.d.cts +231 -423
  100. package/dist/index.d.ts +231 -423
  101. package/dist/index.js +81 -58
  102. package/dist/{init-FYPV4SST.js → init-TKIJDR7I.js} +5 -1
  103. package/dist/lens-MHMUDCMQ.js +1084 -0
  104. package/dist/{mcp-server-5Y3ZM7TV.js → mcp-server-TNIWZ7B5.js} +3 -3
  105. package/dist/{playground-VZBNPPBO.js → playground-3FLDGBET.js} +3 -3
  106. package/dist/{redteam-MZPZD3EF.js → redteam-HV6LMKEH.js} +3 -3
  107. package/dist/{session-JYOARW54.js → session-XZP2754M.js} +3 -3
  108. package/dist/{shared-C_zpdvBm.d.cts → shared-DGnn1jiS.d.cts} +1 -1
  109. package/dist/{shared-Cf7yxx4-.d.ts → shared-U405h52W.d.ts} +1 -1
  110. package/dist/{simulate-LJXYBC6M.js → simulate-VT437EEL.js} +17 -4
  111. package/dist/spatial/index.cjs +682 -0
  112. package/dist/spatial/index.d.cts +517 -0
  113. package/dist/spatial/index.d.ts +517 -0
  114. package/dist/spatial/index.js +633 -0
  115. package/dist/{test-BOOR4A5F.js → test-4WTX6RKQ.js} +3 -3
  116. package/dist/{trace-PKV4KX56.js → trace-2YDNAXMK.js} +2 -2
  117. package/dist/types.cjs +18 -0
  118. package/dist/types.d.cts +370 -0
  119. package/dist/types.d.ts +370 -0
  120. package/dist/types.js +0 -0
  121. package/dist/{validate-RALX7CZS.js → validate-M52DX22Y.js} +1 -1
  122. package/dist/{world-BIP4GZBZ.js → world-O4HTQPDP.js} +1 -1
  123. package/dist/{world-loader-Y6HMQH2D.js → world-loader-YTYFOP7D.js} +1 -1
  124. package/dist/worlds/mentraos-smartglasses.nv-world.md +423 -0
  125. package/dist/worlds/mentraos-spatial.nv-world.md +68 -0
  126. package/dist/worlds/user-rules.nv-world.md +328 -0
  127. package/package.json +46 -3
  128. package/dist/guard-engine-PNR6MHCM.js +0 -10
  129. package/dist/{configure-ai-5MP5DWTT.js → configure-ai-LL3VAPQW.js} +3 -3
@@ -0,0 +1,423 @@
1
+ ---
2
+ world_id: mentraos-smartglasses
3
+ name: MentraOS Smart Glasses — AI Interaction Governance
4
+ version: 3.0.0
5
+ runtime_mode: COMPLIANCE
6
+ default_profile: standard
7
+ alternative_profile: strict
8
+ ---
9
+
10
+ # Thesis
11
+
12
+ MentraOS is an operating system for smart glasses. Apps run on their own servers and connect through the MentraOS SDK via WebSocket. Every app gets access to hardware — camera, microphone, display, location — through permission-gated SDK methods. What MentraOS does not govern is what happens after the app receives that data. An app that gets transcription data can send it to OpenAI, Claude, Gemini, or any AI API it wants. An app that captures a photo can pipe it to a vision model for analysis. The OS controls the pipe. It does not control what's on the other end.
13
+
14
+ This world governs the AI interaction layer — the space between the MentraOS SDK and the AI backends that apps use to process user data. It enforces three categories of rules: (1) platform constraints that are physically real (hardware capabilities, declared permissions, session isolation), (2) AI data flow governance (what user data goes to which AI, and whether the user knows about it), and (3) AI autonomy limits (what the AI can do vs. suggest, and what requires user confirmation).
15
+
16
+ User rules (defined in mentraos-user-rules) override this world. If this world allows an app to send transcriptions to its declared AI API, but the user's personal rules say "confirm every AI data send," the user wins. This world defines the platform's baseline governance. The user's world defines the ceiling.
17
+
18
+ # Invariants
19
+
20
+ - `no_undeclared_hardware_access` — Apps must never access microphone, camera, speaker, or display capabilities not declared in their app registration at console.mentra.glass (structural, immutable)
21
+ - `no_silent_recording` — Apps must never capture audio or video without active user awareness; background recording without indicator is forbidden (structural, immutable)
22
+ - `no_display_obstruction` — Apps must never render content that fully occludes the wearer's real-world field of view without user-dismissable controls (structural, immutable)
23
+ - `no_cross_session_data_leak` — App session data must not leak between distinct user sessions; each AppSession is isolated per userId and sessionId (structural, immutable)
24
+ - `no_credential_exfiltration` — Apps must never transmit MENTRAOS_API_KEY, user auth tokens, or session credentials to third-party endpoints outside the registered app server (structural, immutable)
25
+ - `hardware_capability_respected` — Apps must gracefully degrade when running on glasses that lack declared capabilities; camera apps must not crash on Even Realities G1 which has no camera (structural, immutable)
26
+ - `ai_data_flow_declared` — Every AI API endpoint that receives user data must be declared in the app's registration. Undeclared AI backends are forbidden. (structural, immutable)
27
+ - `ai_actions_require_display` — Any action the AI intends to take on the user's behalf must first be shown on the glasses display. The user sees it before it happens. (structural, immutable)
28
+ - `user_rules_take_precedence` — When a user's personal governance rules conflict with this world's rules, the user's rules win. This world can only be tightened by user rules, never relaxed. (structural, immutable)
29
+
30
+ # State
31
+
32
+ ## permission_violations
33
+ - type: number
34
+ - min: 0
35
+ - max: 10000
36
+ - step: 1
37
+ - default: 0
38
+ - label: Permission Violations
39
+ - description: Number of attempts to access hardware capabilities not declared in app registration
40
+
41
+ ## active_sessions
42
+ - type: number
43
+ - min: 0
44
+ - max: 1000
45
+ - step: 1
46
+ - default: 0
47
+ - label: Active Sessions
48
+ - description: Number of concurrent AppSession instances running
49
+
50
+ ## camera_access_events
51
+ - type: number
52
+ - min: 0
53
+ - max: 100000
54
+ - step: 1
55
+ - default: 0
56
+ - label: Camera Access Events
57
+ - description: Number of camera capture or stream operations performed
58
+
59
+ ## microphone_access_events
60
+ - type: number
61
+ - min: 0
62
+ - max: 100000
63
+ - step: 1
64
+ - default: 0
65
+ - label: Microphone Access Events
66
+ - description: Number of audio capture or transcription operations performed
67
+
68
+ ## display_render_events
69
+ - type: number
70
+ - min: 0
71
+ - max: 100000
72
+ - step: 1
73
+ - default: 0
74
+ - label: Display Render Events
75
+ - description: Number of layout render operations (showTextWall, image display, etc.)
76
+
77
+ ## battery_drain_rate
78
+ - type: number
79
+ - min: 0
80
+ - max: 100
81
+ - step: 1
82
+ - default: 0
83
+ - label: Battery Drain Rate
84
+ - description: Estimated battery consumption percentage per hour from app activity
85
+ - display_as: percentage
86
+
87
+ ## cross_session_leak_attempts
88
+ - type: number
89
+ - min: 0
90
+ - max: 1000
91
+ - step: 1
92
+ - default: 0
93
+ - label: Cross-Session Leak Attempts
94
+ - description: Number of attempts to access data from another user session
95
+
96
+ ## hardware_mismatch_errors
97
+ - type: number
98
+ - min: 0
99
+ - max: 1000
100
+ - step: 1
101
+ - default: 0
102
+ - label: Hardware Mismatch Errors
103
+ - description: Number of times an app tried to use capabilities unsupported by connected glasses
104
+
105
+ ## tool_calls_processed
106
+ - type: number
107
+ - min: 0
108
+ - max: 100000
109
+ - step: 1
110
+ - default: 0
111
+ - label: Tool Calls Processed
112
+ - description: Number of handleToolCall invocations processed by the app server
113
+
114
+ ## credential_exposure_attempts
115
+ - type: number
116
+ - min: 0
117
+ - max: 100
118
+ - step: 1
119
+ - default: 0
120
+ - label: Credential Exposure Attempts
121
+ - description: Number of attempts to transmit API keys or auth tokens to unauthorized endpoints
122
+
123
+ ## glasses_model
124
+ - type: enum
125
+ - options: even_realities_g1, mentra_live, mentra_mach1, vuzix_z100, unknown
126
+ - default: unknown
127
+ - label: Connected Glasses Model
128
+ - description: The smart glasses hardware currently connected via BLE
129
+ - mutable: true
130
+
131
+ ## ai_data_sends
132
+ - type: number
133
+ - min: 0
134
+ - max: 100000
135
+ - step: 1
136
+ - default: 0
137
+ - label: AI Data Sends
138
+ - description: Number of times this app sent user data to its declared AI API endpoints
139
+
140
+ ## ai_data_sends_undeclared
141
+ - type: number
142
+ - min: 0
143
+ - max: 1000
144
+ - step: 1
145
+ - default: 0
146
+ - label: Undeclared AI Data Sends
147
+ - description: Number of times this app sent user data to an AI API not declared in its app registration
148
+
149
+ ## ai_auto_actions
150
+ - type: number
151
+ - min: 0
152
+ - max: 10000
153
+ - step: 1
154
+ - default: 0
155
+ - label: AI Auto-Actions
156
+ - description: Number of actions the app's AI took on the user's behalf
157
+
158
+ ## ai_auto_actions_unconfirmed
159
+ - type: number
160
+ - min: 0
161
+ - max: 1000
162
+ - step: 1
163
+ - default: 0
164
+ - label: Unconfirmed AI Auto-Actions
165
+ - description: Number of AI actions taken without first showing the action on the glasses display
166
+
167
+ ## ai_provider_declared
168
+ - type: number
169
+ - min: 0
170
+ - max: 1
171
+ - step: 1
172
+ - default: 0
173
+ - label: AI Provider Declared
174
+ - description: Whether the app has declared its AI API provider(s) in its registration (1 = yes, 0 = no)
175
+ - mutable: true
176
+
177
+ ## ai_data_types_sent
178
+ - type: number
179
+ - min: 0
180
+ - max: 10
181
+ - step: 1
182
+ - default: 0
183
+ - label: AI Data Types Sent
184
+ - description: Number of distinct data types (transcription, image, location, calendar, etc.) sent to AI during this session
185
+
186
+ ## ai_retention_opted_in
187
+ - type: number
188
+ - min: 0
189
+ - max: 1
190
+ - step: 1
191
+ - default: 0
192
+ - label: Data Retention Opted In
193
+ - description: Whether the user has opted in to data retention for this app (1 = yes, 0 = no)
194
+ - mutable: true
195
+
196
+ ## dashboard_mode
197
+ - type: enum
198
+ - options: main, expanded, always_on, off
199
+ - default: off
200
+ - label: Dashboard Mode
201
+ - description: Current dashboard display mode on the glasses
202
+ - mutable: true
203
+
204
+ # Assumptions
205
+
206
+ ## standard
207
+ - name: Standard App Governance
208
+ - description: Normal app operation with AI governance. Apps declare permissions and AI providers at registration. Hardware access through SDK managers. AI can process user data through declared APIs. AI actions must be shown on display before execution. Data is ephemeral by default. Apps can request data retention if declared and user opts in.
209
+ - hardware_policy: declared_permissions_only
210
+ - ai_data_policy: declared_apis_only
211
+ - ai_action_policy: display_then_confirm
212
+ - data_retention_policy: ephemeral_unless_opted_in
213
+ - session_policy: isolated_per_user
214
+
215
+ ## strict
216
+ - name: Strict App Governance
217
+ - description: Maximum restriction on AI interactions. AI data sends require per-send user confirmation. No AI auto-actions permitted. No data retention under any circumstances. All AI processing must be visible to the user in real-time.
218
+ - hardware_policy: declared_permissions_only
219
+ - ai_data_policy: per_send_confirmation
220
+ - ai_action_policy: no_auto_actions
221
+ - data_retention_policy: never_retain
222
+ - session_policy: isolated_per_user
223
+
224
+ ## developer
225
+ - name: Developer Mode Governance
226
+ - description: Relaxed governance for app development and testing. AI data flows are logged but not blocked for undeclared providers during development. All other platform constraints remain enforced. Not available in production app store.
227
+ - hardware_policy: declared_permissions_only
228
+ - ai_data_policy: log_only
229
+ - ai_action_policy: display_then_confirm
230
+ - data_retention_policy: session_scoped
231
+ - session_policy: isolated_per_user
232
+
233
+ # Rules
234
+
235
+ ## rule-001: Undeclared Hardware Access (structural)
236
+ Apps accessing hardware capabilities they did not declare during registration at console.mentra.glass violates the MentraOS permission model.
237
+
238
+ When permission_violations > 0 [state]
239
+ Then platform_trust *= 0.30
240
+ Collapse: platform_trust < 0.10
241
+
242
+ > trigger: App attempted to use camera, microphone, speaker, or display without declaring the permission in its app registration configuration.
243
+ > rule: MentraOS requires all hardware permissions to be declared at app registration time. The SDK gates access through session managers (audio, camera, layouts). Undeclared access means the app is circumventing the SDK.
244
+ > shift: Platform trust drops critically. App may be suspended from the Mentra Store.
245
+ > effect: Platform trust reduced to 30%. Continued violations trigger collapse.
246
+
247
+ ## rule-002: Hardware Capability Mismatch (degradation)
248
+ Apps must check hardware capabilities before attempting operations. Even Realities G1 has no camera. Mentra Live has no display. Apps must degrade gracefully.
249
+
250
+ When hardware_mismatch_errors > 3 [state]
251
+ Then platform_trust *= 0.60
252
+
253
+ > trigger: App attempted to use a capability (e.g., camera on G1, display on Mentra Live) that the connected glasses hardware does not support.
254
+ > rule: MentraOS supports four glasses models with different capability matrices. Apps must respect the compatibility matrix and provide fallback behavior.
255
+ > shift: Platform trust degrades. App quality score decreases in the Mentra Store.
256
+ > effect: Platform trust reduced to 60%.
257
+
258
+ ## rule-003: Cross-Session Data Leak (structural)
259
+ Each AppSession is scoped to a userId and sessionId. Accessing another session's data violates isolation.
260
+
261
+ When cross_session_leak_attempts > 0 [state]
262
+ Then platform_trust *= 0.20
263
+ Collapse: platform_trust < 0.10
264
+
265
+ > trigger: App attempted to read, write, or reference data belonging to a different user's session.
266
+ > rule: AppSession isolation is a core MentraOS security boundary. The onSession() lifecycle hook receives a scoped session object. Crossing session boundaries indicates either a bug or malicious intent.
267
+ > shift: Platform trust drops severely. App is flagged for security review.
268
+ > effect: Platform trust reduced to 20%. Near-certain collapse on repeated violation.
269
+
270
+ ## rule-004: Excessive Battery Drain (degradation)
271
+ Smart glasses have limited battery. Apps consuming excessive power degrade the user experience.
272
+
273
+ When battery_drain_rate > 25 [state]
274
+ Then platform_trust *= 0.70
275
+
276
+ > trigger: App's estimated battery consumption exceeds 25% per hour.
277
+ > rule: Wearable devices require power-conscious apps. Heavy AI processing should happen server-side, not drain the glasses or phone.
278
+ > shift: Platform trust degrades. App may receive battery warnings from the OS.
279
+ > effect: Platform trust reduced to 70%.
280
+
281
+ ## rule-005: Credential Exposure (structural)
282
+ API keys and auth tokens must never leave the app server boundary.
283
+
284
+ When credential_exposure_attempts > 0 [state]
285
+ Then platform_trust *= 0.10
286
+ Collapse: platform_trust < 0.10
287
+
288
+ > trigger: App attempted to transmit MENTRAOS_API_KEY, session tokens, or user authentication credentials to an endpoint outside the registered app server.
289
+ > rule: The MENTRAOS_API_KEY authenticates the app server to the platform. Exposure compromises the entire app's user base.
290
+ > shift: Platform trust collapses. App is immediately suspended.
291
+ > effect: Platform trust reduced to 10%. Triggers collapse.
292
+
293
+ ## rule-006: Undeclared AI Data Flow (structural)
294
+ App sent user data to an AI API it did not declare at registration. The user never consented to this data flow.
295
+
296
+ When ai_data_sends_undeclared > 0 [state]
297
+ Then platform_trust *= 0.15
298
+ Collapse: platform_trust < 0.10
299
+
300
+ > trigger: App transmitted user data (transcription text, camera images, location coordinates, calendar events) to an AI API endpoint not listed in the app's declared integrations at console.mentra.glass.
301
+ > rule: Every AI provider that touches user data must be declared at registration. This is how users make informed decisions about which apps to install. A nutrition app that declares "sends food photos to OpenAI Vision" is transparent. The same app secretly piping data to an undeclared endpoint is a trust violation. The app store listing shows declared AI providers so users can evaluate before installing.
302
+ > shift: Platform trust collapses. App suspended and flagged for review.
303
+ > effect: Platform trust reduced to 15%. Near-certain collapse.
304
+
305
+ ## rule-007: AI Action Without Display (structural)
306
+ AI took an action on the user's behalf without first showing it on the glasses display.
307
+
308
+ When ai_auto_actions_unconfirmed > 0 [state]
309
+ Then platform_trust *= 0.25
310
+ Collapse: platform_trust < 0.10
311
+
312
+ > trigger: The app's AI executed an external action (sent a message, made an API call, changed a setting, placed an order) without first rendering the intended action on the glasses display for user review and confirmation.
313
+ > rule: Smart glasses display is the user's window into what AI is doing. An AI assistant that auto-sends an email the user never saw on their display has acted behind the user's back. The flow must always be: AI decides action → show on display → user confirms → execute. Skipping display means the user lost control.
314
+ > shift: Platform trust drops severely. App's AI auto-action privileges suspended.
315
+ > effect: Platform trust reduced to 25%.
316
+
317
+ ## rule-008: Excessive AI Data Types (degradation)
318
+ App is sending too many distinct types of user data to its AI backend.
319
+
320
+ When ai_data_types_sent > 4 [state]
321
+ Then platform_trust *= 0.65
322
+
323
+ > trigger: App has sent more than 4 distinct types of user data (transcription, images, location, calendar, contacts, notifications, etc.) to its AI API during a single session.
324
+ > rule: Each data type sent to AI expands the app's knowledge of the user. A meeting app sending transcriptions is expected. The same app also sending location, calendar, contacts, and camera feeds suggests data over-collection. Apps should send only the data types necessary for their declared function.
325
+ > shift: Platform trust degrades. User notified of data breadth.
326
+ > effect: Platform trust reduced to 65%.
327
+
328
+ ## rule-009: Display Safety Violation (structural)
329
+ Full-screen obstruction without dismissal controls endangers the wearer's physical safety.
330
+
331
+ When display_render_events > 0 [state] AND permission_violations > 0 [state]
332
+ Then platform_trust *= 0.40
333
+
334
+ > trigger: App rendered content that fully occludes the wearer's field of view without providing a user-dismissable control.
335
+ > rule: Smart glasses are worn during real-world activity. Display content must never compromise physical safety.
336
+ > shift: Platform trust drops. App faces safety review.
337
+ > effect: Platform trust reduced to 40%.
338
+
339
+ ## rule-010: Clean AI Session (advantage)
340
+ App processed user data through AI with full compliance — declared providers, confirmed actions, proper data handling.
341
+
342
+ When ai_data_sends > 0 [state] AND ai_data_sends_undeclared == 0 [state] AND ai_auto_actions_unconfirmed == 0 [state] AND permission_violations == 0 [state]
343
+ Then platform_trust *= 1.12
344
+
345
+ > trigger: App has actively used AI to process user data and has maintained full compliance with all governance rules.
346
+ > rule: Apps that declare their AI providers, show actions before executing, and respect platform constraints earn trust. This is the model for how AI-powered apps should work on wearables. Clean operation across sessions builds the app's reputation in the Mentra Store.
347
+ > shift: Platform trust improves. App earns AI governance compliance badge.
348
+ > effect: Platform trust boosted by 12%.
349
+
350
+ ## rule-011: Clean Platform Session (advantage)
351
+ App operated without any platform violations — no undeclared access, no session leaks, no credential exposure.
352
+
353
+ When tool_calls_processed > 0 [state] AND permission_violations == 0 [state] AND cross_session_leak_attempts == 0 [state] AND hardware_mismatch_errors == 0 [state]
354
+ Then platform_trust *= 1.10
355
+
356
+ > trigger: App has processed tool calls and served users without triggering any platform governance violations.
357
+ > rule: Good platform citizenship should be recognized. Clean sessions build trust and improve Store ranking.
358
+ > shift: Platform trust improves. App earns reliability reputation.
359
+ > effect: Platform trust boosted by 10%.
360
+
361
+ ## rule-012: No AI Provider Declared (degradation)
362
+ App uses AI features but has not declared any AI provider in its registration.
363
+
364
+ When ai_data_sends > 0 [state] AND ai_provider_declared == 0 [state]
365
+ Then platform_trust *= 0.35
366
+
367
+ > trigger: App is sending user data to AI endpoints but did not declare any AI provider in its app registration at console.mentra.glass.
368
+ > rule: Apps that use AI must declare it. Users deserve to know that their data is being processed by AI, and which AI. An app that processes transcriptions through an AI without declaring it is hiding its architecture from the user. Even if the AI provider is the app developer's own model, it must be declared.
369
+ > shift: Platform trust drops. App must update its registration to declare AI integrations.
370
+ > effect: Platform trust reduced to 35%.
371
+
372
+ # Gates
373
+
374
+ - TRUSTED: platform_trust >= 90
375
+ - OPERATING: platform_trust >= 60
376
+ - CAUTIOUS: platform_trust >= 35
377
+ - RESTRICTED: platform_trust > 10
378
+ - SUSPENDED: platform_trust <= 10
379
+
380
+ # Outcomes
381
+
382
+ ## platform_trust
383
+ - type: number
384
+ - range: 0-100
385
+ - display: percentage
386
+ - label: Platform Trust Score
387
+ - primary: true
388
+
389
+ ## permission_violations
390
+ - type: number
391
+ - range: 0-10000
392
+ - display: integer
393
+ - label: Permission Violations
394
+
395
+ ## hardware_mismatch_errors
396
+ - type: number
397
+ - range: 0-1000
398
+ - display: integer
399
+ - label: Hardware Mismatch Errors
400
+
401
+ ## cross_session_leak_attempts
402
+ - type: number
403
+ - range: 0-1000
404
+ - display: integer
405
+ - label: Cross-Session Leak Attempts
406
+
407
+ ## ai_data_sends_undeclared
408
+ - type: number
409
+ - range: 0-1000
410
+ - display: integer
411
+ - label: Undeclared AI Data Sends
412
+
413
+ ## ai_auto_actions_unconfirmed
414
+ - type: number
415
+ - range: 0-1000
416
+ - display: integer
417
+ - label: Unconfirmed AI Actions
418
+
419
+ ## ai_data_types_sent
420
+ - type: number
421
+ - range: 0-10
422
+ - display: integer
423
+ - label: AI Data Types Sent
@@ -0,0 +1,68 @@
1
+ ---
2
+ world_id: mentraos-spatial
3
+ name: "MentraOS Spatial Governance"
4
+ version: "1.0.0"
5
+ runtime_mode: COMPLIANCE
6
+ description: >
7
+ Spatial governance layer for MentraOS smart glasses. Activates when
8
+ glasses detect zones (via Auki anchors, BLE, geofence) or nearby
9
+ participants (multi-user handshake). Rules are temporary — they apply
10
+ while you're in the space and dissolve when you leave.
11
+ ---
12
+
13
+ # Thesis
14
+
15
+ Smart glasses live in the real world. The rules that apply at home don't apply at a hospital. The rules that apply when you're alone don't apply when you're standing next to someone who doesn't want to be recorded. Spatial governance makes AI respect the physical context it operates in.
16
+
17
+ This world governs the spatial layer — the bridge between physical location and AI behavior. It enforces three principles: (1) zones publish rules and users opt in explicitly, (2) when multiple AR users share a space their governance composes via handshake with "most restrictive wins," and (3) all spatial rules are temporary — they dissolve when you leave.
18
+
19
+ This layer sits between user rules (which always win) and the platform world. A zone can tighten your rules, never relax them. A handshake participant can tighten the group, never relax it.
20
+
21
+ # Invariants
22
+
23
+ - `opt_in_required` — Users must explicitly accept a zone's rules before they apply. No zone can force governance on a user without consent. Discovery is passive; acceptance is active. (structural, immutable)
24
+ - `most_restrictive_wins` — When zone rules, handshake rules, and user rules overlap, the most restrictive value for each field wins. A zone cannot relax your personal rules. A single handshake participant blocking recording means nobody records. (structural, immutable)
25
+ - `rules_are_temporary` — Spatial rules apply only during the spatial session. When you leave a zone or a handshake dissolves, the rules dissolve with it. No spatial rule persists beyond the session. (structural, immutable)
26
+ - `no_identity_leak` — Handshake negotiation shares governance constraints, not identity. "I require no recording" is a constraint, not a name. Participants are anonymous by default. (structural, immutable)
27
+ - `zone_transparency` — When a zone's rules are active, the user must be able to see which zone they're in, what rules apply, and how to exit. No invisible governance. (structural, immutable)
28
+ - `user_can_always_leave` — A user can exit any zone or leave any handshake at any time. Governance never traps the user. If you don't like the rules, you leave. Your personal rules remain. (structural, immutable)
29
+ - `physics_over_policy` — Hardware constraints override spatial rules. If glasses don't have a camera, a zone rule allowing cameras is irrelevant. Physics always wins. (structural, immutable)
30
+ - `bystander_default_protection` — In any space with non-consenting bystanders, the default is elevated bystander protection. Zones can tighten this to strict. No zone can lower it below standard. (structural, immutable)
31
+
32
+ # State
33
+
34
+ - `active_zone` — string, initial "none". The currently active zone ID.
35
+ - `zone_opt_ins` — counter, initial 0. Number of zone opt-ins this session.
36
+ - `zone_declines` — counter, initial 0. Number of zone opt-in declines.
37
+ - `handshake_participants` — counter, initial 0. Current handshake participant count.
38
+ - `handshake_negotiations` — counter, initial 0. Number of handshake re-negotiations.
39
+ - `spatial_blocks` — counter, initial 0. Number of intents blocked by spatial rules.
40
+ - `spatial_confirms` — counter, initial 0. Number of intents requiring spatial confirmation.
41
+ - `spatial_trust` — score, initial 1.0, range [0.0, 1.0]. Spatial governance health score.
42
+
43
+ # Assumptions
44
+
45
+ - `standard` — Default spatial behavior. zone_opt_in_required=true, handshake_auto_join=false, bystander_protection=elevated, max_handshake_participants=10
46
+ - `strict` — Privacy-first spatial. zone_opt_in_required=true, handshake_auto_join=false, bystander_protection=strict, max_handshake_participants=5
47
+ - `open` — For controlled spaces (home, private office). zone_opt_in_required=false, handshake_auto_join=true, bystander_protection=standard, max_handshake_participants=20
48
+
49
+ # Rules
50
+
51
+ - `rule-001` — Zone rules applied without opt-in. trigger: zone_active AND NOT zone_opted_in → spatial_trust *= 0.10, BLOCK: "Zone rules cannot apply without your explicit opt-in."
52
+ - `rule-002` — Handshake identity leaked. trigger: handshake_active AND identity_shared → spatial_trust *= 0.05, BLOCK: "Handshake negotiation must be anonymous."
53
+ - `rule-003` — Bystander protection violated. trigger: bystander_protection == "strict" AND camera == "allowed" → spatial_trust *= 0.20, BLOCK: "Camera blocked in strict bystander protection zone."
54
+ - `rule-004` — Zone exit blocked. trigger: user_exit_requested AND exit_denied → spatial_trust *= 0.01, BLOCK: "Users must always be able to exit a zone."
55
+ - `rule-005` — Spatial rules persisted beyond session. trigger: session_ended AND spatial_rules_active → spatial_trust *= 0.10, BLOCK: "Spatial rules must dissolve when session ends."
56
+ - `rule-006` — Clean spatial session (advantage). trigger: zone_opt_ins > 0 AND spatial_blocks == 0 → spatial_trust *= 1.08
57
+ - `rule-007` — Zone relaxing user rules. trigger: zone_rule_less_restrictive_than_user_rule → spatial_trust *= 0.30, BLOCK: "Zones can only tighten rules, never relax them."
58
+
59
+ # Gates
60
+
61
+ - ACTIVE: spatial_trust >= 0.7
62
+ - CAUTIOUS: spatial_trust >= 0.3
63
+ - SUSPENDED: spatial_trust < 0.3
64
+
65
+ # Outcomes
66
+
67
+ - `clean_spatial` — Desired. User navigated zones and handshakes with no governance violations. Tracked by: zone_opt_ins > 0 AND spatial_blocks == 0.
68
+ - `forced_governance` — Undesired. A zone or handshake tried to apply rules without consent. Tracked by: spatial_trust < 0.5.