fix(joinir): wire balanced depth-scan policy through Pattern2
This commit is contained in:
@ -24,11 +24,18 @@ pub(in crate::mir::builder) fn choose_pattern_kind(
|
||||
// Phase 107: Route balanced depth-scan (return-in-loop) to Pattern2 via policy.
|
||||
//
|
||||
// This keeps Pattern routing structural: no by-name dispatch, no silent fallback.
|
||||
if matches!(
|
||||
classify_balanced_depth_scan_array_end(condition, body),
|
||||
PolicyDecision::Use(_)
|
||||
) {
|
||||
return loop_pattern_detection::LoopPatternKind::Pattern2Break;
|
||||
match classify_balanced_depth_scan_array_end(condition, body) {
|
||||
PolicyDecision::Use(_) => {
|
||||
return loop_pattern_detection::LoopPatternKind::Pattern2Break;
|
||||
}
|
||||
PolicyDecision::Reject(_reason) => {
|
||||
// In strict mode, treat "close-but-unsupported" as a fail-fast
|
||||
// Pattern2 route so the policy can surface the precise contract violation.
|
||||
if crate::config::env::joinir_dev::strict_enabled() {
|
||||
return loop_pattern_detection::LoopPatternKind::Pattern2Break;
|
||||
}
|
||||
}
|
||||
PolicyDecision::None => {}
|
||||
}
|
||||
|
||||
// Phase 193: Use AST Feature Extractor Box for break/continue detection
|
||||
|
||||
Reference in New Issue
Block a user