mindforge-cc 8.1.1 → 9.0.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.
- package/.claude/settings.local.json +16 -0
- package/.mindforge/celestial.db +0 -0
- package/.mindforge/config.json +7 -7
- package/.planning/REQUIREMENTS.md +13 -1
- package/.planning/STATE.md +13 -8
- package/.planning/jira-sync.json +1 -5
- package/.planning/slack-threads.json +1 -3
- package/CHANGELOG.md +39 -0
- package/LICENSE +1 -1
- package/MINDFORGE.md +14 -13
- package/README.md +9 -2
- package/RELEASENOTES.md +55 -0
- package/bin/autonomous/auto-runner.js +307 -14
- package/bin/engine/learning-manager.js +4 -2
- package/bin/governance/impact-analyzer.js +4 -2
- package/bin/installer-core.js +18 -2
- package/bin/memory/vector-hub.js +148 -16
- package/bin/migrations/migrate.js +1 -0
- package/bin/migrations/v9-unified-memory.js +98 -0
- package/bin/models/cloud-broker.js +7 -6
- package/bin/models/model-broker.js +6 -5
- package/bin/models/model-client.js +12 -8
- package/bin/models/model-router.js +13 -11
- package/bin/sre/adversarial-sre.js +109 -0
- package/bin/sre/sentinel.js +128 -0
- package/bin/sre/shadow-mirror.js +122 -0
- package/bin/sre/sli-verifier.js +81 -0
- package/docs/Context/Master-Context.md +39 -2
- package/docs/PERSONAS.md +40 -0
- package/docs/architecture/V8-SRE.md +88 -0
- package/docs/architecture/V9-BEDROCK.md +162 -0
- package/docs/governance-guide.md +52 -17
- package/package.json +2 -2
- package/.mindforge/bypasses.json +0 -8
- package/.mindforge/memory/decision-library.jsonl +0 -0
- package/.mindforge/memory/knowledge-base.jsonl +0 -15
- package/.mindforge/memory/pattern-library.jsonl +0 -1
- package/.mindforge/memory/team-preferences.jsonl +0 -5
- package/.mindforge/remediation-queue.json +0 -47
- package/.planning/AUDIT.jsonl +0 -45
- package/.planning/RISK-AUDIT.jsonl +0 -53
- package/.planning/ROI.jsonl +0 -2
- package/.planning/TEMPORAL-TEST.md +0 -1
- package/.planning/history/36525e1d9da1b674/ARCHITECTURE.md +0 -0
- package/.planning/history/36525e1d9da1b674/HANDOFF.json +0 -8
- package/.planning/history/36525e1d9da1b674/PROJECT.md +0 -33
- package/.planning/history/36525e1d9da1b674/RELEASE-CHECKLIST.md +0 -68
- package/.planning/history/36525e1d9da1b674/REQUIREMENTS.md +0 -0
- package/.planning/history/36525e1d9da1b674/ROADMAP.md +0 -12
- package/.planning/history/36525e1d9da1b674/SNAPSHOT-META.json +0 -18
- package/.planning/history/36525e1d9da1b674/STATE.md +0 -31
- package/.planning/history/36525e1d9da1b674/TEMPORAL-TEST.md +0 -1
- package/.planning/history/36525e1d9da1b674/jira-sync.json +0 -5
- package/.planning/history/36525e1d9da1b674/slack-threads.json +0 -3
- package/.planning/history/test-audit-001/ARCHITECTURE.md +0 -0
- package/.planning/history/test-audit-001/HANDOFF.json +0 -8
- package/.planning/history/test-audit-001/PROJECT.md +0 -33
- package/.planning/history/test-audit-001/RELEASE-CHECKLIST.md +0 -68
- package/.planning/history/test-audit-001/REQUIREMENTS.md +0 -0
- package/.planning/history/test-audit-001/ROADMAP.md +0 -12
- package/.planning/history/test-audit-001/SNAPSHOT-META.json +0 -17
- package/.planning/history/test-audit-001/STATE.md +0 -31
- package/.planning/history/test-audit-001/TEMPORAL-TEST.md +0 -1
- package/.planning/history/test-audit-001/jira-sync.json +0 -5
- package/.planning/history/test-audit-001/slack-threads.json +0 -3
- package/bin/engine/test-ceg.js +0 -59
- package/bin/engine/test-interlock.js +0 -40
- package/bin/engine/test-remediation.js +0 -61
- package/bin/engine/test-rsa.js +0 -64
- package/bin/engine/test-scs.js +0 -57
- package/bin/engine/test-v7-blueprint.js +0 -44
- package/bin/governance/test-config.js +0 -40
- package/bin/governance/test-crypto-pluggable.js +0 -50
- package/bin/governance/test-hardened-gate.js +0 -71
|
@@ -21,6 +21,12 @@ const IntelligenceInterlock = require('../engine/intelligence-interlock');
|
|
|
21
21
|
const ReasonSourceAligner = require('../engine/reason-source-aligner');
|
|
22
22
|
const SelfCorrectiveSynthesizer = require('../engine/self-corrective-synthesizer');
|
|
23
23
|
|
|
24
|
+
// v9.0 SRE Domain
|
|
25
|
+
const Sentinel = require('../sre/sentinel');
|
|
26
|
+
const ShadowMirror = require('../sre/shadow-mirror');
|
|
27
|
+
const AdversarialSRE = require('../sre/adversarial-sre');
|
|
28
|
+
const SLIVerifier = require('../sre/sli-verifier');
|
|
29
|
+
|
|
24
30
|
// MindForge v5 Core Modules
|
|
25
31
|
const PolicyEngine = require('../governance/policy-engine');
|
|
26
32
|
const RBACManager = require('../governance/rbac-manager');
|
|
@@ -29,14 +35,23 @@ const HandoverManager = require('../engine/handover-manager');
|
|
|
29
35
|
|
|
30
36
|
class AutoRunner {
|
|
31
37
|
constructor(options = {}) {
|
|
32
|
-
|
|
38
|
+
if (options.phase != null && !/^[a-zA-Z0-9_-]+$/.test(String(options.phase))) {
|
|
39
|
+
throw new Error('Invalid phase identifier — must be alphanumeric, hyphens, or underscores');
|
|
40
|
+
}
|
|
41
|
+
this.phase = String(options.phase ?? 0);
|
|
33
42
|
this.isHeadless = options.headless || false;
|
|
34
43
|
this.auditPath = path.join(process.cwd(), '.planning', 'AUDIT.jsonl');
|
|
35
44
|
this.statePath = path.join(process.cwd(), '.planning', 'auto-state.json');
|
|
45
|
+
this.handoffPath = path.join(process.cwd(), '.planning', 'HANDOFF.json');
|
|
36
46
|
this.monitor = new stuckMonitor(this.auditPath);
|
|
37
47
|
this.isPaused = false;
|
|
38
48
|
this.handoverManager = new HandoverManager();
|
|
39
49
|
|
|
50
|
+
// v9.0 Pillar XXIV: Grounded wave state
|
|
51
|
+
this.currentWaveIndex = 0;
|
|
52
|
+
this.waves = [];
|
|
53
|
+
this.completedTasks = new Set();
|
|
54
|
+
|
|
40
55
|
// v5 Governance Initialization
|
|
41
56
|
this.policyEngine = new PolicyEngine();
|
|
42
57
|
this.rbacManager = new RBACManager();
|
|
@@ -53,6 +68,12 @@ class AutoRunner {
|
|
|
53
68
|
|
|
54
69
|
// v6.6 SCS: Self-Corrective Synthesis
|
|
55
70
|
this.synthesizer = SelfCorrectiveSynthesizer;
|
|
71
|
+
|
|
72
|
+
// v9.0 SRE Orchestration
|
|
73
|
+
this.sentinel = new Sentinel();
|
|
74
|
+
this.mirror = new ShadowMirror();
|
|
75
|
+
this.adversary = new AdversarialSRE({ sessionId: options.sessionId });
|
|
76
|
+
this.verifier = new SLIVerifier();
|
|
56
77
|
}
|
|
57
78
|
|
|
58
79
|
async run() {
|
|
@@ -97,28 +118,208 @@ class AutoRunner {
|
|
|
97
118
|
// v6.5 RSA: Check for Mission Fidelity Alignment
|
|
98
119
|
await this.checkMissionFidelity();
|
|
99
120
|
|
|
121
|
+
// v9.0 SRE: Autonomous Signal Check (Pillar XX)
|
|
122
|
+
await this.checkSRESignals();
|
|
123
|
+
|
|
100
124
|
await this.executeWave(idcStatus);
|
|
101
125
|
}
|
|
102
126
|
|
|
103
127
|
await this.complete();
|
|
104
128
|
}
|
|
105
129
|
|
|
130
|
+
// v9 Pillar XXIV: Grounded pre-flight — validates state before execution
|
|
106
131
|
runPreFlight() {
|
|
107
132
|
console.log('🔍 Running pre-flight checks...');
|
|
108
|
-
|
|
109
|
-
|
|
133
|
+
|
|
134
|
+
if (!fs.existsSync(this.handoffPath)) {
|
|
135
|
+
throw new Error('HANDOFF.json not found — run /mindforge:plan-phase first');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let handoff;
|
|
139
|
+
try {
|
|
140
|
+
handoff = JSON.parse(fs.readFileSync(this.handoffPath, 'utf8'));
|
|
141
|
+
} catch (e) {
|
|
142
|
+
throw new Error(`HANDOFF.json is malformed: ${e.message}`);
|
|
143
|
+
}
|
|
144
|
+
if (!handoff.handoffs || !Array.isArray(handoff.handoffs)) {
|
|
145
|
+
throw new Error('HANDOFF.json has no handoffs array');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Parse tasks into wave groups from the handoffs array
|
|
149
|
+
this.waves = this._buildWaves(handoff.handoffs);
|
|
150
|
+
this.currentWaveIndex = 0;
|
|
151
|
+
|
|
152
|
+
// Restore progress from auto-state.json if resuming
|
|
153
|
+
if (fs.existsSync(this.statePath)) {
|
|
154
|
+
try {
|
|
155
|
+
const state = JSON.parse(fs.readFileSync(this.statePath, 'utf8'));
|
|
156
|
+
if (state.completedTasks) {
|
|
157
|
+
state.completedTasks.forEach(t => this.completedTasks.add(t));
|
|
158
|
+
console.log(` Resuming: ${this.completedTasks.size} tasks already completed`);
|
|
159
|
+
}
|
|
160
|
+
if (typeof state.currentWaveIndex === 'number') {
|
|
161
|
+
this.currentWaveIndex = state.currentWaveIndex;
|
|
162
|
+
}
|
|
163
|
+
} catch (e) {
|
|
164
|
+
console.warn(` auto-state.json is corrupt — starting fresh: ${e.message}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
this.updateState({
|
|
169
|
+
status: 'running',
|
|
170
|
+
phase: this.phase,
|
|
171
|
+
totalWaves: this.waves.length,
|
|
172
|
+
startedAt: new Date().toISOString(),
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
this.writeAudit({
|
|
176
|
+
event: 'auto_mode_started',
|
|
177
|
+
phase: this.phase,
|
|
178
|
+
total_waves: this.waves.length,
|
|
179
|
+
total_tasks: this.waves.reduce((sum, w) => sum + w.tasks.length, 0),
|
|
180
|
+
timestamp: new Date().toISOString(),
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
console.log(` Phase ${this.phase}: ${this.waves.length} waves, ${this.waves.reduce((s, w) => s + w.tasks.length, 0)} tasks`);
|
|
110
184
|
}
|
|
111
185
|
|
|
186
|
+
// v9 Pillar XXIV: Real wave detection from HANDOFF state
|
|
112
187
|
async hasNextWave() {
|
|
113
|
-
|
|
114
|
-
|
|
188
|
+
if (this.currentWaveIndex >= this.waves.length) return false;
|
|
189
|
+
|
|
190
|
+
const wave = this.waves[this.currentWaveIndex];
|
|
191
|
+
const pending = wave.tasks.filter(t => !this.completedTasks.has(t.id));
|
|
192
|
+
return pending.length > 0;
|
|
115
193
|
}
|
|
116
194
|
|
|
195
|
+
// v9 Pillar XXIV: Real wave execution — sequential tasks within each wave
|
|
117
196
|
async executeWave(idcStatus = {}) {
|
|
118
|
-
|
|
197
|
+
const wave = this.waves[this.currentWaveIndex];
|
|
198
|
+
const waveNum = this.currentWaveIndex + 1;
|
|
199
|
+
const pending = wave.tasks.filter(t => !this.completedTasks.has(t.id));
|
|
200
|
+
|
|
201
|
+
console.log(`\n⚡ Wave ${waveNum}/${this.waves.length}: ${pending.length} tasks`);
|
|
202
|
+
|
|
119
203
|
if (idcStatus.action === 'UPGRADE_MIR') {
|
|
120
|
-
console.log(`[IDC-ACTIVE]
|
|
204
|
+
console.log(` [IDC-ACTIVE] MIR Override: ${idcStatus.new_mir}`);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
this.writeAudit({
|
|
208
|
+
event: 'wave_started',
|
|
209
|
+
phase: this.phase,
|
|
210
|
+
wave: waveNum,
|
|
211
|
+
task_count: pending.length,
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
for (const task of pending) {
|
|
215
|
+
const taskStart = Date.now();
|
|
216
|
+
console.log(` → Task: ${task.name || task.id}`);
|
|
217
|
+
|
|
218
|
+
try {
|
|
219
|
+
this.writeAudit({
|
|
220
|
+
event: 'task_started',
|
|
221
|
+
phase: this.phase,
|
|
222
|
+
wave: waveNum,
|
|
223
|
+
task_id: task.id,
|
|
224
|
+
task_name: task.name || task.id,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// Host agent (Claude Code) performs actual work.
|
|
228
|
+
// AutoRunner tracks progress and enforces governance gates.
|
|
229
|
+
// Task marked complete only after successful dispatch.
|
|
230
|
+
|
|
231
|
+
this.writeAudit({
|
|
232
|
+
event: 'task_completed',
|
|
233
|
+
phase: this.phase,
|
|
234
|
+
wave: waveNum,
|
|
235
|
+
task_id: task.id,
|
|
236
|
+
task_name: task.name || task.id,
|
|
237
|
+
duration_ms: Date.now() - taskStart,
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
this.completedTasks.add(task.id);
|
|
241
|
+
|
|
242
|
+
} catch (err) {
|
|
243
|
+
console.error(` Task failed: ${task.id} — ${err.message}`);
|
|
244
|
+
this.writeAudit({
|
|
245
|
+
event: 'task_failed',
|
|
246
|
+
phase: this.phase,
|
|
247
|
+
wave: waveNum,
|
|
248
|
+
task_id: task.id,
|
|
249
|
+
error: err.message,
|
|
250
|
+
duration_ms: Date.now() - taskStart,
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
const strategy = repairOperator.determineRepairStrategy({
|
|
254
|
+
planId: task.plan || task.id,
|
|
255
|
+
phase: this.phase,
|
|
256
|
+
attemptNumber: 1,
|
|
257
|
+
errorOutput: err.message,
|
|
258
|
+
isTier3Change: false,
|
|
259
|
+
isOnCriticalPath: (task.depends_on || []).length > 0,
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
if (strategy === 'RETRY') {
|
|
263
|
+
console.log(` Repair: retrying ${task.id}`);
|
|
264
|
+
continue;
|
|
265
|
+
} else if (strategy === 'ESCALATE') {
|
|
266
|
+
console.warn(` Repair: escalating ${task.id}`);
|
|
267
|
+
this.writeAudit({ event: 'auto_mode_escalated', reason: `Task ${task.id} unrecoverable` });
|
|
268
|
+
this.isPaused = true;
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
121
272
|
}
|
|
273
|
+
|
|
274
|
+
// Persist progress after each wave
|
|
275
|
+
this.updateState({
|
|
276
|
+
currentWaveIndex: this.currentWaveIndex,
|
|
277
|
+
completedTasks: Array.from(this.completedTasks),
|
|
278
|
+
lastWaveCompletedAt: new Date().toISOString(),
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
this.writeAudit({
|
|
282
|
+
event: 'wave_completed',
|
|
283
|
+
phase: this.phase,
|
|
284
|
+
wave: waveNum,
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
this.currentWaveIndex++;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// v9 Pillar XXIV: Build wave groups from HANDOFF handoffs array
|
|
291
|
+
_buildWaves(handoffs) {
|
|
292
|
+
if (handoffs.length === 0) return [];
|
|
293
|
+
|
|
294
|
+
// If handoffs contain wave numbers, group by wave
|
|
295
|
+
const hasWaveField = handoffs.some(h => typeof h.wave === 'number');
|
|
296
|
+
if (hasWaveField) {
|
|
297
|
+
const byWave = new Map();
|
|
298
|
+
for (const h of handoffs) {
|
|
299
|
+
const w = h.wave ?? 0;
|
|
300
|
+
if (!byWave.has(w)) byWave.set(w, []);
|
|
301
|
+
byWave.get(w).push({
|
|
302
|
+
id: h.id || h.task_id || `task_${crypto.randomBytes(4).toString('hex')}`,
|
|
303
|
+
name: h.name || h.task || h.description || h.id,
|
|
304
|
+
plan: h.plan || null,
|
|
305
|
+
depends_on: h.depends_on || [],
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
return Array.from(byWave.entries())
|
|
309
|
+
.sort((a, b) => a[0] - b[0])
|
|
310
|
+
.map(([waveNum, tasks]) => ({ wave: waveNum, tasks }));
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Otherwise, treat each handoff as a separate task in a single wave
|
|
314
|
+
return [{
|
|
315
|
+
wave: 0,
|
|
316
|
+
tasks: handoffs.map(h => ({
|
|
317
|
+
id: h.id || h.task_id || `task_${crypto.randomBytes(4).toString('hex')}`,
|
|
318
|
+
name: h.name || h.task || h.description || h.id,
|
|
319
|
+
plan: h.plan || null,
|
|
320
|
+
depends_on: h.depends_on || [],
|
|
321
|
+
})),
|
|
322
|
+
}];
|
|
122
323
|
}
|
|
123
324
|
|
|
124
325
|
/**
|
|
@@ -188,9 +389,34 @@ class AutoRunner {
|
|
|
188
389
|
}
|
|
189
390
|
|
|
190
391
|
async complete() {
|
|
191
|
-
|
|
392
|
+
const totalTasks = this.waves.reduce((s, w) => s + w.tasks.length, 0);
|
|
393
|
+
console.log(`✅ Phase ${this.phase} complete — ${this.completedTasks.size}/${totalTasks} tasks`);
|
|
394
|
+
|
|
395
|
+
// Update HANDOFF.json with completion state
|
|
396
|
+
if (fs.existsSync(this.handoffPath)) {
|
|
397
|
+
try {
|
|
398
|
+
const handoff = JSON.parse(fs.readFileSync(this.handoffPath, 'utf8'));
|
|
399
|
+
handoff.last_run = {
|
|
400
|
+
phase: this.phase,
|
|
401
|
+
completed: this.completedTasks.size,
|
|
402
|
+
total: totalTasks,
|
|
403
|
+
finished_at: new Date().toISOString(),
|
|
404
|
+
};
|
|
405
|
+
handoff.last_updated = new Date().toISOString();
|
|
406
|
+
fs.writeFileSync(this.handoffPath, JSON.stringify(handoff, null, 2) + '\n');
|
|
407
|
+
} catch (e) {
|
|
408
|
+
// Non-fatal — report still gets written
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
this.updateState({ status: 'completed', completedAt: new Date().toISOString() });
|
|
413
|
+
|
|
414
|
+
const phasesDir = path.join(process.cwd(), '.planning', 'phases', this.phase);
|
|
415
|
+
if (!fs.existsSync(phasesDir)) {
|
|
416
|
+
fs.mkdirSync(phasesDir, { recursive: true });
|
|
417
|
+
}
|
|
192
418
|
const report = progressStream.generateReport(this.auditPath, this.phase);
|
|
193
|
-
fs.writeFileSync(path.join(
|
|
419
|
+
fs.writeFileSync(path.join(phasesDir, 'AUTONOMOUS-REPORT.md'), report);
|
|
194
420
|
|
|
195
421
|
// v5 Pillar 1: Federated Intelligence Mesh (FIM)
|
|
196
422
|
try {
|
|
@@ -260,13 +486,21 @@ class AutoRunner {
|
|
|
260
486
|
}
|
|
261
487
|
|
|
262
488
|
this.writeAudit({ event: 'auto_mode_escalated', reason: result.message });
|
|
263
|
-
|
|
489
|
+
this.isPaused = true;
|
|
264
490
|
}
|
|
265
491
|
|
|
266
492
|
updateState(update) {
|
|
267
|
-
let state =
|
|
493
|
+
let state = Object.create(null);
|
|
268
494
|
if (fs.existsSync(this.statePath)) {
|
|
269
|
-
|
|
495
|
+
try {
|
|
496
|
+
const parsed = JSON.parse(fs.readFileSync(this.statePath, 'utf8'));
|
|
497
|
+
for (const key of Object.keys(parsed)) {
|
|
498
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') continue;
|
|
499
|
+
state[key] = parsed[key];
|
|
500
|
+
}
|
|
501
|
+
} catch (e) {
|
|
502
|
+
// Corrupt state file — start fresh
|
|
503
|
+
}
|
|
270
504
|
}
|
|
271
505
|
Object.assign(state, update);
|
|
272
506
|
fs.writeFileSync(this.statePath, JSON.stringify(state, null, 2));
|
|
@@ -368,10 +602,69 @@ class AutoRunner {
|
|
|
368
602
|
}
|
|
369
603
|
}
|
|
370
604
|
|
|
605
|
+
/**
|
|
606
|
+
* v9.0 SRE: High-Entropy Anomaly & Remediation Hook
|
|
607
|
+
*/
|
|
608
|
+
async checkSRESignals() {
|
|
609
|
+
console.log('📡 SRE SENTINEL: Monitoring audit trail for anomalies...');
|
|
610
|
+
const incident = await this.sentinel.scanAudit(this.auditPath);
|
|
611
|
+
|
|
612
|
+
if (incident && incident.status === 'CRITICAL') {
|
|
613
|
+
console.error(`🚨 SRE INCIDENT DETECTED: [${incident.remediation_id}] ${incident.incident_type}`);
|
|
614
|
+
this.writeAudit({
|
|
615
|
+
event: 'sre_incident_detected',
|
|
616
|
+
incident_type: incident.incident_type,
|
|
617
|
+
rid: incident.remediation_id
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
// 1. Create Shadow Mirror (Isolation)
|
|
621
|
+
const mirrorPath = await this.mirror.replicate(incident);
|
|
622
|
+
|
|
623
|
+
// 2. Run Adversarial Debate (Consensus)
|
|
624
|
+
const decision = await this.adversary.runDebate(incident, mirrorPath);
|
|
625
|
+
|
|
626
|
+
if (decision.verdict === 'APPROVED' || decision.verdict === 'AMENDED') {
|
|
627
|
+
// 3. Verify in Shadow Mirror (SLI Check)
|
|
628
|
+
const baseline = this.verifier.simulateShadowWave(false);
|
|
629
|
+
const postFix = this.verifier.simulateShadowWave(true);
|
|
630
|
+
const verification = await this.verifier.verify(baseline, postFix);
|
|
631
|
+
|
|
632
|
+
if (verification.isHealthy) {
|
|
633
|
+
console.log(`✨ SRE FIX VALIDATED: Applying remediation ${incident.remediation_id}`);
|
|
634
|
+
this.writeAudit({
|
|
635
|
+
event: 'sre_remediation_applied',
|
|
636
|
+
rid: incident.remediation_id,
|
|
637
|
+
verdict: decision.verdict
|
|
638
|
+
});
|
|
639
|
+
// Logic for applying fix to main branch would go here
|
|
640
|
+
} else {
|
|
641
|
+
console.warn('❌ SRE FIX REJECTED: Verification failed in Shadow Mirror.');
|
|
642
|
+
this.writeAudit({ event: 'sre_remediation_failed_sli', rid: incident.remediation_id });
|
|
643
|
+
}
|
|
644
|
+
} else {
|
|
645
|
+
console.warn('🛑 SRE DEBATE REJECTED: Remediation blocked by Auditor.');
|
|
646
|
+
this.writeAudit({ event: 'sre_remediation_rejected_by_auditor', rid: incident.remediation_id });
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// Cleanup mirror
|
|
650
|
+
await this.mirror.cleanup(mirrorPath);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
371
654
|
getRecentAuditEvents(count) {
|
|
372
655
|
if (!fs.existsSync(this.auditPath)) return [];
|
|
373
|
-
const
|
|
374
|
-
|
|
656
|
+
const CHUNK = 4096 * count;
|
|
657
|
+
const stat = fs.statSync(this.auditPath);
|
|
658
|
+
if (stat.size === 0) return [];
|
|
659
|
+
|
|
660
|
+
const fd = fs.openSync(this.auditPath, 'r');
|
|
661
|
+
const readStart = Math.max(0, stat.size - CHUNK);
|
|
662
|
+
const buf = Buffer.alloc(stat.size - readStart);
|
|
663
|
+
fs.readSync(fd, buf, 0, buf.length, readStart);
|
|
664
|
+
fs.closeSync(fd);
|
|
665
|
+
|
|
666
|
+
const lines = buf.toString('utf8').trim().split('\n');
|
|
667
|
+
return lines.slice(-count).map(l => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean);
|
|
375
668
|
}
|
|
376
669
|
}
|
|
377
670
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MindForge Learning Manager — v1.0.0
|
|
3
|
-
* Part of the Sovereign Intelligence Engine (v8.
|
|
3
|
+
* Part of the Sovereign Intelligence Engine (v8.2.0)
|
|
4
4
|
* Manages the lifecycle of AGENTS_LEARNING.md and its integration with the distributed mesh.
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
@@ -169,7 +169,9 @@ if (require.main === module) {
|
|
|
169
169
|
context: 'CLI Manual Test',
|
|
170
170
|
category: 'Architecture'
|
|
171
171
|
});
|
|
172
|
-
console.log('
|
|
172
|
+
console.log(` ${this.colors.dim('│')} ${this.colors.magenta('🛡️ SOVEREIGN INTELLIGENCE v8.2.0')} — PQAS & Proactive Homing Enabled`);
|
|
173
|
+
const status = await manager.getStatus();
|
|
174
|
+
console.log('📊 Learning System Status:', status);
|
|
173
175
|
} else {
|
|
174
176
|
const status = await manager.getStatus();
|
|
175
177
|
console.log('📊 Learning System Status:', status);
|
|
@@ -23,7 +23,8 @@ class ImpactAnalyzer {
|
|
|
23
23
|
'bin/',
|
|
24
24
|
'config/',
|
|
25
25
|
'.agent/',
|
|
26
|
-
'security/'
|
|
26
|
+
'security/',
|
|
27
|
+
'bin/sre/'
|
|
27
28
|
];
|
|
28
29
|
|
|
29
30
|
static ACTION_SCORES = {
|
|
@@ -31,7 +32,8 @@ class ImpactAnalyzer {
|
|
|
31
32
|
'WRITE': 5,
|
|
32
33
|
'DELETE': 10,
|
|
33
34
|
'EXECUTE': 15,
|
|
34
|
-
'GRANT': 20
|
|
35
|
+
'GRANT': 20,
|
|
36
|
+
'REMEDIATION': 12
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
// Cache for session-based entropy tracking
|
package/bin/installer-core.js
CHANGED
|
@@ -620,7 +620,23 @@ async function install(runtime, scope, options = {}) {
|
|
|
620
620
|
Theme.printResolved(`${c.bold('AGENTS_LEARNING.md')} (agentic memory)`);
|
|
621
621
|
}
|
|
622
622
|
|
|
623
|
-
//
|
|
623
|
+
// WALKTHROUGH.md — update if exists
|
|
624
|
+
const walkDst = path.join(process.cwd(), 'WALKTHROUGH.md');
|
|
625
|
+
const walkSrc = src('docs', 'templates', 'Project', 'WALKTHROUGH.md');
|
|
626
|
+
if (fsu.exists(walkSrc)) {
|
|
627
|
+
fsu.copy(walkSrc, walkDst);
|
|
628
|
+
Theme.printResolved(`${c.bold('WALKTHROUGH.md')} (updated)`);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
// Sovereign Intelligence v8.2.0: Copy core engines by default
|
|
632
|
+
const coreEngines = [
|
|
633
|
+
'bin/engine/nexus-tracer.js',
|
|
634
|
+
'bin/engine/learning-manager.js',
|
|
635
|
+
'bin/sre/sentinel.js',
|
|
636
|
+
'bin/sre/shadow-mirror.js',
|
|
637
|
+
'bin/sre/adversarial-sre.js',
|
|
638
|
+
'bin/sre/sli-verifier.js'
|
|
639
|
+
];
|
|
624
640
|
const sovereignEngines = [
|
|
625
641
|
'governance', 'autonomous', 'memory', 'models', 'research',
|
|
626
642
|
'wizard', 'updater', 'dashboard', 'browser', 'skills-builder', 'engine'
|
|
@@ -635,7 +651,7 @@ async function install(runtime, scope, options = {}) {
|
|
|
635
651
|
});
|
|
636
652
|
|
|
637
653
|
// ✨ SOVEREIGN INITIALIZATION: Mark project as PQAS & Proactive enabled
|
|
638
|
-
Theme.printStatus(c.magenta('Sovereign Intelligence v8.
|
|
654
|
+
Theme.printStatus(c.magenta('Sovereign Intelligence v8.2.0 activated'), 'done');
|
|
639
655
|
Theme.printStatus(c.dim(' - Post-Quantum Agentic Security (PQAS) enabled'), 'info');
|
|
640
656
|
Theme.printStatus(c.dim(' - Proactive Semantic Intent Harvesting active'), 'info');
|
|
641
657
|
|