feat: diagnose reviewer lease handoff next actions (Closes #599) #608
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#608
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.
Summary
Implements #599: a reviewer-safe, read-only diagnosis path for open-PR lease handoffs so agents get an explicit canonical next action when leases are foreign, expired, replaced, or worktree-bound incorrectly.
Changes
reviewer_pr_lease.diagnose_reviewer_pr_lease_handoff— pure classifier emitting:classification: no_lease / own_active / own_expired / foreign_active / foreign_reclaimable / foreign_expired / instructed_lease_missing_with_replacement / worktree_binding_mismatchnext_action: acquire | wait | resume_exact_owner_session | release_expired_lease | repair_worktree_bindinggitea_diagnose_reviewer_pr_lease_handoff(read-only,gitea.read)Non-goals (unchanged)
_SESSION_LEASEseedingValidation
pytest tests/test_reviewer_pr_lease.py -q→ 16 passedpytest tests/test_reviewer_pr_lease.py tests/test_post_merge_moot_lease.py tests/test_merger_lease_adoption.py -q→ 43 passedCloses #599
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #608
issue: #599
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 12847-d9fdcc12d780
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-608-issue-599
phase: claimed
candidate_head:
964505654ftarget_branch: master
target_branch_sha:
7186718cfdlast_activity: 2026-07-09T21:37:07Z
expires_at: 2026-07-09T23:37:07Z
blocker: none
Canonical PR State
STATE: open / mergeable / validated — formal APPROVE
WHO_IS_NEXT: merger
NEXT_ACTION: Merge PR #608 at head
964505654fwith expected_head_sha pin after clean approval.NEXT_PROMPT:
WHAT_HAPPENED: Independent reviewer sysadmin/prgs-reviewer validated PR #608 (author jcwalker3). Scope: diagnose_reviewer_pr_lease_handoff + MCP tool + tests for #599. mergeable=true; merge-tree clean vs master
7186718. Lease suites 43 passed.WHY: Acceptance for #599 met: canonical next_action for foreign/own/expired/instructed-replacement/worktree-mismatch; no steal paths; fail-closed acquisition intact.
ISSUE: #599 (PR #608)
HEAD_SHA:
964505654fREVIEW_STATUS: APPROVE
MERGE_READY: yes (pending merger)
BLOCKERS: none
VALIDATION: pytest tests/test_reviewer_pr_lease.py tests/test_post_merge_moot_lease.py tests/test_merger_lease_adoption.py -q → 43 passed; py_compile clean; merge-tree clean
LAST_UPDATED_BY: prgs-reviewer (sysadmin)
adopted_at: 2026-07-09T21:46:35Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 12847-d9fdcc12d780
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 8913
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #608
issue: #599
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 25531-6d7e9885d694
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr-608
phase: adopted
candidate_head:
964505654ftarget_branch: master
target_branch_sha:
7186718cfdlast_activity: 2026-07-09T21:46:35Z
expires_at: 2026-07-09T23:46:35Z
blocker: none
Stale #332 review-decision lock cleanup (#594)
Status: APPLIED
sysadminprgs-reviewer2026-07-09T21:48:01.191308+00:00approveon PR feat: diagnose reviewer lease handoff next actions (Closes #599) (#608)closed(merged=True)a32c68e24b4528c9c1ee321bbc61c5ec733c3d6d1prgs-reviewerManual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.