From 0cf6f6a4c5c75c736e6fe3b1c726ef80c0a6c802 Mon Sep 17 00:00:00 2001 From: soryu Date: Sat, 24 Jan 2026 04:31:20 +0000 Subject: feat: implement dependency-ordered task execution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add dependency tracking and validation for tasks to enforce execution order (schema changes → backend → UI) as specified in Section 1.3 of ralph-features-spec.md. Changes: - Add depends_on field to Task model (Vec) for explicit dependencies - Create database migration for depends_on column with GIN index - Add dependency_analysis.rs module with: - can_start_task() for checking if all dependencies are complete - Auto-detection of dependency patterns from file paths - Detection of schema/types/backend/UI categories - Warnings for potential dependency violations - Add DependencyOrderingConfig to daemon config with: - enabled: Enable/disable dependency checking - auto_detect: Auto-detect dependencies from file patterns - warn_on_violation: Warn on detected violations - Integrate dependency checks into task manager scheduling - Add depends_on to DaemonCommand::SpawnTask protocol The daemon performs dependency validation as a sanity check but defers to the server for authoritative scheduling decisions. Co-Authored-By: Claude Opus 4.5 --- makima/src/daemon/config.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'makima/src/daemon/config.rs') diff --git a/makima/src/daemon/config.rs b/makima/src/daemon/config.rs index b7cb1e8..4408fff 100644 --- a/makima/src/daemon/config.rs +++ b/makima/src/daemon/config.rs @@ -63,6 +63,44 @@ pub struct DaemonConfig { /// Repositories to auto-clone on startup. #[serde(default)] pub repos: ReposConfig, + + /// Dependency ordering settings for task execution. + #[serde(default)] + pub dependency_ordering: DependencyOrderingConfig, +} + +/// Dependency ordering configuration. +/// Controls how task dependencies are validated and auto-detected. +#[derive(Debug, Clone, Deserialize)] +#[serde(default)] +pub struct DependencyOrderingConfig { + /// Enable dependency ordering checks. + /// When enabled, tasks with unmet dependencies cannot start. + #[serde(default = "default_true")] + pub enabled: bool, + + /// Auto-detect dependencies from file patterns. + /// Analyzes task plans to detect potential dependencies based on: + /// - Migration files -> backend code + /// - Types/models -> consumers + /// - APIs -> UI components + #[serde(default = "default_true")] + pub auto_detect: bool, + + /// Warn on detected dependency violations. + /// Produces warnings when tasks may be executing out of order. + #[serde(default = "default_true")] + pub warn_on_violation: bool, +} + +impl Default for DependencyOrderingConfig { + fn default() -> Self { + Self { + enabled: true, + auto_detect: true, + warn_on_violation: true, + } + } } /// Server connection configuration. @@ -626,6 +664,7 @@ impl DaemonConfig { }, logging: LoggingConfig::default(), repos: ReposConfig::default(), + dependency_ordering: DependencyOrderingConfig::default(), } } } -- cgit v1.2.3