feat(mcp-health): MCP restart coordinator and impact analysis (Closes #658) #875
Merged
sysadmin
merged 4 commits from 2026-07-24 06:04:14 -05:00
feat/issue-658-mcp-restart-coordinator into master
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#875
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.
Summary
Closes #658 — child of the restart-governance program under umbrella #655, building on the #657 restart-path inventory and #656 governance policy.
Adds a central restart coordinator that evaluates live control-plane state before any sanctioned MCP restart and returns a blast-radius impact preview (
safe/unsafe/override), so operators and the web console (#642/#652) can see what a restart would disrupt before concurrent LLM work is destroyed.Changes (purely additive)
restart_coordinator.py(+451) — pure, read-only classifier:evaluate_restart_impact()takes a gathered inventory (sessions, leases/locks, in-flight issue/PR work, mutations, worktrees, prior recovery attempts) and returns a structuredRestartImpactReportDTO. Fails closed (incomplete inventory → deny). Never touches network/filesystem/process, so multi-session fixtures drive every branch.gitea_mcp_server.py(+151) — new MCP toolgitea_request_mcp_restart(dry-run only; read-gated). Gathers the inventory from the #613 control-plane DB and calls the coordinator. Override authority is read from the process environment (GITEA_OPERATOR_RESTART_OVERRIDE_AUTHORIZATION), never self-asserted by the requesting session. Exceptions are redacted; the tool never restarts anything (apply is a later drain-gated child).control_plane_db.py(+29) — read-onlylist_sessions()helper for restart/impact inventory; operational metadata only, no secrets.docs/mcp-restart-coordinator.md(+95),docs/mcp-restart-impact-sample.json(+148),docs/mcp-tool-inventory.md(+1) — human-readable design + sample impact JSON.tests/test_restart_coordinator.py(+340) — multi-session impact fixtures covering verdict/blast-radius/critical-section/fail-closed paths.Acceptance criteria
Tests
venv/bin/python -m pytest tests/test_restart_coordinator.py -q→ 15 passed. Full-suite classification against the current-master baseline is reported on the PR thread.Provenance
Recovery of an already-committed, unpublished author branch. Work was committed at
2d0d8a6by a prior author session (pid 30988, now dead); this cycle republished the branch and recovered the exact-owner durable lock under the original claimant (jcwalker3 / prgs-author) through sanctioned dead-session recovery (unpublished_claim). No re-implementation was performed.Meta
feat/issue-658-mcp-restart-coordinatorbranches/feat-issue-658-mcp-restart-coordinator2d0d8a682b2fa26660fec90c0515e46fd39922d3masterrepo: Scaled-Tech-Consulting/Gitea-Tools
pr: #875
issue: #658
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 51196-709f0c885723
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-658-mcp-restart-coordinator
phase: claimed
candidate_head:
fd558ce5d8target_branch: master
target_branch_sha:
ae1161524dlast_activity: 2026-07-24T10:59:51Z
expires_at: 2026-07-24T11:09:51Z
blocker: none
Canonical PR State
STATE: approved
WHO_IS_NEXT: merger
NEXT_ACTION: Merge PR #875 at head
fd558ce5d8onto masterae1161524d, then reconcile (delete branch + worktree, close #658).NEXT_PROMPT:
WHAT_HAPPENED: Reviewed at exact PR head
fd558ce5in worktree branches/feat-issue-658-mcp-restart-coordinator checked out at that head. Diff vs baseae1161524dis 7 files / +1215 / -0, purely additive. New tool gitea_request_mcp_restart is read-gated, dry-run only (never restarts), fails closed on incomplete inventory, redacts exceptions, reads override authority from the environment. control_plane_db.list_sessions is read-only parameterized SQL returning operational metadata only, no secrets. tests/test_restart_coordinator.py → 15 passed.WHY: All five acceptance criteria satisfied; scope limited to #658; no existing code paths altered; no secrets; focused tests green — merge-ready.
ISSUE: 658
HEAD_SHA:
fd558ce5d8REVIEW_STATUS: approved
MERGE_READY: yes
BLOCKERS: none
VALIDATION: tests/test_restart_coordinator.py → 15 passed (venv interpreter); diff vs base
ae1161524d= 7 files / +1215 / -0 additive; behind=0, mergeable, no conflicts.LAST_UPDATED_BY: prgs-reviewer (sysadmin)
NATIVE_REVIEW_PROOF: reviewed in worktree branches/feat-issue-658-mcp-restart-coordinator checked out at fd558ce5; git diff vs base
ae1161524d= 7 files / +1215 / -0 additive.adopted_at: 2026-07-24T11:03:27Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 51196-709f0c885723
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 15693
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #875
issue: #658
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 51244-a02f0d739ae9
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-658-mcp-restart-coordinator
phase: adopted
candidate_head:
fd558ce5d8target_branch: master
target_branch_sha:
ae1161524dlast_activity: 2026-07-24T11:03:27Z
expires_at: 2026-07-24T11:13:27Z
blocker: none
Stale #332 review-decision lock cleanup (#594)
Status: APPLIED
sysadminprgs-merger2026-07-24T11:04:16.457079+00:00approveon PR feat(mcp-health): MCP restart coordinator and impact analysis (Closes #658) (#875)closed(merged=True)67b4889984924e667b40c717b93577caebcf52d41prgs-reviewerManual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.