aboutsummaryrefslogtreecommitdiff
path: root/downloads/newos4_whitepaper.html
blob: 46c1397c95e48d311e7a6041e630ceb64ed7a6e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>newOS4 Whitepaper</title>
    <style>
        body {
            background-color: #000;
            color: #e0e0e0;
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            line-height: 1.6;
            max-width: 900px;
            margin: 0 auto;
            padding: 40px 20px;
        }
        h1 {
            color: #fff;
            border-bottom: 2px solid #333;
            padding-bottom: 10px;
            font-size: 2.5em;
            text-align: center;
        }
        h2 {
            color: #00ffcc;
            border-bottom: 1px solid #222;
            margin-top: 40px;
            padding-bottom: 5px;
        }
        h3 {
            color: #00ccff;
            margin-top: 30px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
            background-color: #111;
        }
        th, td {
            border: 1px solid #333;
            padding: 12px;
            text-align: left;
        }
        th {
            background-color: #222;
            color: #00ffcc;
        }
        pre {
            background-color: #111;
            padding: 15px;
            border: 1px solid #333;
            border-left: 4px solid #00ffcc;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
            color: #d0d0d0;
        }
        code {
            background-color: #222;
            padding: 2px 5px;
            border-radius: 3px;
            color: #ffcc00;
        }
        .meta {
            text-align: center;
            font-style: italic;
            color: #888;
            margin-bottom: 40px;
        }
        .status-done { color: #00ff00; }
        .status-progress { color: #ffff00; }
        hr { border: 0; border-top: 1px solid #333; margin: 40px 0; }
        footer {
            text-align: center;
            font-size: 0.8em;
            color: #555;
            margin-top: 60px;
            padding-bottom: 20px;
        }
    </style>
</head>
<body>

    <h1>newOS4 — The Cognitive Operating System</h1>
    
    <div class="meta">
        Whitepaper v4.3.1 | Author: Agando | Status: Architecture Draft | Last Updated: 2026-06-04
    </div>

    <section>
        <h2>1. Abstract</h2>
        <p>newOS4 is a <strong>Cognitive Operating System</strong> — an agentic, AI-native fabric where intelligence is treated not as an application layer but as the kernel's primary resource. Unlike traditional OSs that manage CPU cycles and memory pages, newOS4 manages <strong>agentic workflows, semantic storage, and recursive self-optimization</strong> as first-class primitives.</p>
        <p>The system is built on four pillars, all now operational:</p>
        <table>
            <thead>
                <tr><th>Pillar</th><th>Function</th><th>Status</th></tr>
            </thead>
            <tbody>
                <tr><td><strong>Hyper-Modular Kernel</strong></td><td>46 hot-swappable ES modules across 3 layers (infrastructure, core, ext)</td><td class="status-done">✅ LIVE</td></tr>
                <tr><td><strong>A2A Protocol</strong></td><td>Agent contracts with schema validation, orchestrator handshake, no central broker</td><td class="status-done">✅ LIVE</td></tr>
                <tr><td><strong>Neural VFS</strong></td><td>Semantic concept indexing with nvfs-index, nvfs-resolve, nvfs-tree, nvfs-status + concept:// URI handler</td><td class="status-done">✅ LIVE</td></tr>
                <tr><td><strong>Recursive Self-Optimization</strong></td><td>system-health telemetry command logging tool latency, VFS stats, module counts, error rates</td><td class="status-done">✅ LIVE</td></tr>
            </tbody>
        </table>
    </section>

    <section>
        <h2>2. Motivation & Problem Space</h2>
        <p>Modern operating systems (Linux, Windows, macOS) were designed for a world where hardware resources were the binding constraints and the user was the sole intelligent agent. This model breaks under three converging trends:</p>
        <ul>
            <li><strong>Agent proliferation</strong> — LLM-based agents now outnumber human operators.</li>
            <li><strong>Dynamic compute</strong> — Serverless and edge compute require OS-level agility.</li>
            <li><strong>Self-modifying code</strong> — AI systems need to rewrite their own toolchain without reboot cycles.</li>
        </ul>
        <p>newOS4 addresses all three by making <strong>intelligence the kernel primitive</strong>.</p>
    </section>

    <section>
        <h2>3. System Architecture</h2>
        <h3>3.1 Layered Model</h3>
        <pre>
┌──────────────────────────────────────────────────────────┐
│                   Cognitive Shell                         │
│    (WebX11 Terminal / AI Assist / Graph Dashboard)       │
├──────────────────────────────────────────────────────────┤
│                Agent Orchestration Layer                  │
│    (Multi-agent router, A2A handshake, lease system)     │
├──────────────────────────────────────────────────────────┤
│                   A2A Protocol Layer                      │
│    (Contract registry, schema validation, RPC bus)       │
├──────────────────────────────────────────────────────────┤
│                Hyper-Modular Kernel                       │
│    [infrastructure] module-loader, module-manager, terminal, virtual-fs, ollama-manager│
│    [core] 23 modules — AI, ollama, orchestration, ...    │
│    [ext] 18 modules — editor, mindmap, webdav, cron ...  │
├──────────────────────────────────────────────────────────┤
│              Neural VFS + Procedural Memory                │
│    (Semantic indexing, concept:// URIs, skill graph)     │
└──────────────────────────────────────────────────────────┘
        </pre>

        <h3>3.2 The Trinity of Cognition</h3>
        <p>newOS4 fuses three cognitive primitives:</p>
        <ul>
            <li><strong>Perception</strong> — Sensory input via agent sensors, web fetch, file I/O, and human chat (Maps to I/O)</li>
            <li><strong>Reasoning</strong> — Contextual inference via LLM backbone + procedural memory (Maps to Scheduler)</li>
            <li><strong>Action</strong> — Tool execution via sandboxed syscalls and agent delegation (Maps to Execution)</li>
        </ul>

        <h3>3.3 Module Layer Separation</h3>
        <p>New in v4.3.1: All 46 modules are classified into three distinct layers tracked in <code>modules-index.json</code>:</p>
        <table>
            <thead>
                <tr><th>Layer</th><th>Count</th><th>Load Strategy</th><th>Examples</th></tr>
            </thead>
            <tbody>
                <tr><td><strong>Infrastructure</strong></td><td>5</td><td>Loaded by constructor (no user-facing commands)</td><td>module-loader, module-manager, ollama-manager, terminal, virtual-fs</td></tr>
                <tr><td><strong>Core</strong></td><td>23</td><td>Boot-loaded from BUILTIN list</td><td>aiassist, servermon, ollama, orchestration, neural-vfs, secret-vault</td></tr>
                <tr><td><strong>Extension</strong></td><td>18</td><td>Demand-loaded via packages.json</td><td>editor, mindmap, webdav, cron, theme, wpm, calc, voice</td></tr>
            </tbody>
        </table>
        <p>The <code>modules-list</code> terminal command displays layer tags <code>[core]</code>, <code>[ext]</code>, <code>[infra]</code> for instant visibility. <code>view_module</code> and <code>get_module_status</code> resolve file paths from the index, eliminating class-name heuristics.</p>
    </section>

    <section>
        <h2>4. Pillar Deep Dives</h2>
        <h3>4.1 Hyper-Modular Kernel</h3>
        <p>The kernel is a collection of 46 hot-swappable driver modules across three layers:</p>
        <ul>
            <li><strong>Infrastructure</strong> (5) — module-loader, module-manager, ollama-manager, terminal, virtual-fs. Loaded by the constructor, providing boot-time services.</li>
            <li><strong>Core</strong> (23) — AI assist, server monitor, ollama, orchestration, agent registry, neural VFS, mod manager, secret-vault, and more. Boot-loaded from the <code>BUILTIN</code> list at startup.</li>
            <li><strong>Extension</strong> (18) — editor, mindmap, webdav, cron, diff, theme, wpm, calc, voice, busybox, cryptogzip, filemgr, shell, alias, finder, tutorial, skill-pack-core, test-suite. Demand-loaded via <code>packages.json</code>.</li>
        </ul>
        <p>All modules tracked in <code>modules-index.json</code> — the single source of truth for module-to-file mapping, class names, and load strategies. Layer separation eliminates confusion about which modules are core OS vs. user-installable packages.</p>
        <p>Cache versioning via <code>?v=2026-06-03-neuralvfs</code> query parameter ensures all module loads use fresh files after system updates.</p>

        <h3>4.2 A2A Protocol</h3>
        <p>Agent-to-Agent (A2A) is a standardized message format for agent negotiation. Agents register contracts with schema validation via <code>contract-register</code>, discover each other via <code>contract-list</code>, and negotiate task delegation without a central broker.</p>
        <p>The orchestrator performs an A2A handshake before delegating tasks: it queries the contract registry for available agents matching the required capability, validates schemas, and negotiates a lease. This eliminates hardcoded agent routing in favor of dynamic capability discovery.</p>
        <p>Key commands: <code>contract-register &lt;name&gt; &lt;capability&gt;</code>, <code>contract-list</code>, <code>validateTask &lt;contract_id&gt; &lt;payload&gt;</code>.</p>
        <p>Contracts persist in VFS under <code>/system/contracts/</code> and survive page reloads.</p>

        <h3>4.3 Neural VFS</h3>
        <p>Replaces hierarchical paths with semantic addressing. Users access files by concept rather than directory tree path.</p>
        <p>Four terminal commands:</p>
        <ul>
            <li><code>nvfs-index</code> — Builds a semantic index of all VFS files, mapping concepts to file paths.</li>
            <li><code>nvfs-status</code> — Shows index statistics (total concepts indexed, coverage).</li>
            <li><code>nvfs-resolve &lt;concept&gt;</code> — Resolves a concept to its file path(s).</li>
            <li><code>nvfs-tree [concept]</code> — Displays the semantic index as a concept tree.</li>
        </ul>
        <p>Plus <code>concept://</code> URI handler integrated into VFS <code>readFile()</code> and <code>ls()</code> — <code>cat concept://skill</code> resolves through the semantic index and returns actual file content. An AI tool <code>nvfs_resolve</code> is also available for AI-assisted concept lookups.</p>

        <h3>4.4 Recursive Self-Optimization</h3>
        <p>The loop: <code>Monitor → Profile → Diagnose → Patch → Test → Promote</code>.</p>
        <p>The <code>system-health</code> command provides real-time telemetry:</p>
        <ul>
            <li><strong>Tool Latency</strong> — Per-tool timing tracked in <code>/system/metrics/tool-latency.json</code>.</li>
            <li><strong>VFS Stats</strong> — File count, directory count, total storage used.</li>
            <li><strong>Module Stats</strong> — Loaded module count, registered agent count.</li>
            <li><strong>Memory</strong> — Current usage vs. 4GB limit, tool call counts, error rates.</li>
        </ul>
        <p>Telemetry hooks are embedded in the AI tool-calling paths (safe and destructive) within <code>module-aiassist.js</code>, automatically logging every tool invocation. This data feeds future latency diagnosis and WPM patch generation.</p>
    </section>

    <section>
        <h2>5. Roadmap</h2>
        <h3>Phase 1 — Foundation <span class="status-done">✅ COMPLETED</span></h3>
        <p>Expanded from original scope to 25+ features, including:</p>
        <ul>
            <li>WebX11 terminal with fuzzy suggestions and security tiers.</li>
            <li>VFS with <code>localStorage</code> backend.</li>
            <li>Procedural Memory (Skills system) and Hot-reload pipeline.</li>
            <li>Proxy API for search/fetch, Ollama Manager, and AI Tool System.</li>
            <li>Multi-theme support and comprehensive Documentation.</li>
            <li>WebDAV UI, Voice module, and BusyBox compatibility.</li>
            <li>Security layer (0-3) and WPM lifecycle management.</li>
        </ul>

        <h3>Phase 2 — Agentic Shift <span class="status-done">✅ COMPLETED</span></h3>
        <ul>
            <li>✅ AI tool-calling loop (19+ tools).</li>
            <li>✅ <code>session_terminal</code> zero-cost context access.</li>
            <li>✅ Tool failure buffer and auto-skill creation.</li>
            <li>✅ Agent orchestration (list, register, lease, orchestrate).</li>
            <li>✅ <strong>Localized Asset Management</strong> (Bypassing server security blocks).</li>
        </ul>

        <h3>Phase 3 — Cognitive OS <span class="status-done">✅ COMPLETE</span></h3>
        <ul>
            <li>✅ Neural VFS — semantic concept indexing (nvfs-index, nvfs-resolve, nvfs-tree, nvfs-status).</li>
            <li>✅ concept:// URI handler integrated into VFS readFile/ls (cat concept://skill works).</li>
            <li>✅ A2A Protocol — agent contracts with schema validation, orchestrator handshake (contract-register, contract-list).</li>
            <li>✅ A2A VFS mailbox transport — a2a-send, a2a-list, 500ms polling.</li>
            <li>✅ Agent lifecycle management (sleep/wake, VFS serialization, auto-reanimate).</li>
            <li>✅ Autonomous sub-agent spawning with task-derived roles.</li>
            <li>✅ Agent health monitoring and restart policies with exponential backoff.</li>
            <li>✅ Recursive self-optimization — system-health telemetry command.</li>
            <li>✅ Module layer separation — 51 modules across infrastructure/core/ext with modules-index.json.</li>
            <li>✅ Sandboxed execution contexts via WebWorker pool (1-4 workers, VFS snapshots).</li>
            <li>✅ Cross-session persistent memory graphs — 5 node types, weighted edges, VFS persistence.</li>
            <li>✅ Predictive resource allocation — task duration/turns prediction from historical data.</li>
            <li>✅ Global World Model — system self-awareness synthesis from all subsystems.</li>
        </ul>

        <h3>Phase 4 — Agent Safety Security Layer <span class="status-done">✅ RELEASED</span></h3>
        <ul>
            <li>✅ <strong>Guardrail Layer</strong> — Pre-execution policy engine (8 rules) intercepts AI tool calls matching dangerous patterns (<code>rm -rf</code>, <code>curl|bash</code>, <code>chmod 777</code>, <code>eval</code>, mass-delete, sensitive metadata deletion, external downloads, env overwrites). Policy stored in localStorage, editable via <code>guardrail-add</code> / <code>guardrail-remove</code>.</li>
            <li>✅ <strong>Confidence Escalation</strong> — AI must declare <code>Confidence: N%</code> in its reasoning before executing destructive actions. Below 90% → manual approval. No confidence declared → manual approval required by default.</li>
            <li>✅ <strong>Shadow VFS</strong> — <code>shadow &lt;command&gt;</code> snapshots VFS state, runs the command, diffs all filesystem changes. User can <code>shadow-commit</code> or <code>shadow-rollback</code>. AI's <code>run_command</code> tool auto-snapshots and appends shadow diff to every result.</li>
        </ul>
    </section>

    <footer>
        Copyright © 2026 Agando. Distributed under the newOS4 Adaptive License.
    </footer>

</body>
</html>