Skip to content

feat(tooling): merge PRs that are behind lastcode/main - #660

Merged
lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/merge-behind-main
Nov 9, 2026
Merged

lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/merge-behind-main

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Problem

lastcode:merge only merged PRs that were up to date with lastcode/main, and the ruleset required it too. CI takes 25–30 minutes, so with many threads landing at once each merge made every other PR stale; one PR lost that race five times. Upstream T3 Code doesn't require PRs to be up to date, and its main CI stays green.

Fix

The lastcode/main ruleset no longer requires branches to be up to date (strict_required_status_checks_policy: false; already applied). With that off, GitHub reports a behind PR as CLEAN. The guarded merge now accepts one:

  • Merge states: still CLEAN only. BEHIND now means the up-to-date rule is back, and BLOCKED, DIRTY, UNSTABLE and UNKNOWN stay refused.
  • Instead of "head contains main": the base the PR's CI tested (baseRefOid) must still be in main, so a checkpoint rewrite still forces a rebase. A fresh git merge-tree must also show no conflicts against the current tip. Draft, exact-head, CI, review and lock guards are unchanged.
  • Carry check: lastcode-carry-ci.ts now models the squash that really lands. For a behind PR, Carry-Source-Base is the fork point, the parent is the current tip, and the tree is the PR merged onto it, which is the shape checkpoint replay already verifies. The merge reruns it against current main, because a newer merge can change the result. GitHub CI uses the same path, so a PR pushed while main moves no longer fails carry CI.
  • After merging: the wrapper prints the merge commit and a ready background command. The command waits for main's push CI run for that commit and exits with its result. lastcode-pr tells the lander to run it, end the turn, and fix forward or revert if it fails. This holds no lock and adds nothing to the merge itself.
  • Docs: lastcode-pr, upstream-fix, release.md and nightly-workflow.md no longer say to refresh or rerun CI because main moved.

Proof

  • New lifecycle cases (behind main, conflict with newer main, rewritten tested base) and a carry-ci case (behind PR compiled onto the current tip, then a conflicting tip) fail against lastcode/main's scripts and pass here.
  • vp run check:changed origin/lastcode/main passes.
  • The printed watch command was run against real main commits: exit 0 on a passed run, exit 1 on a failed one.

Local review: 1 round with gpt-6.1-terra (xhigh), approved; its one should (behind stacked PRs whose topic base has unsquashed parent commits) failed before this change too and is a follow-up.

Implemented with Claude Opus 5.5 through the Claude Code harness in T3 Code.

🤖 Generated with Claude Code

@lastobelus
lastobelus marked this pull request as ready for review November 9, 2026 01:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T01:17:17.335506Z d4c9af9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b006aa548

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/lastcode-merge.ts Resolved
lastobelus and others added 2 commits November 8, 2026 18:13
GitHub no longer requires lastcode/main PRs to be up to date, so
lastcode:merge accepts a PR whose CI passed on its head even when main has
moved. It checks that the tested base is still in main and that the head
merges cleanly onto the current tip, and the carry check now models the
squash that actually lands there. After merging it prints the merge commit
and how to confirm main's CI for it.

Carry-Group: incubator
Co-Authored-By: Claude <[email protected]>
The printed command waits for main's push run to register before watching
it, and the fallback names this PR's merge commit instead of main's tip.

Carry-Group: incubator
Co-Authored-By: Claude <[email protected]>
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@lastobelus
lastobelus force-pushed the lastcode/merge-behind-main branch from 6b006aa to d4c9af9 Compare November 9, 2026 01:15
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: d4c9af9052

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit 3cbee6a into lastcode/main Nov 9, 2026
20 checks passed
@lastobelus
lastobelus deleted the lastcode/merge-behind-main branch November 9, 2026 01:23
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