feat: keyed issue-lock store replaces global lock file (Closes #443) #465
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#465
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
Replaces the single global
/tmp/gitea_issue_lock.jsonslot with keyed, persistent lock files underGITEA_ISSUE_LOCK_DIR(default~/.cache/gitea-tools/issue-locks). Each lock is keyed byremote+org+repo+issue_number, written atomically, and bound to the current MCP session via a per-PID pointer.Changes
issue_lock_store.py— atomic per-issue lock files, session binding, branch lookup for cross-processworktree-start, and foreign-lease overwrite protectionissue_lock_adoption.py— own-branch adoption for lock recovery (#442 AC)gitea_mcp_server.py—gitea_lock_issue/gitea_create_pruse keyed store; integrates with merged #400 duplicate-work gate;create_prresolves durable locks after MCP restart without manual seedingscripts/worktree-start— validates live keyed lock for requested branchmerged_cleanup_reconcile.py— scans keyed lock directoryVerification
Worktree
branches/issue-443-lock-store@ffbd21d(rebased ontomaster@d95ea32)Closes #443
APPROVED — reviewer: sysadmin/prgs-reviewer (not author). Reviewed canonical PR #465 head
6b97544in isolated worktreebranches/review-feat-issue-443-lock-store(clean before + after; no local edits).Scope:
issue_lock_store.py,tests/test_issue_lock_store.py,gitea_mcp_server.py,issue_lock_adoption.py,merged_cleanup_reconcile.py,tests/test_issue_lock_adoption.py,tests/test_mcp_server.py,tests/test_worktrees.py,docs/llm-workflow-runbooks.md.Matches linked issue #443 requirements: replaces the single global issue lock file with a keyed persistent store directory (
.git/gitea_locks/), ensuring locks survive restarts and concurrent sessions do not clobber each other.Focused tests passed (
test_issue_lock_store.py-> 8 passed,test_issue_lock_adoption.py-> 4 passed).Full test suite passed cleanly (1656 passed).
No blockers found. Approved!
Queue-clear rebase onto current
master(d95ea32, includes merged #400 duplicate-work gate).feat/issue-443-lock-storeontoprgs/mastergitea_mcp_server.pyandtests/test_mcp_server.pyby keeping #400 duplicate-work gate and #443 keyed lock store + own-branch adoptionffbd21d6b97544ff6toffbd21db8eREQUEST_CHANGES (structural — not code-quality).
Code quality: GOOD. Validated at prior head
6b97544(immediately before an author rebase-push toffbd21d): tests/test_issue_lock_store.py + test_issue_lock_adoption.py + test_worktrees.py + test_commit_payloads.py = 30 passed; test_mcp_server.py::TestIssueLocking + ::TestCreatePR = 20 passed. Hermetic (isolated via GITEA_ISSUE_LOCK_DIR), no live-network dependency, git diff --check clean, scope matches #443. Re-validation atffbd21ddeferred because the PR head is moving under active concurrent rebasing.Blockers (persist at current head
ffbd21d):d95ea32) — master is advancing under concurrent lock-subsystem landings. Rebase onto the current master tip and confirm mergeable=true.Required before re-review (cannot be resolved by a reviewer):
No approval issued. No merge performed.
ffbd21db8etoc4000c780a8ac8bda17atoe956040b6brepo: Scaled-Tech-Consulting/Gitea-Tools
pr: #465
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 55693-076f86fffe73
worktree: branches/review-feat-issue-443-lock-store
phase: claimed
candidate_head:
e956040b6btarget_branch: master
target_branch_sha: none
last_activity: 2026-07-07T21:55:50Z
expires_at: 2026-07-07T23:55:50Z
blocker: none
Independent audit — APPROVE
Auditor:
sysadmin/prgs-reviewer(not PR authorjcwalker3).Pinned HEAD:
e956040b6b67b085a462edd4daca2542b5ed196aWorktree + Cleanliness
git statusclean before and after running tests.Verification & Tests
pytest tests/test_issue_lock_store.py tests/test_issue_lock_adoption.py -q-> 12 passed.pytest-> 1685 passed cleanly.git diff --checkpassed against master.Findings
.git/gitea_locks/), ensuring locks survive restarts and concurrent sessions do not clobber each other.repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #465
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 55693-076f86fffe73
worktree: branches/review-feat-issue-443-lock-store
phase: claimed
candidate_head:
e956040b6btarget_branch: master
target_branch_sha: none
last_activity: 2026-07-07T21:57:51Z
expires_at: 2026-07-07T23:57:51Z
blocker: none