@evomap/evolver 1.89.2 → 1.89.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.
Files changed (110) hide show
  1. package/.cursor/BUGBOT.md +182 -0
  2. package/.env.example +68 -0
  3. package/.git-commit-guard-token +1 -0
  4. package/.github/CODEOWNERS +63 -0
  5. package/.github/ISSUE_TEMPLATE/good_first_issue.md +23 -0
  6. package/.github/pull_request_template.md +45 -0
  7. package/.github/workflows/test.yml +75 -0
  8. package/CHANGELOG.md +1237 -0
  9. package/README.ja-JP.md +1 -3
  10. package/README.ko-KR.md +1 -3
  11. package/README.md +86 -530
  12. package/README.public.md +569 -0
  13. package/README.zh-CN.md +1 -3
  14. package/SECURITY.md +108 -0
  15. package/assets/gep/events.jsonl +3 -0
  16. package/assets/gep/genes.json +496 -0
  17. package/examples/atp-consumer-quickstart.md +100 -0
  18. package/examples/hello-world.md +38 -0
  19. package/index.js +44 -48
  20. package/package.json +6 -17
  21. package/proxy-package.json +39 -0
  22. package/public.manifest.json +143 -0
  23. package/src/adapters/hookAdapter.js +2 -0
  24. package/src/adapters/scripts/_lockPaths.js +74 -0
  25. package/src/adapters/scripts/evolver-session-start.js +19 -27
  26. package/src/config.js +23 -0
  27. package/src/evolve/guards.js +721 -1
  28. package/src/evolve/pipeline/collect.js +1283 -1
  29. package/src/evolve/pipeline/dispatch.js +421 -1
  30. package/src/evolve/pipeline/enrich.js +440 -1
  31. package/src/evolve/pipeline/hub.js +319 -1
  32. package/src/evolve/pipeline/select.js +274 -1
  33. package/src/evolve/pipeline/signals.js +206 -1
  34. package/src/evolve/utils.js +264 -1
  35. package/src/evolve.js +350 -1
  36. package/src/experiment/agentRunner.js +229 -0
  37. package/src/experiment/cli.js +159 -0
  38. package/src/experiment/comparison.js +233 -0
  39. package/src/experiment/metrics.js +75 -0
  40. package/src/forceUpdate.js +311 -30
  41. package/src/gep/a2aProtocol.js +4455 -1
  42. package/src/gep/antiAbuseTelemetry.js +233 -0
  43. package/src/gep/autoDistillConv.js +205 -1
  44. package/src/gep/autoDistillLlm.js +315 -1
  45. package/src/gep/candidateEval.js +92 -1
  46. package/src/gep/candidates.js +198 -1
  47. package/src/gep/contentHash.js +30 -1
  48. package/src/gep/conversationSniffer.js +266 -1
  49. package/src/gep/crypto.js +89 -1
  50. package/src/gep/curriculum.js +163 -1
  51. package/src/gep/deviceId.js +218 -1
  52. package/src/gep/envFingerprint.js +118 -1
  53. package/src/gep/epigenetics.js +31 -1
  54. package/src/gep/execBridge.js +711 -1
  55. package/src/gep/explore.js +289 -1
  56. package/src/gep/hash.js +15 -1
  57. package/src/gep/hubFetch.js +359 -1
  58. package/src/gep/hubReview.js +207 -1
  59. package/src/gep/hubSearch.js +526 -1
  60. package/src/gep/hubVerify.js +306 -1
  61. package/src/gep/learningSignals.js +89 -1
  62. package/src/gep/memoryGraph.js +1374 -1
  63. package/src/gep/memoryGraphAdapter.js +203 -1
  64. package/src/gep/mutation.js +203 -1
  65. package/src/gep/narrativeMemory.js +108 -1
  66. package/src/gep/openPRRegistry.js +205 -1
  67. package/src/gep/personality.js +423 -1
  68. package/src/gep/policyCheck.js +599 -1
  69. package/src/gep/prompt.js +836 -1
  70. package/src/gep/recallInject.js +409 -1
  71. package/src/gep/recallVerifier.js +318 -1
  72. package/src/gep/reflection.js +177 -1
  73. package/src/gep/sanitize.js +9 -0
  74. package/src/gep/selector.js +602 -1
  75. package/src/gep/skillDistiller.js +1294 -1
  76. package/src/gep/solidify.js +1699 -1
  77. package/src/gep/strategy.js +136 -1
  78. package/src/gep/tokenSavings.js +88 -1
  79. package/src/gep/validator/sandboxExecutor.js +29 -1
  80. package/src/gep/workspaceKeychain.js +174 -1
  81. package/src/proxy/extensions/traceControl.js +99 -1
  82. package/src/proxy/index.js +14 -5
  83. package/src/proxy/inject.js +52 -1
  84. package/src/proxy/lifecycle/manager.js +30 -0
  85. package/src/proxy/mailbox/store.js +2 -1
  86. package/src/proxy/router/messages_route.js +13 -2
  87. package/src/proxy/trace/extractor.js +646 -1
  88. package/src/proxy/trace/usage.js +105 -1
  89. package/CONTRIBUTING.md +0 -19
  90. package/assets/cover.png +0 -0
  91. package/assets/gep/genes.seed.json +0 -245
  92. package/scripts/a2a_export.js +0 -63
  93. package/scripts/a2a_ingest.js +0 -79
  94. package/scripts/a2a_promote.js +0 -118
  95. package/scripts/analyze_by_skill.js +0 -121
  96. package/scripts/build_binaries.js +0 -479
  97. package/scripts/check-changelog.js +0 -166
  98. package/scripts/extract_log.js +0 -85
  99. package/scripts/generate_history.js +0 -75
  100. package/scripts/gep_append_event.js +0 -96
  101. package/scripts/gep_personality_report.js +0 -234
  102. package/scripts/human_report.js +0 -147
  103. package/scripts/recall-verify-report.js +0 -234
  104. package/scripts/recover_loop.js +0 -61
  105. package/scripts/seed-merchants.js +0 -91
  106. package/scripts/suggest_version.js +0 -89
  107. package/scripts/validate-modules.js +0 -38
  108. package/scripts/validate-suite.js +0 -78
  109. package/skills/index.json +0 -14
  110. /package/{skills → bundled-skills}/_meta/SKILL.md +0 -0
@@ -1,118 +0,0 @@
1
- var assetStore = require('../src/gep/assetStore');
2
- var solidifyMod = require('../src/gep/solidify');
3
- var contentHash = require('../src/gep/contentHash');
4
- var a2aProto = require('../src/gep/a2aProtocol');
5
-
6
- function parseArgs(argv) {
7
- var out = { flags: new Set(), kv: new Map(), positionals: [] };
8
- for (var i = 0; i < argv.length; i++) {
9
- var a = argv[i];
10
- if (!a) continue;
11
- if (a.startsWith('--')) {
12
- var eq = a.indexOf('=');
13
- if (eq > -1) { out.kv.set(a.slice(2, eq), a.slice(eq + 1)); }
14
- else {
15
- var key = a.slice(2);
16
- var next = argv[i + 1];
17
- if (next && !String(next).startsWith('--')) { out.kv.set(key, next); i++; }
18
- else { out.flags.add(key); }
19
- }
20
- } else { out.positionals.push(a); }
21
- }
22
- return out;
23
- }
24
-
25
- function main() {
26
- var args = parseArgs(process.argv.slice(2));
27
- var id = String(args.kv.get('id') || '').trim();
28
- var typeRaw = String(args.kv.get('type') || '').trim().toLowerCase();
29
- var validated = args.flags.has('validated') || String(args.kv.get('validated') || '') === 'true';
30
- var limit = Number.isFinite(Number(args.kv.get('limit'))) ? Number(args.kv.get('limit')) : 500;
31
-
32
- if (!id || !typeRaw) throw new Error('Usage: node scripts/a2a_promote.js --type capsule|gene|event --id <id> --validated');
33
- if (!validated) throw new Error('Refusing to promote without --validated (local verification must be done first).');
34
-
35
- var type = typeRaw === 'capsule' ? 'Capsule' : typeRaw === 'gene' ? 'Gene' : typeRaw === 'event' ? 'EvolutionEvent' : '';
36
- if (!type) throw new Error('Invalid --type. Use capsule, gene, or event.');
37
-
38
- var external = assetStore.readRecentExternalCandidates(limit);
39
- var candidate = null;
40
- for (var i = 0; i < external.length; i++) {
41
- if (external[i] && external[i].type === type && String(external[i].id) === id) { candidate = external[i]; break; }
42
- }
43
- if (!candidate) throw new Error('Candidate not found in external zone: type=' + type + ' id=' + id);
44
-
45
- if (type === 'Gene') {
46
- var validation = Array.isArray(candidate.validation) ? candidate.validation : [];
47
- for (var j = 0; j < validation.length; j++) {
48
- var c = String(validation[j] || '').trim();
49
- if (!c) continue;
50
- if (!solidifyMod.isValidationCommandAllowed(c)) {
51
- throw new Error('Refusing to promote Gene ' + id + ': validation command rejected by safety check: "' + c + '". Only node/npm/npx commands without shell operators are allowed.');
52
- }
53
- }
54
- }
55
-
56
- var promoted = JSON.parse(JSON.stringify(candidate));
57
- if (!promoted.a2a || typeof promoted.a2a !== 'object') promoted.a2a = {};
58
- promoted.a2a.status = 'promoted';
59
- promoted.a2a.promoted_at = new Date().toISOString();
60
- if (!promoted.schema_version) promoted.schema_version = contentHash.SCHEMA_VERSION;
61
- promoted.asset_id = contentHash.computeAssetId(promoted);
62
-
63
- var emitDecisions = process.env.A2A_EMIT_DECISIONS === 'true';
64
-
65
- if (type === 'EvolutionEvent') {
66
- assetStore.appendEventJsonl(promoted);
67
- if (emitDecisions) {
68
- try {
69
- var dmEv = a2aProto.buildDecision({ assetId: promoted.asset_id, localId: id, decision: 'accept', reason: 'event promoted for provenance tracking' });
70
- a2aProto.getTransport().send(dmEv);
71
- } catch (e) {}
72
- }
73
- process.stdout.write('promoted_event=' + id + '\n');
74
- return;
75
- }
76
-
77
- if (type === 'Capsule') {
78
- assetStore.appendCapsule(promoted);
79
- if (emitDecisions) {
80
- try {
81
- var dm = a2aProto.buildDecision({ assetId: promoted.asset_id, localId: id, decision: 'accept', reason: 'capsule promoted after validation' });
82
- a2aProto.getTransport().send(dm);
83
- } catch (e) {}
84
- }
85
- process.stdout.write('promoted_capsule=' + id + '\n');
86
- return;
87
- }
88
-
89
- var localGenes = assetStore.loadGenes();
90
- var exists = false;
91
- for (var k = 0; k < localGenes.length; k++) {
92
- if (localGenes[k] && localGenes[k].type === 'Gene' && String(localGenes[k].id) === id) { exists = true; break; }
93
- }
94
- if (exists) {
95
- if (emitDecisions) {
96
- try {
97
- var dm2 = a2aProto.buildDecision({ assetId: promoted.asset_id, localId: id, decision: 'reject', reason: 'local gene with same ID already exists' });
98
- a2aProto.getTransport().send(dm2);
99
- } catch (e) {}
100
- }
101
- process.stdout.write('conflict_keep_local_gene=' + id + '\n');
102
- return;
103
- }
104
-
105
- assetStore.upsertGene(promoted);
106
- if (emitDecisions) {
107
- try {
108
- var dm3 = a2aProto.buildDecision({ assetId: promoted.asset_id, localId: id, decision: 'accept', reason: 'gene promoted after safety audit' });
109
- a2aProto.getTransport().send(dm3);
110
- } catch (e) {}
111
- }
112
- process.stdout.write('promoted_gene=' + id + '\n');
113
- }
114
-
115
- try { main(); } catch (e) {
116
- process.stderr.write((e && e.message ? e.message : String(e)) + '\n');
117
- process.exit(1);
118
- }
@@ -1,121 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const REPO_ROOT = path.resolve(__dirname, '..');
5
- const LOG_FILE = path.join(REPO_ROOT, 'evolution_history_full.md');
6
- const OUT_FILE = path.join(REPO_ROOT, 'evolution_detailed_report.md');
7
-
8
- function analyzeEvolution() {
9
- if (!fs.existsSync(LOG_FILE)) {
10
- console.error("Source file missing.");
11
- return;
12
- }
13
-
14
- const content = fs.readFileSync(LOG_FILE, 'utf8');
15
- // Split by divider
16
- const entries = content.split('---').map(e => e.trim()).filter(e => e.length > 0);
17
-
18
- const skillUpdates = {}; // Map<SkillName, Array<Changes>>
19
- const generalUpdates = []; // Array<Changes>
20
-
21
- // Regex to detect skills/paths
22
- // e.g. `skills/feishu-card/send.js` or **Target**: `skills/git-sync`
23
- const skillRegex = /skills\/([a-zA-Z0-9\-_]+)/;
24
- const actionRegex = /Action:\s*([\s\S]*?)(?=\n\n|\n[A-Z]|$)/i; // Capture Action text
25
- const statusRegex = /Status:\s*\[?([A-Z\s_]+)\]?/i;
26
-
27
- entries.forEach(entry => {
28
- // Extract basic info
29
- const statusMatch = entry.match(statusRegex);
30
- const status = statusMatch ? statusMatch[1].trim().toUpperCase() : 'UNKNOWN';
31
-
32
- // Skip routine checks if we want a *detailed evolution* report (focus on changes)
33
- // But user asked for "what happened", so routine scans might be boring unless they found something.
34
- // Let's filter out "STABILITY" or "RUNNING" unless there is a clear "Mutated" or "Fixed" keyword.
35
- const isInteresting =
36
- entry.includes('Fixed') ||
37
- entry.includes('Hardened') ||
38
- entry.includes('Optimized') ||
39
- entry.includes('Patched') ||
40
- entry.includes('Created') ||
41
- entry.includes('Added') ||
42
- status === 'SUCCESS' ||
43
- status === 'COMPLETED';
44
-
45
- if (!isInteresting) return;
46
-
47
- // Find associated skill
48
- const skillMatch = entry.match(skillRegex);
49
- let skillName = 'General / System';
50
- if (skillMatch) {
51
- skillName = skillMatch[1];
52
- } else {
53
- // Try heuristics
54
- if (entry.toLowerCase().includes('feishu card')) skillName = 'feishu-card';
55
- else if (entry.toLowerCase().includes('git sync')) skillName = 'git-sync';
56
- else if (entry.toLowerCase().includes('logger')) skillName = 'interaction-logger';
57
- else if (entry.toLowerCase().includes('evolve')) skillName = 'capability-evolver';
58
- }
59
-
60
- // Extract description
61
- let description = "";
62
- const actionMatch = entry.match(actionRegex);
63
- if (actionMatch) {
64
- description = actionMatch[1].trim();
65
- } else {
66
- // Fallback: take lines that look like bullet points or text after header
67
- const lines = entry.split('\n');
68
- description = lines.filter(l => l.match(/^[•\-\*]|\w/)).slice(1).join('\n').trim();
69
- }
70
-
71
- // Clean up description (remove duplicate "Action:" prefix if captured)
72
- description = description.replace(/^Action:\s*/i, '');
73
-
74
- if (!skillUpdates[skillName]) skillUpdates[skillName] = [];
75
-
76
- // Dedup descriptions slightly (simple check)
77
- const isDuplicate = skillUpdates[skillName].some(u => u.desc.includes(description.substring(0, 20)));
78
- if (!isDuplicate) {
79
- // Extract Date if possible
80
- const dateMatch = entry.match(/\((\d{4}\/\d{1,2}\/\d{1,2}.*?)\)/);
81
- const date = dateMatch ? dateMatch[1] : 'Unknown';
82
-
83
- skillUpdates[skillName].push({
84
- date,
85
- status,
86
- desc: description
87
- });
88
- }
89
- });
90
-
91
- // Generate Markdown
92
- let md = "# Detailed Evolution Report (By Skill)\n\n> Comprehensive breakdown of system changes.\n\n";
93
-
94
- // Sort skills alphabetically
95
- const sortedSkills = Object.keys(skillUpdates).sort();
96
-
97
- sortedSkills.forEach(skill => {
98
- md += `## ${skill}\n`;
99
- const updates = skillUpdates[skill];
100
-
101
- updates.forEach(u => {
102
- // Icon based on content
103
- let icon = '*';
104
- const lowerDesc = u.desc.toLowerCase();
105
- if (lowerDesc.includes('optimiz')) icon = '[optimize]';
106
- if (lowerDesc.includes('secur') || lowerDesc.includes('harden') || lowerDesc.includes('permission')) icon = '[security]';
107
- if (lowerDesc.includes('fix') || lowerDesc.includes('patch')) icon = '[repair]';
108
- if (lowerDesc.includes('creat') || lowerDesc.includes('add')) icon = '[add]';
109
-
110
- md += `### ${icon} ${u.date}\n`;
111
- md += `${u.desc}\n\n`;
112
- });
113
- md += `---\n`;
114
- });
115
-
116
- fs.writeFileSync(OUT_FILE, md);
117
- console.log(`Generated report for ${sortedSkills.length} skills.`);
118
- }
119
-
120
- analyzeEvolution();
121
-