@openfluke/welvet 0.3.0 → 0.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,298 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Loom WASM — 345-Item Parity Audit</title>
7
+ <style>
8
+ :root {
9
+ --bg: #050505;
10
+ --panel: #0f0f12;
11
+ --accent: #00d4ff;
12
+ --text: #e0e0e0;
13
+ --dim: #666;
14
+ --pass: #00ff9d;
15
+ --fail: #ff3e3e;
16
+ --warn: #ffcc00;
17
+ --indirect: #00d4ff;
18
+ }
19
+
20
+ * { box-sizing: border-box; margin: 0; padding: 0; }
21
+ body {
22
+ background: var(--bg);
23
+ color: var(--text);
24
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
25
+ overflow-x: hidden;
26
+ line-height: 1.5;
27
+ }
28
+
29
+ .container { max-width: 1400px; margin: 0 auto; padding: 40px 20px; }
30
+
31
+ header {
32
+ border-bottom: 1px solid #222;
33
+ padding-bottom: 20px;
34
+ margin-bottom: 40px;
35
+ display: flex;
36
+ justify-content: space-between;
37
+ align-items: flex-end;
38
+ }
39
+
40
+ h1 {
41
+ font-size: 24px;
42
+ font-weight: 800;
43
+ letter-spacing: -1px;
44
+ color: var(--accent);
45
+ text-transform: uppercase;
46
+ }
47
+
48
+ .stats { display: flex; gap: 30px; }
49
+ .stat-card { text-align: right; }
50
+ .stat-val { font-size: 32px; font-weight: 900; color: #fff; }
51
+ .stat-label { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
52
+
53
+ .controls { margin-bottom: 30px; display: flex; gap: 10px; }
54
+ button {
55
+ background: #1a1a1f;
56
+ border: 1px solid #333;
57
+ color: #fff;
58
+ padding: 10px 20px;
59
+ font-family: inherit;
60
+ font-weight: 600;
61
+ cursor: pointer;
62
+ transition: all 0.2s;
63
+ border-radius: 4px;
64
+ }
65
+ button:hover { background: #2a2a2f; border-color: var(--accent); color: var(--accent); }
66
+ button:disabled { opacity: 0.3; cursor: not-allowed; }
67
+
68
+ .grid {
69
+ display: grid;
70
+ grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
71
+ gap: 20px;
72
+ }
73
+
74
+ .category-card {
75
+ background: var(--panel);
76
+ border: 1px solid #1a1a1f;
77
+ border-radius: 8px;
78
+ padding: 20px;
79
+ display: flex;
80
+ flex-direction: column;
81
+ }
82
+
83
+ .category-title {
84
+ font-size: 14px;
85
+ font-weight: 800;
86
+ margin-bottom: 15px;
87
+ color: var(--dim);
88
+ border-bottom: 1px solid #222;
89
+ padding-bottom: 10px;
90
+ display: flex;
91
+ justify-content: space-between;
92
+ }
93
+
94
+ .item-list {
95
+ font-family: 'JetBrains Mono', 'Courier New', monospace;
96
+ font-size: 11px;
97
+ display: flex;
98
+ flex-direction: column;
99
+ gap: 4px;
100
+ }
101
+
102
+ .item {
103
+ display: flex;
104
+ justify-content: space-between;
105
+ padding: 4px 8px;
106
+ border-radius: 3px;
107
+ background: rgba(255,255,255,0.02);
108
+ }
109
+
110
+ .status-tag {
111
+ font-weight: 700;
112
+ font-size: 9px;
113
+ padding: 2px 6px;
114
+ border-radius: 10px;
115
+ text-transform: uppercase;
116
+ }
117
+
118
+ .PASS { color: var(--pass); background: rgba(0, 255, 157, 0.1); }
119
+ .FAIL { color: var(--fail); background: rgba(255, 62, 62, 0.1); }
120
+ .MISSING { color: var(--dim); background: rgba(255, 255, 255, 0.05); }
121
+ .INDIRECT { color: var(--indirect); background: rgba(0, 212, 255, 0.1); }
122
+
123
+ #terminal {
124
+ margin-top: 40px;
125
+ background: #000;
126
+ border: 1px solid #333;
127
+ border-radius: 4px;
128
+ padding: 15px;
129
+ font-family: 'JetBrains Mono', monospace;
130
+ font-size: 12px;
131
+ color: #888;
132
+ height: 200px;
133
+ overflow-y: auto;
134
+ white-space: pre-wrap;
135
+ }
136
+
137
+ ::-webkit-scrollbar { width: 6px; }
138
+ ::-webkit-scrollbar-track { background: transparent; }
139
+ ::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
140
+
141
+ .glow {
142
+ text-shadow: 0 0 10px var(--accent);
143
+ }
144
+ </style>
145
+ </head>
146
+ <body>
147
+ <div class="container">
148
+ <header>
149
+ <div>
150
+ <h1>Loom Engine — WASM Binary Audit</h1>
151
+ <p class="subtitle" style="font-size: 11px; color: var(--dim); margin-top: 5px;">M-POLY-VTD-0.75-STABLE | Parity Verification Suite</p>
152
+ </div>
153
+ <div class="stats">
154
+ <div class="stat-card">
155
+ <div class="stat-val" id="totalPass">0</div>
156
+ <div class="stat-label">Functions Live</div>
157
+ </div>
158
+ <div class="stat-card">
159
+ <div class="stat-val" id="coverageVal">0%</div>
160
+ <div class="stat-label">Global Coverage</div>
161
+ </div>
162
+ </div>
163
+ </header>
164
+
165
+ <div class="controls">
166
+ <button id="auditBtn" onclick="startAudit()">Initialize Engine Parity Engine</button>
167
+ <button onclick="clearLogs()" style="border: none; color: var(--dim);">Clear Logs</button>
168
+ </div>
169
+
170
+ <div id="grid" class="grid">
171
+ <!-- Dynamic Category Cards -->
172
+ </div>
173
+
174
+ <div id="terminal">Initializing Audit System... Ready for induction.</div>
175
+ </div>
176
+
177
+ <script src="wasm_exec.js"></script>
178
+ <script src="check.js"></script>
179
+ <script>
180
+ let wasmReady = false;
181
+ let expectedApi = null;
182
+
183
+ function log(msg, color = "#888") {
184
+ const t = document.getElementById('terminal');
185
+ const line = document.createElement('div');
186
+ line.style.color = color;
187
+ line.textContent = `[${new Date().toLocaleTimeString()}] ${msg}`;
188
+ t.appendChild(line);
189
+ t.scrollTop = t.scrollHeight;
190
+ }
191
+
192
+ async function init() {
193
+ try {
194
+ log("Fetching expected_api.json...");
195
+ const res = await fetch('./expected_api.json');
196
+ if (!res.ok) throw new Error(`HTTP error! status: ${res.status}`);
197
+ expectedApi = await res.json();
198
+ log("Blueprint loaded. 345 core items mapped.");
199
+
200
+ renderSkeleton();
201
+ } catch (e) {
202
+ log("Initialization Error: " + e.message, "#ff3e3e");
203
+ }
204
+ }
205
+
206
+ function renderSkeleton() {
207
+ const grid = document.getElementById('grid');
208
+ grid.innerHTML = '';
209
+ for (const [cat, items] of Object.entries(expectedApi)) {
210
+ const card = document.createElement('div');
211
+ card.className = 'category-card';
212
+ card.id = `cat-${cat}`;
213
+ card.innerHTML = `
214
+ <div class="category-title">
215
+ <span>${cat}</span>
216
+ <span id="score-${cat}" style="color: var(--accent);">0/${items.length}</span>
217
+ </div>
218
+ <div class="item-list" id="list-${cat}">
219
+ ${items.map(i => `
220
+ <div class="item" id="item-${i.name}">
221
+ <span>${i.name}</span>
222
+ <span class="status-tag MISSING">PENDING</span>
223
+ </div>
224
+ `).join('')}
225
+ </div>
226
+ `;
227
+ grid.appendChild(card);
228
+ }
229
+ }
230
+
231
+ async function loadWASM() {
232
+ if (wasmReady) return;
233
+ log("Loading main.wasm binary...");
234
+ const go = new Go();
235
+ try {
236
+ const result = await WebAssembly.instantiateStreaming(fetch('main.wasm'), go.importObject);
237
+ go.run(result.instance);
238
+ await new Promise(r => setTimeout(r, 200));
239
+ wasmReady = true;
240
+ log("WASM Runtime Active. Signal acquired.", "#00ff9d");
241
+ } catch (e) {
242
+ log("Binary Load Failure: " + e.message, "#ff3e3e");
243
+ }
244
+ }
245
+
246
+ async function startAudit() {
247
+ document.getElementById('auditBtn').disabled = true;
248
+ await loadWASM();
249
+ if (!wasmReady) return;
250
+
251
+ log("Starting multi-stage parity induction...");
252
+ const results = await window.runParityAudit(null, expectedApi);
253
+
254
+ let totalPass = 0;
255
+ let totalCount = 0;
256
+ const catScores = {};
257
+
258
+ for (const res of results) {
259
+ totalCount++;
260
+ if (res.status === 'PASS' || res.status === 'INDIRECT') totalPass++;
261
+
262
+ if (!catScores[res.category]) catScores[res.category] = { pass: 0, total: 0 };
263
+ catScores[res.category].total++;
264
+ if (res.status === 'PASS' || res.status === 'INDIRECT') catScores[res.category].pass++;
265
+
266
+ const el = document.getElementById(`item-${res.name}`);
267
+ if (el) {
268
+ const tag = el.querySelector('.status-tag');
269
+ tag.className = `status-tag ${res.status}`;
270
+ tag.textContent = res.status;
271
+ }
272
+ }
273
+
274
+ // Update scores
275
+ for (const [cat, score] of Object.entries(catScores)) {
276
+ document.getElementById(`score-${cat}`).textContent = `${score.pass}/${score.total}`;
277
+ }
278
+
279
+ document.getElementById('totalPass').textContent = totalPass;
280
+ const coverage = ((totalPass / totalCount) * 100).toFixed(1);
281
+ document.getElementById('coverageVal').textContent = `${coverage}%`;
282
+
283
+ if (parseFloat(coverage) >= 90) {
284
+ document.getElementById('coverageVal').className = 'stat-val glow';
285
+ }
286
+
287
+ log(`Audit Complete. Coverage: ${coverage}% | Checks: ${totalCount}`, "#00ff9d");
288
+ document.getElementById('auditBtn').disabled = false;
289
+ }
290
+
291
+ function clearLogs() {
292
+ document.getElementById('terminal').innerHTML = '';
293
+ }
294
+
295
+ window.onload = init;
296
+ </script>
297
+ </body>
298
+ </html>