Repository navigation
feat(lastcode): post a required status from the guarded merge - #781
Conversation
892d3c0 to
047a411
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 047a411ea8
ℹ️ 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".
A plain merge into lastcode/main skips the carry trailers and retained source ref that checkpoints replay. Guidance alone did not stop one. The guarded merge and checkpoint publisher now post a successful `lastcode:merge` commit status on the commit they write, under the main-write lock, so a ruleset without bypass actors can require it and GitHub refuses every other merge or push. Carry-Group: incubator Co-Authored-By: Claude <[email protected]>
047a411 to
175d3fa
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
A plain merge into
lastcode/main(a UI click orgh pr merge) skips the carry trailers and retained source ref that onlypnpm lastcode:mergewrites, and that breaks the carry check and the next checkpoint. The docs already said not to do it, but nothing enforced it, and every writer, including the plain merge that caused this, runs as the same account, which bypasses "Protect lastcode/main".Fix. The guarded merge and the checkpoint publisher now post a successful
lastcode:mergecommit status on the commit they are about to write, while holding the main-write lock. A second ruleset with no bypass actors can then require that status. GitHub combines the rules of every ruleset that targets a branch, and a bypass applies only to its own ruleset, so the owner's bypass on "Protect lastcode/main" does not skip it.lastcode:mergeposts the status on the PR head after every other check, waits for GitHub to report CLEAN, then merges. If anything fails after the status is posted, it resets the status tofailure; if that reset fails too, the error says so. Before posting, it accepts BLOCKED only when the base requires the status. A failed post is fatal only once the status is required.refs/lastcode/main-write-candidate(GitHub can only attach a status to a commit it already has), then posts the status and pushes main. A failed post only warns, so promotion keeps working until the ruleset exists. If the push is rejected and main isn't the candidate, it resets the status tofailure.lastcode:pr-gatestreats BLOCKED as "waiting for the guarded merge" only for PRs intolastcode/mainwhose base requires the status. Stacked PRs are unchanged.docs/lastcode/nightly-workflow.mdand thelastcode-prskill now describe what GitHub refuses, and give a step-by-step manual repair path.Ruleset to apply after this merges
This PR doesn't change any repository settings. Create this ruleset with
gh api --method POST repos/lastobelus/lastCode/rulesets --input require-guarded-merge.json:{ "name": "Require guarded merge", "target": "branch", "enforcement": "active", "conditions": { "ref_name": { "include": ["refs/heads/lastcode/main"], "exclude": [] } }, "bypass_actors": [], "rules": [ { "type": "required_status_checks", "parameters": { "strict_required_status_checks_policy": false, "do_not_enforce_on_create": false, "required_status_checks": [{ "context": "lastcode:merge" }] } } ] }Order:
lastcode:merge. The merge postslastcode:mergeon this PR's head, the first live proof that posting works.ghsigned in with permission to write commit statuses (gh auth status). Promotion warns "Could not approve … for promotion" otherwise.gh pr mergeon a throwaway PR is refused with "Required status check "lastcode:merge" is expected",lastcode:mergestill merges, and the next checkpoint still promotes.To roll back, delete the "Require guarded merge" ruleset.
Proof
ghthat behaves like GitHub with the ruleset on: the PR shows BLOCKED andpr mergeis refused until the status is posted. The new ruleset row fails against the old script ("not cleanly mergeable (MERGEABLE/BLOCKED)") and passes with this change. Another row (the status can't be posted and no ruleset requires it yet) fails on the round-2 code and passes now.successon the staged candidate and thenfailure. The test fails without the reset.pr-gates, GitHub CI and all checkpoint test files pass (245 tests), andvp run check:changed origin/lastcode/mainpasses.Follow-ups are noted in the merge report: reset the status after a successful merge, avoid the misleading reset message when nothing was posted, and read the branch rules once per run.
Local review: 3 rounds with GPT-6.1 Terra (xhigh), not clean (round 3's should fixed; churn-gate judge verdict MEDIUM, no cuts).
Built with Claude Opus 5.5 in Claude Code (T3 Code harness).
🤖 Generated with Claude Code