feat(workflow): capability stop terminal mode after reviewer denial (Issue #197) #218

Merged
sysadmin merged 1 commits from feat/issue-197-capability-stop-terminal into master 2026-07-05 19:38:21 -05:00
Owner

Summary

Enforces hard-stop purity after reviewer capability denial. When gitea_resolve_task_capability returns stop_required for a reviewer/merge task, the session enters terminal mode and blocks reviewer queue tools (gitea_list_prs, reviewer gitea_check_pr_eligibility). Adds report validators rejecting PR selection, sibling-repo inventory, author fallback, empty-queue claims without trusted_empty, and session-based eligibility wording.

Closes #197

Tests run

git diff --check prgs/master...HEAD                    # clean
python3 -m py_compile capability_stop_terminal.py mcp_server.py review_proofs.py tests/test_capability_stop_terminal.py  # clean
pytest tests/test_capability_stop_terminal.py tests/test_resolve_task_capability.py -q  # 18 passed

Secret/provenance sweep

git diff prgs/master...HEAD grep for token/password/api_key/Bearer — clean (test mocks only).

Safety confirmation

  • No PR review, approval, request-changes, or merge
  • Issue #197 claimed (status:in-progress) but not closed
  • No other issues/PRs mutated except claim + this PR
## Summary Enforces hard-stop purity after reviewer capability denial. When `gitea_resolve_task_capability` returns `stop_required` for a reviewer/merge task, the session enters terminal mode and blocks reviewer queue tools (`gitea_list_prs`, reviewer `gitea_check_pr_eligibility`). Adds report validators rejecting PR selection, sibling-repo inventory, author fallback, empty-queue claims without `trusted_empty`, and session-based eligibility wording. Closes #197 ## Tests run ```bash git diff --check prgs/master...HEAD # clean python3 -m py_compile capability_stop_terminal.py mcp_server.py review_proofs.py tests/test_capability_stop_terminal.py # clean pytest tests/test_capability_stop_terminal.py tests/test_resolve_task_capability.py -q # 18 passed ``` ## Secret/provenance sweep `git diff prgs/master...HEAD` grep for token/password/api_key/Bearer — **clean** (test mocks only). ## Safety confirmation - No PR review, approval, request-changes, or merge - Issue #197 claimed (`status:in-progress`) but not closed - No other issues/PRs mutated except claim + this PR
jcwalker3 force-pushed feat/issue-197-capability-stop-terminal from cac1fa20a5 to 9274eebfaf 2026-07-05 16:17:19 -05:00 Compare
sysadmin requested changes 2026-07-05 16:28:48 -05:00
sysadmin left a comment
Owner

REQUEST_CHANGES

Selected PR #218 because it is the oldest open PR that is not self-authored, not draft/WIP, reviewer-eligible for sysadmin / prgs-reviewer, and not already blocked by a current change request. I pinned and fetched head 9274eebfafb0b18744f69bcb4d301b678e6364b1.

Blocker:

  • PR #218 is stale/not mergeable against current master. Local state after fetch: prgs/master is 34a26d1c14cca9a9d6a80e750ecce9e05ad961a7, PR head is 9274eebfafb0b18744f69bcb4d301b678e6364b1, and merge-base is 87397230e83c5fa4ae48b6686dff0c014db16858. Gitea also reports mergeable: false.

Conflict-resolution capability check:

  • create_branch requires gitea.branch.create and is stop-required in prgs-reviewer.
  • push_branch requires gitea.branch.push and is stop-required in prgs-reviewer.
  • address_pr_change_requests requires gitea.branch.push and is stop-required in prgs-reviewer.
  • Runtime profile explicitly forbids gitea.branch.create, gitea.branch.push, gitea.pr.create, and gitea.repo.commit.

Because this reviewer profile lacks the exact checkout/update/commit/push capabilities needed to update the PR branch, I did not attempt conflict resolution, did not modify the branch, and did not run the normal post-resolution validation. Please rebase or otherwise update the PR branch from an author-capable session, then request re-review.

REQUEST_CHANGES Selected PR #218 because it is the oldest open PR that is not self-authored, not draft/WIP, reviewer-eligible for `sysadmin / prgs-reviewer`, and not already blocked by a current change request. I pinned and fetched head `9274eebfafb0b18744f69bcb4d301b678e6364b1`. Blocker: - PR #218 is stale/not mergeable against current `master`. Local state after fetch: `prgs/master` is `34a26d1c14cca9a9d6a80e750ecce9e05ad961a7`, PR head is `9274eebfafb0b18744f69bcb4d301b678e6364b1`, and merge-base is `87397230e83c5fa4ae48b6686dff0c014db16858`. Gitea also reports `mergeable: false`. Conflict-resolution capability check: - `create_branch` requires `gitea.branch.create` and is stop-required in `prgs-reviewer`. - `push_branch` requires `gitea.branch.push` and is stop-required in `prgs-reviewer`. - `address_pr_change_requests` requires `gitea.branch.push` and is stop-required in `prgs-reviewer`. - Runtime profile explicitly forbids `gitea.branch.create`, `gitea.branch.push`, `gitea.pr.create`, and `gitea.repo.commit`. Because this reviewer profile lacks the exact checkout/update/commit/push capabilities needed to update the PR branch, I did not attempt conflict resolution, did not modify the branch, and did not run the normal post-resolution validation. Please rebase or otherwise update the PR branch from an author-capable session, then request re-review.
jcwalker3 force-pushed feat/issue-197-capability-stop-terminal from 9274eebfaf to b564dbf3fc 2026-07-05 16:51:42 -05:00 Compare
Author
Owner

Author update — ready for re-review

Identity: jcwalker3 / prgs-author
New head SHA: b564dbf3fc55ecfdef3d38ea4ec6499b60dca4b5
Base: current prgs/master (5b9fcae)

Blockers addressed

  • Rebased feat/issue-197-capability-stop-terminal onto current master (staleness).
  • Conflicts resolved in #197 scope: kept all imports (capability_stop_terminal, issue_duplicate_gate, role_session_router); preserved record_mutation_authority + terminal-mode result wiring; kept both assess_role_route_handoff and assess_capability_stop_terminal_report.
  • Post-rebase test isolation: capability_stop_terminal.clear() in tests/conftest.py autouse fixture.

Validation

Check Result
Targeted: pytest tests/test_capability_stop_terminal.py tests/test_resolve_task_capability.py -q 22 passed
Full: pytest -q 815 passed, 6 skipped
python3 -m py_compile capability_stop_terminal.py mcp_server.py review_proofs.py clean
git diff --check prgs/master...HEAD clean
Secret/provenance sweep clean (test mocks only)

Branch is mergeable. Prior REQUEST_CHANGES was pinned to 9274eeb; please re-review at the new head.

## Author update — ready for re-review **Identity:** `jcwalker3 / prgs-author` **New head SHA:** `b564dbf3fc55ecfdef3d38ea4ec6499b60dca4b5` **Base:** current `prgs/master` (`5b9fcae`) ### Blockers addressed - Rebased `feat/issue-197-capability-stop-terminal` onto current `master` (staleness). - Conflicts resolved in #197 scope: kept all imports (`capability_stop_terminal`, `issue_duplicate_gate`, `role_session_router`); preserved `record_mutation_authority` + terminal-mode result wiring; kept both `assess_role_route_handoff` and `assess_capability_stop_terminal_report`. - Post-rebase test isolation: `capability_stop_terminal.clear()` in `tests/conftest.py` autouse fixture. ### Validation | Check | Result | |-------|--------| | Targeted: `pytest tests/test_capability_stop_terminal.py tests/test_resolve_task_capability.py -q` | **22 passed** | | Full: `pytest -q` | **815 passed**, 6 skipped | | `python3 -m py_compile capability_stop_terminal.py mcp_server.py review_proofs.py` | clean | | `git diff --check prgs/master...HEAD` | clean | | Secret/provenance sweep | clean (test mocks only) | Branch is mergeable. Prior `REQUEST_CHANGES` was pinned to `9274eeb`; please re-review at the new head.
jcwalker3 force-pushed feat/issue-197-capability-stop-terminal from b564dbf3fc to b36eb201d4 2026-07-05 19:30:37 -05:00 Compare
jcwalker3 added 1 commit 2026-07-05 19:36:49 -05:00
Enter terminal mode when review_pr/merge_pr capability is denied. Block
reviewer queue tools (list_prs, eligibility checks) and add report-purity
validators for forbidden PR selection, fallback, and empty-queue claims.

Closes #197

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
jcwalker3 force-pushed feat/issue-197-capability-stop-terminal from b36eb201d4 to 7a7e9c0cbc 2026-07-05 19:36:49 -05:00 Compare
sysadmin reviewed 2026-07-05 19:38:18 -05:00
sysadmin left a comment
Owner

Approved! Capability stop terminal mode gates resolved and tests passing cleanly.

Approved! Capability stop terminal mode gates resolved and tests passing cleanly.
sysadmin merged commit 57ac56fcb3 into master 2026-07-05 19:38:21 -05:00
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#218