Skip to content

CR-7: merge the reviewed head through the gh login (#326) - #414

Closed
BunsDev wants to merge 2 commits into
cr7-write-submitfrom
cr7-merge
Closed

BunsDev wants to merge 2 commits into
cr7-write-submitfrom
cr7-merge

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Part of #326, the second of three increments. Stacked on #413 (cr7-write-submit). It carries #412's preflight commit (e988cdc, the same change as #412's 82b4bf1, plus a docs conflict resolution), so #412 can merge first or be closed in favour of this one.

What this adds

  • Merge in the header. It's disabled until the PR has loaded and main has answered for this account. It opens a panel with:

    • method radios for only the methods the repository allows;
    • or the reason it can't merge, with Open on GitHub;
    • then a preview naming the account, owner/repo #n and head, and a confirm button.
  • Fresh facts in main for every check, preview and submit:

    • push permission;
    • allow_merge_commit, allow_squash_merge and allow_rebase_merge;
    • GitHub's mergeable and mergeable_state;
    • the target branch's rules, to see whether a merge queue is required.

    Add CR-7's unwired merge preflight #412's mergePreflight decides.

  • What is never offered: unknown, blocked, behind, conflicting, draft or queue-required states, and unreadable settings or rules. Check counts and model findings aren't inputs.

  • One fixed PUT repos/{o}/{r}/pulls/{n}/merge, with sha = the reviewed head from the durable intent and an offered merge_method. These all send nothing and spend the preview:

    • a moved head or target;
    • a withdrawn method;
    • newly blocked state;
    • lost push permission;
    • another account.
  • Unclear outcomes stay unknown and block the PR. A read-back confirms the merge only if the PR merged, by this account, at that head. Merged by someone else proves nothing.

Validation

  • pnpm build && pnpm test && pnpm test:e2e: exit 0.
    • Desktop unit: 1,969 passed, 17 skipped.
    • Other unit suites: 180 passed, 5 skipped.
    • Desktop E2E: 460 passed, 7 skipped.
    • Site E2E: 7 passed.
  • New tests:
    • 7 service unit tests;
    • an IPC merge through the compiled main handler and the real gh transport;
    • a static guard pinning exactly one PUT, to the merge endpoint, carrying the intent's head;
    • 4 Electron journeys: success with a double click, blocked state and missing push permission, a head move, and a crash → restart → reconcile.
  • Found and fixed: before the PR loaded, the fallback Merge button was enabled and did nothing.
  • Mock and synthetic gh only. No live merge was run, and no real PR was merged.

Evidence: docs/reviews/2026-10-25-cr7-merge.md. Design: docs/design/code-review.md (CR-7 merge).

Please don't merge without Val's go-ahead.

🤖 Generated with Claude Code

BunsDev and others added 2 commits October 25, 2026 17:57
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]>
The second write increment. The header's Merge opens a panel; main reads
push permission, the repository's allowed methods, GitHub's merge state and
the target branch's rules fresh for every check, preview and submit, and
#412's mergePreflight decides what may be offered.

- One PUT, repos/{o}/{r}/pulls/{n}/merge, with sha = the reviewed head from
  the durable intent and an offered merge_method. A moved head, a moved
  target or a withdrawn method between preview and merge sends nothing.
- Unknown, blocked or queue-required state and unreadable settings or rules
  stay unavailable with Open on GitHub; check counts and model findings are
  not inputs.
- An unclear merge is unknown, blocks the PR, and is confirmed only if the
  PR merged by this account at that head.
- Unit, IPC and Electron coverage against a synthetic gh. No live merge.

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 11:36pm UTC

Request Review

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

cr7-write-submit a10fcc4 cr7-merge 09b5e4b +/-
65% 65% 0%
View coverage of the 10 most impacted files.
File cr7-write-submit a10fcc4 cr7-merge 09b5e4b +/-
apps/desktop/sr...ions/intents.ts 100% 98% -2%
apps/desktop/sr...ain/commands.ts 87% 87% 0%
apps/store-desk...rc/main/demo.ts 95% 95% 0%
apps/desktop/sr.../code-review.ts 100% 100% 0%
apps/desktop/sr...review/patch.ts 98% 98% 0%
apps/desktop/sr...eview/github.ts 99% 99% 0%
apps/desktop/sr...rite-service.ts 0% 96% +96%
apps/desktop/sr...review-write.ts 0% 99% +99%
apps/desktop/sr...ons/write-gh.ts 0% 100% +100%
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.

This PR's published head is an ancestor of the reviewed integration head. 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 — 09b5e4b2 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