vektor-slipstream 1.3.3 → 1.3.4
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.
- package/index.js +1 -1
- package/package.json +1 -1
- package/vektor-cli.js +62 -6
package/index.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
'use strict';
|
|
32
32
|
|
|
33
|
-
const { createMemory } = require('vektor-slipstream');
|
|
33
|
+
const { createMemory } = require('vektor-slipstream/boot');
|
|
34
34
|
const cortex = require('./cortex');
|
|
35
35
|
const axon = require('./axon');
|
|
36
36
|
const cerebellum = require('./cerebellum');
|
package/package.json
CHANGED
package/vektor-cli.js
CHANGED
|
@@ -258,12 +258,12 @@ async function cmdRem() {
|
|
|
258
258
|
printBox();
|
|
259
259
|
console.log(' Running REM dream cycle...\n');
|
|
260
260
|
try {
|
|
261
|
-
const { createMemory } = require('./
|
|
261
|
+
const { createMemory } = require('./boot-patch');
|
|
262
262
|
const dbPath = process.env.VEKTOR_DB_PATH ||
|
|
263
263
|
path.join(os.homedir(), 'vektor-slipstream-memory.db');
|
|
264
264
|
|
|
265
265
|
if (!fs.existsSync(dbPath)) {
|
|
266
|
-
console.error(yellow(' ⚠
|
|
266
|
+
console.error(yellow(' ⚠ No memory database found at: ' + dbPath));
|
|
267
267
|
console.log(dim(' Run: npx vektor test to create one'));
|
|
268
268
|
process.exit(1);
|
|
269
269
|
}
|
|
@@ -275,10 +275,66 @@ async function cmdRem() {
|
|
|
275
275
|
licenceKey: process.env.VEKTOR_LICENCE_KEY,
|
|
276
276
|
});
|
|
277
277
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
// ── Phase 1: Audit ──────────────────────────────────────────────────────
|
|
279
|
+
console.log(' ' + dim('┌─ Phase 1/4 Auditing memory graph...'));
|
|
280
|
+
const stats = await memory.stats();
|
|
281
|
+
const total = stats.total || 0;
|
|
282
|
+
console.log(dim(' │ Total nodes: ' + total));
|
|
283
|
+
|
|
284
|
+
if (total === 0) {
|
|
285
|
+
console.log(green(' └─ Memory graph is empty — nothing to consolidate\n'));
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// ── Phase 2: Surface recent activity ───────────────────────────────────
|
|
290
|
+
console.log(' ' + dim('├─ Phase 2/4 Scanning recent activity...'));
|
|
291
|
+
const recent = await memory.recent(20);
|
|
292
|
+
console.log(dim(' │ Recent nodes scanned: ' + (recent ? recent.length : 0)));
|
|
293
|
+
|
|
294
|
+
// ── Phase 3: Prune noise nodes ──────────────────────────────────────────
|
|
295
|
+
console.log(' ' + dim('├─ Phase 3/4 Pruning noise nodes...'));
|
|
296
|
+
let pruned = 0;
|
|
297
|
+
const NOISE = [
|
|
298
|
+
'cloak warmup probe',
|
|
299
|
+
'VEKTOR CLI test — memory is working correctly',
|
|
300
|
+
];
|
|
301
|
+
for (const pattern of NOISE) {
|
|
302
|
+
try {
|
|
303
|
+
const nodes = await memory.recall(pattern, 10);
|
|
304
|
+
if (!nodes || !nodes.length) continue;
|
|
305
|
+
for (const node of nodes) {
|
|
306
|
+
if (node.content && NOISE.some(n => node.content.includes(n))) {
|
|
307
|
+
if (node.id) { await memory.remove(node.id); pruned++; }
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
} catch { /* non-fatal */ }
|
|
311
|
+
}
|
|
312
|
+
console.log(dim(' │ Noise nodes pruned: ' + pruned));
|
|
313
|
+
|
|
314
|
+
// ── Phase 4: Briefing as consolidation summary ──────────────────────────
|
|
315
|
+
console.log(' ' + dim('├─ Phase 4/4 Generating consolidation summary...'));
|
|
316
|
+
let briefSnippet = '';
|
|
317
|
+
try {
|
|
318
|
+
const brief = await memory.briefing();
|
|
319
|
+
if (brief) briefSnippet = brief.slice(0, 120) + (brief.length > 120 ? '...' : '');
|
|
320
|
+
} catch { /* non-fatal */ }
|
|
321
|
+
|
|
322
|
+
// ── Result ──────────────────────────────────────────────────────────────
|
|
323
|
+
const statsAfter = await memory.stats();
|
|
324
|
+
const totalAfter = statsAfter.total || 0;
|
|
325
|
+
const delta = total - totalAfter;
|
|
326
|
+
|
|
327
|
+
console.log(green(' └─ REM cycle complete\n'));
|
|
328
|
+
console.log(' ' + dim('Before:') + ' ' + total + ' nodes');
|
|
329
|
+
console.log(' ' + dim('After: ') + ' ' + totalAfter + ' nodes');
|
|
330
|
+
console.log(' ' + dim('Pruned:') + ' ' + pruned + ' noise nodes');
|
|
331
|
+
if (delta > pruned) {
|
|
332
|
+
console.log(' ' + dim('AUDN: ') + ' ' + (delta - pruned) + ' duplicates resolved');
|
|
333
|
+
}
|
|
334
|
+
if (briefSnippet) {
|
|
335
|
+
console.log('\n ' + dim('Briefing: ') + briefSnippet);
|
|
336
|
+
}
|
|
337
|
+
|
|
282
338
|
} catch (e) {
|
|
283
339
|
console.error(red(' ✗ REM error: ') + e.message);
|
|
284
340
|
process.exit(1);
|