fix(analyzer): detect progress from committed work and embedded RALPH_STATUS#181
Open
enlego wants to merge 1 commit intofrankbria:mainfrom
Open
fix(analyzer): detect progress from committed work and embedded RALPH_STATUS#181enlego wants to merge 1 commit intofrankbria:mainfrom
enlego wants to merge 1 commit intofrankbria:mainfrom
Conversation
…_STATUS When Claude commits work atomically after each task, git diff returns zero uncommitted changes. Ralph incorrectly treats this as no progress and opens the circuit breaker after CB_NO_PROGRESS_THRESHOLD loops. Two complementary fixes in the JSON analysis path: - Check git log --since for recent commits, not just git diff - Parse TASKS_COMPLETED_THIS_LOOP and FILES_MODIFIED from the embedded RALPH_STATUS block in the result field (consistent with existing EXIT_SIGNAL extraction added in Bug frankbria#1 Fix) Also fixes literal \\n handling: normalize escape sequences from the jq result field before grep/cut so parsing works in both production (where jq decodes JSON escapes to real newlines) and test environments. All 456 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Detect progress in
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git diffonly sees uncommitted changes; projects using atomic commits trigger the circuit breaker with no real issueEXIT_SIGNALwas parsed from the embedded RALPH_STATUS block butTASKS_COMPLETED_THIS_LOOPandFILES_MODIFIEDwere notRoot cause
In
analyze_response(JSON path,lib/response_analyzer.sh), progress is detected only viagit diff --name-only. When Claude commits after each loop (a common and encouraged pattern),git diffreturns 0 →has_progress = false→ circuit breaker opens afterCB_NO_PROGRESS_THRESHOLDconsecutive loops.Additionally, the JSON path already extracts
EXIT_SIGNALfrom the embedded---RALPH_STATUS---block in theresultfield, but ignoresTASKS_COMPLETED_THIS_LOOPandFILES_MODIFIEDfrom the same block.Changes
lib/response_analyzer.sh—analyze_response, JSON path (~line 343):Recent-commit detection: After
git diff, checkgit log --oneline -1 --since="20 minutes ago". If a recent commit exists, sethas_progress=trueand populatefiles_modifiedfromgit diff-treeorgit diff HEAD~1.Embedded RALPH_STATUS parsing: Extract
TASKS_COMPLETED_THIS_LOOPandFILES_MODIFIEDfrom theresultfield's---RALPH_STATUS---block, consistent with the existingEXIT_SIGNALextraction. Also normalizes literal\nescape sequences to real newlines before parsing so grep/cut work correctly in both production and test environments.tests/unit/test_json_parsing.bats— 4 new tests (sectionPROGRESS DETECTION WITH COMMITTED WORK TESTS):TASKS_COMPLETED_THIS_LOOPin embedded RALPH_STATUSgit diffis zeroFILES_MODIFIEDfrom RALPH_STATUS whengit diffis zeroTASKS_COMPLETED_THIS_LOOPis zeroTest plan
npm testpasses 100% (456/456 tests)🤖 Generated with Claude Code