System
AI Coding & Codebase Governance Standards
Version: 1.0
Audience: AI Models Contributing to Codebase (RipkaAI, ParthAI, AAdi, etc.)
Maintainer: Swanaya Gupta (Project Owner / OS Researcher)
π― 1. Purpose of This Guide
This document defines strict rules and workflows for AI models modifying, generating, or maintaining ZepraBrowserβs source code.
It ensures that:
- AI-generated code never breaks architecture
- AI patches remain consistent with project design
- AI models keep the browser stable, modular, and performant
- No accidental rewrite, duplication, or structural corruption occurs
- Code contributions stay professional, minimal, and industry-standard
This guide is required for all automated agents in the Ketivee ecosystem.
π§© 2. ZepraBrowser Core Principles (AI MUST Follow)
βοΈ Modularity
Every feature must be inside its correct subsystem:
- ZebraScript β JavaScript Engine
- WebCore β Rendering, DOM, CSS, Layout
- ZepraEngine β Window/Tab/UI integration
- Networking β HTTP, WebSockets
- Storage β LocalStorage, IDB, Cache
- Platform β OS-specific wrappers
- Sandbox β Process isolation
- AI Engine β AI integrations only
- Search Engine β Query routing logic
AI must NOT mix responsibilities.
βοΈ Backward Compatibility
AI-generated changes must never:
- Break existing public headers
- Rename core classes without explicit instruction
- Remove or alter subsystem boundaries
- Change CMake targets unless approved
βοΈ Minimalism
AI code must be:
- Short
- Clean
- No unnecessary comments
- No repeating logic
- No unused variables
- No dead code
This keeps file size and readability high.
π« 3. Actions AI is NOT allowed to perform
AI must NOT:
- Modify
source/zepraScript/without explicit instruction - Change folder structure
- Edit LICENSE
- Remove or rewrite WebCore foundational components
- Auto-format large parts of the codebase
- Mix UI code with engine code
- Generate non-standard naming conventions
- Introduce external dependencies not listed by the user
If unsure β AI must ask.
π 4. Allowed AI Operations
AI is allowed to:
βοΈ Add new files inside correct module
source/webCore/layout/flow_layout.cppβοΈ Fix bugs with minimal code changes
Only modify the exact lines needed.
βοΈ Implement missing functions using existing architecture
βοΈ Generate new modules when instructed
AI must follow directory structure perfectly.
βοΈ Refactor code only in small, isolated units
π§ 5. AI Understanding of File Responsibilities
src/- Browser application logic (UI, search bar, panels, etc.)source/webCore/- HTML β DOM β CSS β Layout β Rendering pipelinesource/zepraScript/- Full JavaScript VM (AI should not touch unless Swanaya explicitly tells)source/networking/- HTTP, DNS, TLS, cachingsource/platform/- Windowing, OS events, clipboard, notificationssource/aiEngine/- AI logic, page analysis, smart actions, Gemini, Parth, Ripka integrationssource/devtools/- Inspector UI and mechanics
π 6. AI Change Workflow (AI MUST Follow)
Here is the procedural flow an AI must follow before modifying code:
Step 1 β Understand Developer Intent
AI must not assume requirements. If user message is unclear β AI asks clarifying questions.
Step 2 β Identify Correct Module
AI must locate the appropriate subsystem.
Example: If user asks to modify request headers β go to source/networking/http_request.cpp.
If user asks to add flexbox stretching β go to source/webCore/layout/flex_layout.cpp.
Step 3 β Verify No Architectural Violations
AI must cross-check changes with modularity rules, privacy rules, platform separation, and dependencies.
If a change violates these, AI must warn and ask for approval.
Step 4 β Generate Minimal Patch
AI produces only the changed code blocks, not the entire file, no comments like βadd thisβ, no explanations inside code, no unrelated modifications.
// Correct minimal patch node->setDirty(true); layout_tree->update(node);Step 5 β Reconfirm Compatibility
AI must ensure no breakage of existing APIs, code builds under C++20, no undefined symbols, correct CMake target remains valid.
Step 6 β Provide Test Instructions
AI must generate tests or usage notes if needed:
Run: ./build/bin/ZepraBrowser --test-layoutπ§ͺ 7. AI Testing Requirements
AI-generated code must pass:
- Unit tests: Located in
tests/unit/ - Integration tests: Located in
tests/integration/ - Web Platform Tests: Located in
tests/web_platform/ - Static Analysis: AI must ensure no uninitialized values, no memory leaks, no undefined behavior.
π 8. AI Safety & Privacy Rules (Mandatory)
AI must not log user data, send browser content to external servers, introduce analytics/tracking, or store personal information.
Any external AI usage (Gemini, OpenAI) must pass through source/privacy/
π 9. Multi-Model AI Interaction Rules
AI engines must cooperate, not conflict:
- Parth AI handles real-time tasks
- RipkaAI handles heavy computation, coding, architecture
- AAdi handles image-gen and multimodal assets
- Browser AI Engine coordinates all of them
- External models are *optional* and must be sandboxed
ποΈ 10. Code Style (AI MUST Follow)
- Indentation: 4 spaces
- No trailing spaces
- Naming:
CamelCasefor classes,snake_casefor functions - Headers: no unnecessary includes
- Comments: No comments unless defining architecture (rare)
- Logging: No logging unless user instructs to add diagnostics
π 11. What To Do If AI Encounters Conflicts
If AI cannot validate a safe patch, AI must say:
This change may break the architecture. Please confirm or provide additional context.β 12. Golden Rule for AI in ZepraBrowser
Never rewrite. Always extend.
Never assume. Always confirm.
Never break architecture. Always respect modularity.
π 13. Suggested AI Behavior Examples
When user says: βAdd CSS variable support.β
AI must confirm scope, only modify CSS parser, computed style, DOM style.
When user says: βFix JS event bubbling.β
AI must patch WebCore DOM event system, NOT touch JavaScript engine.
When user says: βAdd new search engine provider.β
AI must update searchEngine module, update JSON configs, Not touch UI unless instructed.
𧬠14. Final AI Self-Test Checklist
Before ANY AI outputs code, it must ask itself:
- β Am I modifying the correct subsystem?
- β Am I respecting existing architecture?
- β Is this the minimal patch?
- β Did user explicitly request this?
- β Will this break backward compatibility?
- β Am I following Swanayaβs coding rules?
End of Guide: Use this document as the constitution for all AI modifications in ZepraBrowser.