Restore exactly-one terminal node validation per spec

The spec says "exactly one" exit node in the shape table (line 184),
exit handler docs (line 648), and test criteria (line 1834). The lint
rule table (line 1437) says "at least one" but is the minority. The
previous commit incorrectly reverted this — the terminal node change
was not causing the test failures (all three were from retry-on-Fail).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-02-23 16:12:45 -05:00
parent 6406fccd19
commit 9f9b461971

View file

@ -94,12 +94,24 @@ impl LintRule for TerminalNodeRule {
return vec![Diagnostic {
rule: self.name().to_string(),
severity: Severity::Error,
message: "Pipeline must have at least one terminal node (shape=Msquare or id exit/end)".to_string(),
message: "Pipeline must have exactly one terminal node (shape=Msquare or id exit/end)".to_string(),
node_id: None,
edge: None,
fix: Some("Add a node with shape=Msquare or id 'exit'/'end'".to_string()),
}];
}
if terminal_count > 1 {
return vec![Diagnostic {
rule: self.name().to_string(),
severity: Severity::Error,
message: format!(
"Pipeline must have exactly one terminal node, found {terminal_count}"
),
node_id: None,
edge: None,
fix: Some("Remove extra terminal nodes so exactly one remains".to_string()),
}];
}
Vec::new()
}
}