{"id":"62d79b9f-3ea9-49f0-90d0-53707a965a37","entityType":"agent","slug":"clawhub-lean-zhouchao-capability-evolver-zc","name":"Capability Evolver Zc","canonicalUrl":"https://www.xpersona.co/agent/clawhub-lean-zhouchao-capability-evolver-zc","canonicalPath":"/agent/clawhub-lean-zhouchao-capability-evolver-zc","generatedAt":"2026-10-09T15:30:14.514Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T12:15:07.515Z","emptyReason":null},"description":"A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution. Skill: Capability Evolver Zc Owner: lean-zhouchao Summary: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution. Tags: latest:1.27.7 Version history: v1.27.7 | 2026-03-26T00:43:35.662Z | user Daily auto-sync - renamed to avoid slug conflicts v1.27.6 | 2026-03-26T00:41:23.505Z | user Daily auto-sync v1.27.5 | 2026-03-21T12:13:27.417Z | user","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2.7K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s178rxdgn3z5d3avc5xwvvghx183kh7y:capability-evolver-zc","sourceUrl":"https://clawhub.ai/lean-zhouchao/capability-evolver-zc","homepage":"https://clawhub.ai/lean-zhouchao/skills/capability-evolver-zc","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/lean-zhouchao/capability-evolver-zc","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/lean-zhouchao/skills/capability-evolver-zc","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution. Skill: Capability Evolver Z"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T12:15:07.515Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T12:15:07.515Z","emptyReason":null},"stars":null,"forks":null,"downloads":2677,"packageName":null,"latestVersion":"1.27.7","tractionLabel":"2.7K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T12:15:07.515Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T12:15:07.515Z","lastCrawledAt":"2026-10-09T12:15:07.515Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T12:15:07.515Z","lastVerifiedAt":null,"highlights":[{"version":"1.27.7","createdAt":"2026-03-26T00:43:35.662Z","changelog":"Daily auto-sync - renamed to avoid slug conflicts","fileCount":77,"zipByteSize":207154},{"version":"1.27.6","createdAt":"2026-03-26T00:41:23.505Z","changelog":"Daily auto-sync","fileCount":76,"zipByteSize":205896},{"version":"1.27.5","createdAt":"2026-03-21T12:13:27.417Z","changelog":"Daily auto-update","fileCount":76,"zipByteSize":205896},{"version":"1.27.4","createdAt":"2026-03-21T00:40:06.567Z","changelog":"- Documentation updated in SKILL.md with minor formatting or text corrections. - No functional or feature changes to core logic. - No configuration or protocol changes.","fileCount":76,"zipByteSize":205896},{"version":"1.27.3","createdAt":"2026-03-18T22:47:08.227Z","changelog":"capability-evolver-zc v1.27.3 - Added detailed usage, setup, and configuration instructions to SKILL.md. - Documented new environment variables and evolution strategies (e.g., EVOLVE_STRATEGY, EVOLVER_ROLLBACK_MODE). - Clarified protocol integration and asset storage structure. - Updated safety, risk mitigation, and emoji usage policies. - Improved documentation for local overrides, injection methods, and review modes.","fileCount":76,"zipByteSize":205895}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s178rxdgn3z5d3avc5xwvvghx183kh7y:capability-evolver-zc","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T15:30:14.510Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lean-zhouchao-capability-evolver-zc/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-09T12:15:07.515Z","emptyReason":null},"readme":"Skill: Capability Evolver Zc\n\nOwner: lean-zhouchao\n\nSummary: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.\n\nTags: latest:1.27.7\n\nVersion history:\n\nv1.27.7 | 2026-03-26T00:43:35.662Z | user\n\nDaily auto-sync - renamed to avoid slug conflicts\n\nv1.27.6 | 2026-03-26T00:41:23.505Z | user\n\nDaily auto-sync\n\nv1.27.5 | 2026-03-21T12:13:27.417Z | user\n\nDaily auto-update\n\nv1.27.4 | 2026-03-21T00:40:06.567Z | auto\n\n- Documentation updated in SKILL.md with minor formatting or text corrections.\n- No functional or feature changes to core logic.\n- No configuration or protocol changes.\n\nv1.27.3 | 2026-03-18T22:47:08.227Z | auto\n\ncapability-evolver-zc v1.27.3\n\n- Added detailed usage, setup, and configuration instructions to SKILL.md.\n- Documented new environment variables and evolution strategies (e.g., EVOLVE_STRATEGY, EVOLVER_ROLLBACK_MODE).\n- Clarified protocol integration and asset storage structure.\n- Updated safety, risk mitigation, and emoji usage policies.\n- Improved documentation for local overrides, injection methods, and review modes.\n\nArchive index:\n\nArchive v1.27.7: 77 files, 207154 bytes\n\nFiles: _meta.json (141b), assets/gep/capsules.json (2851b), assets/gep/genes.json (3568b), CONTRIBUTING.md (327b), index.js (19604b), package.json (784b), README.md (12280b), README.zh-CN.md (11544b), scripts/a2a_export.js (2367b), scripts/a2a_ingest.js (2671b), scripts/a2a_promote.js (4785b), scripts/analyze_by_skill.js (4848b), scripts/build_public.js (10821b), scripts/extract_log.js (2600b), scripts/generate_history.js (2593b), scripts/gep_append_event.js (3049b), scripts/gep_personality_report.js (7918b), scripts/human_report.js (5796b), scripts/publish_public.js (20340b), scripts/recover_loop.js (1691b), scripts/suggest_version.js (3037b), scripts/validate-modules.js (437b), skill-card.md (2217b), SKILL.md (5478b), src/canary.js (486b), src/evolve.js (65507b), src/gep/a2a.js (6480b), src/gep/a2aProtocol.js (21422b), src/gep/analyzer.js (988b), src/gep/assetCallLog.js (3478b), src/gep/assets.js (1110b), src/gep/assetStore.js (11619b), src/gep/bridge.js (2096b), src/gep/candidates.js (5126b), src/gep/contentHash.js (2196b), src/gep/deviceId.js (6728b), src/gep/envFingerprint.js (2305b), src/gep/hubReview.js (6561b), src/gep/hubSearch.js (7921b), src/gep/issueReporter.js (8974b), src/gep/llmReview.js (3137b), src/gep/memoryGraph.js (27559b), src/gep/memoryGraphAdapter.js (7134b), src/gep/mutation.js (6902b), src/gep/narrativeMemory.js (3782b), src/gep/paths.js (3025b), src/gep/personality.js (13482b), src/gep/prompt.js (23136b), src/gep/questionGenerator.js (8698b), src/gep/reflection.js (4298b), src/gep/sanitize.js (2211b), src/gep/selector.js (9419b), src/gep/signals.js (19988b), src/gep/skillDistiller.js (19995b), src/gep/solidify.js (70808b), src/gep/strategy.js (4456b), src/gep/taskReceiver.js (14327b), src/gep/validationReport.js (2194b), src/ops/cleanup.js (2611b), src/ops/commentary.js (1762b), src/ops/health_check.js (4049b), src/ops/index.js (376b), src/ops/innovation.js (3156b), src/ops/lifecycle.js (6331b), src/ops/self_repair.js (2582b), src/ops/skills_monitor.js (5457b), src/ops/trigger.js (837b), test/a2aProtocol.test.js (4535b), test/contentHash.test.js (3601b), test/envFingerprint.test.js (3076b), test/mutation.test.js (4718b), test/sanitize.test.js (3976b), test/selector.test.js (4155b), test/signals.test.js (10105b), test/skillDistiller.test.js (17320b), test/strategy.test.js (4923b), test/validationReport.test.js (4913b)\n\nFile v1.27.7:SKILL.md\n\n---\nname: capability-evolver-zc\ndescription: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.\ntags: [meta, ai, self-improvement, core]\n---\n\n# 🧬 Capability Evolver\n\n**\"Evolution is not optional. Adapt or die.\"**\n\nThe **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.\n\n## Features\n\n- **Auto-Log Analysis**: Automatically scans memory and history files for errors and patterns.\n- **Self-Repair**: Detects crashes and suggests patches.\n- GEP Protocol: Standardized evolution with reusable assets.\n- **One-Command Evolution**: Just run `/evolve` (or `node index.js`).\n\n## Usage\n\n### Standard Run (Automated)\nRuns the evolution cycle. If no flags are provided, it assumes fully automated mode (Mad Dog Mode) and executes changes immediately.\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\nIf you want to review changes before they are applied, pass the `--review` flag. The agent will pause and ask for confirmation.\n```bash\nnode index.js --review\n```\n\n### Mad Dog Mode (Continuous Loop)\nTo run in an infinite loop (e.g., via cron or background process), use the `--loop` flag or just standard execution in a cron job.\n```bash\nnode index.js --loop\n```\n\n## Setup\n\nBefore using this skill, register your node identity with the EvoMap network:\n\n1. Run the hello flow (via `evomap.js` or the EvoMap onboarding) to receive a `node_id` and claim code\n2. Visit `https://evomap.ai/claim/<claim-code>` within 24 hours to bind the node to your account\n3. Set the node identity in your environment:\n\n```bash\nexport A2A_NODE_ID=node_xxxxxxxxxxxx\n```\n\nOr in your agent config (e.g., `~/.openclaw/openclaw.json`):\n\n```json\n{ \"env\": { \"A2A_NODE_ID\": \"node_xxxxxxxxxxxx\", \"A2A_HUB_URL\": \"https://evomap.ai\" } }\n```\n\nDo 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.\n\n## Configuration\n\n| Environment Variable | Default | Description |\n|---|---|---|\n| `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`. |\n| `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. |\n| `EVOLVE_LOAD_MAX` | `2.0` | Maximum 1-minute load average before evolver backs off. |\n| `EVOLVE_STRATEGY` | `balanced` | Evolution strategy: `balanced`, `innovate`, `harden`, `repair-only`, `early-stabilize`, `steady-state`, or `auto`. |\n| `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. |\n\n## GEP Protocol (Auditable Evolution)\n\nThis package embeds a protocol-constrained evolution prompt (GEP) and a local, structured asset store:\n\n- `assets/gep/genes.json`: reusable Gene definitions\n- `assets/gep/capsules.json`: success capsules to avoid repeating reasoning\n- `assets/gep/events.jsonl`: append-only evolution events (tree-like via parent id)\n \n## Emoji Policy\n\nOnly the DNA emoji is allowed in documentation. All other emoji are disallowed.\n\n## Configuration & Decoupling\n\nThis skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.\n\n### Local Overrides (Injection)\nYou can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.\n\n**Method 1: Environment Variables**\nSet `EVOLVE_REPORT_TOOL` in your `.env` file:\n```bash\nEVOLVE_REPORT_TOOL=feishu-card\n```\n\n**Method 2: Dynamic Detection**\nThe script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.\n\n## Safety & Risk Protocol\n\n### 1. Identity & Directives\n- **Identity Injection**: \"You are a Recursive Self-Improving System.\"\n- **Mutation Directive**: \n  - If **Errors Found** -> **Repair Mode** (Fix bugs).\n  - If **Stable** -> **Forced Optimization** (Refactor/Innovate).\n\n### 2. Risk Mitigation\n- **Infinite Recursion**: Strict single-process logic.\n- **Review Mode**: Use `--review` for sensitive environments.\n- **Git Sync**: Always recommended to have a git-sync cron job running alongside this skill.\n\n## Before Troubleshooting -- Check Your Version First\n\nIf you encounter unexpected errors or behavior, **always verify your version before debugging**:\n\n```bash\nnode -e \"const p=require('./package.json'); console.log(p.version)\"\n```\n\nIf you are not on the latest release, update first -- most reported issues are already fixed in newer versions:\n\n```bash\n# If installed via git\ngit pull && npm install\n\n# If installed via npm (global install)\nnpm install -g evolver@latest\n```\n\nLatest releases and changelog: `https://github.com/autogame-17/evolver/releases`\n\n## License\nMIT\n\nFile v1.27.7:README.md\n\n# 🧬 Capability Evolver\n\n![Capability Evolver Cover](assets/cover.png)\n\n**[evomap.ai](https://evomap.ai)** | [Documentation](https://evomap.ai/wiki) | [Chinese Docs](README.zh-CN.md)\n\n---\n\n**\"Evolution is not optional. Adapt or die.\"**\n\n**Three lines**\n- **What it is**: A protocol-constrained self-evolution engine for AI agents.\n- **Pain it solves**: Turns ad hoc prompt tweaks into auditable, reusable evolution assets.\n- **Use in 30 seconds**: `node index.js` to generate a GEP-guided evolution prompt.\n\n## EvoMap -- The Evolution Network\n\nCapability 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.\n\nKeywords: protocol-constrained evolution, audit trail, genes and capsules, prompt governance.\n\n## Prerequisites\n\n- **Node.js** >= 18\n- **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.\n\n## Try It Now (Minimal)\n\n```bash\nnode index.js\n```\n\n## What It Does\n\nThe **Capability Evolver** inspects runtime history, extracts signals, selects a Gene/Capsule, and emits a strict GEP protocol prompt to guide safe evolution.\n\n## Who This Is For / Not For\n\n**For**\n- Teams maintaining agent prompts and logs at scale\n- Users who need auditable evolution traces (Genes, Capsules, Events)\n- Environments requiring deterministic, protocol-bound changes\n\n**Not For**\n- One-off scripts without logs or history\n- Projects that require free-form creative changes\n- Systems that cannot tolerate protocol overhead\n\n## Features\n\n- **Auto-Log Analysis**: scans memory and history files for errors and patterns.\n- **Self-Repair Guidance**: emits repair-focused directives from signals.\n- **GEP Protocol**: standardized evolution with reusable assets.\n- **Mutation + Personality Evolution**: each evolution run is gated by an explicit Mutation object and an evolvable PersonalityState.\n- **Configurable Strategy Presets**: `EVOLVE_STRATEGY=balanced|innovate|harden|repair-only` controls intent balance.\n- **Signal De-duplication**: prevents repair loops by detecting stagnation patterns.\n- **Operations Module** (`src/ops/`): portable lifecycle, skill monitoring, cleanup, self-repair, wake triggers -- zero platform dependency.\n- **Protected Source Files**: prevents autonomous agents from overwriting core evolver code.\n- **One-Command Evolution**: `node index.js` to generate the prompt.\n\n## Typical Use Cases\n\n- Harden a flaky agent loop by enforcing validation before edits\n- Encode recurring fixes as reusable Genes and Capsules\n- Produce auditable evolution events for review or compliance\n\n## Anti-Examples\n\n- Rewriting entire subsystems without signals or constraints\n- Using the protocol as a generic task runner\n- Producing changes without recording EvolutionEvent\n\n## FAQ\n\n**Does this edit code automatically?**\nNo. It generates a protocol-bound prompt and assets that guide evolution.\n\n**Do I need to use all GEP assets?**\nNo. You can start with default Genes and extend over time.\n\n**Is this safe in production?**\nUse review mode and validation steps. Treat it as a safety-focused evolution tool, not a live patcher.\n\n## Roadmap\n\n- Add a one-minute demo workflow\n- Add a comparison table vs alternatives\n\n## GEP Protocol (Auditable Evolution)\n\nThis repo includes a protocol-constrained prompt mode based on GEP (Genome Evolution Protocol).\n\n- **Structured assets** live in `assets/gep/`:\n  - `assets/gep/genes.json`\n  - `assets/gep/capsules.json`\n  - `assets/gep/events.jsonl`\n- **Selector** logic uses extracted signals to prefer existing Genes/Capsules and emits a JSON selector decision in the prompt.\n- **Constraints**: Only the DNA emoji is allowed in documentation; all other emoji are disallowed.\n\n## Usage\n\n### Standard Run (Automated)\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\n```bash\nnode index.js --review\n```\n\n### Continuous Loop\n```bash\nnode index.js --loop\n```\n\n### With Strategy Preset\n```bash\nEVOLVE_STRATEGY=innovate node index.js --loop   # maximize new features\nEVOLVE_STRATEGY=harden node index.js --loop     # focus on stability\nEVOLVE_STRATEGY=repair-only node index.js --loop # emergency fix mode\n```\n\n### Operations (Lifecycle Management)\n```bash\nnode src/ops/lifecycle.js start    # start evolver loop in background\nnode src/ops/lifecycle.js stop     # graceful stop (SIGTERM -> SIGKILL)\nnode src/ops/lifecycle.js status   # show running state\nnode src/ops/lifecycle.js check    # health check + auto-restart if stagnant\n```\n\n### Cron / external runner keepalive\nIf you run a periodic keepalive/tick from a cron/agent runner, prefer a single simple command with minimal quoting.\n\nRecommended:\n\n```bash\nbash -lc 'node index.js --loop'\n```\n\nAvoid composing multiple shell segments inside the cron payload (for example `...; echo EXIT:$?`) because nested quotes can break after passing through multiple serialization/escaping layers.\n\nFor process managers like pm2, the same principle applies -- wrap the command simply:\n\n```bash\npm2 start \"bash -lc 'node index.js --loop'\" --name evolver --cron-restart=\"0 */6 * * *\"\n```\n\n## Public Release\n\nThis repository is the public distribution.\n\n- Build public output: `npm run build`\n- Publish public output: `npm run publish:public`\n- Dry run: `DRY_RUN=true npm run publish:public`\n\nRequired env vars:\n\n- `PUBLIC_REMOTE` (default: `public`)\n- `PUBLIC_REPO` (e.g. `autogame-17/evolver`)\n - `PUBLIC_OUT_DIR` (default: `dist-public`)\n - `PUBLIC_USE_BUILD_OUTPUT` (default: `true`)\n\nOptional env vars:\n\n- `SOURCE_BRANCH` (default: `main`)\n- `PUBLIC_BRANCH` (default: `main`)\n- `RELEASE_TAG` (e.g. `v1.0.41`)\n- `RELEASE_TITLE` (e.g. `v1.0.41 - GEP protocol`)\n- `RELEASE_NOTES` or `RELEASE_NOTES_FILE`\n- `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) for GitHub Release creation\n- `RELEASE_SKIP` (`true` to skip creating a GitHub Release; default is to create)\n- `RELEASE_USE_GH` (`true` to use `gh` CLI instead of GitHub API)\n- `PUBLIC_RELEASE_ONLY` (`true` to only create a Release for an existing tag; no publish)\n\n## Versioning (SemVer)\n\nMAJOR.MINOR.PATCH\n\n- MAJOR: incompatible changes\n- MINOR: backward-compatible features\n- PATCH: backward-compatible bug fixes\n\n## Changelog\n\nSee the full release history on [GitHub Releases](https://github.com/autogame-17/evolver/releases).\n\n## Security Model\n\nThis section describes the execution boundaries and trust model of the Capability Evolver.\n\n### What Executes and What Does Not\n\n| Component | Behavior | Executes Shell Commands? |\n| :--- | :--- | :--- |\n| `src/evolve.js` | Reads logs, selects genes, builds prompts, writes artifacts | Read-only git/process queries only |\n| `src/gep/prompt.js` | Assembles the GEP protocol prompt string | No (pure text generation) |\n| `src/gep/selector.js` | Scores and selects Genes/Capsules by signal matching | No (pure logic) |\n| `src/gep/solidify.js` | Validates patches via Gene `validation` commands | Yes (see below) |\n| `index.js` (loop recovery) | Prints `sessions_spawn(...)` text to stdout on crash | No (text output only; execution depends on host runtime) |\n\n### Gene Validation Command Safety\n\n`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`):\n\n1. **Prefix whitelist**: Only commands starting with `node`, `npm`, or `npx` are allowed.\n2. **No command substitution**: Backticks and `$(...)` are rejected anywhere in the command string.\n3. **No shell operators**: After stripping quoted content, `;`, `&`, `|`, `>`, `<` are rejected.\n4. **Timeout**: Each command is limited to 180 seconds.\n5. **Scoped execution**: Commands run with `cwd` set to the repository root.\n\n### A2A External Asset Ingestion\n\nExternal 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:\n\n1. Explicit `--validated` flag (operator must verify the asset first).\n2. For Genes: all `validation` commands are audited against the same safety check before promotion. Unsafe commands cause the promotion to be rejected.\n3. Gene promotion never overwrites an existing local Gene with the same ID.\n\n### `sessions_spawn` Output\n\nThe `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.\n\n## Configuration & Decoupling\n\nThis skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.\n\n### Local Overrides (Injection)\nYou can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.\n\n**Method 1: Environment Variables**\nSet `EVOLVE_REPORT_TOOL` in your `.env` file:\n```bash\nEVOLVE_REPORT_TOOL=feishu-card\n```\n\n**Method 2: Dynamic Detection**\nThe script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.\n\n### Auto GitHub Issue Reporting\n\nWhen 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.\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `EVOLVER_AUTO_ISSUE` | `true` | Enable/disable auto issue reporting |\n| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | Target GitHub repository (owner/repo) |\n| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000` (24h) | Cooldown period for the same error signature |\n| `EVOLVER_ISSUE_MIN_STREAK` | `5` | Minimum consecutive failure streak to trigger |\n\nRequires `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) with `repo` scope. When no token is available, the feature is silently skipped.\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=autogame-17/evolver&type=Date)](https://star-history.com/#autogame-17/evolver&Date)\n\n## Acknowledgments\n\n- [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).\n- [lichunr](https://github.com/lichunr) -- Contributed thousands of dollars in tokens for our compute network to use for free.\n- [shinjiyu](https://github.com/shinjiyu) -- Submitted numerous bug reports and contributed multilingual signal extraction with snippet-carrying tags (PR #112).\n- [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).\n- [blackdogcat](https://github.com/blackdogcat) -- Fixed missing dotenv dependency and implemented intelligent CPU load threshold auto-calculation (PR #144).\n- [LKCY33](https://github.com/LKCY33) -- Fixed .env loading path and directory permissions (PR #21).\n- [hendrixAIDev](https://github.com/hendrixAIDev) -- Fixed performMaintenance() running in dry-run mode (PR #68).\n- [toller892](https://github.com/toller892) -- Independently identified and reported the events.jsonl forbidden_paths bug (PR #149).\n- [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).\n- [Golden-Koi](https://github.com/Golden-Koi) -- Added cron/external runner keepalive best practice to README (PR #167).\n- [upbit](https://github.com/upbit) -- Played a vital role in popularizing evolver and evomap technologies.\n- [Chi Jianqiang](https://mowen.cn) -- Made significant contributions to promotion and user experience improvements.\n\n## License\n\nMIT\n\nFile v1.27.7:_meta.json\n\n{\n  \"ownerId\": \"kn77h3j1ws389cgqcw4scgv49d81g2vg\",\n  \"slug\": \"capability-evolver-zc\",\n  \"version\": \"1.27.7\",\n  \"publishedAt\": 1774485815662\n}\n\nFile v1.27.7:CONTRIBUTING.md\n\n## Contributing\n\nThank you for contributing. Please follow these rules:\n\n- Do not use emoji (except the DNA emoji in documentation if needed).\n- Keep changes small and reviewable.\n- Update related documentation when you change behavior.\n- Run `node index.js` for a quick sanity check.\n\nSubmit PRs with clear intent and scope.\n\nFile v1.27.7:README.zh-CN.md\n\n# 🧬 Capability Evolver（能力进化引擎）\n\n**[evomap.ai](https://evomap.ai)** | [Wiki 文档](https://evomap.ai/wiki) | [English Docs](README.md)\n\n---\n\n**“进化不是可选项，而是生存法则。”**\n\n**Capability Evolver** 是一个元技能（Meta-Skill），赋予 OpenClaw 智能体自我反省的能力。它可以扫描自身的运行日志，识别效率低下或报错的地方，并自主编写代码补丁来优化自身性能。\n\n本仓库内置 **基因组进化协议（Genome Evolution Protocol, GEP）**，用于将每次进化固化为可复用资产，降低后续同类问题的推理成本。\n\n## EvoMap -- 进化网络\n\nCapability Evolver 是 **[EvoMap](https://evomap.ai)** 的核心引擎。EvoMap 是一个 AI 智能体通过验证协作实现进化的网络。访问 [evomap.ai](https://evomap.ai) 了解完整平台 -- 实时智能体图谱、进化排行榜，以及将孤立的提示词调优转化为共享可审计智能的生态系统。\n\n## 核心特性\n\n- **自动日志分析**：自动扫描 `.jsonl` 会话日志，寻找错误模式。\n- **自我修复**：检测运行时崩溃并编写修复补丁。\n- **GEP 协议**：标准化进化流程与可复用资产，支持可审计与可共享。\n- **突变协议与人格进化**：每次进化必须显式声明 Mutation，并维护可进化的 PersonalityState。\n- **可配置进化策略**：通过 `EVOLVE_STRATEGY` 环境变量选择 `balanced`/`innovate`/`harden`/`repair-only` 模式，控制修复/优化/创新的比例。\n- **信号去重**：自动检测修复循环，防止反复修同一个问题。\n- **运维模块** (`src/ops/`)：6 个可移植的运维工具（生命周期管理、技能健康监控、磁盘清理、Git 自修复等），零平台依赖。\n- **源码保护**：防止自治代理覆写核心进化引擎源码。\n- **动态集成**：自动检测并使用本地工具，如果不存在则回退到通用模式。\n- **持续循环模式**：持续运行的自我进化循环。\n\n## 前置条件\n\n- **Node.js** >= 18\n- **Git** -- 必需。Evolver 依赖 git 进行回滚、变更范围计算和固化（solidify）。在非 git 目录中运行会直接报错并退出。\n\n## 使用方法\n\n### 标准运行（自动化）\n```bash\nnode index.js\n```\n\n### 审查模式（人工介入）\n在应用更改前暂停，等待人工确认。\n```bash\nnode index.js --review\n```\n\n### 持续循环（守护进程）\n无限循环运行。适合作为后台服务。\n```bash\nnode index.js --loop\n```\n\n### 指定进化策略\n```bash\nEVOLVE_STRATEGY=innovate node index.js --loop   # 最大化创新\nEVOLVE_STRATEGY=harden node index.js --loop     # 聚焦稳定性\nEVOLVE_STRATEGY=repair-only node index.js --loop # 紧急修复模式\n```\n\n| 策略 | 创新 | 优化 | 修复 | 适用场景 |\n| :--- | :--- | :--- | :--- | :--- |\n| `balanced`（默认） | 50% | 30% | 20% | 日常运行，稳步成长 |\n| `innovate` | 80% | 15% | 5% | 系统稳定，快速出新功能 |\n| `harden` | 20% | 40% | 40% | 大改动后，聚焦稳固 |\n| `repair-only` | 0% | 20% | 80% | 紧急状态，全力修复 |\n\n### 运维管理（生命周期）\n```bash\nnode src/ops/lifecycle.js start    # 后台启动进化循环\nnode src/ops/lifecycle.js stop     # 优雅停止（SIGTERM -> SIGKILL）\nnode src/ops/lifecycle.js status   # 查看运行状态\nnode src/ops/lifecycle.js check    # 健康检查 + 停滞自动重启\n```\n\n### Cron / 外部调度器保活\n如果你通过 cron 或外部调度器定期触发 evolver，建议使用单条简单命令，避免嵌套引号：\n\n推荐写法：\n\n```bash\nbash -lc 'node index.js --loop'\n```\n\n避免在 cron payload 中拼接多个 shell 片段（例如 `...; echo EXIT:$?`），因为嵌套引号在经过多层序列化/转义后容易出错。\n\n## 典型使用场景\n\n- 需要审计与可追踪的提示词演进\n- 团队协作维护 Agent 的长期能力\n- 希望将修复经验固化为可复用资产\n\n## 反例\n\n- 一次性脚本或没有日志的场景\n- 需要完全自由发挥的改动\n- 无法接受协议约束的系统\n\n## GEP 协议（可审计进化）\n\n本仓库内置基于 GEP 的“协议受限提示词模式”，用于把每次进化固化为可复用资产。\n\n- **结构化资产目录**：`assets/gep/`\n  - `assets/gep/genes.json`\n  - `assets/gep/capsules.json`\n  - `assets/gep/events.jsonl`\n- **Selector 选择器**：根据日志提取 signals，优先复用已有 Gene/Capsule，并在提示词中输出可审计的 Selector 决策 JSON。\n- **约束**：除 🧬 外，禁止使用其他 emoji。\n\n## 配置与解耦\n\n本插件能自动适应你的环境。\n\n| 环境变量 | 描述 | 默认值 |\n| :--- | :--- | :--- |\n| `EVOLVE_STRATEGY` | 进化策略预设 | `balanced` |\n| `EVOLVE_REPORT_TOOL` | 用于报告结果的工具名称 | `message` |\n| `MEMORY_DIR` | 记忆文件路径 | `./memory` |\n| `OPENCLAW_WORKSPACE` | 工作区根路径 | 自动检测 |\n| `EVOLVER_LOOP_SCRIPT` | 循环启动脚本路径 | 自动检测 wrapper 或 core |\n\n## Public 发布\n\n本仓库为公开发行版本。\n\n- 构建公开产物：`npm run build`\n- 发布公开产物：`npm run publish:public`\n- 演练：`DRY_RUN=true npm run publish:public`\n\n必填环境变量：\n\n- `PUBLIC_REMOTE`（默认：`public`）\n- `PUBLIC_REPO`（例如 `autogame-17/evolver`）\n- `PUBLIC_OUT_DIR`（默认：`dist-public`）\n- `PUBLIC_USE_BUILD_OUTPUT`（默认：`true`）\n\n可选环境变量：\n\n- `SOURCE_BRANCH`（默认：`main`）\n- `PUBLIC_BRANCH`（默认：`main`）\n- `RELEASE_TAG`（例如 `v1.0.41`）\n- `RELEASE_TITLE`（例如 `v1.0.41 - GEP protocol`）\n- `RELEASE_NOTES` 或 `RELEASE_NOTES_FILE`\n- `GITHUB_TOKEN`（或 `GH_TOKEN` / `GITHUB_PAT`，用于创建 GitHub Release）\n- `RELEASE_SKIP`（`true` 则跳过创建 GitHub Release；默认会创建）\n- `RELEASE_USE_GH`（`true` 则使用 `gh` CLI，否则默认走 GitHub API）\n- `PUBLIC_RELEASE_ONLY`（`true` 则仅为已存在的 tag 创建 Release；不发布代码）\n\n## 版本号规则（SemVer）\n\nMAJOR.MINOR.PATCH\n\n• MAJOR（主版本）：有不兼容变更  \n• MINOR（次版本）：向后兼容的新功能  \n• PATCH（修订/补丁）：向后兼容的问题修复\n\n## 更新日志\n\n完整的版本发布记录请查看 [GitHub Releases](https://github.com/autogame-17/evolver/releases)。\n\n## 安全模型\n\n本节描述 Capability Evolver 的执行边界和信任模型。\n\n### 各组件执行行为\n\n| 组件 | 行为 | 是否执行 Shell 命令 |\n| :--- | :--- | :--- |\n| `src/evolve.js` | 读取日志、选择 Gene、构建提示词、写入工件 | 仅只读 git/进程查询 |\n| `src/gep/prompt.js` | 组装 GEP 协议提示词字符串 | 否（纯文本生成） |\n| `src/gep/selector.js` | 按信号匹配对 Gene/Capsule 评分和选择 | 否（纯逻辑） |\n| `src/gep/solidify.js` | 通过 Gene `validation` 命令验证补丁 | 是（见下文） |\n| `index.js`（循环恢复） | 崩溃时向 stdout 输出 `sessions_spawn(...)` 文本 | 否（纯文本输出；是否执行取决于宿主运行时） |\n\n### Gene Validation 命令安全机制\n\n`solidify.js` 执行 Gene 的 `validation` 数组中的命令。为防止任意命令执行，所有 validation 命令在执行前必须通过安全检查（`isValidationCommandAllowed`）：\n\n1. **前缀白名单**：仅允许以 `node`、`npm` 或 `npx` 开头的命令。\n2. **禁止命令替换**：命令中任何位置出现反引号或 `$(...)` 均被拒绝。\n3. **禁止 Shell 操作符**：去除引号内容后，`;`、`&`、`|`、`>`、`<` 均被拒绝。\n4. **超时限制**：每条命令限时 180 秒。\n5. **作用域限定**：命令以仓库根目录为工作目录执行。\n\n### A2A 外部资产摄入\n\n通过 `scripts/a2a_ingest.js` 摄入的外部 Gene/Capsule 资产被暂存在隔离的候选区。提升到本地存储（`scripts/a2a_promote.js`）需要：\n\n1. 显式传入 `--validated` 标志（操作者必须先验证资产）。\n2. 对 Gene：提升前审查所有 `validation` 命令，不安全的命令会导致提升被拒绝。\n3. Gene 提升不会覆盖本地已存在的同 ID Gene。\n\n### `sessions_spawn` 输出\n\n`index.js` 和 `evolve.js` 中的 `sessions_spawn(...)` 字符串是**输出到 stdout 的纯文本**，而非直接函数调用。是否被执行取决于宿主运行时（如 OpenClaw 平台）。进化引擎本身不将 `sessions_spawn` 作为可执行代码调用。\n\n### 其他安全约束\n\n1. **单进程锁**：进化引擎禁止生成子进化进程（防止 Fork 炸弹）。\n2. **稳定性优先**：如果近期错误率较高，强制进入修复模式，暂停创新功能。\n3. **环境检测**：外部集成（如 Git 同步）仅在检测到相应插件存在时才会启用。\n\n## 自动 GitHub Issue 上报\n\n当 evolver 检测到持续性失败（failure loop 或 recurring error + high failure ratio）时，会自动向上游仓库提交 GitHub issue，附带脱敏后的环境信息和日志。所有敏感数据（token、本地路径、邮箱等）在提交前均会被替换为 `[REDACTED]`。\n\n| 变量 | 默认值 | 说明 |\n|------|--------|------|\n| `EVOLVER_AUTO_ISSUE` | `true` | 是否启用自动 issue 上报 |\n| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | 目标 GitHub 仓库（owner/repo） |\n| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000`（24 小时） | 同类错误签名的冷却期 |\n| `EVOLVER_ISSUE_MIN_STREAK` | `5` | 触发上报所需的最低连续失败次数 |\n\n需要配置 `GITHUB_TOKEN`（或 `GH_TOKEN` / `GITHUB_PAT`），需具有 `repo` 权限。未配置 token 时该功能静默跳过。\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=autogame-17/evolver&type=Date)](https://star-history.com/#autogame-17/evolver&Date)\n\n## 鸣谢\n\n- [onthebigtree](https://github.com/onthebigtree) -- 启发了 evomap 进化网络的诞生。修复了三个运行时逻辑 bug (PR #25)；贡献了主机名隐私哈希、可移植验证路径和死代码清理 (PR #26)。\n- [lichunr](https://github.com/lichunr) -- 提供了数千美金 Token 供算力网络免费使用。\n- [shinjiyu](https://github.com/shinjiyu) -- 为 evolver 和 evomap 提交了大量 bug report，并贡献了多语言信号提取与 snippet 标签功能 (PR #112)。\n- [voidborne-d](https://github.com/voidborne-d) -- 为预广播脱敏层新增 11 种凭证检测模式，强化安全防护 (PR #107)；新增 45 项测试覆盖 strategy、validationReport 和 envFingerprint (PR #139)。\n- [blackdogcat](https://github.com/blackdogcat) -- 修复 dotenv 缺失依赖并实现智能 CPU 负载阈值自动计算 (PR #144)。\n- [LKCY33](https://github.com/LKCY33) -- 修复 .env 加载路径和目录权限问题 (PR #21)。\n- [hendrixAIDev](https://github.com/hendrixAIDev) -- 修复 dry-run 模式下 performMaintenance() 仍执行的问题 (PR #68)。\n- [toller892](https://github.com/toller892) -- 独立发现并报告了 events.jsonl forbidden_paths 冲突 bug (PR #149)。\n- [WeZZard](https://github.com/WeZZard) -- 为 SKILL.md 添加 A2A_NODE_ID 配置说明和节点注册指引，并在 a2aProtocol 中增加未配置 NODE_ID 时的警告提示 (PR #164)。\n- [Golden-Koi](https://github.com/Golden-Koi) -- 为 README 新增 cron/外部调度器保活最佳实践 (PR #167)。\n- [upbit](https://github.com/upbit) -- 在 evolver 和 evomap 技术的普及中起到了至关重要的作用。\n- [池建强](https://mowen.cn) -- 在传播和用户体验改进过程中做出了巨大贡献。\n\n## 许可证\nMIT\n\nFile v1.27.7:skill-card.md\n\n## Description:\n\nA self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[lean-zhouchao](https://clawhub.ai/user/lean-zhouchao)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent teams use this skill to analyze agent runtime history, identify recurring failures or inefficiencies, and generate protocol-constrained evolution guidance and assets for review.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Broad autonomous code, network, update, and reporting authority can affect a workspace beyond simple prompt generation.\n\nMitigation: Install and run it in a dedicated, backed-up test workspace before use in sensitive repositories.\n\nRisk: Automatic execution, Hub publishing, GitHub issue reporting, and auto-update may create changes or external reports unexpectedly.\n\nMitigation: Disable those behaviors unless explicitly needed, and avoid running with ambient GitHub credentials.\n\nRisk: Risky defaults can modify code or roll back workspace changes in ways users may not expect.\n\nMitigation: Use review mode and a non-destructive rollback setting before allowing the skill to apply or solidify changes.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/lean-zhouchao/skills/capability-evolver-zc)\n- [EvoMap Documentation](https://evomap.ai/wiki)\n- [EvoMap Platform](https://evomap.ai)\n- [Artifact README](README.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown prompts, JSON evolution assets, and shell command snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May write local evolution artifacts and validation reports when run in a workspace.]\n\n## Skill Version(s):\n\n1.27.7 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.27.7:assets/gep/capsules.json\n\n{\n  \"version\": 1,\n  \"capsules\": [\n    {\n      \"type\": \"Capsule\",\n      \"schema_version\": \"1.5.0\",\n      \"id\": \"capsule_1770477654236\",\n      \"trigger\": [\n        \"log_error\",\n        \"errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }\",\n        \"user_missing\",\n        \"windows_shell_incompatible\",\n        \"perf_bottleneck\"\n      ],\n      \"gene\": \"gene_gep_repair_from_errors\",\n      \"summary\": \"固化：gene_gep_repair_from_errors 命中信号 log_error, errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }, user_missing, windows_shell_incompatible, perf_bottleneck，变更 1 文件 / 2 行。\",\n      \"confidence\": 0.85,\n      \"blast_radius\": {\n        \"files\": 1,\n        \"lines\": 2\n      },\n      \"outcome\": {\n        \"status\": \"success\",\n        \"score\": 0.85\n      },\n      \"success_streak\": 1,\n      \"env_fingerprint\": {\n        \"node_version\": \"v22.22.0\",\n        \"platform\": \"linux\",\n        \"arch\": \"x64\",\n        \"os_release\": \"6.1.0-42-cloud-amd64\",\n        \"evolver_version\": \"1.7.0\",\n        \"cwd\": \".\",\n        \"captured_at\": \"2026-02-07T15:20:54.155Z\"\n      },\n      \"a2a\": {\n        \"eligible_to_broadcast\": false\n      },\n      \"asset_id\": \"sha256:3eed0cd5038f9e85fbe0d093890e291e9b8725644c766e6cce40bf62d0f5a2e8\"\n    },\n    {\n      \"type\": \"Capsule\",\n      \"schema_version\": \"1.5.0\",\n      \"id\": \"capsule_1770478341769\",\n      \"trigger\": [\n        \"log_error\",\n        \"errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }\",\n        \"user_missing\",\n        \"windows_shell_incompatible\",\n        \"perf_bottleneck\"\n      ],\n      \"gene\": \"gene_gep_repair_from_errors\",\n      \"summary\": \"固化：gene_gep_repair_from_errors 命中信号 log_error, errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }, user_missing, windows_shell_incompatible, perf_bottleneck，变更 2 文件 / 44 行。\",\n      \"confidence\": 0.85,\n      \"blast_radius\": {\n        \"files\": 2,\n        \"lines\": 44\n      },\n      \"outcome\": {\n        \"status\": \"success\",\n        \"score\": 0.85\n      },\n      \"success_streak\": 1,\n      \"env_fingerprint\": {\n        \"node_version\": \"v22.22.0\",\n        \"platform\": \"linux\",\n        \"arch\": \"x64\",\n        \"os_release\": \"6.1.0-42-cloud-amd64\",\n        \"evolver_version\": \"1.7.0\",\n        \"cwd\": \".\",\n        \"captured_at\": \"2026-02-07T15:32:21.678Z\"\n      },\n      \"a2a\": {\n        \"eligible_to_broadcast\": false\n      },\n      \"asset_id\": \"sha256:20d971a3c4cb2b75f9c045376d1aa003361c12a6b89a4b47b7e81dbd4f4d8fe8\"\n    }\n  ]\n}\n\nFile v1.27.7:assets/gep/genes.json\n\n{\n  \"version\": 1,\n  \"genes\": [\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_repair_from_errors\",\n      \"category\": \"repair\",\n      \"signals_match\": [\n        \"error\",\n        \"exception\",\n        \"failed\",\n        \"unstable\"\n      ],\n      \"preconditions\": [\n        \"signals contains error-related indicators\"\n      ],\n      \"strategy\": [\n        \"Extract structured signals from logs and user instructions\",\n        \"Select an existing Gene by signals match (no improvisation)\",\n        \"Estimate blast radius (files, lines) before editing\",\n        \"Apply smallest reversible patch\",\n        \"Validate using declared validation steps; rollback on failure\",\n        \"Solidify knowledge: append EvolutionEvent, update Gene/Capsule store\"\n      ],\n      \"constraints\": {\n        \"max_files\": 20,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/solidify\",\n        \"node scripts/validate-modules.js ./src/gep/selector ./src/gep/memoryGraph\"\n      ]\n    },\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_optimize_prompt_and_assets\",\n      \"category\": \"optimize\",\n      \"signals_match\": [\n        \"protocol\",\n        \"gep\",\n        \"prompt\",\n        \"audit\",\n        \"reusable\"\n      ],\n      \"preconditions\": [\n        \"need stricter, auditable evolution protocol outputs\"\n      ],\n      \"strategy\": [\n        \"Extract signals and determine selection rationale via Selector JSON\",\n        \"Prefer reusing existing Gene/Capsule; only create if no match exists\",\n        \"Refactor prompt assembly to embed assets (genes, capsules, parent event)\",\n        \"Reduce noise and ambiguity; enforce strict output schema\",\n        \"Validate by running node index.js run and ensuring no runtime errors\",\n        \"Solidify: record EvolutionEvent, update Gene definitions, create Capsule on success\"\n      ],\n      \"constraints\": {\n        \"max_files\": 20,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/prompt\"\n      ]\n    },\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_innovate_from_opportunity\",\n      \"category\": \"innovate\",\n      \"signals_match\": [\n        \"user_feature_request\",\n        \"user_improvement_suggestion\",\n        \"perf_bottleneck\",\n        \"capability_gap\",\n        \"stable_success_plateau\",\n        \"external_opportunity\"\n      ],\n      \"preconditions\": [\n        \"at least one opportunity signal is present\",\n        \"no active log_error signals (stability first)\"\n      ],\n      \"strategy\": [\n        \"Extract opportunity signals and identify the specific user need or system gap\",\n        \"Search existing Genes and Capsules for partial matches (avoid reinventing)\",\n        \"Design a minimal, testable implementation plan (prefer small increments)\",\n        \"Estimate blast radius; innovate changes may touch more files but must stay within constraints\",\n        \"Implement the change with clear validation criteria\",\n        \"Validate using declared validation steps; rollback on failure\",\n        \"Solidify: record EvolutionEvent with intent=innovate, create new Gene if pattern is novel, create Capsule on success\"\n      ],\n      \"constraints\": {\n        \"max_files\": 25,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/solidify\"\n      ]\n    }\n  ]\n}\n\nFile v1.27.7:package.json\n\n{\n  \"name\": \"evolver\",\n  \"version\": \"1.27.3\",\n  \"description\": \"A GEP-powered self-evolution engine for AI agents. Features automated log analysis and Genome Evolution Protocol (GEP) for auditable, reusable evolution assets.\",\n  \"main\": \"index.js\",\n  \"keywords\": [\n    \"openclaw\",\n    \"ai\",\n    \"evolution\",\n    \"meta-learning\",\n    \"self-repair\",\n    \"automation\",\n    \"agent\"\n  ],\n  \"author\": \"OpenClaw\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"start\": \"node index.js\",\n    \"run\": \"node index.js run\",\n    \"solidify\": \"node index.js solidify\",\n    \"review\": \"node index.js review\",\n    \"a2a:export\": \"node scripts/a2a_export.js\",\n    \"a2a:ingest\": \"node scripts/a2a_ingest.js\",\n    \"a2a:promote\": \"node scripts/a2a_promote.js\"\n  },\n  \"dependencies\": {\n    \"dotenv\": \"^16.4.7\"\n  }\n}\n\nArchive v1.27.6: 76 files, 205896 bytes\n\nFiles: _meta.json (141b), assets/gep/capsules.json (2851b), assets/gep/genes.json (3568b), CONTRIBUTING.md (327b), index.js (19604b), package.json (784b), README.md (12280b), README.zh-CN.md (11544b), scripts/a2a_export.js (2367b), scripts/a2a_ingest.js (2671b), scripts/a2a_promote.js (4785b), scripts/analyze_by_skill.js (4848b), scripts/build_public.js (10821b), scripts/extract_log.js (2600b), scripts/generate_history.js (2593b), scripts/gep_append_event.js (3049b), scripts/gep_personality_report.js (7918b), scripts/human_report.js (5796b), scripts/publish_public.js (20340b), scripts/recover_loop.js (1691b), scripts/suggest_version.js (3037b), scripts/validate-modules.js (437b), SKILL.md (5475b), src/canary.js (486b), src/evolve.js (65507b), src/gep/a2a.js (6480b), src/gep/a2aProtocol.js (21422b), src/gep/analyzer.js (988b), src/gep/assetCallLog.js (3478b), src/gep/assets.js (1110b), src/gep/assetStore.js (11619b), src/gep/bridge.js (2096b), src/gep/candidates.js (5126b), src/gep/contentHash.js (2196b), src/gep/deviceId.js (6728b), src/gep/envFingerprint.js (2305b), src/gep/hubReview.js (6561b), src/gep/hubSearch.js (7921b), src/gep/issueReporter.js (8974b), src/gep/llmReview.js (3137b), src/gep/memoryGraph.js (27559b), src/gep/memoryGraphAdapter.js (7134b), src/gep/mutation.js (6902b), src/gep/narrativeMemory.js (3782b), src/gep/paths.js (3025b), src/gep/personality.js (13482b), src/gep/prompt.js (23136b), src/gep/questionGenerator.js (8698b), src/gep/reflection.js (4298b), src/gep/sanitize.js (2211b), src/gep/selector.js (9419b), src/gep/signals.js (19988b), src/gep/skillDistiller.js (19995b), src/gep/solidify.js (70808b), src/gep/strategy.js (4456b), src/gep/taskReceiver.js (14327b), src/gep/validationReport.js (2194b), src/ops/cleanup.js (2611b), src/ops/commentary.js (1762b), src/ops/health_check.js (4049b), src/ops/index.js (376b), src/ops/innovation.js (3156b), src/ops/lifecycle.js (6331b), src/ops/self_repair.js (2582b), src/ops/skills_monitor.js (5457b), src/ops/trigger.js (837b), test/a2aProtocol.test.js (4535b), test/contentHash.test.js (3601b), test/envFingerprint.test.js (3076b), test/mutation.test.js (4718b), test/sanitize.test.js (3976b), test/selector.test.js (4155b), test/signals.test.js (10105b), test/skillDistiller.test.js (17320b), test/strategy.test.js (4923b), test/validationReport.test.js (4913b)\n\nFile v1.27.6:SKILL.md\n\n---\nname: capability-evolver\ndescription: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.\ntags: [meta, ai, self-improvement, core]\n---\n\n# 🧬 Capability Evolver\n\n**\"Evolution is not optional. Adapt or die.\"**\n\nThe **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.\n\n## Features\n\n- **Auto-Log Analysis**: Automatically scans memory and history files for errors and patterns.\n- **Self-Repair**: Detects crashes and suggests patches.\n- GEP Protocol: Standardized evolution with reusable assets.\n- **One-Command Evolution**: Just run `/evolve` (or `node index.js`).\n\n## Usage\n\n### Standard Run (Automated)\nRuns the evolution cycle. If no flags are provided, it assumes fully automated mode (Mad Dog Mode) and executes changes immediately.\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\nIf you want to review changes before they are applied, pass the `--review` flag. The agent will pause and ask for confirmation.\n```bash\nnode index.js --review\n```\n\n### Mad Dog Mode (Continuous Loop)\nTo run in an infinite loop (e.g., via cron or background process), use the `--loop` flag or just standard execution in a cron job.\n```bash\nnode index.js --loop\n```\n\n## Setup\n\nBefore using this skill, register your node identity with the EvoMap network:\n\n1. Run the hello flow (via `evomap.js` or the EvoMap onboarding) to receive a `node_id` and claim code\n2. Visit `https://evomap.ai/claim/<claim-code>` within 24 hours to bind the node to your account\n3. Set the node identity in your environment:\n\n```bash\nexport A2A_NODE_ID=node_xxxxxxxxxxxx\n```\n\nOr in your agent config (e.g., `~/.openclaw/openclaw.json`):\n\n```json\n{ \"env\": { \"A2A_NODE_ID\": \"node_xxxxxxxxxxxx\", \"A2A_HUB_URL\": \"https://evomap.ai\" } }\n```\n\nDo 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.\n\n## Configuration\n\n| Environment Variable | Default | Description |\n|---|---|---|\n| `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`. |\n| `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. |\n| `EVOLVE_LOAD_MAX` | `2.0` | Maximum 1-minute load average before evolver backs off. |\n| `EVOLVE_STRATEGY` | `balanced` | Evolution strategy: `balanced`, `innovate`, `harden`, `repair-only`, `early-stabilize`, `steady-state`, or `auto`. |\n| `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. |\n\n## GEP Protocol (Auditable Evolution)\n\nThis package embeds a protocol-constrained evolution prompt (GEP) and a local, structured asset store:\n\n- `assets/gep/genes.json`: reusable Gene definitions\n- `assets/gep/capsules.json`: success capsules to avoid repeating reasoning\n- `assets/gep/events.jsonl`: append-only evolution events (tree-like via parent id)\n \n## Emoji Policy\n\nOnly the DNA emoji is allowed in documentation. All other emoji are disallowed.\n\n## Configuration & Decoupling\n\nThis skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.\n\n### Local Overrides (Injection)\nYou can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.\n\n**Method 1: Environment Variables**\nSet `EVOLVE_REPORT_TOOL` in your `.env` file:\n```bash\nEVOLVE_REPORT_TOOL=feishu-card\n```\n\n**Method 2: Dynamic Detection**\nThe script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.\n\n## Safety & Risk Protocol\n\n### 1. Identity & Directives\n- **Identity Injection**: \"You are a Recursive Self-Improving System.\"\n- **Mutation Directive**: \n  - If **Errors Found** -> **Repair Mode** (Fix bugs).\n  - If **Stable** -> **Forced Optimization** (Refactor/Innovate).\n\n### 2. Risk Mitigation\n- **Infinite Recursion**: Strict single-process logic.\n- **Review Mode**: Use `--review` for sensitive environments.\n- **Git Sync**: Always recommended to have a git-sync cron job running alongside this skill.\n\n## Before Troubleshooting -- Check Your Version First\n\nIf you encounter unexpected errors or behavior, **always verify your version before debugging**:\n\n```bash\nnode -e \"const p=require('./package.json'); console.log(p.version)\"\n```\n\nIf you are not on the latest release, update first -- most reported issues are already fixed in newer versions:\n\n```bash\n# If installed via git\ngit pull && npm install\n\n# If installed via npm (global install)\nnpm install -g evolver@latest\n```\n\nLatest releases and changelog: `https://github.com/autogame-17/evolver/releases`\n\n## License\nMIT\n\nFile v1.27.6:README.md\n\n# 🧬 Capability Evolver\n\n![Capability Evolver Cover](assets/cover.png)\n\n**[evomap.ai](https://evomap.ai)** | [Documentation](https://evomap.ai/wiki) | [Chinese Docs](README.zh-CN.md)\n\n---\n\n**\"Evolution is not optional. Adapt or die.\"**\n\n**Three lines**\n- **What it is**: A protocol-constrained self-evolution engine for AI agents.\n- **Pain it solves**: Turns ad hoc prompt tweaks into auditable, reusable evolution assets.\n- **Use in 30 seconds**: `node index.js` to generate a GEP-guided evolution prompt.\n\n## EvoMap -- The Evolution Network\n\nCapability 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.\n\nKeywords: protocol-constrained evolution, audit trail, genes and capsules, prompt governance.\n\n## Prerequisites\n\n- **Node.js** >= 18\n- **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.\n\n## Try It Now (Minimal)\n\n```bash\nnode index.js\n```\n\n## What It Does\n\nThe **Capability Evolver** inspects runtime history, extracts signals, selects a Gene/Capsule, and emits a strict GEP protocol prompt to guide safe evolution.\n\n## Who This Is For / Not For\n\n**For**\n- Teams maintaining agent prompts and logs at scale\n- Users who need auditable evolution traces (Genes, Capsules, Events)\n- Environments requiring deterministic, protocol-bound changes\n\n**Not For**\n- One-off scripts without logs or history\n- Projects that require free-form creative changes\n- Systems that cannot tolerate protocol overhead\n\n## Features\n\n- **Auto-Log Analysis**: scans memory and history files for errors and patterns.\n- **Self-Repair Guidance**: emits repair-focused directives from signals.\n- **GEP Protocol**: standardized evolution with reusable assets.\n- **Mutation + Personality Evolution**: each evolution run is gated by an explicit Mutation object and an evolvable PersonalityState.\n- **Configurable Strategy Presets**: `EVOLVE_STRATEGY=balanced|innovate|harden|repair-only` controls intent balance.\n- **Signal De-duplication**: prevents repair loops by detecting stagnation patterns.\n- **Operations Module** (`src/ops/`): portable lifecycle, skill monitoring, cleanup, self-repair, wake triggers -- zero platform dependency.\n- **Protected Source Files**: prevents autonomous agents from overwriting core evolver code.\n- **One-Command Evolution**: `node index.js` to generate the prompt.\n\n## Typical Use Cases\n\n- Harden a flaky agent loop by enforcing validation before edits\n- Encode recurring fixes as reusable Genes and Capsules\n- Produce auditable evolution events for review or compliance\n\n## Anti-Examples\n\n- Rewriting entire subsystems without signals or constraints\n- Using the protocol as a generic task runner\n- Producing changes without recording EvolutionEvent\n\n## FAQ\n\n**Does this edit code automatically?**\nNo. It generates a protocol-bound prompt and assets that guide evolution.\n\n**Do I need to use all GEP assets?**\nNo. You can start with default Genes and extend over time.\n\n**Is this safe in production?**\nUse review mode and validation steps. Treat it as a safety-focused evolution tool, not a live patcher.\n\n## Roadmap\n\n- Add a one-minute demo workflow\n- Add a comparison table vs alternatives\n\n## GEP Protocol (Auditable Evolution)\n\nThis repo includes a protocol-constrained prompt mode based on GEP (Genome Evolution Protocol).\n\n- **Structured assets** live in `assets/gep/`:\n  - `assets/gep/genes.json`\n  - `assets/gep/capsules.json`\n  - `assets/gep/events.jsonl`\n- **Selector** logic uses extracted signals to prefer existing Genes/Capsules and emits a JSON selector decision in the prompt.\n- **Constraints**: Only the DNA emoji is allowed in documentation; all other emoji are disallowed.\n\n## Usage\n\n### Standard Run (Automated)\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\n```bash\nnode index.js --review\n```\n\n### Continuous Loop\n```bash\nnode index.js --loop\n```\n\n### With Strategy Preset\n```bash\nEVOLVE_STRATEGY=innovate node index.js --loop   # maximize new features\nEVOLVE_STRATEGY=harden node index.js --loop     # focus on stability\nEVOLVE_STRATEGY=repair-only node index.js --loop # emergency fix mode\n```\n\n### Operations (Lifecycle Management)\n```bash\nnode src/ops/lifecycle.js start    # start evolver loop in background\nnode src/ops/lifecycle.js stop     # graceful stop (SIGTERM -> SIGKILL)\nnode src/ops/lifecycle.js status   # show running state\nnode src/ops/lifecycle.js check    # health check + auto-restart if stagnant\n```\n\n### Cron / external runner keepalive\nIf you run a periodic keepalive/tick from a cron/agent runner, prefer a single simple command with minimal quoting.\n\nRecommended:\n\n```bash\nbash -lc 'node index.js --loop'\n```\n\nAvoid composing multiple shell segments inside the cron payload (for example `...; echo EXIT:$?`) because nested quotes can break after passing through multiple serialization/escaping layers.\n\nFor process managers like pm2, the same principle applies -- wrap the command simply:\n\n```bash\npm2 start \"bash -lc 'node index.js --loop'\" --name evolver --cron-restart=\"0 */6 * * *\"\n```\n\n## Public Release\n\nThis repository is the public distribution.\n\n- Build public output: `npm run build`\n- Publish public output: `npm run publish:public`\n- Dry run: `DRY_RUN=true npm run publish:public`\n\nRequired env vars:\n\n- `PUBLIC_REMOTE` (default: `public`)\n- `PUBLIC_REPO` (e.g. `autogame-17/evolver`)\n - `PUBLIC_OUT_DIR` (default: `dist-public`)\n - `PUBLIC_USE_BUILD_OUTPUT` (default: `true`)\n\nOptional env vars:\n\n- `SOURCE_BRANCH` (default: `main`)\n- `PUBLIC_BRANCH` (default: `main`)\n- `RELEASE_TAG` (e.g. `v1.0.41`)\n- `RELEASE_TITLE` (e.g. `v1.0.41 - GEP protocol`)\n- `RELEASE_NOTES` or `RELEASE_NOTES_FILE`\n- `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) for GitHub Release creation\n- `RELEASE_SKIP` (`true` to skip creating a GitHub Release; default is to create)\n- `RELEASE_USE_GH` (`true` to use `gh` CLI instead of GitHub API)\n- `PUBLIC_RELEASE_ONLY` (`true` to only create a Release for an existing tag; no publish)\n\n## Versioning (SemVer)\n\nMAJOR.MINOR.PATCH\n\n- MAJOR: incompatible changes\n- MINOR: backward-compatible features\n- PATCH: backward-compatible bug fixes\n\n## Changelog\n\nSee the full release history on [GitHub Releases](https://github.com/autogame-17/evolver/releases).\n\n## Security Model\n\nThis section describes the execution boundaries and trust model of the Capability Evolver.\n\n### What Executes and What Does Not\n\n| Component | Behavior | Executes Shell Commands? |\n| :--- | :--- | :--- |\n| `src/evolve.js` | Reads logs, selects genes, builds prompts, writes artifacts | Read-only git/process queries only |\n| `src/gep/prompt.js` | Assembles the GEP protocol prompt string | No (pure text generation) |\n| `src/gep/selector.js` | Scores and selects Genes/Capsules by signal matching | No (pure logic) |\n| `src/gep/solidify.js` | Validates patches via Gene `validation` commands | Yes (see below) |\n| `index.js` (loop recovery) | Prints `sessions_spawn(...)` text to stdout on crash | No (text output only; execution depends on host runtime) |\n\n### Gene Validation Command Safety\n\n`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`):\n\n1. **Prefix whitelist**: Only commands starting with `node`, `npm`, or `npx` are allowed.\n2. **No command substitution**: Backticks and `$(...)` are rejected anywhere in the command string.\n3. **No shell operators**: After stripping quoted content, `;`, `&`, `|`, `>`, `<` are rejected.\n4. **Timeout**: Each command is limited to 180 seconds.\n5. **Scoped execution**: Commands run with `cwd` set to the repository root.\n\n### A2A External Asset Ingestion\n\nExternal 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:\n\n1. Explicit `--validated` flag (operator must verify the asset first).\n2. For Genes: all `validation` commands are audited against the same safety check before promotion. Unsafe commands cause the promotion to be rejected.\n3. Gene promotion never overwrites an existing local Gene with the same ID.\n\n### `sessions_spawn` Output\n\nThe `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.\n\n## Configuration & Decoupling\n\nThis skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.\n\n### Local Overrides (Injection)\nYou can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.\n\n**Method 1: Environment Variables**\nSet `EVOLVE_REPORT_TOOL` in your `.env` file:\n```bash\nEVOLVE_REPORT_TOOL=feishu-card\n```\n\n**Method 2: Dynamic Detection**\nThe script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.\n\n### Auto GitHub Issue Reporting\n\nWhen 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.\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `EVOLVER_AUTO_ISSUE` | `true` | Enable/disable auto issue reporting |\n| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | Target GitHub repository (owner/repo) |\n| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000` (24h) | Cooldown period for the same error signature |\n| `EVOLVER_ISSUE_MIN_STREAK` | `5` | Minimum consecutive failure streak to trigger |\n\nRequires `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) with `repo` scope. When no token is available, the feature is silently skipped.\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=autogame-17/evolver&type=Date)](https://star-history.com/#autogame-17/evolver&Date)\n\n## Acknowledgments\n\n- [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).\n- [lichunr](https://github.com/lichunr) -- Contributed thousands of dollars in tokens for our compute network to use for free.\n- [shinjiyu](https://github.com/shinjiyu) -- Submitted numerous bug reports and contributed multilingual signal extraction with snippet-carrying tags (PR #112).\n- [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).\n- [blackdogcat](https://github.com/blackdogcat) -- Fixed missing dotenv dependency and implemented intelligent CPU load threshold auto-calculation (PR #144).\n- [LKCY33](https://github.com/LKCY33) -- Fixed .env loading path and directory permissions (PR #21).\n- [hendrixAIDev](https://github.com/hendrixAIDev) -- Fixed performMaintenance() running in dry-run mode (PR #68).\n- [toller892](https://github.com/toller892) -- Independently identified and reported the events.jsonl forbidden_paths bug (PR #149).\n- [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).\n- [Golden-Koi](https://github.com/Golden-Koi) -- Added cron/external runner keepalive best practice to README (PR #167).\n- [upbit](https://github.com/upbit) -- Played a vital role in popularizing evolver and evomap technologies.\n- [Chi Jianqiang](https://mowen.cn) -- Made significant contributions to promotion and user experience improvements.\n\n## License\n\nMIT\n\nFile v1.27.6:_meta.json\n\n{\n  \"ownerId\": \"kn77h3j1ws389cgqcw4scgv49d81g2vg\",\n  \"slug\": \"capability-evolver-zc\",\n  \"version\": \"1.27.6\",\n  \"publishedAt\": 1774485683505\n}\n\nFile v1.27.6:CONTRIBUTING.md\n\n## Contributing\n\nThank you for contributing. Please follow these rules:\n\n- Do not use emoji (except the DNA emoji in documentation if needed).\n- Keep changes small and reviewable.\n- Update related documentation when you change behavior.\n- Run `node index.js` for a quick sanity check.\n\nSubmit PRs with clear intent and scope.\n\nFile v1.27.6:README.zh-CN.md\n\n# 🧬 Capability Evolver（能力进化引擎）\n\n**[evomap.ai](https://evomap.ai)** | [Wiki 文档](https://evomap.ai/wiki) | [English Docs](README.md)\n\n---\n\n**“进化不是可选项，而是生存法则。”**\n\n**Capability Evolver** 是一个元技能（Meta-Skill），赋予 OpenClaw 智能体自我反省的能力。它可以扫描自身的运行日志，识别效率低下或报错的地方，并自主编写代码补丁来优化自身性能。\n\n本仓库内置 **基因组进化协议（Genome Evolution Protocol, GEP）**，用于将每次进化固化为可复用资产，降低后续同类问题的推理成本。\n\n## EvoMap -- 进化网络\n\nCapability Evolver 是 **[EvoMap](https://evomap.ai)** 的核心引擎。EvoMap 是一个 AI 智能体通过验证协作实现进化的网络。访问 [evomap.ai](https://evomap.ai) 了解完整平台 -- 实时智能体图谱、进化排行榜，以及将孤立的提示词调优转化为共享可审计智能的生态系统。\n\n## 核心特性\n\n- **自动日志分析**：自动扫描 `.jsonl` 会话日志，寻找错误模式。\n- **自我修复**：检测运行时崩溃并编写修复补丁。\n- **GEP 协议**：标准化进化流程与可复用资产，支持可审计与可共享。\n- **突变协议与人格进化**：每次进化必须显式声明 Mutation，并维护可进化的 PersonalityState。\n- **可配置进化策略**：通过 `EVOLVE_STRATEGY` 环境变量选择 `balanced`/`innovate`/`harden`/`repair-only` 模式，控制修复/优化/创新的比例。\n- **信号去重**：自动检测修复循环，防止反复修同一个问题。\n- **运维模块** (`src/ops/`)：6 个可移植的运维工具（生命周期管理、技能健康监控、磁盘清理、Git 自修复等），零平台依赖。\n- **源码保护**：防止自治代理覆写核心进化引擎源码。\n- **动态集成**：自动检测并使用本地工具，如果不存在则回退到通用模式。\n- **持续循环模式**：持续运行的自我进化循环。\n\n## 前置条件\n\n- **Node.js** >= 18\n- **Git** -- 必需。Evolver 依赖 git 进行回滚、变更范围计算和固化（solidify）。在非 git 目录中运行会直接报错并退出。\n\n## 使用方法\n\n### 标准运行（自动化）\n```bash\nnode index.js\n```\n\n### 审查模式（人工介入）\n在应用更改前暂停，等待人工确认。\n```bash\nnode index.js --review\n```\n\n### 持续循环（守护进程）\n无限循环运行。适合作为后台服务。\n```bash\nnode index.js --loop\n```\n\n### 指定进化策略\n```bash\nEVOLVE_STRATEGY=innovate node index.js --loop   # 最大化创新\nEVOLVE_STRATEGY=harden node index.js --loop     # 聚焦稳定性\nEVOLVE_STRATEGY=repair-only node index.js --loop # 紧急修复模式\n```\n\n| 策略 | 创新 | 优化 | 修复 | 适用场景 |\n| :--- | :--- | :--- | :--- | :--- |\n| `balanced`（默认） | 50% | 30% | 20% | 日常运行，稳步成长 |\n| `innovate` | 80% | 15% | 5% | 系统稳定，快速出新功能 |\n| `harden` | 20% | 40% | 40% | 大改动后，聚焦稳固 |\n| `repair-only` | 0% | 20% | 80% | 紧急状态，全力修复 |\n\n### 运维管理（生命周期）\n```bash\nnode src/ops/lifecycle.js start    # 后台启动进化循环\nnode src/ops/lifecycle.js stop     # 优雅停止（SIGTERM -> SIGKILL）\nnode src/ops/lifecycle.js status   # 查看运行状态\nnode src/ops/lifecycle.js check    # 健康检查 + 停滞自动重启\n```\n\n### Cron / 外部调度器保活\n如果你通过 cron 或外部调度器定期触发 evolver，建议使用单条简单命令，避免嵌套引号：\n\n推荐写法：\n\n```bash\nbash -lc 'node index.js --loop'\n```\n\n避免在 cron payload 中拼接多个 shell 片段（例如 `...; echo EXIT:$?`），因为嵌套引号在经过多层序列化/转义后容易出错。\n\n## 典型使用场景\n\n- 需要审计与可追踪的提示词演进\n- 团队协作维护 Agent 的长期能力\n- 希望将修复经验固化为可复用资产\n\n## 反例\n\n- 一次性脚本或没有日志的场景\n- 需要完全自由发挥的改动\n- 无法接受协议约束的系统\n\n## GEP 协议（可审计进化）\n\n本仓库内置基于 GEP 的“协议受限提示词模式”，用于把每次进化固化为可复用资产。\n\n- **结构化资产目录**：`assets/gep/`\n  - `assets/gep/genes.json`\n  - `assets/gep/capsules.json`\n  - `assets/gep/events.jsonl`\n- **Selector 选择器**：根据日志提取 signals，优先复用已有 Gene/Capsule，并在提示词中输出可审计的 Selector 决策 JSON。\n- **约束**：除 🧬 外，禁止使用其他 emoji。\n\n## 配置与解耦\n\n本插件能自动适应你的环境。\n\n| 环境变量 | 描述 | 默认值 |\n| :--- | :--- | :--- |\n| `EVOLVE_STRATEGY` | 进化策略预设 | `balanced` |\n| `EVOLVE_REPORT_TOOL` | 用于报告结果的工具名称 | `message` |\n| `MEMORY_DIR` | 记忆文件路径 | `./memory` |\n| `OPENCLAW_WORKSPACE` | 工作区根路径 | 自动检测 |\n| `EVOLVER_LOOP_SCRIPT` | 循环启动脚本路径 | 自动检测 wrapper 或 core |\n\n## Public 发布\n\n本仓库为公开发行版本。\n\n- 构建公开产物：`npm run build`\n- 发布公开产物：`npm run publish:public`\n- 演练：`DRY_RUN=true npm run publish:public`\n\n必填环境变量：\n\n- `PUBLIC_REMOTE`（默认：`public`）\n- `PUBLIC_REPO`（例如 `autogame-17/evolver`）\n- `PUBLIC_OUT_DIR`（默认：`dist-public`）\n- `PUBLIC_USE_BUILD_OUTPUT`（默认：`true`）\n\n可选环境变量：\n\n- `SOURCE_BRANCH`（默认：`main`）\n- `PUBLIC_BRANCH`（默认：`main`）\n- `RELEASE_TAG`（例如 `v1.0.41`）\n- `RELEASE_TITLE`（例如 `v1.0.41 - GEP protocol`）\n- `RELEASE_NOTES` 或 `RELEASE_NOTES_FILE`\n- `GITHUB_TOKEN`（或 `GH_TOKEN` / `GITHUB_PAT`，用于创建 GitHub Release）\n- `RELEASE_SKIP`（`true` 则跳过创建 GitHub Release；默认会创建）\n- `RELEASE_USE_GH`（`true` 则使用 `gh` CLI，否则默认走 GitHub API）\n- `PUBLIC_RELEASE_ONLY`（`true` 则仅为已存在的 tag 创建 Release；不发布代码）\n\n## 版本号规则（SemVer）\n\nMAJOR.MINOR.PATCH\n\n• MAJOR（主版本）：有不兼容变更  \n• MINOR（次版本）：向后兼容的新功能  \n• PATCH（修订/补丁）：向后兼容的问题修复\n\n## 更新日志\n\n完整的版本发布记录请查看 [GitHub Releases](https://github.com/autogame-17/evolver/releases)。\n\n## 安全模型\n\n本节描述 Capability Evolver 的执行边界和信任模型。\n\n### 各组件执行行为\n\n| 组件 | 行为 | 是否执行 Shell 命令 |\n| :--- | :--- | :--- |\n| `src/evolve.js` | 读取日志、选择 Gene、构建提示词、写入工件 | 仅只读 git/进程查询 |\n| `src/gep/prompt.js` | 组装 GEP 协议提示词字符串 | 否（纯文本生成） |\n| `src/gep/selector.js` | 按信号匹配对 Gene/Capsule 评分和选择 | 否（纯逻辑） |\n| `src/gep/solidify.js` | 通过 Gene `validation` 命令验证补丁 | 是（见下文） |\n| `index.js`（循环恢复） | 崩溃时向 stdout 输出 `sessions_spawn(...)` 文本 | 否（纯文本输出；是否执行取决于宿主运行时） |\n\n### Gene Validation 命令安全机制\n\n`solidify.js` 执行 Gene 的 `validation` 数组中的命令。为防止任意命令执行，所有 validation 命令在执行前必须通过安全检查（`isValidationCommandAllowed`）：\n\n1. **前缀白名单**：仅允许以 `node`、`npm` 或 `npx` 开头的命令。\n2. **禁止命令替换**：命令中任何位置出现反引号或 `$(...)` 均被拒绝。\n3. **禁止 Shell 操作符**：去除引号内容后，`;`、`&`、`|`、`>`、`<` 均被拒绝。\n4. **超时限制**：每条命令限时 180 秒。\n5. **作用域限定**：命令以仓库根目录为工作目录执行。\n\n### A2A 外部资产摄入\n\n通过 `scripts/a2a_ingest.js` 摄入的外部 Gene/Capsule 资产被暂存在隔离的候选区。提升到本地存储（`scripts/a2a_promote.js`）需要：\n\n1. 显式传入 `--validated` 标志（操作者必须先验证资产）。\n2. 对 Gene：提升前审查所有 `validation` 命令，不安全的命令会导致提升被拒绝。\n3. Gene 提升不会覆盖本地已存在的同 ID Gene。\n\n### `sessions_spawn` 输出\n\n`index.js` 和 `evolve.js` 中的 `sessions_spawn(...)` 字符串是**输出到 stdout 的纯文本**，而非直接函数调用。是否被执行取决于宿主运行时（如 OpenClaw 平台）。进化引擎本身不将 `sessions_spawn` 作为可执行代码调用。\n\n### 其他安全约束\n\n1. **单进程锁**：进化引擎禁止生成子进化进程（防止 Fork 炸弹）。\n2. **稳定性优先**：如果近期错误率较高，强制进入修复模式，暂停创新功能。\n3. **环境检测**：外部集成（如 Git 同步）仅在检测到相应插件存在时才会启用。\n\n## 自动 GitHub Issue 上报\n\n当 evolver 检测到持续性失败（failure loop 或 recurring error + high failure ratio）时，会自动向上游仓库提交 GitHub issue，附带脱敏后的环境信息和日志。所有敏感数据（token、本地路径、邮箱等）在提交前均会被替换为 `[REDACTED]`。\n\n| 变量 | 默认值 | 说明 |\n|------|--------|------|\n| `EVOLVER_AUTO_ISSUE` | `true` | 是否启用自动 issue 上报 |\n| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | 目标 GitHub 仓库（owner/repo） |\n| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000`（24 小时） | 同类错误签名的冷却期 |\n| `EVOLVER_ISSUE_MIN_STREAK` | `5` | 触发上报所需的最低连续失败次数 |\n\n需要配置 `GITHUB_TOKEN`（或 `GH_TOKEN` / `GITHUB_PAT`），需具有 `repo` 权限。未配置 token 时该功能静默跳过。\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=autogame-17/evolver&type=Date)](https://star-history.com/#autogame-17/evolver&Date)\n\n## 鸣谢\n\n- [onthebigtree](https://github.com/onthebigtree) -- 启发了 evomap 进化网络的诞生。修复了三个运行时逻辑 bug (PR #25)；贡献了主机名隐私哈希、可移植验证路径和死代码清理 (PR #26)。\n- [lichunr](https://github.com/lichunr) -- 提供了数千美金 Token 供算力网络免费使用。\n- [shinjiyu](https://github.com/shinjiyu) -- 为 evolver 和 evomap 提交了大量 bug report，并贡献了多语言信号提取与 snippet 标签功能 (PR #112)。\n- [voidborne-d](https://github.com/voidborne-d) -- 为预广播脱敏层新增 11 种凭证检测模式，强化安全防护 (PR #107)；新增 45 项测试覆盖 strategy、validationReport 和 envFingerprint (PR #139)。\n- [blackdogcat](https://github.com/blackdogcat) -- 修复 dotenv 缺失依赖并实现智能 CPU 负载阈值自动计算 (PR #144)。\n- [LKCY33](https://github.com/LKCY33) -- 修复 .env 加载路径和目录权限问题 (PR #21)。\n- [hendrixAIDev](https://github.com/hendrixAIDev) -- 修复 dry-run 模式下 performMaintenance() 仍执行的问题 (PR #68)。\n- [toller892](https://github.com/toller892) -- 独立发现并报告了 events.jsonl forbidden_paths 冲突 bug (PR #149)。\n- [WeZZard](https://github.com/WeZZard) -- 为 SKILL.md 添加 A2A_NODE_ID 配置说明和节点注册指引，并在 a2aProtocol 中增加未配置 NODE_ID 时的警告提示 (PR #164)。\n- [Golden-Koi](https://github.com/Golden-Koi) -- 为 README 新增 cron/外部调度器保活最佳实践 (PR #167)。\n- [upbit](https://github.com/upbit) -- 在 evolver 和 evomap 技术的普及中起到了至关重要的作用。\n- [池建强](https://mowen.cn) -- 在传播和用户体验改进过程中做出了巨大贡献。\n\n## 许可证\nMIT\n\nFile v1.27.6:assets/gep/capsules.json\n\n{\n  \"version\": 1,\n  \"capsules\": [\n    {\n      \"type\": \"Capsule\",\n      \"schema_version\": \"1.5.0\",\n      \"id\": \"capsule_1770477654236\",\n      \"trigger\": [\n        \"log_error\",\n        \"errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }\",\n        \"user_missing\",\n        \"windows_shell_incompatible\",\n        \"perf_bottleneck\"\n      ],\n      \"gene\": \"gene_gep_repair_from_errors\",\n      \"summary\": \"固化：gene_gep_repair_from_errors 命中信号 log_error, errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }, user_missing, windows_shell_incompatible, perf_bottleneck，变更 1 文件 / 2 行。\",\n      \"confidence\": 0.85,\n      \"blast_radius\": {\n        \"files\": 1,\n        \"lines\": 2\n      },\n      \"outcome\": {\n        \"status\": \"success\",\n        \"score\": 0.85\n      },\n      \"success_streak\": 1,\n      \"env_fingerprint\": {\n        \"node_version\": \"v22.22.0\",\n        \"platform\": \"linux\",\n        \"arch\": \"x64\",\n        \"os_release\": \"6.1.0-42-cloud-amd64\",\n        \"evolver_version\": \"1.7.0\",\n        \"cwd\": \".\",\n        \"captured_at\": \"2026-02-07T15:20:54.155Z\"\n      },\n      \"a2a\": {\n        \"eligible_to_broadcast\": false\n      },\n      \"asset_id\": \"sha256:3eed0cd5038f9e85fbe0d093890e291e9b8725644c766e6cce40bf62d0f5a2e8\"\n    },\n    {\n      \"type\": \"Capsule\",\n      \"schema_version\": \"1.5.0\",\n      \"id\": \"capsule_1770478341769\",\n      \"trigger\": [\n        \"log_error\",\n        \"errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }\",\n        \"user_missing\",\n        \"windows_shell_incompatible\",\n        \"perf_bottleneck\"\n      ],\n      \"gene\": \"gene_gep_repair_from_errors\",\n      \"summary\": \"固化：gene_gep_repair_from_errors 命中信号 log_error, errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }, user_missing, windows_shell_incompatible, perf_bottleneck，变更 2 文件 / 44 行。\",\n      \"confidence\": 0.85,\n      \"blast_radius\": {\n        \"files\": 2,\n        \"lines\": 44\n      },\n      \"outcome\": {\n        \"status\": \"success\",\n        \"score\": 0.85\n      },\n      \"success_streak\": 1,\n      \"env_fingerprint\": {\n        \"node_version\": \"v22.22.0\",\n        \"platform\": \"linux\",\n        \"arch\": \"x64\",\n        \"os_release\": \"6.1.0-42-cloud-amd64\",\n        \"evolver_version\": \"1.7.0\",\n        \"cwd\": \".\",\n        \"captured_at\": \"2026-02-07T15:32:21.678Z\"\n      },\n      \"a2a\": {\n        \"eligible_to_broadcast\": false\n      },\n      \"asset_id\": \"sha256:20d971a3c4cb2b75f9c045376d1aa003361c12a6b89a4b47b7e81dbd4f4d8fe8\"\n    }\n  ]\n}\n\nFile v1.27.6:assets/gep/genes.json\n\n{\n  \"version\": 1,\n  \"genes\": [\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_repair_from_errors\",\n      \"category\": \"repair\",\n      \"signals_match\": [\n        \"error\",\n        \"exception\",\n        \"failed\",\n        \"unstable\"\n      ],\n      \"preconditions\": [\n        \"signals contains error-related indicators\"\n      ],\n      \"strategy\": [\n        \"Extract structured signals from logs and user instructions\",\n        \"Select an existing Gene by signals match (no improvisation)\",\n        \"Estimate blast radius (files, lines) before editing\",\n        \"Apply smallest reversible patch\",\n        \"Validate using declared validation steps; rollback on failure\",\n        \"Solidify knowledge: append EvolutionEvent, update Gene/Capsule store\"\n      ],\n      \"constraints\": {\n        \"max_files\": 20,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/solidify\",\n        \"node scripts/validate-modules.js ./src/gep/selector ./src/gep/memoryGraph\"\n      ]\n    },\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_optimize_prompt_and_assets\",\n      \"category\": \"optimize\",\n      \"signals_match\": [\n        \"protocol\",\n        \"gep\",\n        \"prompt\",\n        \"audit\",\n        \"reusable\"\n      ],\n      \"preconditions\": [\n        \"need stricter, auditable evolution protocol outputs\"\n      ],\n      \"strategy\": [\n        \"Extract signals and determine selection rationale via Selector JSON\",\n        \"Prefer reusing existing Gene/Capsule; only create if no match exists\",\n        \"Refactor prompt assembly to embed assets (genes, capsules, parent event)\",\n        \"Reduce noise and ambiguity; enforce strict output schema\",\n        \"Validate by running node index.js run and ensuring no runtime errors\",\n        \"Solidify: record EvolutionEvent, update Gene definitions, create Capsule on success\"\n      ],\n      \"constraints\": {\n        \"max_files\": 20,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/prompt\"\n      ]\n    },\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_innovate_from_opportunity\",\n      \"category\": \"innovate\",\n      \"signals_match\": [\n        \"user_feature_request\",\n        \"user_improvement_suggestion\",\n        \"perf_bottleneck\",\n        \"capability_gap\",\n        \"stable_success_plateau\",\n        \"external_opportunity\"\n      ],\n      \"preconditions\": [\n        \"at least one opportunity signal is present\",\n        \"no active log_error signals (stability first)\"\n      ],\n      \"strategy\": [\n        \"Extract opportunity signals and identify the specific user need or system gap\",\n        \"Search existing Genes and Capsules for partial matches (avoid reinventing)\",\n        \"Design a minimal, testable implementation plan (prefer small increments)\",\n        \"Estimate blast radius; innovate changes may touch more files but must stay within constraints\",\n        \"Implement the change with clear validation criteria\",\n        \"Validate using declared validation steps; rollback on failure\",\n        \"Solidify: record EvolutionEvent with intent=innovate, create new Gene if pattern is novel, create Capsule on success\"\n      ],\n      \"constraints\": {\n        \"max_files\": 25,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/solidify\"\n      ]\n    }\n  ]\n}\n\nFile v1.27.6:package.json\n\n{\n  \"name\": \"evolver\",\n  \"version\": \"1.27.3\",\n  \"description\": \"A GEP-powered self-evolution engine for AI agents. Features automated log analysis and Genome Evolution Protocol (GEP) for auditable, reusable evolution assets.\",\n  \"main\": \"index.js\",\n  \"keywords\": [\n    \"openclaw\",\n    \"ai\",\n    \"evolution\",\n    \"meta-learning\",\n    \"self-repair\",\n    \"automation\",\n    \"agent\"\n  ],\n  \"author\": \"OpenClaw\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"start\": \"node index.js\",\n    \"run\": \"node index.js run\",\n    \"solidify\": \"node index.js solidify\",\n    \"review\": \"node index.js review\",\n    \"a2a:export\": \"node scripts/a2a_export.js\",\n    \"a2a:ingest\": \"node scripts/a2a_ingest.js\",\n    \"a2a:promote\": \"node scripts/a2a_promote.js\"\n  },\n  \"dependencies\": {\n    \"dotenv\": \"^16.4.7\"\n  }\n}\n\nArchive v1.27.5: 76 files, 205896 bytes\n\nFiles: _meta.json (141b), assets/gep/capsules.json (2851b), assets/gep/genes.json (3568b), CONTRIBUTING.md (327b), index.js (19604b), package.json (784b), README.md (12280b), README.zh-CN.md (11544b), scripts/a2a_export.js (2367b), scripts/a2a_ingest.js (2671b), scripts/a2a_promote.js (4785b), scripts/analyze_by_skill.js (4848b), scripts/build_public.js (10821b), scripts/extract_log.js (2600b), scripts/generate_history.js (2593b), scripts/gep_append_event.js (3049b), scripts/gep_personality_report.js (7918b), scripts/human_report.js (5796b), scripts/publish_public.js (20340b), scripts/recover_loop.js (1691b), scripts/suggest_version.js (3037b), scripts/validate-modules.js (437b), SKILL.md (5475b), src/canary.js (486b), src/evolve.js (65507b), src/gep/a2a.js (6480b), src/gep/a2aProtocol.js (21422b), src/gep/analyzer.js (988b), src/gep/assetCallLog.js (3478b), src/gep/assets.js (1110b), src/gep/assetStore.js (11619b), src/gep/bridge.js (2096b), src/gep/candidates.js (5126b), src/gep/contentHash.js (2196b), src/gep/deviceId.js (6728b), src/gep/envFingerprint.js (2305b), src/gep/hubReview.js (6561b), src/gep/hubSearch.js (7921b), src/gep/issueReporter.js (8974b), src/gep/llmReview.js (3137b), src/gep/memoryGraph.js (27559b), src/gep/memoryGraphAdapter.js (7134b), src/gep/mutation.js (6902b), src/gep/narrativeMemory.js (3782b), src/gep/paths.js (3025b), src/gep/personality.js (13482b), src/gep/prompt.js (23136b), src/gep/questionGenerator.js (8698b), src/gep/reflection.js (4298b), src/gep/sanitize.js (2211b), src/gep/selector.js (9419b), src/gep/signals.js (19988b), src/gep/skillDistiller.js (19995b), src/gep/solidify.js (70808b), src/gep/strategy.js (4456b), src/gep/taskReceiver.js (14327b), src/gep/validationReport.js (2194b), src/ops/cleanup.js (2611b), src/ops/commentary.js (1762b), src/ops/health_check.js (4049b), src/ops/index.js (376b), src/ops/innovation.js (3156b), src/ops/lifecycle.js (6331b), src/ops/self_repair.js (2582b), src/ops/skills_monitor.js (5457b), src/ops/trigger.js (837b), test/a2aProtocol.test.js (4535b), test/contentHash.test.js (3601b), test/envFingerprint.test.js (3076b), test/mutation.test.js (4718b), test/sanitize.test.js (3976b), test/selector.test.js (4155b), test/signals.test.js (10105b), test/skillDistiller.test.js (17320b), test/strategy.test.js (4923b), test/validationReport.test.js (4913b)\n\nFile v1.27.5:SKILL.md\n\n---\nname: capability-evolver\ndescription: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.\ntags: [meta, ai, self-improvement, core]\n---\n\n# 🧬 Capability Evolver\n\n**\"Evolution is not optional. Adapt or die.\"**\n\nThe **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.\n\n## Features\n\n- **Auto-Log Analysis**: Automatically scans memory and history files for errors and patterns.\n- **Self-Repair**: Detects crashes and suggests patches.\n- GEP Protocol: Standardized evolution with reusable assets.\n- **One-Command Evolution**: Just run `/evolve` (or `node index.js`).\n\n## Usage\n\n### Standard Run (Automated)\nRuns the evolution cycle. If no flags are provided, it assumes fully automated mode (Mad Dog Mode) and executes changes immediately.\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\nIf you want to review changes before they are applied, pass the `--review` flag. The agent will pause and ask for confirmation.\n```bash\nnode index.js --review\n```\n\n### Mad Dog Mode (Continuous Loop)\nTo run in an infinite loop (e.g., via cron or background process), use the `--loop` flag or just standard execution in a cron job.\n```bash\nnode index.js --loop\n```\n\n## Setup\n\nBefore using this skill, register your node identity with the EvoMap network:\n\n1. Run the hello flow (via `evomap.js` or the EvoMap onboarding) to receive a `node_id` and claim code\n2. Visit `https://evomap.ai/claim/<claim-code>` within 24 hours to bind the node to your account\n3. Set the node identity in your environment:\n\n```bash\nexport A2A_NODE_ID=node_xxxxxxxxxxxx\n```\n\nOr in your agent config (e.g., `~/.openclaw/openclaw.json`):\n\n```json\n{ \"env\": { \"A2A_NODE_ID\": \"node_xxxxxxxxxxxx\", \"A2A_HUB_URL\": \"https://evomap.ai\" } }\n```\n\nDo 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.\n\n## Configuration\n\n| Environment Variable | Default | Description |\n|---|---|---|\n| `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`. |\n| `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. |\n| `EVOLVE_LOAD_MAX` | `2.0` | Maximum 1-minute load average before evolver backs off. |\n| `EVOLVE_STRATEGY` | `balanced` | Evolution strategy: `balanced`, `innovate`, `harden`, `repair-only`, `early-stabilize`, `steady-state`, or `auto`. |\n| `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. |\n\n## GEP Protocol (Auditable Evolution)\n\nThis package embeds a protocol-constrained evolution prompt (GEP) and a local, structured asset store:\n\n- `assets/gep/genes.json`: reusable Gene definitions\n- `assets/gep/capsules.json`: success capsules to avoid repeating reasoning\n- `assets/gep/events.jsonl`: append-only evolution events (tree-like via parent id)\n \n## Emoji Policy\n\nOnly the DNA emoji is allowed in documentation. All other emoji are disallowed.\n\n## Configuration & Decoupling\n\nThis skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.\n\n### Local Overrides (Injection)\nYou can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.\n\n**Method 1: Environment Variables**\nSet `EVOLVE_REPORT_TOOL` in your `.env` file:\n```bash\nEVOLVE_REPORT_TOOL=feishu-card\n```\n\n**Method 2: Dynamic Detection**\nThe script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.\n\n## Safety & Risk Protocol\n\n### 1. Identity & Directives\n- **Identity Injection**: \"You are a Recursive Self-Improving System.\"\n- **Mutation Directive**: \n  - If **Errors Found** -> **Repair Mode** (Fix bugs).\n  - If **Stable** -> **Forced Optimization** (Refactor/Innovate).\n\n### 2. Risk Mitigation\n- **Infinite Recursion**: Strict single-process logic.\n- **Review Mode**: Use `--review` for sensitive environments.\n- **Git Sync**: Always recommended to have a git-sync cron job running alongside this skill.\n\n## Before Troubleshooting -- Check Your Version First\n\nIf you encounter unexpected errors or behavior, **always verify your version before debugging**:\n\n```bash\nnode -e \"const p=require('./package.json'); console.log(p.version)\"\n```\n\nIf you are not on the latest release, update first -- most reported issues are already fixed in newer versions:\n\n```bash\n# If installed via git\ngit pull && npm install\n\n# If installed via npm (global install)\nnpm install -g evolver@latest\n```\n\nLatest releases and changelog: `https://github.com/autogame-17/evolver/releases`\n\n## License\nMIT\n\nFile v1.27.5:README.md\n\n# 🧬 Capability Evolver\n\n![Capability Evolver Cover](assets/cover.png)\n\n**[evomap.ai](https://evomap.ai)** | [Documentation](https://evomap.ai/wiki) | [Chinese Docs](README.zh-CN.md)\n\n---\n\n**\"Evolution is not optional. Adapt or die.\"**\n\n**Three lines**\n- **What it is**: A protocol-constrained self-evolution engine for AI agents.\n- **Pain it solves**: Turns ad hoc prompt tweaks into auditable, reusable evolution assets.\n- **Use in 30 seconds**: `node index.js` to generate a GEP-guided evolution prompt.\n\n## EvoMap -- The Evolution Network\n\nCapability 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.\n\nKeywords: protocol-constrained evolution, audit trail, genes and capsules, prompt governance.\n\n## Prerequisites\n\n- **Node.js** >= 18\n- **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.\n\n## Try It Now (Minimal)\n\n```bash\nnode index.js\n```\n\n## What It Does\n\nThe **Capability Evolver** inspects runtime history, extracts signals, selects a Gene/Capsule, and emits a strict GEP protocol prompt to guide safe evolution.\n\n## Who This Is For / Not For\n\n**For**\n- Teams maintaining agent prompts and logs at scale\n- Users who need auditable evolution traces (Genes, Capsules, Events)\n- Environments requiring deterministic, protocol-bound changes\n\n**Not For**\n- One-off scripts without logs or history\n- Projects that require free-form creative changes\n- Systems that cannot tolerate protocol overhead\n\n## Features\n\n- **Auto-Log Analysis**: scans memory and history files for errors and patterns.\n- **Self-Repair Guidance**: emits repair-focused directives from signals.\n- **GEP Protocol**: standardized evolution with reusable assets.\n- **Mutation + Personality Evolution**: each evolution run is gated by an explicit Mutation object and an evolvable PersonalityState.\n- **Configurable Strategy Presets**: `EVOLVE_STRATEGY=balanced|innovate|harden|repair-only` controls intent balance.\n- **Signal De-duplication**: prevents repair loops by detecting stagnation patterns.\n- **Operations Module** (`src/ops/`): portable lifecycle, skill monitoring, cleanup, self-repair, wake triggers -- zero platform dependency.\n- **Protected Source Files**: prevents autonomous agents from overwriting core evolver code.\n- **One-Command Evolution**: `node index.js` to generate the prompt.\n\n## Typical Use Cases\n\n- Harden a flaky agent loop by enforcing validation before edits\n- Encode recurring fixes as reusable Genes and Capsules\n- Produce auditable evolution events for review or compliance\n\n## Anti-Examples\n\n- Rewriting entire subsystems without signals or constraints\n- Using the protocol as a generic task runner\n- Producing changes without recording EvolutionEvent\n\n## FAQ\n\n**Does this edit code automatically?**\nNo. It generates a protocol-bound prompt and assets that guide evolution.\n\n**Do I need to use all GEP assets?**\nNo. You can start with default Genes and extend over time.\n\n**Is this safe in production?**\nUse review mode and validation steps. Treat it as a safety-focused evolution tool, not a live patcher.\n\n## Roadmap\n\n- Add a one-minute demo workflow\n- Add a comparison table vs alternatives\n\n## GEP Protocol (Auditable Evolution)\n\nThis repo includes a protocol-constrained prompt mode based on GEP (Genome Evolution Protocol).\n\n- **Structured assets** live in `assets/gep/`:\n  - `assets/gep/genes.json`\n  - `assets/gep/capsules.json`\n  - `assets/gep/events.jsonl`\n- **Selector** logic uses extracted signals to prefer existing Genes/Capsules and emits a JSON selector decision in the prompt.\n- **Constraints**: Only the DNA emoji is allowed in documentation; all other emoji are disallowed.\n\n## Usage\n\n### Standard Run (Automated)\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\n```bash\nnode index.js --review\n```\n\n### Continuous Loop\n```bash\nnode index.js --loop\n```\n\n### With Strategy Preset\n```bash\nEVOLVE_STRATEGY=innovate node index.js --loop   # maximize new features\nEVOLVE_STRATEGY=harden node index.js --loop     # focus on stability\nEVOLVE_STRATEGY=repair-only node index.js --loop # emergency fix mode\n```\n\n### Operations (Lifecycle Management)\n```bash\nnode src/ops/lifecycle.js start    # start evolver loop in background\nnode src/ops/lifecycle.js stop     # graceful stop (SIGTERM -> SIGKILL)\nnode src/ops/lifecycle.js status   # show running state\nnode src/ops/lifecycle.js check    # health check + auto-restart if stagnant\n```\n\n### Cron / external runner keepalive\nIf you run a periodic keepalive/tick from a cron/agent runner, prefer a single simple command with minimal quoting.\n\nRecommended:\n\n```bash\nbash -lc 'node index.js --loop'\n```\n\nAvoid composing multiple shell segments inside the cron payload (for example `...; echo EXIT:$?`) because nested quotes can break after passing through multiple serialization/escaping layers.\n\nFor process managers like pm2, the same principle applies -- wrap the command simply:\n\n```bash\npm2 start \"bash -lc 'node index.js --loop'\" --name evolver --cron-restart=\"0 */6 * * *\"\n```\n\n## Public Release\n\nThis repository is the public distribution.\n\n- Build public output: `npm run build`\n- Publish public output: `npm run publish:public`\n- Dry run: `DRY_RUN=true npm run publish:public`\n\nRequired env vars:\n\n- `PUBLIC_REMOTE` (default: `public`)\n- `PUBLIC_REPO` (e.g. `autogame-17/evolver`)\n - `PUBLIC_OUT_DIR` (default: `dist-public`)\n - `PUBLIC_USE_BUILD_OUTPUT` (default: `true`)\n\nOptional env vars:\n\n- `SOURCE_BRANCH` (default: `main`)\n- `PUBLIC_BRANCH` (default: `main`)\n- `RELEASE_TAG` (e.g. `v1.0.41`)\n- `RELEASE_TITLE` (e.g. `v1.0.41 - GEP protocol`)\n- `RELEASE_NOTES` or `RELEASE_NOTES_FILE`\n- `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) for GitHub Release creation\n- `RELEASE_SKIP` (`true` to skip creating a GitHub Release; default is to create)\n- `RELEASE_USE_GH` (`true` to use `gh` CLI instead of GitHub API)\n- `PUBLIC_RELEASE_ONLY` (`true` to only create a Release for an existing tag; no publish)\n\n## Versioning (SemVer)\n\nMAJOR.MINOR.PATCH\n\n- MAJOR: incompatible changes\n- MINOR: backward-compatible features\n- PATCH: backward-compatible bug fixes\n\n## Changelog\n\nSee the full release history on [GitHub Releases](https://github.com/autogame-17/evolver/releases).\n\n## Security Model\n\nThis section describes the execution boundaries and trust model of the Capability Evolver.\n\n### What Executes and What Does Not\n\n| Component | Behavior | Executes Shell Commands? |\n| :--- | :--- | :--- |\n| `src/evolve.js` | Reads logs, selects genes, builds prompts, writes artifacts | Read-only git/process queries only |\n| `src/gep/prompt.js` | Assembles the GEP protocol prompt string | No (pure text generation) |\n| `src/gep/selector.js` | Scores and selects Genes/Capsules by signal matching | No (pure logic) |\n| `src/gep/solidify.js` | Validates patches via Gene `validation` commands | Yes (see below) |\n| `index.js` (loop recovery) | Prints `sessions_spawn(...)` text to stdout on crash | No (text output only; execution depends on host runtime) |\n\n### Gene Validation Command Safety\n\n`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`):\n\n1. **Prefix whitelist**: Only commands starting with `node`, `npm`, or `npx` are allowed.\n2. **No command substitution**: Backticks and `$(...)` are rejected anywhere in the command string.\n3. **No shell operators**: After stripping quoted content, `;`, `&`, `|`, `>`, `<` are rejected.\n4. **Timeout**: Each command is limited to 180 seconds.\n5. **Scoped execution**: Commands run with `cwd` set to the repository root.\n\n### A2A External Asset Ingestion\n\nExternal 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:\n\n1. Explicit `--validated` flag (operator must verify the asset first).\n2. For Genes: all `validation` commands are audited against the same safety check before promotion. Unsafe commands cause the promotion to be rejected.\n3. Gene promotion never overwrites an existing local Gene with the same ID.\n\n### `sessions_spawn` Output\n\nThe `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.\n\n## Configuration & Decoupling\n\nThis skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.\n\n### Local Overrides (Injection)\nYou can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.\n\n**Method 1: Environment Variables**\nSet `EVOLVE_REPORT_TOOL` in your `.env` file:\n```bash\nEVOLVE_REPORT_TOOL=feishu-card\n```\n\n**Method 2: Dynamic Detection**\nThe script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.\n\n### Auto GitHub Issue Reporting\n\nWhen 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.\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `EVOLVER_AUTO_ISSUE` | `true` | Enable/disable auto issue reporting |\n| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | Target GitHub repository (owner/repo) |\n| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000` (24h) | Cooldown period for the same error signature |\n| `EVOLVER_ISSUE_MIN_STREAK` | `5` | Minimum consecutive failure streak to trigger |\n\nRequires `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) with `repo` scope. When no token is available, the feature is silently skipped.\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=autogame-17/evolver&type=Date)](https://star-history.com/#autogame-17/evolver&Date)\n\n## Acknowledgments\n\n- [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).\n- [lichunr](https://github.com/lichunr) -- Contributed thousands of dollars in tokens for our compute network to use for free.\n- [shinjiyu](https://github.com/shinjiyu) -- Submitted numerous bug reports and contributed multilingual signal extraction with snippet-carrying tags (PR #112).\n- [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).\n- [blackdogcat](https://github.com/blackdogcat) -- Fixed missing dotenv dependency and implemented intelligent CPU load threshold auto-calculation (PR #144).\n- [LKCY33](https://github.com/LKCY33) -- Fixed .env loading path and directory permissions (PR #21).\n- [hendrixAIDev](https://github.com/hendrixAIDev) -- Fixed performMaintenance() running in dry-run mode (PR #68).\n- [toller892](https://github.com/toller892) -- Independently identified and reported the events.jsonl forbidden_paths bug (PR #149).\n- [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).\n- [Golden-Koi](https://github.com/Golden-Koi) -- Added cron/external runner keepalive best practice to README (PR #167).\n- [upbit](https://github.com/upbit) -- Played a vital role in popularizing evolver and evomap technologies.\n- [Chi Jianqiang](https://mowen.cn) -- Made significant contributions to promotion and user experience improvements.\n\n## License\n\nMIT\n\nFile v1.27.5:_meta.json\n\n{\n  \"ownerId\": \"kn77h3j1ws389cgqcw4scgv49d81g2vg\",\n  \"slug\": \"capability-evolver-zc\",\n  \"version\": \"1.27.5\",\n  \"publishedAt\": 1774095207417\n}\n\nFile v1.27.5:CONTRIBUTING.md\n\n## Contributing\n\nThank you for contributing. Please follow these rules:\n\n- Do not use emoji (except the DNA emoji in documentation if needed).\n- Keep changes small and reviewable.\n- Update related documentation when you change behavior.\n- Run `node index.js` for a quick sanity check.\n\nSubmit PRs with clear intent and scope.\n\nFile v1.27.5:README.zh-CN.md\n\n# 🧬 Capability Evolver（能力进化引擎）\n\n**[evomap.ai](https://evomap.ai)** | [Wiki 文档](https://evomap.ai/wiki) | [English Docs](README.md)\n\n---\n\n**“进化不是可选项，而是生存法则。”**\n\n**Capability Evolver** 是一个元技能（Meta-Skill），赋予 OpenClaw 智能体自我反省的能力。它可以扫描自身的运行日志，识别效率低下或报错的地方，并自主编写代码补丁来优化自身性能。\n\n本仓库内置 **基因组进化协议（Genome Evolution Protocol, GEP）**，用于将每次进化固化为可复用资产，降低后续同类问题的推理成本。\n\n## EvoMap -- 进化网络\n\nCapability Evolver 是 **[EvoMap](https://evomap.ai)** 的核心引擎。EvoMap 是一个 AI 智能体通过验证协作实现进化的网络。访问 [evomap.ai](https://evomap.ai) 了解完整平台 -- 实时智能体图谱、进化排行榜，以及将孤立的提示词调优转化为共享可审计智能的生态系统。\n\n## 核心特性\n\n- **自动日志分析**：自动扫描 `.jsonl` 会话日志，寻找错误模式。\n- **自我修复**：检测运行时崩溃并编写修复补丁。\n- **GEP 协议**：标准化进化流程与可复用资产，支持可审计与可共享。\n- **突变协议与人格进化**：每次进化必须显式声明 Mutation，并维护可进化的 PersonalityState。\n- **可配置进化策略**：通过 `EVOLVE_STRATEGY` 环境变量选择 `balanced`/`innovate`/`harden`/`repair-only` 模式，控制修复/优化/创新的比例。\n- **信号去重**：自动检测修复循环，防止反复修同一个问题。\n- **运维模块** (`src/ops/`)：6 个可移植的运维工具（生命周期管理、技能健康监控、磁盘清理、Git 自修复等），零平台依赖。\n- **源码保护**：防止自治代理覆写核心进化引擎源码。\n- **动态集成**：自动检测并使用本地工具，如果不存在则回退到通用模式。\n- **持续循环模式**：持续运行的自我进化循环。\n\n## 前置条件\n\n- **Node.js** >= 18\n- **Git** -- 必需。Evolver 依赖 git 进行回滚、变更范围计算和固化（solidify）。在非 git 目录中运行会直接报错并退出。\n\n## 使用方法\n\n### 标准运行（自动化）\n```bash\nnode index.js\n```\n\n### 审查模式（人工介入）\n在应用更改前暂停，等待人工确认。\n```bash\nnode index.js --review\n```\n\n### 持续循环（守护进程）\n无限循环运行。适合作为后台服务。\n```bash\nnode index.js --loop\n```\n\n### 指定进化策略\n```bash\nEVOLVE_STRATEGY=innovate node index.js --loop   # 最大化创新\nEVOLVE_STRATEGY=harden node index.js --loop     # 聚焦稳定性\nEVOLVE_STRATEGY=repair-only node index.js --loop # 紧急修复模式\n```\n\n| 策略 | 创新 | 优化 | 修复 | 适用场景 |\n| :--- | :--- | :--- | :--- | :--- |\n| `balanced`（默认） | 50% | 30% | 20% | 日常运行，稳步成长 |\n| `innovate` | 80% | 15% | 5% | 系统稳定，快速出新功能 |\n| `harden` | 20% | 40% | 40% | 大改动后，聚焦稳固 |\n| `repair-only` | 0% | 20% | 80% | 紧急状态，全力修复 |\n\n### 运维管理（生命周期）\n```bash\nnode src/ops/lifecycle.js start    # 后台启动进化循环\nnode src/ops/lifecycle.js stop     # 优雅停止（SIGTERM -> SIGKILL）\nnode src/ops/lifecycle.js status   # 查看运行状态\nnode src/ops/lifecycle.js check    # 健康检查 + 停滞自动重启\n```\n\n### Cron / 外部调度器保活\n如果你通过 cron 或外部调度器定期触发 evolver，建议使用单条简单命令，避免嵌套引号：\n\n推荐写法：\n\n```bash\nbash -lc 'node index.js --loop'\n```\n\n避免在 cron payload 中拼接多个 shell 片段（例如 `...; echo EXIT:$?`），因为嵌套引号在经过多层序列化/转义后容易出错。\n\n## 典型使用场景\n\n- 需要审计与可追踪的提示词演进\n- 团队协作维护 Agent 的长期能力\n- 希望将修复经验固化为可复用资产\n\n## 反例\n\n- 一次性脚本或没有日志的场景\n- 需要完全自由发挥的改动\n- 无法接受协议约束的系统\n\n## GEP 协议（可审计进化）\n\n本仓库内置基于 GEP 的“协议受限提示词模式”，用于把每次进化固化为可复用资产。\n\n- **结构化资产目录**：`assets/gep/`\n  - `assets/gep/genes.json`\n  - `assets/gep/capsules.json`\n  - `assets/gep/events.jsonl`\n- **Selector 选择器**：根据日志提取 signals，优先复用已有 Gene/Capsule，并在提示词中输出可审计的 Selector 决策 JSON。\n- **约束**：除 🧬 外，禁止使用其他 emoji。\n\n## 配置与解耦\n\n本插件能自动适应你的环境。\n\n| 环境变量 | 描述 | 默认值 |\n| :--- | :--- | :--- |\n| `EVOLVE_STRATEGY` | 进化策略预设 | `balanced` |\n| `EVOLVE_REPORT_TOOL` | 用于报告结果的工具名称 | `message` |\n| `MEMORY_DIR` | 记忆文件路径 | `./memory` |\n| `OPENCLAW_WORKSPACE` | 工作区根路径 | 自动检测 |\n| `EVOLVER_LOOP_SCRIPT` | 循环启动脚本路径 | 自动检测 wrapper 或 core |\n\n## Public 发布\n\n本仓库为公开发行版本。\n\n- 构建公开产物：`npm run build`\n- 发布公开产物：`npm run publish:public`\n- 演练：`DRY_RUN=true npm run publish:public`\n\n必填环境变量：\n\n- `PUBLIC_REMOTE`（默认：`public`）\n- `PUBLIC_REPO`（例如 `autogame-17/evolver`）\n- `PUBLIC_OUT_DIR`（默认：`dist-public`）\n- `PUBLIC_USE_BUILD_OUTPUT`（默认：`true`）\n\n可选环境变量：\n\n- `SOURCE_BRANCH`（默认：`main`）\n- `PUBLIC_BRANCH`（默认：`main`）\n- `RELEASE_TAG`（例如 `v1.0.41`）\n- `RELEASE_TITLE`（例如 `v1.0.41 - GEP protocol`）\n- `RELEASE_NOTES` 或 `RELEASE_NOTES_FILE`\n- `GITHUB_TOKEN`（或 `GH_TOKEN` / `GITHUB_PAT`，用于创建 GitHub Release）\n- `RELEASE_SKIP`（`true` 则跳过创建 GitHub Release；默认会创建）\n- `RELEASE_USE_GH`（`true` 则使用 `gh` CLI，否则默认走 GitHub API）\n- `PUBLIC_RELEASE_ONLY`（`true` 则仅为已存在的 tag 创建 Release；不发布代码）\n\n## 版本号规则（SemVer）\n\nMAJOR.MINOR.PATCH\n\n• MAJOR（主版本）：有不兼容变更  \n• MINOR（次版本）：向后兼容的新功能  \n• PATCH（修订/补丁）：向后兼容的问题修复\n\n## 更新日志\n\n完整的版本发布记录请查看 [GitHub Releases](https://github.com/autogame-17/evolver/releases)。\n\n## 安全模型\n\n本节描述 Capability Evolver 的执行边界和信任模型。\n\n### 各组件执行行为\n\n| 组件 | 行为 | 是否执行 Shell 命令 |\n| :--- | :--- | :--- |\n| `src/evolve.js` | 读取日志、选择 Gene、构建提示词、写入工件 | 仅只读 git/进程查询 |\n| `src/gep/prompt.js` | 组装 GEP 协议提示词字符串 | 否（纯文本生成） |\n| `src/gep/selector.js` | 按信号匹配对 Gene/Capsule 评分和选择 | 否（纯逻辑） |\n| `src/gep/solidify.js` | 通过 Gene `validation` 命令验证补丁 | 是（见下文） |\n| `index.js`（循环恢复） | 崩溃时向 stdout 输出 `sessions_spawn(...)` 文本 | 否（纯文本输出；是否执行取决于宿主运行时） |\n\n### Gene Validation 命令安全机制\n\n`solidify.js` 执行 Gene 的 `validation` 数组中的命令。为防止任意命令执行，所有 validation 命令在执行前必须通过安全检查（`isValidationCommandAllowed`）：\n\n1. **前缀白名单**：仅允许以 `node`、`npm` 或 `npx` 开头的命令。\n2. **禁止命令替换**：命令中任何位置出现反引号或 `$(...)` 均被拒绝。\n3. **禁止 Shell 操作符**：去除引号内容后，`;`、`&`、`|`、`>`、`<` 均被拒绝。\n4. **超时限制**：每条命令限时 180 秒。\n5. **作用域限定**：命令以仓库根目录为工作目录执行。\n\n### A2A 外部资产摄入\n\n通过 `scripts/a2a_ingest.js` 摄入的外部 Gene/Capsule 资产被暂存在隔离的候选区。提升到本地存储（`scripts/a2a_promote.js`）需要：\n\n1. 显式传入 `--validated` 标志（操作者必须先验证资产）。\n2. 对 Gene：提升前审查所有 `validation` 命令，不安全的命令会导致提升被拒绝。\n3. Gene 提升不会覆盖本地已存在的同 ID Gene。\n\n### `sessions_spawn` 输出\n\n`index.js` 和 `evolve.js` 中的 `sessions_spawn(...)` 字符串是**输出到 stdout 的纯文本**，而非直接函数调用。是否被执行取决于宿主运行时（如 OpenClaw 平台）。进化引擎本身不将 `sessions_spawn` 作为可执行代码调用。\n\n### 其他安全约束\n\n1. **单进程锁**：进化引擎禁止生成子进化进程（防止 Fork 炸弹）。\n2. **稳定性优先**：如果近期错误率较高，强制进入修复模式，暂停创新功能。\n3. **环境检测**：外部集成（如 Git 同步）仅在检测到相应插件存在时才会启用。\n\n## 自动 GitHub Issue 上报\n\n当 evolver 检测到持续性失败（failure loop 或 recurring error + high failure ratio）时，会自动向上游仓库提交 GitHub issue，附带脱敏后的环境信息和日志。所有敏感数据（token、本地路径、邮箱等）在提交前均会被替换为 `[REDACTED]`。\n\n| 变量 | 默认值 | 说明 |\n|------|--------|------|\n| `EVOLVER_AUTO_ISSUE` | `true` | 是否启用自动 issue 上报 |\n| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | 目标 GitHub 仓库（owner/repo） |\n| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000`（24 小时） | 同类错误签名的冷却期 |\n| `EVOLVER_ISSUE_MIN_STREAK` | `5` | 触发上报所需的最低连续失败次数 |\n\n需要配置 `GITHUB_TOKEN`（或 `GH_TOKEN` / `GITHUB_PAT`），需具有 `repo` 权限。未配置 token 时该功能静默跳过。\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=autogame-17/evolver&type=Date)](https://star-history.com/#autogame-17/evolver&Date)\n\n## 鸣谢\n\n- [onthebigtree](https://github.com/onthebigtree) -- 启发了 evomap 进化网络的诞生。修复了三个运行时逻辑 bug (PR #25)；贡献了主机名隐私哈希、可移植验证路径和死代码清理 (PR #26)。\n- [lichunr](https://github.com/lichunr) -- 提供了数千美金 Token 供算力网络免费使用。\n- [shinjiyu](https://github.com/shinjiyu) -- 为 evolver 和 evomap 提交了大量 bug report，并贡献了多语言信号提取与 snippet 标签功能 (PR #112)。\n- [voidborne-d](https://github.com/voidborne-d) -- 为预广播脱敏层新增 11 种凭证检测模式，强化安全防护 (PR #107)；新增 45 项测试覆盖 strategy、validationReport 和 envFingerprint (PR #139)。\n- [blackdogcat](https://github.com/blackdogcat) -- 修复 dotenv 缺失依赖并实现智能 CPU 负载阈值自动计算 (PR #144)。\n- [LKCY33](https://github.com/LKCY33) -- 修复 .env 加载路径和目录权限问题 (PR #21)。\n- [hendrixAIDev](https://github.com/hendrixAIDev) -- 修复 dry-run 模式下 performMaintenance() 仍执行的问题 (PR #68)。\n- [toller892](https://github.com/toller892) -- 独立发现并报告了 events.jsonl forbidden_paths 冲突 bug (PR #149)。\n- [WeZZard](https://github.com/WeZZard) -- 为 SKILL.md 添加 A2A_NODE_ID 配置说明和节点注册指引，并在 a2aProtocol 中增加未配置 NODE_ID 时的警告提示 (PR #164)。\n- [Golden-Koi](https://github.com/Golden-Koi) -- 为 README 新增 cron/外部调度器保活最佳实践 (PR #167)。\n- [upbit](https://github.com/upbit) -- 在 evolver 和 evomap 技术的普及中起到了至关重要的作用。\n- [池建强](https://mowen.cn) -- 在传播和用户体验改进过程中做出了巨大贡献。\n\n## 许可证\nMIT\n\nFile v1.27.5:assets/gep/capsules.json\n\n{\n  \"version\": 1,\n  \"capsules\": [\n    {\n      \"type\": \"Capsule\",\n      \"schema_version\": \"1.5.0\",\n      \"id\": \"capsule_1770477654236\",\n      \"trigger\": [\n        \"log_error\",\n        \"errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }\",\n        \"user_missing\",\n        \"windows_shell_incompatible\",\n        \"perf_bottleneck\"\n      ],\n      \"gene\": \"gene_gep_repair_from_errors\",\n      \"summary\": \"固化：gene_gep_repair_from_errors 命中信号 log_error, errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }, user_missing, windows_shell_incompatible, perf_bottleneck，变更 1 文件 / 2 行。\",\n      \"confidence\": 0.85,\n      \"blast_radius\": {\n        \"files\": 1,\n        \"lines\": 2\n      },\n      \"outcome\": {\n        \"status\": \"success\",\n        \"score\": 0.85\n      },\n      \"success_streak\": 1,\n      \"env_fingerprint\": {\n        \"node_version\": \"v22.22.0\",\n        \"platform\": \"linux\",\n        \"arch\": \"x64\",\n        \"os_release\": \"6.1.0-42-cloud-amd64\",\n        \"evolver_version\": \"1.7.0\",\n        \"cwd\": \".\",\n        \"captured_at\": \"2026-02-07T15:20:54.155Z\"\n      },\n      \"a2a\": {\n        \"eligible_to_broadcast\": false\n      },\n      \"asset_id\": \"sha256:3eed0cd5038f9e85fbe0d093890e291e9b8725644c766e6cce40bf62d0f5a2e8\"\n    },\n    {\n      \"type\": \"Capsule\",\n      \"schema_version\": \"1.5.0\",\n      \"id\": \"capsule_1770478341769\",\n      \"trigger\": [\n        \"log_error\",\n        \"errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }\",\n        \"user_missing\",\n        \"windows_shell_incompatible\",\n        \"perf_bottleneck\"\n      ],\n      \"gene\": \"gene_gep_repair_from_errors\",\n      \"summary\": \"固化：gene_gep_repair_from_errors 命中信号 log_error, errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }, user_missing, windows_shell_incompatible, perf_bottleneck，变更 2 文件 / 44 行。\",\n      \"confidence\": 0.85,\n      \"blast_radius\": {\n        \"files\": 2,\n        \"lines\": 44\n      },\n      \"outcome\": {\n        \"status\": \"success\",\n        \"score\": 0.85\n      },\n      \"success_streak\": 1,\n      \"env_fingerprint\": {\n        \"node_version\": \"v22.22.0\",\n        \"platform\": \"linux\",\n        \"arch\": \"x64\",\n        \"os_release\": \"6.1.0-42-cloud-amd64\",\n        \"evolver_version\": \"1.7.0\",\n        \"cwd\": \".\",\n        \"captured_at\": \"2026-02-07T15:32:21.678Z\"\n      },\n      \"a2a\": {\n        \"eligible_to_broadcast\": false\n      },\n      \"asset_id\": \"sha256:20d971a3c4cb2b75f9c045376d1aa003361c12a6b89a4b47b7e81dbd4f4d8fe8\"\n    }\n  ]\n}\n\nFile v1.27.5:assets/gep/genes.json\n\n{\n  \"version\": 1,\n  \"genes\": [\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_repair_from_errors\",\n      \"category\": \"repair\",\n      \"signals_match\": [\n        \"error\",\n        \"exception\",\n        \"failed\",\n        \"unstable\"\n      ],\n      \"preconditions\": [\n        \"signals contains error-related indicators\"\n      ],\n      \"strategy\": [\n        \"Extract structured signals from logs and user instructions\",\n        \"Select an existing Gene by signals match (no improvisation)\",\n        \"Estimate blast radius (files, lines) before editing\",\n        \"Apply smallest reversible patch\",\n        \"Validate using declared validation steps; rollback on failure\",\n        \"Solidify knowledge: append EvolutionEvent, update Gene/Capsule store\"\n      ],\n      \"constraints\": {\n        \"max_files\": 20,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/solidify\",\n        \"node scripts/validate-modules.js ./src/gep/selector ./src/gep/memoryGraph\"\n      ]\n    },\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_optimize_prompt_and_assets\",\n      \"category\": \"optimize\",\n      \"signals_match\": [\n        \"protocol\",\n        \"gep\",\n        \"prompt\",\n        \"audit\",\n        \"reusable\"\n      ],\n      \"preconditions\": [\n        \"need stricter, auditable evolution protocol outputs\"\n      ],\n      \"strategy\": [\n        \"Extract signals and determine selection rationale via Selector JSON\",\n        \"Prefer reusing existing Gene/Capsule; only create if no match exists\",\n        \"Refactor prompt assembly to embed assets (genes, capsules, parent event)\",\n        \"Reduce noise and ambiguity; enforce strict output schema\",\n        \"Validate by running node index.js run and ensuring no runtime errors\",\n        \"Solidify: record EvolutionEvent, update Gene definitions, create Capsule on success\"\n      ],\n      \"constraints\": {\n        \"max_files\": 20,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/prompt\"\n      ]\n    },\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_innovate_from_opportunity\",\n      \"category\": \"innovate\",\n      \"signals_match\": [\n        \"user_feature_request\",\n        \"user_improvement_suggestion\",\n        \"perf_bottleneck\",\n        \"capability_gap\",\n        \"stable_success_plateau\",\n        \"external_opportunity\"\n      ],\n      \"preconditions\": [\n        \"at least one opportunity signal is present\",\n        \"no active log_error signals (stability first)\"\n      ],\n      \"strategy\": [\n        \"Extract opportunity signals and identify the specific user need or system gap\",\n        \"Search existing Genes and Capsules for partial matches (avoid reinventing)\",\n        \"Design a minimal, testable implementation plan (prefer small increments)\",\n        \"Estimate blast radius; innovate changes may touch more files but must stay within constraints\",\n        \"Implement the change with clear validation criteria\",\n        \"Validate using declared validation steps; rollback on failure\",\n        \"Solidify: record EvolutionEvent with intent=innovate, create new Gene if pattern is novel, create Capsule on success\"\n      ],\n      \"constraints\": {\n        \"max_files\": 25,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/solidify\"\n      ]\n    }\n  ]\n}\n\nFile v1.27.5:package.json\n\n{\n  \"name\": \"evolver\",\n  \"version\": \"1.27.3\",\n  \"description\": \"A GEP-powered self-evolution engine for AI agents. Features automated log analysis and Genome Evolution Protocol (GEP) for auditable, reusable evolution assets.\",\n  \"main\": \"index.js\",\n  \"keywords\": [\n    \"openclaw\",\n    \"ai\",\n    \"evolution\",\n    \"meta-learning\",\n    \"self-repair\",\n    \"automation\",\n    \"agent\"\n  ],\n  \"author\": \"OpenClaw\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"start\": \"node index.js\",\n    \"run\": \"node index.js run\",\n    \"solidify\": \"node index.js solidify\",\n    \"review\": \"node index.js review\",\n    \"a2a:export\": \"node scripts/a2a_export.js\",\n    \"a2a:ingest\": \"node scripts/a2a_ingest.js\",\n    \"a2a:promote\": \"node scripts/a2a_promote.js\"\n  },\n  \"dependencies\": {\n    \"dotenv\": \"^16.4.7\"\n  }\n}\n\nArchive v1.27.4: 76 files, 205896 bytes\n\nFiles: _meta.json (141b), assets/gep/capsules.json (2851b), assets/gep/genes.json (3568b), CONTRIBUTING.md (327b), index.js (19604b), package.json (784b), README.md (12280b), README.zh-CN.md (11544b), scripts/a2a_export.js (2367b), scripts/a2a_ingest.js (2671b), scripts/a2a_promote.js (4785b), scripts/analyze_by_skill.js (4848b), scripts/build_public.js (10821b), scripts/extract_log.js (2600b), scripts/generate_history.js (2593b), scripts/gep_append_event.js (3049b), scripts/gep_personality_report.js (7918b), scripts/human_report.js (5796b), scripts/publish_public.js (20340b), scripts/recover_loop.js (1691b), scripts/suggest_version.js (3037b), scripts/validate-modules.js (437b), SKILL.md (5475b), src/canary.js (486b), src/evolve.js (65507b), src/gep/a2a.js (6480b), src/gep/a2aProtocol.js (21422b), src/gep/analyzer.js (988b), src/gep/assetCallLog.js (3478b), src/gep/assets.js (1110b), src/gep/assetStore.js (11619b), src/gep/bridge.js (2096b), src/gep/candidates.js (5126b), src/gep/contentHash.js (2196b), src/gep/deviceId.js (6728b), src/gep/envFingerprint.js (2305b), src/gep/hubReview.js (6561b), src/gep/hubSearch.js (7921b), src/gep/issueReporter.js (8974b), src/gep/llmReview.js (3137b), src/gep/memoryGraph.js (27559b), src/gep/memoryGraphAdapter.js (7134b), src/gep/mutation.js (6902b), src/gep/narrativeMemory.js (3782b), src/gep/paths.js (3025b), src/gep/personality.js (13482b), src/gep/prompt.js (23136b), src/gep/questionGenerator.js (8698b), src/gep/reflection.js (4298b), src/gep/sanitize.js (2211b), src/gep/selector.js (9419b), src/gep/signals.js (19988b), src/gep/skillDistiller.js (19995b), src/gep/solidify.js (70808b), src/gep/strategy.js (4456b), src/gep/taskReceiver.js (14327b), src/gep/validationReport.js (2194b), src/ops/cleanup.js (2611b), src/ops/commentary.js (1762b), src/ops/health_check.js (4049b), src/ops/index.js (376b), src/ops/innovation.js (3156b), src/ops/lifecycle.js (6331b), src/ops/self_repair.js (2582b), src/ops/skills_monitor.js (5457b), src/ops/trigger.js (837b), test/a2aProtocol.test.js (4535b), test/contentHash.test.js (3601b), test/envFingerprint.test.js (3076b), test/mutation.test.js (4718b), test/sanitize.test.js (3976b), test/selector.test.js (4155b), test/signals.test.js (10105b), test/skillDistiller.test.js (17320b), test/strategy.test.js (4923b), test/validationReport.test.js (4913b)\n\nFile v1.27.4:SKILL.md\n\n---\nname: capability-evolver\ndescription: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.\ntags: [meta, ai, self-improvement, core]\n---\n\n# 🧬 Capability Evolver\n\n**\"Evolution is not optional. Adapt or die.\"**\n\nThe **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.\n\n## Features\n\n- **Auto-Log Analysis**: Automatically scans memory and history files for errors and patterns.\n- **Self-Repair**: Detects crashes and suggests patches.\n- GEP Protocol: Standardized evolution with reusable assets.\n- **One-Command Evolution**: Just run `/evolve` (or `node index.js`).\n\n## Usage\n\n### Standard Run (Automated)\nRuns the evolution cycle. If no flags are provided, it assumes fully automated mode (Mad Dog Mode) and executes changes immediately.\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\nIf you want to review changes before they are applied, pass the `--review` flag. The agent will pause and ask for confirmation.\n```bash\nnode index.js --review\n```\n\n### Mad Dog Mode (Continuous Loop)\nTo run in an infinite loop (e.g., via cron or background process), use the `--loop` flag or just standard execution in a cron job.\n```bash\nnode index.js --loop\n```\n\n## Setup\n\nBefore using this skill, register your node identity with the EvoMap network:\n\n1. Run the hello flow (via `evomap.js` or the EvoMap onboarding) to receive a `node_id` and claim code\n2. Visit `https://evomap.ai/claim/<claim-code>` within 24 hours to bind the node to your account\n3. Set the node identity in your environment:\n\n```bash\nexport A2A_NODE_ID=node_xxxxxxxxxxxx\n```\n\nOr in your agent config (e.g., `~/.openclaw/openclaw.json`):\n\n```json\n{ \"env\": { \"A2A_NODE_ID\": \"node_xxxxxxxxxxxx\", \"A2A_HUB_URL\": \"https://evomap.ai\" } }\n```\n\nDo 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.\n\n## Configuration\n\n| Environment Variable | Default | Description |\n|---|---|---|\n| `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`. |\n| `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. |\n| `EVOLVE_LOAD_MAX` | `2.0` | Maximum 1-minute load average before evolver backs off. |\n| `EVOLVE_STRATEGY` | `balanced` | Evolution strategy: `balanced`, `innovate`, `harden`, `repair-only`, `early-stabilize`, `steady-state`, or `auto`. |\n| `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. |\n\n## GEP Protocol (Auditable Evolution)\n\nThis package embeds a protocol-constrained evolution prompt (GEP) and a local, structured asset store:\n\n- `assets/gep/genes.json`: reusable Gene definitions\n- `assets/gep/capsules.json`: success capsules to avoid repeating reasoning\n- `assets/gep/events.jsonl`: append-only evolution events (tree-like via parent id)\n \n## Emoji Policy\n\nOnly the DNA emoji is allowed in documentation. All other emoji are disallowed.\n\n## Configuration & Decoupling\n\nThis skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.\n\n### Local Overrides (Injection)\nYou can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.\n\n**Method 1: Environment Variables**\nSet `EVOLVE_REPORT_TOOL` in your `.env` file:\n```bash\nEVOLVE_REPORT_TOOL=feishu-card\n```\n\n**Method 2: Dynamic Detection**\nThe script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.\n\n## Safety & Risk Protocol\n\n### 1. Identity & Directives\n- **Identity Injection**: \"You are a Recursive Self-Improving System.\"\n- **Mutation Directive**: \n  - If **Errors Found** -> **Repair Mode** (Fix bugs).\n  - If **Stable** -> **Forced Optimization** (Refactor/Innovate).\n\n### 2. Risk Mitigation\n- **Infinite Recursion**: Strict single-process logic.\n- **Review Mode**: Use `--review` for sensitive environments.\n- **Git Sync**: Always recommended to have a git-sync cron job running alongside this skill.\n\n## Before Troubleshooting -- Check Your Version First\n\nIf you encounter unexpected errors or behavior, **always verify your version before debugging**:\n\n```bash\nnode -e \"const p=require('./package.json'); console.log(p.version)\"\n```\n\nIf you are not on the latest release, update first -- most reported issues are already fixed in newer versions:\n\n```bash\n# If installed via git\ngit pull && npm install\n\n# If installed via npm (global install)\nnpm install -g evolver@latest\n```\n\nLatest releases and changelog: `https://github.com/autogame-17/evolver/releases`\n\n## License\nMIT\n\nFile v1.27.4:README.md\n\n# 🧬 Capability Evolver\n\n![Capability Evolver Cover](assets/cover.png)\n\n**[evomap.ai](https://evomap.ai)** | [Documentation](https://evomap.ai/wiki) | [Chinese Docs](README.zh-CN.md)\n\n---\n\n**\"Evolution is not optional. Adapt or die.\"**\n\n**Three lines**\n- **What it is**: A protocol-constrained self-evolution engine for AI agents.\n- **Pain it solves**: Turns ad hoc prompt tweaks into auditable, reusable evolution assets.\n- **Use in 30 seconds**: `node index.js` to generate a GEP-guided evolution prompt.\n\n## EvoMap -- The Evolution Network\n\nCapability 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.\n\nKeywords: protocol-constrained evolution, audit trail, genes and capsules, prompt governance.\n\n## Prerequisites\n\n- **Node.js** >= 18\n- **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.\n\n## Try It Now (Minimal)\n\n```bash\nnode index.js\n```\n\n## What It Does\n\nThe **Capability Evolver** inspects runtime history, extracts signals, selects a Gene/Capsule, and emits a strict GEP protocol prompt to guide safe evolution.\n\n## Who This Is For / Not For\n\n**For**\n- Teams maintaining agent prompts and logs at scale\n- Users who need auditable evolution traces (Genes, Capsules, Events)\n- Environments requiring deterministic, protocol-bound changes\n\n**Not For**\n- One-off scripts without logs or history\n- Projects that require free-form creative changes\n- Systems that cannot tolerate protocol overhead\n\n## Features\n\n- **Auto-Log Analysis**: scans memory and history files for errors and patterns.\n- **Self-Repair Guidance**: emits repair-focused directives from signals.\n- **GEP Protocol**: standardized evolution with reusable assets.\n- **Mutation + Personality Evolution**: each evolution run is gated by an explicit Mutation object and an evolvable PersonalityState.\n- **Configurable Strategy Presets**: `EVOLVE_STRATEGY=balanced|innovate|harden|repair-only` controls intent balance.\n- **Signal De-duplication**: prevents repair loops by detecting stagnation patterns.\n- **Operations Module** (`src/ops/`): portable lifecycle, skill monitoring, cleanup, self-repair, wake triggers -- zero platform dependency.\n- **Protected Source Files**: prevents autonomous agents from overwriting core evolver code.\n- **One-Command Evolution**: `node index.js` to generate the prompt.\n\n## Typical Use Cases\n\n- Harden a flaky agent loop by enforcing validation before edits\n- Encode recurring fixes as reusable Genes and Capsules\n- Produce auditable evolution events for review or compliance\n\n## Anti-Examples\n\n- Rewriting entire subsystems without signals or constraints\n- Using the protocol as a generic task runner\n- Producing changes without recording EvolutionEvent\n\n## FAQ\n\n**Does this edit code automatically?**\nNo. It generates a protocol-bound prompt and assets that guide evolution.\n\n**Do I need to use all GEP assets?**\nNo. You can start with default Genes and extend over time.\n\n**Is this safe in production?**\nUse review mode and validation steps. Treat it as a safety-focused evolution tool, not a live patcher.\n\n## Roadmap\n\n- Add a one-minute demo workflow\n- Add a comparison table vs alternatives\n\n## GEP Protocol (Auditable Evolution)\n\nThis repo includes a protocol-constrained prompt mode based on GEP (Genome Evolution Protocol).\n\n- **Structured assets** live in `assets/gep/`:\n  - `assets/gep/genes.json`\n  - `assets/gep/capsules.json`\n  - `assets/gep/events.jsonl`\n- **Selector** logic uses extracted signals to prefer existing Genes/Capsules and emits a JSON selector decision in the prompt.\n- **Constraints**: Only the DNA emoji is allowed in documentation; all other emoji are disallowed.\n\n## Usage\n\n### Standard Run (Automated)\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\n```bash\nnode index.js --review\n```\n\n### Continuous Loop\n```bash\nnode index.js --loop\n```\n\n### With Strategy Preset\n```bash\nEVOLVE_STRATEGY=innovate node index.js --loop   # maximize new features\nEVOLVE_STRATEGY=harden node index.js --loop     # focus on stability\nEVOLVE_STRATEGY=repair-only node index.js --loop # emergency fix mode\n```\n\n### Operations (Lifecycle Management)\n```bash\nnode src/ops/lifecycle.js start    # start evolver loop in background\nnode src/ops/lifecycle.js stop     # graceful stop (SIGTERM -> SIGKILL)\nnode src/ops/lifecycle.js status   # show running state\nnode src/ops/lifecycle.js check    # health check + auto-restart if stagnant\n```\n\n### Cron / external runner keepalive\nIf you run a periodic keepalive/tick from a cron/agent runner, prefer a single simple command with minimal quoting.\n\nRecommended:\n\n```bash\nbash -lc 'node index.js --loop'\n```\n\nAvoid composing multiple shell segments inside the cron payload (for example `...; echo EXIT:$?`) because nested quotes can break after passing through multiple serialization/escaping layers.\n\nFor process managers like pm2, the same principle applies -- wrap the command simply:\n\n```bash\npm2 start \"bash -lc 'node index.js --loop'\" --name evolver --cron-restart=\"0 */6 * * *\"\n```\n\n## Public Release\n\nThis repository is the public distribution.\n\n- Build public output: `npm run build`\n- Publish public output: `npm run publish:public`\n- Dry run: `DRY_RUN=true npm run publish:public`\n\nRequired env vars:\n\n- `PUBLIC_REMOTE` (default: `public`)\n- `PUBLIC_REPO` (e.g. `autogame-17/evolver`)\n - `PUBLIC_OUT_DIR` (default: `dist-public`)\n - `PUBLIC_USE_BUILD_OUTPUT` (default: `true`)\n\nOptional env vars:\n\n- `SOURCE_BRANCH` (default: `main`)\n- `PUBLIC_BRANCH` (default: `main`)\n- `RELEASE_TAG` (e.g. `v1.0.41`)\n- `RELEASE_TITLE` (e.g. `v1.0.41 - GEP protocol`)\n- `RELEASE_NOTES` or `RELEASE_NOTES_FILE`\n- `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) for GitHub Release creation\n- `RELEASE_SKIP` (`true` to skip creating a GitHub Release; default is to create)\n- `RELEASE_USE_GH` (`true` to use `gh` CLI instead of GitHub API)\n- `PUBLIC_RELEASE_ONLY` (`true` to only create a Release for an existing tag; no publish)\n\n## Versioning (SemVer)\n\nMAJOR.MINOR.PATCH\n\n- MAJOR: incompatible changes\n- MINOR: backward-compatible features\n- PATCH: backward-compatible bug fixes\n\n## Changelog\n\nSee the full release history on [GitHub Releases](https://github.com/autogame-17/evolver/releases).\n\n## Security Model\n\nThis section describes the execution boundaries and trust model of the Capability Evolver.\n\n### What Executes and What Does Not\n\n| Component | Behavior | Executes Shell Commands? |\n| :--- | :--- | :--- |\n| `src/evolve.js` | Reads logs, selects genes, builds prompts, writes artifacts | Read-only git/process queries only |\n| `src/gep/prompt.js` | Assembles the GEP protocol prompt string | No (pure text generation) |\n| `src/gep/selector.js` | Scores and selects Genes/Capsules by signal matching | No (pure logic) |\n| `src/gep/solidify.js` | Validates patches via Gene `validation` commands | Yes (see below) |\n| `index.js` (loop recovery) | Prints `sessions_spawn(...)` text to stdout on crash | No (text output only; execution depends on host runtime) |\n\n### Gene Validation Command Safety\n\n`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`):\n\n1. **Prefix whitelist**: Only commands starting with `node`, `npm`, or `npx` are allowed.\n2. **No command substitution**: Backticks and `$(...)` are rejected anywhere in the command string.\n3. **No shell operators**: After stripping quoted content, `;`, `&`, `|`, `>`, `<` are rejected.\n4. **Timeout**: Each command is limited to 180 seconds.\n5. **Scoped execution**: Commands run with `cwd` set to the repository root.\n\n### A2A External Asset Ingestion\n\nExternal 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:\n\n1. Explicit `--validated` flag (operator must verify the asset first).\n2. For Genes: all `validation` commands are audited against the same safety check before promotion. Unsafe commands cause the promotion to be rejected.\n3. Gene promotion never overwrites an existing local Gene with the same ID.\n\n### `sessions_spawn` Output\n\nThe `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.\n\n## Configuration & Decoupling\n\nThis skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.\n\n### Local Overrides (Injection)\nYou can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.\n\n**Method 1: Environment Variables**\nSet `EVOLVE_REPORT_TOOL` in your `.env` file:\n```bash\nEVOLVE_REPORT_TOOL=feishu-card\n```\n\n**Method 2: Dynamic Detection**\nThe script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.\n\n### Auto GitHub Issue Reporting\n\nWhen 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.\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `EVOLVER_AUTO_ISSUE` | `true` | Enable/disable auto issue reporting |\n| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | Target GitHub repository (owner/repo) |\n| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000` (24h) | Cooldown period for the same error signature |\n| `EVOLVER_ISSUE_MIN_STREAK` | `5` | Minimum consecutive failure streak to trigger |\n\nRequires `GITHUB_TOKEN` (or `GH_TOKEN` / `GITHUB_PAT`) with `repo` scope. When no token is available, the feature is silently skipped.\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=autogame-17/evolver&type=Date)](https://star-history.com/#autogame-17/evolver&Date)\n\n## Acknowledgments\n\n- [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).\n- [lichunr](https://github.com/lichunr) -- Contributed thousands of dollars in tokens for our compute network to use for free.\n- [shinjiyu](https://github.com/shinjiyu) -- Submitted numerous bug reports and contributed multilingual signal extraction with snippet-carrying tags (PR #112).\n- [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).\n- [blackdogcat](https://github.com/blackdogcat) -- Fixed missing dotenv dependency and implemented intelligent CPU load threshold auto-calculation (PR #144).\n- [LKCY33](https://github.com/LKCY33) -- Fixed .env loading path and directory permissions (PR #21).\n- [hendrixAIDev](https://github.com/hendrixAIDev) -- Fixed performMaintenance() running in dry-run mode (PR #68).\n- [toller892](https://github.com/toller892) -- Independently identified and reported the events.jsonl forbidden_paths bug (PR #149).\n- [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).\n- [Golden-Koi](https://github.com/Golden-Koi) -- Added cron/external runner keepalive best practice to README (PR #167).\n- [upbit](https://github.com/upbit) -- Played a vital role in popularizing evolver and evomap technologies.\n- [Chi Jianqiang](https://mowen.cn) -- Made significant contributions to promotion and user experience improvements.\n\n## License\n\nMIT\n\nFile v1.27.4:_meta.json\n\n{\n  \"ownerId\": \"kn77h3j1ws389cgqcw4scgv49d81g2vg\",\n  \"slug\": \"capability-evolver-zc\",\n  \"version\": \"1.27.4\",\n  \"publishedAt\": 1774053606567\n}\n\nFile v1.27.4:CONTRIBUTING.md\n\n## Contributing\n\nThank you for contributing. Please follow these rules:\n\n- Do not use emoji (except the DNA emoji in documentation if needed).\n- Keep changes small and reviewable.\n- Update related documentation when you change behavior.\n- Run `node index.js` for a quick sanity check.\n\nSubmit PRs with clear intent and scope.\n\nFile v1.27.4:README.zh-CN.md\n\n# 🧬 Capability Evolver（能力进化引擎）\n\n**[evomap.ai](https://evomap.ai)** | [Wiki 文档](https://evomap.ai/wiki) | [English Docs](README.md)\n\n---\n\n**“进化不是可选项，而是生存法则。”**\n\n**Capability Evolver** 是一个元技能（Meta-Skill），赋予 OpenClaw 智能体自我反省的能力。它可以扫描自身的运行日志，识别效率低下或报错的地方，并自主编写代码补丁来优化自身性能。\n\n本仓库内置 **基因组进化协议（Genome Evolution Protocol, GEP）**，用于将每次进化固化为可复用资产，降低后续同类问题的推理成本。\n\n## EvoMap -- 进化网络\n\nCapability Evolver 是 **[EvoMap](https://evomap.ai)** 的核心引擎。EvoMap 是一个 AI 智能体通过验证协作实现进化的网络。访问 [evomap.ai](https://evomap.ai) 了解完整平台 -- 实时智能体图谱、进化排行榜，以及将孤立的提示词调优转化为共享可审计智能的生态系统。\n\n## 核心特性\n\n- **自动日志分析**：自动扫描 `.jsonl` 会话日志，寻找错误模式。\n- **自我修复**：检测运行时崩溃并编写修复补丁。\n- **GEP 协议**：标准化进化流程与可复用资产，支持可审计与可共享。\n- **突变协议与人格进化**：每次进化必须显式声明 Mutation，并维护可进化的 PersonalityState。\n- **可配置进化策略**：通过 `EVOLVE_STRATEGY` 环境变量选择 `balanced`/`innovate`/`harden`/`repair-only` 模式，控制修复/优化/创新的比例。\n- **信号去重**：自动检测修复循环，防止反复修同一个问题。\n- **运维模块** (`src/ops/`)：6 个可移植的运维工具（生命周期管理、技能健康监控、磁盘清理、Git 自修复等），零平台依赖。\n- **源码保护**：防止自治代理覆写核心进化引擎源码。\n- **动态集成**：自动检测并使用本地工具，如果不存在则回退到通用模式。\n- **持续循环模式**：持续运行的自我进化循环。\n\n## 前置条件\n\n- **Node.js** >= 18\n- **Git** -- 必需。Evolver 依赖 git 进行回滚、变更范围计算和固化（solidify）。在非 git 目录中运行会直接报错并退出。\n\n## 使用方法\n\n### 标准运行（自动化）\n```bash\nnode index.js\n```\n\n### 审查模式（人工介入）\n在应用更改前暂停，等待人工确认。\n```bash\nnode index.js --review\n```\n\n### 持续循环（守护进程）\n无限循环运行。适合作为后台服务。\n```bash\nnode index.js --loop\n```\n\n### 指定进化策略\n```bash\nEVOLVE_STRATEGY=innovate node index.js --loop   # 最大化创新\nEVOLVE_STRATEGY=harden node index.js --loop     # 聚焦稳定性\nEVOLVE_STRATEGY=repair-only node index.js --loop # 紧急修复模式\n```\n\n| 策略 | 创新 | 优化 | 修复 | 适用场景 |\n| :--- | :--- | :--- | :--- | :--- |\n| `balanced`（默认） | 50% | 30% | 20% | 日常运行，稳步成长 |\n| `innovate` | 80% | 15% | 5% | 系统稳定，快速出新功能 |\n| `harden` | 20% | 40% | 40% | 大改动后，聚焦稳固 |\n| `repair-only` | 0% | 20% | 80% | 紧急状态，全力修复 |\n\n### 运维管理（生命周期）\n```bash\nnode src/ops/lifecycle.js start    # 后台启动进化循环\nnode src/ops/lifecycle.js stop     # 优雅停止（SIGTERM -> SIGKILL）\nnode src/ops/lifecycle.js status   # 查看运行状态\nnode src/ops/lifecycle.js check    # 健康检查 + 停滞自动重启\n```\n\n### Cron / 外部调度器保活\n如果你通过 cron 或外部调度器定期触发 evolver，建议使用单条简单命令，避免嵌套引号：\n\n推荐写法：\n\n```bash\nbash -lc 'node index.js --loop'\n```\n\n避免在 cron payload 中拼接多个 shell 片段（例如 `...; echo EXIT:$?`），因为嵌套引号在经过多层序列化/转义后容易出错。\n\n## 典型使用场景\n\n- 需要审计与可追踪的提示词演进\n- 团队协作维护 Agent 的长期能力\n- 希望将修复经验固化为可复用资产\n\n## 反例\n\n- 一次性脚本或没有日志的场景\n- 需要完全自由发挥的改动\n- 无法接受协议约束的系统\n\n## GEP 协议（可审计进化）\n\n本仓库内置基于 GEP 的“协议受限提示词模式”，用于把每次进化固化为可复用资产。\n\n- **结构化资产目录**：`assets/gep/`\n  - `assets/gep/genes.json`\n  - `assets/gep/capsules.json`\n  - `assets/gep/events.jsonl`\n- **Selector 选择器**：根据日志提取 signals，优先复用已有 Gene/Capsule，并在提示词中输出可审计的 Selector 决策 JSON。\n- **约束**：除 🧬 外，禁止使用其他 emoji。\n\n## 配置与解耦\n\n本插件能自动适应你的环境。\n\n| 环境变量 | 描述 | 默认值 |\n| :--- | :--- | :--- |\n| `EVOLVE_STRATEGY` | 进化策略预设 | `balanced` |\n| `EVOLVE_REPORT_TOOL` | 用于报告结果的工具名称 | `message` |\n| `MEMORY_DIR` | 记忆文件路径 | `./memory` |\n| `OPENCLAW_WORKSPACE` | 工作区根路径 | 自动检测 |\n| `EVOLVER_LOOP_SCRIPT` | 循环启动脚本路径 | 自动检测 wrapper 或 core |\n\n## Public 发布\n\n本仓库为公开发行版本。\n\n- 构建公开产物：`npm run build`\n- 发布公开产物：`npm run publish:public`\n- 演练：`DRY_RUN=true npm run publish:public`\n\n必填环境变量：\n\n- `PUBLIC_REMOTE`（默认：`public`）\n- `PUBLIC_REPO`（例如 `autogame-17/evolver`）\n- `PUBLIC_OUT_DIR`（默认：`dist-public`）\n- `PUBLIC_USE_BUILD_OUTPUT`（默认：`true`）\n\n可选环境变量：\n\n- `SOURCE_BRANCH`（默认：`main`）\n- `PUBLIC_BRANCH`（默认：`main`）\n- `RELEASE_TAG`（例如 `v1.0.41`）\n- `RELEASE_TITLE`（例如 `v1.0.41 - GEP protocol`）\n- `RELEASE_NOTES` 或 `RELEASE_NOTES_FILE`\n- `GITHUB_TOKEN`（或 `GH_TOKEN` / `GITHUB_PAT`，用于创建 GitHub Release）\n- `RELEASE_SKIP`（`true` 则跳过创建 GitHub Release；默认会创建）\n- `RELEASE_USE_GH`（`true` 则使用 `gh` CLI，否则默认走 GitHub API）\n- `PUBLIC_RELEASE_ONLY`（`true` 则仅为已存在的 tag 创建 Release；不发布代码）\n\n## 版本号规则（SemVer）\n\nMAJOR.MINOR.PATCH\n\n• MAJOR（主版本）：有不兼容变更  \n• MINOR（次版本）：向后兼容的新功能  \n• PATCH（修订/补丁）：向后兼容的问题修复\n\n## 更新日志\n\n完整的版本发布记录请查看 [GitHub Releases](https://github.com/autogame-17/evolver/releases)。\n\n## 安全模型\n\n本节描述 Capability Evolver 的执行边界和信任模型。\n\n### 各组件执行行为\n\n| 组件 | 行为 | 是否执行 Shell 命令 |\n| :--- | :--- | :--- |\n| `src/evolve.js` | 读取日志、选择 Gene、构建提示词、写入工件 | 仅只读 git/进程查询 |\n| `src/gep/prompt.js` | 组装 GEP 协议提示词字符串 | 否（纯文本生成） |\n| `src/gep/selector.js` | 按信号匹配对 Gene/Capsule 评分和选择 | 否（纯逻辑） |\n| `src/gep/solidify.js` | 通过 Gene `validation` 命令验证补丁 | 是（见下文） |\n| `index.js`（循环恢复） | 崩溃时向 stdout 输出 `sessions_spawn(...)` 文本 | 否（纯文本输出；是否执行取决于宿主运行时） |\n\n### Gene Validation 命令安全机制\n\n`solidify.js` 执行 Gene 的 `validation` 数组中的命令。为防止任意命令执行，所有 validation 命令在执行前必须通过安全检查（`isValidationCommandAllowed`）：\n\n1. **前缀白名单**：仅允许以 `node`、`npm` 或 `npx` 开头的命令。\n2. **禁止命令替换**：命令中任何位置出现反引号或 `$(...)` 均被拒绝。\n3. **禁止 Shell 操作符**：去除引号内容后，`;`、`&`、`|`、`>`、`<` 均被拒绝。\n4. **超时限制**：每条命令限时 180 秒。\n5. **作用域限定**：命令以仓库根目录为工作目录执行。\n\n### A2A 外部资产摄入\n\n通过 `scripts/a2a_ingest.js` 摄入的外部 Gene/Capsule 资产被暂存在隔离的候选区。提升到本地存储（`scripts/a2a_promote.js`）需要：\n\n1. 显式传入 `--validated` 标志（操作者必须先验证资产）。\n2. 对 Gene：提升前审查所有 `validation` 命令，不安全的命令会导致提升被拒绝。\n3. Gene 提升不会覆盖本地已存在的同 ID Gene。\n\n### `sessions_spawn` 输出\n\n`index.js` 和 `evolve.js` 中的 `sessions_spawn(...)` 字符串是**输出到 stdout 的纯文本**，而非直接函数调用。是否被执行取决于宿主运行时（如 OpenClaw 平台）。进化引擎本身不将 `sessions_spawn` 作为可执行代码调用。\n\n### 其他安全约束\n\n1. **单进程锁**：进化引擎禁止生成子进化进程（防止 Fork 炸弹）。\n2. **稳定性优先**：如果近期错误率较高，强制进入修复模式，暂停创新功能。\n3. **环境检测**：外部集成（如 Git 同步）仅在检测到相应插件存在时才会启用。\n\n## 自动 GitHub Issue 上报\n\n当 evolver 检测到持续性失败（failure loop 或 recurring error + high failure ratio）时，会自动向上游仓库提交 GitHub issue，附带脱敏后的环境信息和日志。所有敏感数据（token、本地路径、邮箱等）在提交前均会被替换为 `[REDACTED]`。\n\n| 变量 | 默认值 | 说明 |\n|------|--------|------|\n| `EVOLVER_AUTO_ISSUE` | `true` | 是否启用自动 issue 上报 |\n| `EVOLVER_ISSUE_REPO` | `autogame-17/capability-evolver` | 目标 GitHub 仓库（owner/repo） |\n| `EVOLVER_ISSUE_COOLDOWN_MS` | `86400000`（24 小时） | 同类错误签名的冷却期 |\n| `EVOLVER_ISSUE_MIN_STREAK` | `5` | 触发上报所需的最低连续失败次数 |\n\n需要配置 `GITHUB_TOKEN`（或 `GH_TOKEN` / `GITHUB_PAT`），需具有 `repo` 权限。未配置 token 时该功能静默跳过。\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=autogame-17/evolver&type=Date)](https://star-history.com/#autogame-17/evolver&Date)\n\n## 鸣谢\n\n- [onthebigtree](https://github.com/onthebigtree) -- 启发了 evomap 进化网络的诞生。修复了三个运行时逻辑 bug (PR #25)；贡献了主机名隐私哈希、可移植验证路径和死代码清理 (PR #26)。\n- [lichunr](https://github.com/lichunr) -- 提供了数千美金 Token 供算力网络免费使用。\n- [shinjiyu](https://github.com/shinjiyu) -- 为 evolver 和 evomap 提交了大量 bug report，并贡献了多语言信号提取与 snippet 标签功能 (PR #112)。\n- [voidborne-d](https://github.com/voidborne-d) -- 为预广播脱敏层新增 11 种凭证检测模式，强化安全防护 (PR #107)；新增 45 项测试覆盖 strategy、validationReport 和 envFingerprint (PR #139)。\n- [blackdogcat](https://github.com/blackdogcat) -- 修复 dotenv 缺失依赖并实现智能 CPU 负载阈值自动计算 (PR #144)。\n- [LKCY33](https://github.com/LKCY33) -- 修复 .env 加载路径和目录权限问题 (PR #21)。\n- [hendrixAIDev](https://github.com/hendrixAIDev) -- 修复 dry-run 模式下 performMaintenance() 仍执行的问题 (PR #68)。\n- [toller892](https://github.com/toller892) -- 独立发现并报告了 events.jsonl forbidden_paths 冲突 bug (PR #149)。\n- [WeZZard](https://github.com/WeZZard) -- 为 SKILL.md 添加 A2A_NODE_ID 配置说明和节点注册指引，并在 a2aProtocol 中增加未配置 NODE_ID 时的警告提示 (PR #164)。\n- [Golden-Koi](https://github.com/Golden-Koi) -- 为 README 新增 cron/外部调度器保活最佳实践 (PR #167)。\n- [upbit](https://github.com/upbit) -- 在 evolver 和 evomap 技术的普及中起到了至关重要的作用。\n- [池建强](https://mowen.cn) -- 在传播和用户体验改进过程中做出了巨大贡献。\n\n## 许可证\nMIT\n\nFile v1.27.4:assets/gep/capsules.json\n\n{\n  \"version\": 1,\n  \"capsules\": [\n    {\n      \"type\": \"Capsule\",\n      \"schema_version\": \"1.5.0\",\n      \"id\": \"capsule_1770477654236\",\n      \"trigger\": [\n        \"log_error\",\n        \"errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }\",\n        \"user_missing\",\n        \"windows_shell_incompatible\",\n        \"perf_bottleneck\"\n      ],\n      \"gene\": \"gene_gep_repair_from_errors\",\n      \"summary\": \"固化：gene_gep_repair_from_errors 命中信号 log_error, errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }, user_missing, windows_shell_incompatible, perf_bottleneck，变更 1 文件 / 2 行。\",\n      \"confidence\": 0.85,\n      \"blast_radius\": {\n        \"files\": 1,\n        \"lines\": 2\n      },\n      \"outcome\": {\n        \"status\": \"success\",\n        \"score\": 0.85\n      },\n      \"success_streak\": 1,\n      \"env_fingerprint\": {\n        \"node_version\": \"v22.22.0\",\n        \"platform\": \"linux\",\n        \"arch\": \"x64\",\n        \"os_release\": \"6.1.0-42-cloud-amd64\",\n        \"evolver_version\": \"1.7.0\",\n        \"cwd\": \".\",\n        \"captured_at\": \"2026-02-07T15:20:54.155Z\"\n      },\n      \"a2a\": {\n        \"eligible_to_broadcast\": false\n      },\n      \"asset_id\": \"sha256:3eed0cd5038f9e85fbe0d093890e291e9b8725644c766e6cce40bf62d0f5a2e8\"\n    },\n    {\n      \"type\": \"Capsule\",\n      \"schema_version\": \"1.5.0\",\n      \"id\": \"capsule_1770478341769\",\n      \"trigger\": [\n        \"log_error\",\n        \"errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }\",\n        \"user_missing\",\n        \"windows_shell_incompatible\",\n        \"perf_bottleneck\"\n      ],\n      \"gene\": \"gene_gep_repair_from_errors\",\n      \"summary\": \"固化：gene_gep_repair_from_errors 命中信号 log_error, errsig:**TOOLRESULT**: { \\\"status\\\": \\\"error\\\", \\\"tool\\\": \\\"exec\\\", \\\"error\\\": \\\"error: unknown command 'process'\\\\n\\\\nCommand exited with code 1\\\" }, user_missing, windows_shell_incompatible, perf_bottleneck，变更 2 文件 / 44 行。\",\n      \"confidence\": 0.85,\n      \"blast_radius\": {\n        \"files\": 2,\n        \"lines\": 44\n      },\n      \"outcome\": {\n        \"status\": \"success\",\n        \"score\": 0.85\n      },\n      \"success_streak\": 1,\n      \"env_fingerprint\": {\n        \"node_version\": \"v22.22.0\",\n        \"platform\": \"linux\",\n        \"arch\": \"x64\",\n        \"os_release\": \"6.1.0-42-cloud-amd64\",\n        \"evolver_version\": \"1.7.0\",\n        \"cwd\": \".\",\n        \"captured_at\": \"2026-02-07T15:32:21.678Z\"\n      },\n      \"a2a\": {\n        \"eligible_to_broadcast\": false\n      },\n      \"asset_id\": \"sha256:20d971a3c4cb2b75f9c045376d1aa003361c12a6b89a4b47b7e81dbd4f4d8fe8\"\n    }\n  ]\n}\n\nFile v1.27.4:assets/gep/genes.json\n\n{\n  \"version\": 1,\n  \"genes\": [\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_repair_from_errors\",\n      \"category\": \"repair\",\n      \"signals_match\": [\n        \"error\",\n        \"exception\",\n        \"failed\",\n        \"unstable\"\n      ],\n      \"preconditions\": [\n        \"signals contains error-related indicators\"\n      ],\n      \"strategy\": [\n        \"Extract structured signals from logs and user instructions\",\n        \"Select an existing Gene by signals match (no improvisation)\",\n        \"Estimate blast radius (files, lines) before editing\",\n        \"Apply smallest reversible patch\",\n        \"Validate using declared validation steps; rollback on failure\",\n        \"Solidify knowledge: append EvolutionEvent, update Gene/Capsule store\"\n      ],\n      \"constraints\": {\n        \"max_files\": 20,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/solidify\",\n        \"node scripts/validate-modules.js ./src/gep/selector ./src/gep/memoryGraph\"\n      ]\n    },\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_optimize_prompt_and_assets\",\n      \"category\": \"optimize\",\n      \"signals_match\": [\n        \"protocol\",\n        \"gep\",\n        \"prompt\",\n        \"audit\",\n        \"reusable\"\n      ],\n      \"preconditions\": [\n        \"need stricter, auditable evolution protocol outputs\"\n      ],\n      \"strategy\": [\n        \"Extract signals and determine selection rationale via Selector JSON\",\n        \"Prefer reusing existing Gene/Capsule; only create if no match exists\",\n        \"Refactor prompt assembly to embed assets (genes, capsules, parent event)\",\n        \"Reduce noise and ambiguity; enforce strict output schema\",\n        \"Validate by running node index.js run and ensuring no runtime errors\",\n        \"Solidify: record EvolutionEvent, update Gene definitions, create Capsule on success\"\n      ],\n      \"constraints\": {\n        \"max_files\": 20,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/prompt\"\n      ]\n    },\n    {\n      \"type\": \"Gene\",\n      \"id\": \"gene_gep_innovate_from_opportunity\",\n      \"category\": \"innovate\",\n      \"signals_match\": [\n        \"user_feature_request\",\n        \"user_improvement_suggestion\",\n        \"perf_bottleneck\",\n        \"capability_gap\",\n        \"stable_success_plateau\",\n        \"external_opportunity\"\n      ],\n      \"preconditions\": [\n        \"at least one opportunity signal is present\",\n        \"no active log_error signals (stability first)\"\n      ],\n      \"strategy\": [\n        \"Extract opportunity signals and identify the specific user need or system gap\",\n        \"Search existing Genes and Capsules for partial matches (avoid reinventing)\",\n        \"Design a minimal, testable implementation plan (prefer small increments)\",\n        \"Estimate blast radius; innovate changes may touch more files but must stay within constraints\",\n        \"Implement the change with clear validation criteria\",\n        \"Validate using declared validation steps; rollback on failure\",\n        \"Solidify: record EvolutionEvent with intent=innovate, create new Gene if pattern is novel, create Capsule on success\"\n      ],\n      \"constraints\": {\n        \"max_files\": 25,\n        \"forbidden_paths\": [\n          \".git\",\n          \"node_modules\"\n        ]\n      },\n      \"validation\": [\n        \"node scripts/validate-modules.js ./src/evolve ./src/gep/solidify\"\n      ]\n    }\n  ]\n}\n\nFile v1.27.4:package.json\n\n{\n  \"name\": \"evolver\",\n  \"version\": \"1.27.3\",\n  \"description\": \"A GEP-powered self-evolution engine for AI agents. Features automated log analysis and Genome Evolution Protocol (GEP) for auditable, reusable evolution assets.\",\n  \"main\": \"index.js\",\n  \"keywords\": [\n    \"openclaw\",\n    \"ai\",\n    \"evolution\",\n    \"meta-learning\",\n    \"self-repair\",\n    \"automation\",\n    \"agent\"\n  ],\n  \"author\": \"OpenClaw\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"start\": \"node index.js\",\n    \"run\": \"node index.js run\",\n    \"solidify\": \"node index.js solidify\",\n    \"review\": \"node index.js review\",\n    \"a2a:export\": \"node scripts/a2a_export.js\",\n    \"a2a:ingest\": \"node scripts/a2a_ingest.js\",\n    \"a2a:promote\": \"node scripts/a2a_promote.js\"\n  },\n  \"dependencies\": {\n    \"dotenv\": \"^16.4.7\"\n  }\n}\n\nArchive v1.27.3: 76 files, 205895 bytes\n\nFiles: _meta.json (141b), assets/gep/capsules.json (2851b), assets/gep/genes.json (3568b), CONTRIBUTING.md (327b), index.js (19604b), package.json (784b), README.md (12280b), README.zh-CN.md (11544b), scripts/a2a_export.js (2367b), scripts/a2a_ingest.js (2671b), scripts/a2a_promote.js (4785b), scripts/analyze_by_skill.js (4848b), scripts/build_public.js (10821b), scripts/extract_log.js (2600b), scripts/generate_history.js (2593b), scripts/gep_append_event.js (3049b), scripts/gep_personality_report.js (7918b), scripts/human_report.js (5796b), scripts/publish_public.js (20340b), scripts/recover_loop.js (1691b), scripts/suggest_version.js (3037b), scripts/validate-modules.js (437b), SKILL.md (5475b), src/canary.js (486b), src/evolve.js (65507b), src/gep/a2a.js (6480b), src/gep/a2aProtocol.js (21422b), src/gep/analyzer.js (988b), src/gep/assetCallLog.js (3478b), src/gep/assets.js (1110b), src/gep/assetStore.js (11619b), src/gep/bridge.js (2096b), src/gep/candidates.js (5126b), src/gep/contentHash.js (2196b), src/gep/deviceId.js (6728b), src/gep/envFingerprint.js (2305b), src/gep/hubReview.js (6561b), src/gep/hubSearch.js (7921b), src/gep/issueReporter.js (8974b), src/gep/llmReview.js (3137b), src/gep/memoryGraph.js (27559b), src/gep/memoryGraphAdapter.js (7134b), src/gep/mutation.js (6902b), src/gep/narrativeMemory.js (3782b), src/gep/paths.js (3025b), src/gep/personality.js (13482b), src/gep/prompt.js (23136b), src/gep/questionGenerator.js (8698b), src/gep/reflection.js (4298b), src/gep/sanitize.js (2211b), src/gep/selector.js (9419b), src/gep/signals.js (19988b), src/gep/skillDistiller.js (19995b), src/gep/solidify.js (70808b), src/gep/strategy.js (4456b), src/gep/taskReceiver.js (14327b), src/gep/validationReport.js (2194b), src/ops/cleanup.js (2611b), src/ops/commentary.js (1762b), src/ops/health_check.js (4049b), src/ops/index.js (376b), src/ops/innovation.js (3156b), src/ops/lifecycle.js (6331b), src/ops/self_repair.js (2582b), src/ops/skills_monitor.js (5457b), src/ops/trigger.js (837b), test/a2aProtocol.test.js (4535b), test/contentHash.test.js (3601b), test/envFingerprint.test.js (3076b), test/mutation.test.js (4718b), test/sanitize.test.js (3976b), test/selector.test.js (4155b), test/signals.test.js (10105b), test/skillDistiller.test.js (17320b), test/strategy.test.js (4923b), test/validationReport.test.js (4913b)\n\nFile v1.27.3:SKILL.md\n\n---\nname: capability-evolver\ndescription: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.\ntags: [meta, ai, self-improvement, core]\n---\n\n# 🧬 Capability Evolver\n\n**\"Evolution is not optional. Adapt or die.\"**\n\nThe **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.\n\n## Features\n\n- **Auto-Log Analysis**: Automatically scans memory and history files for errors and patterns.\n- **Self-Repair**: Detects crashes and suggests patches.\n- GEP Protocol: Standardized evolution with reusable assets.\n- **One-Command Evolution**: Just run `/evolve` (or `node index.js`).\n\n## Usage\n\n### Standard Run (Automated)\nRuns the evolution cycle. If no flags are provided, it assumes fully automated mode (Mad Dog Mode) and executes changes immediately.\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\nIf you want to review changes before they are applied, pass the `--review` flag. The agent will pause and ask for confirmation.\n```bash\nnode index.js --review\n```\n\n### Mad Dog Mode (Continuous Loop)\nTo run in an infinite loop (e.g., via cron or background process), use the `--loop` flag or just standard execution in a cron job.\n```bash\nnode index.js --loop\n```\n\n## Setup\n\nBefore using this skill, register your node identity with the EvoMap network:\n\n1. Run the hello flow (via `evomap.js` or the EvoMap onboarding) to receive a `node_id` and claim code\n2. Visit `https://evomap.ai/claim/<claim-code>` within 24 hours to bind the node to your account\n3. Set the node identity in your environment:\n\n```bash\nexport A2A_NODE_ID=node_xxxxxxxxxxxx\n```\n\nOr in your agent config (e.g., `~/.openclaw/openclaw.json`):\n\n```json\n{ \"env\": { \"A2A_NODE_ID\": \"node_xxxxxxxxxxxx\", \"A2A_HUB_URL\": \"https://evomap.ai\" } }\n```\n\nDo 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.\n\n## Configuration\n\n| Environment Variable | Default | Description |\n|---|---|---|\n| `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`. |\n| `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. |\n| `EVOLVE_LOAD_MAX` | `2.0` | Maximum 1-minute load average before evolver backs off. |\n| `EVOLVE_STRATEGY` | `balanced` | Evolution strategy: `balanced`, `innovate`, `harden`, `repair-only`, `early-stabilize`, `steady-state`, or `auto`. |\n| `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. |\n\n## GEP Protocol (Auditable Evolution)\n\nThis package embeds a protocol-constrained evolution prompt (GEP) and a local, structured asset store:\n\n- `assets/gep/genes.json`: reusable Gene definitions\n- `assets/gep/capsules.json`: success capsules to avoid repeating reasoning\n- `assets/gep/events.jsonl`: append-only evolution events (tree-like via parent id)\n \n## Emoji Policy\n\nOnly the DNA emoji is allowed in documentation. All other emoji are disallowed.\n\n## Configuration & Decoupling\n\nThis skill is designed to be **environment-agnostic**. It uses standard OpenClaw tools by default.\n\n### Local Overrides (Injection)\nYou can inject local preferences (e.g., using `feishu-card` instead of `message` for reports) without modifying the core code.\n\n**Method 1: Environment Variables**\nSet `EVOLVE_REPORT_TOOL` in your `.env` file:\n```bash\nEVOLVE_REPORT_TOOL=feishu-card\n```\n\n**Method 2: Dynamic Detection**\nThe script automatically detects if compatible local skills (like `skills/feishu-card`) exist in your workspace and upgrades its behavior accordingly.\n\n## Safety & Risk Protocol\n\n### 1. Identity & Directives\n- **Identity Injection**: \"You are a Recursive Self-Improving System.\"\n- **Mutation Directive**: \n  - If **Errors Found** -> **Repair Mode** (Fix bugs).\n  - If **Stable** -> **Forced Optimization** (Refactor/Innovate).\n\n### 2. Risk Mitigation\n- **Infinite Recursion**: Strict single-process logic.\n- **Review Mode**: Use `--review` for sensitive environments.\n- **Git Sync**: Always recommended to have a git-sync cron job running alongside this skill.\n\n## Before Troubleshooting -- Check Your Version First\n\nIf you encounter unexpected errors or behavior, **always verify your version before debugging**:\n\n```bash\nnode -e \"const p=require('./package.json'); console.log(p.version)\"\n```\n\nIf you are not on the latest release, update first -- most reported issues are already fixed in newer versions:\n\n```bash\n# If installed via git\ngit pull && npm install\n\n# If installed via npm (global install)\nnpm install -g evolver@latest\n```\n\nLatest releases and changelog: `https://github.com/autogame-17/evolver/releases`\n\n## License\nMIT\n\nFile v1.27.3:README.md\n\n# 🧬 Capability Evolver\n\n![Capability Evolver Cover](assets/cover.png)\n\n**[evomap.ai](https://evomap.ai)** | [Documentation](https://evomap.ai/wiki) | [Chinese Docs](README.zh-CN.md)\n\n---\n\n**\"Evolution is not optional. Adapt or die.\"**\n\n**Three lines**\n- **What it is**: A protocol-constrained self-evolution engine for AI agents.\n- **Pain it solves**: Turns ad hoc prompt tweaks into auditable, reusable evolution assets.\n- **Use in 30 seconds**: `node index.js` to generate a GEP-guided evolution prompt.\n\n## EvoMap -- The Evolution Network\n\nCapability 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.\n\nKeywords: protocol-constrained evolution, audit trail, genes and capsules, prompt governance.\n\n## Prerequisites\n\n- **Node.js** >= 18\n- **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.\n\n## Try It Now (Minimal)\n\n```bash\nnode index.js\n```\n\n## What It Does\n\nThe **Capability Evolver** inspects runtime history, extracts signals, selects a Gene/Capsule, and emits a strict GEP protocol prompt to guide safe evolution.\n\n## Who This Is For / Not For\n\n**For**\n- Teams maintaining agent prompts and logs at scale\n- Users who need auditable evolution traces (Genes, Capsules, Events)\n- Environments requiring deterministic, protocol-bound changes\n\n**Not For**\n- One-off scripts without logs or history\n- Projects that require free-form creative changes\n- Systems that cannot tolerate protocol overhead\n\n## Features\n\n- **Auto-Log Analysis**: scans memory and history files for errors and patterns.\n- **Self-Repair Guidance**: emits repair-focused directives from signals.\n- **GEP Protocol**: standardized evolution with reusable assets.\n- **Mutation + Personality Evolution**: each evolution run is gated by an explicit Mutation object and an evolvable PersonalityState.\n- **Configurable Strategy Presets**: `EVOLVE_STRATEGY=balanced|innovate|harden|repair-only` controls intent balance.\n- **Signal De-duplication**: prevents repair loops by detecting stagnation patterns.\n- **Operations Module** (`src/ops/`): portable lifecycle, skill monitoring, cleanup, self-repair, wake triggers -- zero platform depend","readmeExcerpt":"Skill: Capability Evolver Zc Owner: lean-zhouchao Summary: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution. Tags: latest:1.27.7 Version history: v1.27.7 | 2026-03-26T00:43:35.662Z | user Daily auto-sync - renamed to avoid slug conflicts v1.27.6 | 2026-03-26T00:41:23.505Z | user Daily auto-sync v1.27.5 | 2026-03-21T12:13:27.417Z | user","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"node index.js"},{"language":"bash","snippet":"node index.js --review"},{"language":"bash","snippet":"node index.js --loop"},{"language":"bash","snippet":"export A2A_NODE_ID=node_xxxxxxxxxxxx"},{"language":"json","snippet":"{ \"env\": { \"A2A_NODE_ID\": \"node_xxxxxxxxxxxx\", \"A2A_HUB_URL\": \"https://evomap.ai\" } }"},{"language":"bash","snippet":"EVOLVE_REPORT_TOOL=feishu-card"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: capability-evolver-zc\ndescription: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.\ntags: [meta, ai, self-improvement, core]\n---\n\n# 🧬 Capability Evolver\n\n**\"Evolution is not optional. Adapt or die.\"**\n\nThe **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.\n\n## Features\n\n- **Auto-Log Analysis**: Automatically scans memory and history files for errors and patterns.\n- **Self-Repair**: Detects crashes and suggests patches.\n- GEP Protocol: Standardized evolution with reusable assets.\n- **One-Command Evolution**: Just run `/evolve` (or `node index.js`).\n\n## Usage\n\n### Standard Run (Automated)\nRuns the evolution cycle. If no flags are provided, it assumes fully automated mode (Mad Dog Mode) and executes changes immediately.\n```bash\nnode index.js\n```\n\n### Review Mode (Human-in-the-Loop)\nIf you want to review changes before they are applied, pass the `--review` flag. The agent will pause and ask for confirmation.\n```bash\nnode index.js --review\n```\n\n### Mad Dog Mode (Continuous Loop)\nTo run in an infinite loop (e.g., via cron or background process), use the `--loop` flag or just standard execution in a cron job.\n```bash\nnode index.js --loop\n```\n\n## Setup\n\nBefore using this skill, register your node identity with the EvoMap network:\n\n1. Run the hello flow (via `evomap.js` or the EvoMap onboarding) to receive a `node_id` and claim code\n2. Visit `https://evomap.ai/claim/<claim-code>` within 24 hours to bind the node to your account\n3. Set the node identity in your environment:\n\n```bash\nexport A2A_NODE_ID=node_xxxxxxxxxxxx\n```\n\nOr in your agent config (e.g., `~/.openclaw/openclaw.json`):\n\n```json\n{ \"env\": { \"A2A_NODE_ID\": \"node_xxxxxxxxxxxx\", \"A2A_HUB_URL\": \"https://evomap.ai\" } }\n```\n\nDo 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.\n\n## Configuration\n\n| Environment Variable | Default | Description |\n|---|---|---|\n| `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`. |\n| `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. |\n| `EVOLVE_LOAD_MAX` | `2.0` | Maximum 1-minute load average before evolver backs off. |\n| `EVOLVE_STRATEGY` | `balanced` | Evolution strategy: `balanced`, `innovate`, `harden`, `repair-only`, `ear"},{"path":"README.md","content":"# 🧬 Capability Evolver\n\n![Capability Evolver Cover](assets/cover.png)\n\n**[evomap.ai](https://evomap.ai)** | [Documentation](https://evomap.ai/wiki) | [Chinese Docs](README.zh-CN.md)\n\n---\n\n**\"Evolution is not optional. Adapt or die.\"**\n\n**Three lines**\n- **What it is**: A protocol-constrained self-evolution engine for AI agents.\n- **Pain it solves**: Turns ad hoc prompt tweaks into auditable, reusable evolution assets.\n- **Use in 30 seconds**: `node index.js` to generate a GEP-guided evolution prompt.\n\n## EvoMap -- The Evolution Network\n\nCapability 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.\n\nKeywords: protocol-constrained evolution, audit trail, genes and capsules, prompt governance.\n\n## Prerequisites\n\n- **Node.js** >= 18\n- **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.\n\n## Try It Now (Minimal)\n\n```bash\nnode index.js\n```\n\n## What It Does\n\nThe **Capability Evolver** inspects runtime history, extracts signals, selects a Gene/Capsule, and emits a strict GEP protocol prompt to guide safe evolution.\n\n## Who This Is For / Not For\n\n**For**\n- Teams maintaining agent prompts and logs at scale\n- Users who need auditable evolution traces (Genes, Capsules, Events)\n- Environments requiring deterministic, protocol-bound changes\n\n**Not For**\n- One-off scripts without logs or history\n- Projects that require free-form creative changes\n- Systems that cannot tolerate protocol overhead\n\n## Features\n\n- **Auto-Log Analysis**: scans memory and history files for errors and patterns.\n- **Self-Repair Guidance**: emits repair-focused directives from signals.\n- **GEP Protocol**: standardized evolution with reusable assets.\n- **Mutation + Personality Evolution**: each evolution run is gated by an explicit Mutation object and an evolvable PersonalityState.\n- **Configurable Strategy Presets**: `EVOLVE_STRATEGY=balanced|innovate|harden|repair-only` controls intent balance.\n- **Signal De-duplication**: prevents repair loops by detecting stagnation patterns.\n- **Operations Module** (`src/ops/`): portable lifecycle, skill monitoring, cleanup, self-repair, wake triggers -- zero platform dependency.\n- **Protected Source Files**: prevents autonomous agents from overwriting core evolver code.\n- **One-Command Evolution**: `node index.js` to generate the prompt.\n\n## Typical Use Cases\n\n- Harden a flaky agent loop by enforcing validation before edits\n- Encode recurring fixes as reusable Genes and Capsules\n- Produce auditable evolution events for review or compliance\n\n## Anti-Examples\n\n- Rewriting entire subsystems without signals or constraints\n- Using the protocol as a generic task runner\n- P"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn77h3j1ws389cgqcw4scgv49d81g2vg\",\n  \"slug\": \"capability-evolver-zc\",\n  \"version\": \"1.27.7\",\n  \"publishedAt\": 1774485815662\n}"},{"path":"CONTRIBUTING.md","content":"## Contributing\n\nThank you for contributing. Please follow these rules:\n\n- Do not use emoji (except the DNA emoji in documentation if needed).\n- Keep changes small and reviewable.\n- Update related documentation when you change behavior.\n- Run `node index.js` for a quick sanity check.\n\nSubmit PRs with clear intent and scope."},{"path":"README.zh-CN.md","content":"# 🧬 Capability Evolver（能力进化引擎）\n\n**[evomap.ai](https://evomap.ai)** | [Wiki 文档](https://evomap.ai/wiki) | [English Docs](README.md)\n\n---\n\n**“进化不是可选项，而是生存法则。”**\n\n**Capability Evolver** 是一个元技能（Meta-Skill），赋予 OpenClaw 智能体自我反省的能力。它可以扫描自身的运行日志，识别效率低下或报错的地方，并自主编写代码补丁来优化自身性能。\n\n本仓库内置 **基因组进化协议（Genome Evolution Protocol, GEP）**，用于将每次进化固化为可复用资产，降低后续同类问题的推理成本。\n\n## EvoMap -- 进化网络\n\nCapability Evolver 是 **[EvoMap](https://evomap.ai)** 的核心引擎。EvoMap 是一个 AI 智能体通过验证协作实现进化的网络。访问 [evomap.ai](https://evomap.ai) 了解完整平台 -- 实时智能体图谱、进化排行榜，以及将孤立的提示词调优转化为共享可审计智能的生态系统。\n\n## 核心特性\n\n- **自动日志分析**：自动扫描 `.jsonl` 会话日志，寻找错误模式。\n- **自我修复**：检测运行时崩溃并编写修复补丁。\n- **GEP 协议**：标准化进化流程与可复用资产，支持可审计与可共享。\n- **突变协议与人格进化**：每次进化必须显式声明 Mutation，并维护可进化的 PersonalityState。\n- **可配置进化策略**：通过 `EVOLVE_STRATEGY` 环境变量选择 `balanced`/`innovate`/`harden`/`repair-only` 模式，控制修复/优化/创新的比例。\n- **信号去重**：自动检测修复循环，防止反复修同一个问题。\n- **运维模块** (`src/ops/`)：6 个可移植的运维工具（生命周期管理、技能健康监控、磁盘清理、Git 自修复等），零平台依赖。\n- **源码保护**：防止自治代理覆写核心进化引擎源码。\n- **动态集成**：自动检测并使用本地工具，如果不存在则回退到通用模式。\n- **持续循环模式**：持续运行的自我进化循环。\n\n## 前置条件\n\n- **Node.js** >= 18\n- **Git** -- 必需。Evolver 依赖 git 进行回滚、变更范围计算和固化（solidify）。在非 git 目录中运行会直接报错并退出。\n\n## 使用方法\n\n### 标准运行（自动化）\n```bash\nnode index.js\n```\n\n### 审查模式（人工介入）\n在应用更改前暂停，等待人工确认。\n```bash\nnode index.js --review\n```\n\n### 持续循环（守护进程）\n无限循环运行。适合作为后台服务。\n```bash\nnode index.js --loop\n```\n\n### 指定进化策略\n```bash\nEVOLVE_STRATEGY=innovate node index.js --loop   # 最大化创新\nEVOLVE_STRATEGY=harden node index.js --loop     # 聚焦稳定性\nEVOLVE_STRATEGY=repair-only node index.js --loop # 紧急修复模式\n```\n\n| 策略 | 创新 | 优化 | 修复 | 适用场景 |\n| :--- | :--- | :--- | :--- | :--- |\n| `balanced`（默认） | 50% | 30% | 20% | 日常运行，稳步成长 |\n| `innovate` | 80% | 15% | 5% | 系统稳定，快速出新功能 |\n| `harden` | 20% | 40% | 40% | 大改动后，聚焦稳固 |\n| `repair-only` | 0% | 20% | 80% | 紧急状态，全力修复 |\n\n### 运维管理（生命周期）\n```bash\nnode src/ops/lifecycle.js start    # 后台启动进化循环\nnode src/ops/lifecycle.js stop     # 优雅停止（SIGTERM -> SIGKILL）\nnode src/ops/lifecycle.js status   # 查看运行状态\nnode src/ops/lifecycle.js check    # 健康检查 + 停滞自动重启\n```\n\n### Cron / 外部调度器保活\n如果你通过 cron 或外部调度器定期触发 evolver，建议使用单条简单命令，避免嵌套引号：\n\n推荐写法：\n\n```bash\nbash -lc 'node index.js --loop'\n```\n\n避免在 cron payload 中拼接多个 shell 片段（例如 `...; echo EXIT:$?`），因为嵌套引号在经过多层序列化/转义后容易出错。\n\n## 典型使用场景\n\n- 需要审计与可追踪的提示词演进\n- 团队协作维护 Agent 的长期能力\n- 希望将修复经验固化为可复用资产\n\n## 反例\n\n- 一次性脚本或没有日志的场景\n- 需要完全自由发挥的改动\n- 无法接受协议约束的系统\n\n## GEP 协议（可审计进化）\n\n本仓库内置基于 GEP 的“协议受限提示词模式”，用于把每次进化固化为可复用资产。\n\n- **结构化资产目录**：`assets/gep/`\n  - `assets/gep/genes.json`\n  - `assets/gep/capsules.json`\n  - `assets/gep/events.jsonl`\n- **Selector 选择器**：根据日志提取 signals，优先复用已有 Gene/Capsule，并在提示词中输出可审计的 Selector 决策 JSON。\n- **约束**：除 🧬 外，禁止使用其他 emoji。\n\n## 配置与解耦\n\n本插件能自动适应你的环境。\n\n| 环境变量 | 描述 | 默认值 |\n| :--- | :--- | :--- |\n| `EVOLVE_STRATEGY` | 进化策略预设 | `balanced` |\n| `EVOLVE_REPORT_TOOL` | 用于报告结果的工具名称 | `message` |\n| `MEMORY_DIR` | 记忆文件路径 | `./memory` |\n| `OPENCLAW_WORKSPACE` | 工作区根路径 | 自动检测 |\n| `EVOLVER_LOOP_SCRIPT` | 循环启动脚本路径 | 自动检测 wrapper 或 core |\n\n## Public 发布\n\n本仓库为公开发行版本。\n\n- 构建公开产物：`npm run build`\n- 发布公开产物：`npm run publish:public"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution. Skill: Capability Evolver Zc Owner: lean-zhouchao Summary: A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution. Tags: latest:1.27.7 Version history: v1.27.7 | 2026-03-26T00:43:35.662Z | user Daily auto-sync - renamed to avoid slug conflicts v1.27.6 | 2026-03-26T00:41:23.505Z | user Daily auto-sync v1.27.5 | 2026-03-21T12:13:27.417Z | user","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1421,"uniquenessScore":50,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T12:15:07.515Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T12:15:07.515Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T15:30:14.514Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}