feat: enforce session hard-stop after terminal review mutation (Closes #332) #345
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#345
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.
Closes #332
Summary
Extends the single-terminal-decision machinery (#211) to session-level hard-stop semantics:
terminal_review_hard_stop_reasons(new helper beside the #211 lock): after a live terminal verdict, the only permitted continuation is the merge sequence for the same approved PR. REQUEST_CHANGES stops the run. Operator-approved corrections (#211) re-open the review path only — never a cross-PR merge. Stop guidance names the consumed terminal mutation and the continuation rule applied.gitea_merge_prGate 2b: consults the hard-stop between confirmation and eligibility — local, zero API calls — so a run can never submit a verdict on one PR and merge another.gitea_mark_final_review_decision: hard-stop check with the terminal-specific stop message; plus duplicate REQUEST_CHANGES suppression — an unresolved request-changes at the current head SHA refuses a second request-changes, and an unverifiable feedback state fails closed.Validation
pytest tests/test_terminal_review_hard_stop.py -q— 13 passed (acceptance scenarios: REQUEST_CHANGES stops everything; approve permits same-PR merge only; cross-PR merge/review/mark-ready blocked; correction re-opens review path only; duplicate RC blocked at same head, allowed when stale/no blocker, fail-closed when unverifiable; approve path never fetches feedback)pytest tests/test_mcp_server.py tests/test_terminal_review_hard_stop.py -q— 197 passedpytest tests/ --ignore=tests/integration) in the issue worktree — 1111 tests, 1 failed:TestIssueLockArtifactWarning::test_lock_success_includes_artifact_warning— pre-existing on clean master, re-proven this session in baseline worktreebranches/baseline-master-pr291at current masterfd396df(identical failure); not caused by this branchgit diff --check— clean; secret-pattern scan — no hits (one grep match is the pre-existing_SECRET_PREFIXESconstant in diff context)456e46dRisk
Low-moderate. Additive gate before the merge API and in mark-ready; fail-closed direction only (never widens permissions). Existing #211 correction flow preserved and covered by updated tests. Three existing
TestSubmitPrReviewsetups now stub the new feedback fetch — behavior change is intentional per AC6.Worktree
/Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-332-terminal-review-hard-stop(branchfeat/issue-332-terminal-review-hard-stop; main checkout stayed onmaster, not used for task work)All tests pass successfully. Reviewed the implementation in gitea_mcp_server.py and test coverage in tests/test_terminal_review_hard_stop.py. It correctly enforces session hard-stop after a terminal live review mutation, allowing only the merge sequence for the same approved PR, and suppresses duplicate REQUEST_CHANGES reviews on the same head SHA. Tested inside the review worktree, and the single failing test is pre-existing on master.