Skip to content

[WIP] The implement-review loop can run indefinitely if the reviewer keeps req - #286

Closed
bamdadd wants to merge 1 commit into
mainfrom
lintel/feat/870851c1-the-implement-review-loop-can-run-indefi
Closed

[WIP] The implement-review loop can run indefinitely if the reviewer keeps req#286
bamdadd wants to merge 1 commit into
mainfrom
lintel/feat/870851c1-the-implement-review-loop-can-run-indefi

Conversation

@bamdadd

@bamdadd bamdadd commented Apr 7, 2026

Copy link
Copy Markdown
Owner

⚠️ This is a draft PR created by Lintel after a pipeline failure.
The automated workflow could not complete successfully. An engineer should review the changes, fix any issues, and mark the PR as ready.

Summary

Enforce MAX_REVIEW_CYCLES in the implement-review loop by adding a force_approve node and cycle guard in route_after_review, making the limit configurable per-project (default 3), emitting a ReviewCycleLimitReached guardrail event, annotating the PR with a warning, and tracking cycle counts in pipeline stage metadata.

Changes

  • Add ReviewCycleLimitReached event to contracts
  • Add max_review_cycles field to Project model and create DB migration
  • Update WorkflowState schema and rename config constant
  • Add force_approve node and update route_after_review edge logic in graph
  • Update review node to emit warning annotation at cycle limit
  • Update pipeline projection to track review cycle metadata
  • Add notification rule trigger for ReviewCycleLimitReached event
  • Write tests for graph edge routing with cycle limit enforcement
  • Write tests for review node and force_approve node behavior
  • Write tests for Project model max_review_cycles field and API endpoints

Context

The implement-review loop can run indefinitely if the reviewer keeps requesting changes that the implementer cannot resolve. MAX_REVIEW_CYCLES=2 exists but is not enforced consistently, and there is no escalation path when the limit is hit.

Implementation:

  1. Enforce MAX_REVIEW_CYCLES strictly in the graph edge logic — after N cycles, force-approve with a warning annotation
  2. Make MAX_REVIEW_CYCLES configurable per-project (default 3)
  3. When circuit breaker trips, add a review_warning to the PR description explaining the limit was reached
  4. Emit a guardrail event so notification rules can alert on stuck reviews
  5. Track cycle count in pipeline stage metadata for observability

Raised by Lintel 🤖

@bamdadd

bamdadd commented Apr 7, 2026

Copy link
Copy Markdown
Owner Author

Closing stub PR — superseded by PR #288 with actual implementation.

@bamdadd bamdadd closed this Apr 7, 2026
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.

1 participant