Skip to content

Self-merge check: a repository-owned command that can hold any Self-merge - #2433

Draft
JacobStephens2 wants to merge 39 commits into
mainfrom
issue-2421
Draft

JacobStephens2 wants to merge 39 commits into
mainfrom
issue-2421

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Repositories can configure a Self-merge check under [merge].self_merge_check. thirdshift runs a repository script from the Base branch on origin, or an absolute host command, in Command scratch. The check receives the PR number, repository, Base branch, current body and first-observed body. For a PR the Command opened, the opening body serves as the first observation.

Settle CI and observe the ready PR
  └─ Run the repository or host check
       ├─ Hold → Ready for review with the reason
       └─ Pass → Recheck head, body, branches and merge policy → Request merge

The shared Delivery step covers Ticket, Pickup, Fix, Base fix, merge-mode Review, Custom process and final Spec Self-merges. Tickets landing on a Spec branch skip the check. The per-Command self-merge-check and no-self-merge-check choices carry through to child Runs. Repositories without a configured check continue through the existing merge gates.

A hold releases the Claim or PR reservation and leaves the branch and PR ready for the Day shift. The Inbox, Run notification and Command log carry the reason. Local Pickup and Fix Passes use the recorded hold when selecting work. A separate settled CI failure or Merge conflict can still make a held PR eligible for a Fix Pass. Sign-off holds still apply during CI watch. The guide, Glossary and ADR 0037 document the configuration and scope.

Evidence

Execution evidence

  • thirdshift --help | rg -- self-merge-check
    • Before · Exit 1 with no matches.
    • After · Exit 0 with self-merge-check / no-self-merge-check: require / skip the configured check.
  • cargo test --test review_merge a_passing_check_is_followed_by_a_fresh_closing_issue_read -- --exact
    • Before · The fake GitHub merge went ahead without a fresh closing-issue read after the check.
    • After · The ordering regression passed.
  • cargo test --test process a_direct_custom_check_hold_ends_ready -- --exact
    • Before · The process reached the later Step, printed exit status 9 and returned 1.
    • After · The held process returned 0, cleared its Claim and appeared under Ready for review with the reason.

The integration seam is the thirdshift CLI with real Git and fake GitHub and Harness adapters.

cargo fmt --all --check passed. scripts/affected-tests refs/remotes/origin/main passed all 74 site tests and the build, then stopped when Console test servers refused connections. The Console and Rust reruns are in progress.

Visual evidence

Playwright verified the site disclosures and navigation, the phone-width manual with JavaScript disabled, and the Console's Ready for review flow with faux records. The Before checkout is refs/remotes/origin/main (7fee10ea).

Before — Console Ready for review walkthrough, desktop 1440×900

before-inbox.dLgK5F.mp4

After — Console Ready for review walkthrough, desktop 1440×900

after-inbox.gNPW4C.mp4

Before — Console Ready for review rows, desktop 1440×900

Before Console Ready for review rows at desktop 1440×900

After — Console Ready for review rows, desktop 1440×900

After Console Ready for review rows at desktop 1440×900

Before — Home page Ticket run, desktop 1440×900

Before Home page Ticket run at desktop 1440×900

After — Home page Ticket run, desktop 1440×900

After Home page Ticket run at desktop 1440×900

Before — How it works delivery, desktop 1440×900

Before How it works delivery at desktop 1440×900

After — How it works delivery, desktop 1440×900

After How it works delivery at desktop 1440×900

Before — Architecture Figure 3, desktop 1440×900

Before Architecture Figure 3 at desktop 1440×900

After — Architecture Figure 3, desktop 1440×900

After Architecture Figure 3 at desktop 1440×900

Before — Manual User config, desktop 1440×900

Before Manual User config at desktop 1440×900

After — Manual User config, desktop 1440×900

After Manual User config at desktop 1440×900

Before — Manual User config, mobile 390×844

Before Manual User config at mobile 390×844

After — Manual User config, mobile 390×844

After Manual User config at mobile 390×844

Unaddressed findings

Standards

  • Readiness observation ownership. Search::line can observe a Ticket's Spec before that Spec is selected. Pickup retains the earliest body across searches, reservation losses and dispatch. The focused regression a_pickup_keeps_a_specs_first_body_when_an_earlier_reservation_loses covers that path. Readiness lookup

Spec

  • Cross-host hold persistence. The same-origin probe with a fresh logs directory retried a held PR after a hand-back. The Day shift decision covers the shared record, lifetime and release mechanism. Issue #2439
  • Release bump PRs. The fake Release published and merged the bump PR with a hold script configured. The Release workflow publishes before requesting that merge, so the Day shift needs to decide coverage and where the hold belongs. Issue #2445

Both axes covered every changed file, including generated HTML and the review follow-up hunk.

Merge Danger

Door: two-way

The check is opt-in per repository and can be disabled by configuration or for one Command.

Blast Radius: Delivery

Closes #2421

JacobStephens2 and others added 30 commits December 3, 2026 16:02
2026-12-03T21:14:39Z, host factory.etadventures.com. Uncommitted work at the time of failure is included in this commit.
… nothing to fix on the branch)

2026-12-03T23:14:04Z, host factory.etadventures.com. Uncommitted work at the time of failure is included in this commit.
…2423)

The partial #2421 work kept on the Spec branch left tests red:

- gate the self_merge_check module to Linux
- keep the help text within its line limit
- say "run", not "Run", on the hand-written site pages
- watch the snapshot query's new body field in the sign-off CI test
- list merge.self_merge_check in the complete User config test fixtures

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Report missing Base branch Self-merge check scripts
Cover Self-merge checks across Delivery paths
# Conflicts:
#	site/how-it-works/index.html
#	tests/spec_run.rs
Honor per-Command Self-merge check overrides
Skip held pull requests in Pickup and let Fix Pass repair conflicts after mergeability settles. Refs #2428.
Preserve the starting PR body for Self-merge checks
Leave Self-merge check holds for the Day shift
# Conflicts:
#	site/index.html
#	src/fix/selection.rs
#	src/logs.rs
#	src/logs/reading.rs
#	src/logs/reading/attribution.rs
#	src/logs/reading/inbox.rs
#	src/ready.rs
Hand Self-merge check holds to the Day shift
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.

Self-merge check: a repository-owned command that can hold any Self-merge

1 participant