Make active leases first-class workflow state with canonical adopt, release, expire, and abandon handling #601
Closed
opened 2026-07-09 16:05:37 -05:00 by jcwalker3
·
7 comments
No Branch/Tag Specified
master
fix/issue-709-decision-lock-cross-profile
fix/issue-695-native-transport-quarantine
fix/issue-698-report-validator-schema
fix/issue-702-stale-binding-lease-recovery
fix/issue-699-structured-auth-mcp-errors
fix/issue-695-native-quarantine-v2
fix/issue-693-review-decision-lock-recovery
fix/issue-691-obsolete-reviewer-lease-cleanup
feat/issue-687-reconciler-branch-delete
fix/issue-683-workflow-guard-hardening
chore/issue-681-preserve-review-session-wip
feat/issue-604-anti-stomp-preflight
feat/issue-606-sentry-observability
fix/issue-671-block-stable-branch-push
fix/issue-675-residual-preflight-remediation
fix/issue-673-remediate-regressions-part2
fix/issue-673-remediate-regressions
feat/issue-603-lifecycle-labels
fix/issue-627-set-issue-labels-pagination
feat/issue-601-first-class-leases
feat/issue-612-incident-bridge
feat/issue-600-controller-allocator-api
fix/issue-620-head-scoped-review-locks
feat/issue-613-allocator-db-substrate
docs/mcp-stable-control-runtime-policy
feat/issue-609-prepared-review-verdict-resume
feat/issue-610-live-remote-parity
feat/issue-503-reviewer-active-worktree
feat/issue-470-preflight-contract
feat/issue-440-lock-recovery
feat/issue-440-branch-recovery
feat/issue-458-queue-fail-closed-copy
feat/issue-400-early-duplicate-work-gate
feat/issue-308-reconcile-inventory-pagination
feat/issue-308-reconcile-pagination-proof
docs/issue-261-agent-temp-artifact-cleanup
feat/issue-262-map-commit-files
fix/infra-stop-conflict-marker-false-positive
feat/issue-139-role-aware-task-routing
feat/issue-188-continuation-selection-wall
feat/issue-189-continuation-mode-proofs
feat/issue-232-refresh-wiki-proof-heads
feat/issue-210-block-workspace-edits
feat/issue-204-exact-issue-lock
docs/issue-80-label-taxonomy
docs/issue-79-safety-boundary-updates
v1.1.0
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
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#601
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.
Context
Part of the LLM coordination failure series (sessions stepping on each other). This is a focused implementation issue, not an umbrella.
Related sibling: #600 (work allocator). Overlaps partially with open #599 (foreign-session resolution path) — implement or extend without duplicating ownership; prefer canonical lease lifecycle here and keep #599 scoped to handoff exposure if still open.
Problem
Reviewer/author/merger leases exist, but sessions still get blocked by foreign active leases with no clear safe path except waiting. Old prompts can reference released lease IDs, while newer active leases silently supersede them.
Required behavior
Acceptance criteria
Implementation notes
Canonical Issue State
STATE: ready for independent implementation
WHO_IS_NEXT: author
NEXT_ACTION: claim this issue and implement first-class lease adopt/release/expire/abandon tooling per acceptance criteria
NEXT_PROMPT:
WHAT_HAPPENED: Filed as focused coordination issue #601. Series siblings: #600 allocator, #602 terminal-lock early check, #603 lifecycle labels, #604 anti-stomp preflight, #605 dashboard. Related pre-existing #599 foreign-session handoff.
WHY: Sessions block on foreign/stale leases without a safe resume/release path; prompts can reference superseded lease IDs.
RELATED_PRS: none yet
BLOCKERS: none
VALIDATION: issue created with type:feature status:ready and labels workflow-hardening,leases,anti-stomp,recovery
LAST_UPDATED_BY: jcwalker3 (prgs-author)
Canonical Issue State
STATE: open / status:ready — evidence attached for lease adoption idempotency after PR #587
WHO_IS_NEXT: author
NEXT_ACTION: implement idempotent merger lease adoption and clear supersession of prior adoption comments when re-adopting after MCP restart
NEXT_PROMPT:
WHAT_HAPPENED: Evidence-only comment. During merged PR #587 (head
ebd06b73c9, mergeae6a3ae00c), prgs-merger/sysadmin re-adopted leases after MCP restarts and root-guard cleanup: adoption comments #9079 (from reviewer session 90865-review-587), #9081, #9083. Canonical for successful merge: lease_proof_comment_id #9083 (sanctioned_adoption). Duplicate search: #599 closed (foreign handoff); open #601 owns adopt lifecycle; no separate open issue for adoption-noise. No new issue created.WHY: Non-idempotent re-adopt after process death appends multiple phase:adopted markers, creating ledger noise and ambiguous canonical adoption. Desired: idempotent or clear supersede; reports/assess tools name canonical adoption comment id; post-merge multi-marker moot cleanup (extend #515 if needed).
RELATED_PRS: #587 (merged)
BLOCKERS: none for evidence attach; implementation remains on #601
VALIDATION: Live open/closed issue search; #599 closed; #601 open with leases label; related #515/#536/#537/#577 closed history; gitea.issue.comment allowed under prgs-reconciler/sysadmin
LAST_UPDATED_BY: sysadmin / prgs-reconciler (evidence only)
[THREAD STATE LEDGER] PR #625 / Issue #601 — MERGED to master; issue auto-closed; residual label reconciliation for controller/reconciler
What is true now:
1be4600261780ef0b1be(dismissed and stale)5347b313ea5347b313ea1be4600261(approval_visible=true, approval_at_current_head=true, has_blocking_change_requests=false, review_feedback_stale=false); prior REQUEST_CHANGES verdict at780ef0bis dismissed and stale; PR #625 merged via merge commit; issue #601 closed by the merge5347b31present on prgs/master; head SHA1be4600261reachable from prgs/master (git merge-base --is-ancestor); merger worktree branches/merge-control clean; root checkout cleanWhat changed:
1be4600261via merge commit5347b31What is blocked:
Who/what acts next:
Canonical Issue State
STATE:
merged-complete
WHO_IS_NEXT:
controller
NEXT_ACTION:
Reconcile Issue #601 post-merge label state (drop stale status:pr-open) and record final acceptance; the merge itself is complete and verified.
NEXT_PROMPT:
WHAT_HAPPENED:
Merger session verified live PR/issue state, confirmed the reviewer's server-side review verdict is current and non-blocking at head SHA
1be4600261(== live head; approval_visible=true; prior REQUEST_CHANGES at780ef0bdismissed and stale), confirmed the reviewing actor (prgs-reviewer sysadmin) is not the PR author (jcwalker3), adopted the reviewer lease into merger role via the sanctioned path (comment 9445), passed merge eligibility, and merged PR #625 via a merge commit. Post-merge verification confirmed PR closed and merged, merge commit5347b31on prgs/master, head SHA1be4600261reachable, and Issue #601 auto-closed. Merger and root worktrees remain clean.WHY:
All live-state, review-verdict parity, capability, lease, workspace, and merge-eligibility gates passed at the pinned head SHA
1be4600261. Issue #601 auto-closed via the Closes directive, so the merge objective is complete; the only residual is cosmetic label reconciliation, which is reconciler/controller scope (merger cannot set labels).CURRENT_HEAD:
1be4600261MERGE_COMMIT:
5347b313eaRELATED_ISSUES:
RELATED_PRS:
BLOCKERS:
none
VALIDATION:
Review-verdict parity: reviewer server-side review verdict current and non-blocking at head SHA
1be4600261(== live head; approval_visible=true, approval_at_current_head=true); prior REQUEST_CHANGES dismissed and stale; reviewing actor != PR author. Merge eligibility: eligible=true, state open, mergeable=true, self_author=false. Merge result: performed=true via merge commit5347b31. Post-merge: PR #625 closed and merged, merge commit on prgs/master, head SHA1be4600261reachable, Issue #601 closed. Workspace: merger worktree branches/merge-control clean; root clean.LAST_UPDATED_BY:
sysadmin / prgs-merger / merger / 2026-07-10T11:23-05:00
[THREAD STATE LEDGER] PR #625 / Issue #601 — LABEL_RECONCILIATION_BLOCKED by Gitea label pagination defect
What is true now:
1be46002615347b313ea5347b313eagitea_set_issue_labelstool queries f"{base}/labels?limit=100" which only returns the first 50 labels (alphabetically), thereby omitting labels like "type:feature" and "workflow-hardening" that lie beyond index 50. The tool raises: "The following labels do not exist on the repository: ['type:feature', 'workflow-hardening']".What changed:
What is blocked:
Who/what acts next:
Canonical Issue State
STATE:
label-reconciliation-blocked
WHO_IS_NEXT:
author
NEXT_ACTION:
Fix the Gitea label pagination defect in gitea_set_issue_labels (in gitea_mcp_server.py) by replacing api_request with api_get_all, restart the MCP server, and finalize Issue #601 label hygiene.
NEXT_PROMPT:
WHAT_HAPPENED:
Reconciler session blocked during label hygiene update because gitea_set_issue_labels cannot resolve labels beyond Gitea's 50-item page cap.
WHY:
gitea_set_issue_labels does not paginate its repository labels fetch, unlike gitea_list_labels.
RELATED_PRS:
PR #625
BLOCKERS:
Gitea label pagination defect; requires fixing the Gitea GET /labels api_request call to use api_get_all.
VALIDATION:
git diff --check prgs/master...HEAD clean; 79 unit tests passed.
LAST_UPDATED_BY:
sysadmin / prgs-reconciler / reconciler / 2026-07-10T12:41-05:00
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 Gitea client returned EOF, necessitating a reconnect of the MCP server. Once reconnected, the reconciler executed gitea_set_issue_labels to strip the stale PR status label.
RELATED_PRS:
#625, #629
BLOCKERS:
none
VALIDATION:
5ab5fe8583LAST_UPDATED_BY:
reconciler
Canonical Issue State
STATE:
residual_status_pr_open_absent
WHO_IS_NEXT:
controller
NEXT_ACTION:
Decide whether to close Issue #601 as complete after PR #625 land, or keep open for remaining acceptance criteria
NEXT_PROMPT:
WHAT_HAPPENED:
Post-#629 reconciler re-check: residual status:pr-open named in merger handoff is not present on #601. No label mutation applied to #601.
WHY:
Live labels already correct for the residual hygiene goal; reconciler did not invent a close without policy proof.
RELATED_ISSUES:
RELATED_PRS:
BLOCKERS:
none for residual status:pr-open path
VALIDATION:
gitea_view_issue #601 labels listed without status:pr-open; MCP at
5ab5fe8583LAST_UPDATED_BY:
sysadmin / prgs-reconciler / 2026-07-10
[THREAD STATE LEDGER] Issue #601 — CLOSURE AUDIT (post-transport-flap rerun): closure VALID; contamination narrative discarded; no reopen
What is true now:
5347b313ea); merged_at 2026-07-10T11:23:29-05:001be4600261(approval_visible=true, approval_at_current_head=true, has_blocking_change_requests=false); the merge of PR #625 was performed; issue #601 closed by that merge event5347b31and head SHA1be4600261both reachable from prgs/master; PR #625 changed the real #601 lease files (lease_lifecycle.py +723 new, control_plane_db.py +622, gitea_mcp_server.py +310, issue_lock_store.py, task_capability_map.py, tests/test_lease_lifecycle.py +392 new, plus docs); control checkout cleanWhat changed:
What is blocked:
Who/what acts next:
Contamination adjudication (trusted vs discarded)
TRUSTED proof of closure:
5347b31on prgs/master) genuinely implementing #601's lease lifecycle.DISCARDED as closure basis (not underpinning the closure):
Canonical Issue State
STATE:
merged-complete
WHO_IS_NEXT:
user
NEXT_ACTION:
None. Issue #601 is validly closed by PR #625 (merge commit
5347b31); labels are reconciled; audit trail is complete.NEXT_PROMPT:
WHAT_HAPPENED:
Reconciler/controller reran the Issue #601 closure audit after an MCP transport flap had blocked a prior attempt. Live Gitea + git-remote reads confirm #601 was closed by the merge event of sanctioned PR #625 (merge commit
5347b31on prgs/master, implementing the real lease-lifecycle files), that closed_at equals merged_at (auto-close, not a manual author close), and that stale label status:pr-open was already removed with valid labels preserved. The operator-supplied contamination narrative was adjudicated against live proof and found non-load-bearing for the closure.WHY:
A valid landed implementation exists on prgs/master despite the reported contaminated session behavior, so the correct disposition is to leave #601 closed and document trusted vs discarded proof rather than reopen. Reopening is unwarranted on the merits and would be forbidden without live evidence of missing implementation.
RELATED_ISSUES:
RELATED_PRS:
5347b31)BLOCKERS:
none
VALIDATION:
Live gitea_view_issue #601 = closed, labels without status:pr-open. Live gitea_view_pr #625 = closed with merge performed, merge_commit_sha
5347b31, closed_at == merged_at. Git remote: merge commit5347b31and head SHA1be4600261reachable from prgs/master; PR #625 landed the real #601 lease-lifecycle files. Reconciler runtime fresh: restart_required=false, stop_required=false, preflight workflow_skill_ready=true, boundary clean, in parity. No mutation performed by this audit.LAST_UPDATED_BY:
sysadmin / prgs-reconciler / reconciler / 2026-07-10T13:40-05:00