refactor(env): centralize NYASH_JOINIR_STRUCTURE_ONLY flag
Moved NYASH_JOINIR_STRUCTURE_ONLY environment variable handling from inline std::env::var() in routing.rs to a centralized helper function in src/config/env/joinir_flags.rs. Changes: - Added joinir_structure_only_enabled() helper function - Replaced direct env::var() call in routing.rs with helper - Maintains existing behavior: default ON, NYASH_JOINIR_STRUCTURE_ONLY=0/off to disable - Follows env module centralization pattern (Box Theory: separation of concerns) Testing: - cargo test --lib: 1126 passed ✅ - Regression: Phase 107 VM smoke ✅ - Phase 113/114 maintained ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -183,10 +183,7 @@ impl MirBuilder {
|
||||
// Phase 196: Default to structure-first routing now that LoopBuilder is removed.
|
||||
// - Default: ON (structure_only = true) to allow JoinIR patterns to run for all loops.
|
||||
// - To revert to the previous whitelist-only behavior, set NYASH_JOINIR_STRUCTURE_ONLY=0.
|
||||
let structure_only = match std::env::var("NYASH_JOINIR_STRUCTURE_ONLY").ok().as_deref() {
|
||||
Some("0") | Some("off") => false,
|
||||
_ => true,
|
||||
};
|
||||
let structure_only = crate::config::env::joinir_structure_only_enabled();
|
||||
|
||||
if structure_only {
|
||||
trace::trace().routing(
|
||||
|
||||
Reference in New Issue
Block a user