diff --git a/crates/ironclaw_engine/CLAUDE.md b/crates/ironclaw_engine/CLAUDE.md index df1d18a4..0f2a9381 100644 --- a/crates/ironclaw_engine/CLAUDE.md +++ b/crates/ironclaw_engine/CLAUDE.md @@ -13,7 +13,7 @@ See `docs/plans/2026-03-20-engine-v2-architecture.md` for the 8-phase roadmap. | **Thread** | Unit of work with lifecycle, parent-child tree, capability leases | Session + Job + Routine + Sub-agent | | **Step** | Unit of execution (one LLM call + its action executions) | Agentic loop iteration + tool calls | | **Capability** | Unit of effect (actions + knowledge + policies) | Tool + Skill + Hook + Extension | -| **MemoryDoc** | Unit of durable knowledge (summaries, lessons, playbooks) | Workspace memory blobs | +| **MemoryDoc** | Unit of durable knowledge (summaries, lessons, skills) | Workspace memory blobs | | **Project** | Unit of context (scopes memory, threads, missions) | Flat workspace namespace | ## Build & Test @@ -33,7 +33,7 @@ src/ │ ├── thread.rs # Thread, ThreadId, ThreadState (state machine), ThreadType, ThreadConfig │ ├── step.rs # Step, StepId, LlmResponse, ActionCall, ActionResult, TokenUsage │ ├── capability.rs # Capability, ActionDef, EffectType, CapabilityLease, PolicyRule -│ ├── memory.rs # MemoryDoc, DocId, DocType (Summary/Lesson/Playbook[legacy]/Skill/Issue/Spec/Note) +│ ├── memory.rs # MemoryDoc, DocId, DocType (Summary/Lesson/Skill/Issue/Spec/Note) │ ├── project.rs # Project, ProjectId │ ├── event.rs # ThreadEvent, EventKind (18 variants for event sourcing) │ ├── message.rs # ThreadMessage, MessageRole diff --git a/crates/ironclaw_engine/src/executor/context.rs b/crates/ironclaw_engine/src/executor/context.rs index 40b8ad1f..fe5f7c11 100644 --- a/crates/ironclaw_engine/src/executor/context.rs +++ b/crates/ironclaw_engine/src/executor/context.rs @@ -20,7 +20,7 @@ const MAX_CONTEXT_DOCS: usize = 5; /// /// Retrieves relevant memory docs from the project and injects them as a /// system message after the main system prompt. This gives the LLM access -/// to lessons learned, playbooks, and known issues from prior threads. +/// to lessons learned, skills, and known issues from prior threads. pub async fn build_step_context( messages: &[ThreadMessage], leases: &[CapabilityLease], @@ -67,7 +67,6 @@ fn format_docs_as_context(docs: &[MemoryDoc]) -> String { let type_label = match doc.doc_type { crate::types::memory::DocType::Lesson => "LESSON", crate::types::memory::DocType::Spec => "MISSING CAPABILITY", - crate::types::memory::DocType::Playbook => "PLAYBOOK", crate::types::memory::DocType::Issue => "KNOWN ISSUE", crate::types::memory::DocType::Summary => "CONTEXT", crate::types::memory::DocType::Note => "NOTE", diff --git a/crates/ironclaw_engine/src/memory/retrieval.rs b/crates/ironclaw_engine/src/memory/retrieval.rs index 06ae6721..8f14747c 100644 --- a/crates/ironclaw_engine/src/memory/retrieval.rs +++ b/crates/ironclaw_engine/src/memory/retrieval.rs @@ -119,7 +119,6 @@ fn doc_type_weight(doc_type: DocType) -> f64 { DocType::Spec => 0.5, // Missing capability info is highest priority DocType::Skill => 0.45, // Skills with activation metadata and code snippets DocType::Lesson => 0.4, // Lessons prevent repeating mistakes - DocType::Playbook => 0.3, // Reusable procedures DocType::Issue => 0.2, // Known problems DocType::Summary => 0.1, // Background context DocType::Note => 0.05, // Scratch notes, lowest priority @@ -285,8 +284,7 @@ mod tests { #[test] fn doc_type_weight_ordering() { assert!(doc_type_weight(DocType::Spec) > doc_type_weight(DocType::Lesson)); - assert!(doc_type_weight(DocType::Lesson) > doc_type_weight(DocType::Playbook)); - assert!(doc_type_weight(DocType::Playbook) > doc_type_weight(DocType::Issue)); + assert!(doc_type_weight(DocType::Lesson) > doc_type_weight(DocType::Issue)); assert!(doc_type_weight(DocType::Issue) > doc_type_weight(DocType::Summary)); assert!(doc_type_weight(DocType::Summary) > doc_type_weight(DocType::Note)); } diff --git a/crates/ironclaw_engine/src/runtime/mission.rs b/crates/ironclaw_engine/src/runtime/mission.rs index afba1a6c..e4beddd7 100644 --- a/crates/ironclaw_engine/src/runtime/mission.rs +++ b/crates/ironclaw_engine/src/runtime/mission.rs @@ -274,7 +274,7 @@ impl MissionManager { /// for `StateChanged { to: Done }`. For each completed non-Mission thread: /// /// 1. **Error diagnosis** — if trace has issues, fires `thread_completed_with_issues` - /// 2. **Playbook extraction** — if thread succeeded with many steps/actions, + /// 2. **Skill extraction** — if thread succeeded with many steps/actions, /// fires `thread_completed_with_learnings` /// 3. **Conversation insights** — after every N threads in a conversation, /// fires `conversation_insights_due` @@ -374,7 +374,7 @@ impl MissionManager { } } - // ── Trigger 2: Playbook extraction ────────────── + // ── Trigger 2: Skill extraction ────────────────── let action_count = thread .events .iter() @@ -564,7 +564,7 @@ impl MissionManager { /// Ensure all three learning missions exist for the given project. /// - /// Creates (if missing) the self-improvement, playbook extraction, and + /// Creates (if missing) the self-improvement, skill extraction, and /// conversation insights missions. This is the preferred entry point — /// call once at project bootstrap. pub async fn ensure_learning_missions( @@ -1099,7 +1099,7 @@ pub const FIX_PATTERN_DB_TITLE: &str = "fix_pattern_database"; /// Well-known tag for the fix pattern database. pub const FIX_PATTERN_DB_TAG: &str = "fix_patterns"; -/// The goal for the skill extraction mission (replaces playbook extraction). +/// The goal for the skill extraction mission. const SKILL_EXTRACTION_GOAL: &str = "\ You extract reusable skills from successfully completed multi-step threads. diff --git a/crates/ironclaw_engine/src/types/memory.rs b/crates/ironclaw_engine/src/types/memory.rs index 599e4502..56053bbc 100644 --- a/crates/ironclaw_engine/src/types/memory.rs +++ b/crates/ironclaw_engine/src/types/memory.rs @@ -34,8 +34,6 @@ pub enum DocType { Summary, /// Durable learning from experience. Lesson, - /// Reusable multi-step procedure. - Playbook, /// Detected problem for follow-up. Issue, /// Missing capability request. diff --git a/docs/engine-v2-architecture.md b/docs/engine-v2-architecture.md index 043eba9e..4d603845 100644 --- a/docs/engine-v2-architecture.md +++ b/docs/engine-v2-architecture.md @@ -128,7 +128,6 @@ For trace debugging: `ENGINE_V2_TRACE=1` writes full JSON traces to `engine_trac |------|---------|-------------| | `Summary` | What a thread accomplished | Conversation insights mission | | `Lesson` | Durable learning from experience | Self-improvement mission | -| `Playbook` | Reusable multi-step procedure | Legacy (superseded by Skill) | | `Skill` | Reusable skill with activation metadata and code snippets | Skill extraction mission, v1 migration | | `Issue` | Detected problem for follow-up | Self-improvement mission | | `Spec` | Missing capability request | Self-improvement mission | @@ -154,7 +153,7 @@ On each LLM call, two knowledge sources are injected into the system prompt: ## Skills System -Skills are the v2 replacement for both v1 SKILL.md prompt extensions and v1 playbooks. They provide deterministic, keyword-driven knowledge injection with optional executable code snippets for the CodeAct runtime. +Skills are the v2 evolution of SKILL.md prompt extensions. They provide deterministic, keyword-driven knowledge injection with optional executable code snippets for the CodeAct runtime. ### Architecture diff --git a/docs/self-improvement.md b/docs/self-improvement.md index ec2f77da..78fa6162 100644 --- a/docs/self-improvement.md +++ b/docs/self-improvement.md @@ -151,7 +151,7 @@ For Rust bugs in the engine or bridge, the self-improvement thread describes the ## Fix Pattern Database -A Playbook MemoryDoc maps known trace symptoms to fix strategies: +A Note MemoryDoc maps known trace symptoms to fix strategies: | Trace Pattern | Fix Strategy | Location | |---|---|---| diff --git a/src/bridge/store_adapter.rs b/src/bridge/store_adapter.rs index 83ab72f9..5de08c82 100644 --- a/src/bridge/store_adapter.rs +++ b/src/bridge/store_adapter.rs @@ -202,7 +202,6 @@ fn doc_workspace_path(doc: &MemoryDoc) -> String { let type_dir = match doc.doc_type { DocType::Summary => "summaries", DocType::Lesson => "lessons", - DocType::Playbook => "playbooks", DocType::Issue => "issues", DocType::Spec => "specs", DocType::Note => "notes",