fix(ci): server-side merges fire push workflows; gated chain gets the ancestry guard #5469
ccantynzAI Reviewcommented 24d ago
AI Triage
(no summary)
Priority: medium Risk area: mixed
Suggested labels: (no label suggestions) Suggested reviewers: (no reviewer suggestions)
Suggestions only — nothing has been applied. The PR author stays in control.
gluecron[bot]🤖 botAI Reviewcommented 24d ago
AI review unavailable
The platform's AI balance is exhausted, so AI generation is temporarily unavailable. Nothing was lost. You can queue this as a repair for the internal agent from the repository's Health page, or try again once the balance is restored. The PR is otherwise unchanged.
Cross-repo impact
See what breaks downstream if this PR merges.
⮌ Merged
This pull request was merged into main.
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts
Two gaps found by PR #5468's live test (it merged to main and produced no verify-deploy run at all):
1. Merges never fired
on: pushworkflows. A server-side merge advances the base ref directly — the receive-pack hook that callssyncAndEnqueuePushWorkflowsnever sees it. On a platform where PR merges are the primary way main moves,on: push: branches: [main]effectively never fired. New shared helperenqueuePushWorkflowsForBranchAdvance()(resolves the post-merge tip, enqueues matching workflows, never throws) is called from all five merge sites:performMerge(ai-loop/auto-merge/autopilot), the gated v2/MCP chain, the merge button, and both merge-queue success exits.2. The gated chain was still missing the incident-day ancestry guard.
pr-merge-gated.ts— the exact path MCP merges take — had a bareupdate-refwith nomerge-base --is-ancestorcheck: the INCIDENT 2026-08-08 class that discarded five merged PRs. Guard added, mirroringpr-merge.ts; a stale branch now routes throughmergeWithAutoResolveinstead of replacing the base.Structural tests pin all five call sites and the guard in all three update-ref paths. This PR's own merge is the live test: merging it via MCP goes through the gated chain, which (once deployed... note: the current deployed code still lacks the hook, so the proof run comes from the next merge after this one deploys).
🤖 Generated with Claude Code