EasyAgentsPython 3

PR Readiness Gate

Decide whether an agent-created pull request has enough checks, approval, and proof artifacts to merge.

25m2 sample tests5 hidden tests

Implement pr_blockers(checks, reviews, artifacts, required_checks), a merge-readiness gate for agent-created pull requests.

Requirements

  • checks is a list of dictionaries with name and status.
  • Required check names must exist and have status "passed".
  • Missing checks produce missing_check:<name>.
  • Failing checks produce failing_check:<name>.
  • At least one review with state "approved" is required.
  • Any review with state "changes_requested" blocks merge.
  • Artifacts must contain "diff" and "tests".
  • Return blockers sorted lexicographically.

Example

python
1checks = [{"name": "test", "status": "passed"}] 2reviews = [{"user": "u", "state": "approved"}] 3assert pr_blockers(checks, reviews, ["diff", "tests"], ["test"]) == []

Constraints

  • Keep the result deterministic.
  • Leave inputs untouched.

Editor