feat(joinir): Phase 112 strict guard for StepTree required_caps

- Add control_tree_capability_guard.rs with check(tree, func_name, strict, dev)
- Allowlist: If, NestedIf, Loop, Return, Break, Continue
- Deny (strict): NestedLoop, TryCatch, Throw, Lambda, While, ForRange, Match, Arrow
- Wire into lower_function_body() (strict-only check)
- Error format: [joinir/control_tree/cap_missing/<Cap>] with 1-line Hint
- Unit tests: nested_loop_rejects, if_only_passes, strict_false_passes
- Default behavior unchanged (strict=false always Ok)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-18 01:38:25 +09:00
parent 14730c227f
commit 09ce24e132
4 changed files with 225 additions and 3 deletions

View File

@ -7,7 +7,9 @@
//! - Loop processing context (loop_context.rs) ✅ Phase 140-P5
//! - MIR block merging (merge/) ✅ Phase 4
//! - Unified tracing (trace.rs) ✅ Phase 195
//! - Control tree capability guard (control_tree_capability_guard.rs) ✅ Phase 112
pub(in crate::mir::builder) mod control_tree_capability_guard;
pub(in crate::mir::builder) mod loop_context;
pub(in crate::mir::builder) mod merge;
pub(in crate::mir::builder) mod parity_checker;