Conflicting PR reached Human Review: -vN resolution never on PR branch; fast path skips mergeability (#591)

Open
#157 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, github, python
Domain
devtools

Research direction

Start with Flow.stage in flow.py around line 1488 and head_check in promoted.py around line 493, then trace the merge-to-main and reject/resume paths described in the issue. Check how the -vN resolution relates to the PR head and how mergeability is read. Done means conflicting PRs cannot receive a pass or move into Human Review, and staged or reviewed PRs are rechecked when main changes.

Written by the indexing model from the issue text.

Description

What happened

PR tangentcode/platform#591 reached Human Review with a PR branch that conflicts with main. Michal's rule: a PR leaves In Progress only if it merges cleanly onto main.

Timeline (ET, 2026-11-19):

  • 11:38 AM: fill found #591 conflicting with the future main in work (#567 ahead of it). Fix-in-place (tangentswarm #146) had the worker resolve it on the speculative branch ptw-captions-come-only-v1 (bacfa612). The PR branch ptw-captions-come-only stayed at 4e36b680, which does not contain the resolution.
  • 12:01:49 PM: stage: #591 4e36b680 is pre-merged: Ready -> Staging, no gate re-run (tangentswarm #136). Flow.stage (flow.py ~1488) also writes apply #591 4e36b680 PASS, the gate pass line the promote fast path reads. At this time main did not have #567 yet, so 4e36b680 was still clean against main.
  • 12:16:22 PM: #567 merged (6bef7814). 4e36b680 now conflicts with main in 5 files.
  • 12:16:27 PM: promoted.fast_path moved #591 Staging -> Human Review "(gate pass at 4e36b680)". head_check (promoted.py ~493) checks only that the head has a gate pass and is not a draft.
  • 12:22 PM: Michal saw the conflict in Human Review.

Root cause

The pre-merge model resolves a conflict with future main on the -vN branch, but the PR branch, which is what Michal merges, keeps the unresolved head. Two places then treat the PR head as good:

  1. Flow.stage writes a gate PASS for the PR head (4e36b680) even when the pre-merged tip in work is a -vN resolution that the PR head lacks. The pass is for the -vN tip, but it is recorded for the PR head.
  2. The promote fast path (head_check) never checks mergeability against the current main. Nothing rechecks a PR in Staging or Human Review after main moves.

Fix (proposed)

  • When fix-in-place resolves a conflict on -vN, the PR is not done until the same resolution is on the PR branch (a normal merge of main into the PR branch once its predecessor merges, or a merge of the -vN resolution into the PR branch). Until then, do not write a gate pass for the PR head; mark it as "needs main merge".
  • In head_check, refuse the move when GitHub reports mergeable CONFLICTING / mergeStateStatus DIRTY for the PR (one PR read; UNKNOWN means wait and retry). The merge event that freed the slot is exactly when this must be rechecked.
  • On each merge to main, recheck mergeability of every PR in Staging and Human Review; a conflicting one goes back to In Progress with a merge-main relay to its worker, through the normal path.
  • The reject path that auto-resumes the worker when a card goes Human Review -> In Progress should carry the reason (here the worker woke with no reason and went looking for a note from Michal).

Recovery done

swarmbot moved #591 Human Review -> In Progress at 12:23 PM ET (server converted it to draft and removed merge-ready) and relayed a merge-main brief to the worker (pane %306): merge origin/main into ptw-captions-come-only, normal merge commit, no force-push, tests through test-slot.

Dominant language
Python
Stars
3
Forks
0
Avg merge
5h 57m
Merged PRs (30d)
60

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tangentcode/tangentswarm

All issues in tangentcode/tangentswarm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.