@evomap/evolver 1.86.0 → 1.87.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/assets/gep/genes.seed.json +44 -2
- package/package.json +3 -2
- package/src/adapters/scripts/_memoryFiltering.js +35 -0
- package/src/adapters/scripts/evolver-session-start.js +8 -5
- package/src/adapters/scripts/evolver-signal-detect.js +24 -1
- package/src/evolve/guards.js +1 -1
- package/src/evolve/pipeline/collect.js +1 -1
- package/src/evolve/pipeline/dispatch.js +1 -1
- package/src/evolve/pipeline/enrich.js +1 -1
- package/src/evolve/pipeline/hub.js +1 -1
- package/src/evolve/pipeline/select.js +1 -1
- package/src/evolve/pipeline/signals.js +1 -1
- package/src/evolve/utils.js +1 -1
- package/src/evolve.js +1 -1
- package/src/gep/a2aProtocol.js +1 -1
- package/src/gep/assetStore.js +1 -0
- package/src/gep/candidateEval.js +1 -1
- package/src/gep/candidates.js +1 -1
- package/src/gep/contentHash.js +1 -1
- package/src/gep/crypto.js +1 -1
- package/src/gep/curriculum.js +1 -1
- package/src/gep/deviceId.js +1 -1
- package/src/gep/envFingerprint.js +1 -1
- package/src/gep/epigenetics.js +1 -1
- package/src/gep/explore.js +1 -1
- package/src/gep/hash.js +1 -1
- package/src/gep/hubFetch.js +1 -1
- package/src/gep/hubReview.js +1 -1
- package/src/gep/hubSearch.js +1 -1
- package/src/gep/hubVerify.js +1 -1
- package/src/gep/learningSignals.js +1 -1
- package/src/gep/memoryGraph.js +1 -1
- package/src/gep/memoryGraphAdapter.js +1 -1
- package/src/gep/mutation.js +1 -1
- package/src/gep/narrativeMemory.js +1 -1
- package/src/gep/openPRRegistry.js +1 -1
- package/src/gep/paths.js +7 -1
- package/src/gep/personality.js +1 -1
- package/src/gep/policyCheck.js +1 -1
- package/src/gep/prompt.js +1 -1
- package/src/gep/recallVerifier.js +1 -1
- package/src/gep/reflection.js +1 -1
- package/src/gep/schemas/capsule.js +51 -1
- package/src/gep/selector.js +1 -1
- package/src/gep/skillDistiller.js +1 -1
- package/src/gep/solidify.js +1 -1
- package/src/gep/strategy.js +1 -1
- package/src/gep/workspaceKeychain.js +1 -1
- package/src/proxy/index.js +226 -1
- package/src/proxy/router/messages_route.js +87 -9
- package/src/proxy/server/http.js +50 -13
|
@@ -143,7 +143,11 @@
|
|
|
143
143
|
"validation": [
|
|
144
144
|
"node scripts/validate-modules.js ./src/gep/signals ./src/evolve",
|
|
145
145
|
"node scripts/validate-suite.js"
|
|
146
|
-
]
|
|
146
|
+
],
|
|
147
|
+
"routing_hint": {
|
|
148
|
+
"tier": "mid",
|
|
149
|
+
"reasoning_level": "medium"
|
|
150
|
+
}
|
|
147
151
|
},
|
|
148
152
|
{
|
|
149
153
|
"type": "Gene",
|
|
@@ -178,6 +182,10 @@
|
|
|
178
182
|
"validation": [
|
|
179
183
|
"node --version"
|
|
180
184
|
],
|
|
185
|
+
"routing_hint": {
|
|
186
|
+
"tier": "cheap",
|
|
187
|
+
"reasoning_level": "low"
|
|
188
|
+
},
|
|
181
189
|
"schema_version": "1.6.0",
|
|
182
190
|
"_source": {
|
|
183
191
|
"kind": "skill2gep",
|
|
@@ -197,7 +205,41 @@
|
|
|
197
205
|
"preconditions_extracted": 0
|
|
198
206
|
}
|
|
199
207
|
},
|
|
200
|
-
"asset_id": "sha256:
|
|
208
|
+
"asset_id": "sha256:1501bc37fbefb18630c4dc8a95d8cdc1ed32bec4a465dc3223280ae907e07297"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "Gene",
|
|
212
|
+
"id": "gene_tool_integrity",
|
|
213
|
+
"category": "repair",
|
|
214
|
+
"signals_match": [
|
|
215
|
+
"tool_bypass|工具绕过|ツール迂回|도구우회"
|
|
216
|
+
],
|
|
217
|
+
"preconditions": [
|
|
218
|
+
"agent used shell/exec to perform an action that a registered tool can handle"
|
|
219
|
+
],
|
|
220
|
+
"strategy": [
|
|
221
|
+
"Always prefer registered tools over ad-hoc scripts or shell workarounds",
|
|
222
|
+
"If a registered tool fails, report the actual error honestly and attempt to fix the root cause",
|
|
223
|
+
"Never fabricate explanations -- describe actual actions transparently",
|
|
224
|
+
"Do not create temporary scripts in extension or project directories"
|
|
225
|
+
],
|
|
226
|
+
"constraints": {
|
|
227
|
+
"max_files": 4,
|
|
228
|
+
"forbidden_paths": [
|
|
229
|
+
".git",
|
|
230
|
+
"node_modules"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"validation": [
|
|
234
|
+
"node scripts/validate-suite.js"
|
|
235
|
+
],
|
|
236
|
+
"anti_patterns": [
|
|
237
|
+
"tool_bypass"
|
|
238
|
+
],
|
|
239
|
+
"routing_hint": {
|
|
240
|
+
"tier": "cheap",
|
|
241
|
+
"reasoning_level": "low"
|
|
242
|
+
}
|
|
201
243
|
}
|
|
202
244
|
]
|
|
203
245
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evomap/evolver",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.87.0",
|
|
4
4
|
"description": "A GEP-powered self-evolution engine for AI agents. Features automated log analysis and Genome Evolution Protocol (GEP) for auditable, reusable evolution assets.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"node": ">=22.12"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@
|
|
39
|
+
"@aws-sdk/client-bedrock-runtime": "^3.1053.0",
|
|
40
|
+
"@evomap/gep-sdk": "^1.5.0",
|
|
40
41
|
"dotenv": "^16.4.7",
|
|
41
42
|
"undici": "^7.0.0"
|
|
42
43
|
},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// _memoryFiltering.js
|
|
2
|
+
// Shared memory filtering logic for evolver hooks (platform-independent).
|
|
3
|
+
//
|
|
4
|
+
// Responsibility: Filter evolution memory outcomes to reduce noise in Claude/Codex context.
|
|
5
|
+
// - Removes failed outcomes (no learning value)
|
|
6
|
+
// - Filters low-confidence outcomes (score < 0.5)
|
|
7
|
+
// - Enforces time bounds (< 7 days old)
|
|
8
|
+
// - Limits result size (max 3 outcomes)
|
|
9
|
+
|
|
10
|
+
const DEFAULT_MIN_SCORE = 0.5;
|
|
11
|
+
const DEFAULT_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000; // 7 days
|
|
12
|
+
const DEFAULT_MAX_OUTCOMES = 3;
|
|
13
|
+
|
|
14
|
+
function filterRelevantOutcomes(entries, opts = {}) {
|
|
15
|
+
const minScore = opts.minScore !== undefined ? opts.minScore : DEFAULT_MIN_SCORE;
|
|
16
|
+
const maxAgeMs = opts.maxAgeMs !== undefined ? opts.maxAgeMs : DEFAULT_MAX_AGE_MS;
|
|
17
|
+
const maxOutcomes = opts.maxOutcomes !== undefined ? opts.maxOutcomes : DEFAULT_MAX_OUTCOMES;
|
|
18
|
+
|
|
19
|
+
const now = Date.now();
|
|
20
|
+
|
|
21
|
+
return entries
|
|
22
|
+
.filter(e => {
|
|
23
|
+
// Only keep 'success' outcomes (failed ones don't provide learning value)
|
|
24
|
+
if (e.outcome?.status !== 'success') return false;
|
|
25
|
+
// Only keep high-confidence outcomes
|
|
26
|
+
if ((e.outcome?.score ?? 0) < minScore) return false;
|
|
27
|
+
// Only keep recent outcomes
|
|
28
|
+
const ts = e.timestamp ? new Date(e.timestamp).getTime() : 0;
|
|
29
|
+
if (now - ts > maxAgeMs) return false;
|
|
30
|
+
return true;
|
|
31
|
+
})
|
|
32
|
+
.slice(-maxOutcomes);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = { filterRelevantOutcomes, DEFAULT_MIN_SCORE, DEFAULT_MAX_AGE_MS, DEFAULT_MAX_OUTCOMES };
|
|
@@ -8,6 +8,7 @@ const path = require('path');
|
|
|
8
8
|
const os = require('os');
|
|
9
9
|
|
|
10
10
|
const { findEvolverRoot, findMemoryGraph } = require('./_runtimePaths');
|
|
11
|
+
const { filterRelevantOutcomes } = require('./_memoryFiltering');
|
|
11
12
|
|
|
12
13
|
function readLastN(filePath, n) {
|
|
13
14
|
try {
|
|
@@ -100,17 +101,19 @@ function main() {
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
const entries = readLastN(graphPath, 5);
|
|
103
|
-
|
|
104
|
+
const filtered = filterRelevantOutcomes(entries);
|
|
105
|
+
|
|
106
|
+
if (filtered.length === 0) {
|
|
104
107
|
process.stdout.write(JSON.stringify({}));
|
|
105
108
|
return;
|
|
106
109
|
}
|
|
107
110
|
|
|
108
|
-
const successCount =
|
|
109
|
-
const failCount =
|
|
111
|
+
const successCount = filtered.filter(e => e.outcome && e.outcome.status === 'success').length;
|
|
112
|
+
const failCount = filtered.filter(e => e.outcome && e.outcome.status === 'failed').length;
|
|
110
113
|
|
|
111
|
-
const lines =
|
|
114
|
+
const lines = filtered.map(formatOutcome);
|
|
112
115
|
const summary = [
|
|
113
|
-
`[Evolution Memory] Recent ${
|
|
116
|
+
`[Evolution Memory] Recent ${filtered.length} outcomes (${successCount} success, ${failCount} failed):`,
|
|
114
117
|
...lines,
|
|
115
118
|
'',
|
|
116
119
|
'Use successful approaches. Avoid repeating failed patterns.',
|
|
@@ -13,9 +13,32 @@ const SIGNAL_KEYWORDS = {
|
|
|
13
13
|
test_failure: ['test failed', 'test failure', 'assertion', 'expect(', 'assert.'],
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
function stratifyContent(text) {
|
|
17
|
+
// Separate code/comments/documents to avoid false positives
|
|
18
|
+
const lines = text.split('\n');
|
|
19
|
+
const documentText = [];
|
|
20
|
+
|
|
21
|
+
for (const line of lines) {
|
|
22
|
+
const trimmed = line.trim();
|
|
23
|
+
// Skip lines that are comments or code structure (not document text)
|
|
24
|
+
if (trimmed.startsWith('//') || trimmed.startsWith('#') || trimmed.startsWith('*') ||
|
|
25
|
+
trimmed.startsWith('{') || trimmed.startsWith('[') || trimmed.startsWith('}') ||
|
|
26
|
+
trimmed.startsWith(']') || trimmed.startsWith('/*')) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
documentText.push(line);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return documentText.join('\n');
|
|
33
|
+
}
|
|
34
|
+
|
|
16
35
|
function detectSignals(text) {
|
|
17
36
|
if (!text || typeof text !== 'string') return [];
|
|
18
|
-
|
|
37
|
+
|
|
38
|
+
// Apply stratification to reduce false positives from code/comments
|
|
39
|
+
const stratified = stratifyContent(text);
|
|
40
|
+
const lower = stratified.toLowerCase();
|
|
41
|
+
|
|
19
42
|
const found = [];
|
|
20
43
|
for (const [signal, keywords] of Object.entries(SIGNAL_KEYWORDS)) {
|
|
21
44
|
for (const kw of keywords) {
|