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
//! Analyzer module - Phase 2 transformation.
//!
//! This module provides the core analysis functionality that transforms
//! raw::Workflow (parsed from YAML) into analyzed::Workflow (validated,
//! references resolved).
//!
//! # Two-Phase Architecture
//!
//! ```text
//! ┌────────────────────────────────────────────────────────────────────┐
//! │ Phase 1: Parsing (ast::raw) │
//! │ - marked_yaml parses YAML with Span tracking │
//! │ - All values are strings, unresolved │
//! │ - Output: raw::Workflow with Spanned<T> fields │
//! └──────────────────────────┬─────────────────────────────────────────┘
//! │
//! │ analyze()
//! │
//! ▼
//! ┌────────────────────────────────────────────────────────────────────┐
//! │ Phase 2: Analysis (this module) │
//! │ - Validates schema version │
//! │ - Builds task table (TaskId interning) │
//! │ - Resolves all references (with:, depends_on:) │
//! │ - Detects cyclic dependencies │
//! │ - Collects errors with precise spans │
//! │ - Output: analyzed::Workflow with TaskId fields │
//! └────────────────────────────────────────────────────────────────────┘
//! ```
//!
//! # Error Handling
//!
//! The analyzer collects ALL errors in a single pass (not fail-fast).
//! This allows IDEs to show all problems at once.
//!
//! ```ignore
//! let result = analyze(raw_workflow);
//! if result.is_err() {
//! for error in &result.errors {
//! // error.span has precise location
//! // error.suggestion may have "did you mean?"
//! eprintln!("{}: {}", error.kind.code(), error);
//! }
//! }
//! ```
//!
//! # Suggestion Engine
//!
//! Uses Jaro-Winkler similarity (strsim) for "did you mean?" suggestions:
//!
//! - Unknown task "taks1" → did you mean "task1"?
//! - Invalid schema "nika/workfow@0.10" → did you mean "nika/workflow@0.12"?
pub use ;
pub use ;