1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! # SCUD Core - Shared Types for SCUD Task Management
//!
//! This crate provides the core data types and utilities shared between
//! SCUD CLI and Descartes GUI applications.
//!
//! ## Features
//!
//! - **Task types**: [`Task`], [`TaskStatus`], [`Priority`]
//! - **Phase management**: [`Phase`], [`PhaseStats`], [`IdFormat`]
//! - **SCG format**: Token-efficient text format for task graphs
//! - **Wave computation**: Parallel execution wave calculation
//! - **Storage**: File-based task persistence with locking
//!
//! ## Example
//!
//! ```
//! use scud_core::{Task, Phase, compute_waves};
//!
//! // Create a phase with tasks
//! let mut phase = Phase::new("my-feature".to_string());
//!
//! let task1 = Task::new(
//! "1".to_string(),
//! "Implement feature".to_string(),
//! "Add the new functionality".to_string(),
//! );
//!
//! let mut task2 = Task::new(
//! "2".to_string(),
//! "Write tests".to_string(),
//! "Add test coverage".to_string(),
//! );
//! task2.dependencies = vec!["1".to_string()];
//!
//! phase.add_task(task1);
//! phase.add_task(task2);
//!
//! // Find tasks ready to work on
//! if let Some(next) = phase.find_next_task() {
//! println!("Ready: {}", next.title);
//! }
//!
//! // Compute parallel execution waves
//! let task_refs: Vec<&Task> = phase.tasks.iter().collect();
//! let result = compute_waves(&task_refs);
//! println!("Waves: {}", result.waves.len());
//! ```
/// Core data models for tasks and phases.
///
/// This module defines the fundamental types used throughout SCUD:
///
/// - [`models::Task`] - Individual work items with status, complexity, dependencies
/// - [`models::Phase`] - A collection of related tasks (identified by a tag)
/// - [`models::TaskStatus`] - Task lifecycle states (Pending, InProgress, Done, etc.)
/// - [`models::Priority`] - Task priority levels (Critical, High, Medium, Low)
/// - [`models::IdFormat`] - ID generation strategy (Sequential or UUID)
/// Task graph serialization formats.
///
/// Provides parsers and serializers for the SCG (SCUD Graph) format,
/// a token-efficient text format designed for AI context windows.
///
/// Key exports:
/// - [`formats::parse_scg`] - Parse SCG text into a Phase
/// - [`formats::serialize_scg`] - Serialize a Phase to SCG text
/// - [`formats::Format`] - Enum of supported formats (SCG, JSON)
/// Wave computation for parallel task execution.
///
/// Computes execution waves using topological sort, grouping tasks
/// that can run in parallel based on their dependencies.
/// File-based task storage with locking.
///
/// Manages reading and writing of task data to the filesystem with:
/// - File locking for safe concurrent access
/// - Caching of active phase selection
/// - Atomic read-modify-write operations
/// Event publishing system using ZMQ.
///
/// Provides ZMQ-based event publishing for task management events.
/// Supports PUB socket for broadcasting events and REP socket for queries.
// Re-export commonly used types at the crate root for ergonomic API
pub use ;
// Re-export format utilities
pub use ;
// Re-export wave computation types and functions
pub use ;
// Re-export storage
pub use Storage;