#[cfg(test)]
mod tests {
    #[test]
    fn test_factored_action_composition() {
        // Verify: exposure * 9 + order * 3 + urgency covers 0-44
        let mut seen = std::collections::HashSet::new();
        for exposure in 0..5_u32 {
            for order in 0..3_u32 {
                for urgency in 0..3_u32 {
                    let factored = exposure * 9 + order * 3 + urgency;
                    assert!(factored < 45, "factored {} out of range", factored);
                    seen.insert(factored);
                }
            }
        }
        assert_eq!(seen.len(), 45, "Must cover all 45 factored actions");
    }

    #[test]
    fn test_factored_action_decomposition() {
        // Verify round-trip: compose then decompose
        for original in 0..45_u32 {
            let exposure = original / 9;
            let order = (original % 9) / 3;
            let urgency = original % 3;

            let recomposed = exposure * 9 + order * 3 + urgency;
            assert_eq!(original, recomposed, "Round-trip failed for {}", original);
            assert!(exposure < 5);
            assert!(order < 3);
            assert!(urgency < 3);
        }
    }
}
