> For the complete documentation index, see [llms.txt](https://maha-strategies-llc.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maha-strategies-llc.gitbook.io/docs/core-concepts/kinetic-interventions-and-ui-lockdown.md).

# Kinetic Interventions & UI Lockdown

The defining characteristic of Maha OS is its ability to physically intercept cognitive decay. When the Agentic Core detects a critical drop in systemic readiness or a spike in high-frequency algorithmic extraction, the system shifts from passive telemetry to active enforcement.

This section details the mechanisms used to lock the local node and enforce physiological recovery.

***

### 1. The z-\[9999] Absolute Overlay

To prevent the user from simply swiping away a notification and returning to an extractive loop, Maha OS utilizes an un-bypassable UI lockdown.

* **React Native Implementation:** The intervention is rendered via React Native as a screen-spanning component with an absolute `z-index` of `9999`.
* **System-Level Preemption:** Utilizing the Android `SYSTEM_ALERT_WINDOW` permission, this overlay draws directly on top of all other active applications (e.g., social media feeds, browsers).
* **The Parasympathetic Audit:** Once triggered, the screen aggressively dims and device navigation is disabled. The user cannot access their underlying applications until they complete a hardware-verified kinetic protocol—typically a mandatory, multi-second breathing audit designed to re-engage the parasympathetic nervous system and stabilize their Resting Heart Rate (RHR).

***

### 2. WebSocket Enforcement

Interventions must occur with zero latency to effectively disrupt the dopamine loop. Relying on standard HTTP polling would introduce lag, allowing the user to continue doomscrolling during the critical intervention window.

* **Real-Time Signaling:** When an intervention is necessary, the Agentic Core fires a payload through the persistent WebSocket connection directly to the Sovereign Client.
* **Dynamic Protocol Generation:** The payload is not static. Gemini 2.5 Flash calculates the exact kinetic protocol required based on the real-time biometric delta (e.g., prescribing a 4-7-8 breathing ratio for acute stress spikes, or a simple 4-second box breath for mild focus fragmentation).

***

### 3. Graceful Degradation & Local Fallbacks

Deploying an absolute `z-[9999]` UI lock introduces a severe architectural risk: if the network drops or the Render proxy times out while the screen is locked, the user's device could become soft-bricked.

To mitigate this, Maha OS employs strict graceful degradation protocols:

* **On-Device Timeout:** If the client loses the WebSocket connection during an active lockdown, a localized timer initiates.
* **Localized Fallback Protocol:** Instead of waiting infinitely for the Agentic Core to verify the biometric audit, the Sovereign Client defaults to a pre-compiled, on-device fallback protocol. The user is presented with a standard 10-second breathing visualizer generated entirely on the edge.
* **Failsafe Unlocking:** Once the local visualizer completes, the client unilaterally drops the `z-[9999]` overlay and restores device access, ensuring the user is never permanently locked out of their hardware due to server instability.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://maha-strategies-llc.gitbook.io/docs/core-concepts/kinetic-interventions-and-ui-lockdown.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
