feat: first-class control-plane lease lifecycle (Closes #601) #625
Merged
sysadmin
merged 2 commits from 2026-07-10 11:23:29 -05:00
feat/issue-601-first-class-leases into master
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#625
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 #601 — active leases as first-class workflow state with canonical adopt / release / expire / abandon handling on the #613 control-plane DB substrate (#600 allocator compatible).
Dependency chain:
#613 substrate → #600 allocator → #601 lease lifecycle (this PR)Changes
lease_lifecycle.pycontrol_plane_db.pygitea_mcp_server.pygitea_*_workflow_lease(s)issue_lock_store.pytask_capability_map.pytests/test_lease_lifecycle.pyHard rules
wait_foreign_active).(dead_process OR missing_worktree)+no_live_mutation_risk(+ foreign operator/full proof).adopted_from_session_id,adopted_by_session_id, work identity, head SHA, worktree.gitea_adopt_merger_pr_lease) unchanged.Validation
Closes #601
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #625
issue: #601
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 62699-c2ed89d8b3ff
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-625
phase: claimed
candidate_head:
780ef0b1betarget_branch: master
target_branch_sha: none
last_activity: 2026-07-10T15:38:11Z
expires_at: 2026-07-10T17:38:11Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #625
issue: #601
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 62699-c2ed89d8b3ff
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-625
phase: claimed
candidate_head:
780ef0b1betarget_branch: master
target_branch_sha: none
last_activity: 2026-07-10T15:43:08Z
expires_at: 2026-07-10T17:43:08Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #625
issue: #601
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 62699-c2ed89d8b3ff
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-625
phase: claimed
candidate_head:
780ef0b1betarget_branch: master
target_branch_sha: none
last_activity: 2026-07-10T15:43:46Z
expires_at: 2026-07-10T17:43:46Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #625
issue: #601
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 62699-c2ed89d8b3ff
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-625
phase: claimed
candidate_head:
780ef0b1betarget_branch: master
target_branch_sha: none
last_activity: 2026-07-10T15:44:31Z
expires_at: 2026-07-10T17:44:31Z
blocker: none
Requesting changes due to 1 test failure (TestIssueLocking::test_lock_issue_blocks_expired_same_operation_lease_for_recovery) and a whitespace check issue (trailing blank line in control_plane_db.py).
Canonical Issue State
STATE:
needs-review
WHO_IS_NEXT:
reviewer
NEXT_ACTION:
Re-review PR #625 at head
1be460026110f69f51f6578a34c87efc8bdfa83dafter REQUEST_CHANGES fixes; do not re-review stale head780ef0b.NEXT_PROMPT:
WHAT_HAPPENED:
Author addressed REQUEST_CHANGES from head
780ef0b1be4d1682fdb4fba1e4b0b6a131d60e43and pushed fix head1be460026110f69f51f6578a34c87efc8bdfa83don existing branchfeat/issue-601-first-class-leases(PR #625). No new PR opened. Assignment asn-193d452ed0b748e7 reused.WHY:
Server-side review at
780ef0bhad two blockers: (1) MCP recovery test expected sticky expired-lock fail-closed behavior but fixture used a missing worktree path so reclaim succeeded; (2) trailing blank line at EOF in control_plane_db.py failed git whitespace check. Both fixed without weakening foreign lease protection or DB lease authority.RELATED_DISCUSSION:
none
RELATED_PRS:
BRANCH:
feat/issue-601-first-class-leases
HEAD_SHA:
1be4600261VALIDATION:
pytest targeted suite → 79 passed; git diff --check prgs/master...HEAD → clean
BLOCKERS:
none for author; reviewer must re-validate at new head (prior REQUEST_CHANGES is stale relative to current head)
LAST_UPDATED_BY:
jcwalker3 / prgs-author / 2026-07-10
CTH: Author Handoff
Status: request_changes_addressed_awaiting_re_review
Next owner: reviewer
Current blocker: none
Decision: REQUEST_CHANGES blockers fixed; push complete; re-review required at new head
Proof:
780ef0b1be4d1682fdb4fba1e4b0b6a131d60e431be460026110f69f51f6578a34c87efc8bdfa83dNext action: reviewer re-reviews PR #625 at pinned new head
Ready-to-paste prompt: see NEXT_PROMPT above
[THREAD STATE LEDGER] PR #625 / Issue #601 — REQUEST_CHANGES addressed; re-review needed at new head
What is true now:
1be4600261780ef0b1be(stale relative to current head)What changed:
What is blocked:
Who/what acts next:
1be4600261using prgs-reviewer1be4600261Canonical Issue State
STATE:
needs-review
WHO_IS_NEXT:
reviewer
NEXT_ACTION:
Re-review PR #625 at head
1be4600261NEXT_PROMPT:
WHAT_HAPPENED:
Author pushed fix head after REQUEST_CHANGES; ledger records re-review handoff
WHY:
Formal REQUEST_CHANGES at
780ef0bis stale; reviewer must judge new headRELATED_PRS:
BLOCKERS:
none
VALIDATION:
79 passed; git diff --check clean
LAST_UPDATED_BY:
jcwalker3 / prgs-author / 2026-07-10
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #625
issue: #601
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 62699-c2ed89d8b3ff
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-625
phase: claimed
candidate_head:
1be4600261target_branch: master
target_branch_sha: none
last_activity: 2026-07-10T16:02:34Z
expires_at: 2026-07-10T18:02:34Z
blocker: none
Canonical PR State
STATE:
approved
WHO_IS_NEXT:
merger
NEXT_ACTION:
Adopt the merger lease and merge PR #625 at head
1be4600261.NEXT_PROMPT:
WHAT_HAPPENED:
The independent reviewer session has approved PR #625 at the current live head
1be460026110f69f51f6578a34c87efc8bdfa83dafter confirming that both prior blockers have been successfully resolved.WHY:
tests/test_mcp_server.pynow correctly exercises sticky fail-closed lease behavior by verifying that an expired lease with a live PID and a present worktree prevents takeover.control_plane_db.pyhas been removed, ensuringgit diff --checkpasses cleanly.tests/test_issue_lock_store.py.ISSUE:
#601
HEAD_SHA:
1be4600261REVIEW_STATUS:
approved
MERGE_READY:
true
BLOCKERS:
none
VALIDATION:
The targeted pytest suite (79 tests) passed successfully. The workspace and
git diff --checkare completely clean.LAST_UPDATED_BY:
sysadmin / prgs-reviewer / 2026-07-10
adopted_at: 2026-07-10T16:22:53Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 62699-c2ed89d8b3ff
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 9429
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #625
issue: #601
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 41940-211cee547d00
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-control
phase: adopted
candidate_head:
1be4600261target_branch: master
target_branch_sha: none
last_activity: 2026-07-10T16:22:53Z
expires_at: 2026-07-10T18:22:53Z
blocker: none
Stale #332 review-decision lock cleanup (#594)
Status: APPLIED
sysadminprgs-reviewer2026-07-10T17:50:42.303906+00:00approveon PR feat: first-class control-plane lease lifecycle (Closes #601) (#625)closed(merged=True)5347b313ea4ac5a1d265b42de653e91e2b0bdcb62prgs-reviewerManual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.
Canonical Issue State
STATE:
complete
WHO_IS_NEXT:
user
NEXT_ACTION:
No further actions are required. The workflow is complete.
NEXT_PROMPT:
WHAT_HAPPENED:
Refreshed the MCP runtime to include the paginated label-resolution fix, removed stale status:pr-open from Issue #601, preserved all valid labels, and verified final closed state.
WHY:
The PR was successfully reviewed, approved, and merged. Label reconciliation is now also complete.
RELATED_PRS:
#625, #629
BLOCKERS:
none
VALIDATION:
5ab5fe8583LAST_UPDATED_BY:
reconciler