mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-26 23:50:17 +00:00
chore: clean up legacy playbook references in engine crate
- Rename PLAYBOOK_MIN_STEPS/ACTIONS → SKILL_EXTRACTION_MIN_STEPS/ACTIONS - Fix pattern DB uses DocType::Note instead of DocType::Playbook - Update CLAUDE.md: skill-extraction mission, DocType list, module map Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
@@ -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/Issue/Spec/Note)
|
||||
│ ├── memory.rs # MemoryDoc, DocId, DocType (Summary/Lesson/Playbook[legacy]/Skill/Issue/Spec/Note)
|
||||
│ ├── project.rs # Project, ProjectId
|
||||
│ ├── event.rs # ThreadEvent, EventKind (18 variants for event sourcing)
|
||||
│ ├── message.rs # ThreadMessage, MessageRole
|
||||
@@ -48,7 +48,9 @@ src/
|
||||
├── capability/ # Capability management
|
||||
│ ├── registry.rs # CapabilityRegistry — register/get/list capabilities
|
||||
│ ├── lease.rs # LeaseManager — grant/check/consume/revoke/expire leases
|
||||
│ └── policy.rs # PolicyEngine — deterministic effect-level allow/deny/approve + provenance taint
|
||||
│ ├── policy.rs # PolicyEngine — deterministic effect-level allow/deny/approve + provenance taint
|
||||
│ ├── skill_selector.rs # SkillSelector — MemoryDoc→LoadedSkill bridge, deterministic selection
|
||||
│ └── skill_tracker.rs # SkillTracker — confidence tracking, versioned updates, rollback
|
||||
├── runtime/ # Thread lifecycle management
|
||||
│ ├── manager.rs # ThreadManager — spawn, stop, inject messages, join threads
|
||||
│ ├── conversation.rs # ConversationManager — routes UI messages to threads
|
||||
@@ -86,7 +88,7 @@ Validated by `ThreadState::can_transition_to()`. Terminal states: `Done`, `Faile
|
||||
Three event-driven missions fire automatically after thread completion:
|
||||
|
||||
1. **Error diagnosis** (`self-improvement`) — fires when a thread completes with trace issues. Diagnoses root cause and applies prompt overlays or orchestrator patches.
|
||||
2. **Playbook extraction** (`playbook-extraction`) — fires when a thread succeeds with 5+ steps and 3+ tool actions. Extracts reusable step-by-step procedures.
|
||||
2. **Skill extraction** (`skill-extraction`) — fires when a thread succeeds with 5+ steps and 3+ tool actions. Extracts reusable skills with activation metadata, CodeAct code snippets, and domain tags. Output stored as `DocType::Skill` MemoryDoc.
|
||||
3. **Conversation insights** (`conversation-insights`) — fires every 5 completed threads in a project. Extracts user preferences, domain knowledge, and workflow patterns.
|
||||
|
||||
Created by `MissionManager::ensure_learning_missions()` at project bootstrap.
|
||||
|
||||
@@ -282,10 +282,10 @@ impl MissionManager {
|
||||
let mgr = Arc::clone(self);
|
||||
let mut rx = mgr.thread_manager.subscribe_events();
|
||||
|
||||
/// Minimum steps for a thread to be a playbook candidate.
|
||||
const PLAYBOOK_MIN_STEPS: usize = 5;
|
||||
/// Minimum distinct action executions for playbook extraction.
|
||||
const PLAYBOOK_MIN_ACTIONS: usize = 3;
|
||||
/// Minimum steps for a thread to be a skill extraction candidate.
|
||||
const SKILL_EXTRACTION_MIN_STEPS: usize = 5;
|
||||
/// Minimum distinct action executions for skill extraction.
|
||||
const SKILL_EXTRACTION_MIN_ACTIONS: usize = 3;
|
||||
/// Completed thread interval for conversation insights.
|
||||
const CONVERSATION_INSIGHTS_INTERVAL: u32 = 5;
|
||||
|
||||
@@ -390,8 +390,8 @@ impl MissionManager {
|
||||
&& trace.issues.iter().all(|i| {
|
||||
i.severity != crate::executor::trace::IssueSeverity::Error
|
||||
})
|
||||
&& thread.step_count >= PLAYBOOK_MIN_STEPS
|
||||
&& action_count >= PLAYBOOK_MIN_ACTIONS
|
||||
&& thread.step_count >= SKILL_EXTRACTION_MIN_STEPS
|
||||
&& action_count >= SKILL_EXTRACTION_MIN_ACTIONS
|
||||
{
|
||||
let actions_used: Vec<String> = thread
|
||||
.events
|
||||
@@ -549,7 +549,7 @@ impl MissionManager {
|
||||
use crate::types::memory::{DocType, MemoryDoc};
|
||||
let pattern_doc = MemoryDoc::new(
|
||||
project_id,
|
||||
DocType::Playbook,
|
||||
DocType::Note,
|
||||
FIX_PATTERN_DB_TITLE,
|
||||
SEED_FIX_PATTERNS,
|
||||
)
|
||||
@@ -946,7 +946,7 @@ async fn process_self_improvement_output(
|
||||
} else {
|
||||
MemoryDoc::new(
|
||||
project_id,
|
||||
DocType::Playbook,
|
||||
DocType::Note,
|
||||
FIX_PATTERN_DB_TITLE,
|
||||
SEED_FIX_PATTERNS,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user