skill-system-evolution

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill System Evolution

Skill System 演化模块

Version-controlled evolution engine that uses insight results to evolve soul profiles and workflow recipes.
This skill is the ACT half of the system: it reads accumulated observation data, decides changes that are justified by evidence, applies them conservatively, and records a versioned snapshot for every change.
具备版本控制的演化引擎,利用洞察结果演化Soul配置文件和工作流方案。
该Skill是系统的执行(ACT)部分:它读取积累的观测数据,判定有证据支撑的变更,保守地应用这些变更,并为每一次变更记录带版本的快照。

Key Concepts

核心概念

  1. Insight = OBSERVE
    • Extract facets from sessions and accumulate buffers.
    • This is handled by
      skill-system-insight
      .
  2. Evolution = ACT
    • Read accumulated data and decide changes.
    • Apply changes with strong evidence only.
    • Always version and store an audit snapshot.
  3. Every evolution creates a versioned snapshot
    • No mutation without a recorded snapshot.
    • Snapshots are stored in Postgres (
      agent_memories
      ) and can be listed/rolled back.
  4. Users can list, compare, rollback, and pin versions
    • list-versions
      provides the history.
    • rollback
      restores a prior snapshot (and records the rollback as its own snapshot).
    • Pinning is represented as an additional tag on the snapshot (e.g.,
      pin:true
      ) or as a separate memory record (implementation choice for the operator).
  1. 洞察(Insight)= 观测(OBSERVE)
    • 从会话中提取维度信息并积累缓冲数据。
    • 这部分由
      skill-system-insight
      负责。
  2. 演化(Evolution)= 执行(ACT)
    • 读取积累的数据并判定变更。
    • 仅基于充分证据应用变更。
    • 始终为变更创建版本并存储审计快照。
  3. 每一次演化都会生成带版本的快照
    • 无快照记录则不允许修改。
    • 快照存储在Postgres的
      agent_memories
      中,可列出或回滚。
  4. 用户可列出、对比、回滚和固定版本
    • list-versions
      命令提供历史记录。
    • rollback
      命令恢复之前的快照(并将回滚操作本身记录为新的快照)。
    • 固定版本可通过为快照添加额外标签(如
      pin:true
      )或单独的内存记录实现(具体实现由运维人员选择)。

Architecture

架构

Reads

读取操作

  • Insight facets:
    • agent_memories.category = 'insight-facet'
    • Tags include
      user:<user>
  • Soul state (dual matrix):
    • agent_memories.category = 'soul-state'
    • Tags include
      user:<user>
      and
      matrix
  • 洞察维度:
    • agent_memories.category = 'insight-facet'
    • 标签包含
      user:<user>
  • Soul状态(双矩阵):
    • agent_memories.category = 'soul-state'
    • 标签包含
      user:<user>
      matrix

Writes

写入操作

  • Evolution snapshots:
    • agent_memories.category = 'evolution-snapshot'
    • Each snapshot stores the full artifact YAML/markdown in
      snapshot_data
  • Soul profiles (filesystem):
    • ../skill-system-soul/profiles/<user>.md
  • Workflow recipes (filesystem):
    • ../skill-system-workflow/recipes/*.yaml
      (or
      .yml
      )
  • 演化快照:
    • agent_memories.category = 'evolution-snapshot'
    • 每个快照在
      snapshot_data
      中存储完整的YAML/Markdown工件
  • Soul配置文件(文件系统):
    • ../skill-system-soul/profiles/<user>.md
  • 工作流方案(文件系统):
    • ../skill-system-workflow/recipes/*.yaml
      (或
      .yml

Version tags

版本标签

Version tag format:
v{N}_{target}_{timestamp}
Example:
v3_soul_20260211
Recommended versioning algorithm per user+target:
  • Let
    N = 1 + max(existing N)
    for snapshots with tags
    user:<user>
    and
    target:<target>
    .
  • If none exist, start at
    N = 1
    .
  • Timestamp uses local date (YYYYMMDD) unless you need time disambiguation; if you do, append
    _HHMM
    .
版本标签格式:
v{N}_{target}_{timestamp}
示例:
v3_soul_20260211
推荐的按用户+目标的版本化算法:
  • 对于带有
    user:<user>
    target:<target>
    标签的快照,
    N = 1 + 现有最大N值
  • 若不存在现有快照,则从
    N = 1
    开始。
  • 时间戳使用本地日期(YYYYMMDD),若需要区分时间则追加
    _HHMM

Operational Constraints

操作约束

  • Max 1 evolution pass per day per user.
    • Applies across targets (soul/recipe/both). Use the most recent
      evolution-snapshot
      date as the limiter.
  • Transparency: always explain what changed and why.
    • Every proposed change must include evidence strings from facets or state context.
  • Safety: cannot remove core safety constraints from soul profiles.
    • The evolved profile must retain baseline safety expectations: honest uncertainty, no hallucinated authority, and refusal of harmful/illegal instructions.
  • User approval: major changes require confirmation.
    • If any proposed personality dimension change has
      abs(proposed_value - current_value) > 0.5
      , do not apply automatically.
    • Instead, produce an evolution plan and ask for explicit approval.
  • 每个用户每天最多执行1次演化流程。
    • 该限制适用于所有目标(soul/方案/两者)。以最近的
      evolution-snapshot
      日期作为限制依据。
  • 透明度:始终说明变更内容及原因。
    • 每一项拟议的变更都必须包含来自维度信息或状态上下文的证据字符串。
  • 安全性:不得移除Soul配置文件中的核心安全约束。
    • 演化后的配置文件必须保留基线安全要求:诚实告知不确定性、不虚构权威、拒绝有害/非法指令。
  • 用户审批:重大变更需确认。
    • 若任何拟议的人格维度变更满足
      abs(proposed_value - current_value) > 0.5
      ,则不得自动应用。
    • 取而代之的是生成演化计划并请求用户明确审批。

Relationship to
skill-system-insight

skill-system-insight
的关系

For new installations,
skill-system-evolution
supersedes the insight skill's synthesis operation:
  • skill-system-insight
    remains the source of facets and matrix updates.
  • Layer 3 profile generation (synthesis) is performed and versioned here, so changes are auditable and reversible.
对于新安装的系统,
skill-system-evolution
取代了洞察Skill的合成操作:
  • skill-system-insight
    仍然是维度信息和矩阵更新的来源。
  • 第3层配置文件生成(合成)在此处执行并进行版本控制,因此变更具备可审计性和可逆性。

Storage Pattern (agent_memories)

存储模式(agent_memories)

Evolution snapshots are stored as episodic memories:
  • memory_type = 'episodic'
  • category = 'evolution-snapshot'
  • tags
    include:
    • user:<user>
    • target:<target>
      where target is
      soul
      ,
      recipe
      , or
      both
    • version:<version_tag>
Example SQL templates (copy/paste and substitute values):
sql
-- Rate limit check (max 1/day): any snapshot in last 24h?
SELECT id, created_at, title
FROM agent_memories
WHERE category = 'evolution-snapshot'
  AND 'user:<user>' = ANY(tags)
  AND created_at >= (NOW() - INTERVAL '24 hours')
ORDER BY created_at DESC
LIMIT 1;

-- Store an evolution snapshot
SELECT store_memory(
  'episodic',
  'evolution-snapshot',
  ARRAY['user:<user>', 'target:<target>', 'version:<version_tag>'],
  'Evolution Snapshot: <version_tag>',
  '<full evolution-snapshot YAML as text>',
  '{"version_tag": "<version_tag>", "target": "<target>", "timestamp": "<iso>"}',
  'evolution-agent',
  NULL,
  8.0
);

-- List recent snapshots for a user (most recent first)
SELECT id, created_at, title
FROM agent_memories
WHERE category = 'evolution-snapshot'
  AND 'user:<user>' = ANY(tags)
ORDER BY created_at DESC
LIMIT 50;
演化快照存储为情景记忆:
  • memory_type = 'episodic'
  • category = 'evolution-snapshot'
  • tags
    包含:
    • user:<user>
    • target:<target>
      ,其中target为
      soul
      recipe
      both
    • version:<version_tag>
示例SQL模板(复制粘贴并替换值):
sql
-- 速率限制检查(每天最多1次):过去24小时内是否有快照?
SELECT id, created_at, title
FROM agent_memories
WHERE category = 'evolution-snapshot'
  AND 'user:<user>' = ANY(tags)
  AND created_at >= (NOW() - INTERVAL '24 hours')
ORDER BY created_at DESC
LIMIT 1;

-- 存储演化快照
SELECT store_memory(
  'episodic',
  'evolution-snapshot',
  ARRAY['user:<user>', 'target:<target>', 'version:<version_tag>'],
  'Evolution Snapshot: <version_tag>',
  '<full evolution-snapshot YAML as text>',
  '{"version_tag": "<version_tag>", "target": "<target>", "timestamp": "<iso>"}',
  'evolution-agent',
  NULL,
  8.0
);

-- 列出用户的最近快照(按时间倒序)
SELECT id, created_at, title
FROM agent_memories
WHERE category = 'evolution-snapshot'
  AND 'user:<user>' = ANY(tags)
ORDER BY created_at DESC
LIMIT 50;

Operations

操作命令

  • evolve-soul
    • Check if matrix has enough data (buffer threshold) and/or synthesis is pending.
    • Apply pending matrix updates.
    • Synthesize new Layer 3 profile using evidence (last 50 facets), then version it.
  • evolve-recipes
    • Analyze workflow facets to detect friction/outcomes.
    • Propose conservative recipe modifications and version them.
  • list-versions
    • List evolution history for a user, optionally filtered by target.
  • rollback
    • Restore a previous version of soul or recipes.
    • Records the rollback as a new snapshot.
skill
{
  "schema_version": "2.0",
  "id": "skill-system-evolution",
  "version": "1.0.0",
  "capabilities": ["evolution-soul", "evolution-recipes", "evolution-list", "evolution-rollback"],
  "effects": ["db.read", "db.write", "fs.read", "fs.write"],
  "operations": {
    "evolve-soul": {
      "description": "Evolve soul profile from accumulated insight data. Creates versioned snapshot.",
      "input": {
        "user": {"type": "string", "required": true, "description": "User handle"}
      },
      "output": {
        "description": "Evolution result with version tag",
        "fields": {"version_tag": "string", "changes": "array", "profile_path": "string"}
      },
      "entrypoints": {
        "agent": "Follow scripts/evolve-soul.md procedure"
      }
    },
    "evolve-recipes": {
      "description": "Evolve workflow recipes based on effectiveness data from insight facets.",
      "input": {
        "user": {"type": "string", "required": true, "description": "User handle"}
      },
      "output": {
        "description": "Recipe evolution result with version tag",
        "fields": {"version_tag": "string", "recipes_changed": "array"}
      },
      "entrypoints": {
        "agent": "Follow scripts/evolve-recipes.md procedure"
      }
    },
    "list-versions": {
      "description": "List all evolution snapshots for a user.",
      "input": {
        "user": {"type": "string", "required": true},
        "target": {"type": "string", "required": false, "description": "Filter: soul | recipe | all"}
      },
      "output": {
        "description": "Array of version snapshots",
        "fields": {"versions": "array of {tag, target, timestamp, summary}"}
      },
      "entrypoints": {
        "agent": "Follow scripts/list-versions.md procedure"
      }
    },
    "rollback": {
      "description": "Restore a previous evolution version.",
      "input": {
        "user": {"type": "string", "required": true},
        "version_tag": {"type": "string", "required": true, "description": "Version tag to restore"}
      },
      "output": {
        "description": "Rollback result",
        "fields": {"status": "ok | error", "restored_from": "string"}
      },
      "entrypoints": {
        "agent": "Follow scripts/rollback.md procedure"
      }
    }
  },
  "stdout_contract": {
    "last_line_json": false,
    "note": "Agent-executed procedures; versioned snapshots stored in agent_memories."
  }
}
  • evolve-soul
    • 检查矩阵是否有足够数据(缓冲阈值)和/或是否有待合成任务。
    • 应用待处理的矩阵更新。
    • 利用证据(最近50个维度信息)合成新的第3层配置文件,然后为其添加版本。
  • evolve-recipes
    • 分析工作流维度信息以检测摩擦点/结果。
    • 提出保守的方案修改建议并为其添加版本。
  • list-versions
    • 列出用户的演化历史,可按目标筛选。
  • rollback
    • 恢复Soul或方案的先前版本。
    • 将回滚操作记录为新的快照。
skill
{
  "schema_version": "2.0",
  "id": "skill-system-evolution",
  "version": "1.0.0",
  "capabilities": ["evolution-soul", "evolution-recipes", "evolution-list", "evolution-rollback"],
  "effects": ["db.read", "db.write", "fs.read", "fs.write"],
  "operations": {
    "evolve-soul": {
      "description": "Evolve soul profile from accumulated insight data. Creates versioned snapshot.",
      "input": {
        "user": {"type": "string", "required": true, "description": "User handle"}
      },
      "output": {
        "description": "Evolution result with version tag",
        "fields": {"version_tag": "string", "changes": "array", "profile_path": "string"}
      },
      "entrypoints": {
        "agent": "Follow scripts/evolve-soul.md procedure"
      }
    },
    "evolve-recipes": {
      "description": "Evolve workflow recipes based on effectiveness data from insight facets.",
      "input": {
        "user": {"type": "string", "required": true, "description": "User handle"}
      },
      "output": {
        "description": "Recipe evolution result with version tag",
        "fields": {"version_tag": "string", "recipes_changed": "array"}
      },
      "entrypoints": {
        "agent": "Follow scripts/evolve-recipes.md procedure"
      }
    },
    "list-versions": {
      "description": "List all evolution snapshots for a user.",
      "input": {
        "user": {"type": "string", "required": true},
        "target": {"type": "string", "required": false, "description": "Filter: soul | recipe | all"}
      },
      "output": {
        "description": "Array of version snapshots",
        "fields": {"versions": "array of {tag, target, timestamp, summary}"}
      },
      "entrypoints": {
        "agent": "Follow scripts/list-versions.md procedure"
      }
    },
    "rollback": {
      "description": "Restore a previous evolution version.",
      "input": {
        "user": {"type": "string", "required": true},
        "version_tag": {"type": "string", "required": true, "description": "Version tag to restore"}
      },
      "output": {
        "description": "Rollback result",
        "fields": {"status": "ok | error", "restored_from": "string"}
      },
      "entrypoints": {
        "agent": "Follow scripts/rollback.md procedure"
      }
    }
  },
  "stdout_contract": {
    "last_line_json": false,
    "note": "Agent-executed procedures; versioned snapshots stored in agent_memories."
  }
}