Skip to content

Cloudflare triage inspired improvements - #132

Merged
ArnabChatterjee20k merged 7 commits into
mainfrom
cloudflare-triage-improvements
Aug 25, 2026
Merged

Cloudflare triage inspired improvements#132
ArnabChatterjee20k merged 7 commits into
mainfrom
cloudflare-triage-improvements

Conversation

@ArnabChatterjee20k

@ArnabChatterjee20k ArnabChatterjee20k commented Aug 5, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Better issue-to-PR triage: diagnosis reuse + verify/eval guardrails

Architectural improvements to the issue-fixing cycle, inspired by Cloudflare's Astro issue triage writeup. All changes are opt-in with behavior-preserving defaults.

What changed

  1. Feed the verify diagnosis forward into the fix (b547e8a)
    The reproduce/verify stage already produces a structured verdict (root cause, impact, suggested fix, evidence), but it was only posted as a note and discarded — the fix agent then re-derived
    everything from scratch. That verdict is now carried on ProcessingInput and prepended to the fix prompt, so the fix starts from a confirmed root cause instead of re-litigating whether the bug is
    real. Skipped when the verdict is a bare conservative fallback (no details).

  2. verify_fail_open option (d10afc6)
    ReplyConfig.verify_fail_open (default true = current behavior). When the verify stage can't run (timeout / error / unsupported), the default assumes the bug is reproduced and fixes anyway.
    Setting this false instead asks the reporter for repro steps — biasing away from forcing a fix on uncertainty.

  3. Wire the regression gate (d10afc6)
    EvaluationConfig.fail_on_regression already existed but was never enforced — the after-fix eval only posted a comment. It's now wired: a successful attempt whose after-fix evaluation shows new
    failures or regressions is marked failed (triggering retry) instead of shipping the PR. Adds EvaluationResult::has_regressions().

  4. Enforce a real red→green contract ( 5184d2e )
    Adds opt-in EvaluationConfig.require_red_green (default false). Makes the "failing test first" step verifiable instead of self-reported. When enabled and a test tool is
    detected: Red — a dedicated agent run authors only a failing test before any fix, then the suite is re-run against baseline and must show a new test failure, else the bug
    isn't reproduced and the attempt fails; Fix — the fix prompt is told the failing test already exists and must be made to pass without weakening it; Green — the after-fix
    eval gate is forced on, failing the attempt if the test still fails. Adds EvaluationResult::has_new_test_failures(). Reuses CodeQualityEvaluator and the existing
    execute_with_attempt, so no new AgentRunner trait method or wrapper forwarding is needed.

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds diagnosis reuse, configurable verification fallback behavior, regression enforcement, and an opt-in red-to-green evaluation workflow.

  • Carries structured verification results into the fix-agent prompt.
  • Adds verify_fail_open and require_red_green configuration options with behavior-preserving defaults.
  • Adds red-phase test authoring and post-fix regression gates.
  • Extends evaluation helpers and timeline statuses for red-to-green outcomes.

Confidence Score: 5/5

The PR appears safe to merge because the previously reported workspace compilation failure has been corrected.

No blocking failure remains; the only exhaustive external ReplyConfig literal now initializes verify_fail_open, while the remaining construction sites use the complete default implementation or struct update syntax.

Important Files Changed

Filename Overview
crates/claudear-analysis/src/evaluation/types.rs Adds focused helpers for detecting new test failures and general evaluation regressions.
crates/claudear-config/src/config.rs Adds defaulted verification fallback and red-to-green settings; the previously reported exhaustive ReplyConfig construction issue is fixed.
crates/claudear-core/src/types.rs Adds serialized timeline statuses for red-green start, red confirmation, and green confirmation.
crates/claudear-e2e/src/config.rs Updates the exhaustive ReplyConfig literal with verify_fail_open, resolving the prior workspace compilation finding.
crates/claudear-engine/src/processing.rs Integrates verification diagnoses, configurable fail-open behavior, red-phase test authoring, and post-fix regression enforcement into issue processing.
crates/claudear-engine/src/watcher.rs Initializes the new optional diagnosis input at watcher-based processing entry points.
src/webhook/server.rs Initializes the new optional diagnosis input for webhook-triggered processing.

Reviews (7): Last reviewed commit: "linting" | Re-trigger Greptile

Comment thread crates/claudear-config/src/config.rs Outdated
Copilot AI lite review requested due to automatic review settings August 5, 2026 10:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

ArnabChatterjee20k added a commit that referenced this pull request Aug 5, 2026
The e2e config builder constructs ReplyConfig field-by-field, so the
new verify_fail_open field must be set explicitly. Addresses greptile
review comment on PR #132.
Copilot AI review requested due to automatic review settings August 5, 2026 10:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ArnabChatterjee20k ArnabChatterjee20k changed the title Cloudflare triage improvements Cloudflare triage inspired improvements Aug 5, 2026
Copilot AI review requested due to automatic review settings August 5, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 5, 2026 12:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ArnabChatterjee20k
ArnabChatterjee20k force-pushed the cloudflare-triage-improvements branch from e296ed0 to 00626a4 Compare August 16, 2026 09:59
Base automatically changed from feat/appwrite-mcp-agent to main August 25, 2026 11:12
The reproduce/verify stage already produces a structured verdict
(root cause, impact, suggested fix, evidence) but it was only posted
as a note and thrown away before the fix ran. Carry it on
ProcessingInput and prepend it to the fix prompt context so the fix
agent starts from a confirmed root cause instead of re-deriving one.
Three opt-in triage guardrails from the Cloudflare/Astro triage model:

- verify_fail_open (ReplyConfig, default true): when the reproduce/
  verify stage can't run (timeout/error/unsupported), setting this
  false asks the reporter for repro steps instead of forcing a fix.
- fail_on_regression (EvaluationConfig, already existed): now wired.
  A successful attempt whose after-fix eval shows new failures or
  regressions is failed and retried instead of shipping the PR.
- request_reporter_verification (ReplyConfig, default false): after a
  PR is created, ask the original reporter to confirm the fix resolves
  the issue on their end.
Drops request_reporter_verification and the post-PR reporter ping.
Keeps the diagnosis-forwarding, verify_fail_open, and regression-gate
guardrails.
The e2e config builder constructs ReplyConfig field-by-field, so the
new verify_fail_open field must be set explicitly. Addresses greptile
review comment on PR #132.
Adds opt-in evaluation.require_red_green (default false). When enabled
and a test tool is detected:

- Red phase: before the fix, a dedicated agent run authors a failing
  test only (no app code). The eval suite is re-run against the
  baseline; if no new test failure appears, the bug isn't reproduced
  and the attempt fails.
- Fix phase: the fix prompt is told the failing test already exists
  and to make it pass without weakening it.
- Green phase: the existing after-fix eval gate is forced on in
  red-green mode, so a test still failing after the fix fails the
  attempt.

Adds EvaluationResult::has_new_test_failures() (test-category only) and
a covering unit test.
The red-green phase previously ran invisibly inside Pending. Now it
emits dedicated timeline events and issue decisions:

- RedGreenStarted when the failing-test phase begins
- RedConfirmed / red_green_not_reproduced for the red assertion
- GreenConfirmed / not_green for the after-fix assertion

Also records red_green action runs (red_confirmed / not_reproduced /
green_confirmed / not_green) so the dashboard timeline reflects each
step instead of showing only a stalled Pending attempt.
@abnegate
abnegate force-pushed the cloudflare-triage-improvements branch from 00626a4 to bf01332 Compare August 25, 2026 11:12
@ArnabChatterjee20k
ArnabChatterjee20k merged commit 8c75611 into main Aug 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants