v0.4.0
Added
- Learn Protocol v1:
state.jsonis 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.mdis now a generated artifact produced byrender.mjsfromstate.json, never edited directly. AI instructions explicitly forbid reading or writingknowledge-map.mdas a data source. - Automatic v0→v1 migration: Existing learning data is auto-migrated on
learn-anything initorupdate, with backup files created for safety. - Schema validation:
render.mjsvalidatesstate.jsonagainst the v1 schema before generatingknowledge-map.md, with clear error messages on field mismatches. - Status script: New standalone
status.mjsscript readsstate.jsonand outputs a formatted heatmap or topic summary, reducing AI token spend. Supports--locale en|zh-CNfor i18n output. - Shared utils (
utils.mjs): Extracted shared types, validation, and helpers used by bothrender.mjsandstatus.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.jsononly, droppingknowledge-map.mdas a data source.
新增
-
learn protocol v1:
state.json现在是所有学习数据的唯一数据源,采用层级式知识图谱格式(领域 → 概念 → 细节)。旧的双文件模型(state.yaml + 手写knowledge-map.md)已被替换——knowledge-map.md现在是由render.mjs根据state.json生成的,不会直接编辑。AI 指令明确禁止读取或写入knowledge-map.md作为数据源。 -
v0→v1 自动迁移:现有learn数据会在
learn-anything init或update时自动迁移,并创建备份文件以确保安全。 -
schema校验:
render.mjs会在生成knowledge-map.md之前,根据 v1 模式校验state.json,并在字段不匹配时显示清晰的错误信息。 -
status脚本:新增独立的
status.mjs脚本,读取state.json文件并输出格式化的热图或主题摘要,从而降低token消耗。支持--locale en|zh-CN参数, 暂时只支持中英文输出。 -
utils (
utils.mjs):提取了render.mjs和status.mjs共用的类型、校验和辅助函数。
变更
-
prompt压缩:在 4 个工作流模板中,技能模板的 INSTRUCTIONS 代码减少了约 69%(减少了 457 行),消除了冗余,同时保留了所有功能。
-
统一学习图标:在
render.mjs、迁移代码、技能模板和测试用例中,将混合的图标样式替换为统一的彩色圆形图标集 (🟢 🔵 🟠 ⚪)。 -
所有 5 个工作流模板 已更新为仅读取/写入
state.json,不再使用knowledge-map.md作为数据源。