Skip to content

v0.4.0

Choose a tag to compare

@ChenChenyaqi ChenChenyaqi released this 07 Jun 10:59
· 30 commits to main since this release
c430a18

Added

  • Learn Protocol v1: state.json is now the single source of truth for all learning data, using a hierarchical knowledge map format (domains → concepts → details). The old dual-file model (state.yaml + hand-written knowledge-map.md) is replaced — knowledge-map.md is now a generated artifact produced by render.mjs from state.json, never edited directly. AI instructions explicitly forbid reading or writing knowledge-map.md as a data source.
  • Automatic v0→v1 migration: Existing learning data is auto-migrated on learn-anything init or update, with backup files created for safety.
  • Schema validation: render.mjs validates state.json against the v1 schema before generating knowledge-map.md, with clear error messages on field mismatches.
  • Status script: New standalone status.mjs script reads state.json and outputs a formatted heatmap or topic summary, reducing AI token spend. Supports --locale en|zh-CN for i18n output.
  • Shared utils (utils.mjs): Extracted shared types, validation, and helpers used by both render.mjs and status.mjs.

Changed

  • Prompt compression: Reduced skill template INSTRUCTIONS by ~69% (457 fewer lines) across 4 workflow templates, eliminating redundancy while preserving all functional behavior.
  • Unified learning icons: Replaced mixed icon styles with a consistent colored circle set (🟢 🔵 🟠 ⚪) across render.mjs, migration code, skill templates, and test fixtures.
  • All 5 workflow templates updated to read/write state.json only, dropping knowledge-map.md as a data source.

新增

  • learn protocol v1state.json 现在是所有学习数据的唯一数据源,采用层级式知识图谱格式(领域 → 概念 → 细节)。旧的双文件模型(state.yaml + 手写knowledge-map.md)已被替换——knowledge-map.md 现在是由 render.mjs 根据 state.json 生成的,不会直接编辑。AI 指令明确禁止读取或写入 knowledge-map.md 作为数据源。

  • v0→v1 自动迁移:现有learn数据会在 learn-anything initupdate 时自动迁移,并创建备份文件以确保安全。

  • schema校验render.mjs 会在生成 knowledge-map.md 之前,根据 v1 模式校验 state.json,并在字段不匹配时显示清晰的错误信息。

  • status脚本:新增独立的 status.mjs 脚本,读取 state.json 文件并输出格式化的热图或主题摘要,从而降低token消耗。支持 --locale en|zh-CN 参数, 暂时只支持中英文输出。

  • utils (utils.mjs):提取了 render.mjsstatus.mjs 共用的类型、校验和辅助函数。

变更

  • prompt压缩:在 4 个工作流模板中,技能模板的 INSTRUCTIONS 代码减少了约 69%(减少了 457 行),消除了冗余,同时保留了所有功能。

  • 统一学习图标:在 render.mjs、迁移代码、技能模板和测试用例中,将混合的图标样式替换为统一的彩色圆形图标集 (🟢 🔵 🟠 ⚪)。

  • 所有 5 个工作流模板 已更新为仅读取/写入 state.json,不再使用 knowledge-map.md 作为数据源。