When to Use
- - Need to check learning stage of a pattern or correction
- Want to identify emerging patterns from repeated corrections
- Need to coordinate promotion/demotion of patterns across memory tiers
- Integrating with correction‑logger and preference‑tracker for learning workflows
Architecture
NeverOnce 增强功能
- - ✅ 有效性反馈集成:从增强correction-logger获取有效性分数,跟踪修正使用历史
- ✅ 动态阶段转换算法:基于有效性的自动阶段提升/降级
- 高有效性模式 → 加速确认
- 低有效性模式 → 自动降级或标记
- - ✅ 反馈循环监控:跟踪模式有效性趋势,识别高/低效学习模式
- ✅ 学习速度计算:基于有效性和反馈趋势的学习速度评估
- ✅ 增强报告生成:模式有效性报告、反馈循环统计、学习进度跟踪
- ✅ 自动调整规则:基于置信度的自动阶段调整,减少人工干预
增强算法
- 1. 阶段置信度计算:
confidence = (repetition_count * 0.4) + (effectiveness_score * 0.4) + (time_factor * 0.2)
- 2. 学习速度评估:
learning_speed = (help_ratio * 0.6) + (effectiveness_trend * 0.4)
- 3. 自动调整阈值:
- 自动提升: confidence ≥ 0.8
- 自动降级: effectiveness ≤ 0.2
集成说明
- - 依赖: 增强correction-logger v2.0.0+(可选,但推荐)
- 数据源: 从纠正记录器获取有效性分数和反馈历史
- 兼容性: 原有API完全兼容,新增增强方法可选使用
The plugin provides a LearningCoordinator class that:
- 1. Monitors learning signals – watches corrections and preferences via their respective adapters.
- Manages learning stages – tracks patterns through stages: tentative, emerging, pending, confirmed, archived.
- Coordinates promotion/demotion – applies rules for when to move patterns between stages and tiers.
- Exposes learning statistics – reports on learning progress and pattern evolution.
The plugin does not store its own data; it relies on existing adapters (correction‑logger, preference‑tracker) and the learning‑rules file (learning.md).
Installation
CODEBLOCK2
Or manually copy the plugin directory to your workspace skills folder.
Configuration
Default configuration loads the learning rules file and references other adapters:
CODEBLOCK3
API Reference
LearningCoordinator Class
CODEBLOCK4
Adapter Interface
The plugin includes a LearningCoordinatorAdapter that conforms to the star‑architecture MemoryAdapter base class, providing:
- -
health_check() – reports availability of required adapters and rule file - INLINECODE5 – returns learning statistics (stage counts, promotion rates, etc.)
- INLINECODE6 – searches across learning rules and pattern descriptions
- INLINECODE7 – ensures coordinator state is in sync (no‑op for this plugin)
- INLINECODE8 ,
get_emerging_patterns(), promote_pattern() – convenience methods
Integration with Star Architecture
Once installed and its adapter is registered in the star‑architecture registry, other plugins can query learning coordination via the adapter factory:
CODEBLOCK5
Learning Rules
The plugin reads the learning.md file (see SIPA skill) to obtain:
- - Trigger definitions – what counts as a learning signal
- Confirmation flow – how and when to ask for user confirmation
- Stage evolution – rules for moving between stages
- Anti‑patterns – what not to learn
The file is treated as read‑only; modifications must be made manually.
Troubleshooting
Missing adapters – If correction‑logger or preference‑tracker adapters are unavailable, the coordinator will operate with limited functionality.
Rule file not found – If learning.md does not exist, the plugin will create a minimal version based on the SIPA skill's default content.
Permission errors – Ensure the process has read access to the learning rules file.
Related Plugins
- - correction‑logger – logs user corrections and system improvements
- preference‑tracker – manages user preferences and patterns
- heartbeat‑manager – manages heartbeat state and logs
- reflection‑logger – logs self‑reflection entries
Version History
- - v0.1.0 – Initial split from SIPA skill, basic coordination, star‑architecture adapter.
错误码
| 错误码 | 描述 | 解决方案 |
|---|
| E001 | 未知错误 | 检查日志,联系开发者 |
| E002 |
配置错误 | 验证配置文件格式 |
| E003 | 依赖缺失 | 安装所需依赖包 |
何时使用
- - 需要检查某个模式或修正的学习阶段
- 希望从重复修正中识别新兴模式
- 需要协调模式在记忆层级间的提升/降级
- 与修正记录器和偏好追踪器集成以支持学习工作流
架构
NeverOnce 增强功能
- - ✅ 有效性反馈集成:从增强版correction-logger获取有效性分数,跟踪修正使用历史
- ✅ 动态阶段转换算法:基于有效性的自动阶段提升/降级
- 高有效性模式 → 加速确认
- 低有效性模式 → 自动降级或标记
- - ✅ 反馈循环监控:跟踪模式有效性趋势,识别高/低效学习模式
- ✅ 学习速度计算:基于有效性和反馈趋势的学习速度评估
- ✅ 增强报告生成:模式有效性报告、反馈循环统计、学习进度跟踪
- ✅ 自动调整规则:基于置信度的自动阶段调整,减少人工干预
增强算法
- 1. 阶段置信度计算:
confidence = (repetitioncount 0.4) + (effectivenessscore 0.4) + (time_factor * 0.2)
- 2. 学习速度评估:
learningspeed = (helpratio 0.6) + (effectiveness_trend 0.4)
- 3. 自动调整阈值:
- 自动提升: confidence ≥ 0.8
- 自动降级: effectiveness ≤ 0.2
集成说明
- - 依赖: 增强版correction-logger v2.0.0+(可选,但推荐)
- 数据源: 从纠正记录器获取有效性分数和反馈历史
- 兼容性: 原有API完全兼容,新增增强方法可选使用
该插件提供一个LearningCoordinator类,其功能包括:
- 1. 监控学习信号 – 通过各自的适配器观察修正和偏好。
- 管理学习阶段 – 跟踪模式在各阶段间的流转:暂定、新兴、待定、已确认、已归档。
- 协调提升/降级 – 应用规则决定模式何时在阶段和层级间移动。
- 暴露学习统计信息 – 报告学习进度和模式演化。
该插件不存储自身数据;它依赖现有的适配器(correction‑logger、preference‑tracker)和学习规则文件(learning.md)。
安装
bash
clawhub install learning-coordinator
或手动将插件目录复制到工作区技能文件夹。
配置
默认配置加载学习规则文件并引用其他适配器:
yaml
learningrulesfile: ~/self-improving/learning.md
correctionadapter: correctionlogger
preferenceadapter: preferencetracker
auto_create: true
API 参考
LearningCoordinator 类
python
from learning_coordinator import LearningCoordinator
coordinator = LearningCoordinator(config=None)
获取学习统计信息
stats = coordinator.get
learningstats()
检查新兴模式
emerging = coordinator.get
emergingpatterns(threshold=2)
提升模式(用户确认后)
result = coordinator.promote
pattern(correctionids=[1, 2, 3], new_status=confirmed)
获取各阶段计数
stage
counts = coordinator.getstage_counts()
健康检查
health = coordinator.health_check()
适配器接口
该插件包含一个LearningCoordinatorAdapter,符合星型架构的MemoryAdapter基类,提供以下功能:
- - healthcheck() – 报告所需适配器和规则文件的可用性
- getstats() – 返回学习统计信息(阶段计数、提升率等)
- search(query, limit=10) – 在学习规则和模式描述中搜索
- sync() – 确保协调器状态同步(此插件无操作)
- getlearningstats(), getemergingpatterns(), promote_pattern() – 便捷方法
与星型架构集成
安装后,其适配器注册到星型架构注册表中,其他插件可通过适配器工厂查询学习协调功能:
python
from integration.adapter_factory import AdapterFactory
factory = AdapterFactory()
coordinatoradapter = factory.getadapter(learning_coordinator)
if coordinator_adapter:
stats = coordinatoradapter.getlearning_stats()
emerging = coordinatoradapter.getemerging_patterns(threshold=2)
学习规则
该插件读取learning.md文件(参见SIPA技能)以获取:
- - 触发定义 – 什么算作学习信号
- 确认流程 – 如何以及何时请求用户确认
- 阶段演化 – 阶段间移动的规则
- 反模式 – 不应学习的内容
该文件被视为只读;修改必须手动进行。
故障排除
缺少适配器 – 如果correction‑logger或preference‑tracker适配器不可用,协调器将以有限功能运行。
规则文件未找到 – 如果learning.md不存在,插件将基于SIPA技能的默认内容创建一个最小版本。
权限错误 – 确保进程对学习规则文件具有读取权限。
相关插件
- - correction‑logger – 记录用户修正和系统改进
- preference‑tracker – 管理用户偏好和模式
- heartbeat‑manager – 管理心跳状态和日志
- reflection‑logger – 记录自我反思条目
版本历史
- - v0.1.0 – 从SIPA技能初始拆分,基本协调功能,星型架构适配器。
错误码
| 错误码 | 描述 | 解决方案 |
|---|
| E001 | 未知错误 | 检查日志,联系开发者 |
| E002 |
配置错误 | 验证配置文件格式 |
| E003 | 依赖缺失 | 安装所需依赖包 |