Files
hakorune/src
nyash-codex e202b95555 feat(joinir): Phase 36 PHI box midrange reduction (MEDIUM safety)
Phase 36-4: LoopSnapshotMergeBox reduction (470 → 363 lines, 22.8%)
- Removed dead code: merge_continue_for_header() + tests (~100 lines)
- Removed superseded helpers: optimize_same_value/sanitize_inputs + tests (~94 lines)
- Removed unused fields: header_phi_inputs/exit_phi_inputs + new/Default (~19 lines)
- Converted to pure static utility (no state, only static methods)

Phase 36-5: PhiBuilderBox responsibility markers
- Added Phase 36 Responsibility Classification section to file header
- Added responsibility markers to all public methods:
  - Loop-only: set_if_context() (if-in-loop PHI context)
  - Common: new(), generate_phis() (stable API for both If and Loop)
  - If-only: generate_if_phis(), compute_modified_names_if(), get_conservative_if_values()
  - Stub: generate_loop_phis() (Phase 37+ implementation target)
- No code changes (markers only)

LoopSnapshotMergeBox changes:
- Removed merge_continue_for_header(): NEVER CALLED in production
- Removed optimize_same_value(): superseded by PhiInputCollector::optimize_same_value()
- Removed sanitize_inputs(): superseded by PhiInputCollector::sanitize()
- Removed test_merge_continue_for_header_*: tests for dead method
- Removed test_optimize_same_value_*: tests for superseded method
- Removed test_sanitize_inputs_*: tests for superseded method
- Added 3 new tests for merge_exit_with_classification():
  - test_merge_exit_with_classification_simple_carrier(): carrier variable
  - test_merge_exit_with_classification_skips_body_local_internal(): Option C logic
  - test_merge_exit_with_classification_break_only_loop(): Case B (header not in exit preds)

PhiBuilderBox changes:
- No wrapper created (hybrid usage pattern - only 1 Loop-specific method)
- Responsibility markers document Loop/If/Common method classification
- Usage pattern clarified: if-in-loop PHI vs loop PHI

Test results:
 cargo build --release: Clean build
 Loop tests: All PASS (no regression)
 If tests: All PASS (unchanged)
 Phase 34 tests: All PASS

Line reduction: 107 lines (LoopSnapshotMergeBox)
Phase 37+ potential: ~3,275 lines remaining

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 02:04:26 +09:00
..