Skip to content

Commit b26af4e

Browse files
committed
Fix: Clarify self-review logic - only pass after verifying analysis is complete
1 parent 2b6fe66 commit b26af4e

File tree

1 file changed

+34
-38
lines changed

1 file changed

+34
-38
lines changed

.github/workflows/agentready-dev-issue-pr.yml

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -181,41 +181,6 @@ jobs:
181181
182182
Do NOT post any comment yet - you will self-review your analysis first.
183183
184-
- name: Extract analysis decision
185-
if: steps.issue-context.outputs.skip_pr_creation != 'true'
186-
id: extract-decision
187-
run: |
188-
if [ -f .github/agentready-dev-logs/analysis-decision.txt ]; then
189-
DECISION=$(cat .github/agentready-dev-logs/analysis-decision.txt | tr -d '\n' | head -c 50)
190-
# Remove "OUTPUT=" prefix if present
191-
DECISION=$(echo "$DECISION" | sed 's/^OUTPUT=//' | sed 's/^output=//')
192-
# Extract just the value (create_pr or provide_feedback)
193-
DECISION=$(echo "$DECISION" | grep -oE "(create_pr|provide_feedback)" | head -1)
194-
if [ -z "$DECISION" ]; then
195-
DECISION="provide_feedback"
196-
fi
197-
echo "decision=$DECISION" >> $GITHUB_OUTPUT
198-
else
199-
echo "decision=provide_feedback" >> $GITHUB_OUTPUT
200-
echo "Warning: Decision file not found, defaulting to provide_feedback" >&2
201-
fi
202-
203-
if [ -f .github/agentready-dev-logs/analysis-reasoning.txt ]; then
204-
REASONING=$(cat .github/agentready-dev-logs/analysis-reasoning.txt)
205-
echo "reasoning<<EOF" >> $GITHUB_OUTPUT
206-
echo "$REASONING" >> $GITHUB_OUTPUT
207-
echo "EOF" >> $GITHUB_OUTPUT
208-
else
209-
echo "reasoning=Analysis completed" >> $GITHUB_OUTPUT
210-
fi
211-
212-
if [ -f .github/agentready-dev-logs/analysis-branch.txt ]; then
213-
BRANCH_SUGGESTION=$(cat .github/agentready-dev-logs/analysis-branch.txt | tr -d '\n' | head -c 50)
214-
echo "branch_suggestion=$BRANCH_SUGGESTION" >> $GITHUB_OUTPUT
215-
else
216-
echo "branch_suggestion=" >> $GITHUB_OUTPUT
217-
fi
218-
219184
- name: Verify analysis files exist
220185
if: steps.issue-context.outputs.skip_pr_creation != 'true'
221186
id: verify-analysis-files
@@ -235,6 +200,33 @@ jobs:
235200
echo "✅ Analysis files verified"
236201
echo "files_exist=true" >> $GITHUB_OUTPUT
237202
203+
- name: Extract analysis decision
204+
if: steps.issue-context.outputs.skip_pr_creation != 'true' && steps.verify-analysis-files.outputs.files_exist == 'true'
205+
id: extract-decision
206+
run: |
207+
DECISION=$(cat .github/agentready-dev-logs/analysis-decision.txt | tr -d '\n' | head -c 50)
208+
# Remove "OUTPUT=" prefix if present
209+
DECISION=$(echo "$DECISION" | sed 's/^OUTPUT=//' | sed 's/^output=//')
210+
# Extract just the value (create_pr or provide_feedback)
211+
DECISION=$(echo "$DECISION" | grep -oE "(create_pr|provide_feedback)" | head -1)
212+
if [ -z "$DECISION" ]; then
213+
echo "ERROR: Invalid decision value in analysis-decision.txt. Expected 'create_pr' or 'provide_feedback'." >&2
214+
exit 1
215+
fi
216+
echo "decision=$DECISION" >> $GITHUB_OUTPUT
217+
218+
REASONING=$(cat .github/agentready-dev-logs/analysis-reasoning.txt)
219+
echo "reasoning<<EOF" >> $GITHUB_OUTPUT
220+
echo "$REASONING" >> $GITHUB_OUTPUT
221+
echo "EOF" >> $GITHUB_OUTPUT
222+
223+
if [ -f .github/agentready-dev-logs/analysis-branch.txt ]; then
224+
BRANCH_SUGGESTION=$(cat .github/agentready-dev-logs/analysis-branch.txt | tr -d '\n' | head -c 50)
225+
echo "branch_suggestion=$BRANCH_SUGGESTION" >> $GITHUB_OUTPUT
226+
else
227+
echo "branch_suggestion=" >> $GITHUB_OUTPUT
228+
fi
229+
238230
- name: Self-review issue analysis
239231
if: steps.issue-context.outputs.skip_pr_creation != 'true' && steps.extract-decision.outputs.decision != '' && steps.verify-analysis-files.outputs.files_exist == 'true'
240232
id: self-review-analysis
@@ -255,10 +247,14 @@ jobs:
255247
3. Is your analysis thorough and accurate?
256248
4. Does your reasoning help humans make informed decisions?
257249
258-
If you find issues with your analysis, update the decision/reasoning files and write REVIEW_PASSED=true.
259-
If your analysis is comprehensive and accurate, write REVIEW_PASSED=true to .github/agentready-dev-logs/analysis-review-passed.txt.
250+
If you find issues with your analysis that need to be added:
251+
- Update the decision/reasoning files with the improved analysis
252+
- After updating, write REVIEW_PASSED=true to .github/agentready-dev-logs/analysis-review-passed.txt
253+
254+
If your analysis is comprehensive and accurate (no issues found):
255+
- Write REVIEW_PASSED=true to .github/agentready-dev-logs/analysis-review-passed.txt
260256
261-
The goal is to ensure the issue is thoroughly analyzed before proceeding.
257+
The goal is to ensure the issue is thoroughly analyzed before proceeding. Only write REVIEW_PASSED=true after you've verified the analysis is complete and accurate.
262258
263259
Do NOT post any comment yet.
264260

0 commit comments

Comments
 (0)