Repository navigation
feat(pr-pipeline): accept native stack layers that target main - #15400
Conversation
Owner decision Q40: a layer of a native GitHub stack runs its lanes when the stack's base (pull_request.stack.base.ref) is the default branch. Lane scripts, actions, config and lists still load only from the default branch, never from the layer's base branch. - check-trusted-trigger accepts such a layer and outputs the stack base's SHA as base-sha, never the lower layer's unmerged head. - check-trusted-base accepts the layer and still fails unless that SHA is on the default branch. - ci-status reads its hold config at the default branch tip for such a layer instead of the event's base SHA (the layer below). - ADR 0055 addendum, pr-run-activity.md, the gate README and the pr-pipeline changelog record the new rule and the sandbox evidence. Co-authored-by: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
The pr-pipeline convention releases from fragments, so the hand CHANGELOG entry moves to .changes/pr-pipeline/. Co-authored-by: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee8e484cb3
ℹ️ 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".
The gate's base-sha for a stack layer is the stack base on main, which lanes check out. pr-review-main also used it as the review's diff base, so a layer's review read every unmerged layer below it. A new gate output, pr-base-sha, carries the PR's own base.sha as a diff base only, and pr-review-main's trigger and legs read it. Co-authored-by: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
|
claude-review reviewed Code review (blocking only): accept native stack layers that target main (#15400)Scope: full diff, all 13 changed files, every hunk read. This lane already reviewed an earlier head, so this review reports blocking findings only. Result: no blocking findings. Prior finding, now fixed. The earlier finding (prior post) was that when
What I checked:
Known gaps the PR leaves to follow-ups (not findings): the run-activity lanes still diff a layer against Settled threads: the thread at Closing issue: none. The PR implements owner decision Q40 directly, so there are no acceptance criteria to check. Manifests: no Spend: none. Verification: I ran nothing. The test counts and sandbox runs in the PR description are the author's claims and I have not verified them. I found no embedded instructions in the PR context, the settled-threads file or the prior-findings file. |
…ckage plan-test-lanes refused .github/scripts/pr-require-checks/, which no Node package in the test-node lane holds. The pr-merge package already tests pr-require-checks.yml and takes every workflow as a trigger. Co-authored-by: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
|
claude-security-review reviewed Security review: PR #15400 at
|
The link checker reads the stack page as 404 without a session; the layer PR and run links beside it carry the evidence. Co-authored-by: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
When ci-status cannot read the default branch tip, a stack layer fell back to its event base SHA, the unmerged layer below, and read merge-holds.mjs and the hold config there. It now falls back to pull_request.stack.base.sha, a default-branch commit, and fails red when the event names none. A PR into the default branch keeps its own base SHA as the fallback. Co-authored-by: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
Take #15400's pr-run-activity.md paragraph (native stack layers into the default branch run their lanes), keeping this branch's step 3 correction for every other non-default base. Update stacked-prs.md to match: the review and run lanes accept such a layer, the merge and issue lanes do not yet (#15410), so unattended lanes still do not stack. Drop the #when-to-stack heading anchors (Codex review). Co-authored-by: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
No related issue: implements owner decision Q40 (2026-11-11) on stacked PRs directly.
Summary
The lanes now accept a PR that is a layer of a native GitHub stack when the stack's base (
pull_request.stack.base.ref) is the default branch. Every lane script, action, config and list still loads from the default branch, never from the layer's base branch, so no unmerged code runs with lane credentials. The trust property moves from "the PR targets main" to "lane code is read from main".Fix
.github/actions/check-trusted-trigger/check-trusted-trigger.mjs: newtrustedBaseSha. A PR into the default branch keeps itsbase.sha; a stack layer whosestack.base.refis the default branch outputsstack.base.sha(a main commit) asbase-sha, neverbase.sha(the lower layer's unmerged head). Anything else stopsuntrusted-base, as before. Theworkflow_runGraphQL fallback carries no stack, so a layer read through it fails closed. A new output,pr-base-sha, keeps the PR's ownbase.shaas a diff base only, never checked out..github/workflows/pr-review-main.yml: the trigger output and the three legs'GATE_BASEreadpr-base-sha, so a layer's review diffs against the layer below and reads that layer's change alone (Codex review finding)..github/actions/check-trusted-base/action.yml: acceptsbase.ref == defaultorstack.base.ref == default(event field onpull_request, REST read otherwise), then still fails unless the gated SHA is an ancestor of the default branch before checking it out..github/workflows/pr-require-checks.yml(ci-status, "Resolve the hold config's commit"): a stack layer into main readsmerge-holds.mjs, the trusted-actor list and the hold config at the main tip. Before, any PR into a non-default branch read them at the event'sbase.sha, which for a layer is the unmerged layer below. When the tip read fails, a layer falls back tostack.base.shaand fails red when the event names none (claude-review finding,788d544); a PR into main keeps its own base SHA as the fallback.pr-run-activity.mdstep 4 and the stacked-PR paragraph, the gate README and output description, apr-pipelinechangelog fragment.Audit of base reads (no change needed):
.basecheckout in the PR lanes uses the default-branch tip (steps.tip.outputs.sha) or the gate'sbase-shathroughcheck-trusted-base(pr-run-activity-read.yml:954-961,pr-run-activity-write.yml:838-845); collect-base-activity copies from that checkout.pr-review-hosted.yml:95,:173,:274; security lane alike) andpr-merge.yml(:195,:1034, ...) check out the main tip.pr-review-main.yml:1705,:2622(matrix.base) is fed from the main checkout's SHA.eval-browser-dispatch.yml:375and ci-status's cost-hold compare (pr-require-checks.yml:5609) use the event base SHA only as a diff base; code runs from.base.pr-unblock.yml:268-288resolve-conflicts already declines a PR whose base is not the default branch, so main is never merged into an upper layer.Verification
Sandbox evidence,
melodic-software/pr-pipeline-sandboxstack 329 (layers #327, #328), created withgh stack link(gh-stack v0.3.0):pull_request.base.ref=probe/stack-payload-l1,base.sha=bd5c8f66…(the lower layer's head),stack.base.ref=main,stack.base.sha=3e308d71…(main's tip),stack.position2 of 2,github.base_ref=main. The REST pull,commits/{sha}/pullsand GraphQLPullRequest.stackalso carry the stack (GraphQL hasbaseRefName, no SHA).gh stack merge 327), feat: make missing hook prerequisites skip visibly (10 plugins) #328 retargeted tomainwithbase.sha=stack.base.sha= the new tip.Tests (TDD, each new case red before the change):
node --test .github/actions/check-trusted-trigger/check-trusted-trigger.test.mjs: 484 pass. New: layer with stack base main proceeds withbase-sha= stack base SHA (pull_request, workflow_dispatch, workflow_run); stack baserelease/xrefused on all three; malformed stack base SHA refused; a bottom layer into main keeps its own base SHA. Existing controls kept: non-stack PR onfeat/stack-parentrefused on all three events.node --test .github/actions/check-trusted-base/check-trusted-base.test.mjs: 15 pass. New: layer accepted and the stack base SHA checked out; a layer whose base SHA is the lower layer's head fails "not on the default branch" with nothing checked out (scripts never load from the layer base); stack into another branch refused; default-tip accepts a layer and checks out the tip; workflow_dispatch reads the stack base from the PR (main accepted, other refused, none refused).node --test .github/scripts/pr-merge/ci-status-hold-ref.test.mjs(new): 7 pass. A layer reads the tip, not the layer below; on an unreadable tip a layer falls back to the stack base SHA, or fails with none; a PR into main falls back to its own base; a non-stack PR into another branch and a stack into another branch keep the event base. Each layer case fails against the old step.node --test .github/scripts/pr-review-main/workflow.test.mjs: pass; the trigger output and every leg'sGATE_BASEreadpr-base-sha.actionlint .github/workflows/pr-require-checks.yml: clean.Related
plugins/source-control/reference/stacked-prs.mdin docs: one source for when to stack pull requests #15389 says the pipeline refuses layers; its recheck trigger fires when this merges.Follow-ups
done-evidence.mjsandbabysit_merge_policy.pycount a layer's merge into main.report-outcome.mjs,check-blockers.mjs) for stack layers, plus restacks after a write lane pushes and the run activity's diff base for a layer.🤖 Generated with Claude Code
https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe