mindforge-cc 6.5.0 → 6.6.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.
@@ -19,6 +19,7 @@ const MeshSelfHealer = require('./mesh-self-healer');
19
19
  const crypto = require('crypto');
20
20
  const IntelligenceInterlock = require('../engine/intelligence-interlock');
21
21
  const ReasonSourceAligner = require('../engine/reason-source-aligner');
22
+ const SelfCorrectiveSynthesizer = require('../engine/self-corrective-synthesizer');
22
23
 
23
24
  // MindForge v5 Core Modules
24
25
  const PolicyEngine = require('../governance/policy-engine');
@@ -49,6 +50,9 @@ class AutoRunner {
49
50
 
50
51
  // v6.5 RSA: Reason-Source Alignment
51
52
  this.aligner = ReasonSourceAligner;
53
+
54
+ // v6.6 SCS: Self-Corrective Synthesis
55
+ this.synthesizer = SelfCorrectiveSynthesizer;
52
56
  }
53
57
 
54
58
  async run() {
@@ -157,7 +161,20 @@ class AutoRunner {
157
161
  console.log(`[RSA-ALIGN] Thought aligns with Requirement: ${alignment.best_match_id} (Confidence: ${alignment.confidence})`);
158
162
  // In a real execution, we would update the event in the audit.
159
163
  // For simulation, we log it and could trigger actions if confidence is too low.
160
- if (alignment.confidence < this.aligner.ALIGNMENT_THRESHOLD) {
164
+ if (alignment.confidence < 0.50) {
165
+ console.warn(`[RSA-CRITICAL] Mission fidelity below threshold (${alignment.confidence}). Triggering SCS...`);
166
+ const correction = await this.synthesizer.synthesizeCorrection(this.getRecentAuditEvents(10), { phase: this.phase });
167
+
168
+ this.writeAudit({
169
+ event: 'scs_homing_injected',
170
+ instruction: correction.instruction,
171
+ req_id: correction.req_id,
172
+ confidence: correction.confidence
173
+ });
174
+
175
+ // In a real execution, we would append this instruction to the next prompt's system message
176
+ console.log(`[SCS-INJECT] Self-Correction high-density signal injected into wave context.`);
177
+ } else if (alignment.confidence < this.aligner.ALIGNMENT_THRESHOLD) {
161
178
  console.warn(`[RSA-WARNING] Mission fidelity dropping: ${alignment.confidence}`);
162
179
  }
163
180
  }
@@ -96,6 +96,16 @@ class ReasonSourceAligner {
96
96
 
97
97
  return intersection.size / tokensA.size; // Weighted by thought coverage
98
98
  }
99
+
100
+ /**
101
+ * Retrieves the full details of a specific requirement by ID.
102
+ * Useful for v6.6.0 SCS self-healing synthesis.
103
+ * @param {string} reqId
104
+ */
105
+ getRequirementDetails(reqId) {
106
+ if (!this.initialized) return null;
107
+ return this.registry.find(req => req.id === reqId) || null;
108
+ }
99
109
  }
100
110
 
101
111
  module.exports = new ReasonSourceAligner();
@@ -0,0 +1,65 @@
1
+ /**
2
+ * MindForge v6.6.0 — Self-Corrective Synthesis (SCS)
3
+ * Component: Self-Corrective Synthesizer (Pillar XII)
4
+ *
5
+ * Analyzes mission drift and logic stagnation to synthesize
6
+ * corrective steering signals (Homing Instructions).
7
+ */
8
+ 'use strict';
9
+
10
+ const rsa = require('./reason-source-aligner.js');
11
+
12
+ class SelfCorrectiveSynthesizer {
13
+ constructor() {
14
+ this.historyLimit = 10;
15
+ this.synthesisCount = 0;
16
+ }
17
+
18
+ /**
19
+ * Evaluates a suboptimal state and generates a corrective thought.
20
+ * @param {Array} auditTrail - Recent audit events.
21
+ * @param {Object} context - Current execution context.
22
+ */
23
+ async synthesizeCorrection(auditTrail, context) {
24
+ console.log('[SCS] Critical drift detected. Initiating internal alignment pass...');
25
+
26
+ // 1. Identify failure points
27
+ const failureEvents = auditTrail.slice(-this.historyLimit).filter(e =>
28
+ e.type === 'mission_fidelity' && e.alignment.confidence < 0.50
29
+ );
30
+
31
+ if (failureEvents.length === 0) {
32
+ return this._generateGenericRefocus(context);
33
+ }
34
+
35
+ // 2. Map to primary target requirement
36
+ const targetId = failureEvents[0].alignment.best_match_id;
37
+ const requirement = rsa.getRequirementDetails(targetId);
38
+
39
+ if (!requirement) {
40
+ return this._generateGenericRefocus(context);
41
+ }
42
+
43
+ // 3. Synthesize the "Homing Signal"
44
+ this.synthesisCount++;
45
+ const correction = {
46
+ type: 'scs_refocus',
47
+ req_id: targetId,
48
+ instruction: `[SCS-REFOCUS] Targeting [${targetId}]: ${requirement.summary}. Action: Resuming strict alignment with core requirement: ${requirement.description.split('\n')[0]}`,
49
+ confidence: 0.98
50
+ };
51
+
52
+ console.log(`[SCS] Synthesis complete. Correction targeted at ${targetId}.`);
53
+ return correction;
54
+ }
55
+
56
+ _generateGenericRefocus(context) {
57
+ return {
58
+ type: 'scs_refocus',
59
+ instruction: '[SCS-GENERAL-HOMING] Reasoning drift detected. I am resetting my internal thought buffer and re-reading the project constitution to ensure mission fidelity.',
60
+ confidence: 0.85
61
+ };
62
+ }
63
+ }
64
+
65
+ module.exports = new SelfCorrectiveSynthesizer();
@@ -0,0 +1,57 @@
1
+ /**
2
+ * MindForge v6.6.0 — SCS Verification Suite
3
+ * Tests the Self-Corrective Synthesis self-healing loop.
4
+ */
5
+ 'use strict';
6
+
7
+ const rsa = require('./reason-source-aligner.js');
8
+ const scs = require('./self-corrective-synthesizer.js');
9
+
10
+ async function runTests() {
11
+ console.log('🧪 Starting MindForge v6.6.0 SCS Verification...');
12
+ await rsa.init();
13
+
14
+ // Test Case 1: Detect Drift and Refocus on REQ-004 (RSA)
15
+ console.log('\n--- Test Case 1: Targeted Refocus ---');
16
+ const driftingAudit = [
17
+ { type: 'mission_fidelity', alignment: { is_aligned: true, best_match_id: 'REQ-004', confidence: 0.85 } }, // Good
18
+ { type: 'mission_fidelity', alignment: { is_aligned: false, best_match_id: 'REQ-004', confidence: 0.35 } } // Drift detected
19
+ ];
20
+
21
+ const correction = await scs.synthesizeCorrection(driftingAudit, { phase: '6.6.0-test' });
22
+
23
+ if (correction.type === 'scs_refocus' && correction.req_id === 'REQ-004') {
24
+ console.log('✅ SUCCESS: SCS correctly identified target requirement [REQ-004].');
25
+ console.log(`[SYNTHESIS] ${correction.instruction}`);
26
+ } else {
27
+ console.error('❌ FAIL: SCS failed to target REQ-004 correctly.', correction);
28
+ }
29
+
30
+ // Test Case 2: General Homing (No obvious requirements match in drift)
31
+ console.log('\n--- Test Case 2: General Homing ---');
32
+ const chaoticAudit = [
33
+ { type: 'mission_fidelity', alignment: { is_aligned: false, best_match_id: null, confidence: 0.1 } }
34
+ ];
35
+
36
+ const generalCorrection = await scs.synthesizeCorrection(chaoticAudit, { phase: '6.6.0-test' });
37
+
38
+ if (generalCorrection.instruction.includes('[SCS-GENERAL-HOMING]')) {
39
+ console.log('✅ SUCCESS: SCS triggered general homing for chaotic audit state.');
40
+ console.log(`[SYNTHESIS] ${generalCorrection.instruction}`);
41
+ } else {
42
+ console.error('❌ FAIL: SCS failed to trigger general homing.', generalCorrection);
43
+ }
44
+
45
+ // Test Case 3: Validating the Synthesized instruction with RSA
46
+ console.log('\n--- Test Case 3: RSA Validation of SCS Instruction ---');
47
+ const alignment = rsa.checkAlignment(correction.instruction);
48
+ if (alignment.best_match_id === 'REQ-004' && alignment.confidence > 0.60) {
49
+ console.log(`✅ SUCCESS: RSA confirms synthesized instruction aligns with [REQ-004] (Confidence: ${alignment.confidence})`);
50
+ } else {
51
+ console.error(`❌ FAIL: Synthesized instruction failed RSA validation. Match: ${alignment.best_match_id}, Conf: ${alignment.confidence}`);
52
+ }
53
+
54
+ console.log('\n✨ v6.6.0 SCS Verification Suite Complete.');
55
+ }
56
+
57
+ runTests().catch(console.error);
@@ -0,0 +1,21 @@
1
+ # 🎯 Discovered Skills Registry
2
+
3
+ *Generated at: 09/04/2026, 00:36:33*
4
+
5
+ This document is automatically updated when AAVA refreshes its command engine. It lists all skills discovered across the workspace and system.
6
+
7
+ ## 📂 Project Skills (`.aava/skills/`)
8
+ _No skills discovered in this tier._
9
+
10
+ ## 🌎 Global Skills (`~/.aava/skills/`)
11
+ _No skills discovered in this tier._
12
+
13
+ ## 📦 Plugin Skills (Bundled)
14
+ | Skill | Description | Argument Hint |
15
+ | :--- | :--- | :--- |
16
+ | `$debug` | Debug skill | `` |
17
+
18
+ ---
19
+ ## 💡 Tips
20
+ - Use `$` in the chat to trigger these skills.
21
+ - To add a new skill, create a `.md` file in `.aava/skills/` in your project root.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindforge-cc",
3
- "version": "6.5.0",
3
+ "version": "6.6.0",
4
4
  "description": "MindForge — Sovereign Agentic Intelligence Framework. (CADIA v6.2 & PQAS Enabled)",
5
5
  "bin": {
6
6
  "mindforge-cc": "bin/install.js"