fix: exclude foreign-claimed work from allocation (Closes #765) #773
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#773
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 #765
Summary
Recovers the preserved #765 implementation onto current
prgs/master(0c2f45a) and publishes foreign-lease exclusion for the controller-owned allocator.Before ranking, active claims owned by a different
controller_instance_idare excluded with reasonclaimed_by_other_session. Ranking continues to the next unclaimed candidate. Own-task resume remains possible. Task-local blockers no longer blockade the entire author queue.controller_instance_idis persisted on sessions and surfaced on lease rows; the workflow dashboard applies the same exclusion.Recovery proof
author-765-recovery-d4e629909f8f45a1-1784573047d06198b97d583f0b960adcb435931effbf305516preserve/issue-765-d06198bbacafc5f96f709ea195fdce733ba98449ae4513fad13d872df3ac22630617c4805832d0875e258a30c2f45abb7c0db96c477e9a6db35a6728e654311gitea_commit_filesFiles
allocator_service.pycontrol_plane_db.pygitea_mcp_server.pyworkflow_dashboard.pytests/test_allocator_foreign_lease_exclusion.py(new)Validation
Checklist
jcwalker3/prgs-author)Next role
reviewer — review at head
ad13d872df3ac22630617c4805832d0875e258a3.Canonical Issue State
STATE: pr-open — PR #773 published for Issue #765 at head
ad13d872dfWHO_IS_NEXT: reviewer
NEXT_ACTION: review PR #773 at pinned head
ad13d872dfunder prgs-reviewer; do not author further #765 changes unless requested changes landNEXT_PROMPT:
WHAT_HAPPENED: Author recovery for #765 completed. Recovered lock via gitea_lock_issue after parking branch at master tip with preserve/issue-765-d06198b holding candidate d06198b. Cherry-picked preserved commit cleanly onto
0c2f45a(local c4b504d; stable patch-id bacafc5f…), re-ran focused and full tests, published via gitea_commit_files to headad13d872, opened PR #773 only.WHY: Comment 13206 classified AUTHOR_RECOVERY_REQUIRED; #765 behavior was absent from master; exclusive author WIP was free (open PR inventory empty); candidate was complete and clean.
RELATED_PRS: #773 (this PR, open, closes #765)
BLOCKERS: none
VALIDATION: Gate Zero parity at
0c2f45arestart_required=false stop_required=false; identity jcwalker3/prgs-author match; no competing live author lease for #765; open PR inventory empty before create; focused 22 passed; broader 101 passed; full suite 3861 passed with 11 baseline-proven failures; remote branch headad13d872verified via ls-remote; issue labels moved to status:pr-openLAST_UPDATED_BY: prgs-author / jcwalker3 / LLM_LOCK_ID=author-765-recovery-d4e629909f8f45a1-1784573047
[THREAD STATE LEDGER] PR #773 / Issue #765 — author recovery published; next role reviewer
What is true now:
ad13d872dfbase masterad13d872dfWhat changed:
0c2f45aby clean cherry-pick then gitea_commit_files publishedad13d872What is blocked:
Who/what acts next:
ad13d872dfad13d872repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #773
issue: #765
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: reviewer-773-765-4b0b18cf4d154c9c-1784574196
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-418
phase: claimed
candidate_head:
ad13d872dftarget_branch: master
target_branch_sha:
0c2f45abb7last_activity: 2026-07-20T19:03:28Z
expires_at: 2026-07-20T19:13:28Z
blocker: none
Canonical PR State
STATE: approved at current head; awaiting independent merger
WHO_IS_NEXT: merger
NEXT_ACTION: Merge PR #773 at exact reviewed head
ad13d872dfunder prgs-merger after Gate Zero; do not re-review unless head moves; do not author changes.NEXT_PROMPT:
WHAT_HAPPENED: Independent formal review of PR #773 completed by sysadmin/prgs-reviewer (LLM_LOCK_ID=reviewer-773-765-4b0b18cf4d154c9c-1784574196). Lease acquired on worktree branches/review-418 pinned to
ad13d872. Provenance, ACs, failure modes, 22-vs-23 accounting, focused/related/full tests, and baseline signature comparison completed. Formal APPROVE submitted at exact head via native MCP gitea_submit_pr_review.WHY: Issue #765 requires foreign active leases to be excluded before allocator ranking so one claimed issue cannot blockade the author queue. The published head implements that ownership model with controller_instance_id, dashboard parity, and regression tests; independent validation confirms ACs and no regression beyond baseline master failures.
ISSUE: #765
HEAD_SHA:
ad13d872dfREVIEW_STATUS: APPROVED
MERGE_READY: yes (approval at current head; mergeable; no blocking change requests from this review)
BLOCKERS: none for merge of this PR; 11 full-suite failures are baseline-proven on pristine master
0c2f45aand outside this PR's five-file diffVALIDATION: Gate Zero pass; workflow_hash 263d0a6cb8a6 boundary clean; parent==base; patch-id bacafc5f96f709ea195fdce733ba98449ae4513f matches preserve d06198b; five-file scoped diff; focused 22 passed; related 101 passed; full 3861 passed / 6 skipped / 11 baseline-matched failures; 22 vs 23 resolved as prior accounting miscount (no lost coverage); symlink mcp-author-clean-ns is publication provenance only (restore in terminal cleanup)
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=gitea_submit_pr_review; profile=prgs-reviewer; identity=sysadmin; session_id=reviewer-773-765-4b0b18cf4d154c9c-1784574196; head=ad13d872df3ac22630617c4805832d0875e258a3
LAST_UPDATED_BY: sysadmin / prgs-reviewer / LLM_LOCK_ID=reviewer-773-765-4b0b18cf4d154c9c-1784574196
Formal independent review — APPROVE
Provenance
ACs #765 (all PASS)
Foreign lease exclusion before ranking; next unclaimed selection; own-task resume; task-local blockers; all-claimed wait; controller_instance_id persist/enforce; skipped accounting; backward-compatible schema migration; dashboard parity.
Failure modes (all PASS)
Expired/released not active; missing instance fails safe; same profile different controller instance is foreign; no special-casing; no anti-stomp/role/WIP weakening.
Tests
0c2f45a(+22 = new module)Symlink
mcp-author-clean-ns → issue-765-allocator-ownership (under branches/, not control). Publication provenance only. Reviewer did not modify. Restore during terminal cleanup.
Verdict
APPROVE at
ad13d872df. Do not merge from reviewer.repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #773
issue: #765
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: reviewer-773-765-4b0b18cf4d154c9c-1784574196
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-418
phase: released
candidate_head:
ad13d872dftarget_branch: master
target_branch_sha:
0c2f45abb7last_activity: 2026-07-20T19:10:15Z
expires_at: 2026-07-20T19:20:15Z
blocker: manual-release
Canonical Issue State
STATE: approved review posted to gitea at current head on PR #773; reviewer lease released; awaiting independent merger
WHO_IS_NEXT: merger
NEXT_ACTION: Merge PR #773 at exact reviewed head
ad13d872dfunder prgs-merger after Gate Zero; re-verify approval_at_current_head before merge.NEXT_PROMPT:
WHAT_HAPPENED: Independent formal review of PR #773 finished. Approved review posted to gitea (review_id=486) at head
ad13d872. Readback: reviewed_head_sha exact, dismissed=false, stale=false, approval_at_current_head=true, has_blocking_change_requests=false. Reviewer lease released for session reviewer-773-765-4b0b18cf4d154c9c-1784574196. Merge not performed from reviewer role. No source or symlink modifications by reviewer.WHY: Issue #765 foreign-lease exclusion is correctly implemented and independently confirmed; next actor is merger.
RELATED_PRS: #773 (open; Closes #765; head
ad13d872df)BLOCKERS: none
VALIDATION: focused suite 22 passed; related allocator/control-plane/dashboard suite 101 passed; full suite 3861 passed / 6 skipped / 11 failures baseline-proven on pristine master 0c2f45a; patch-id bacafc5f…; parent equals base 0c2f45a…; approval_at_current_head=true
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=gitea_submit_pr_review; profile=prgs-reviewer; identity=sysadmin; session_id=reviewer-773-765-4b0b18cf4d154c9c-1784574196; head=ad13d872df3ac22630617c4805832d0875e258a3; review_id=486
LAST_UPDATED_BY: sysadmin / prgs-reviewer / LLM_LOCK_ID=reviewer-773-765-4b0b18cf4d154c9c-1784574196
[THREAD STATE LEDGER] PR #773 / Issue #765 — formal review complete; next role merger
What is true now:
What changed:
ad13d872What is blocked:
Who/what acts next:
ad13d872after Gate Zeroad13d872repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #773
issue: #765
reviewer_identity: sysadmin
profile: prgs-merger
session_id: merger-pr773-5d38ffca5802435d-1784575439
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr-773
phase: claimed
candidate_head:
ad13d872dftarget_branch: master
target_branch_sha:
0c2f45abb7last_activity: 2026-07-20T19:24:38Z
expires_at: 2026-07-20T19:34:38Z
blocker: none
Stale #332 review-decision lock cleanup (#594)
Status: APPLIED
sysadminprgs-merger2026-07-20T19:25:00.861282+00:00approveon PR fix: exclude foreign-claimed work from allocation (Closes #765) (#773)closed(merged=True)ccfaa0ec0cb6c24159ae7795b51268289f04e9e51prgs-reviewerManual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #773
issue: #765
reviewer_identity: sysadmin
profile: prgs-merger
session_id: merger-pr773-5d38ffca5802435d-1784575439
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr-773
phase: released
candidate_head:
ad13d872dftarget_branch: master
target_branch_sha:
0c2f45abb7last_activity: 2026-07-20T19:34:22Z
expires_at: 2026-07-20T19:44:22Z
blocker: post-merge-moot
Canonical Issue State
STATE: terminal cleanup completed for merged PR #773 / closed Issue #765
WHO_IS_NEXT: controller
NEXT_ACTION: no further #773/#765 cleanup required; optional follow-up only if a sanctioned symlink/file-lock cleanup capability is added
NEXT_PROMPT:
WHAT_HAPPENED: Supervised terminal cleanup by prgs-reconciler / sysadmin (LLM_LOCK_ID=reconciler-773-765-011d9db842544dda8f5db07a206d490b). Gate Zero held at master
ccfaa0ec0c(restart_required=false, stop_required=false, clean control checkout).ad13d872: dry-run cleanup_allowed=true then apply → released marker comment 13405 (post-merge-moot). No active PR lease remains.WHY: Post-merge terminal cleanup for the #773/#765 bundle only.
RELATED_PRS: #773 (merged; this thread)
BLOCKERS: none for terminal state; residual capability gaps: no sanctioned unlock for dead-owner file issue-lock; no sanctioned symlink restore/remove (mcp-author-clean-ns preserved dangling)
VALIDATION: PR closed/merged with merge_commit ccfaa0ec0cb6… and head ad13d872…; Issue #765 closed; merger lease active_lease=null; remote branch verified_absent; local branch deleted; merge/review/author worktrees absent; control checkout clean at ccfaa0e…; #772/#774 worktrees untouched
LAST_UPDATED_BY: sysadmin / prgs-reconciler / LLM_LOCK_ID=reconciler-773-765-011d9db842544dda8f5db07a206d490b