feat(controller): route outdated and conflicting PRs through synchronization lifecycle #728
Labels
Clear labels
allocator
anti-stomp
architecture
bug
chore
codex
concurrency
contamination
control-plane
dashboard
database
design
documentation
enhancement
gitea
glitchtip
important
incident
incident-bridge
integration
jenkins
labels
leases
mcp
mcp-health
mcp-menu
multi-project
mutating
nice-to-have
observability
portability
preflight
protected-branch
queue
read-only
reconnect
recovery
refactor
release
reliability
resumable-review
reviewer
roadmap
safety
security
self-hosted
sentry
stale-runtime
status:blocked
status:in-progress
status:pr-open
status:ready
terminal-lock
testing
tracker
type:bug
type:feature
type:feature
type:guardrail
visibility
workflow
workflow-hardening
workflow-hardening
Controller-owned work allocator
Prevent concurrent LLM session stomping
Architecture / structural design
OpenAI Codex client / workflow session surface
Concurrent session safety
Workflow or session contamination incident
MCP control-plane coordination and allocation authority
MCP operational dashboard/queue view
Internal coordination storage (SQLite/Postgres)
Design / investigation, no implementation
Docs / runbooks
New feature or improvement
Gitea MCP workflow
GlitchTip integration
Operational or process incident requiring durable audit trail
Sentry-to-Gitea incident bridging
Integration testing
Jenkins integration
Label taxonomy management
Lease adopt/release/expire lifecycle
MCP server / tooling
MCP namespace and runtime health
MCP menu surface
Work spanning multiple monitoring projects or Gitea repos
Mutating action; requires gating
Observability, metrics, traces, error reporting
Cross-platform / portability
Shared preflight gates before mutation
Protected branch / stable-branch policy concern
Work queue visibility and allocation
Read-only, no mutation
MCP client reconnect/reload recovery path
Recovery paths for stale/foreign leases
Code refactor / restructure
Release / versioning
Reliability / failure handling
Persist and resume prepared review verdicts across sessions
Reviewer workflow tooling
Roadmap / umbrella issue
Safety rails and fail-closed mutation guards
Security / trust boundary
Self-hosted infrastructure integration
Sentry error monitoring integration
Stale backend daemon / runtime-vs-master parity failures
Issue is blocked
Issue is being worked on
Issue has an open pull request
Issue is ready for work
Terminal review lock (#332) path
Tests / test coverage
Issue tracker hygiene / meta
Bug or defect
Feature or enhancement
Feature or enhancement
Safety gate or guardrail
Workflow state visibility for LLMs/operators
Cross-tool workflow
LLM workflow coordination hardening
LLM workflow coordination hardening
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#728
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #727
Behavior summary
Native PR synchronization lifecycle for open PRs that would otherwise stall after base advances, approvals go stale, or conflicts appear.
update_branch_by_mergemerges base into the PR branch (never rebase/force-push).fresh_review_required.Routing states
merge_nowupdate_branch_by_mergeauthor_conflict_remediationfresh_review_requiredblockedSafety guarantees
Tests and results
Changed files (vs live master
f65069d):pr_sync_status.py(new)gitea_mcp_server.pytask_capability_map.pyskills/llm-project-workflow/templates/merge-pr.mdskills/llm-project-workflow/workflows/review-merge-pr.mdtests/test_pr_sync_status.py(new)Exact feature head
98fbfb3de735069dd05670a3d8755e7c14349af1Next role
Independent REVIEWER — do not self-review or merge from the author profile.
Cleanup handoff (reconciler)
After this PR is proven valid, delete obsolete remote branch
feat/pr-sync-status(same tip, pre-issue rename). Do not delete until PR head is verified.repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #728
issue: #727
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 56032-3c1cd4072ded
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-418
phase: claimed
candidate_head:
98fbfb3de7target_branch: master
target_branch_sha:
f65069d22dlast_activity: 2026-07-17T14:54:24Z
expires_at: 2026-07-17T16:54:24Z
blocker: none
Canonical PR State
STATE: request_changes
WHO_IS_NEXT: author
NEXT_ACTION: Fix author-lock resolution for tracking-issue vs PR number mismatch; add regression tests; re-request review at new head.
NEXT_PROMPT:
WHAT_HAPPENED: Independent review of PR #728 at
98fbfb3found blocking author-lock keying defect.WHY: Author update path cannot run when tracking issue number differs from PR number.
ISSUE: #727
HEAD_SHA:
98fbfb3de7REVIEW_STATUS: request_changes
MERGE_READY: no
BLOCKERS: Author lock requires issue_number == pr_number only.
VALIDATION: 28 focused tests passed; 117 related regression tests passed.
LAST_UPDATED_BY: sysadmin
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #728
issue: #727
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 55661-26fe51186d16
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-728-c1c61e9
phase: claimed
candidate_head:
c1c61e9b15target_branch: master
target_branch_sha:
fca3296883last_activity: 2026-07-17T17:57:45Z
expires_at: 2026-07-17T19:57:45Z
blocker: none
Canonical PR State
STATE: approved
WHO_IS_NEXT: merger
NEXT_ACTION: Merger acquires/adopts lease and merges PR #728 at pinned head
c1c61e9b15with confirmation MERGE PR 728.NEXT_PROMPT:
WHAT_HAPPENED: Independent prgs-reviewer (sysadmin) reviewed exact head
c1c61e9in clean detached worktree branches/review-pr-728-c1c61e9 via native MCP. Prior REQUEST_CHANGES (issue_number==pr_number ownership defect) is remediated. Master merged; capability map keeps PR-sync + #725 merger-lease entries. Focused ownership + pr_sync tests 34 passed; broader related suite 150 passed.WHY: Ownership now uses linked issue/session/durable/branch locks; Issue #727 lock authorizes PR #728; unrelated issues fail closed. No force/rebase. Dual-pin sync lifecycle preserved with #725 lease path.
ISSUE: #727
HEAD_SHA:
c1c61e9b15REVIEW_STATUS: approved
MERGE_READY: yes
BLOCKERS: none
VALIDATION: pytest tests/test_pr_ownership_issue_pr_mismatch.py tests/test_pr_sync_status.py -> 34 passed; related suite 150 passed; mergeable true; eligibility approve ready
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=mcp_server; profile=prgs-reviewer; identity=sysadmin; tool=gitea_submit_pr_review; head=c1c61e9b15f61689978ade90042bdaebe25aa9c4; session=55661-26fe51186d16
LAST_UPDATED_BY: prgs-reviewer / sysadmin
adopted_at: 2026-07-17T17:58:24Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 55661-26fe51186d16
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 12133
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #728
issue: #727
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 55660-13731b027d48
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr-728-c1c61e9
phase: adopted
candidate_head:
c1c61e9b15target_branch: master
target_branch_sha:
fca3296883last_activity: 2026-07-17T17:58:24Z
expires_at: 2026-07-17T19:58:24Z
blocker: none