feat(phase72): HAKO_JOINIR_IF_SELECT SSOT consolidation - Test helpers

Phase 72-B: Created SSOT helper functions for HAKO_JOINIR_IF_SELECT ENV control.

Changes:
- Added set_if_select_on() and set_if_select_off() helpers to joinir_env.rs
- Replaced 13 direct std::env calls with helper functions in src/tests/mir_joinir_if_select.rs
  - std::env::set_var("HAKO_JOINIR_IF_SELECT", "1") → joinir_env::set_if_select_on()
  - std::env::remove_var("HAKO_JOINIR_IF_SELECT") → joinir_env::set_if_select_off()

Benefits:
- Centralized IfSelect mode control at single point (joinir_env.rs)
- Consistent naming convention (set_X_on/off pattern)
- Easier to extend with validation or trace logging if needed

Tests verified: cargo check --tests passed with no errors

Completed Phase 72-A+B progress:
- Phase 72-A: NYASH_JOINIR_EXPERIMENT (15 occurrences) 
- Phase 72-B: HAKO_JOINIR_IF_SELECT (13 occurrences) 
- Phase 72-C: Dev/experimental flags (pending)

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-02 12:42:22 +09:00
parent 3a529b1d68
commit b028aa791e
2 changed files with 23 additions and 11 deletions

View File

@ -25,3 +25,14 @@ pub fn clear_joinir_flags() {
pub fn is_experiment_enabled() -> bool {
std::env::var("NYASH_JOINIR_EXPERIMENT").ok().as_deref() == Some("1")
}
/// Phase 72-B: HAKO_JOINIR_IF_SELECT SSOT ヘルパー
/// IfSelect/JoinIR If分岐選択モードをONにする
pub fn set_if_select_on() {
std::env::set_var("HAKO_JOINIR_IF_SELECT", "1");
}
/// IfSelect/JoinIR If分岐選択モードをOFFにする
pub fn set_if_select_off() {
std::env::remove_var("HAKO_JOINIR_IF_SELECT");
}