feat: guarded merger lease adoption flow (#536) #538
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#538
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 #536
Summary
Replaces the noncanonical manual
reviewer_pr_lease._SESSION_LEASEseeding pattern (incident path used for PR #493 and PR #421) with a guarded, auditable merger lease adoption flow.merger_lease_adoption.pywith adoption assessment, durable proof comment formatting, and sanctioned provenance helpers.gitea_adopt_merger_pr_leaseMCP tool for cross-session merger handoff after formal APPROVED review at the current head.assess_mutation_lease_gaterejects bare manual session seeding.adoptedas an active lease phase for thread-visible merger adoption proof.Validation
pytest tests/test_merger_lease_adoption.py tests/test_reviewer_pr_lease.py tests/test_post_merge_moot_lease.py— 27 passedpytest tests/ --ignore=tests/integration) — 1865 passed, 1 failedmaster:TestMergePR::test_merge_blocked_on_stale_approval_head(mock side_effect ordering; not introduced by #536)git diff --check— cleanmaster— clean; implementation committed from isolated worktreebranches/issue-536-merger-lease-adoptionCanonical handoff
Merger sessions (review and merge in separate sessions):
approval_at_current_headviagitea_get_pr_review_feedback.gitea_adopt_merger_pr_leasefrom a clean merger worktree underbranches/, with pinnedexpected_head_sha.adopted_from_session_idin the handoff.gitea_merge_prwith the same pinned head SHA.Forbidden: manual in-process
record_session_lease()/_SESSION_LEASEseeding without sanctioned provenance.Same-session review+merge: continue using
gitea_acquire_reviewer_pr_leasedirectly.repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #538
issue: #536
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 42115-1a6a3980f193
worktree: branches/review-pr-538
phase: claimed
candidate_head:
08ea214526target_branch: master
target_branch_sha: none
last_activity: 2026-07-08T15:12:29Z
expires_at: 2026-07-08T17:12:29Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #538
issue: #536
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 42115-1a6a3980f193
worktree: branches/review-pr-538
phase: claimed
candidate_head:
08ea214526target_branch: master
target_branch_sha: none
last_activity: 2026-07-08T15:22:12Z
expires_at: 2026-07-08T17:22:12Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #538
issue: #536
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 42115-1a6a3980f193
worktree: branches/review-pr-538
phase: claimed
candidate_head:
08ea214526target_branch: master
target_branch_sha: none
last_activity: 2026-07-08T15:22:34Z
expires_at: 2026-07-08T17:22:34Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #538
issue: #536
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 42115-1a6a3980f193
worktree: branches/review-pr-538
phase: claimed
candidate_head:
08ea214526target_branch: master
target_branch_sha: none
last_activity: 2026-07-08T15:23:46Z
expires_at: 2026-07-08T17:23:46Z
blocker: none
Review verdict: APPROVE
Reviewer:
sysadmin(prgs-reviewer)PR author:
jcwalker3(not self-review)Pinned head SHA:
08ea214526bf1f9d9ec3e3ee7e1323b997b72670Review worktree:
branches/review-pr-538Lease session:
42115-1a6a3980f193Closes #536.
Validation
Next actor
Merger (
prgs-merger): adopt → merge @ pinned SHA → close #536repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #538
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 42115-1a6a3980f193
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-538
phase: claimed
candidate_head:
08ea214526target_branch: master
target_branch_sha:
7231f27c1clast_activity: 2026-07-08T15:47:22Z
expires_at: 2026-07-08T17:47:22Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #538
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 42115-1a6a3980f193
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-538
phase: released
candidate_head:
08ea214526target_branch: master
target_branch_sha:
7231f27c1clast_activity: 2026-07-08T15:48:14Z
expires_at: 2026-07-08T17:48:14Z
blocker: post-merge-moot