docs(governance): MCP restart governance and authorization policy (Closes #656) #857
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#857
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 #656
First child of umbrella #655. There is no durable written policy stating who may restart the MCP control plane, under what conditions, that restart is a last resort, and how controller approval, automated safety gates, and break-glass interact. Operators and LLM sessions therefore invent restart behavior ad hoc, and #630 and #642 have no policy backbone to bind to. This adds that policy as an ADR.
What this adds
docs/architecture/mcp-restart-governance.md(new, 223) — therestart-governance/v1ADR:RG-01–RG-08(§5) — stable identifiers so later enforcement code binds to identifiers rather than to prose, with the policy-version field emitted on future restart audit events.docs/safety-model.md(+14) — new § Process restart governance summarizing the rule and pointing at the ADR.docs/webui-deployment.md(+9) — new § Process restart / reload disposition recording that the console exposes no restart control and deferring to the ADR.tests/test_mcp_restart_governance_docs.py(new, 107) — nine documentation-acceptance tests, one per acceptance criterion plus policy-ID presence, ambiguity-denial wording, and a secret-marker check on all three documents.Acceptance criteria
test_ac1_adr_exists_with_matrix_and_v1_decisiontest_ac2_restart_is_last_resort_with_narrower_recoveriestest_ac3_forbids_unilateral_llm_full_restart_with_affected_sessionstest_ac4_break_glass_conditions_listedtest_ac5_adr_links_issue_lineage,test_ac5_safety_model_and_deployment_cross_link_adrNon-goals honored: no restart-coordinator code, no HA or quorum machinery, and no new process-kill or auto-restart tool. This pull request adds no executable restart path whatsoever — it is documentation plus documentation tests.
Provenance
The bulk of this work was authored in an earlier author cycle whose owning MCP session (pid 57094) exited before committing, leaving the implementation uncommitted in the issue's registered worktree. This cycle recovered the durable claim through the sanctioned dead-session path in
gitea_lock_issue(identityjcwalker3/prgs-author, recovery modeunpublished_claim, recorded pid 57094 confirmed dead, head relationdescends_from_recorded_baseagainst recorded base4f3a464a), committed that work unchanged as1301a57to preserve its provenance, merged current master, then applied one correction of its own. No file copy and no re-implementation.The correction (
9f75915) fixes linked-issue descriptions that named issues by roles they do not hold: #652 is the console product vision rather than a restart-specific vision, #653 is the console phased-delivery roadmap, #630 is the manual process-kill contamination guard rather than the coordinator (the coordinator remains an unimplemented later child of #655), #642 is the sanctioned restart and graceful-reload console UX, and #591 is auto-restart on master advance rather than transport recovery. Wording only — every normative statement, the authorization matrix, andRG-01–RG-08are untouched.Test evidence
Run from
/Users/jasonwalker/Development/Gitea-Tools/branches/docs-issue-656-mcp-restart-governancewith the repository venv interpreter.venv/bin/python -m pytest tests/test_mcp_restart_governance_docs.py -q -s— 9 passed.venv/bin/python -m pytest -q -s— 4624 passed, 12 failed, 6 skipped, 735 subtests passed in 554.68s.Baseline classification: the twelve failing node identifiers are the documented pre-existing master baseline at
188e83c4— six intests/test_commit_payloads.py, two intests/test_issue_702_review_findings_f1_f6.py, two intests/test_mcp_server.py(TestRuntimeProfile::test_whoami_v2_metadataandTestPreflightVerification::test_declared_clean_task_worktree_ignores_control_checkout_violation), one intests/test_post_merge_moot_lease.py, and one intests/test_reconciler_supersession_close.py. None of them touchdocs/.To be precise about the evidence: this cycle did not re-run an independent detached baseline worktree. It compares against the baseline recorded in PR #856's validation, which pinned a clean detached worktree to master
188e83c4— the identical commit this branch is merged onto — and reported those twelve identifiers with 4615 passed. This branch reports 4624 passed, a delta of exactly nine, which accounts for precisely the nine tests added here. A reviewer wanting an independently regenerated baseline should regenerate it rather than rely on that carry-forward.git status --porcelainreported zero entries in the worktree before publication and reports zero entries now.Risk
Very low. No executable code changes and no runtime surface. The residual risk is policy drift: the ADR states rules that enforcement code does not yet implement, so between this merge and the coordinator child of #655 the policy is binding on humans and LLM sessions by convention rather than by gate. The
RG-01–RG-08identifiers exist specifically so that later enforcement binds to fixed handles instead of re-deriving intent from prose.Known limitations
The v1 authority decision (controller approval plus automated safety gates) is recorded but not yet enforced anywhere. The drain protocol, checkpoint schema, impact preview, and post-restart reconciliation are named but specified only at policy level; each is a separate child of #655. Existing auto-restart behavior in
gitea_mcp_server.pyis called out for inventory but is deliberately not modified here.Provenance details
docs/issue-656-mcp-restart-governance/Users/jasonwalker/Development/Gitea-Tools/branches/docs-issue-656-mcp-restart-governance1301a57de4626118cc2a0d81ce6eb09da22ac3ac9f759150b8bde333e123bcd8efd302d4ebd809c1188e83c4d69bfb959c91b1f8e766ab8a0656d92dCanonical PR State
Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #857
issue: #656
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 90432-499b65b9d457
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-857-docs-issue-656-mcp-restart-governance
phase: claimed
candidate_head:
0088ecaf00target_branch: master
target_branch_sha:
89657a06c4last_activity: 2026-07-24T07:17:56Z
expires_at: 2026-07-24T07:27:56Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #857
issue: #656
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 90432-499b65b9d457
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-857-docs-issue-656-mcp-restart-governance
phase: validated
candidate_head:
0088ecaf00target_branch: master
target_branch_sha:
89657a06c4last_activity: 2026-07-24T07:18:21Z
expires_at: 2026-07-24T07:28:21Z
blocker: none
APPROVE — PR #857
Documentation-only MCP restart governance ADR for #656. Scope is clean: new ADR, two cross-link doc sections, nine documentation-acceptance tests. No executable restart path.
Reviewed at head
0088ecaf00against master89657a06c4. Author jcwalker3; reviewer sysadmin/prgs-reviewer. Focused pytest 9 passed. All five ACs satisfied; RG-01–RG-08 present; break-glass and ambiguity-deny wording present.Canonical PR State
STATE: approved-awaiting-merge
WHO_IS_NEXT: merger
NEXT_ACTION: Revalidate approval at exact head 0088ecaf00eb87f53612ef67b5b0b84bdd32d07a; call gitea_assess_pr_sync_status; if recommended_next_action=merge_now, adopt/acquire merger lease and merge via gitea_merge_pr only.
NEXT_PROMPT:
WHAT_HAPPENED: Formal APPROVE submitted by prgs-reviewer after docs-only review and validation.
WHY: Issue #656 ACs 1-5 met; documentation-only non-goals honored; no conflicts; head matches base ancestry with commits_behind=0.
ISSUE: #656
HEAD_SHA:
0088ecaf00REVIEW_STATUS: APPROVED
MERGE_READY: true
BLOCKERS: none
VALIDATION: cwd=branches/review-pr-857-docs-issue-656-mcp-restart-governance HEAD=0088ecaf00eb clean before/after; venv/bin/python -m pytest tests/test_mcp_restart_governance_docs.py -q → 9 passed in 0.99s
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=mcp_server; token_fingerprint=940cd497439b039d; pid=90432; mode=production
LAST_UPDATED_BY: sysadmin / prgs-reviewer
adopted_at: 2026-07-24T07:25:46Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 90432-499b65b9d457
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 15552
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #857
issue: #656
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 28389-43d5e39eda7e
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr-857-0088ecaf
phase: adopted
candidate_head:
0088ecaf00target_branch: master
target_branch_sha:
89657a06c4last_activity: 2026-07-24T07:25:46Z
expires_at: 2026-07-24T07:35:46Z
blocker: none
Stale #332 review-decision lock cleanup (#594)
Status: APPLIED
sysadminprgs-merger2026-07-24T07:26:04.808273+00:00approveon PR docs(governance): MCP restart governance and authorization policy (Closes #656) (#857)closed(merged=True)60df5087e94e2f0504b5f3b8a6e1b01c976380c33prgs-reviewerManual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #857
issue: #656
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 28389-43d5e39eda7e
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr-857-0088ecaf
phase: released
candidate_head:
0088ecaf00target_branch: master
target_branch_sha:
89657a06c4last_activity: 2026-07-24T07:30:45Z
expires_at: 2026-07-24T07:40:45Z
blocker: post-merge-moot