fix: robust KAIZEN_IMPEDIMENTS JSON extraction (kaizen #313)#252
Merged
fix: robust KAIZEN_IMPEDIMENTS JSON extraction (kaizen #313)#252
Conversation
…aizen qwibitai#313) The JSON extraction pipeline could fail when STDOUT didn't contain the KAIZEN_IMPEDIMENTS: prefix (just raw JSON), or when STDOUT was empty but the COMMAND contained a heredoc with the JSON body. Added three fallback layers: 1. Primary: extract from STDOUT after KAIZEN_IMPEDIMENTS: prefix (existing) 2. Fallback 1: try parsing STDOUT directly as JSON array (no prefix needed) 3. Fallback 2: extract heredoc body from full COMMAND text 4. Fallback 3: extract from CMD_LINE inline echo (existing) Added 3 new test cases covering the qwibitai#313 edge cases (81 total, all pass). Run tag: batch-260321-1108-3ef8/run-2 Closes Garsson-io/kaizen#313 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The cross-worktree gate clearing tests expected 0 state files after clearing, but mark_reflection_done() (from PR #249, kaizen #288) creates kaizen-done-* marker files. Updated assertions to exclude these expected markers when counting remaining state files. Fixes 2 pre-existing test failures (62 total, all pass now). Run tag: batch-260321-1108-3ef8/run-2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Accept upstream's more precise approach (ls pr-kaizen-* instead of filtering with grep -v) for the interaction matrix tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
pr-kaizen-clear.shso KAIZEN_IMPEDIMENTS declarations succeed on first submissionKAIZEN_IMPEDIMENTS:prefix (raw JSON array) or STDOUT is empty (heredoc body extraction)Root Cause
The original extraction only tried two paths: STDOUT with prefix, then CMD_LINE (which has heredoc body stripped). When STDOUT contained just the JSON without the prefix, both paths failed.
Changes
Test plan
Closes Garsson-io/kaizen#313
Run tag: batch-260321-1108-3ef8/run-2
🤖 Generated with Claude Code