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
//! MapReduce job state management using Stillwater's Effect pattern
//!
//! This module provides pure, testable state management for MapReduce jobs,
//! separating state transition logic from I/O operations.
//!
//! # Architecture
//!
//! The state management is organized into three layers:
//!
//! - **Pure Functions** (`pure.rs`): State transition logic with no side effects
//! - **Effect-Based I/O** (`io.rs`): I/O operations wrapped in Effect types
//! - **Type Definitions** (`types.rs`): Data structures for job state
//!
//! # Pure Core, Imperative Shell
//!
//! This design follows the "pure core, imperative shell" pattern:
//!
//! ```text
//! Pure Logic (pure.rs) → Effect Composition (io.rs) → Orchestration
//! ↓ ↓ ↓
//! No I/O, instant tests Mock environments Real dependencies
//! ```
//!
//! # Example Usage
//!
//! ```rust,ignore
//! use prodigy::cook::execution::state::{pure, io, StateEnv};
//!
//! // Pure state transition (testable without I/O)
//! let new_state = pure::apply_agent_result(state, result);
//!
//! // Effect-based I/O (lazy, composable)
//! let effect = io::update_with_agent_result(state, result);
//! let new_state = effect.run(&env).await?;
//! ```
// Re-export commonly used types
pub use ;
// Re-export pure functions for easy access
pub use pure::;
// Re-export I/O functions and environment
pub use ;