Skip to content

Cloudflare triage inspired improvements - #132

Open
ArnabChatterjee20k wants to merge 7 commits into
feat/appwrite-mcp-agentfrom
cloudflare-triage-improvements
Open

Cloudflare triage inspired improvements#132
ArnabChatterjee20k wants to merge 7 commits into
feat/appwrite-mcp-agentfrom
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.)

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.
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds configurable verification failure behavior, carries verified diagnoses into fix prompts, enforces optional regression and red→green gates, and records corresponding timeline events.

  • Adds verify_fail_open and require_red_green configuration with behavior-preserving defaults.
  • Reuses verification diagnoses during issue fixing.
  • Evaluates newly authored failing tests before fixes and regression results afterward.
  • Updates all affected ProcessingInput and ReplyConfig construction sites.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported workspace compilation failure is resolved because the affected ReplyConfig literal now initializes verify_fail_open, and no blocking failure remains.

Important Files Changed

Filename Overview
crates/claudear-analysis/src/evaluation/types.rs Adds helpers for detecting new test failures and general regressions from evaluation deltas.
crates/claudear-config/src/config.rs Adds defaulted verification failure and red→green configuration options.
crates/claudear-core/src/types.rs Adds timeline statuses for red→green execution milestones.
crates/claudear-e2e/src/config.rs Initializes the new ReplyConfig field, resolving the previously reported workspace compilation failure.
crates/claudear-engine/src/processing.rs Carries verification diagnoses into fixes and implements optional red-phase and post-fix regression gates.
crates/claudear-engine/src/watcher.rs Initializes the new optional diagnosis field at watcher processing entry points.
src/webhook/server.rs Initializes the new optional diagnosis field for webhook-triggered processing.

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

Comment thread crates/claudear-config/src/config.rs Outdated
Drops request_reporter_verification and the post-PR reporter ping.
Keeps the diagnosis-forwarding, verify_fail_open, and regression-gate
guardrails.
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.

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
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.
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.

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.
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.

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