Summary
Long-term direction for the claude-pr-review/quality-gate feature: replace the regex-grep approach with a structured contract between anthropics/claude-code-action (or a wrapper) and the gate. Grep is fragile by design and the marker-validation + multi-bot collision issues in this milestone are symptoms of that fragility — addressing them tactically buys time, but the root fix is a contract.
Why grep is the wrong long-term answer
- Prompt templates drift; regex misses become silent fail-open events
- Severity classification is currently encoded in human-readable prose, not data — every consumer that wants to act on it has to re-implement the parser
- Adding a new severity tier (e.g. "Note" or "Suggestion") requires every consumer to update their regex
- The grep can't reliably distinguish "Critical finding the reviewer raised" from "the word Critical appearing in the code being reviewed"
Proposal options
Option A — Hidden JSON block in the review comment
Emit a JSON block inside an HTML comment (invisible in rendered Markdown):
<!-- claude-pr-review-summary-v1
{
"schemaVersion": 1,
"findings": { "critical": 2, "high": 1, "medium": 4, "low": 0 },
"verdict": "blocking"
}
-->
Gate parses with jq. Versioned schema; backwards-compatible drift.
Option B — Use anthropics/claude-code-action outputs
Consume structured findings as step outputs (or as an uploaded artifact). Requires upstream cooperation but is the cleanest integration.
Option C — Separate structured artifact
Have the action upload a claude-review-findings.json artifact; the gate downloads and parses it. Decouples the user-facing comment from the machine-readable signal.
Blocked by
- Fail-open issue — fix first; structured contract doesn't matter if the caller silently swallows failures
- Validate-regex-against-upstream — informs whether upstream cooperation (Option B) is viable
- Multi-bot selection — the sentinel from Option A or comment ID from Option B is the same mechanism that fixes selection ambiguity
Acceptance criteria
Out of scope
- Choosing the severity taxonomy itself — orthogonal; this issue is about transport, not classification
Refs #176 #179
🤖 Generated by Claude Code on behalf of @cbeaulieu-gt
Summary
Long-term direction for the
claude-pr-review/quality-gatefeature: replace the regex-grep approach with a structured contract betweenanthropics/claude-code-action(or a wrapper) and the gate. Grep is fragile by design and the marker-validation + multi-bot collision issues in this milestone are symptoms of that fragility — addressing them tactically buys time, but the root fix is a contract.Why grep is the wrong long-term answer
Proposal options
Option A — Hidden JSON block in the review comment
Emit a JSON block inside an HTML comment (invisible in rendered Markdown):
Gate parses with
jq. Versioned schema; backwards-compatible drift.Option B — Use
anthropics/claude-code-actionoutputsConsume structured findings as step outputs (or as an uploaded artifact). Requires upstream cooperation but is the cleanest integration.
Option C — Separate structured artifact
Have the action upload a
claude-review-findings.jsonartifact; the gate downloads and parses it. Decouples the user-facing comment from the machine-readable signal.Blocked by
Acceptance criteria
anthropics/claude-code-actionpr-review/README.mdexplains the contractOut of scope
Refs #176 #179
🤖 Generated by Claude Code on behalf of @cbeaulieu-gt