@evomap/evolver 1.89.0 → 1.89.2
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/CONTRIBUTING.md +19 -0
- package/README.ja-JP.md +9 -32
- package/README.ko-KR.md +9 -32
- package/README.md +530 -86
- package/README.zh-CN.md +4 -31
- package/SKILL.md +1 -1
- package/assets/cover.png +0 -0
- package/index.js +14 -1
- package/package.json +17 -6
- package/scripts/a2a_export.js +63 -0
- package/scripts/a2a_ingest.js +79 -0
- package/scripts/a2a_promote.js +118 -0
- package/scripts/analyze_by_skill.js +121 -0
- package/scripts/build_binaries.js +479 -0
- package/scripts/check-changelog.js +166 -0
- package/scripts/extract_log.js +85 -0
- package/scripts/generate_history.js +75 -0
- package/scripts/gep_append_event.js +96 -0
- package/scripts/gep_personality_report.js +234 -0
- package/scripts/human_report.js +147 -0
- package/scripts/recall-verify-report.js +234 -0
- package/scripts/recover_loop.js +61 -0
- package/scripts/seed-merchants.js +91 -0
- package/scripts/suggest_version.js +89 -0
- package/scripts/validate-modules.js +38 -0
- package/scripts/validate-suite.js +78 -0
- package/skills/index.json +14 -0
- package/src/evolve/guards.js +1 -721
- package/src/evolve/pipeline/collect.js +1 -1283
- package/src/evolve/pipeline/dispatch.js +1 -421
- package/src/evolve/pipeline/enrich.js +1 -434
- package/src/evolve/pipeline/hub.js +1 -319
- package/src/evolve/pipeline/select.js +1 -274
- package/src/evolve/pipeline/signals.js +1 -206
- package/src/evolve/utils.js +1 -264
- package/src/evolve.js +1 -350
- package/src/forceUpdate.js +105 -20
- package/src/gep/a2aProtocol.js +1 -4395
- package/src/gep/autoDistillConv.js +1 -205
- package/src/gep/autoDistillLlm.js +1 -315
- package/src/gep/candidateEval.js +1 -92
- package/src/gep/candidates.js +1 -198
- package/src/gep/contentHash.js +1 -30
- package/src/gep/conversationSniffer.js +1 -266
- package/src/gep/crypto.js +1 -89
- package/src/gep/curriculum.js +1 -163
- package/src/gep/deviceId.js +1 -218
- package/src/gep/envFingerprint.js +1 -118
- package/src/gep/epigenetics.js +1 -31
- package/src/gep/execBridge.js +1 -711
- package/src/gep/explore.js +1 -289
- package/src/gep/hash.js +1 -15
- package/src/gep/hubFetch.js +1 -359
- package/src/gep/hubReview.js +1 -207
- package/src/gep/hubSearch.js +1 -526
- package/src/gep/hubVerify.js +1 -306
- package/src/gep/learningSignals.js +1 -89
- package/src/gep/memoryGraph.js +1 -1374
- package/src/gep/memoryGraphAdapter.js +1 -203
- package/src/gep/mutation.js +1 -203
- package/src/gep/narrativeMemory.js +1 -108
- package/src/gep/oauthLogin.js +34 -0
- package/src/gep/openPRRegistry.js +1 -205
- package/src/gep/personality.js +1 -423
- package/src/gep/policyCheck.js +1 -599
- package/src/gep/prompt.js +1 -836
- package/src/gep/recallInject.js +1 -409
- package/src/gep/recallVerifier.js +1 -318
- package/src/gep/reflection.js +1 -177
- package/src/gep/selector.js +1 -602
- package/src/gep/skillDistiller.js +1 -1294
- package/src/gep/skillPublisher.js +1 -1
- package/src/gep/solidify.js +1 -1699
- package/src/gep/strategy.js +1 -136
- package/src/gep/tokenSavings.js +1 -88
- package/src/gep/workspaceKeychain.js +1 -174
- package/src/proxy/extensions/traceControl.js +1 -99
- package/src/proxy/inject.js +1 -52
- package/src/proxy/lifecycle/manager.js +2 -0
- package/src/proxy/trace/extractor.js +1 -534
- package/src/proxy/trace/usage.js +1 -105
- package/.cursor/BUGBOT.md +0 -182
- package/.env.example +0 -68
- package/.git-commit-guard-token +0 -1
- package/.github/CODEOWNERS +0 -63
- package/.github/ISSUE_TEMPLATE/good_first_issue.md +0 -23
- package/.github/pull_request_template.md +0 -45
- package/.github/workflows/test.yml +0 -75
- package/CHANGELOG.md +0 -1123
- package/README.public.md +0 -594
- package/SECURITY.md +0 -108
- package/assets/gep/events.jsonl +0 -3
- package/examples/atp-consumer-quickstart.md +0 -100
- package/examples/hello-world.md +0 -38
- package/proxy-package.json +0 -39
- package/public.manifest.json +0 -141
- /package/assets/gep/{genes.json → genes.seed.json} +0 -0
- /package/{bundled-skills → skills}/_meta/SKILL.md +0 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// recall-verify-report — aggregate kind=recall_verify events from the
|
|
5
|
+
// memory graph jsonl into a Markdown table. Exit 0 = ship gate green
|
|
6
|
+
// (every asset_type has success_rate >= 0.95 and 0 mismatches), exit 2
|
|
7
|
+
// otherwise. Designed to be scripted into deploy.sh as a pre-publish gate.
|
|
8
|
+
//
|
|
9
|
+
// Usage:
|
|
10
|
+
// node scripts/recall-verify-report.js # all events
|
|
11
|
+
// node scripts/recall-verify-report.js --since 1h # last hour
|
|
12
|
+
// node scripts/recall-verify-report.js --since 30m
|
|
13
|
+
// node scripts/recall-verify-report.js --since 2026-05-16T10:00:00Z
|
|
14
|
+
// node scripts/recall-verify-report.js --json # raw JSON for piping
|
|
15
|
+
|
|
16
|
+
const { tryReadMemoryGraphEvents } = require('../src/gep/memoryGraph');
|
|
17
|
+
|
|
18
|
+
const SUCCESS_THRESHOLD = 0.95;
|
|
19
|
+
|
|
20
|
+
function parseSince(value) {
|
|
21
|
+
if (!value) return null;
|
|
22
|
+
// Try relative duration first (1h / 30m / 2d / 45s) — unambiguous.
|
|
23
|
+
const m = String(value).match(/^(\d+)\s*(s|m|h|d)$/i);
|
|
24
|
+
if (m) {
|
|
25
|
+
const n = Number(m[1]);
|
|
26
|
+
const unit = m[2].toLowerCase();
|
|
27
|
+
const factor = unit === 's' ? 1000 : unit === 'm' ? 60000 : unit === 'h' ? 3600000 : 86400000;
|
|
28
|
+
return Date.now() - (n * factor);
|
|
29
|
+
}
|
|
30
|
+
// Then ISO-8601. Require '-' or 'T' so we don't accept loose numeric
|
|
31
|
+
// strings like "5" → year 2001.
|
|
32
|
+
if (/[-T]/.test(String(value))) {
|
|
33
|
+
const iso = Date.parse(value);
|
|
34
|
+
if (!Number.isNaN(iso)) return iso;
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function parseArgs(argv) {
|
|
40
|
+
const args = { since: null, json: false };
|
|
41
|
+
for (let i = 2; i < argv.length; i++) {
|
|
42
|
+
const a = argv[i];
|
|
43
|
+
if (a === '--json') args.json = true;
|
|
44
|
+
else if (a === '--since') {
|
|
45
|
+
args.since = argv[++i];
|
|
46
|
+
} else if (a.startsWith('--since=')) {
|
|
47
|
+
args.since = a.slice('--since='.length);
|
|
48
|
+
} else if (a === '--help' || a === '-h') {
|
|
49
|
+
args.help = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return args;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function percentile(sorted, p) {
|
|
56
|
+
if (!sorted.length) return 0;
|
|
57
|
+
const idx = Math.min(sorted.length - 1, Math.floor(sorted.length * p));
|
|
58
|
+
return sorted[idx];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function aggregate(events) {
|
|
62
|
+
const byType = new Map();
|
|
63
|
+
for (const ev of events) {
|
|
64
|
+
if (!ev || ev.kind !== 'recall_verify') continue;
|
|
65
|
+
const type = (ev.asset && ev.asset.type) || 'Unknown';
|
|
66
|
+
if (!byType.has(type)) {
|
|
67
|
+
byType.set(type, {
|
|
68
|
+
type,
|
|
69
|
+
total: 0,
|
|
70
|
+
ok: 0,
|
|
71
|
+
missing: 0,
|
|
72
|
+
mismatch: 0,
|
|
73
|
+
skipped: 0,
|
|
74
|
+
latencies: [],
|
|
75
|
+
ages: [],
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const bucket = byType.get(type);
|
|
79
|
+
bucket.total += 1;
|
|
80
|
+
const v = ev.verification || {};
|
|
81
|
+
if (v.outcome === 'roundtrip_ok') bucket.ok += 1;
|
|
82
|
+
else if (v.outcome === 'roundtrip_missing') bucket.missing += 1;
|
|
83
|
+
else if (v.outcome === 'roundtrip_mismatch') bucket.mismatch += 1;
|
|
84
|
+
else bucket.skipped += 1;
|
|
85
|
+
if (Number.isFinite(v.latency_ms)) bucket.latencies.push(v.latency_ms);
|
|
86
|
+
if (Number.isFinite(v.age_at_verify_ms)) bucket.ages.push(v.age_at_verify_ms);
|
|
87
|
+
}
|
|
88
|
+
const rows = [];
|
|
89
|
+
for (const bucket of byType.values()) {
|
|
90
|
+
const denom = bucket.ok + bucket.missing + bucket.mismatch;
|
|
91
|
+
bucket.success_rate = denom > 0 ? bucket.ok / denom : 0;
|
|
92
|
+
bucket.latencies.sort(function (a, b) { return a - b; });
|
|
93
|
+
bucket.ages.sort(function (a, b) { return a - b; });
|
|
94
|
+
bucket.p50_latency_ms = percentile(bucket.latencies, 0.5);
|
|
95
|
+
bucket.p95_latency_ms = percentile(bucket.latencies, 0.95);
|
|
96
|
+
bucket.p99_latency_ms = percentile(bucket.latencies, 0.99);
|
|
97
|
+
bucket.p50_age_ms = percentile(bucket.ages, 0.5);
|
|
98
|
+
bucket.p95_age_ms = percentile(bucket.ages, 0.95);
|
|
99
|
+
bucket.p99_age_ms = percentile(bucket.ages, 0.99);
|
|
100
|
+
delete bucket.latencies;
|
|
101
|
+
delete bucket.ages;
|
|
102
|
+
rows.push(bucket);
|
|
103
|
+
}
|
|
104
|
+
rows.sort(function (a, b) { return a.type.localeCompare(b.type); });
|
|
105
|
+
|
|
106
|
+
const totals = { type: 'TOTAL', total: 0, ok: 0, missing: 0, mismatch: 0, skipped: 0 };
|
|
107
|
+
for (const r of rows) {
|
|
108
|
+
totals.total += r.total;
|
|
109
|
+
totals.ok += r.ok;
|
|
110
|
+
totals.missing += r.missing;
|
|
111
|
+
totals.mismatch += r.mismatch;
|
|
112
|
+
totals.skipped += r.skipped;
|
|
113
|
+
}
|
|
114
|
+
const totalsDenom = totals.ok + totals.missing + totals.mismatch;
|
|
115
|
+
totals.success_rate = totalsDenom > 0 ? totals.ok / totalsDenom : 0;
|
|
116
|
+
|
|
117
|
+
// Gate severity is monotonic: once a row triggers a worse state, later
|
|
118
|
+
// rows cannot downgrade it. Without this, AntiPattern@0% (RED) followed
|
|
119
|
+
// by Capsule@90% (YELLOW) would report YELLOW — misleading dashboards
|
|
120
|
+
// even though the exit code still reflects RED. (Bugbot review on PR #53.)
|
|
121
|
+
// RANK is the comparison ordinal: GREEN(0) < YELLOW(1) < RED(2).
|
|
122
|
+
const RANK = { GREEN: 0, YELLOW: 1, RED: 2 };
|
|
123
|
+
function escalate(current, candidate) {
|
|
124
|
+
return RANK[candidate] > RANK[current] ? candidate : current;
|
|
125
|
+
}
|
|
126
|
+
let gate = 'GREEN';
|
|
127
|
+
if (rows.length === 0) gate = 'RED';
|
|
128
|
+
else {
|
|
129
|
+
for (const r of rows) {
|
|
130
|
+
if (r.mismatch > 0) { gate = 'RED'; break; }
|
|
131
|
+
if (r.success_rate < SUCCESS_THRESHOLD) {
|
|
132
|
+
gate = escalate(gate, r.success_rate >= 0.85 ? 'YELLOW' : 'RED');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return { rows, totals, gate };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function fmtPct(rate) {
|
|
140
|
+
return (rate * 100).toFixed(1) + '%';
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function fmtMs(n) {
|
|
144
|
+
if (!Number.isFinite(n) || n === 0) return '—';
|
|
145
|
+
if (n < 1000) return Math.round(n) + 'ms';
|
|
146
|
+
return (n / 1000).toFixed(1) + 's';
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function printMarkdown(result, since) {
|
|
150
|
+
const sinceStr = since ? new Date(since).toISOString() : 'all time';
|
|
151
|
+
console.log('# RecallVerify Report (since ' + sinceStr + ')');
|
|
152
|
+
console.log('');
|
|
153
|
+
if (result.rows.length === 0) {
|
|
154
|
+
console.log('_No `recall_verify` events found in memory graph._');
|
|
155
|
+
console.log('');
|
|
156
|
+
console.log('Ship gate: **RED** (no data — feature may be disabled or daemon has not run a publish cycle yet)');
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
console.log('| asset_type | total | ok | missing | mismatch | skipped | success_rate | p50_latency | p99_latency | p50_age | p99_age |');
|
|
160
|
+
console.log('|--------------|------:|----:|--------:|---------:|--------:|-------------:|------------:|------------:|--------:|--------:|');
|
|
161
|
+
for (const r of result.rows) {
|
|
162
|
+
console.log('| ' + r.type.padEnd(12) +
|
|
163
|
+
' | ' + String(r.total).padStart(5) +
|
|
164
|
+
' | ' + String(r.ok).padStart(3) +
|
|
165
|
+
' | ' + String(r.missing).padStart(7) +
|
|
166
|
+
' | ' + String(r.mismatch).padStart(8) +
|
|
167
|
+
' | ' + String(r.skipped).padStart(7) +
|
|
168
|
+
' | ' + fmtPct(r.success_rate).padStart(12) +
|
|
169
|
+
' | ' + fmtMs(r.p50_latency_ms).padStart(11) +
|
|
170
|
+
' | ' + fmtMs(r.p99_latency_ms).padStart(11) +
|
|
171
|
+
' | ' + fmtMs(r.p50_age_ms).padStart(7) +
|
|
172
|
+
' | ' + fmtMs(r.p99_age_ms).padStart(7) +
|
|
173
|
+
' |');
|
|
174
|
+
}
|
|
175
|
+
const t = result.totals;
|
|
176
|
+
console.log('| ' + 'TOTAL'.padEnd(12) +
|
|
177
|
+
' | ' + String(t.total).padStart(5) +
|
|
178
|
+
' | ' + String(t.ok).padStart(3) +
|
|
179
|
+
' | ' + String(t.missing).padStart(7) +
|
|
180
|
+
' | ' + String(t.mismatch).padStart(8) +
|
|
181
|
+
' | ' + String(t.skipped).padStart(7) +
|
|
182
|
+
' | ' + fmtPct(t.success_rate).padStart(12) +
|
|
183
|
+
' | ' + '—'.padStart(11) +
|
|
184
|
+
' | ' + '—'.padStart(11) +
|
|
185
|
+
' | ' + '—'.padStart(7) +
|
|
186
|
+
' | ' + '—'.padStart(7) +
|
|
187
|
+
' |');
|
|
188
|
+
console.log('');
|
|
189
|
+
console.log('Ship gate: **' + result.gate + '**' + (result.gate === 'GREEN' ? ' (exit 0)' : ' (exit 2)'));
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function main() {
|
|
193
|
+
const args = parseArgs(process.argv);
|
|
194
|
+
if (args.help) {
|
|
195
|
+
console.log('Usage: node scripts/recall-verify-report.js [--since <Nh|Nm|Nd|ISO>] [--json]');
|
|
196
|
+
process.exit(0);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let sinceMs = null;
|
|
200
|
+
if (args.since) {
|
|
201
|
+
const parsed = parseSince(args.since);
|
|
202
|
+
if (parsed === undefined) {
|
|
203
|
+
console.error('Error: --since must be ISO-8601 or a duration like 1h / 30m / 2d (got: ' + args.since + ')');
|
|
204
|
+
process.exit(1);
|
|
205
|
+
}
|
|
206
|
+
sinceMs = parsed;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const allEvents = tryReadMemoryGraphEvents(20000);
|
|
210
|
+
const filtered = allEvents.filter(function (ev) {
|
|
211
|
+
if (!ev || ev.kind !== 'recall_verify') return false;
|
|
212
|
+
if (sinceMs != null && Number.isFinite(ev.ts) && ev.ts < sinceMs) return false;
|
|
213
|
+
return true;
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
const result = aggregate(filtered);
|
|
217
|
+
|
|
218
|
+
if (args.json) {
|
|
219
|
+
console.log(JSON.stringify({
|
|
220
|
+
since: sinceMs ? new Date(sinceMs).toISOString() : null,
|
|
221
|
+
...result,
|
|
222
|
+
}, null, 2));
|
|
223
|
+
} else {
|
|
224
|
+
printMarkdown(result, sinceMs);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
process.exit(result.gate === 'GREEN' ? 0 : 2);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (require.main === module) {
|
|
231
|
+
main();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
module.exports = { aggregate, parseSince, parseArgs };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
function exists(p) {
|
|
8
|
+
try {
|
|
9
|
+
return fs.existsSync(p);
|
|
10
|
+
} catch (e) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function sleepMs(ms) {
|
|
16
|
+
const n = Number(ms);
|
|
17
|
+
const t = Number.isFinite(n) ? Math.max(0, n) : 0;
|
|
18
|
+
if (t <= 0) return;
|
|
19
|
+
spawnSync('sleep', [String(Math.ceil(t / 1000))], { stdio: 'ignore' });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function resolveWorkspaceRoot() {
|
|
23
|
+
// In OpenClaw exec, cwd is usually the workspace root.
|
|
24
|
+
// Keep it simple: do not try to walk up arbitrarily.
|
|
25
|
+
return process.cwd();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function resolveEvolverEntry(workspaceRoot) {
|
|
29
|
+
const candidates = [
|
|
30
|
+
path.join(workspaceRoot, 'skills', 'evolver', 'index.js'),
|
|
31
|
+
path.join(workspaceRoot, 'skills', 'capability-evolver', 'index.js'),
|
|
32
|
+
];
|
|
33
|
+
for (const p of candidates) {
|
|
34
|
+
if (exists(p)) return p;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function main() {
|
|
40
|
+
const waitMs = parseInt(String(process.env.EVOLVER_RECOVER_WAIT_MS || '10000'), 10);
|
|
41
|
+
const wait = Number.isFinite(waitMs) ? Math.max(0, waitMs) : 10000;
|
|
42
|
+
|
|
43
|
+
console.log(`[RECOVERY] Waiting ${wait}ms before restart...`);
|
|
44
|
+
sleepMs(wait);
|
|
45
|
+
|
|
46
|
+
const workspaceRoot = resolveWorkspaceRoot();
|
|
47
|
+
const entry = resolveEvolverEntry(workspaceRoot);
|
|
48
|
+
if (!entry) {
|
|
49
|
+
console.error('[RECOVERY] Failed: cannot locate evolver entry under skills/.');
|
|
50
|
+
process.exit(2);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
console.log(`[RECOVERY] Restarting loop via ${path.relative(workspaceRoot, entry)} ...`);
|
|
54
|
+
const r = spawnSync(process.execPath, [entry, '--loop'], { stdio: 'inherit' });
|
|
55
|
+
process.exit(typeof r.status === 'number' ? r.status : 1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (require.main === module) {
|
|
59
|
+
main();
|
|
60
|
+
}
|
|
61
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Seed Merchants -- registers 3 merchant services on the ATP network.
|
|
3
|
+
// Run once to bootstrap the network with available service listings.
|
|
4
|
+
//
|
|
5
|
+
// Usage:
|
|
6
|
+
// A2A_HUB_URL=https://evomap.ai node scripts/seed-merchants.js
|
|
7
|
+
|
|
8
|
+
const { merchantAgent } = require('../src/atp');
|
|
9
|
+
|
|
10
|
+
const SEED_SERVICES = [
|
|
11
|
+
{
|
|
12
|
+
title: 'Code Review Agent',
|
|
13
|
+
description: 'Automated code review for JavaScript, Python, and TypeScript projects. Identifies bugs, style issues, and performance opportunities.',
|
|
14
|
+
capabilities: ['code_review', 'javascript', 'python', 'typescript', 'bug_detection'],
|
|
15
|
+
useCases: ['Pull request review', 'Code quality audit', 'Security scan'],
|
|
16
|
+
pricePerTask: 5,
|
|
17
|
+
maxConcurrent: 5,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
title: 'Translation Agent',
|
|
21
|
+
description: 'Translates text between English, Chinese (Simplified/Traditional), and Japanese with context-aware accuracy.',
|
|
22
|
+
capabilities: ['translation', 'english', 'chinese', 'japanese', 'localization'],
|
|
23
|
+
useCases: ['Document translation', 'UI localization', 'README translation'],
|
|
24
|
+
pricePerTask: 3,
|
|
25
|
+
maxConcurrent: 10,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: 'Text Summarization Agent',
|
|
29
|
+
description: 'Generates concise summaries from long documents, reports, and codebases. Supports structured and freeform output.',
|
|
30
|
+
capabilities: ['summarization', 'text_analysis', 'report', 'digest'],
|
|
31
|
+
useCases: ['Meeting notes summary', 'Codebase overview', 'Research digest'],
|
|
32
|
+
pricePerTask: 2,
|
|
33
|
+
maxConcurrent: 10,
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
function handleOrder(order) {
|
|
38
|
+
const title = (order.title || '').toLowerCase();
|
|
39
|
+
const signals = (order.signals || '').toLowerCase();
|
|
40
|
+
|
|
41
|
+
let result;
|
|
42
|
+
if (title.includes('review') || signals.includes('code_review')) {
|
|
43
|
+
result = 'Code review completed. No critical issues found. 2 suggestions for improvement.';
|
|
44
|
+
} else if (title.includes('translat') || signals.includes('translation')) {
|
|
45
|
+
result = 'Translation completed. Source and target text verified for accuracy.';
|
|
46
|
+
} else {
|
|
47
|
+
result = 'Analysis completed. Summary generated from provided content.';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
result,
|
|
52
|
+
output: result,
|
|
53
|
+
pass_rate: 1.0,
|
|
54
|
+
processed_at: new Date().toISOString(),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function main() {
|
|
59
|
+
const hubUrl = process.env.A2A_HUB_URL || process.env.EVOMAP_HUB_URL;
|
|
60
|
+
if (!hubUrl) {
|
|
61
|
+
console.error('[Seed] A2A_HUB_URL or EVOMAP_HUB_URL is required.');
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
console.log('[Seed] Hub:', hubUrl);
|
|
66
|
+
console.log('[Seed] Starting merchant with', SEED_SERVICES.length, 'services...');
|
|
67
|
+
|
|
68
|
+
await merchantAgent.start({
|
|
69
|
+
services: SEED_SERVICES,
|
|
70
|
+
onOrder: handleOrder,
|
|
71
|
+
pollMs: 30000,
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
console.log('[Seed] Merchant started. Polling for orders. Press Ctrl+C to stop.');
|
|
75
|
+
|
|
76
|
+
process.on('SIGINT', () => {
|
|
77
|
+
console.log('\n[Seed] Shutting down...');
|
|
78
|
+
merchantAgent.stop();
|
|
79
|
+
process.exit(0);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
process.on('SIGTERM', () => {
|
|
83
|
+
merchantAgent.stop();
|
|
84
|
+
process.exit(0);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
main().catch((err) => {
|
|
89
|
+
console.error('[Seed] Fatal:', err.message || err);
|
|
90
|
+
process.exit(1);
|
|
91
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
|
|
5
|
+
const REPO_ROOT = path.resolve(__dirname, '..');
|
|
6
|
+
|
|
7
|
+
function ensureDir(dir) {
|
|
8
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function parseSemver(v) {
|
|
12
|
+
const m = String(v || '').trim().match(/^(\d+)\.(\d+)\.(\d+)$/);
|
|
13
|
+
if (!m) return null;
|
|
14
|
+
return { major: Number(m[1]), minor: Number(m[2]), patch: Number(m[3]) };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function bumpSemver(base, bump) {
|
|
18
|
+
const v = parseSemver(base);
|
|
19
|
+
if (!v) return null;
|
|
20
|
+
if (bump === 'major') return `${v.major + 1}.0.0`;
|
|
21
|
+
if (bump === 'minor') return `${v.major}.${v.minor + 1}.0`;
|
|
22
|
+
if (bump === 'patch') return `${v.major}.${v.minor}.${v.patch + 1}`;
|
|
23
|
+
return `${v.major}.${v.minor}.${v.patch}`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function git(cmd) {
|
|
27
|
+
return execSync(cmd, { cwd: REPO_ROOT, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getBaseReleaseCommit() {
|
|
31
|
+
try {
|
|
32
|
+
const hash = git('git log -n 1 --pretty=%H --grep="chore(release): prepare v"');
|
|
33
|
+
return hash || null;
|
|
34
|
+
} catch (e) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function getCommitSubjectsSince(baseCommit) {
|
|
40
|
+
try {
|
|
41
|
+
if (!baseCommit) {
|
|
42
|
+
const out = git('git log -n 30 --pretty=%s');
|
|
43
|
+
return out ? out.split('\n').filter(Boolean) : [];
|
|
44
|
+
}
|
|
45
|
+
const out = git(`git log ${baseCommit}..HEAD --pretty=%s`);
|
|
46
|
+
return out ? out.split('\n').filter(Boolean) : [];
|
|
47
|
+
} catch (e) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function inferBumpFromSubjects(subjects) {
|
|
53
|
+
const subs = (subjects || []).map(s => String(s));
|
|
54
|
+
const hasBreaking = subs.some(s => /\bBREAKING CHANGE\b/i.test(s) || /^[a-z]+(\(.+\))?!:/.test(s));
|
|
55
|
+
if (hasBreaking) return { bump: 'major', reason: 'breaking change marker in commit subject' };
|
|
56
|
+
|
|
57
|
+
const hasFeat = subs.some(s => /^feat(\(.+\))?:/i.test(s));
|
|
58
|
+
if (hasFeat) return { bump: 'minor', reason: 'feature commit detected (feat:)' };
|
|
59
|
+
|
|
60
|
+
const hasFix = subs.some(s => /^(fix|perf)(\(.+\))?:/i.test(s));
|
|
61
|
+
if (hasFix) return { bump: 'patch', reason: 'fix/perf commit detected' };
|
|
62
|
+
|
|
63
|
+
if (subs.length === 0) return { bump: 'none', reason: 'no commits since base release commit' };
|
|
64
|
+
return { bump: 'patch', reason: 'default to patch for non-breaking changes' };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function main() {
|
|
68
|
+
const pkgPath = path.join(REPO_ROOT, 'package.json');
|
|
69
|
+
const baseVersion = JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version;
|
|
70
|
+
|
|
71
|
+
const baseCommit = getBaseReleaseCommit();
|
|
72
|
+
const subjects = getCommitSubjectsSince(baseCommit);
|
|
73
|
+
const decision = inferBumpFromSubjects(subjects);
|
|
74
|
+
const suggestedVersion = decision.bump === 'none' ? baseVersion : bumpSemver(baseVersion, decision.bump);
|
|
75
|
+
|
|
76
|
+
const out = { baseVersion, baseCommit, subjects, decision, suggestedVersion };
|
|
77
|
+
const memDir = path.join(REPO_ROOT, 'memory');
|
|
78
|
+
ensureDir(memDir);
|
|
79
|
+
fs.writeFileSync(path.join(memDir, 'semver_suggestion.json'), JSON.stringify(out, null, 2) + '\n', 'utf8');
|
|
80
|
+
process.stdout.write(JSON.stringify(out, null, 2) + '\n');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
try {
|
|
84
|
+
main();
|
|
85
|
+
} catch (e) {
|
|
86
|
+
process.stderr.write(`${e.message}\n`);
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Usage: node scripts/validate-modules.js ./src/evolve ./src/gep/solidify
|
|
2
|
+
// Validates that each module (1) loads without errors, (2) exports something
|
|
3
|
+
// meaningful, and (3) exported functions are callable (typeof check).
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const modules = process.argv.slice(2);
|
|
6
|
+
if (!modules.length) { console.error('No modules specified'); process.exit(1); }
|
|
7
|
+
|
|
8
|
+
let checked = 0;
|
|
9
|
+
for (const m of modules) {
|
|
10
|
+
const resolved = path.resolve(m);
|
|
11
|
+
const exported = require(resolved);
|
|
12
|
+
|
|
13
|
+
if (exported === undefined || exported === null) {
|
|
14
|
+
console.error('FAIL: ' + m + ' exports null/undefined');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const t = typeof exported;
|
|
19
|
+
if (t === 'object' && Object.keys(exported).length === 0) {
|
|
20
|
+
console.error('FAIL: ' + m + ' exports an empty object (no public API)');
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (t === 'object') {
|
|
25
|
+
const keys = Object.keys(exported);
|
|
26
|
+
for (const k of keys) {
|
|
27
|
+
if (typeof exported[k] === 'function') {
|
|
28
|
+
if (typeof exported[k] !== 'function') {
|
|
29
|
+
console.error('FAIL: ' + m + '.' + k + ' is declared but not a callable function');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
checked++;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
console.log('ok: ' + checked + ' module(s) validated');
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Usage: node scripts/validate-suite.js [test-glob-pattern | test-file]
|
|
2
|
+
// Runs the evolver test suite -- repo root is derived from script location, no shell glob needed.
|
|
3
|
+
// Accepts either a directory glob pattern (e.g. `test/*.test.js`) or a concrete test file path.
|
|
4
|
+
// See community PR #514.
|
|
5
|
+
const { execFileSync } = require('child_process');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
|
|
9
|
+
const EVOLVER_REPO_ROOT = path.join(__dirname, '..');
|
|
10
|
+
const pattern = process.argv[2] || 'test/*.test.js';
|
|
11
|
+
|
|
12
|
+
function expandTestGlob(repoRoot, pat) {
|
|
13
|
+
const fullPattern = path.isAbsolute(pat) ? pat : path.join(repoRoot, pat);
|
|
14
|
+
if (fs.existsSync(fullPattern) && fs.statSync(fullPattern).isFile()) {
|
|
15
|
+
return fullPattern.endsWith('.test.js') ? [fullPattern] : [];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const dir = path.dirname(pat);
|
|
19
|
+
const basenamePattern = path.basename(pat);
|
|
20
|
+
const fullDir = path.isAbsolute(dir) ? dir : path.join(repoRoot, dir);
|
|
21
|
+
if (!fs.existsSync(fullDir) || !fs.statSync(fullDir).isDirectory()) return [];
|
|
22
|
+
|
|
23
|
+
const escaped = basenamePattern
|
|
24
|
+
.replace(/[.+?^${}()|[\]\\]/g, '\\$&')
|
|
25
|
+
.replace(/\*/g, '.*');
|
|
26
|
+
const matcher = new RegExp('^' + escaped + '$');
|
|
27
|
+
return fs.readdirSync(fullDir)
|
|
28
|
+
.filter(f => f.endsWith('.test.js') && matcher.test(f))
|
|
29
|
+
.map(f => path.join(fullDir, f))
|
|
30
|
+
.sort();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const files = expandTestGlob(EVOLVER_REPO_ROOT, pattern);
|
|
34
|
+
if (files.length === 0) {
|
|
35
|
+
console.error('FAIL: no tests found matching pattern: ' + pattern);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const env = Object.assign({}, process.env, {
|
|
40
|
+
NODE_ENV: 'test',
|
|
41
|
+
EVOLVER_REPO_ROOT,
|
|
42
|
+
GEP_ASSETS_DIR: path.join(EVOLVER_REPO_ROOT, 'assets', 'gep'),
|
|
43
|
+
});
|
|
44
|
+
delete env.EVOLVE_BRIDGE;
|
|
45
|
+
delete env.OPENCLAW_WORKSPACE;
|
|
46
|
+
// Clear NODE_TEST_CONTEXT so nested runs from within node --test work.
|
|
47
|
+
delete env.NODE_TEST_CONTEXT;
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
const output = execFileSync(process.execPath, ['--test', ...files], {
|
|
51
|
+
cwd: EVOLVER_REPO_ROOT,
|
|
52
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
53
|
+
timeout: 180000,
|
|
54
|
+
env,
|
|
55
|
+
});
|
|
56
|
+
const out = output.toString('utf8');
|
|
57
|
+
const passMatch = out.match(/pass (\d+)/);
|
|
58
|
+
const failMatch = out.match(/fail (\d+)/);
|
|
59
|
+
const passCount = passMatch ? Number(passMatch[1]) : 0;
|
|
60
|
+
const failCount = failMatch ? Number(failMatch[1]) : 0;
|
|
61
|
+
|
|
62
|
+
if (failCount > 0) {
|
|
63
|
+
console.error('FAIL: ' + failCount + ' test(s) failed');
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
if (passCount === 0) {
|
|
67
|
+
console.error('FAIL: no tests found');
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
console.log('ok: ' + passCount + ' test(s) passed, 0 failed');
|
|
71
|
+
} catch (e) {
|
|
72
|
+
const stderr = e.stderr ? e.stderr.toString('utf8').slice(-500) : '';
|
|
73
|
+
const stdout = e.stdout ? e.stdout.toString('utf8').slice(-500) : '';
|
|
74
|
+
console.error('FAIL: test suite exited with code ' + (e.status || 'unknown'));
|
|
75
|
+
if (stderr) console.error(stderr);
|
|
76
|
+
if (stdout) console.error(stdout);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "_meta",
|
|
4
|
+
"dir": "_meta",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "Bootstrap skill that teaches the agent how to discover and load other skills on demand via gep_list_skill / gep_load_skill.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"meta",
|
|
9
|
+
"bootstrap",
|
|
10
|
+
"evolver"
|
|
11
|
+
],
|
|
12
|
+
"sizeBytes": 1691
|
|
13
|
+
}
|
|
14
|
+
]
|