Skip to content

Add CR-7's unwired merge preflight - #412

Closed
BunsDev wants to merge 1 commit into
mainfrom
cr7-merge-preflight
Closed

BunsDev wants to merge 1 commit into
mainfrom
cr7-merge-preflight

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

This adds CR-7's merge preflight (#326, AC4) as a pure, unwired decision next to the draft/intent model. It sends nothing to GitHub. The questions on #326 are still unanswered, so it adds no write code, read, IPC channel or UI.

mergePreflight(reviewed, facts) returns one of three results:

  • reconfirm: the account, repository, PR, head, base SHA or base ref changed. It never adapts to the new state.
  • unavailable, with Open in GitHub as the fallback: the PR is closed, merged, draft, conflicting, blocked, behind or unknown, policy is unreadable, or a merge queue is required. There's no rules bypass and no queue enrollment.
  • offer: only the methods the repository explicitly allows, with the reviewed head as expectedHeadSha. unstable is offered, with its state attached.

Check counts and model findings aren't inputs. The exact-shape check refuses them, so they can't count as permission. mergeOperation builds a merge operation only from a method the offer contains.

Limits. No read supplies MergeFacts yet; the merge increment adds that fresh main-owned read. The expected head SHA isn't an atomic base lock: the adapter repeats the preflight right before dispatch, and GitHub enforces its rules.

Validation (local, macOS, 82b4bf1):

  • Red first: all 6 tests failed against a stub.
  • pnpm build && pnpm test: exit 0. Desktop: 1,944 passed, 17 skipped, 0 failed.
  • pnpm test:e2e: exit 0. 451 desktop and 7 site tests passed, 7 skipped.
  • Hosted CI on 82b4bf1: all checks passed, including the required unit + e2e (macOS).

This is independent of #410. Evidence. Mock only: no merge, comment, review or live write.

Refs #326, #319.

🤖 Generated with Claude Code

mergePreflight decides, from the reviewed revision and one set of fresh
GitHub facts, whether Merge may be offered and with which methods.

A changed account, repository, PR, head or target asks for renewed
confirmation. Closed, draft, conflicting, blocked, behind, unknown,
queue-required and unreadable states stay unavailable, with Open in GitHub
as the fallback. An offer lists only explicitly allowed methods and carries
the reviewed head as expectedHeadSha. Check counts and model findings are
refused as inputs. mergeOperation builds a merge operation only from an
offered method.

Pure and unwired: no GitHub request, read, IPC channel or UI. Refs #326.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 25, 2026 3:08am UTC

Request Review

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

main a10fcc4 cr7-merge-preflight 82b4bf1 +/-
65% 65% 0%
View coverage of the 2 most impacted files.
File main a10fcc4 cr7-merge-preflight 82b4bf1 +/-
apps/desktop/sr.../code-review.ts 100% 100% 0%
apps/desktop/sr...ge-preflight.ts 0% 100% +100%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

BunsDev commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #416, now verified merged as b3aad0d85b91f479d5415abdec15d9f74a5dd61c. Protected queue run 40420085521 passed (468 desktop tests, 4 skips, 7 site tests). Git's clean merge of reviewed integration head fffd07ec7006347142453217e6bdf899373ff31d onto the squash parent produces the exact landed tree.

The copied preflight implementation, tests and receipt match this PR at integration commit e988cdc; later changes share the merge types and document the connected adapter. The integration includes the reviewed write-race and uncertainty repairs. This closure records supersession, not live-write or human acceptance of #326. Your source worktree remains protected; no owner release or deletion is performed here.

@BunsDev BunsDev closed this Oct 27, 2026

This branch was successfully deployed

1 active deployment
Preview — 82b4bf11 Deployed Oct 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant