Skip to content

feat: add AI merge gate and documentation drift detector#132

Merged
JacobPEvans merged 7 commits intomainfrom
feat/ai-merge-gate-and-doc-drift
Apr 8, 2026
Merged

feat: add AI merge gate and documentation drift detector#132
JacobPEvans merged 7 commits intomainfrom
feat/ai-merge-gate-and-doc-drift

Conversation

@JacobPEvans
Copy link
Copy Markdown
Owner

Summary

  • _ai-merge-gate.yml — Reusable status aggregator. Polls for Copilot gh-aw agent check runs on the PR, waits for completion, reports single pass/fail. Branch protection requires only "AI Merge Gate" instead of N individual checks.
  • gh-aw-documentation-drift.md — Copilot cloud agent triggered on push to main. Compares code changes against docs (README, docs/, docstrings). Opens draft PR with fixes when drift detected. Free with GitHub subscription.

Architecture

PR opened → AI Merge Gate (polls for agent checks) → pass/fail
Code merged → doc-drift agent (detects stale docs) → draft fix PR

The merge gate is a status aggregator, not an executor. Agents run independently via GitHub's Copilot infrastructure. The gate just waits for them and reports.

Test plan

  • Create test PR, verify AI Merge Gate passes (with or without agent checks)
  • Merge code-only change to main, verify doc-drift agent triggers
  • Deploy thin callers to consumer repos (parallel PRs follow)

🤖 Generated with Claude Code

Add two new workflows:

1. _ai-merge-gate.yml — reusable status aggregator that waits for
   Copilot gh-aw agent checks to complete and reports a single
   pass/fail. Branch protection requires only "AI Merge Gate"
   instead of individually configuring each AI workflow.

2. gh-aw-documentation-drift.md — Copilot cloud agent that detects
   documentation drift when code changes on main aren't reflected
   in docs. Opens draft PRs with targeted fixes. Free with GitHub
   subscription, uses signed commits.

(claude)
@JacobPEvans JacobPEvans added type:feature Feature - New feature or request (semver: MINOR) priority:high High - Should be addressed soon size:m M - Moderate effort, 1-2 days labels Apr 7, 2026
Copilot AI review requested due to automatic review settings April 7, 2026 09:51
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two automation workflows to centralize AI-related gating and keep documentation aligned with code in this reusable GitHub Actions workflows repository.

Changes:

  • Introduces a reusable “AI Merge Gate” workflow to aggregate Copilot agent check results into a single required status.
  • Adds a Copilot agent workflow that detects documentation drift on pushes to main and opens a draft PR with fixes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/_ai-merge-gate.yml New reusable status aggregator workflow intended to wait for Copilot-related checks and report a single pass/fail.
.github/workflows/gh-aw-documentation-drift.md New Copilot agent definition for post-merge documentation drift detection and automated draft PR creation.

- Add permissions + concurrency to dogfood caller (fixes CodeQL)
- Remove unused required_checks input from _ai-merge-gate.yml
- Add workflow_dispatch trigger to _ai-merge-gate.yml
- Add bash: true to doc-drift agent tools (needed for git/grep/find)
- Fix multi-commit push handling in doc-drift (use before..after range)

(claude)
Rewrote _ai-merge-gate.yml from 60-line polling script to 5-line
native gh CLI check. No custom scripts — single API call verifies
Copilot agent check status. Slimmed dogfood caller to 6 lines.

(claude)
Our custom gh-aw-documentation-drift.md was reinventing what GitHub Next
already maintains. Replace with the official githubnext/agentics/update-docs
template (sourced via gh aw add). Follows the same pattern as our other
5 gh-aw agents which are also sourced from githubnext/agentics.

(claude)
Copilot setup is an AI workflow and belongs in ai-workflows, not .github.
Moved from JacobPEvans/.github/_copilot-setup-steps.yml — identical
functionality, correct source of truth.

Nix repos (nix-darwin, nix-ai) will be updated to call this in follow-up
PRs. Non-Nix repos define their own copilot-setup-steps.yml with
repo-specific tooling.

(claude)
Official agentics templates belong in individual repos via gh aw add,
not copied into ai-workflows. No custom prompts here.

(claude)
@JacobPEvans JacobPEvans merged commit 0f255e1 into main Apr 8, 2026
4 checks passed
@JacobPEvans JacobPEvans deleted the feat/ai-merge-gate-and-doc-drift branch April 8, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:high High - Should be addressed soon size:m M - Moderate effort, 1-2 days type:feature Feature - New feature or request (semver: MINOR)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants