Implement MCP restart classes and blast-radius permissions #663

Closed
opened 2026-07-10 15:32:18 -05:00 by jcwalker3 · 1 comment
Owner

Problem statement

All disruptions are treated like full server restart. Scoped recovery (client reconnect, worker restart, config reload, etc.) lacks formal classes with permissions and blast radius.

Operational impact

Over-broad restarts interrupt unrelated work; under-specified reconnect leaves stale capability state.

Scope

Define and implement controlled operations for:

  • Client reconnect · session reconnect · worker restart · role-runtime restart · connector restart · configuration reload · rolling MCP restart · full MCP restart · host restart

Each class: required permission, expected blast radius, drain requirements, approval requirements, audit requirements, recovery behavior. Prefer narrower class when sufficient (#655 last-resort ladder).

Non-goals

  • Full multi-instance rolling HA (design child).
  • Host reboot automation.

Required implementation investigation

#655 #656 #658 #657; namespace model; dual-namespace deployment docs.

Proposed implementation direction

Enum RestartClass + policy table; coordinator routes by class; tests matrix.

Security / workflow-safety

Least privilege; full restart highest bar; client reconnect lowest.

Failure behavior

Unknown class → deny.

Acceptance criteria

  1. All classes documented with fields above.
  2. Coordinator enforces class permissions.
  3. Narrower class does not require full drain when policy says so (documented).
  4. Tests for permission matrix.
  5. Links #652 #653 #655.

Required tests

Permission matrix unit tests.

Observability and audit

Class field on all restart audits.

Dependencies

Rollout

Ship classes incrementally starting with client reconnect + full restart.

Canonical issue state

STATE: ready-for-author
WHO_IS_NEXT: author
NEXT_ACTION: Implement restart class matrix in coordinator
NEXT_PROMPT: Author restart classes under #655; PR; stop

Required proof

Policy table + enforcement + tests.

Required final response and handoff

Brief PR → reviewer.

## Problem statement All disruptions are treated like full server restart. Scoped recovery (client reconnect, worker restart, config reload, etc.) lacks formal classes with permissions and blast radius. ## Operational impact Over-broad restarts interrupt unrelated work; under-specified reconnect leaves stale capability state. ## Scope Define and implement controlled operations for: * Client reconnect · session reconnect · worker restart · role-runtime restart · connector restart · configuration reload · rolling MCP restart · full MCP restart · host restart Each class: required permission, expected blast radius, drain requirements, approval requirements, audit requirements, recovery behavior. Prefer narrower class when sufficient (#655 last-resort ladder). ## Non-goals * Full multi-instance rolling HA (design child). * Host reboot automation. ## Required implementation investigation #655 #656 #658 #657; namespace model; dual-namespace deployment docs. ## Proposed implementation direction Enum `RestartClass` + policy table; coordinator routes by class; tests matrix. ## Security / workflow-safety Least privilege; full restart highest bar; client reconnect lowest. ## Failure behavior Unknown class → deny. ## Acceptance criteria 1. All classes documented with fields above. 2. Coordinator enforces class permissions. 3. Narrower class does not require full drain when policy says so (documented). 4. Tests for permission matrix. 5. Links #652 #653 #655. ## Required tests Permission matrix unit tests. ## Observability and audit Class field on all restart audits. ## Dependencies * Parent **#655** · Depends **#656** **#658** · Vision **#652** · Roadmap **#653** ## Rollout Ship classes incrementally starting with client reconnect + full restart. ## Canonical issue state ```text STATE: ready-for-author WHO_IS_NEXT: author NEXT_ACTION: Implement restart class matrix in coordinator NEXT_PROMPT: Author restart classes under #655; PR; stop ``` ## Required proof Policy table + enforcement + tests. ## Required final response and handoff Brief PR → reviewer.
jcwalker3 added the type:featurestatus:readyworkflow-hardeningsafetymcp-health labels 2026-07-10 15:32:18 -05:00
jcwalker3 added status:pr-open and removed status:ready labels 2026-07-24 17:21:11 -05:00
Owner

Canonical Issue State

STATE: approved
WHO_IS_NEXT: merger
NEXT_ACTION: Acquire a merger PR lease and land PR #886 on master at exact head 220361ad94.
NEXT_PROMPT:

Act as prgs-merger on Scaled-Tech-Consulting/Gitea-Tools, remote prgs. PR #886 (issue #663, MCP restart class permissions) carries a fresh approve verdict at exact head 220361ad940cbad7617386a8b6c50c740cddd0bc, base master @ 2f4dec832327513118f2fe92b74da25d124a01cb. Confirm approval_at_current_head is true and recommended_next_action is merge_now via gitea_assess_pr_sync_status, load the review workflow, resolve the merge capability, acquire or adopt the merger PR lease, then merge with expected_head_sha pinned. A moved head voids the approval and requires a fresh review. The merge auto-closes issue #663, strips status:pr-open, and clears the reviewer decision lock; expect the merge itself to re-stale the daemon, so let a failing post-merge lease release lapse by TTL rather than switching profiles.

WHAT_HAPPENED: A completely fresh independent reviewer review of PR #886 at head 220361ad was performed and an approve verdict was posted to Gitea at that exact head. Review 578 at 714190e was treated as void and comment 16559 was not treated as a formal verdict. Both blockers raised in 16559 were verified fixed by a reviewer-authored probe of the real MCP tool and by mutation testing, and both full-suite runs were measured by the reviewer in branches/ worktrees rather than accepting the author's figures.
WHY: B1 is fixed — apply_authorized is now the conjunction of the #661 drain gate and the #663 restart-class matrix, so an authorized break-glass can no longer authorize an apply for a class the matrix denies. B2 is fixed — docs/mcp-restart-coordinator.md now documents drain_proof_json and request_break_glass and states the gate executes inside the tool. No regression and no new failure signature.
RELATED_PRS: #886 (open, head 220361ad94, base master @ 2f4dec8323, approve verdict posted by the reviewer); #882 (#661 drain proof, landed on master)
BLOCKERS: none
VALIDATION: WEBUI_TEST_OFFLINE=1 ../../venv/bin/python -m pytest tests/ -q from branches/review-886-baseline @2f4dec83 gave 23 failed / 5190 passed / 6 skipped / 867 subtests; the same command from branches/review-886-head @220361ad gave 23 failed / 5230 passed / 6 skipped / 912 subtests; sorted FAILED lines diff empty, 23 identical signatures, +40 passing. Mutation tests: reverting the B1 conjunction to gate.allow fails 21 tests; restoring the pre-fix coordinator document fails 8 governance tests. A reviewer-authored independent probe of the real MCP tool passed 4 tests and 12 subtests, covering four worker roles against three restricted classes with break-glass authorized.
LAST_UPDATED_BY: sysadmin (prgs-reviewer)

NATIVE_REVIEW_PROOF: gitea_submit_pr_review via native MCP namespace gitea-reviewer, profile prgs-reviewer, identity sysadmin, expected_head_sha 220361ad94, submitted_verdict APPROVED, review_verdict_visible true. No offline, import, or helper path was used.

[THREAD STATE LEDGER] PR #886 — approved review posted to Gitea

What is true now:

  • PR state: open
  • Server-side decision state: approved review posted to Gitea at head 220361ad94
  • Local verdict/state: approve verdict prepared locally
  • Latest known validation: head 23 failed / 5230 passed / 6 skipped / 912 subtests against baseline 23 failed / 5190 passed / 6 skipped / 867 subtests, identical 23 failure signatures

What changed:

  • approved review posted to Gitea

What is blocked:

  • Blocker classification: no blocker

Who/what acts next:

  • Next actor: merger
  • Required action: acquire the merger PR lease and land PR #886 with the head SHA pinned
  • Do not do: do not land a moved head
  • Resume from: the review on PR #886

Server-side mutation ledger:

  • gitea_acquire_reviewer_pr_lease → reviewer lease claimed, comment 16590
  • gitea_mark_final_review_decision → approve marked at head 220361ad
  • gitea_submit_pr_review → approved review posted to Gitea
  • gitea_create_issue_comment → this canonical issue-state comment

The full findings, the independent probe results, the mutation-test tables, and
two non-blocking observations are recorded in the review on PR #886.

## Canonical Issue State STATE: approved WHO_IS_NEXT: merger NEXT_ACTION: Acquire a merger PR lease and land PR #886 on master at exact head 220361ad940cbad7617386a8b6c50c740cddd0bc. NEXT_PROMPT: ```text Act as prgs-merger on Scaled-Tech-Consulting/Gitea-Tools, remote prgs. PR #886 (issue #663, MCP restart class permissions) carries a fresh approve verdict at exact head 220361ad940cbad7617386a8b6c50c740cddd0bc, base master @ 2f4dec832327513118f2fe92b74da25d124a01cb. Confirm approval_at_current_head is true and recommended_next_action is merge_now via gitea_assess_pr_sync_status, load the review workflow, resolve the merge capability, acquire or adopt the merger PR lease, then merge with expected_head_sha pinned. A moved head voids the approval and requires a fresh review. The merge auto-closes issue #663, strips status:pr-open, and clears the reviewer decision lock; expect the merge itself to re-stale the daemon, so let a failing post-merge lease release lapse by TTL rather than switching profiles. ``` WHAT_HAPPENED: A completely fresh independent reviewer review of PR #886 at head 220361ad was performed and an approve verdict was posted to Gitea at that exact head. Review 578 at 714190e was treated as void and comment 16559 was not treated as a formal verdict. Both blockers raised in 16559 were verified fixed by a reviewer-authored probe of the real MCP tool and by mutation testing, and both full-suite runs were measured by the reviewer in branches/ worktrees rather than accepting the author's figures. WHY: B1 is fixed — apply_authorized is now the conjunction of the #661 drain gate and the #663 restart-class matrix, so an authorized break-glass can no longer authorize an apply for a class the matrix denies. B2 is fixed — docs/mcp-restart-coordinator.md now documents drain_proof_json and request_break_glass and states the gate executes inside the tool. No regression and no new failure signature. RELATED_PRS: #886 (open, head 220361ad940cbad7617386a8b6c50c740cddd0bc, base master @ 2f4dec832327513118f2fe92b74da25d124a01cb, approve verdict posted by the reviewer); #882 (#661 drain proof, landed on master) BLOCKERS: none VALIDATION: WEBUI_TEST_OFFLINE=1 ../../venv/bin/python -m pytest tests/ -q from branches/review-886-baseline @2f4dec83 gave 23 failed / 5190 passed / 6 skipped / 867 subtests; the same command from branches/review-886-head @220361ad gave 23 failed / 5230 passed / 6 skipped / 912 subtests; sorted FAILED lines diff empty, 23 identical signatures, +40 passing. Mutation tests: reverting the B1 conjunction to gate.allow fails 21 tests; restoring the pre-fix coordinator document fails 8 governance tests. A reviewer-authored independent probe of the real MCP tool passed 4 tests and 12 subtests, covering four worker roles against three restricted classes with break-glass authorized. LAST_UPDATED_BY: sysadmin (prgs-reviewer) NATIVE_REVIEW_PROOF: gitea_submit_pr_review via native MCP namespace gitea-reviewer, profile prgs-reviewer, identity sysadmin, expected_head_sha 220361ad940cbad7617386a8b6c50c740cddd0bc, submitted_verdict APPROVED, review_verdict_visible true. No offline, import, or helper path was used. [THREAD STATE LEDGER] PR #886 — approved review posted to Gitea What is true now: - PR state: open - Server-side decision state: approved review posted to Gitea at head 220361ad940cbad7617386a8b6c50c740cddd0bc - Local verdict/state: approve verdict prepared locally - Latest known validation: head 23 failed / 5230 passed / 6 skipped / 912 subtests against baseline 23 failed / 5190 passed / 6 skipped / 867 subtests, identical 23 failure signatures What changed: - approved review posted to Gitea What is blocked: - Blocker classification: no blocker Who/what acts next: - Next actor: merger - Required action: acquire the merger PR lease and land PR #886 with the head SHA pinned - Do not do: do not land a moved head - Resume from: the review on PR #886 Server-side mutation ledger: - gitea_acquire_reviewer_pr_lease → reviewer lease claimed, comment 16590 - gitea_mark_final_review_decision → approve marked at head 220361ad - gitea_submit_pr_review → approved review posted to Gitea - gitea_create_issue_comment → this canonical issue-state comment The full findings, the independent probe results, the mutation-test tables, and two non-blocking observations are recorded in the review on PR #886.
sysadmin removed the status:pr-open label 2026-07-25 02:34:26 -05:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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