ralph-claude-code/tests/unit
Frank Bria f6fde6780b
fix(exit-detection): use explicit EXIT_SIGNAL instead of confidence threshold (#132)
Replace confidence-based heuristic in update_exit_signals() with explicit
EXIT_SIGNAL checking. JSON mode always has confidence >= 70 due to
deterministic scoring, causing completion_indicators to fill after 5 loops
and triggering premature exits even when Claude sets EXIT_SIGNAL: false.

Changes:
- lib/response_analyzer.sh: Check exit_signal == "true" instead of
  confidence >= 60 when updating completion_indicators array
- ralph_loop.sh: Update safety circuit breaker comment to reflect that
  completion_indicators now only accumulates on EXIT_SIGNAL=true
- tests/unit/test_exit_detection.bats: Add 4 TDD tests (32-35) validating
  the fix for update_exit_signals() behavior
- CLAUDE.md: Document fix as v0.11.1, update test counts (420 → 424)

Test count: 424 passing (100% pass rate)

Co-authored-by: Test User <test@example.com>
2026-01-26 16:41:05 -07:00
..
test_cli_modern.bats refactor(naming): remove @ prefix from on-disk filenames (#131) 2026-01-26 15:40:27 -07:00
test_cli_parsing.bats feat(structure): migrate Ralph files to .ralph/ subfolder (#109) 2026-01-20 23:22:30 -07:00
test_enable_core.bats refactor(naming): remove @ prefix from on-disk filenames (#131) 2026-01-26 15:40:27 -07:00
test_exit_detection.bats fix(exit-detection): use explicit EXIT_SIGNAL instead of confidence threshold (#132) 2026-01-26 16:41:05 -07:00
test_json_parsing.bats Merge main and apply code review fixes 2026-01-21 21:42:29 -07:00
test_ralph_enable.bats refactor(naming): remove @ prefix from on-disk filenames (#131) 2026-01-26 15:40:27 -07:00
test_rate_limiting.bats feat(structure): migrate Ralph files to .ralph/ subfolder (#109) 2026-01-20 23:22:30 -07:00
test_session_continuity.bats refactor(naming): remove @ prefix from on-disk filenames (#131) 2026-01-26 15:40:27 -07:00
test_task_sources.bats feat(enable): add ralph-enable wizard for existing projects (v0.11.0) (#124) 2026-01-25 14:37:25 -07:00
test_wizard_utils.bats fix(wizard): redirect prompts to stderr for clean command substitution (#130) 2026-01-26 14:47:06 -07:00