Skip to content

Flag stale CI on Ready for review and require fresh Base CI for Self-merge - #2317

Merged
JacobStephens2 merged 9 commits into
mainfrom
issue-2316
Nov 19, 2026
Merged

JacobStephens2 merged 9 commits into
mainfrom
issue-2316

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Closes #2316

Summary

Ready for review
  Green CI behind Base → show the first-parent count in the Console and status
  Head contains Base → clear the warning
  Comparison unavailable → keep current PR facts and the last warning for the same head and Base branch

Self-merge
  Check the captured PR and current Base before every merge request, including quota retries
  Base moved → reconcile it and watch the updated head
  Earlier checks and an unchecked updated head → hold the PR ready for review
  Base with a merge queue → use the existing merge path

The merge request guards the expected head. A Base update after the last local observation can still race the server-side merge. GitHub merge input

Evidence

Execution evidence

  • Delivery. target/debug/deps/merge_run-2a568814994f113f base_moving_at_the_merge_gate_needs_green_ci_on_the_new_head --exact failed with the merged head missed the Base commit that arrived after CI and passed with the gate.
  • Console HTTP. target/debug/deps/console-b1fb2fabdc066aa0 github::ready_rows_flag_stale_green_ci_with_a_first_parent_count --exact initially showed CI green without the stale-CI note. The regression passed with the note and verifies it clears on a current head.
  • Repeated Base updates. cargo test --test merge_run missing_ci_after_two_base_updates_holds_self_merge -- --exact and cargo test --test merge_run missing_fresh_ci_after_rewritten_base_holds_self_merge -- --exact reproduced merges after CI was absent on both updated heads. Both regressions now pass and keep the PR ready, including a Continuation after the rewrite.
  • Independent PR facts. cargo test --test status failed_stale_ci_comparison_keeps_current_mergeability -- --exact returned mergeable before the fix and conflicting afterward despite the failed comparison.
  • REST reserve. The before runs for inbox_comparison_leaves_the_rest_reserve_for_the_factory, first_comparison_leaves_the_reserve_after_a_cold_identity_read, and inbox_stops_comparisons_when_the_rest_quota_probe_fails showed an extra REST read. Each now passes with cargo test --test status <test name> -- --exact.
  • Homepage copy. rg -ni 'stale CI|CI (result )?predates|behind (the )?Base' site/index.html exited 1 before the change and found the warning afterward. Chromium keyboard-opened the Console details and checked the paragraph at 1440×900 and at 390×844 without JavaScript.

Visual evidence

Before — Ready for review, desktop 1440×900

Before Ready for review at 1440×900

After — Ready for review, desktop 1440×900

After Ready for review at 1440×900

Before — Ready for review, mobile 390×844

Before Ready for review at 390×844

After — Ready for review, mobile 390×844

After Ready for review at 390×844

Before — How it works, desktop 1440×900

Before How it works at 1440×900

After — How it works, desktop 1440×900

After How it works at 1440×900

Before — Self-merge architecture, desktop 1440×900

Before Self-merge architecture at 1440×900

After — Self-merge architecture, desktop 1440×900

After Self-merge architecture at 1440×900

Before — Homepage Console details, desktop 1440×900

Before homepage Console details at desktop 1440×900

After — Homepage Console details, desktop 1440×900

After homepage Console details at desktop 1440×900

Before — Homepage Console details, mobile 390×844

Before homepage Console details at mobile 390×844

After — Homepage Console details, mobile 390×844

After homepage Console details at mobile 390×844

Merge Danger

Door Two-way.

Blast Radius Delivery and Inbox.

Unaddressed findings

Standards

None.

Spec

None.

Security

None.

Both reviewers read every changed file across the two review passes.

Built with codex codex-cli 0.169.0 · gpt-6.2-sol · xhigh

Security review outcome

No unaddressed introduced findings.

@JacobStephens2

Copy link
Copy Markdown
Owner Author

Delivery completed on agent-authored or reviewed head 7f905f1.

@JacobStephens2 JacobStephens2 added the in-progress A Claim: thirdshift has taken this issue label Nov 19, 2026
@JacobStephens2

Copy link
Copy Markdown
Owner Author

Review run. The branch moved; no fixes were pushed. Proposed fixes remain in the local worktree. Spec axis used the linked closing issues.

Reviewed PR #2317 against 746b27e8c066a1e28dc9d5f6ac2440dd1ec48acf, using linked closing issue #2316 as the Spec. Committed the fixes locally as 0c6a9e3e. The worktree is clean.

Standards

  1. Successive Base updates could erase CI evidence across a Continuation. The ancestry check now includes heads merged with earlier Base commits, preserving the requirement for fresh green CI. Kept the Continuation regression.
  2. A failed Base comparison could hide a newly reported merge conflict. The Inbox now applies the fresh GraphQL facts and retains the previous stale-CI comparison when the head and branch still match. Extended the status regression to verify both facts.
  3. Quota retries skipped the linked closing-issue trust check. The check now runs for each merge attempt. Kept the retry regression.
  4. The homepage and Figure 3’s accessible description still described the old merge gate. Both now explain the Base freshness check and merge queue exception.
  5. Base-fix fixtures depended on Git’s generated merge message. They now use the published branch head and commit ancestry to identify a Base update.

Spec

  1. Two Base advances in one Delivery could let an unchecked head Self-merge. The ancestry fix also covers successive updates within one Delivery. Kept a separate regression for that path.
  2. A retarget during the review-decision read could send Self-merge to an untested Base. The merge gate now revalidates the PR target after the policy reads and before comparing Base. Kept the retarget regression.
  3. A stale-CI comparison failure could suppress a fresh Merge conflict and the corresponding Fix action. The Inbox now refreshes those facts independently of the comparison.

Unaddressed findings

Standards. None.

Spec. Self-merge can proceed after a Base update when neither head has CI checks. Issue #2316 calls for green CI on the updated head. The PR body scopes the hold to cases with “Earlier checks but no green CI on the updated head.” The focused repro confirmed that the PR merged with no checks. The review left that documented departure in place under the PR-body exception. Delivery gate · PR summary

Review coverage

Both reviewers read all 23 changed files in the pinned diff. Neither axis excluded generated output or left a changed file unread. The reports include the complete files-read lists and supporting sources. Standards report · Spec report · Finding counts

Validation

Exact command Result
gh pr view 2317 --repo JacobStephens2/thirdshift --json state --jq .state OPEN, exit 0 immediately before the required suite
scripts/affected-tests main Exit 1 at the full Rust stage
npm test --prefix site Exit 0, 74 passed
cargo build --locked Exit 0
npm test --prefix console Exit 0, 268 passed
cargo nextest run Exit 100. 191 passed and one CI re-run test failed. Fail-fast left 4,708 selected tests unrun. Nextest separately reported 219 skipped.
cargo test --test ci a_check_re_run_watches_a_dependent_job_to_its_new_success -- --exact Exit 0 on the isolated rerun
cargo test --test merge_run repeated_base_updates_still_require_green_ci -- --exact Exit 101 before, 0 after
cargo test --test merge_run two_base_advances_do_not_forget_the_original_green_ci -- --exact Exit 101 before, 0 after
cargo test --test merge_run self_merge_revalidates_a_retarget_during_the_review_decision -- --exact Exit 101 before, 0 after. An interim compile failure was corrected before the passing run.
cargo test --test status failed_base_comparison_preserves_the_last_stale_ci_answer -- --exact Exit 101 before, 0 after
cargo test --test review_merge quota_retry_rechecks_linked_closing_issues -- --exact Exit 101 before, 0 after
cargo test --test merge_run a_base_update_without_any_ci_does_not_self_merge -- --exact Exit 101, confirming the documented departure
cargo test --bin thirdshift pull_request::tests Exit 0, 46 passed
cargo test --test base_fix a_merge_run_self_merges_once_its_base_fix_has_merged -- --exact Exit 0
cargo test --test spec_run two_tickets_meeting_the_same_inherited_failure_share_one_base_fix -- --exact Exit 0
cargo fmt --all -- --check, git diff --check, git diff --cached --check Each exited 0

The focused Rust run below exited 0 with 161 passed. Rust validation used CARGO_INCREMENTAL=0.

cargo nextest run --no-fail-fast --test-threads 3 -E 'binary(=merge_run) | binary(=review_merge) | binary(=mergeable) | binary(=status) | test(ready_rows_flag_stale_green_ci_with_a_first_parent_count) | test(base_fix_reaches_each_tickets_run_of_the_dispatched_spec_run) | test(a_base_fix_and_its_ticket_both_run_the_security_review) | test(with_base_fix_a_tickets_inherited_failure_gets_a_base_fix_into_the_spec_branch) | test(a_ticket_that_landed_after_a_base_fix_says_so_in_the_notification_and_the_checklist) | test(two_tickets_meeting_the_same_inherited_failure_share_one_base_fix)'

The documentation check below exited 1 before and 0 after.

! rg -n 'then merges it\. Here|Once the pull request is open, ready, mergeable and green, thirdshift checks the review decision and merges it' site/index.html site/architecture/index.html

npm run docs:check --prefix site exited 0. The first Chromium evidence pass timed out before the homepage Finish panel was opened. The corrected before and after passes opened it by keyboard, checked the Figure 3 accessible name, and exited 0. Homepage before · Homepage after · Validation log

Standards 5 — most serious was the omitted trust check on quota retries. Spec 3 — most serious was Self-merge into an untested Base after a retarget.

Security

No unaddressed introduced findings.

Delivery failed

pull request changed during Review run: head moved; expected 7f905f1, actual adb350a

@JacobStephens2 JacobStephens2 removed the in-progress A Claim: thirdshift has taken this issue label Nov 19, 2026
@JacobStephens2
JacobStephens2 merged commit ff56084 into main Nov 19, 2026
25 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-2316 branch November 19, 2026 20:09
@JacobStephens2 JacobStephens2 mentioned this pull request Nov 20, 2026
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.

Flag stale CI on Ready for review and require a fresh-Base green run before Self-merge

1 participant