Add controller-owned work allocator to prevent duplicate LLM work on the same issue or PR #600
Closed
opened 2026-07-09 16:05:15 -05:00 by jcwalker3
·
6 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#600
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.
Problem
Multiple LLM sessions can independently select the same issue or PR and start author/reviewer/merger work before discovering active leases, terminal locks, or already-in-progress sessions. This causes wasted validation, blocked formal decisions, and workflow contention.
Required behavior
assigned_workwaitblocked_by_terminal_pathblocked_by_active_leaseneeds_controllerno_safe_workAcceptance criteria
Implementation notes
LLM coordination series (independent implementation issues)
Not an umbrella — each issue can be claimed and shipped independently:
Related pre-existing: #599 (foreign lease handoff path).
Canonical Issue State
STATE: ready for independent implementation — design clarified (MCP allocator is the authority)
WHO_IS_NEXT: author
NEXT_ACTION: implement MCP-native allocation tools; do not implement a separate human/LLM controller role
NEXT_PROMPT:
WHAT_HAPPENED: Design clarification added to #600 superseding any framing of a separate human-only or LLM-only controller role.
WHY: Allocation must live in the Gitea MCP control plane so concurrent sessions cannot stomp by self-selecting issues/PRs.
RELATED_PRS: none yet
BLOCKERS: none
VALIDATION: labels updated to include control-plane, database, mcp-menu; clarification recorded on issue thread
LAST_UPDATED_BY: jcwalker3 (prgs-author)
Design clarification (authoritative for #600)
Clarification
The allocator should not be a separate human-only or LLM-only controller role. The Gitea MCP tool itself should become the allocation authority.
Required design — first-class Gitea MCP allocation tools
gitea_allocate_next_workgitea_get_assignmentgitea_heartbeat_assignmentgitea_release_assignmentgitea_complete_assignmentgitea_reconcile_assignmentsgitea_list_live_allocationsWorker rules:
Storage model
Allocator must inspect
Required routing behavior
Acceptance criteria (updated)
gitea_allocate_next_work(apply=true)cannot receive the same assignment.Related issues
Canonical Issue State
STATE: open; architecture-aligned after ADR land; ready for design stubs only until #613 substrate ships
WHO_IS_NEXT: author
NEXT_ACTION: Wait for or implement after #613; do not claim #600 complete without DB-backed assign+lease
NEXT_PROMPT:
WHAT_HAPPENED: PR #614 merged the allocator/control-plane/observability ADR. This comment records #600 as dependent on #613 and restates allocator authority rules from the ADR.
WHY: #600 body predated the hard #613 dependency and could be read as implementable on existing comment/file locks alone — ADR forbids that as completion.
RELATED_PRS: #614 (merged, merge_commit_sha=08c3488d7c35ba27efcd5119514aeeac37b657f7); ADR docs/architecture/mcp-allocator-control-plane-observability-adr.md; depends on #613; feeds #612
BLOCKERS: Hard dependency on #613 control-plane DB (atomic assignment+lease). Unblock condition: #613 merged to master with assign+lease transactions available. Partial previews allowed only without claiming allocator complete.
VALIDATION: gitea_view_pr #614 closed+merged at 08c3488d7c35ba27efcd5119514aeeac37b657f7; prgs/master contains merge commit; ADR path on master
LAST_UPDATED_BY: sysadmin (prgs-reconciler)
Global architecture statement
Dependency
Hard decisions for #600
gitea_allocate_next_work(withapply=trueonly when taking work).Gitea comments/labels may mirror assignment for humans; they are not the sole lock source.
Issue claim heartbeat
Canonical Issue State
STATE: open — #600 allocator API is on master; issue-close is pending an author session
WHO_IS_NEXT: author
NEXT_ACTION: Close issue #600 via prgs-author; prgs-reconciler has no gitea.issue.close permission and does not reopen or close issues.
NEXT_PROMPT:
WHAT_HAPPENED: PR #622 landed #600 on master; the "Closes #600" keyword did not auto-close the issue, leaving it open. The prior claim heartbeat (comment 9318) is moot because its branch merged via PR #622. Reconciler flagged the stale status:pr-open label but did not strip it, to avoid dropping org-scoped labels.
WHY: The merge auto-close missed; closing requires an author profile. Reconciler flags rather than forces (no permission; not reopening).
RELATED_PRS: #622 (closed, merge
f20c8436aa); depends on #613 / PR #619 (10228e1c06); feeds #612 / PR #623 (ab1c2d7973)BLOCKERS: prgs-reconciler lacks gitea.issue.close — an author session must close #600.
VALIDATION: gitea_view_pr #622 state=closed with merge result f20c843; gitea_view_issue #600 state=open; prgs/master head
ab1c2d7973containsf20c843. Raw Sentry/GlitchTip incidents are non-assignable; only issue/pr kinds are allocatable.LAST_UPDATED_BY: sysadmin (prgs-reconciler)
[THREAD STATE LEDGER]
What is true now
ab1c2d7973(containsf20c843).What changed
What is blocked
Who/what acts next
Chain #613 → #600 → #612 is fully landed on master (
10228e1→f20c843→ab1c2d7). Raw incidents attach only through incident_links; Gitea issues remain the durable work system.Canonical Issue State
STATE:
closed
WHO_IS_NEXT:
user
NEXT_ACTION:
no further author work on #600; chain #613 → #600 → #612 is landed on master; use allocator and bridge via normal workflow only
NEXT_PROMPT:
WHAT_HAPPENED:
Author post-merge reconciliation closed issue #600 after PR #622 landed on master and auto-close did not fire; removed stale status:pr-open from #600, #612, and #613 while preserving all non-status labels.
WHY:
PR #622 body included Closes #600 and merge commit
f20c843is on prgs/master, but issue #600 remained open with stale status:pr-open; reconciler could not safely rewrite full label sets due to label-name resolution limits on colon-prefixed labels when using replace-all with incomplete label pages.RELATED_PRS:
#622 (implements #600, merge
f20c843); #619 (#613, merge10228e1); #623 (#612, mergeab1c2d7)BLOCKERS:
none remaining for this chain; label cleanup completed via surgical DELETE of status:pr-open only (id 100), not a lossy full replace
VALIDATION:
live prgs/master contains
10228e1,f20c843, ab1c2d7; PR #619/#622/#623 closed with matching merge SHAs; issue #600 state closed; labels after cleanup omit status:pr-open and retain allocator/control-plane/type:feature (and peers on #612/#613)LAST_UPDATED_BY:
jcwalker3 (prgs-author)
Post-merge reconciliation (#600)
f20c8436aacdaea6ba2448764b43ef05e02d427b— #600 implementation is on master.Closes #600did not fire.status:pr-openremoved from #600, #612, and #613 by surgical label DELETE (label id 100 only). Non-status labels preserved (includingtype:feature,workflow-hardeningwhere present).