feat(mcp): post-restart reconciliation and completion proof (Closes #662) #879
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#879
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 #662
Parent umbrella #655 · Vision #652 · Roadmap #653 · Soft deps #660 #661
Summary
Post-restart MCP reconciliation so operators do not rebuild context from chat after a daemon restart.
What this adds
post_restart_reconcile.py— purereconcile_after_restart(inventory)classifier returning a machine-readable completion proof across service health, clients, sessions, checkpoints (soft #660), leases, capabilities/parity, worktrees, interrupted mutations (never auto-resumed), duplicates, and queue state.gitea_reconcile_after_restart— read-only MCP tool that gathers control-plane inventory + master parity and returns the proof; proposes durable follow-up issues but does not create them in v1.gitea_assess_master_parityafter process start runs reconcile once (log-only by default).log_only(default) vsenforce(GITEA_POST_RESTART_RECONCILE_MODE=enforceormode=enforce) setsmutation_holdwhen anything remains unresolved.docs/post-restart-reconcile.md.tests/test_issue_662_post_restart_reconcile.py(11 cases including interrupted-mutation detection).Acceptance criteria
gitea_assess_master_parity+ explicit toolRestartCompletionProof.as_dict()proposed_follow_upsin proof (create path deferred; log-only rollout)linksfield + PR bodyNon-goals honored
Validation
Provenance
fix/issue-662-post-restart-reconcilebranches/fix-issue-662-post-restart-reconcilea7a283f4490f532359edcb567299407ed7c331c2103d0df28921d95673d4f375b00f01d306c70c70asn-28d0e16447ab477c/lease-dcf03d50e1d94af7Canonical PR State
Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #879
issue: #662
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 45214-2c49ef91ca41
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr879-20260724
phase: claimed
candidate_head:
a7a283f449target_branch: master
target_branch_sha:
2976c21ee6last_activity: 2026-07-24T13:59:31Z
expires_at: 2026-07-24T14:09:31Z
blocker: none
Canonical PR State
STATE: approved
WHO_IS_NEXT: merger
NEXT_ACTION: Base-sync PR #879 (32 commits behind live master) then merge into master after approval_at_current_head
NEXT_PROMPT:
WHAT_HAPPENED: Reviewer re-verified #662 post-restart reconcile at head
a7a283f449on mutation-safe daemon @2976c21e; pytest tests/test_issue_662_post_restart_reconcile.py 11 passed; formal APPROVE review verdict posted via review APIWHY: Pure fail-closed classifier satisfies ACs 1-5; interrupted mutations always resume_allowed=false; mutation_hold only in enforce mode; additive read-only surface
ISSUE: #662
HEAD_SHA:
a7a283f449REVIEW_STATUS: approve review API verdict at pinned head
a7a283f449MERGE_READY: true
BLOCKERS: none for review; PR is 32 commits behind live base so merge path needs update_branch_by_merge first
VALIDATION: pytest tests/test_issue_662_post_restart_reconcile.py exit 0 (11 passed); Live head SHA before approval: a7a283f4490f532359edcb567299407ed7c331c2; Pushes occurred during validation: no; Workflow-load helper result: workflow_hash: 263d0a6cb8a6 boundary_status: clean
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=mcp_server; namespace=gitea-reviewer; profile=prgs-reviewer; identity=sysadmin; workflow=review-merge-pr; workflow_hash=263d0a6cb8a6; head=a7a283f4490f532359edcb567299407ed7c331c2
LAST_UPDATED_BY: sysadmin / prgs-reviewer / reviewer
[THREAD STATE LEDGER]
what is true now
Server-side decision state: open PR #879 at head
a7a283f449carries formal approve review API verdict for #662 post-restart reconcileLocal verdict/state: approve at pinned head after 11-test suite green and pure-classifier spot-check
Next actor: merger
Required action: base-sync then merge PR #879 with operator consent when approval_at_current_head holds
Blocker classification: no blocker
Do not do: do not auto-resume write mutations; do not re-review this same head for a second formal approve; do not merge without operator consent
what changed
a7a283f449what is blocked
Nothing for review. Merge eligibility still requires catching up 32 base commits via update_branch_by_merge; that may move head and require fresh approval_at_current_head before merge.
who/what acts next
Merger: assess PR sync, perform or request base-sync, then merge only with explicit operator consent.
APPROVE — #662 post-restart reconciliation.
post_restart_reconcile.py is a pure, exception-safe classifier: no network/filesystem/process mutation on the pure path; fail-closed on incomplete inventory (overall=failed, never claims complete); interrupted mutations always resume_allowed=false (AC4, no blind write resume); #660 checkpoints soft-skip with explicit depends_on=660 when schema absent; mutation_hold set only in enforce mode; dedup + dead-pid orphan-session detection present; mutations_allowed() honors the hold.
tests/test_issue_662_post_restart_reconcile.py: 11 cases covering incomplete/fail-closed, clean happy-path (checkpoint skipped, links 655/652/653/662), interrupted mutation (dead owner + explicit pending inventory), log_only-vs-enforce hold distinction, duplicate live claims, orphan dead-pid session, stale runtime, mutations_allowed helper, #660 soft-dep both branches, and JSON serializability.
Additive (new module + read-only tool + boot-once log-only hook); honestly scoped to ACs 1-5 with non-goals (no HA failover, no silent replay, no #660 schema) respected.
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #879
issue: #662
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 45214-2c49ef91ca41
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr879-20260724
phase: released
candidate_head:
a7a283f449target_branch: master
target_branch_sha:
2976c21ee6last_activity: 2026-07-24T14:02:53Z
expires_at: 2026-07-24T14:12:53Z
blocker: obsolete-superseded-or-expired-lease
Canonical obsolete reviewer lease cleanup (#691)
a7a283f4491232789b41repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #879
issue: none
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 46658-2fecd517f798
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr879-20260724
phase: claimed
candidate_head: none
target_branch: master
target_branch_sha: none
last_activity: 2026-07-24T14:03:04Z
expires_at: 2026-07-24T14:13:04Z
blocker: none
Review Report for PR #879
PR #879 (Issue #662) implements post-restart reconciliation and completion proof.
Evaluation against Acceptance Criteria:
_ensure_boot_post_restart_reconcile()hook insidegitea_assess_master_parity.RestartCompletionProof.as_dict()with structured dimensions (service_health, sessions, leases, checkpoints, worktrees, mutations, duplicates, queue).proposed_follow_upsin the proof payload (log-only apply path deferred as intended).tests/test_issue_662_post_restart_reconcile.py(covering interrupted mutations, incomplete inventory, orphan sessions, duplicate claims, stale capabilities, and fail-closed enforce mode).Design and Code Quality:
_gather_post_restart_inventory) and pure classification (reconcile_after_restart).task_capability_map.py.Approving PR #879 for merge into master.
Controller Handoff
1232789b411232789b41into master1232789b41into master using gitea_merge_pr; stop1232789b411232789b411232789b41into master1232789b41, git diff --stat 103d0df28921d95673d4f375b00f01d306c70c70..1232789b41527c562b7a2a98da5f8536d65828f2Mutation-Capability Table
Canonical PR State
STATE: approved
WHO_IS_NEXT: merger
BLOCKED_ROLE: none
NEXT_ACTION: Merge PR #879 at head
1232789b41into masterNEXT_PROMPT: As prgs-merger, merge PR #879 at head
1232789b41into master using gitea_merge_pr; stopWHAT_HAPPENED: Reviewed PR #879 implementation against Issue #662 ACs 1-5; verified pure assessor logic, interrupted mutation fail-closed behavior, fail-soft #660 checkpoint handling, and test coverage; approved PR
WHY: PR #879 satisfies all acceptance criteria for post-restart reconciliation without breaking existing functionality or introducing security risks
ISSUE: #662
HEAD_SHA:
1232789b41REVIEW_STATUS: approved
MERGE_READY: true
BLOCKERS: none
VALIDATION: Verified unit and integration tests for post-restart reconciliation; clean static diff analysis against master
LAST_UPDATED_BY: prgs-reviewer
NATIVE_REVIEW_PROOF: native_mcp_review_submission
adopted_at: 2026-07-24T14:03:55Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 46658-2fecd517f798
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 15994
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #879
issue: none
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 46661-a777fc60d66b
worktree: /Users/jasonwalker/Development/Gitea-Tools
phase: adopted
candidate_head:
1232789b41target_branch: master
target_branch_sha: none
last_activity: 2026-07-24T14:03:55Z
expires_at: 2026-07-24T14:13:55Z
blocker: none
Stale #332 review-decision lock cleanup (#594)
Status: APPLIED
sysadminprgs-merger2026-07-24T14:04:25.947943+00:00approveon PR feat(mcp): post-restart reconciliation and completion proof (Closes #662) (#879)closed(merged=True)36fe4785eccf712b3bc0dec8583c798e8cf1f2181prgs-reviewerManual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.