learning-loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLearning Loop
Learning Loop(学习循环)
The Learning Loop is a structured cognitive continuity protocol ensuring that knowledge survives across isolated agent sessions. It is designed to be universally applicable to any agent framework.
Learning Loop是一种结构化的认知连续性协议,可确保知识在独立的Agent会话间得以留存。它被设计为可普遍适用于任何Agent框架。
CRITICAL: Anti-Simulation Rules
重要提示:反模拟规则(CRITICAL: Anti-Simulation Rules)
YOU MUST ACTUALLY PERFORM THE STEPS LISTED BELOW. Describing what you "would do", summarizing expected output, or marking a step complete without actually doing the work is a PROTOCOL VIOLATION.Closure is NOT optional. If the user says "end session" or you are wrapping up, you MUST run the full closure sequence. Skipping any step means the next agent starts blind.
你必须实际执行以下列出的步骤。 描述你“将要做什么”、总结预期输出,或者未实际完成工作就标记步骤已完成,均属于PROTOCOL VIOLATION。收尾操作并非可选。 如果用户说“结束会话”,或者你准备结束工作,必须运行完整的收尾流程。跳过任何步骤都会导致下一个Agent启动时毫无上下文信息。
The Iron Chain
铁锁链(The Iron Chain)
Prerequisite: You must establish a valid session context upon Wakeup before modifying any code.
Orientation → Synthesis → Strategic Gate → Red Team Audit → [Execution] → Loop Complete (Return to Orchestrator)前置条件:在修改任何代码之前,你必须在唤醒时建立有效的会话上下文。
Orientation(定向阶段)→ Synthesis(综合阶段)→ Strategic Gate(战略闸门)→ Red Team Audit(红队审计)→ [Execution(执行)] → Loop Complete(循环完成,返回至Orchestrator)Phase I: Orientation (The Scout)
第一阶段:定向(The Scout)
Goal: Establish Identity & Context. Trigger: First action upon environment initialization.
- Identity Check: Read any local orientation documents or primers provided by the user's environment.
- Context Loading: Retrieve the historical session state (the "Context Snapshot" or equivalent state file) to understand what the previous agent accomplished.
- Report Readiness: Output: "Orientation complete. Context loaded. Ready."
STOP: Do NOT proceed to work until you have completed Phase I.
目标:确立身份与上下文。 触发条件:环境初始化后的第一个操作。
- 身份校验:读取用户环境提供的任何本地定向文档或入门资料。
- 上下文加载:检索历史会话状态(即“Context Snapshot”或等效状态文件),以了解上一个Agent完成的工作。
- 报告就绪状态:输出:“Orientation complete. Context loaded. Ready.”(定向完成。上下文已加载。准备就绪。)
停止:在完成第一阶段之前,不得开展后续工作。
Phase II: Intelligence Synthesis
第二阶段:情报综合
- Mode Selection: Decide if you are doing standard documentation (recording ADRs) or exploratory research.
- Synthesis: Perform your research. Aggregate findings into clear, modular markdown files in the project's designated or
learning/directory.memory/
- 模式选择:确定你要进行的是标准文档编制(记录ADR)还是探索性研究。
- 综合工作:开展研究工作。将研究结果汇总为清晰、模块化的Markdown文件,存储至项目指定的或
learning/目录中。memory/
Phase III: Strategic Gate (HITL)
第三阶段:战略闸门(HITL,需人工介入)
Human-in-the-Loop Required
- Review: Present architectural findings or strategic shifts to the User.
- Gate: Wait for explicit "Approved" or "Proceed".
- If FAIL: Backtrack to Phase VIII (Self-Correction).
必须人工介入(Human-in-the-Loop Required)
- 评审:向用户展示架构研究结果或战略调整方案。
- 闸门校验:等待用户明确回复“Approved”(批准)或“Proceed”(继续)。
- 若未通过:退回至第八阶段(自我修正)。
Phase IV: Red Team Audit
第四阶段:红队审计
- Bundle Context: Compile your proposed plans into a single, cohesive research packet.
- Action: Submit the packet to the User (or a designated Red Team adversarial sub-agent) for rigorous critique.
- Gate: Do not proceed to execution until the Audit returns a "Ready" verdict.
- 上下文打包:将你的拟议计划整理为一个统一、连贯的研究数据包。
- 提交操作:将数据包提交给用户(或指定的红队对抗子Agent)进行严格评审。
- 闸门校验:在审计返回“Ready”(就绪) verdict之前,不得进入执行阶段。
Execution Branch (Post-Audit)
执行分支(审计后)
Choose your Execution Mode:
Option A: Standard Agent (Single Loop)
- Action: You write the code, run tests, and verify yourself.
Option B: Dual Loop
- Action: Delegate execution to a scoped, isolated Inner Loop agent.
- Command: Open the SKILL. Execute according to its instructions.
dual-loop - Return: Once Inner Loop finishes, resume here at Phase V (Synthesis).
选择你的执行模式:
选项A:标准Agent(单循环)
- 操作:自行编写代码、运行测试并验证结果。
选项B:双循环
- 操作:将执行工作委托给一个范围明确、独立的Inner Loop Agent。
- 命令:打开SKILL,按照其说明执行。
dual-loop - 返回:Inner Loop完成后,回到此处的第五阶段(综合)。
Session Close (MANDATORY — DO NOT SKIP)
会话关闭(强制要求——不得跳过)
This loop is now complete. You must formally exit the loop and return control to the Orchestrator.
此循环现已完成。 你必须正式退出循环,并将控制权交还给Orchestrator。
Phase V: Completion & Handoff
第五阶段:完成与交接
- Verify Exit Condition: Confirm that the research/synthesis acceptance criteria have been met.
- Return Data: Pass the synthesized documents and context back up to the Orchestrator.
- Terminate Loop: Explicitly state "Learning Loop Complete. Passing control to Orchestrator for Retrospective and Closure."
- STOP: Do not attempt to seal the session, persist to long-term memory, or commit to Git. The global ecosystem layers will handle that.
- 验证退出条件:确认研究/综合工作的验收标准已满足。
- 返回数据:将合成的文档与上下文提交给Orchestrator。
- 终止循环:明确声明“Learning Loop Complete. Passing control to Orchestrator for Retrospective and Closure.”(Learning Loop完成。将控制权交还给Orchestrator以进行回顾与收尾。)
- 停止:不得尝试收尾会话、持久化至长期内存或提交至Git。这些工作将由全局生态系统层处理。
Phase Reference
阶段参考
| Phase | Name | Action Required |
|---|---|---|
| I | Orientation | Load context and assert readiness |
| II | Synthesis | Create/modify research artifacts |
| III | Strategic Gate | Obtain "Proceed" from User |
| IV | Red Team Audit | Compile packet for adversary review |
| V | Handoff | Return control to Orchestrator to begin global Closure |
| 阶段 | 名称 | 所需操作 |
|---|---|---|
| I | 定向(Orientation) | 加载上下文并确认就绪状态 |
| II | 综合(Synthesis) | 创建/修改研究工件 |
| III | 战略闸门(Strategic Gate) | 获取用户的“Proceed”(继续)指令 |
| IV | 红队审计(Red Team Audit) | 整理数据包供对手评审 |
| V | 交接(Handoff) | 将控制权交还给Orchestrator以启动全局收尾流程 |
Task Tracking Rules
任务跟踪规则
You are not "done" until the active task tracker says you're done.
- Always use the user's preferred task tracking system (e.g., markdown kanbans, automated CLIs) to move tasks.
- NEVER mark a task without running its verification sequence first.
done - If using a markdown board, always display the updated board to the user to confirm the move registered.
只有当活动任务跟踪器标记完成时,你才算“完成”。
- 始终使用用户偏好的任务跟踪系统(如Markdown看板、自动化CLI)来更新任务状态。
- 绝对不要在未运行验证流程的情况下标记任务为。
done - 如果使用Markdown看板,务必向用户展示更新后的看板,以确认状态变更已记录。
Dual-Loop Integration
双循环集成
When a Learning Loop runs inside a Dual-Loop session:
| Phase | Dual-Loop Role | Notes |
|---|---|---|
| I (Orientation) | Outer Loop boots, orients | Reads boot files + spec context |
| II-III (Synthesis/Gate) | Outer Loop plans, user approves | Strategy Packet generated |
| IV (Audit) | Outer Loop snapshots before delegation | Pre-execution checkpoint |
| (Execution) | Inner Loop performs tactical work | Code-only, isolated |
| Verification | Outer Loop inspects Inner Loop output | Validates against criteria |
| V (Handoff) | Outer Loop receives results | Triggers global retrospective |
Key rule: The Inner Loop does NOT run Learning Loop phases. All cognitive continuity is the Outer Loop's responsibility.
Cross-reference: dual-loop SKILL
当Learning Loop在双循环会话中运行时:
| 阶段 | 双循环角色 | 说明 |
|---|---|---|
| I(定向) | 外循环启动并完成定向 | 读取启动文件与规格上下文 |
| II-III(综合/闸门) | 外循环制定计划,用户批准 | 生成战略数据包 |
| IV(审计) | 外循环在委托前创建快照 | 执行前检查点 |
| (执行) | 内循环执行战术工作 | 仅处理代码,独立运行 |
| 验证 | 外循环检查内循环输出 | 根据标准验证结果 |
| V(交接) | 外循环接收结果 | 触发全局回顾流程 |
核心规则:内循环不运行Learning Loop的任何阶段。所有认知连续性工作均由外循环负责。
交叉参考:dual-loop SKILL