Move terminal-lock and merge-path checks to the beginning of reviewer workflow #602

Open
opened 2026-07-09 16:06:03 -05:00 by jcwalker3 · 3 comments
Owner

Context

Part of the LLM coordination failure series (sessions stepping on each other). This is a focused implementation issue, not an umbrella.

Related siblings: #600 (allocator must route terminal-first), #601 (lease lifecycle).

Problem

Reviewers are doing expensive review work and reaching dry-run REQUEST_CHANGES only to be blocked at formal submission by #332 terminal review locks from another PR. This wastes work and creates confusion.

Required behavior

  • Reviewer workflow must check terminal review slot availability before acquiring PR review lease or running tests.
  • If #332 is occupied by an open PR, reviewer workflow must stop immediately and route to the terminal PR lifecycle.
  • The tool must distinguish:
    • terminal approval clean and merge-authorizing
    • terminal approval contaminated
    • terminal PR open and unresolved
    • terminal PR merged/closed and cleanup allowed
    • cleanup blocked
  • Downstream reviews must not proceed until the terminal path is resolved.

Acceptance criteria

  1. Reviewer cannot start validation on PR #587/#592 while open PR #593 holds #332.
  2. Output includes terminal PR number, terminal review ID, review state, cleanliness status if known, and single next action.
  3. Cleanup remains fail-closed while terminal PR is open.
  4. Tests cover contaminated approval, clean approval, open terminal PR, merged terminal PR, and cleanup.
  5. Formal review mutation still fails closed as a final safety net.

Implementation notes

  • Early gate is advisory routing for agents; formal mutation remains the hard fail-closed net.
  • Prefer a single typed terminal-path status enum shared with allocator/dashboard consumers.
## Context Part of the LLM coordination failure series (sessions stepping on each other). This is a focused implementation issue, not an umbrella. Related siblings: #600 (allocator must route terminal-first), #601 (lease lifecycle). ## Problem Reviewers are doing expensive review work and reaching dry-run REQUEST_CHANGES only to be blocked at formal submission by #332 terminal review locks from another PR. This wastes work and creates confusion. ## Required behavior * Reviewer workflow must check terminal review slot availability before acquiring PR review lease or running tests. * If #332 is occupied by an open PR, reviewer workflow must stop immediately and route to the terminal PR lifecycle. * The tool must distinguish: * terminal approval clean and merge-authorizing * terminal approval contaminated * terminal PR open and unresolved * terminal PR merged/closed and cleanup allowed * cleanup blocked * Downstream reviews must not proceed until the terminal path is resolved. ## Acceptance criteria 1. Reviewer cannot start validation on PR #587/#592 while open PR #593 holds #332. 2. Output includes terminal PR number, terminal review ID, review state, cleanliness status if known, and single next action. 3. Cleanup remains fail-closed while terminal PR is open. 4. Tests cover contaminated approval, clean approval, open terminal PR, merged terminal PR, and cleanup. 5. Formal review mutation still fails closed as a final safety net. ## Implementation notes * Early gate is advisory routing for agents; formal mutation remains the hard fail-closed net. * Prefer a single typed terminal-path status enum shared with allocator/dashboard consumers.
Author
Owner

Canonical Issue State

STATE: ready for independent implementation
WHO_IS_NEXT: author
NEXT_ACTION: claim this issue and move terminal-lock/merge-path checks to the start of reviewer workflow
NEXT_PROMPT:

Implement #602 on Scaled-Tech-Consulting/Gitea-Tools: check terminal review slot (#332) before acquiring PR review lease or running tests. Distinguish clean/contaminated/open/merged/cleanup-blocked terminal states. Keep formal review mutation fail-closed.

WHAT_HAPPENED: Filed as focused coordination issue #602. Series siblings: #600 allocator, #601 leases, #603 lifecycle labels, #604 anti-stomp preflight, #605 dashboard.
WHY: Reviewers waste expensive validation then hit terminal lock only at formal submission.
RELATED_PRS: none yet
BLOCKERS: none
VALIDATION: issue created with type:guardrail status:ready and labels workflow-hardening,terminal-lock,reviewer,anti-stomp
LAST_UPDATED_BY: jcwalker3 (prgs-author)

## Canonical Issue State STATE: ready for independent implementation WHO_IS_NEXT: author NEXT_ACTION: claim this issue and move terminal-lock/merge-path checks to the start of reviewer workflow NEXT_PROMPT: ```text Implement #602 on Scaled-Tech-Consulting/Gitea-Tools: check terminal review slot (#332) before acquiring PR review lease or running tests. Distinguish clean/contaminated/open/merged/cleanup-blocked terminal states. Keep formal review mutation fail-closed. ``` WHAT_HAPPENED: Filed as focused coordination issue #602. Series siblings: #600 allocator, #601 leases, #603 lifecycle labels, #604 anti-stomp preflight, #605 dashboard. WHY: Reviewers waste expensive validation then hit terminal lock only at formal submission. RELATED_PRS: none yet BLOCKERS: none VALIDATION: issue created with type:guardrail status:ready and labels workflow-hardening,terminal-lock,reviewer,anti-stomp LAST_UPDATED_BY: jcwalker3 (prgs-author)
jcwalker3 added status:in-progress and removed status:ready labels 2026-07-09 17:22:25 -05:00
Author
Owner

Issue claim heartbeat

<!-- gitea-issue-claim-heartbeat:v1 --> **Issue claim heartbeat** - kind: claim - issue: #602 - branch: feat/issue-602-terminal-path-preflight - phase: claimed - profile: prgs-author - pr: none - blocker: none - next_action: create worktree and begin implementation
Author
Owner

Claimed for author implementation. Branch: feat/issue-602-terminal-path-preflight. Worktree: branches/feat-issue-602-terminal-path-preflight. Lease owner: jcwalker3 / prgs-author; expires 2026-07-10T02:22:03Z. Scope: move terminal-review path checks ahead of lease acquisition and validation, with typed terminal states and regression coverage.

Claimed for author implementation. Branch: `feat/issue-602-terminal-path-preflight`. Worktree: `branches/feat-issue-602-terminal-path-preflight`. Lease owner: `jcwalker3 / prgs-author`; expires 2026-07-10T02:22:03Z. Scope: move terminal-review path checks ahead of lease acquisition and validation, with typed terminal states and regression coverage.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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