Skip to content

feat(source-control): choose pull request branch updates from shared criteria - #14258

Merged
kyle-sexton merged 10 commits into
mainfrom
feat/pull-request-reassess-action
Nov 9, 2026
Merged

kyle-sexton merged 10 commits into
mainfrom
feat/pull-request-reassess-action

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Refs: #14199

Summary

Problem: every step that updates a pull request branch follows a fixed "merge, never a rebase" rule, whatever the branch's situation. Intent: "driven by facts and the latest consensus-based /research"

  • One decision script picks none, merge, rebase, delegate or hold for a branch from its signals, and one reader gathers those signals from git and GitHub. Unknown or unreadable signals fall toward hold or merge, never a rewrite.
  • create, ready, merge, monitor and babysit's two update sites now read that decision. A repository can force merge or rebase with pr_update_method, on the rows that allow it.
  • A native GitHub stack member updates by rebase, or is held where a rewrite is not possible. In this repository the result is no update when none is needed, and merge when one is.

Fix

  • plugins/source-control/scripts/branch-update-method.sh owns the ordered rows; reference/branch-update-criteria.md records each row's reasoning and sources; ADR 0096 supersedes decision 4 of ADR 0037.
  • branch-update-signals.sh reads the signals; stale-base-overlap.sh, lib/base-file.sh and lib/github-remote.sh hold logic shared with push-branch.sh, read-review-venue.sh and read-pre-ready.sh.
  • The rebase procedure runs on a detached HEAD, checks the target with push-branch.sh --preflight, and pushes only with a pinned lease in the caller's own command. A repository's overlap rule runs only for a base shown to be the default branch, in push-branch.sh as well.

Verification

  • Decision, signal and push tests pass: 422, 381 and 229 cases. read-review-venue and read-pre-ready existing tests pass unmodified.
  • Babysit suite passes (1,318 tests, lint clean), including hold making no update, no ledger entry and no enqueue. Merge-only guards are unchanged.
  • Each phase had a fresh-context verifier and its tagged code-design or security review.
  • The two graded eval cases, pull-request-ready-merges-base-never-rebases and pull-request-create-default-open-state-ready, each scored 1.00 at 66f27af with the validity gate VALID. Each was one run of the with-plugin arm only, so they show the behavior passes and measure no delta against no plugin.

Acceptance criteria

  • AC14: create's refresh, ready's base merge, babysit's refresh and reassess all read the same criteria source, and the fixed rule is gone. reassess follows in the next pull request.
  • AC15: One repository setting forces merge or rebase; its default applies the shared table.
  • AC16: In this repository the criteria return no update when none is needed, merge when one is needed, and rebase only for a native GitHub stack.

Remaining

Related

Refs: #14199

🤖 Generated with Claude Code

https://claude.ai/code/session_015te8CqrCmigawLFLWN3KpQ

kyle-sexton and others added 6 commits November 8, 2026 14:45
Add a pure decision script that picks none, merge, rebase, delegate or
hold for one pull request branch from a set of signals, with an ordered
first-match table and a forced-value setting that replaces only the
forceable rows. The criteria reference records why each row decides as
it does and where to read the sources live.

Refs: #14199

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015te8CqrCmigawLFLWN3KpQ
Add a reader that turns a pull request or branch into the signals the
decision script takes, failing toward unknown or blocked. Add the team
setting pr_update_method and push-branch.sh --preflight, which checks a
rebase target and leaves the force push to the caller.

Move the base-branch setting read and the remote lookup into shared
libraries, and the overlap check into one helper. A repository's overlap
rule runs only for a base shown to be the default branch when the signal
reader calls it.

Refs: #14199

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015te8CqrCmigawLFLWN3KpQ
…ision

Babysit's refresh and enqueue update now take the shared decision before
updating a branch. A native stack member, a failed stack read or a
decision that cannot be made is held, with no update, ledger entry or
enqueue.

Refs: #14199

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015te8CqrCmigawLFLWN3KpQ
…d decision

create, ready, merge and monitor now read one decide-and-carry-out
sequence in place of the fixed merge rule, with a rebase procedure that
runs on a detached HEAD and pushes only with a pinned lease. ADR 0092
supersedes decision 4 of ADR 0037. Text that said ready always merges the
base now says it updates the branch.

Refs: #14199

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015te8CqrCmigawLFLWN3KpQ
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 8, 2026 21:43
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 8, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-08T21:43:40.067371Z
We couldn’t complete this review. Comment @codex review to try again.
586b464 Draft marked ready
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-security-review: 1 inline finding(s) on 586b464118577ab617c27e4470a9d5af2c7ae4ff; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 7e64cc883179b22d126115b08f65545cddffd0bd: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: incremental (2dd704c → 7e64cc8)

I read the whole change to both files in the incremental scope and found no security issues. This lane had already reviewed an earlier head of this pull request, so this pass reports blocking findings only.

critical-findings: 0

What changed

  • ADR renamed. docs/adr/0092-choose-the-pull-request-branch-update-method-from-shared-criteria.md is now docs/adr/0096-…. The API returned no patch for it, so I read the file at the head commit. Its opening lines (status, date, and that it supersedes decision 4 of ADR 0037) match the content reviewed before, and it contains no reference to its own old or new number.
  • ADR 0037 link updated. One line now points at the renumbered file (0037…md#L8).

Both files are documentation only. Neither matches a trusted-path glob. The change touches no trust control, token scope, merge hold, plugin manifest or standing instruction.

Earlier findings

The one earlier SUGGESTION (discussion_r4507940852) was found fixed in the review of 66f27af. This push does not touch that code.

No new spend.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on 586b464118577ab617c27e4470a9d5af2c7ae4ff; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 7e64cc883179b22d126115b08f65545cddffd0bd: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review, incremental (2dd704c → 7e64cc8)

No findings. I read the whole change in both files in the incremental scope. This lane had already reviewed an earlier head (blocking only: yes), so this pass reported blocking findings only.

What changed

  • docs/adr/0092-choose-the-pull-request-branch-update-method-from-shared-criteria.md is renamed to docs/adr/0096-.... The old number clashed with docs/adr/0092-carry-only-the-miro-mcp-server-in-a-plugin.md, which is already on the base. The renamed file's header still points back to ADR 0037 correctly (L5-L8).
  • The "Superseded in part" link in ADR 0037 now points at the new 0096 path (L12-L14).

Checks

  • No stale links. No reference to 0092-choose-the-pull-request-branch-update-method... is left anywhere in the repository. Every remaining 0092 link goes to the Miro ADR, as it should.
  • No index to update. docs/architecture/landscape.json lists only some ADRs. It has no entry for 0092 or 0093, so it needs no 0096 entry.

Prior and settled threads

Both settled threads (push-branch.sh sync_stale_base and ready-for-review.md step 2) are marked lines changed since resolution: no, and this push touches neither file. Neither thread is raised again.

Verification status

I ran nothing, because this lane has no shell. Everything above comes from reading the diff and the files at the head commit.

Spend

None. This change touches only ADR docs.

kyle-sexton and others added 3 commits November 8, 2026 16:55
push-branch.sh ran a base ref's own overlap rule for any PR base, so a
stacked base's unreviewed script ran in the operator's session. Only a
base the remote reports as its default branch may now run its rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015te8CqrCmigawLFLWN3KpQ
The rebase procedure required the local HEAD to equal the remote tip, so
a branch with no pull request and a new local commit was always judged
stale and ended in a hold. Its fallback also sent a run with no pull
request to the forge's update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015te8CqrCmigawLFLWN3KpQ
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 9, 2026
Main took number 0092 for the Miro MCP carry decision while this branch
was open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015te8CqrCmigawLFLWN3KpQ
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit b46ad66 Nov 9, 2026
76 checks passed
@kyle-sexton
kyle-sexton deleted the feat/pull-request-reassess-action branch November 9, 2026 01:55
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant