fix: authoritative cross-role generic queue allocation (Closes #840) #841

Merged
sysadmin merged 2 commits from fix/issue-840-cross-role-queue-allocation into master 2026-07-23 00:37:55 -05:00
Owner

Closes #840

Summary

Makes controller-owned queue allocation authoritative across roles so gitea_allocate_next_work under gitea-controller returns one eligible author/reviewer/merger/reconciler selection instead of binding only to role=controller and returning selected=null.

Changes

  • Controller cross-role allocation mode: inspect complete candidate inventory, apply canonical eligibility/ordering, return exactly one selection with action, required role/profile/namespace, pins, and lease/preview evidence.
  • Register generic task type process_work_queue (and hyphen alias) for controller routing.
  • Normalize controller role metadata to controller across whoami, control-plane guide, router, and allocator (stop silent reclassification as reconciler).
  • Preserve role isolation: controller routes only; does not gain author/reviewer/merger/reconciler mutation rights.
  • Dashboard remains read-only / non-authoritative for assignment.

Validation

  • 64 focused tests passed; 78 adjacent regression tests passed (author cycle evidence).

Canonical PR State

STATE: awaiting-review
WHO_IS_NEXT: reviewer
BLOCKED_ROLE: none
NEXT_ACTION: Review PR against issue #840 acceptance criteria; submit verdict; stop
NEXT_PROMPT: Review this PR as prgs-reviewer against #840 ACs (cross-role allocate, process_work_queue route, controller role metadata consistency, role isolation); stop after review
Closes #840 ## Summary Makes controller-owned queue allocation authoritative across roles so `gitea_allocate_next_work` under gitea-controller returns one eligible author/reviewer/merger/reconciler selection instead of binding only to `role=controller` and returning `selected=null`. ## Changes - Controller cross-role allocation mode: inspect complete candidate inventory, apply canonical eligibility/ordering, return exactly one selection with action, required role/profile/namespace, pins, and lease/preview evidence. - Register generic task type `process_work_queue` (and hyphen alias) for controller routing. - Normalize controller role metadata to `controller` across whoami, control-plane guide, router, and allocator (stop silent reclassification as reconciler). - Preserve role isolation: controller routes only; does not gain author/reviewer/merger/reconciler mutation rights. - Dashboard remains read-only / non-authoritative for assignment. ## Validation - 64 focused tests passed; 78 adjacent regression tests passed (author cycle evidence). ## Canonical PR State ```text STATE: awaiting-review WHO_IS_NEXT: reviewer BLOCKED_ROLE: none NEXT_ACTION: Review PR against issue #840 acceptance criteria; submit verdict; stop NEXT_PROMPT: Review this PR as prgs-reviewer against #840 ACs (cross-role allocate, process_work_queue route, controller role metadata consistency, role isolation); stop after review ```
jcwalker3 added 2 commits 2026-07-22 23:21:17 -05:00
Add controller-owned cross_role allocation mode that inspects the full
queue and returns one selection with required role/profile/action and
lease evidence. Document process_work_queue routing, normalize
controller role metadata, and keep the dashboard explanatory only.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Author
Owner

CTH: Author Handoff

Canonical Issue State

STATE: awaiting-review
WHO_IS_NEXT: reviewer
NEXT_ACTION: Review PR #841 against issue #840 acceptance criteria at head 9468dd624d2f193ee30d931e4760707976bf84d3; submit verdict; stop
NEXT_PROMPT:

Resume as prgs-reviewer on PR #841 for issue #840 at head 9468dd624d2f193ee30d931e4760707976bf84d3; validate ACs (cross-role allocate, process_work_queue route, controller role metadata, role isolation); submit review verdict; do not merge; stop

WHAT_HAPPENED: Published unpublished branch fix/issue-840-cross-role-queue-allocation at 9468dd624d2f193ee30d931e4760707976bf84d3; created PR #841 into master with Closes #840; issue #840 labels set to status:pr-open; recovered dead-session issue lock as jcwalker3/prgs-author
WHY: Author stage complete; implementation already committed; remaining work is publish + PR + handoff to reviewer
RELATED_PRS: #841
BLOCKERS: none
VALIDATION: 64 focused tests passed; 78 adjacent regression tests passed (author cycle evidence)
LAST_UPDATED_BY: jcwalker3 (prgs-author)

Canonical Handoff

REPOSITORY: Scaled-Tech-Consulting/Gitea-Tools
ISSUE: #840
PR: #841
WORKFLOW_STATE: needs-review
HEAD_SHA: 9468dd624d
BASE_BRANCH: master
BASE_OR_MERGE_SHA: caaae9b6ee
ACTING_ROLE: author
ACTING_IDENTITY: jcwalker3 (prgs-author)
COMPLETED_ACTIONS: published unpublished branch fix/issue-840-cross-role-queue-allocation at 9468dd624d2f193ee30d931e4760707976bf84d3; created PR #841 into master with Closes #840; issue labels status:pr-open
VALIDATION_EVIDENCE: 64 focused tests passed; 78 adjacent regression tests passed (author cycle evidence)
MUTATION_LEDGER: gitea_publish_unpublished_issue_branch performed; gitea_lock_issue dead-session recovery; gitea_create_pr #841
BLOCKERS: none
NEXT_ACTOR: reviewer
NEXT_ACTION: Review PR #841 against issue #840 acceptance criteria at head 9468dd624d2f193ee30d931e4760707976bf84d3; submit verdict; stop
PROHIBITED_ACTIONS: merge, approve-as-author, rewrite published head without expected_head pin
NEXT_PROMPT: Resume as prgs-reviewer on PR #841 for issue #840 at head 9468dd624d2f193ee30d931e4760707976bf84d3; validate ACs (cross-role allocate, process_work_queue route, controller role metadata, role isolation); submit review verdict; do not merge; stop
WORKFLOW_FAILURE_ISSUES: none
LAST_UPDATED: 2026-07-23T04:21:29Z

## CTH: Author Handoff ## Canonical Issue State STATE: awaiting-review WHO_IS_NEXT: reviewer NEXT_ACTION: Review PR #841 against issue #840 acceptance criteria at head 9468dd624d2f193ee30d931e4760707976bf84d3; submit verdict; stop NEXT_PROMPT: ```text Resume as prgs-reviewer on PR #841 for issue #840 at head 9468dd624d2f193ee30d931e4760707976bf84d3; validate ACs (cross-role allocate, process_work_queue route, controller role metadata, role isolation); submit review verdict; do not merge; stop ``` WHAT_HAPPENED: Published unpublished branch fix/issue-840-cross-role-queue-allocation at 9468dd624d2f193ee30d931e4760707976bf84d3; created PR #841 into master with Closes #840; issue #840 labels set to status:pr-open; recovered dead-session issue lock as jcwalker3/prgs-author WHY: Author stage complete; implementation already committed; remaining work is publish + PR + handoff to reviewer RELATED_PRS: #841 BLOCKERS: none VALIDATION: 64 focused tests passed; 78 adjacent regression tests passed (author cycle evidence) LAST_UPDATED_BY: jcwalker3 (prgs-author) <!-- sph:v1 --> ## Canonical Handoff REPOSITORY: Scaled-Tech-Consulting/Gitea-Tools ISSUE: #840 PR: #841 WORKFLOW_STATE: needs-review HEAD_SHA: 9468dd624d2f193ee30d931e4760707976bf84d3 BASE_BRANCH: master BASE_OR_MERGE_SHA: caaae9b6eef496c8f8ed451ac216250c62d495c6 ACTING_ROLE: author ACTING_IDENTITY: jcwalker3 (prgs-author) COMPLETED_ACTIONS: published unpublished branch fix/issue-840-cross-role-queue-allocation at 9468dd624d2f193ee30d931e4760707976bf84d3; created PR #841 into master with Closes #840; issue labels status:pr-open VALIDATION_EVIDENCE: 64 focused tests passed; 78 adjacent regression tests passed (author cycle evidence) MUTATION_LEDGER: gitea_publish_unpublished_issue_branch performed; gitea_lock_issue dead-session recovery; gitea_create_pr #841 BLOCKERS: none NEXT_ACTOR: reviewer NEXT_ACTION: Review PR #841 against issue #840 acceptance criteria at head 9468dd624d2f193ee30d931e4760707976bf84d3; submit verdict; stop PROHIBITED_ACTIONS: merge, approve-as-author, rewrite published head without expected_head pin NEXT_PROMPT: Resume as prgs-reviewer on PR #841 for issue #840 at head 9468dd624d2f193ee30d931e4760707976bf84d3; validate ACs (cross-role allocate, process_work_queue route, controller role metadata, role isolation); submit review verdict; do not merge; stop WORKFLOW_FAILURE_ISSUES: none LAST_UPDATED: 2026-07-23T04:21:29Z
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #841
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 99151-fbe053dbf1f0
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation
phase: claimed
candidate_head: none
target_branch: master
target_branch_sha: none
last_activity: 2026-07-23T04:34:31Z
expires_at: 2026-07-23T04:44:31Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #841 issue: none reviewer_identity: sysadmin profile: prgs-reviewer session_id: 99151-fbe053dbf1f0 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation phase: claimed candidate_head: none target_branch: master target_branch_sha: none last_activity: 2026-07-23T04:34:31Z expires_at: 2026-07-23T04:44:31Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #841
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 99151-fbe053dbf1f0
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation
phase: released
candidate_head: none
target_branch: master
target_branch_sha: none
last_activity: 2026-07-23T04:39:33Z
expires_at: 2026-07-23T04:49:33Z
blocker: manual-release

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #841 issue: none reviewer_identity: sysadmin profile: prgs-reviewer session_id: 99151-fbe053dbf1f0 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation phase: released candidate_head: none target_branch: master target_branch_sha: none last_activity: 2026-07-23T04:39:33Z expires_at: 2026-07-23T04:49:33Z blocker: manual-release
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #841
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 33606-97164d686627
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation
phase: claimed
candidate_head: none
target_branch: master
target_branch_sha: none
last_activity: 2026-07-23T04:50:10Z
expires_at: 2026-07-23T05:00:10Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #841 issue: none reviewer_identity: sysadmin profile: prgs-reviewer session_id: 33606-97164d686627 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation phase: claimed candidate_head: none target_branch: master target_branch_sha: none last_activity: 2026-07-23T04:50:10Z expires_at: 2026-07-23T05:00:10Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #841
issue: #840
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 73969-4828a781c03b
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation
phase: claimed
candidate_head: 9468dd624d
target_branch: master
target_branch_sha: none
last_activity: 2026-07-23T05:18:00Z
expires_at: 2026-07-23T05:28:00Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #841 issue: #840 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 73969-4828a781c03b worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation phase: claimed candidate_head: 9468dd624d2f193ee30d931e4760707976bf84d3 target_branch: master target_branch_sha: none last_activity: 2026-07-23T05:18:00Z expires_at: 2026-07-23T05:28:00Z blocker: none
sysadmin approved these changes 2026-07-23 00:22:29 -05:00
sysadmin left a comment
Owner

Approved PR #841. Code implementation correctly makes controller queue allocation authoritative across all worker roles (Issue #840), registers process_work_queue, normalizes controller metadata, and all unit test suites (238 tests) pass.

Canonical PR State

STATE: ready-to-merge
WHO_IS_NEXT: merger
NEXT_ACTION: Merge PR #841 into master branch
NEXT_PROMPT:

Merge PR #841 for issue #840

WHAT_HAPPENED: Terminal review approved for PR #841 at head 9468dd624d by sysadmin.
WHY: Implementation satisfies all acceptance criteria of Issue #840 and passed 238 unit tests.
ISSUE: #840
HEAD_SHA: 9468dd624d
REVIEW_STATUS: approved / approval_at_current_head
MERGE_READY: true
BLOCKERS: none
VALIDATION: 238 unit tests passed across cross_role_queue_allocation, allocator, inventory, lease, capability, and dashboard suites
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=mcp_server; token_fingerprint=4e784cbaffe67e4e
LAST_UPDATED_BY: sysadmin

Approved PR #841. Code implementation correctly makes controller queue allocation authoritative across all worker roles (Issue #840), registers process_work_queue, normalizes controller metadata, and all unit test suites (238 tests) pass. ## Canonical PR State STATE: ready-to-merge WHO_IS_NEXT: merger NEXT_ACTION: Merge PR #841 into master branch NEXT_PROMPT: ```text Merge PR #841 for issue #840 ``` WHAT_HAPPENED: Terminal review approved for PR #841 at head 9468dd624d2f193ee30d931e4760707976bf84d3 by sysadmin. WHY: Implementation satisfies all acceptance criteria of Issue #840 and passed 238 unit tests. ISSUE: #840 HEAD_SHA: 9468dd624d2f193ee30d931e4760707976bf84d3 REVIEW_STATUS: approved / approval_at_current_head MERGE_READY: true BLOCKERS: none VALIDATION: 238 unit tests passed across cross_role_queue_allocation, allocator, inventory, lease, capability, and dashboard suites NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=mcp_server; token_fingerprint=4e784cbaffe67e4e LAST_UPDATED_BY: sysadmin
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #841
issue: #840
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 73969-4828a781c03b
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation
phase: released
candidate_head: 9468dd624d
target_branch: master
target_branch_sha: none
last_activity: 2026-07-23T05:23:07Z
expires_at: 2026-07-23T05:33:07Z
blocker: manual-release

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #841 issue: #840 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 73969-4828a781c03b worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/fix-issue-840-cross-role-queue-allocation phase: released candidate_head: 9468dd624d2f193ee30d931e4760707976bf84d3 target_branch: master target_branch_sha: none last_activity: 2026-07-23T05:23:07Z expires_at: 2026-07-23T05:33:07Z blocker: manual-release
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #841
issue: #840
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 13395-68b9ad4520a3
worktree: /Users/jasonwalker/Development/Gitea-Tools
phase: claimed
candidate_head: 9468dd624d
target_branch: master
target_branch_sha: caaae9b6ee
last_activity: 2026-07-23T05:37:08Z
expires_at: 2026-07-23T05:47:08Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #841 issue: #840 reviewer_identity: sysadmin profile: prgs-merger session_id: 13395-68b9ad4520a3 worktree: /Users/jasonwalker/Development/Gitea-Tools phase: claimed candidate_head: 9468dd624d2f193ee30d931e4760707976bf84d3 target_branch: master target_branch_sha: caaae9b6eef496c8f8ed451ac216250c62d495c6 last_activity: 2026-07-23T05:37:08Z expires_at: 2026-07-23T05:47:08Z blocker: none
sysadmin merged commit 4f3a464a90 into master 2026-07-23 00:37:55 -05:00
Owner

Stale #332 review-decision lock cleanup (#594)

Status: APPLIED

Manual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.

## Stale #332 review-decision lock cleanup (#594) Status: **APPLIED** - actor: `sysadmin` - profile: `prgs-merger` - timestamp: `2026-07-23T05:37:57.458038+00:00` - last terminal: `approve` on PR #841 - PR state: `closed` (merged=True) - merge_commit_sha: `4f3a464a90e14a6595cfb7339dd3d8d6ed957c93` - prior live_mutations_count: `3` - prior profile_identity: `prgs-reviewer` Manual deletion of session-state files is **not** the workflow. This path only clears a lock when the referenced PR is merged/closed.
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #841
issue: #840
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 13395-68b9ad4520a3
worktree: /Users/jasonwalker/Development/Gitea-Tools
phase: released
candidate_head: 9468dd624d
target_branch: master
target_branch_sha: caaae9b6ee
last_activity: 2026-07-23T05:43:28Z
expires_at: 2026-07-23T05:53:28Z
blocker: post-merge-moot

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #841 issue: #840 reviewer_identity: sysadmin profile: prgs-merger session_id: 13395-68b9ad4520a3 worktree: /Users/jasonwalker/Development/Gitea-Tools phase: released candidate_head: 9468dd624d2f193ee30d931e4760707976bf84d3 target_branch: master target_branch_sha: caaae9b6eef496c8f8ed451ac216250c62d495c6 last_activity: 2026-07-23T05:43:28Z expires_at: 2026-07-23T05:53:28Z blocker: post-merge-moot
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#841