#pragma once /** * AutoForge DAG Engine * * Minimal skeleton for Phase 1. * Full task scheduling will be implemented in Phase 2. */ #include #include #include #include #include namespace autoforge { /// Represents a single node in the execution DAG. struct DAGNode { std::string id; std::string name; std::string type; // e.g., "plan", "code", "test", "analyze" std::vector deps; // IDs of dependency nodes }; /// DAG execution engine — schedules and runs task nodes. class DAGEngine { public: DAGEngine(); ~DAGEngine(); /// Get the engine version string. static std::string version(); /// Add a node to the DAG. void add_node(const DAGNode& node); /// Get the number of nodes in the DAG. size_t node_count() const; /// Clear all nodes. void clear(); /// Validate that the DAG has no cycles. Returns true if valid. bool validate() const; /// Execute the DAG (Phase 2 — currently a no-op). /// Returns true on success. bool execute(); private: std::vector nodes_; std::unordered_map index_; mutable std::mutex mutex_; }; } // namespace autoforge