Current state
CI.md defines local pre-push checks, focused test selection, and CI-only coverage, but it does not define what an agent or contributor must do after pushing a PR.
As a result, PR creation can be treated as completion even while:
- required Actions or CodeQL checks are pending or failing;
- review feedback exists in GitHub reviews, inline threads, or issue comments;
- Greptile reviewed an older head commit or has unresolved comments;
- a deterministic failure is repeatedly rerun instead of fixed.
A documentation-only approach was explored in #4832 and intentionally closed so the workflow and automation boundary can be designed first.
Desired state
Define one reliable post-push monitoring and remediation workflow, then document the agreed contract in CI.md.
The design should cover:
- Verify the remote PR head SHA matches the local commit before waiting for or triggering reviews.
- Monitor all required Actions shards, CodeQL, synthetic tests, and other installed checks.
- Inspect human reviews, changes-requested states, issue comments, inline comments, and unresolved review threads—not only check runs.
- When Greptile is configured, require a current-head 5/5 score with zero unresolved Greptile threads.
- On actionable failures, inspect the full context, fix the root cause, run focused local validation, push to the same PR branch, and restart monitoring for the new head.
- Rerun without a code change only for credible flaky or external failures.
- Stop only when the PR is mergeable, required checks are green/neutral, and actionable feedback is resolved—or report a concrete external blocker.
Design questions
- Should this remain an agent/contributor policy in
CI.md, become a reusable local command, or use a GitHub App/workflow?
- What permissions are safe for automated fixes, especially for fork PRs and untrusted code?
- How should the loop avoid stale review scores, duplicate Greptile triggers, infinite fix cycles, and unauthorized thread resolution?
- Which reviews are mandatory versus advisory, and how should unavailable third-party services affect the exit gate?
- Should monitoring stop at “ready to merge,” or may automation enable/perform merge under repository rules?
Acceptance criteria
Current state
CI.mddefines local pre-push checks, focused test selection, and CI-only coverage, but it does not define what an agent or contributor must do after pushing a PR.As a result, PR creation can be treated as completion even while:
A documentation-only approach was explored in #4832 and intentionally closed so the workflow and automation boundary can be designed first.
Desired state
Define one reliable post-push monitoring and remediation workflow, then document the agreed contract in
CI.md.The design should cover:
Design questions
CI.md, become a reusable local command, or use a GitHub App/workflow?Acceptance criteria
CI.mdis updated only after the workflow design is agreed.