wolverine-ai 2.6.3 → 2.6.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/package.json +1 -1
- package/src/agent/research-agent.js +1 -1
- package/src/core/wolverine.js +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wolverine-ai",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.4",
|
|
4
4
|
"description": "Self-healing Node.js server framework powered by AI. Catches crashes, diagnoses errors, generates fixes, verifies, and restarts — automatically.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -55,7 +55,7 @@ class ResearchAgent {
|
|
|
55
55
|
|
|
56
56
|
const namespace = success ? "fixes" : "errors";
|
|
57
57
|
const prefix = success ? "FIXED" : "FAILED";
|
|
58
|
-
const text = `${prefix}: ${safeError} in ${filePath}. ${success ? "Solution" : "Attempted"}: ${safeExplanation}`;
|
|
58
|
+
const text = `${prefix}: ${safeError} in ${filePath}. ${success ? "Solution" : "Attempted (DO NOT REPEAT)"}: ${safeExplanation}`;
|
|
59
59
|
|
|
60
60
|
await this.brain.remember(namespace, text, { type: success ? "fix-success" : "fix-failure", file: filePath });
|
|
61
61
|
console.log(chalk.gray(` 🧠 ${success ? "✅" : "❌"} Recorded ${prefix.toLowerCase()} for ${safeError.slice(0, 50)}`));
|
package/src/core/wolverine.js
CHANGED
|
@@ -413,6 +413,29 @@ async function _healImpl({ stderr, cwd, sandbox, notifier, rateLimiter, backupMa
|
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
+
// Record outcome to brain — both successes AND failures with full context
|
|
417
|
+
if (brain && brain._initialized) {
|
|
418
|
+
try {
|
|
419
|
+
if (goalResult.success) {
|
|
420
|
+
await brain.remember("fixes",
|
|
421
|
+
`FIXED (${goalResult.mode}, iter ${goalResult.iteration}): ${parsed.errorMessage} in ${parsed.filePath}:${parsed.line}. ` +
|
|
422
|
+
`Solution: ${goalResult.explanation?.slice(0, 200)}. Files: ${(goalResult.agentStats?.filesModified || []).join(", ")}`,
|
|
423
|
+
{ type: "fix-success", file: parsed.filePath, error: parsed.errorMessage, mode: goalResult.mode }
|
|
424
|
+
);
|
|
425
|
+
} else {
|
|
426
|
+
// Record failure with all attempts so brain knows what NOT to do
|
|
427
|
+
const attemptSummary = (goalResult.attempts || []).map(a =>
|
|
428
|
+
`Iter ${a.iteration} (${a.mode}): ${a.explanation?.slice(0, 80)}`
|
|
429
|
+
).join("; ");
|
|
430
|
+
await brain.remember("errors",
|
|
431
|
+
`UNRESOLVED: ${parsed.errorMessage} in ${parsed.filePath}:${parsed.line}. ` +
|
|
432
|
+
`Tried ${goalResult.iteration} iterations: ${attemptSummary}. All failed.`,
|
|
433
|
+
{ type: "fix-failure", file: parsed.filePath, error: parsed.errorMessage, attempts: goalResult.iteration }
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
} catch {}
|
|
437
|
+
}
|
|
438
|
+
|
|
416
439
|
if (goalResult.success) {
|
|
417
440
|
if (logger) logger.info(EVENT_TYPES.HEAL_SUCCESS, goalResult.explanation, { iteration: goalResult.iteration, mode: goalResult.mode });
|
|
418
441
|
return { healed: true, ...goalResult };
|