This document turns HAVEN from a set of overlapping experiments into one canonical engineering direction.
HAVEN is a local-first developer environment built to serve humans before markets.
It is not a cloud-first chat wrapper. It is a sovereign workbench:
- local by default
- multilingual by design
- inspectable in code
- useful on modest hardware
- honest about tradeoffs
The winning edge is not "more AI magic." The winning edge is trustworthy local intelligence with real developer utility: code work, memory, routing, ops, and forensics.
Official source of truth:
C:\Users\Iqd20\OneDrive\OFFICIAL
Reference only:
C:\Users\Iqd20\Downloads\haven-electron
Do not treat extracted, portable, unpacked, or .exe artifacts as development sources.
The current repository already contains the main layers we need:
- Frontend shell:
src/ - IDE and orchestration logic:
src/ide/engine/ - Desktop native bridge:
src-tauri/src/lib.rs - Portable Rust core candidates:
niyah-core/
Important live modules:
src/ide/engine/NiyahEngine.tssrc/ide/engine/ModelRouter.tssrc/ide/engine/ThreeLobeAgent.tssrc/ide/engine/OllamaService.tssrc/ide/engine/SovereignTauri.tssrc-tauri/src/lib.rsniyah-core/bridge.rsniyah-core/forensics.rs
Downloads contains useful ideas, but not canonical code.
What to port deliberately:
niyah_v4.py: command surface, provider switching, SQLite memory patternsdragon403.py: ops and forensics workflows worth translating into stable modulesmaster_Building_v5.sh: deployment ideas only, not raw production logic
What not to port directly:
- hardcoded IPs
- environment-specific shell automation
- extracted app bundles
- duplicated packaging outputs
The long-term architecture should converge on five layers.
Rust core shared by desktop and future CLI:
- model routing
- privacy policy enforcement
- workspace state
- memory access
- forensics packaging
- health checks
This should grow inside niyah-core/ until it becomes the reusable heart of the product.
Tauri remains the official desktop runtime because it is lighter and cleaner than the Electron copies.
Responsibilities:
- native window shell
- secure local IPC
- updater hooks
- local Ollama bootstrap
- file-system and process capabilities
React + Monaco remains the visual workbench.
Responsibilities:
- code editing
- conversation panel
- memory viewer
- model/router status
- forensics and ops panels
Build a real niyah or haven CLI from the same shared core instead of letting scripts drift separately.
Minimum command surface:
niyah askniyah modelniyah memoryniyah opsniyah forensicsniyah doctor
The CLI must call the same routing and storage logic as the desktop app.
Plugins must be capability-based and local-first.
Preferred order:
- local internal commands
- file-based extensions
- sandboxed Wasm plugins
Do not build a cloud marketplace.
Non-negotiables:
- no telemetry by default
- no dark patterns
- no fake "fully local" claims if any feature is remote
- no premium lock on dignity, privacy, or basic access
- no Arabic-only design; Arabic matters, but the tool must serve all humans
The product must remain useful for:
- Arabic speakers
- English speakers
- low-budget users
- offline users
- high-sensitivity engineering work
Every architecture decision should support verification, not just policy language.
Required properties:
- local-first model routing
- explicit remote opt-in only
- auditable outbound behavior
- local memory ownership
- reproducible builds when possible
- signed releases when practical
Target trust features:
- audit log for model/provider usage
- visible local-vs-remote status in UI
- safe browser-mode behavior
- no hidden external calls from editor/runtime assets
Priority 1: Stabilize the current Tauri desktop experience.
- remove reload loops
- keep local model startup reliable
- make IDE launch deterministic
- keep browser fallback safe
Priority 2: Extract shared core logic.
- move routing and diagnostic logic toward
niyah-core - reduce duplication between frontend orchestration and native bridge
Priority 3: Build the real CLI.
- port the best ideas from
niyah_v4.py - keep command grammar stable
- make it scriptable and human-readable
Priority 4: Add disciplined ops and forensics.
- package evidence locally
- run health checks cleanly
- never ship environment-specific server assumptions
Priority 5: Add memory that stays understandable.
- start with SQLite relational memory
- add semantic retrieval only after the base is reliable
- include expiration and deletion controls
Avoid these traps:
- competing with cloud tools on hype or feature count
- keeping multiple "official" codebases alive
- building a chat toy instead of an engineering tool
- adding cloud sync early
- adding plugin hosting before local capability boundaries are real
Week 1:
- stabilize desktop runtime
- confirm one source of truth
- clean identity and metadata
Week 2:
- define shared core interfaces
- extract or mirror routing/health primitives into
niyah-core
Week 3:
- scaffold CLI commands against the shared core
- port minimal memory and model status flows
Week 4:
- wire forensics packaging and doctor/health flows
- document architecture and operating model
HAVEN wins if a developer can say:
"My code stayed on my machine, the tool was useful, and I can inspect what it did."
That is a better north star than trying to look like a cloud copilot.