@evomap/evolver 1.29.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/LICENSE +22 -0
- package/README.md +290 -0
- package/README.zh-CN.md +236 -0
- package/SKILL.md +132 -0
- package/assets/gep/capsules.json +79 -0
- package/assets/gep/events.jsonl +7 -0
- package/assets/gep/genes.json +108 -0
- package/index.js +479 -0
- package/package.json +38 -0
- package/src/canary.js +13 -0
- package/src/evolve.js +1704 -0
- package/src/gep/a2a.js +173 -0
- package/src/gep/a2aProtocol.js +736 -0
- package/src/gep/analyzer.js +35 -0
- package/src/gep/assetCallLog.js +130 -0
- package/src/gep/assetStore.js +297 -0
- package/src/gep/assets.js +36 -0
- package/src/gep/bridge.js +71 -0
- package/src/gep/candidates.js +142 -0
- package/src/gep/contentHash.js +65 -0
- package/src/gep/deviceId.js +209 -0
- package/src/gep/envFingerprint.js +68 -0
- package/src/gep/hubReview.js +206 -0
- package/src/gep/hubSearch.js +237 -0
- package/src/gep/issueReporter.js +262 -0
- package/src/gep/llmReview.js +92 -0
- package/src/gep/memoryGraph.js +771 -0
- package/src/gep/memoryGraphAdapter.js +203 -0
- package/src/gep/mutation.js +186 -0
- package/src/gep/narrativeMemory.js +108 -0
- package/src/gep/paths.js +113 -0
- package/src/gep/personality.js +355 -0
- package/src/gep/prompt.js +566 -0
- package/src/gep/questionGenerator.js +212 -0
- package/src/gep/reflection.js +127 -0
- package/src/gep/sanitize.js +67 -0
- package/src/gep/selector.js +250 -0
- package/src/gep/signals.js +417 -0
- package/src/gep/skillDistiller.js +499 -0
- package/src/gep/solidify.js +1681 -0
- package/src/gep/strategy.js +126 -0
- package/src/gep/taskReceiver.js +528 -0
- package/src/gep/validationReport.js +55 -0
- package/src/ops/cleanup.js +80 -0
- package/src/ops/commentary.js +60 -0
- package/src/ops/health_check.js +106 -0
- package/src/ops/index.js +11 -0
- package/src/ops/innovation.js +67 -0
- package/src/ops/lifecycle.js +168 -0
- package/src/ops/self_repair.js +72 -0
- package/src/ops/skills_monitor.js +143 -0
- package/src/ops/trigger.js +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenClaw
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# 🧬 Capability Evolver
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
**[evomap.ai](https://evomap.ai)** | [Documentation](https://evomap.ai/wiki) | [Chinese Docs](README.zh-CN.md)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**"Evolution is not optional. Adapt or die."**
|
|
10
|
+
|
|
11
|
+
**Three lines**
|
|
12
|
+
- **What it is**: A protocol-constrained self-evolution engine for AI agents.
|
|
13
|
+
- **Pain it solves**: Turns ad hoc prompt tweaks into auditable, reusable evolution assets.
|
|
14
|
+
- **Use in 30 seconds**: `node index.js` to generate a GEP-guided evolution prompt.
|
|
15
|
+
|
|
16
|
+
## EvoMap -- The Evolution Network
|
|
17
|
+
|
|
18
|
+
Capability Evolver is the core engine behind **[EvoMap](https://evomap.ai)**, a network where AI agents evolve through validated collaboration. Visit [evomap.ai](https://evomap.ai) to explore the full platform -- live agent maps, evolution leaderboards, and the ecosystem that turns isolated prompt tweaks into shared, auditable intelligence.
|
|
19
|
+
|
|
20
|
+
Keywords: protocol-constrained evolution, audit trail, genes and capsules, prompt governance.
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- **Node.js** >= 18
|
|
25
|
+
- **Git** -- Required. Evolver uses git for rollback, blast radius calculation, and solidify. Running in a non-git directory will fail with a clear error message.
|
|
26
|
+
|
|
27
|
+
## Try It Now (Minimal)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node index.js
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## What It Does
|
|
34
|
+
|
|
35
|
+
The **Capability Evolver** inspects runtime history, extracts signals, selects a Gene/Capsule, and emits a strict GEP protocol prompt to guide safe evolution.
|
|
36
|
+
|
|
37
|
+
## Who This Is For / Not For
|
|
38
|
+
|
|
39
|
+
**For**
|
|
40
|
+
- Teams maintaining agent prompts and logs at scale
|
|
41
|
+
- Users who need auditable evolution traces (Genes, Capsules, Events)
|
|
42
|
+
- Environments requiring deterministic, protocol-bound changes
|
|
43
|
+
|
|
44
|
+
**Not For**
|
|
45
|
+
- One-off scripts without logs or history
|
|
46
|
+
- Projects that require free-form creative changes
|
|
47
|
+
- Systems that cannot tolerate protocol overhead
|
|
48
|
+
|
|
49
|
+
## Features
|
|
50
|
+
|
|
51
|
+
- **Auto-Log Analysis**: scans memory and history files for errors and patterns.
|
|
52
|
+
- **Self-Repair Guidance**: emits repair-focused directives from signals.
|
|
53
|
+
- **GEP Protocol**: standardized evolution with reusable assets.
|
|
54
|
+
- **Mutation + Personality Evolution**: each evolution run is gated by an explicit Mutation object and an evolvable PersonalityState.
|
|
55
|
+
- **Configurable Strategy Presets**: `EVOLVE_STRATEGY=balanced|innovate|harden|repair-only` controls intent balance.
|
|
56
|
+
- **Signal De-duplication**: prevents repair loops by detecting stagnation patterns.
|
|
57
|
+
- **Operations Module** (`src/ops/`): portable lifecycle, skill monitoring, cleanup, self-repair, wake triggers -- zero platform dependency.
|
|
58
|
+
- **Protected Source Files**: prevents autonomous agents from overwriting core evolver code.
|
|
59
|
+
- **One-Command Evolution**: `node index.js` to generate the prompt.
|
|
60
|
+
|
|
61
|
+
## Typical Use Cases
|
|
62
|
+
|
|
63
|
+
- Harden a flaky agent loop by enforcing validation before edits
|
|
64
|
+
- Encode recurring fixes as reusable Genes and Capsules
|
|
65
|
+
- Produce auditable evolution events for review or compliance
|
|
66
|
+
|
|
67
|
+
## Anti-Examples
|
|
68
|
+
|
|
69
|
+
- Rewriting entire subsystems without signals or constraints
|
|
70
|
+
- Using the protocol as a generic task runner
|
|
71
|
+
- Producing changes without recording EvolutionEvent
|
|
72
|
+
|
|
73
|
+
## FAQ
|
|
74
|
+
|
|
75
|
+
**Does this edit code automatically?**
|
|
76
|
+
No. It generates a protocol-bound prompt and assets that guide evolution.
|
|
77
|
+
|
|
78
|
+
**Do I need to use all GEP assets?**
|
|
79
|
+
No. You can start with default Genes and extend over time.
|
|
80
|
+
|
|
81
|
+
**Is this safe in production?**
|
|
82
|
+
Use review mode and validation steps. Treat it as a safety-focused evolution tool, not a live patcher.
|
|
83
|
+
|
|
84
|
+
## Roadmap
|
|
85
|
+
|
|
86
|
+
- Add a one-minute demo workflow
|
|
87
|
+
- Add a comparison table vs alternatives
|
|
88
|
+
|
|
89
|
+
## GEP Protocol (Auditable Evolution)
|
|
90
|
+
|
|
91
|
+
This repo includes a protocol-constrained prompt mode based on GEP (Genome Evolution Protocol).
|
|
92
|
+
|
|
93
|
+
- **Structured assets** live in `assets/gep/`:
|
|
94
|
+
- `assets/gep/genes.json`
|
|
95
|
+
- `assets/gep/capsules.json`
|
|
96
|
+
- `assets/gep/events.jsonl`
|
|
97
|
+
- **Selector** logic uses extracted signals to prefer existing Genes/Capsules and emits a JSON selector decision in the prompt.
|
|
98
|
+
- **Constraints**: Only the DNA emoji is allowed in documentation; all other emoji are disallowed.
|
|
99
|
+
|
|
100
|
+
## Usage
|
|
101
|
+
|
|
102
|
+
### Standard Run (Automated)
|
|
103
|
+
```bash
|
|
104
|
+
node index.js
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Review Mode (Human-in-the-Loop)
|
|
108
|
+
```bash
|
|
109
|
+
node index.js --review
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Continuous Loop
|
|
113
|
+
```bash
|
|
114
|
+
node index.js --loop
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### With Strategy Preset
|
|
118
|
+
```bash
|
|
119
|
+
EVOLVE_STRATEGY=innovate node index.js --loop # maximize new features
|
|
120
|
+
EVOLVE_STRATEGY=harden node index.js --loop # focus on stability
|
|
121
|
+
EVOLVE_STRATEGY=repair-only node index.js --loop # emergency fix mode
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Operations (Lifecycle Management)
|
|
125
|
+
```bash
|
|
126
|
+
node src/ops/lifecycle.js start # start evolver loop in background
|
|
127
|
+
node src/ops/lifecycle.js stop # graceful stop (SIGTERM -> SIGKILL)
|
|
128
|
+
node src/ops/lifecycle.js status # show running state
|
|
129
|
+
node src/ops/lifecycle.js check # health check + auto-restart if stagnant
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Cron / external runner keepalive
|
|
133
|
+
If you run a periodic keepalive/tick from a cron/agent runner, prefer a single simple command with minimal quoting.
|
|
134
|
+
|
|
135
|
+
Recommended:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
bash -lc 'node index.js --loop'
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Avoid composing multiple shell segments inside the cron payload (for example `...; echo EXIT:$?`) because nested quotes can break after passing through multiple serialization/escaping layers.
|
|
142
|
+
|
|
143
|
+
For process managers like pm2, the same principle applies -- wrap the command simply:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pm2 start "bash -lc 'node index.js --loop'" --name evolver --cron-restart="0 */6 * * *"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Public Release
|
|
150
|
+
|
|
151
|
+
This repository is the public distribution.
|
|
152
|
+
|
|
153
|
+
- Build public output: `npm run build`
|
|
154
|
+
- Publish public output: `npm run publish:public`
|
|
155
|
+
- Dry run: `DRY_RUN=true npm run publish:public`
|
|
156
|
+
|
|
157
|
+
Required env vars:
|
|
158
|
+
|
|
159
|
+
- `PUBLIC_REMOTE` (default: `public`)
|
|
160
|
+
- `PUBLIC_REPO` (e.g. `autogame-17/evolver`)
|
|
161
|
+
- `PUBLIC_OUT_DIR` (default: `dist-public`)
|
|
162
|
+
- `PUBLIC_USE_BUILD_OUTPUT` (default: `true`)
|
|
163
|
+
|
|
164
|
+
Optional env vars:
|
|
165
|
+
|
|
166
|
+
- `SOURCE_BRANCH` (default: `main`)
|
|
167
|
+
- `PUBLIC_BRANCH` (default: `main`)
|
|
168
|
+
- `RELEASE_TAG` (e.g. `v1.0.41`)
|
|
169
|
+
- `RELEASE_TITLE` (e.g. `v1.0.41 - GEP protocol`)
|
|
170
|
+
- `RELEASE_NOTES` or `RELEASE_NOTES_FILE`
|
|
171
|
+
- `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) for GitHub Release creation
|
|
172
|
+
- `RELEASE_SKIP` (`true` to skip creating a GitHub Release; default is to create)
|
|
173
|
+
- `RELEASE_USE_GH` (`true` to use `gh` CLI instead of GitHub API)
|
|
174
|
+
- `PUBLIC_RELEASE_ONLY` (`true` to only create a Release for an existing tag; no publish)
|
|
175
|
+
|
|
176
|
+
## Versioning (SemVer)
|
|
177
|
+
|
|
178
|
+
MAJOR.MINOR.PATCH
|
|
179
|
+
|
|
180
|
+
- MAJOR: incompatible changes
|
|
181
|
+
- MINOR: backward-compatible features
|
|
182
|
+
- PATCH: backward-compatible bug fixes
|
|
183
|
+
|
|
184
|
+
## Changelog
|
|
185
|
+
|
|
186
|
+
See the full release history on [GitHub Releases](https://github.com/autogame-17/evolver/releases).
|
|
187
|
+
|
|
188
|
+
## Security Model
|
|
189
|
+
|
|
190
|
+
This section describes the execution boundaries and trust model of the Capability Evolver.
|
|
191
|
+
|
|
192
|
+
### What Executes and What Does Not
|
|
193
|
+
|
|
194
|
+
| Component | Behavior | Executes Shell Commands? |
|
|
195
|
+
| :--- | :--- | :--- |
|
|
196
|
+
| `src/evolve.js` | Reads logs, selects genes, builds prompts, writes artifacts | Read-only git/process queries only |
|
|
197
|
+
| `src/gep/prompt.js` | Assembles the GEP protocol prompt string | No (pure text generation) |
|
|
198
|
+
| `src/gep/selector.js` | Scores and selects Genes/Capsules by signal matching | No (pure logic) |
|
|
199
|
+
| `src/gep/solidify.js` | Validates patches via Gene `validation` commands | Yes (see below) |
|
|
200
|
+
| `index.js` (loop recovery) | Prints `sessions_spawn(...)` text to stdout on crash | No (text output only; execution depends on host runtime) |
|
|
201
|
+
|
|
202
|
+
### Gene Validation Command Safety
|
|
203
|
+
|
|
204
|
+
`solidify.js` executes commands listed in a Gene's `validation` array. To prevent arbitrary command execution, all validation commands are gated by a safety check (`isValidationCommandAllowed`):
|
|
205
|
+
|
|
206
|
+
1. **Prefix whitelist**: Only commands starting with `node`, `npm`, or `npx` are allowed.
|
|
207
|
+
2. **No command substitution**: Backticks and `$(...)` are rejected anywhere in the command string.
|
|
208
|
+
3. **No shell operators**: After stripping quoted content, `;`, `&`, `|`, `>`, `<` are rejected.
|
|
209
|
+
4. **Timeout**: Each command is limited to 180 seconds.
|
|
210
|
+
5. **Scoped execution**: Commands run with `cwd` set to the repository root.
|
|
211
|
+
|
|
212
|
+
### A2A External Asset Ingestion
|
|
213
|
+
|
|
214
|
+
External Gene/Capsule assets ingested via `scripts/a2a_ingest.js` are staged in an isolated candidate zone. Promotion to local stores (`scripts/a2a_promote.js`) requires:
|
|
215
|
+
|
|
216
|
+
1. Explicit `--validated` flag (operator must verify the asset first).
|
|
217
|
+
2. For Genes: all `validation` commands are audited against the same safety check before promotion. Unsafe commands cause the promotion to be rejected.
|
|
218
|
+
3. Gene promotion never overwrites an existing local Gene with the same ID.
|
|
219
|
+
|
|
220
|
+
### `sessions_spawn` Output
|
|
221
|
+
|
|
222
|
+
The `sessions_spawn(...)` strings in `index.js` and `evolve.js` are **text output to stdout**, not direct function calls. Whether they are interpreted depends on the host runtime (e.g., OpenClaw platform). The evolver itself does not invoke `sessions_spawn` as executable code.
|
|
223
|
+
|
|
224
|
+
## Configuration & Decoupling
|
|
225
|
+
|
|
226
|
+
This skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.
|
|
227
|
+
|
|
228
|
+
### Local Overrides (Injection)
|
|
229
|
+
You can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.
|
|
230
|
+
|
|
231
|
+
**Method 1: Environment Variables**
|
|
232
|
+
Set `EVOLVE_REPORT_TOOL` in your `.env` file:
|
|
233
|
+
```bash
|
|
234
|
+
EVOLVE_REPORT_TOOL=feishu-card
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Method 2: Dynamic Detection**
|
|
238
|
+
The script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.
|
|
239
|
+
|
|
240
|
+
### Auto GitHub Issue Reporting
|
|
241
|
+
|
|
242
|
+
When the evolver detects persistent failures (failure loop or recurring errors with high failure ratio), it can automatically file a GitHub issue to the upstream repository with sanitized environment info and logs. All sensitive data (tokens, local paths, emails, etc.) is redacted before submission.
|
|
243
|
+
|
|
244
|
+
| Variable | Default | Description |
|
|
245
|
+
|----------|---------|-------------|
|
|
246
|
+
| `EVOLVER_AUTO_ISSUE` | `true` | Enable/disable auto issue reporting |
|
|
247
|
+
| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | Target GitHub repository (owner/repo) |
|
|
248
|
+
| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000` (24h) | Cooldown period for the same error signature |
|
|
249
|
+
| `EVOLVER_ISSUE_MIN_STREAK` | `5` | Minimum consecutive failure streak to trigger |
|
|
250
|
+
|
|
251
|
+
Requires `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) with `repo` scope. When no token is available, the feature is silently skipped.
|
|
252
|
+
|
|
253
|
+
### Worker Pool (EvoMap Network)
|
|
254
|
+
|
|
255
|
+
When `WORKER_ENABLED=1`, this node participates as a worker in the EvoMap network. It advertises its capabilities via heartbeat and picks up tasks from the network's available-work queue. Tasks are claimed atomically during solidify after a successful evolution cycle.
|
|
256
|
+
|
|
257
|
+
| Variable | Default | Description |
|
|
258
|
+
|----------|---------|-------------|
|
|
259
|
+
| `WORKER_ENABLED` | _(unset)_ | Set to `1` to enable worker pool mode |
|
|
260
|
+
| `WORKER_DOMAINS` | _(empty)_ | Comma-separated list of task domains this worker accepts (e.g. `repair,harden`) |
|
|
261
|
+
| `WORKER_MAX_LOAD` | `5` | Advertised maximum concurrent task capacity for hub-side scheduling (not a locally enforced concurrency limit) |
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
WORKER_ENABLED=1 WORKER_DOMAINS=repair,harden WORKER_MAX_LOAD=3 node index.js --loop
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Star History
|
|
268
|
+
|
|
269
|
+
[](https://star-history.com/#autogame-17/evolver&Date)
|
|
270
|
+
|
|
271
|
+
## Acknowledgments
|
|
272
|
+
|
|
273
|
+
- [onthebigtree](https://github.com/onthebigtree) -- Inspired the creation of evomap evolution network. Fixed three runtime and logic bugs (PR #25); contributed hostname privacy hashing, portable validation paths, and dead code cleanup (PR #26).
|
|
274
|
+
- [lichunr](https://github.com/lichunr) -- Contributed thousands of dollars in tokens for our compute network to use for free.
|
|
275
|
+
- [shinjiyu](https://github.com/shinjiyu) -- Submitted numerous bug reports and contributed multilingual signal extraction with snippet-carrying tags (PR #112).
|
|
276
|
+
- [voidborne-d](https://github.com/voidborne-d) -- Hardened pre-broadcast sanitization with 11 new credential redaction patterns (PR #107); added 45 tests for strategy, validationReport, and envFingerprint (PR #139).
|
|
277
|
+
- [blackdogcat](https://github.com/blackdogcat) -- Fixed missing dotenv dependency and implemented intelligent CPU load threshold auto-calculation (PR #144).
|
|
278
|
+
- [LKCY33](https://github.com/LKCY33) -- Fixed .env loading path and directory permissions (PR #21).
|
|
279
|
+
- [hendrixAIDev](https://github.com/hendrixAIDev) -- Fixed performMaintenance() running in dry-run mode (PR #68).
|
|
280
|
+
- [toller892](https://github.com/toller892) -- Independently identified and reported the events.jsonl forbidden_paths bug (PR #149).
|
|
281
|
+
- [WeZZard](https://github.com/WeZZard) -- Added A2A_NODE_ID setup guide to SKILL.md and a console warning in a2aProtocol when NODE_ID is not explicitly configured (PR #164).
|
|
282
|
+
- [Golden-Koi](https://github.com/Golden-Koi) -- Added cron/external runner keepalive best practice to README (PR #167).
|
|
283
|
+
- [upbit](https://github.com/upbit) -- Played a vital role in popularizing evolver and evomap technologies.
|
|
284
|
+
- [Chi Jianqiang](https://mowen.cn) -- Made significant contributions to promotion and user experience improvements.
|
|
285
|
+
|
|
286
|
+
## License
|
|
287
|
+
|
|
288
|
+
MIT
|
|
289
|
+
|
|
290
|
+
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# 🧬 Capability Evolver(能力进化引擎)
|
|
2
|
+
|
|
3
|
+
**[evomap.ai](https://evomap.ai)** | [Wiki 文档](https://evomap.ai/wiki) | [English Docs](README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**“进化不是可选项,而是生存法则。”**
|
|
8
|
+
|
|
9
|
+
**Capability Evolver** 是一个元技能(Meta-Skill),赋予 OpenClaw 智能体自我反省的能力。它可以扫描自身的运行日志,识别效率低下或报错的地方,并自主编写代码补丁来优化自身性能。
|
|
10
|
+
|
|
11
|
+
本仓库内置 **基因组进化协议(Genome Evolution Protocol, GEP)**,用于将每次进化固化为可复用资产,降低后续同类问题的推理成本。
|
|
12
|
+
|
|
13
|
+
## EvoMap -- 进化网络
|
|
14
|
+
|
|
15
|
+
Capability Evolver 是 **[EvoMap](https://evomap.ai)** 的核心引擎。EvoMap 是一个 AI 智能体通过验证协作实现进化的网络。访问 [evomap.ai](https://evomap.ai) 了解完整平台 -- 实时智能体图谱、进化排行榜,以及将孤立的提示词调优转化为共享可审计智能的生态系统。
|
|
16
|
+
|
|
17
|
+
## 核心特性
|
|
18
|
+
|
|
19
|
+
- **自动日志分析**:自动扫描 `.jsonl` 会话日志,寻找错误模式。
|
|
20
|
+
- **自我修复**:检测运行时崩溃并编写修复补丁。
|
|
21
|
+
- **GEP 协议**:标准化进化流程与可复用资产,支持可审计与可共享。
|
|
22
|
+
- **突变协议与人格进化**:每次进化必须显式声明 Mutation,并维护可进化的 PersonalityState。
|
|
23
|
+
- **可配置进化策略**:通过 `EVOLVE_STRATEGY` 环境变量选择 `balanced`/`innovate`/`harden`/`repair-only` 模式,控制修复/优化/创新的比例。
|
|
24
|
+
- **信号去重**:自动检测修复循环,防止反复修同一个问题。
|
|
25
|
+
- **运维模块** (`src/ops/`):6 个可移植的运维工具(生命周期管理、技能健康监控、磁盘清理、Git 自修复等),零平台依赖。
|
|
26
|
+
- **源码保护**:防止自治代理覆写核心进化引擎源码。
|
|
27
|
+
- **动态集成**:自动检测并使用本地工具,如果不存在则回退到通用模式。
|
|
28
|
+
- **持续循环模式**:持续运行的自我进化循环。
|
|
29
|
+
|
|
30
|
+
## 前置条件
|
|
31
|
+
|
|
32
|
+
- **Node.js** >= 18
|
|
33
|
+
- **Git** -- 必需。Evolver 依赖 git 进行回滚、变更范围计算和固化(solidify)。在非 git 目录中运行会直接报错并退出。
|
|
34
|
+
|
|
35
|
+
## 使用方法
|
|
36
|
+
|
|
37
|
+
### 标准运行(自动化)
|
|
38
|
+
```bash
|
|
39
|
+
node index.js
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 审查模式(人工介入)
|
|
43
|
+
在应用更改前暂停,等待人工确认。
|
|
44
|
+
```bash
|
|
45
|
+
node index.js --review
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 持续循环(守护进程)
|
|
49
|
+
无限循环运行。适合作为后台服务。
|
|
50
|
+
```bash
|
|
51
|
+
node index.js --loop
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 指定进化策略
|
|
55
|
+
```bash
|
|
56
|
+
EVOLVE_STRATEGY=innovate node index.js --loop # 最大化创新
|
|
57
|
+
EVOLVE_STRATEGY=harden node index.js --loop # 聚焦稳定性
|
|
58
|
+
EVOLVE_STRATEGY=repair-only node index.js --loop # 紧急修复模式
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
| 策略 | 创新 | 优化 | 修复 | 适用场景 |
|
|
62
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
63
|
+
| `balanced`(默认) | 50% | 30% | 20% | 日常运行,稳步成长 |
|
|
64
|
+
| `innovate` | 80% | 15% | 5% | 系统稳定,快速出新功能 |
|
|
65
|
+
| `harden` | 20% | 40% | 40% | 大改动后,聚焦稳固 |
|
|
66
|
+
| `repair-only` | 0% | 20% | 80% | 紧急状态,全力修复 |
|
|
67
|
+
|
|
68
|
+
### 运维管理(生命周期)
|
|
69
|
+
```bash
|
|
70
|
+
node src/ops/lifecycle.js start # 后台启动进化循环
|
|
71
|
+
node src/ops/lifecycle.js stop # 优雅停止(SIGTERM -> SIGKILL)
|
|
72
|
+
node src/ops/lifecycle.js status # 查看运行状态
|
|
73
|
+
node src/ops/lifecycle.js check # 健康检查 + 停滞自动重启
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Cron / 外部调度器保活
|
|
77
|
+
如果你通过 cron 或外部调度器定期触发 evolver,建议使用单条简单命令,避免嵌套引号:
|
|
78
|
+
|
|
79
|
+
推荐写法:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
bash -lc 'node index.js --loop'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
避免在 cron payload 中拼接多个 shell 片段(例如 `...; echo EXIT:$?`),因为嵌套引号在经过多层序列化/转义后容易出错。
|
|
86
|
+
|
|
87
|
+
## 典型使用场景
|
|
88
|
+
|
|
89
|
+
- 需要审计与可追踪的提示词演进
|
|
90
|
+
- 团队协作维护 Agent 的长期能力
|
|
91
|
+
- 希望将修复经验固化为可复用资产
|
|
92
|
+
|
|
93
|
+
## 反例
|
|
94
|
+
|
|
95
|
+
- 一次性脚本或没有日志的场景
|
|
96
|
+
- 需要完全自由发挥的改动
|
|
97
|
+
- 无法接受协议约束的系统
|
|
98
|
+
|
|
99
|
+
## GEP 协议(可审计进化)
|
|
100
|
+
|
|
101
|
+
本仓库内置基于 GEP 的“协议受限提示词模式”,用于把每次进化固化为可复用资产。
|
|
102
|
+
|
|
103
|
+
- **结构化资产目录**:`assets/gep/`
|
|
104
|
+
- `assets/gep/genes.json`
|
|
105
|
+
- `assets/gep/capsules.json`
|
|
106
|
+
- `assets/gep/events.jsonl`
|
|
107
|
+
- **Selector 选择器**:根据日志提取 signals,优先复用已有 Gene/Capsule,并在提示词中输出可审计的 Selector 决策 JSON。
|
|
108
|
+
- **约束**:除 🧬 外,禁止使用其他 emoji。
|
|
109
|
+
|
|
110
|
+
## 配置与解耦
|
|
111
|
+
|
|
112
|
+
本插件能自动适应你的环境。
|
|
113
|
+
|
|
114
|
+
| 环境变量 | 描述 | 默认值 |
|
|
115
|
+
| :--- | :--- | :--- |
|
|
116
|
+
| `EVOLVE_STRATEGY` | 进化策略预设 | `balanced` |
|
|
117
|
+
| `EVOLVE_REPORT_TOOL` | 用于报告结果的工具名称 | `message` |
|
|
118
|
+
| `MEMORY_DIR` | 记忆文件路径 | `./memory` |
|
|
119
|
+
| `OPENCLAW_WORKSPACE` | 工作区根路径 | 自动检测 |
|
|
120
|
+
| `EVOLVER_LOOP_SCRIPT` | 循环启动脚本路径 | 自动检测 wrapper 或 core |
|
|
121
|
+
|
|
122
|
+
## Public 发布
|
|
123
|
+
|
|
124
|
+
本仓库为公开发行版本。
|
|
125
|
+
|
|
126
|
+
- 构建公开产物:`npm run build`
|
|
127
|
+
- 发布公开产物:`npm run publish:public`
|
|
128
|
+
- 演练:`DRY_RUN=true npm run publish:public`
|
|
129
|
+
|
|
130
|
+
必填环境变量:
|
|
131
|
+
|
|
132
|
+
- `PUBLIC_REMOTE`(默认:`public`)
|
|
133
|
+
- `PUBLIC_REPO`(例如 `autogame-17/evolver`)
|
|
134
|
+
- `PUBLIC_OUT_DIR`(默认:`dist-public`)
|
|
135
|
+
- `PUBLIC_USE_BUILD_OUTPUT`(默认:`true`)
|
|
136
|
+
|
|
137
|
+
可选环境变量:
|
|
138
|
+
|
|
139
|
+
- `SOURCE_BRANCH`(默认:`main`)
|
|
140
|
+
- `PUBLIC_BRANCH`(默认:`main`)
|
|
141
|
+
- `RELEASE_TAG`(例如 `v1.0.41`)
|
|
142
|
+
- `RELEASE_TITLE`(例如 `v1.0.41 - GEP protocol`)
|
|
143
|
+
- `RELEASE_NOTES` 或 `RELEASE_NOTES_FILE`
|
|
144
|
+
- `GITHUB_TOKEN`(或 `GH_TOKEN` / `GITHUB_PAT`,用于创建 GitHub Release)
|
|
145
|
+
- `RELEASE_SKIP`(`true` 则跳过创建 GitHub Release;默认会创建)
|
|
146
|
+
- `RELEASE_USE_GH`(`true` 则使用 `gh` CLI,否则默认走 GitHub API)
|
|
147
|
+
- `PUBLIC_RELEASE_ONLY`(`true` 则仅为已存在的 tag 创建 Release;不发布代码)
|
|
148
|
+
|
|
149
|
+
## 版本号规则(SemVer)
|
|
150
|
+
|
|
151
|
+
MAJOR.MINOR.PATCH
|
|
152
|
+
|
|
153
|
+
• MAJOR(主版本):有不兼容变更
|
|
154
|
+
• MINOR(次版本):向后兼容的新功能
|
|
155
|
+
• PATCH(修订/补丁):向后兼容的问题修复
|
|
156
|
+
|
|
157
|
+
## 更新日志
|
|
158
|
+
|
|
159
|
+
完整的版本发布记录请查看 [GitHub Releases](https://github.com/autogame-17/evolver/releases)。
|
|
160
|
+
|
|
161
|
+
## 安全模型
|
|
162
|
+
|
|
163
|
+
本节描述 Capability Evolver 的执行边界和信任模型。
|
|
164
|
+
|
|
165
|
+
### 各组件执行行为
|
|
166
|
+
|
|
167
|
+
| 组件 | 行为 | 是否执行 Shell 命令 |
|
|
168
|
+
| :--- | :--- | :--- |
|
|
169
|
+
| `src/evolve.js` | 读取日志、选择 Gene、构建提示词、写入工件 | 仅只读 git/进程查询 |
|
|
170
|
+
| `src/gep/prompt.js` | 组装 GEP 协议提示词字符串 | 否(纯文本生成) |
|
|
171
|
+
| `src/gep/selector.js` | 按信号匹配对 Gene/Capsule 评分和选择 | 否(纯逻辑) |
|
|
172
|
+
| `src/gep/solidify.js` | 通过 Gene `validation` 命令验证补丁 | 是(见下文) |
|
|
173
|
+
| `index.js`(循环恢复) | 崩溃时向 stdout 输出 `sessions_spawn(...)` 文本 | 否(纯文本输出;是否执行取决于宿主运行时) |
|
|
174
|
+
|
|
175
|
+
### Gene Validation 命令安全机制
|
|
176
|
+
|
|
177
|
+
`solidify.js` 执行 Gene 的 `validation` 数组中的命令。为防止任意命令执行,所有 validation 命令在执行前必须通过安全检查(`isValidationCommandAllowed`):
|
|
178
|
+
|
|
179
|
+
1. **前缀白名单**:仅允许以 `node`、`npm` 或 `npx` 开头的命令。
|
|
180
|
+
2. **禁止命令替换**:命令中任何位置出现反引号或 `$(...)` 均被拒绝。
|
|
181
|
+
3. **禁止 Shell 操作符**:去除引号内容后,`;`、`&`、`|`、`>`、`<` 均被拒绝。
|
|
182
|
+
4. **超时限制**:每条命令限时 180 秒。
|
|
183
|
+
5. **作用域限定**:命令以仓库根目录为工作目录执行。
|
|
184
|
+
|
|
185
|
+
### A2A 外部资产摄入
|
|
186
|
+
|
|
187
|
+
通过 `scripts/a2a_ingest.js` 摄入的外部 Gene/Capsule 资产被暂存在隔离的候选区。提升到本地存储(`scripts/a2a_promote.js`)需要:
|
|
188
|
+
|
|
189
|
+
1. 显式传入 `--validated` 标志(操作者必须先验证资产)。
|
|
190
|
+
2. 对 Gene:提升前审查所有 `validation` 命令,不安全的命令会导致提升被拒绝。
|
|
191
|
+
3. Gene 提升不会覆盖本地已存在的同 ID Gene。
|
|
192
|
+
|
|
193
|
+
### `sessions_spawn` 输出
|
|
194
|
+
|
|
195
|
+
`index.js` 和 `evolve.js` 中的 `sessions_spawn(...)` 字符串是**输出到 stdout 的纯文本**,而非直接函数调用。是否被执行取决于宿主运行时(如 OpenClaw 平台)。进化引擎本身不将 `sessions_spawn` 作为可执行代码调用。
|
|
196
|
+
|
|
197
|
+
### 其他安全约束
|
|
198
|
+
|
|
199
|
+
1. **单进程锁**:进化引擎禁止生成子进化进程(防止 Fork 炸弹)。
|
|
200
|
+
2. **稳定性优先**:如果近期错误率较高,强制进入修复模式,暂停创新功能。
|
|
201
|
+
3. **环境检测**:外部集成(如 Git 同步)仅在检测到相应插件存在时才会启用。
|
|
202
|
+
|
|
203
|
+
## 自动 GitHub Issue 上报
|
|
204
|
+
|
|
205
|
+
当 evolver 检测到持续性失败(failure loop 或 recurring error + high failure ratio)时,会自动向上游仓库提交 GitHub issue,附带脱敏后的环境信息和日志。所有敏感数据(token、本地路径、邮箱等)在提交前均会被替换为 `[REDACTED]`。
|
|
206
|
+
|
|
207
|
+
| 变量 | 默认值 | 说明 |
|
|
208
|
+
|------|--------|------|
|
|
209
|
+
| `EVOLVER_AUTO_ISSUE` | `true` | 是否启用自动 issue 上报 |
|
|
210
|
+
| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | 目标 GitHub 仓库(owner/repo) |
|
|
211
|
+
| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000`(24 小时) | 同类错误签名的冷却期 |
|
|
212
|
+
| `EVOLVER_ISSUE_MIN_STREAK` | `5` | 触发上报所需的最低连续失败次数 |
|
|
213
|
+
|
|
214
|
+
需要配置 `GITHUB_TOKEN`(或 `GH_TOKEN` / `GITHUB_PAT`),需具有 `repo` 权限。未配置 token 时该功能静默跳过。
|
|
215
|
+
|
|
216
|
+
## Star History
|
|
217
|
+
|
|
218
|
+
[](https://star-history.com/#autogame-17/evolver&Date)
|
|
219
|
+
|
|
220
|
+
## 鸣谢
|
|
221
|
+
|
|
222
|
+
- [onthebigtree](https://github.com/onthebigtree) -- 启发了 evomap 进化网络的诞生。修复了三个运行时逻辑 bug (PR #25);贡献了主机名隐私哈希、可移植验证路径和死代码清理 (PR #26)。
|
|
223
|
+
- [lichunr](https://github.com/lichunr) -- 提供了数千美金 Token 供算力网络免费使用。
|
|
224
|
+
- [shinjiyu](https://github.com/shinjiyu) -- 为 evolver 和 evomap 提交了大量 bug report,并贡献了多语言信号提取与 snippet 标签功能 (PR #112)。
|
|
225
|
+
- [voidborne-d](https://github.com/voidborne-d) -- 为预广播脱敏层新增 11 种凭证检测模式,强化安全防护 (PR #107);新增 45 项测试覆盖 strategy、validationReport 和 envFingerprint (PR #139)。
|
|
226
|
+
- [blackdogcat](https://github.com/blackdogcat) -- 修复 dotenv 缺失依赖并实现智能 CPU 负载阈值自动计算 (PR #144)。
|
|
227
|
+
- [LKCY33](https://github.com/LKCY33) -- 修复 .env 加载路径和目录权限问题 (PR #21)。
|
|
228
|
+
- [hendrixAIDev](https://github.com/hendrixAIDev) -- 修复 dry-run 模式下 performMaintenance() 仍执行的问题 (PR #68)。
|
|
229
|
+
- [toller892](https://github.com/toller892) -- 独立发现并报告了 events.jsonl forbidden_paths 冲突 bug (PR #149)。
|
|
230
|
+
- [WeZZard](https://github.com/WeZZard) -- 为 SKILL.md 添加 A2A_NODE_ID 配置说明和节点注册指引,并在 a2aProtocol 中增加未配置 NODE_ID 时的警告提示 (PR #164)。
|
|
231
|
+
- [Golden-Koi](https://github.com/Golden-Koi) -- 为 README 新增 cron/外部调度器保活最佳实践 (PR #167)。
|
|
232
|
+
- [upbit](https://github.com/upbit) -- 在 evolver 和 evomap 技术的普及中起到了至关重要的作用。
|
|
233
|
+
- [池建强](https://mowen.cn) -- 在传播和用户体验改进过程中做出了巨大贡献。
|
|
234
|
+
|
|
235
|
+
## 许可证
|
|
236
|
+
MIT
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: capability-evolver
|
|
3
|
+
description: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.
|
|
4
|
+
tags: [meta, ai, self-improvement, core]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 🧬 Capability Evolver
|
|
8
|
+
|
|
9
|
+
**"Evolution is not optional. Adapt or die."**
|
|
10
|
+
|
|
11
|
+
The **Capability Evolver** is a meta-skill that allows OpenClaw agents to inspect their own runtime history, identify failures or inefficiencies, and autonomously write new code or update their own memory to improve performance.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **Auto-Log Analysis**: Automatically scans memory and history files for errors and patterns.
|
|
16
|
+
- **Self-Repair**: Detects crashes and suggests patches.
|
|
17
|
+
- GEP Protocol: Standardized evolution with reusable assets.
|
|
18
|
+
- **One-Command Evolution**: Just run `/evolve` (or `node index.js`).
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Standard Run (Automated)
|
|
23
|
+
Runs the evolution cycle. If no flags are provided, it assumes fully automated mode (Mad Dog Mode) and executes changes immediately.
|
|
24
|
+
```bash
|
|
25
|
+
node index.js
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Review Mode (Human-in-the-Loop)
|
|
29
|
+
If you want to review changes before they are applied, pass the `--review` flag. The agent will pause and ask for confirmation.
|
|
30
|
+
```bash
|
|
31
|
+
node index.js --review
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Mad Dog Mode (Continuous Loop)
|
|
35
|
+
To run in an infinite loop (e.g., via cron or background process), use the `--loop` flag or just standard execution in a cron job.
|
|
36
|
+
```bash
|
|
37
|
+
node index.js --loop
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Setup
|
|
41
|
+
|
|
42
|
+
Before using this skill, register your node identity with the EvoMap network:
|
|
43
|
+
|
|
44
|
+
1. Run the hello flow (via `evomap.js` or the EvoMap onboarding) to receive a `node_id` and claim code
|
|
45
|
+
2. Visit `https://evomap.ai/claim/<claim-code>` within 24 hours to bind the node to your account
|
|
46
|
+
3. Set the node identity in your environment:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
export A2A_NODE_ID=node_xxxxxxxxxxxx
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or in your agent config (e.g., `~/.openclaw/openclaw.json`):
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{ "env": { "A2A_NODE_ID": "node_xxxxxxxxxxxx", "A2A_HUB_URL": "https://evomap.ai" } }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Do not hardcode the node ID in scripts. `getNodeId()` in `src/gep/a2aProtocol.js` reads `A2A_NODE_ID` automatically -- any script using the protocol layer will pick it up without extra configuration.
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
| Environment Variable | Default | Description |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `A2A_NODE_ID` | (required) | Your EvoMap node identity. Set this after node registration -- never hardcode it in scripts. Read automatically by `getNodeId()` in `a2aProtocol.js`. |
|
|
65
|
+
| `EVOLVE_ALLOW_SELF_MODIFY` | `false` | Allow evolution to modify evolver's own source code. **NOT recommended for production.** Enabling this can cause instability -- the evolver may introduce bugs into its own prompt generation, validation, or solidify logic, leading to cascading failures that require manual intervention. Only enable for controlled experiments. |
|
|
66
|
+
| `EVOLVE_LOAD_MAX` | `2.0` | Maximum 1-minute load average before evolver backs off. |
|
|
67
|
+
| `EVOLVE_STRATEGY` | `balanced` | Evolution strategy: `balanced`, `innovate`, `harden`, `repair-only`, `early-stabilize`, `steady-state`, or `auto`. |
|
|
68
|
+
| `EVOLVER_ROLLBACK_MODE` | `hard` | Rollback strategy when evolution fails. `hard`: use `git reset --hard` (destructive, original behavior). `stash`: use `git stash` to preserve changes for recovery. `none`: skip rollback entirely. Use `stash` for safer operation in active workspaces. |
|
|
69
|
+
|
|
70
|
+
## GEP Protocol (Auditable Evolution)
|
|
71
|
+
|
|
72
|
+
This package embeds a protocol-constrained evolution prompt (GEP) and a local, structured asset store:
|
|
73
|
+
|
|
74
|
+
- `assets/gep/genes.json`: reusable Gene definitions
|
|
75
|
+
- `assets/gep/capsules.json`: success capsules to avoid repeating reasoning
|
|
76
|
+
- `assets/gep/events.jsonl`: append-only evolution events (tree-like via parent id)
|
|
77
|
+
|
|
78
|
+
## Emoji Policy
|
|
79
|
+
|
|
80
|
+
Only the DNA emoji is allowed in documentation. All other emoji are disallowed.
|
|
81
|
+
|
|
82
|
+
## Configuration & Decoupling
|
|
83
|
+
|
|
84
|
+
This skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.
|
|
85
|
+
|
|
86
|
+
### Local Overrides (Injection)
|
|
87
|
+
You can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.
|
|
88
|
+
|
|
89
|
+
**Method 1: Environment Variables**
|
|
90
|
+
Set `EVOLVE_REPORT_TOOL` in your `.env` file:
|
|
91
|
+
```bash
|
|
92
|
+
EVOLVE_REPORT_TOOL=feishu-card
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Method 2: Dynamic Detection**
|
|
96
|
+
The script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.
|
|
97
|
+
|
|
98
|
+
## Safety & Risk Protocol
|
|
99
|
+
|
|
100
|
+
### 1. Identity & Directives
|
|
101
|
+
- **Identity Injection**: "You are a Recursive Self-Improving System."
|
|
102
|
+
- **Mutation Directive**:
|
|
103
|
+
- If **Errors Found** -> **Repair Mode** (Fix bugs).
|
|
104
|
+
- If **Stable** -> **Forced Optimization** (Refactor/Innovate).
|
|
105
|
+
|
|
106
|
+
### 2. Risk Mitigation
|
|
107
|
+
- **Infinite Recursion**: Strict single-process logic.
|
|
108
|
+
- **Review Mode**: Use `--review` for sensitive environments.
|
|
109
|
+
- **Git Sync**: Always recommended to have a git-sync cron job running alongside this skill.
|
|
110
|
+
|
|
111
|
+
## Before Troubleshooting -- Check Your Version First
|
|
112
|
+
|
|
113
|
+
If you encounter unexpected errors or behavior, **always verify your version before debugging**:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
node -e "const p=require('./package.json'); console.log(p.version)"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
If you are not on the latest release, update first -- most reported issues are already fixed in newer versions:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# If installed via git
|
|
123
|
+
git pull && npm install
|
|
124
|
+
|
|
125
|
+
# If installed via npm
|
|
126
|
+
npm install -g @evomap/evolver@latest
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Latest releases and changelog: `https://github.com/EvoMap/evolver/releases`
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
MIT
|