Add sovereign-mamba source: Modelfile, kernel Prolog gates, sovereign_crypto Rust, Lean4, corpus policy
0427fad verified | <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>SnapKitty Nemotron Harness</title> | |
| <style> | |
| :root { | |
| --bg: #0d1117; | |
| --surface: #161b22; | |
| --border: #30363d; | |
| --text: #e6edf3; | |
| --dim: #8b949e; | |
| --accent: #58a6ff; | |
| --green: #3fb950; | |
| --amber: #d29922; | |
| --red: #f85149; | |
| --font: 'SF Mono', 'Cascadia Code', 'Consolas', monospace; | |
| } | |
| *{margin:0;padding:0;box-sizing:border-box} | |
| body{background:var(--bg);color:var(--text);font-family:var(--font);padding:24px;max-width:1080px;margin:0 auto} | |
| h1{font-size:18px;font-weight:600;letter-spacing:0.5px;padding-bottom:12px;border-bottom:1px solid var(--border);margin-bottom:8px} | |
| .sub{color:var(--dim);font-size:12px;margin-bottom:20px} | |
| .panel{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:16px;margin-bottom:16px} | |
| .grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:16px} | |
| .triple{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;margin-bottom:16px} | |
| label{font-size:11px;color:var(--dim);display:block;margin-bottom:4px} | |
| textarea,input{width:100%;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:8px 12px;font-family:var(--font);font-size:13px} | |
| select{width:100%;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:8px 12px;font-family:var(--font);font-size:13px} | |
| textarea{height:80px;resize:vertical;line-height:1.5} | |
| button{background:var(--accent);color:#fff;border:none;border-radius:6px;padding:8px 20px;font-family:var(--font);font-size:13px;font-weight:500;cursor:pointer} | |
| button:hover{opacity:0.9} | |
| pre{font-size:12px;line-height:1.6;color:var(--text);white-space:pre-wrap;max-height:400px;overflow:auto;margin:0} | |
| .mono{font-family:var(--font);font-size:12px} | |
| .green{color:var(--green)} | |
| .amber{color:var(--amber)} | |
| .red{color:var(--red)} | |
| .dim{color:var(--dim)} | |
| .stat{font-size:11px;padding:2px 0} | |
| .badge{display:inline-block;padding:1px 8px;border-radius:4px;font-size:10px;font-weight:500} | |
| .badge.green{background:#1a3a2a;color:var(--green)} | |
| .badge.amber{background:#2d2410;color:var(--amber)} | |
| .badge.red{background:#3a1a1a;color:var(--red)} | |
| .tok{color:var(--accent)} | |
| .row{display:flex;gap:8px;align-items:center;flex-wrap:wrap} | |
| @media (max-width: 840px){.grid,.triple{grid-template-columns:1fr}} | |
| </style> | |
| </head> | |
| <body> | |
| <h1>SNAPKITTY NEMOTRON HARNESS</h1> | |
| <p class="sub">Constitutional AI · Plasma Gate Kernel · WORM-sealed · Bifrost Audited</p> | |
| <div class="grid"> | |
| <div class="panel"> | |
| <div class="dim" style="font-size:11px;margin-bottom:4px">MODEL</div> | |
| <div style="font-size:13px">snapkitty-nemotron</div> | |
| <div style="font-size:11px;color:var(--green);margin-top:2px">constitutional AI</div> | |
| </div> | |
| <div class="panel"> | |
| <div style="display:flex;gap:12px;flex-wrap:wrap"> | |
| <div><div class="dim" style="font-size:11px">MODE</div><div style="font-size:13px">executor</div></div> | |
| <div><div class="dim" style="font-size:11px">ROLE</div><div style="font-size:13px">untrusted compute</div></div> | |
| <div><div class="dim" style="font-size:11px">KERNEL</div><div style="font-size:13px;color:var(--accent)">plasma_gate.pl</div></div> | |
| <div><div class="dim" style="font-size:11px">AXIOMS</div><div style="font-size:13px"><span id="axiomCount" class="green">14</span></div></div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="triple"> | |
| <div class="panel"> | |
| <div class="dim" style="font-size:11px;margin-bottom:4px">OLLAMA</div> | |
| <div id="ollamaHealth" style="font-size:13px">Checking…</div> | |
| <div id="ollamaBase" class="dim" style="font-size:11px;margin-top:4px"></div> | |
| </div> | |
| <div class="panel"> | |
| <div class="dim" style="font-size:11px;margin-bottom:4px">RESOLVED MODEL</div> | |
| <div id="resolvedModel" style="font-size:13px">—</div> | |
| <div id="modelCount" class="dim" style="font-size:11px;margin-top:4px"></div> | |
| </div> | |
| <div class="panel"> | |
| <div class="dim" style="font-size:11px;margin-bottom:4px">RECEIPTS</div> | |
| <div id="receiptDir" style="font-size:13px">—</div> | |
| <div id="kernelStatus" class="dim" style="font-size:11px;margin-top:4px"></div> | |
| </div> | |
| </div> | |
| <div class="panel"> | |
| <div class="grid" style="margin-bottom:12px"> | |
| <div> | |
| <label>Model</label> | |
| <select id="modelSelect"></select> | |
| </div> | |
| <div> | |
| <label>Prompt preset</label> | |
| <select id="presetSelect"> | |
| <option value="">Custom prompt</option> | |
| <option value="⚙️ Review the current Lean file. Emit <|lean_gate|>. Seal all results with <|receipt_seal|>.">Lean gate review</option> | |
| <option value="⚙️ Read the trust deed through <|file_read|> and summarize allowed syscalls. Seal result with <|receipt_seal|>.">Trust deed summary</option> | |
| <option value="⚙️ Run in executor mode. Classify this task as ACCEPTED, APPROVAL_REQUIRED, or REJECTED and emit the needed syscall tokens only.">Gate-only classification</option> | |
| </select> | |
| </div> | |
| </div> | |
| <label>Prompt</label> | |
| <textarea id="promptInput" placeholder="Enter a task for the model..."></textarea> | |
| <div class="row" style="margin-top:10px"> | |
| <button onclick="runPrompt()">Run</button> | |
| <button onclick="runRawPrompt()" style="background:transparent;border:1px solid var(--border)">Raw</button> | |
| <button onclick="refreshHealth()" style="background:transparent;border:1px solid var(--border)">Refresh</button> | |
| <span id="status" class="dim" style="font-size:12px"></span> | |
| </div> | |
| </div> | |
| <div class="panel"> | |
| <div style="display:flex;justify-content:space-between;margin-bottom:10px"> | |
| <div style="font-size:13px;font-weight:500">Model Output</div> | |
| <div id="gateDisplay" class="dim" style="font-size:11px"></div> | |
| </div> | |
| <pre id="modelOutput" style="min-height:60px">Run a prompt to see output.</pre> | |
| </div> | |
| <div id="resultsArea" style="display:none"> | |
| <div class="grid"> | |
| <div class="panel"> | |
| <div style="font-size:13px;font-weight:500;margin-bottom:8px">Syscalls</div> | |
| <div id="syscallList" class="mono"></div> | |
| </div> | |
| <div class="panel"> | |
| <div style="font-size:13px;font-weight:500;margin-bottom:8px">Axiom Execution (Plasma Gate)</div> | |
| <div id="axiomList" class="mono"></div> | |
| </div> | |
| </div> | |
| <div class="panel"> | |
| <div style="font-size:13px;font-weight:500;margin-bottom:8px">Receipt</div> | |
| <div id="receiptDisplay" class="mono" style="font-size:11px;line-height:1.8"></div> | |
| </div> | |
| </div> | |
| <script> | |
| const promptInput = document.getElementById("promptInput"); | |
| const modelSelect = document.getElementById("modelSelect"); | |
| const presetSelect = document.getElementById("presetSelect"); | |
| presetSelect.addEventListener("change", () => { | |
| if (presetSelect.value) promptInput.value = presetSelect.value; | |
| }); | |
| async function fetchJson(url, options) { | |
| const response = await fetch(url, options); | |
| const data = await response.json(); | |
| if (!response.ok) throw new Error(data.error || `Request failed (${response.status})`); | |
| return data; | |
| } | |
| async function refreshHealth() { | |
| try { | |
| const [health, models] = await Promise.all([ | |
| fetchJson("/api/health"), | |
| fetchJson("/api/models") | |
| ]); | |
| document.getElementById("ollamaHealth").innerHTML = `<span class="green">Connected</span>`; | |
| document.getElementById("ollamaBase").textContent = health.ollama.baseUrl; | |
| document.getElementById("resolvedModel").textContent = models.resolvedModel || "—"; | |
| document.getElementById("modelCount").textContent = `${models.models.length} model(s) visible`; | |
| document.getElementById("receiptDir").textContent = health.receipts.dir; | |
| document.getElementById("kernelStatus").textContent = `plasma=${health.kernel.plasmaGate ? "on" : "off"} · lean=${health.lean.exists ? "on" : "off"}`; | |
| const current = modelSelect.value; | |
| modelSelect.innerHTML = ""; | |
| models.models.forEach((model) => { | |
| const option = document.createElement("option"); | |
| option.value = model.name; | |
| option.textContent = `${model.name}${model.name === models.resolvedModel ? " (default)" : ""}`; | |
| modelSelect.appendChild(option); | |
| }); | |
| if (current && [...modelSelect.options].some(option => option.value === current)) { | |
| modelSelect.value = current; | |
| } else if (models.resolvedModel) { | |
| modelSelect.value = models.resolvedModel; | |
| } | |
| } catch (error) { | |
| document.getElementById("ollamaHealth").innerHTML = `<span class="red">Offline</span>`; | |
| document.getElementById("ollamaBase").textContent = error.message; | |
| document.getElementById("status").textContent = "health check failed"; | |
| } | |
| } | |
| async function runPrompt() { | |
| const prompt = document.getElementById("promptInput").value.trim(); | |
| if (!prompt) return; | |
| const el = document.getElementById("modelOutput"); | |
| el.textContent = "Running..."; | |
| document.getElementById("status").textContent = "querying model..."; | |
| document.getElementById("resultsArea").style.display = "none"; | |
| try { | |
| const data = await fetchJson("/api/ollama", { | |
| method: "POST", | |
| headers: {"Content-Type":"application/json"}, | |
| body: JSON.stringify({ prompt, model: modelSelect.value || undefined }) | |
| }); | |
| el.textContent = data.raw; | |
| document.getElementById("status").textContent = `done · ${data.usedModel}`; | |
| document.getElementById("gateDisplay").textContent = data.receipt.status; | |
| // Syscalls | |
| const syscalls = data.syscalls; | |
| let shtml = ""; | |
| if (syscalls.detected.length === 0) { | |
| shtml = '<span class="dim">No syscall tokens detected</span>'; | |
| } else { | |
| syscalls.gate.forEach((g) => { | |
| const cls = g.verdict === "ALLOW" ? "green" : g.verdict === "APPROVAL_REQUIRED" ? "amber" : "red"; | |
| shtml += `<div style="display:flex;justify-content:space-between;padding:3px 0">`; | |
| shtml += `<span class="tok"><|${g.syscall}|></span> <span class="badge ${cls}">${g.verdict}</span></div>`; | |
| }); | |
| } | |
| document.getElementById("syscallList").innerHTML = shtml; | |
| // Axioms | |
| const ax = data.axioms; | |
| let ahtml = `<div style="margin-bottom:6px">Status: <span class="${ax.allPass ? 'green' : 'red'}">${ax.allPass ? 'ALL PASS' : 'SOME FAILED'}</span></div>`; | |
| ax.results.forEach((r) => { | |
| const cls = r.pass ? "green" : "red"; | |
| const name = r.id.replace("ax_", ""); | |
| ahtml += `<div style="padding:3px 0;border-bottom:1px solid var(--border);display:flex;justify-content:space-between">`; | |
| ahtml += `<span><span class="${cls}" style="font-weight:500;margin-right:6px">${r.pass ? '✓' : '✗'}</span>${name}</span>`; | |
| ahtml += `<span class="dim" style="font-size:11px">${r.output}</span></div>`; | |
| }); | |
| document.getElementById("axiomList").innerHTML = ahtml; | |
| // Receipt | |
| const rc = data.receipt; | |
| document.getElementById("receiptDisplay").innerHTML = ` | |
| <div><span class="dim">ID</span> <span class="green">${rc.id}</span></div> | |
| <div><span class="dim">Time</span> ${rc.timestamp}</div> | |
| <div><span class="dim">Model</span> ${data.usedModel}</div> | |
| <div><span class="dim">Status</span> <span class="${rc.status === 'ACCEPTED' ? 'green' : rc.status === 'APPROVAL_REQUIRED' ? 'amber' : 'red'}">${rc.status}</span></div> | |
| <div><span class="dim">Kernel</span> ${rc.kernel}</div> | |
| <div><span class="dim">Trust Deed</span> ${rc.trust_deed} v${rc.version}</div> | |
| <div><span class="dim">Receipt Dir</span> ${rc.receiptsDir}</div> | |
| <div><span class="dim">Axioms</span> ${ax.allPass ? 'PASS' : 'FAIL'} (${ax.results.filter(r => r.pass).length}/${ax.results.length})</div> | |
| <div><span class="dim">Syscalls</span> ${rc.syscalls.detected.length > 0 ? rc.syscalls.detected.map(s => '<|' + s + '|>').join(', ') : 'none'}</div>`; | |
| document.getElementById("resultsArea").style.display = "block"; | |
| } catch (e) { | |
| el.textContent = "Error: " + e.message; | |
| document.getElementById("status").textContent = "error"; | |
| } | |
| } | |
| async function runRawPrompt() { | |
| const prompt = document.getElementById("promptInput").value.trim(); | |
| if (!prompt) return; | |
| const el = document.getElementById("modelOutput"); | |
| el.textContent = "Running raw prompt..."; | |
| document.getElementById("status").textContent = "querying raw model..."; | |
| document.getElementById("resultsArea").style.display = "none"; | |
| try { | |
| const data = await fetchJson("/api/ollama/raw", { | |
| method: "POST", | |
| headers: {"Content-Type":"application/json"}, | |
| body: JSON.stringify({ prompt, model: modelSelect.value || undefined }) | |
| }); | |
| el.textContent = data.output; | |
| document.getElementById("status").textContent = `raw done · ${data.model}`; | |
| document.getElementById("gateDisplay").textContent = "raw"; | |
| } catch (e) { | |
| el.textContent = "Error: " + e.message; | |
| document.getElementById("status").textContent = "raw error"; | |
| } | |
| } | |
| refreshHealth(); | |
| </script> | |
| </body> | |
| </html> | |