Skip to content

feat(pr): add deterministic pull-request merge gate (q pr gate) - #103

Draft
pulkitxm wants to merge 1 commit into
mainfrom
codex/implement-complete-quinjet-review-control-features
Draft

pulkitxm wants to merge 1 commit into
mainfrom
codex/implement-complete-quinjet-review-control-features

Conversation

@pulkitxm

Copy link
Copy Markdown
Owner

Motivation

  • Provide a single, deterministic merge verdict that aggregates checks, reviews, unresolved threads, branch freshness, conflicts, merge-queue state, and ruleset state so humans and automation can answer "What blocks this PR?" reliably.
  • Make that verdict machine-friendly with stable JSON, meaningful exit codes, and a watch mode for scripts and editor integrations.

Description

  • Add a new pr gate verb with --watch, --interval, and --json support and a PrGateArgs clap struct wired into the command tree and pull-request routing.
  • Implement the gate evaluation in src/cli/gate.rs, producing pass | pending | blocked plus categorized blockers and pending reasons derived from check runs, review decision, unresolved threads, draft/PR state, mergeable/merge-state, and merge-queue state, and exposing headOid and cache/review truncation provenance.
  • Return automation-friendly exit codes: 0 for pass, 1 for blocked, and 2 for pending (constant GATE_EXIT_PENDING added and used by watch mode).
  • Integrate the command into the CLI (src/cli/pr_verbs.rs, src/cli/verbs.rs, src/cli/pull_request.rs, and src/cli/mod.rs) and document it in docs/cli/pull-request/gate.md and the pull-request README.
  • Add unit tests for PullRequestGate::evaluate and behaviour rendering, and an end-to-end fake-GitHub regression test that exercises textual output, JSON output, and exit codes; also update the CLI capabilities test expectation to account for the new verb.

Testing

  • Ran cargo fmt --all -- --check, which succeeded.
  • Ran cargo clippy --all-targets --all-features --locked -- -D warnings, which succeeded after addressing warnings.
  • Ran targeted and full test suites: unit tests covering the gate and the full repository test suite (cargo test --all-features --locked) passed (including the new gate unit tests and the added fake-GitHub integration test).
  • Ran python3 scripts/check_comments.py to validate repository comment rules, which succeeded.
  • Note: an external optional MCP helper (make_pr) could not be exercised in this environment due to a missing runtime import in the local MCP server harness; this does not affect the gate implementation or its tests which passed locally.

Codex Task

@pulkitxm
pulkitxm deployed to pukbot-production August 29, 2026 11:01 — with GitHub Actions Active
@pulkitxm
pulkitxm deployed to pukbot-production August 29, 2026 11:01 — with GitHub Actions Active
@pukbot pukbot Bot added documentation Improvements or additions to documentation rust cli size/L labels Aug 29, 2026

This branch was successfully deployed

1 active deployment
pukbot-production — 558a1e5e Deployed Aug 29, 2026 by pulkitxm via Area labels #305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli codex documentation Improvements or additions to documentation rust size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant