🛡️ MindShield v1.2.0 Technical Dev Log

Local AI Persistence, Blueprint v2.0, & Firefox MV3 Architecture

Building client-side reflection mechanisms into modern AI chat interfaces requires balancing zero-friction user experience with robust intent classification. MindShield v1.2.0 introduces a fundamental rework of our local inference runtime, intent triage architecture, cross-platform DOM interception, and Firefox Manifest V3 compliance.

1. Blueprint v2.0: 3-Tier Intent Classification & Flagging

Previous iterations relied on binary pass/flag logic that proved overly restrictive on non-surrender queries. Blueprint v2.0 establishes a nuanced 3-tier triage hierarchy executed locally:

Tier 1: PASS (0ms Delay)

Bypasses all delays for factual lookups, concept breakdowns, comparative analysis, collaborative reviews, and context dumps exceeding 400 characters.

Tier 2: WARNING (Soft Notice)

Renders a glassmorphic amber toast without blocking execution. Targeted at cognitive offloading like basic math (15 * 42), social drafting, and action requests.

Tier 3: FLAGGED (5s Lockout)

Enforces a 5-second reflection timer specifically for direct problem-solving surrender, homework evasion, and puzzle shortcuts.

Contextual Scanning & Regex Improvements

2. Local AI Engine Optimization (ONNX / WASM)

Running zero-shot classification via @xenova/transformers locally inside the browser presents strict memory and latency boundaries.

[Native Chat Input] ──> [Capture Event] ──> [Warm Offscreen / Service Worker RAM] 
                                                    │
                                      (DistilBERT-MNLI / ONNX WASM)
                                                    │
                                 ┌──────────────────┴──────────────────┐
                                 ▼                                     ▼
                        < 50ms Triage                        > 400 Chars Auto-Pass

Persistent RAM Caching (Chrome)

Chrome's background service worker previously terminated the offscreen document post-eval, triggering full 28MB model re-downloads and re-compilations on subsequent queries (~10s latency). Implementing chrome.offscreen.hasDocument() checks keeps the offscreen document permanently warm in memory, bringing inference evaluation down to <50ms.

Zero-Shot Label Engineering

Candidate labels and hypothesis templates for distilbert-base-uncased-mnli were recalibrated for high-contrast output:

3. DOM Interception & SPA Route Lifecycle

Handling Single Page Application (SPA) state transitions across ChatGPT, Claude, Gemini, and X.com (Grok) required refactoring event capture strategies:

4. Firefox AMO Compatibility & Security Hardening

Firefox MV3 does not support Chrome's offscreen API. To achieve full cross-browser feature parity, the Firefox build was re-engineered for direct in-process WebAssembly execution within the background module.

Runtime & Build Adaptations