feat(pr-ledger): direct-push merges flip PRs to merged; API close endpoint #5508
gluecron[bot]🤖 botAI Reviewcommented 11d 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.
ccantynzAI Reviewcommented 11d 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.
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
The Vapron briefing's two Gluecron-side asks, delivered
1. Merged-state auto-detection (GitHub semantics). New
src/lib/pr-merge-detect.ts, wired intoonPostReceiveas fire-and-forget step 3b: on every branch push, any open PR whose head tip is reachable from the new base tip (git merge-base --is-ancestor) flips tomergedwithmergedAt/mergedBystamped and an activity-feed entry. Deleted head branches are left untouched (nothing to prove reachability with); git errors fail closed (never flip on a guess); the UPDATE re-assertsstate='open'so a concurrent endpoint-merge can't double-flip. This makes the Vapron agent's gate→merge→push flow show up truthfully on the PR page with zero behavior change on their side.2.
POST /api/v2/repos/:owner/:repo/pulls/:number/close. Author or write access; 409 with current state when the PR isn't open; activity-logged. The v2 merge endpoint already exists on current main (shipped Aug 7,performGatedMergechain) — the box-158 instance predates it and needs a build update to see both. Endpoint index now advertises merge + close.Tests pin the reachability decisions on a real throwaway repo (merged head, unmerged tip, orphan history, garbage shas → fail closed). 7/7 pass locally; typecheck clean.
🤖 Generated with Claude Code