-
-
Notifications
You must be signed in to change notification settings - Fork 10
bug: Verdict parsing fails when AI outputs VERDICT: [PASS] with brackets #575
Copy link
Copy link
Closed
Labels
agent-qaTesting and verification agentTesting and verification agentarea-promptsAgent prompts and templatesAgent prompts and templatesarea-workflowsGitHub Actions workflowsGitHub Actions workflowsautomationAutomated workflows and processesAutomated workflows and processesbugSomething isn't workingSomething isn't workinggithub-actionsGitHub Actions workflow updatesGitHub Actions workflow updatespriority:P1Important: Affects user experience significantly, high business valueImportant: Affects user experience significantly, high business value
Metadata
Metadata
Assignees
Labels
agent-qaTesting and verification agentTesting and verification agentarea-promptsAgent prompts and templatesAgent prompts and templatesarea-workflowsGitHub Actions workflowsGitHub Actions workflowsautomationAutomated workflows and processesAutomated workflows and processesbugSomething isn't workingSomething isn't workinggithub-actionsGitHub Actions workflow updatesGitHub Actions workflow updatespriority:P1Important: Affects user experience significantly, high business valueImportant: Affects user experience significantly, high business value
Summary
The verdict parsing regex in
ai-reviewaction fails to extract verdicts when the AI includes brackets around the verdict token (e.g.,VERDICT: [PASS]instead ofVERDICT: PASS).Root Cause Analysis
The Problem
Prompt templates show options with brackets: Files like
spec-trace-requirements.md(line 54) andspec-check-completeness.md(line 60) show:AI interprets brackets literally: Instead of outputting
VERDICT: PASS, the AI outputsVERDICT: [PASS]including the brackets.Regex can't match brackets: The verdict parsing in
action.ymlline 705:verdict=$(echo "$output" | sed -n 's/.*VERDICT:[[:space:]]*\([A-Z_]*\).*/\1/p' | tail -n 1)This regex
[A-Z_]*cannot match[so when parsingVERDICT: [PASS]:VERDICT:there's a space (matched by[[:space:]]*)[but[is not in[A-Z_]NEEDS_REVIEW(line 721)Evidence
From PR #543 CI run 20588542269:
VERDICT: [PASS]with requirements traceability showing 100% coverageTRACE_VERDICT: NEEDS_REVIEWProposed Fixes
Option A: Fix the regex (Quick fix)
Update line 705 to handle optional brackets:
verdict=$(echo "$output" | sed -n 's/.*VERDICT:[[:space:]]*\[\?\([A-Z_]*\)\]\?.*/\1/p' | tail -n 1)Option B: Fix the prompts (Root cause)
Update prompt templates to show expected output without the OR-style bracket notation:
Option C: Both (Recommended)
Affected Files
.github/actions/ai-review/action.yml(parsing).github/prompts/spec-trace-requirements.md(prompt template).github/prompts/spec-check-completeness.md(prompt template)[OPTION1|OPTION2]notationImpact