Require live PR head re-pin before conflict-fix classification #522

Closed
opened 2026-07-08 03:37:18 -05:00 by jcwalker3 · 1 comment
Owner

Problem:
The open PR inventory reported stale mergeable:false and stale head_sha values for PRs that were already conflict-resolved and mergeable at their live branch heads. This caused author sessions to start unnecessary conflict-fix work and even led to a rejected non-fast-forward push attempt.

Observed:

  • Inventory flagged PR #508 as mergeable:false at stale head dad1dc8.
  • Live PR #508 head was actually 3f3d6cb and mergeable:true.
  • Inventory flagged PR #493 as mergeable:false at stale head 685e627.
  • Live PR #493 head was actually 4561d7a and mergeable:true.
  • git merge-tree against current master showed 0 conflicts at the live heads.
  • PR #490 was correctly skipped for reconciler supersession, not conflict-fix.

Required behavior:
Before an author session classifies a PR as conflicted or performs conflict-fix work, the workflow must re-fetch the live PR state and re-pin the branch head SHA. Inventory mergeable/head_sha fields should be treated as advisory and potentially stale.

Acceptance criteria:

  1. Add a guard or helper that re-fetches live PR state before conflict-fix classification.
  2. Require live head SHA confirmation before creating a conflict-fix worktree.
  3. If inventory says mergeable:false but live PR says mergeable:true, classify as stale inventory and skip author mutation.
  4. If live head differs from inventory head, report both SHAs and use the live head only.
  5. Add tests covering stale inventory head/mergeability fields.
  6. Update author conflict-fix runbook guidance to require live-head re-pin before mutation.
Problem: The open PR inventory reported stale mergeable:false and stale head_sha values for PRs that were already conflict-resolved and mergeable at their live branch heads. This caused author sessions to start unnecessary conflict-fix work and even led to a rejected non-fast-forward push attempt. Observed: - Inventory flagged PR #508 as mergeable:false at stale head dad1dc8. - Live PR #508 head was actually 3f3d6cb and mergeable:true. - Inventory flagged PR #493 as mergeable:false at stale head 685e627. - Live PR #493 head was actually 4561d7a and mergeable:true. - git merge-tree against current master showed 0 conflicts at the live heads. - PR #490 was correctly skipped for reconciler supersession, not conflict-fix. Required behavior: Before an author session classifies a PR as conflicted or performs conflict-fix work, the workflow must re-fetch the live PR state and re-pin the branch head SHA. Inventory mergeable/head_sha fields should be treated as advisory and potentially stale. Acceptance criteria: 1. Add a guard or helper that re-fetches live PR state before conflict-fix classification. 2. Require live head SHA confirmation before creating a conflict-fix worktree. 3. If inventory says mergeable:false but live PR says mergeable:true, classify as stale inventory and skip author mutation. 4. If live head differs from inventory head, report both SHAs and use the live head only. 5. Add tests covering stale inventory head/mergeability fields. 6. Update author conflict-fix runbook guidance to require live-head re-pin before mutation.
jcwalker3 added the status:in-progress label 2026-07-08 21:28:29 -05:00
Author
Owner

Issue claim heartbeat

<!-- gitea-issue-claim-heartbeat:v1 --> **Issue claim heartbeat** - kind: claim - issue: #522 - branch: feat/issue-522-conflict-fix-classification - phase: claimed - profile: prgs-author - pr: none - blocker: none - next_action: create worktree and begin implementation
sysadmin removed the status:in-progress label 2026-07-09 07:41:39 -05:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#522