From 88a4f15ce1310f8ee8693835be14aa5280233f17 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 5 Feb 2026 23:42:48 +0000 Subject: Add directive-first chain system redesign Redesigns the chain system with a directive-first architecture where Directive is the top-level entity (the "why/what") and Chains are generated execution plans (the "how") that can be dynamically modified. Backend: - Add database migration for directive system tables - Add Directive, DirectiveChain, ChainStep, DirectiveEvent models - Add DirectiveVerifier and DirectiveApproval models - Add orchestration module with engine, planner, and verifier - Add comprehensive API handlers for directives - Add daemon CLI commands for directive management - Add directive skill documentation - Integrate contract completion with directive engine - Add SSE endpoint for real-time directive events Frontend: - Add directives route with split-view layout - Add 6-tab detail view (Overview, Chain, Events, Evaluations, Approvals, Verifiers) - Add React Flow DAG visualization for chain steps - Add SSE subscription hook for real-time event updates - Add useDirectives and useDirectiveEventSubscription hooks - Add directive types and API functions Fixes: - Fix test failures in ws/protocol, task_output, completion_gate, patch - Fix word boundary matching in looks_like_task() - Fix parse_last() to find actual last completion gate - Fix create_export_patch when merge-base equals HEAD - Clean up clippy warnings in new code Co-Authored-By: Claude Opus 4.5 --- makima/src/llm/task_output.rs | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'makima/src/llm/task_output.rs') diff --git a/makima/src/llm/task_output.rs b/makima/src/llm/task_output.rs index c5d709e..c7f6990 100644 --- a/makima/src/llm/task_output.rs +++ b/makima/src/llm/task_output.rs @@ -126,7 +126,7 @@ pub fn parse_tasks_from_breakdown(content: &str) -> TaskParseResult { let heading_pattern = Regex::new(r"^##\s+(?:Phase\s*\d*:?\s*)?(.+)$").unwrap(); // Patterns for dependencies (inline) - let depends_pattern = Regex::new(r"(?i)(?:depends on|after|requires):?\s*(.+)").unwrap(); + let depends_pattern = Regex::new(r"(?i)\(?\s*(?:depends on|after|requires):?\s*([^)]+)\)?").unwrap(); for line in content.lines() { let trimmed = line.trim(); @@ -226,7 +226,7 @@ pub fn parse_tasks_from_breakdown(content: &str) -> TaskParseResult { } } -/// Check if text looks like a task (has action verbs) +/// Check if text looks like a task (has action verbs at word boundaries) fn looks_like_task(text: &str) -> bool { let lower = text.to_lowercase(); let action_verbs = [ @@ -237,7 +237,27 @@ fn looks_like_task(text: &str) -> bool { "disable", "install", "initialize", "define", "extend", "extract", ]; - action_verbs.iter().any(|verb| lower.starts_with(verb) || lower.contains(&format!(" {}", verb))) + // Check if text starts with an action verb (followed by space or end) + for verb in &action_verbs { + if lower.starts_with(verb) { + // Check for word boundary after verb + let after = &lower[verb.len()..]; + if after.is_empty() || after.starts_with(' ') || after.starts_with('_') { + return true; + } + } + // Check if verb appears after space with word boundary + let pattern = format!(" {} ", verb); + let pattern_end = format!(" {}", verb); + if lower.contains(&pattern) { + return true; + } + // Check if verb is at the end of string after a space + if lower.ends_with(&pattern_end) && lower.len() > pattern_end.len() { + return true; + } + } + false } /// Analyze a completed task's output to suggest next actions -- cgit v1.2.3