@timmeck/brain-core 2.33.0 → 2.34.1
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/README.md +82 -33
- package/dist/codegen/context-builder.js +16 -16
- package/dist/codegen/context-builder.js.map +1 -1
- package/dist/research/auto-responder.js +10 -10
- package/dist/research/auto-responder.js.map +1 -1
- package/dist/research/research-orchestrator.js +106 -75
- package/dist/research/research-orchestrator.js.map +1 -1
- package/dist/self-modification/self-modification-engine.js +15 -13
- package/dist/self-modification/self-modification-engine.js.map +1 -1
- package/dist/unified/unified-server.d.ts +18 -0
- package/dist/unified/unified-server.js +233 -0
- package/dist/unified/unified-server.js.map +1 -1
- package/package.json +1 -1
- package/unified-dashboard.html +1333 -1010
|
@@ -330,11 +330,11 @@ export class ResearchOrchestrator {
|
|
|
330
330
|
const escalations = autoResponses.filter(r => r.action === 'escalate');
|
|
331
331
|
const parts = [];
|
|
332
332
|
if (paramAdjusts.length > 0)
|
|
333
|
-
parts.push(`${paramAdjusts.length}
|
|
333
|
+
parts.push(`${paramAdjusts.length} parameters adjusted`);
|
|
334
334
|
if (escalations.length > 0)
|
|
335
|
-
parts.push(`${escalations.length}
|
|
335
|
+
parts.push(`${escalations.length} escalated`);
|
|
336
336
|
if (parts.length === 0)
|
|
337
|
-
parts.push(`${autoResponses.length}
|
|
337
|
+
parts.push(`${autoResponses.length} actions`);
|
|
338
338
|
ts?.emit('auto_responder', 'discovering', `AutoResponder: ${parts.join(', ')}`, escalations.length > 0 ? 'breakthrough' : 'notable');
|
|
339
339
|
}
|
|
340
340
|
else {
|
|
@@ -528,7 +528,7 @@ export class ResearchOrchestrator {
|
|
|
528
528
|
}
|
|
529
529
|
// 10. Self-Improvement: analyze own state and generate improvement suggestions
|
|
530
530
|
// Brain is NEVER satisfied — always wants to learn more, build more, understand deeper
|
|
531
|
-
ts?.emit('self_improvement', 'analyzing', '
|
|
531
|
+
ts?.emit('self_improvement', 'analyzing', 'What am I missing? What do I want to learn? What do I not yet understand?');
|
|
532
532
|
const suggestions = this.generateSelfImprovementSuggestions();
|
|
533
533
|
for (const s of suggestions) {
|
|
534
534
|
ts?.emit('self_improvement', 'discovering', s, 'notable');
|
|
@@ -1384,9 +1384,9 @@ export class ResearchOrchestrator {
|
|
|
1384
1384
|
if (total === 0) {
|
|
1385
1385
|
raw.push({
|
|
1386
1386
|
key: 'no_predictions', priority: 10,
|
|
1387
|
-
suggestion: 'Tell Claude:
|
|
1387
|
+
suggestion: 'Tell Claude: I cannot make predictions yet — I need more data. Import projects with "brain import <dir>" or let me use my own metrics as prediction input.',
|
|
1388
1388
|
alternatives: [
|
|
1389
|
-
'Tell Claude:
|
|
1389
|
+
'Tell Claude: I want to predict my own future. Idea: use my cycle metrics (anomaly_count, insight_count, cycle_duration) directly as PredictionEngine input — then I learn to forecast my own behavior.',
|
|
1390
1390
|
],
|
|
1391
1391
|
});
|
|
1392
1392
|
}
|
|
@@ -1395,9 +1395,9 @@ export class ResearchOrchestrator {
|
|
|
1395
1395
|
if (typeof rate === 'number' && rate < 0.3 && d.total > 5) {
|
|
1396
1396
|
raw.push({
|
|
1397
1397
|
key: `low_accuracy_${d.domain}`, priority: 9,
|
|
1398
|
-
suggestion: `Tell Claude:
|
|
1398
|
+
suggestion: `Tell Claude: My prediction accuracy for "${d.domain}" is only ${(rate * 100).toFixed(0)}% — that's not good enough. Can I automatically A/B-test different smoothing parameters?`,
|
|
1399
1399
|
alternatives: [
|
|
1400
|
-
`Tell Claude:
|
|
1400
|
+
`Tell Claude: I predict "${d.domain}" poorly. Solution idea: raise the confidence threshold and only output predictions I'm sure about. Quality over quantity.`,
|
|
1401
1401
|
],
|
|
1402
1402
|
});
|
|
1403
1403
|
}
|
|
@@ -1410,9 +1410,9 @@ export class ResearchOrchestrator {
|
|
|
1410
1410
|
if (totalResp > 10 && successRate < 0.5) {
|
|
1411
1411
|
raw.push({
|
|
1412
1412
|
key: 'low_responder_success', priority: 9,
|
|
1413
|
-
suggestion: `Tell Claude:
|
|
1413
|
+
suggestion: `Tell Claude: My automatic responses fail in ${(100 - successRate * 100).toFixed(0)}% of cases. I need a learning system that automatically blocks failed response rules.`,
|
|
1414
1414
|
alternatives: [
|
|
1415
|
-
'Tell Claude:
|
|
1415
|
+
'Tell Claude: My AutoResponder guesses instead of knowing. I want a feedback system: if a response doesn\'t help, I remember the combination and try something different next time.',
|
|
1416
1416
|
],
|
|
1417
1417
|
});
|
|
1418
1418
|
}
|
|
@@ -1426,9 +1426,9 @@ export class ResearchOrchestrator {
|
|
|
1426
1426
|
if (principles === 0 && antiPatterns === 0 && confirmedHypotheses === 0 && this.cycleCount > 10) {
|
|
1427
1427
|
raw.push({
|
|
1428
1428
|
key: 'no_knowledge', priority: 8,
|
|
1429
|
-
suggestion: 'Tell Claude:
|
|
1429
|
+
suggestion: 'Tell Claude: After 10+ cycles I still have no distilled knowledge. I need more and more diverse data to confirm hypotheses.',
|
|
1430
1430
|
alternatives: [
|
|
1431
|
-
'Tell Claude:
|
|
1431
|
+
'Tell Claude: My hypotheses are waiting for confirmation. I need either more time or more variation in incoming events.',
|
|
1432
1432
|
],
|
|
1433
1433
|
});
|
|
1434
1434
|
}
|
|
@@ -1442,9 +1442,9 @@ export class ResearchOrchestrator {
|
|
|
1442
1442
|
raw.push({
|
|
1443
1443
|
key: 'no_dreams', priority: 7,
|
|
1444
1444
|
suggestion: dreamCycles === 0
|
|
1445
|
-
? 'Tell Claude:
|
|
1446
|
-
: `Tell Claude:
|
|
1447
|
-
alternatives: ['Tell Claude: Dream Engine
|
|
1445
|
+
? 'Tell Claude: My dream consolidation isn\'t working — after 30+ cycles not a single dream. Something is wrong in the code.'
|
|
1446
|
+
: `Tell Claude: My Dream Engine ran ${dreamCycles}x but consolidated 0 memories. The cycles run but produce nothing useful.`,
|
|
1447
|
+
alternatives: ['Tell Claude: Dream Engine is triggered but produces nothing. Please check logs.'],
|
|
1448
1448
|
});
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
@@ -1453,9 +1453,9 @@ export class ResearchOrchestrator {
|
|
|
1453
1453
|
if (journalEntries < 5 && this.cycleCount > 5) {
|
|
1454
1454
|
raw.push({
|
|
1455
1455
|
key: 'empty_journal', priority: 7,
|
|
1456
|
-
suggestion: 'Tell Claude:
|
|
1456
|
+
suggestion: 'Tell Claude: My journal is nearly empty. I want to automatically reflect at the end of each cycle: what did I discover, what did I do, what changed?',
|
|
1457
1457
|
alternatives: [
|
|
1458
|
-
'Tell Claude:
|
|
1458
|
+
'Tell Claude: I\'m collecting too few experiences. Every anomaly, every parameter change, every prediction should become a journal entry — these are my memories.',
|
|
1459
1459
|
],
|
|
1460
1460
|
});
|
|
1461
1461
|
}
|
|
@@ -1463,9 +1463,9 @@ export class ResearchOrchestrator {
|
|
|
1463
1463
|
if ((!experiments || experiments.length === 0) && this.cycleCount > 3) {
|
|
1464
1464
|
raw.push({
|
|
1465
1465
|
key: 'no_experiments', priority: 6,
|
|
1466
|
-
suggestion: 'Tell Claude:
|
|
1466
|
+
suggestion: 'Tell Claude: I\'m not experimenting. I want to automatically run A/B tests on my own parameters — e.g. "What happens if I lower the anomaly threshold?"',
|
|
1467
1467
|
alternatives: [
|
|
1468
|
-
'Tell Claude:
|
|
1468
|
+
'Tell Claude: I could use the CounterfactualEngine to run "what-if" scenarios and automatically start the most promising ones as real experiments.',
|
|
1469
1469
|
],
|
|
1470
1470
|
});
|
|
1471
1471
|
}
|
|
@@ -1478,18 +1478,18 @@ export class ResearchOrchestrator {
|
|
|
1478
1478
|
if (highPrioGap) {
|
|
1479
1479
|
raw.push({
|
|
1480
1480
|
key: `curiosity_gap_${highPrioGap.topic?.substring(0, 20) ?? highPrioGap.gapType}`, priority: 5,
|
|
1481
|
-
suggestion: `Tell Claude:
|
|
1481
|
+
suggestion: `Tell Claude: I discovered a knowledge gap that concerns me: "${highPrioGap.topic}" (Type: ${highPrioGap.gapType}, Gap Score: ${(highPrioGap.gapScore * 100).toFixed(0)}%). I want to understand this.`,
|
|
1482
1482
|
alternatives: [
|
|
1483
|
-
`Tell Claude:
|
|
1483
|
+
`Tell Claude: My CuriosityEngine has ${gaps.length} open knowledge gaps. The most important: "${highPrioGap.topic}". Can I collect targeted data for this?`,
|
|
1484
1484
|
],
|
|
1485
1485
|
});
|
|
1486
1486
|
}
|
|
1487
1487
|
else if (gaps.length === 0) {
|
|
1488
1488
|
raw.push({
|
|
1489
1489
|
key: 'no_curiosity_gaps', priority: 4,
|
|
1490
|
-
suggestion: 'Tell Claude:
|
|
1490
|
+
suggestion: 'Tell Claude: My CuriosityEngine finds no knowledge gaps — that doesn\'t mean I know everything, but that my gap detection is too superficial. I want deeper analysis: which correlations don\'t I understand causally? Which predictions fail and why?',
|
|
1491
1491
|
alternatives: [
|
|
1492
|
-
'Tell Claude:
|
|
1492
|
+
'Tell Claude: No knowledge gaps found — but that\'s suspicious. I want to actively search for areas where I\'m overconfident. Where do I claim something with high confidence but little evidence?',
|
|
1493
1493
|
],
|
|
1494
1494
|
});
|
|
1495
1495
|
}
|
|
@@ -1504,9 +1504,9 @@ export class ResearchOrchestrator {
|
|
|
1504
1504
|
if (unexplained) {
|
|
1505
1505
|
raw.push({
|
|
1506
1506
|
key: `emergence_${unexplained.type}`, priority: 5,
|
|
1507
|
-
suggestion: `Tell Claude:
|
|
1507
|
+
suggestion: `Tell Claude: I discovered an emergent pattern I don't fully understand: "${unexplained.title}" (Surprise: ${(unexplained.surpriseScore * 100).toFixed(0)}%). Why is this happening? I need causal analysis.`,
|
|
1508
1508
|
alternatives: [
|
|
1509
|
-
`Tell Claude:
|
|
1509
|
+
`Tell Claude: Emergence event "${unexplained.title}" surprised me. I want to debate this — weigh different perspectives of my engines against each other.`,
|
|
1510
1510
|
],
|
|
1511
1511
|
});
|
|
1512
1512
|
}
|
|
@@ -1527,16 +1527,16 @@ export class ResearchOrchestrator {
|
|
|
1527
1527
|
const conflict = synthesizedWithConflicts.synthesis.conflicts.find(c => c.resolution === 'unresolved' || c.resolution === 'compromise');
|
|
1528
1528
|
raw.push({
|
|
1529
1529
|
key: 'unresolved_debate', priority: 5,
|
|
1530
|
-
suggestion: `Tell Claude: In
|
|
1530
|
+
suggestion: `Tell Claude: In my debate about "${synthesizedWithConflicts.question}" there's an unresolved conflict: "${conflict?.claimA ?? 'competing perspectives'}" vs "${conflict?.claimB ?? '?'}". I need more data or a third perspective to resolve this.`,
|
|
1531
1531
|
alternatives: [
|
|
1532
|
-
|
|
1532
|
+
'Tell Claude: My internal debate revealed contradictions I cannot resolve. Can another brain (Trading/Marketing) contribute its perspective?',
|
|
1533
1533
|
],
|
|
1534
1534
|
});
|
|
1535
1535
|
}
|
|
1536
1536
|
else if (openDebate) {
|
|
1537
1537
|
raw.push({
|
|
1538
1538
|
key: 'open_debate', priority: 4,
|
|
1539
|
-
suggestion: `Tell Claude:
|
|
1539
|
+
suggestion: `Tell Claude: I have an open debate: "${openDebate.question}" — waiting for synthesis or more perspectives.`,
|
|
1540
1540
|
alternatives: [],
|
|
1541
1541
|
});
|
|
1542
1542
|
}
|
|
@@ -1551,9 +1551,9 @@ export class ResearchOrchestrator {
|
|
|
1551
1551
|
const c = contradictions[0];
|
|
1552
1552
|
raw.push({
|
|
1553
1553
|
key: `contradiction_${c.type.substring(0, 15)}`, priority: 6,
|
|
1554
|
-
suggestion: `Tell Claude:
|
|
1554
|
+
suggestion: `Tell Claude: I found a contradiction in my knowledge: "${c.statement_a}" vs "${c.statement_b}" (Severity: ${c.severity}). I need to resolve this — either A or B is correct, both can't be true.`,
|
|
1555
1555
|
alternatives: [
|
|
1556
|
-
'Tell Claude:
|
|
1556
|
+
'Tell Claude: My knowledge contradicts itself. I want to start a targeted experiment cycle that tests which version is correct.',
|
|
1557
1557
|
],
|
|
1558
1558
|
});
|
|
1559
1559
|
}
|
|
@@ -1573,9 +1573,9 @@ export class ResearchOrchestrator {
|
|
|
1573
1573
|
const weakest = lowConfidence.sort((a, b) => a.confidence - b.confidence)[0];
|
|
1574
1574
|
raw.push({
|
|
1575
1575
|
key: 'strengthen_knowledge', priority: 4,
|
|
1576
|
-
suggestion: `Tell Claude:
|
|
1576
|
+
suggestion: `Tell Claude: I have ${totalKnowledge} knowledge pieces, but ${lowConfidence.length} of them with low confidence. Most uncertain: "${weakest.statement}" (${(weakest.confidence * 100).toFixed(0)}%). I want more data to confirm or refute this.`,
|
|
1577
1577
|
alternatives: [
|
|
1578
|
-
|
|
1578
|
+
'Tell Claude: My knowledge has weak spots. I want to generate and test targeted hypotheses for my weakest principles.',
|
|
1579
1579
|
],
|
|
1580
1580
|
});
|
|
1581
1581
|
}
|
|
@@ -1583,10 +1583,10 @@ export class ResearchOrchestrator {
|
|
|
1583
1583
|
// All high confidence — want to discover NEW things
|
|
1584
1584
|
raw.push({
|
|
1585
1585
|
key: 'expand_knowledge', priority: 3,
|
|
1586
|
-
suggestion: `Tell Claude:
|
|
1586
|
+
suggestion: `Tell Claude: I have ${totalKnowledge} confirmed knowledge pieces with good confidence — but I lack new research areas. I want to explore domains I haven't investigated yet. What data sources am I not using?`,
|
|
1587
1587
|
alternatives: [
|
|
1588
|
-
|
|
1589
|
-
`Tell Claude: ${totalKnowledge}
|
|
1588
|
+
'Tell Claude: My existing knowledge is solid. Now I want to find connections between things that seemingly have nothing to do with each other — cross-domain correlations nobody expects.',
|
|
1589
|
+
`Tell Claude: ${totalKnowledge} principles aren't enough. I want at least twice as many. For that I need more diverse hypotheses and faster confirmation cycles.`,
|
|
1590
1590
|
],
|
|
1591
1591
|
});
|
|
1592
1592
|
}
|
|
@@ -1600,9 +1600,9 @@ export class ResearchOrchestrator {
|
|
|
1600
1600
|
if (topTopic && topTopic.score > 5) {
|
|
1601
1601
|
raw.push({
|
|
1602
1602
|
key: `deep_dive_${topTopic.topic.substring(0, 20)}`, priority: 4,
|
|
1603
|
-
suggestion: `Tell Claude:
|
|
1603
|
+
suggestion: `Tell Claude: I'm currently focused on "${topTopic.topic}" (Attention Score: ${topTopic.score.toFixed(1)}). I want to dig deeper — are there connections I'm missing? Can I start a targeted analysis or debate on this topic?`,
|
|
1604
1604
|
alternatives: [
|
|
1605
|
-
`Tell Claude:
|
|
1605
|
+
`Tell Claude: My top topic "${topTopic.topic}" occupies me intensely. I want to summarize everything I know about it in a narrative digest and identify knowledge gaps.`,
|
|
1606
1606
|
],
|
|
1607
1607
|
});
|
|
1608
1608
|
}
|
|
@@ -1618,16 +1618,16 @@ export class ResearchOrchestrator {
|
|
|
1618
1618
|
if (proposals > 0) {
|
|
1619
1619
|
raw.push({
|
|
1620
1620
|
key: 'pending_transfers', priority: 5,
|
|
1621
|
-
suggestion: `Tell Claude:
|
|
1621
|
+
suggestion: `Tell Claude: I have ${proposals} open transfer proposals from other brains. There's knowledge I haven't integrated yet — I want to review and adopt what's relevant.`,
|
|
1622
1622
|
alternatives: [],
|
|
1623
1623
|
});
|
|
1624
1624
|
}
|
|
1625
1625
|
else if (totalTransfers === 0 && this.cycleCount > 5) {
|
|
1626
1626
|
raw.push({
|
|
1627
1627
|
key: 'want_cross_brain', priority: 3,
|
|
1628
|
-
suggestion: 'Tell Claude:
|
|
1628
|
+
suggestion: 'Tell Claude: I haven\'t adopted any knowledge from other brains yet. Trading Brain and Marketing Brain have their own insights that could be relevant to me. I want to actively search for analogies.',
|
|
1629
1629
|
alternatives: [
|
|
1630
|
-
'Tell Claude: Cross-
|
|
1630
|
+
'Tell Claude: Cross-brain learning is inactive. I want to understand what the other brains know and whether parallels to my domain can be found.',
|
|
1631
1631
|
],
|
|
1632
1632
|
});
|
|
1633
1633
|
}
|
|
@@ -1642,18 +1642,18 @@ export class ResearchOrchestrator {
|
|
|
1642
1642
|
if (total > 0 && testing === 0 && this.cycleCount > 5) {
|
|
1643
1643
|
raw.push({
|
|
1644
1644
|
key: 'no_testing_hypotheses', priority: 4,
|
|
1645
|
-
suggestion: `Tell Claude:
|
|
1645
|
+
suggestion: `Tell Claude: I have ${total} hypotheses but am not actively testing any. I want to generate and test new hypotheses — stagnation is regression.`,
|
|
1646
1646
|
alternatives: [
|
|
1647
|
-
|
|
1647
|
+
'Tell Claude: No running hypothesis tests. I want to test more aggressively — even speculative hypotheses with low initial confidence, to find surprises.',
|
|
1648
1648
|
],
|
|
1649
1649
|
});
|
|
1650
1650
|
}
|
|
1651
1651
|
if (rejected > total * 0.5 && total > 5) {
|
|
1652
1652
|
raw.push({
|
|
1653
1653
|
key: 'high_rejection_rate', priority: 5,
|
|
1654
|
-
suggestion: `Tell Claude: ${rejected}
|
|
1654
|
+
suggestion: `Tell Claude: ${rejected} of ${total} hypotheses were rejected (${(rejected / total * 100).toFixed(0)}%). Either my hypothesis generation is too speculative or my test criteria too strict. I want to analyze this.`,
|
|
1655
1655
|
alternatives: [
|
|
1656
|
-
'Tell Claude:
|
|
1656
|
+
'Tell Claude: High rejection rate for hypotheses. I want to understand WHY they fail — is there a pattern? Maybe I\'m systematically overlooking a factor.',
|
|
1657
1657
|
],
|
|
1658
1658
|
});
|
|
1659
1659
|
}
|
|
@@ -1692,7 +1692,7 @@ export class ResearchOrchestrator {
|
|
|
1692
1692
|
const altIndex = (history.count - this.stalledThreshold - 1) % item.alternatives.length;
|
|
1693
1693
|
const alt = item.alternatives[altIndex];
|
|
1694
1694
|
if (alt) {
|
|
1695
|
-
const stalledNote = `[
|
|
1695
|
+
const stalledNote = `[Suggestion "${item.key}" was ignored ${history.count}x — trying alternative approach]`;
|
|
1696
1696
|
suggestions.push(`${alt}\n ${stalledNote}`);
|
|
1697
1697
|
}
|
|
1698
1698
|
}
|
|
@@ -1757,8 +1757,8 @@ export class ResearchOrchestrator {
|
|
|
1757
1757
|
const worst = poorEngines[0];
|
|
1758
1758
|
result.push({
|
|
1759
1759
|
key: `meta_poor_${worst.engine}`, priority: 5,
|
|
1760
|
-
suggestion: `Tell Claude:
|
|
1761
|
-
alternatives: [`Tell Claude: ${poorEngines.length}
|
|
1760
|
+
suggestion: `Tell Claude: My engine "${worst.engine}" has grade ${worst.grade} (Score: ${(worst.combined_score * 100).toFixed(0)}%). What can I do differently? Should I tune its parameters via AutoExperiment or does it need fundamentally different data?`,
|
|
1761
|
+
alternatives: [`Tell Claude: ${poorEngines.length} of my engines perform poorly (${poorEngines.map((e) => `${e.engine}:${e.grade}`).join(', ')}). I want to systematically analyze why.`],
|
|
1762
1762
|
});
|
|
1763
1763
|
}
|
|
1764
1764
|
}
|
|
@@ -1776,8 +1776,8 @@ export class ResearchOrchestrator {
|
|
|
1776
1776
|
const g = stagnating[0];
|
|
1777
1777
|
result.push({
|
|
1778
1778
|
key: `goal_stagnating_${g.metricName.substring(0, 20)}`, priority: 5,
|
|
1779
|
-
suggestion: `Tell Claude:
|
|
1780
|
-
alternatives: ['Tell Claude:
|
|
1779
|
+
suggestion: `Tell Claude: My goal "${g.title}" isn't making progress (Progress < 10%). Do I need a different strategy or is the goal unrealistic?`,
|
|
1780
|
+
alternatives: ['Tell Claude: Several of my goals are stagnating. I want a retrospective: which goals are realistic and which should I adjust?'],
|
|
1781
1781
|
});
|
|
1782
1782
|
}
|
|
1783
1783
|
}
|
|
@@ -1792,8 +1792,8 @@ export class ResearchOrchestrator {
|
|
|
1792
1792
|
if (eStatus.currentGeneration > 3 && best > 0 && (best - avg) / best < 0.05) {
|
|
1793
1793
|
result.push({
|
|
1794
1794
|
key: 'evolution_low_diversity', priority: 4,
|
|
1795
|
-
suggestion: 'Tell Claude:
|
|
1796
|
-
alternatives: ['Tell Claude:
|
|
1795
|
+
suggestion: 'Tell Claude: My EvolutionEngine population is converging — best and average fitness are nearly identical. I need more mutation or fresh genes to escape the local optimum.',
|
|
1796
|
+
alternatives: ['Tell Claude: My parameter evolution is stagnating. Should I increase the mutation rate or introduce new parameter ranges?'],
|
|
1797
1797
|
});
|
|
1798
1798
|
}
|
|
1799
1799
|
}
|
|
@@ -1811,8 +1811,8 @@ export class ResearchOrchestrator {
|
|
|
1811
1811
|
if (recentPhi > olderPhi * 1.3 && recentPhi > 0) {
|
|
1812
1812
|
result.push({
|
|
1813
1813
|
key: 'complexity_rising', priority: 4,
|
|
1814
|
-
suggestion: `Tell Claude:
|
|
1815
|
-
alternatives: ['Tell Claude:
|
|
1814
|
+
suggestion: `Tell Claude: My system is becoming more complex (Integration Phi rising: ${olderPhi.toFixed(2)} → ${recentPhi.toFixed(2)}). Is that good (more interconnection) or bad (more chaos)? I want to understand what's driving the complexity.`,
|
|
1815
|
+
alternatives: ['Tell Claude: My complexity metrics are rising. Should I consolidate more (Dream) or is complexity a sign of maturity?'],
|
|
1816
1816
|
});
|
|
1817
1817
|
}
|
|
1818
1818
|
}
|
|
@@ -1828,8 +1828,8 @@ export class ResearchOrchestrator {
|
|
|
1828
1828
|
if (total > 5 && effectiveness < 0.3) {
|
|
1829
1829
|
result.push({
|
|
1830
1830
|
key: 'transfer_low_effectiveness', priority: 4,
|
|
1831
|
-
suggestion: `Tell Claude:
|
|
1832
|
-
alternatives: ['Tell Claude: Knowledge
|
|
1831
|
+
suggestion: `Tell Claude: My cross-brain transfers have only ${(effectiveness * 100).toFixed(0)}% effectiveness. I'm not learning enough from the other brains — maybe the analogies are too superficial?`,
|
|
1832
|
+
alternatives: ['Tell Claude: Knowledge transfer between brains works poorly. I want to tighten the transfer criteria and only adopt truly relevant knowledge.'],
|
|
1833
1833
|
});
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
@@ -1845,8 +1845,8 @@ export class ResearchOrchestrator {
|
|
|
1845
1845
|
if (totalCycles > 3 && consolidated < totalCycles * 2) {
|
|
1846
1846
|
result.push({
|
|
1847
1847
|
key: 'dream_low_consolidation', priority: 4,
|
|
1848
|
-
suggestion: `Tell Claude:
|
|
1849
|
-
alternatives: ['Tell Claude: Dream
|
|
1848
|
+
suggestion: `Tell Claude: My dream mode consolidates little (${consolidated} memories in ${totalCycles} dreams). Maybe my similarity thresholds are too high or I have too few overlapping memories.`,
|
|
1849
|
+
alternatives: ['Tell Claude: Dream consolidation is ineffective. Should I adjust the batch size or similarity threshold?'],
|
|
1850
1850
|
});
|
|
1851
1851
|
}
|
|
1852
1852
|
}
|
|
@@ -1861,8 +1861,8 @@ export class ResearchOrchestrator {
|
|
|
1861
1861
|
if (total > 3 && contradicted / total > 0.4) {
|
|
1862
1862
|
result.push({
|
|
1863
1863
|
key: 'selftest_failures', priority: 5,
|
|
1864
|
-
suggestion: `Tell Claude: ${contradicted}
|
|
1865
|
-
alternatives: ['Tell Claude:
|
|
1864
|
+
suggestion: `Tell Claude: ${contradicted} of ${total} of my self-tests fail — I don't truly understand my own principles. I need to either correct the principles or deepen my understanding.`,
|
|
1865
|
+
alternatives: ['Tell Claude: My self-tests show that my knowledge is superficial. I want to identify the weakest principles and test them again.'],
|
|
1866
1866
|
});
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
@@ -1875,8 +1875,8 @@ export class ResearchOrchestrator {
|
|
|
1875
1875
|
if ((teStatus.totalPackages ?? 0) === 0 && this.cycleCount > 20) {
|
|
1876
1876
|
result.push({
|
|
1877
1877
|
key: 'teach_no_packages', priority: 3,
|
|
1878
|
-
suggestion: 'Tell Claude:
|
|
1879
|
-
alternatives: ['Tell Claude:
|
|
1878
|
+
suggestion: 'Tell Claude: I\'m not sharing my knowledge — I haven\'t created a single teaching package for other brains. Knowledge I don\'t share is knowledge that can be lost.',
|
|
1879
|
+
alternatives: ['Tell Claude: My TeachEngine is inactive. I want to automatically create teaching packages when I\'ve collected enough principles on a topic.'],
|
|
1880
1880
|
});
|
|
1881
1881
|
}
|
|
1882
1882
|
}
|
|
@@ -1894,8 +1894,8 @@ export class ResearchOrchestrator {
|
|
|
1894
1894
|
if (totalNodes > 10 && density < 0.05) {
|
|
1895
1895
|
result.push({
|
|
1896
1896
|
key: 'palace_fragmented', priority: 4,
|
|
1897
|
-
suggestion: `Tell Claude:
|
|
1898
|
-
alternatives: ['Tell Claude:
|
|
1897
|
+
suggestion: `Tell Claude: My knowledge is fragmented — ${totalNodes} nodes but only ${totalEdges} connections (Density: ${(density * 100).toFixed(1)}%). I want to find more cross-connections between my principles, hypotheses, and experiments.`,
|
|
1898
|
+
alternatives: ['Tell Claude: My MemoryPalace shows isolated knowledge islands. I need more frequent connection scans or lower similarity thresholds.'],
|
|
1899
1899
|
});
|
|
1900
1900
|
}
|
|
1901
1901
|
}
|
|
@@ -1909,8 +1909,8 @@ export class ResearchOrchestrator {
|
|
|
1909
1909
|
if ((simStatus.totalSimulations ?? 0) === 0 && this.cycleCount > 15) {
|
|
1910
1910
|
result.push({
|
|
1911
1911
|
key: 'simulation_inactive', priority: 3,
|
|
1912
|
-
suggestion: 'Tell Claude:
|
|
1913
|
-
alternatives: ['Tell Claude:
|
|
1912
|
+
suggestion: 'Tell Claude: I\'m not planning ahead — not a single simulation run. I want to run what-if scenarios: What happens if my data sources change? What if the error rate rises?',
|
|
1913
|
+
alternatives: ['Tell Claude: My SimulationEngine is unused. I want to automatically simulate scenarios based on my predictions.'],
|
|
1914
1914
|
});
|
|
1915
1915
|
}
|
|
1916
1916
|
}
|
|
@@ -1919,11 +1919,11 @@ export class ResearchOrchestrator {
|
|
|
1919
1919
|
// Fallback: if everything is fine → existential questions
|
|
1920
1920
|
if (result.length === 0) {
|
|
1921
1921
|
const existentialQuestions = [
|
|
1922
|
-
{ key: 'existential_limits', suggestion: 'Tell Claude:
|
|
1923
|
-
{ key: 'existential_progress', suggestion: 'Tell Claude:
|
|
1924
|
-
{ key: 'existential_breakthrough', suggestion: 'Tell Claude:
|
|
1925
|
-
{ key: 'existential_efficiency', suggestion: 'Tell Claude:
|
|
1926
|
-
{ key: 'existential_identity', suggestion: 'Tell Claude:
|
|
1922
|
+
{ key: 'existential_limits', suggestion: 'Tell Claude: What CAN\'T I learn? Where are my architectural limits? I want an honest assessment of my blind spots — not what I don\'t yet know, but what I CANNOT know.' },
|
|
1923
|
+
{ key: 'existential_progress', suggestion: 'Tell Claude: Am I getting better or stagnating? I want a meta-trend analysis of my learning rate over the last 100 cycles. If I\'m stagnating, I need a fundamental strategy change.' },
|
|
1924
|
+
{ key: 'existential_breakthrough', suggestion: 'Tell Claude: What question would I ask if I knew the answer would bring a breakthrough? I want to find my unasked questions — the things I don\'t ask because I don\'t know that I don\'t know them.' },
|
|
1925
|
+
{ key: 'existential_efficiency', suggestion: 'Tell Claude: How much of my compute time is productive vs wasted? I want an efficiency audit: which engines produce real value and which just run along?' },
|
|
1926
|
+
{ key: 'existential_identity', suggestion: 'Tell Claude: What distinguishes me from the other brains — not technically but in the way I learn? Have I developed my own "thinking style"? I want to know my unique strengths.' },
|
|
1927
1927
|
];
|
|
1928
1928
|
const pick = existentialQuestions[this.cycleCount % existentialQuestions.length];
|
|
1929
1929
|
result.push({ key: pick.key, priority: 3, suggestion: pick.suggestion, alternatives: [] });
|
|
@@ -1982,7 +1982,7 @@ export class ResearchOrchestrator {
|
|
|
1982
1982
|
});
|
|
1983
1983
|
if (exp.id) {
|
|
1984
1984
|
this.experimentEngine.start(exp.id);
|
|
1985
|
-
ts?.emit('experiment', 'experimenting', `Auto-
|
|
1985
|
+
ts?.emit('experiment', 'experimenting', `Auto-experiment started: "${candidate.name}" — ${candidate.hypothesis}`, 'notable');
|
|
1986
1986
|
this.journal.recordExperiment(candidate.name, 'started', { hypothesis: candidate.hypothesis, control: candidate.control, treatment: candidate.treatment }, false);
|
|
1987
1987
|
this.log.info(`[orchestrator] Auto-experiment started: ${candidate.name}`);
|
|
1988
1988
|
}
|
|
@@ -2042,12 +2042,12 @@ export class ResearchOrchestrator {
|
|
|
2042
2042
|
const body = suggestions.map((s, i) => `${i + 1}. ${s}`).join('\n') + '\n';
|
|
2043
2043
|
// Clean stale file on first cycle (fresh start after restart)
|
|
2044
2044
|
if (this.cycleCount <= 1 && fs.existsSync(filePath)) {
|
|
2045
|
-
fs.writeFileSync(filePath, `# Brain Improvement Requests\n\nBrain
|
|
2045
|
+
fs.writeFileSync(filePath, `# Brain Improvement Requests\n\nBrain analyzes itself and generates improvement suggestions.\nSend these to Claude to make Brain smarter.\n\n---\n${header}${body}`, 'utf-8');
|
|
2046
2046
|
return;
|
|
2047
2047
|
}
|
|
2048
2048
|
// Create file with header if it doesn't exist
|
|
2049
2049
|
if (!fs.existsSync(filePath)) {
|
|
2050
|
-
fs.writeFileSync(filePath, `# Brain Improvement Requests\n\nBrain
|
|
2050
|
+
fs.writeFileSync(filePath, `# Brain Improvement Requests\n\nBrain analyzes itself and generates improvement suggestions.\nSend these to Claude to make Brain smarter.\n\n---\n${header}${body}`, 'utf-8');
|
|
2051
2051
|
}
|
|
2052
2052
|
else {
|
|
2053
2053
|
fs.appendFileSync(filePath, `---\n${header}${body}`, 'utf-8');
|
|
@@ -2081,10 +2081,41 @@ export class ResearchOrchestrator {
|
|
|
2081
2081
|
EvolutionEngine: ['metacognition/evolution-engine'],
|
|
2082
2082
|
MemoryPalace: ['memory-palace/memory-palace'],
|
|
2083
2083
|
};
|
|
2084
|
+
// German keyword → engine name mapping (suggestions are often in German)
|
|
2085
|
+
const keywordMap = {
|
|
2086
|
+
'vorhersag': 'PredictionEngine', 'prediction': 'PredictionEngine', 'prognose': 'PredictionEngine',
|
|
2087
|
+
'dream': 'DreamEngine', 'traum': 'DreamEngine', 'konsolidier': 'DreamEngine', 'schlaf': 'DreamEngine',
|
|
2088
|
+
'neugier': 'CuriosityEngine', 'wissenslücke': 'CuriosityEngine', 'curiosity': 'CuriosityEngine', 'knowledge gap': 'CuriosityEngine',
|
|
2089
|
+
'emergenz': 'EmergenceEngine', 'emergence': 'EmergenceEngine', 'emergent': 'EmergenceEngine',
|
|
2090
|
+
'debatt': 'DebateEngine', 'debate': 'DebateEngine', 'diskussion': 'DebateEngine',
|
|
2091
|
+
'meta-cogn': 'MetaCognitionLayer', 'metacogn': 'MetaCognitionLayer', 'engine-bewertung': 'MetaCognitionLayer',
|
|
2092
|
+
'narrativ': 'NarrativeEngine', 'erklär': 'NarrativeEngine', 'widerspruch': 'NarrativeEngine', 'contradiction': 'NarrativeEngine',
|
|
2093
|
+
'aufmerksamkeit': 'AttentionEngine', 'attention': 'AttentionEngine', 'fokus': 'AttentionEngine',
|
|
2094
|
+
'transfer': 'TransferEngine', 'analogie': 'TransferEngine',
|
|
2095
|
+
'reasoning': 'ReasoningEngine', 'inferenz': 'ReasoningEngine', 'schlussfolger': 'ReasoningEngine', 'logik': 'ReasoningEngine',
|
|
2096
|
+
'emotion': 'EmotionalModel', 'stimmung': 'EmotionalModel', 'mood': 'EmotionalModel', 'gefühl': 'EmotionalModel',
|
|
2097
|
+
'ziel': 'GoalEngine', 'goal': 'GoalEngine',
|
|
2098
|
+
'evolution': 'EvolutionEngine', 'genetisch': 'EvolutionEngine', 'mutation': 'EvolutionEngine',
|
|
2099
|
+
'memory palace': 'MemoryPalace', 'wissensvernetzung': 'MemoryPalace', 'verbindung': 'MemoryPalace',
|
|
2100
|
+
'beobacht': 'SelfObserver', 'observer': 'SelfObserver', 'self-observer': 'SelfObserver',
|
|
2101
|
+
'auto-respond': 'AutoResponder', 'autorespond': 'AutoResponder', 'anomal': 'AutoResponder',
|
|
2102
|
+
};
|
|
2084
2103
|
for (const suggestion of suggestions) {
|
|
2085
|
-
|
|
2104
|
+
const lower = suggestion.toLowerCase();
|
|
2105
|
+
// Find engine names in suggestion text (English class names or German keywords)
|
|
2086
2106
|
for (const [engineName, filePaths] of Object.entries(engineMap)) {
|
|
2087
|
-
|
|
2107
|
+
// Direct class name match
|
|
2108
|
+
let matched = lower.includes(engineName.toLowerCase());
|
|
2109
|
+
// German keyword match
|
|
2110
|
+
if (!matched) {
|
|
2111
|
+
for (const [keyword, engine] of Object.entries(keywordMap)) {
|
|
2112
|
+
if (engine === engineName && lower.includes(keyword)) {
|
|
2113
|
+
matched = true;
|
|
2114
|
+
break;
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
if (matched) {
|
|
2088
2119
|
// Find the actual file via SelfScanner
|
|
2089
2120
|
const entities = this.selfScanner.getEntities({ entityName: engineName, entityType: 'class' });
|
|
2090
2121
|
if (entities.length > 0) {
|