feat: persist MCP workflow proof and decision lock across daemons (Closes #559) #562
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#562
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 #559.
MCP tool calls in IDE session pools often land on different daemon processes. Workflow-load proof and review decision lock were process-local globals, so sequential canonical steps failed closed with missing-load-proof errors even when the tools were called correctly in the same logical session.
Changes
mcp_session_state.py: user-private durable store under~/.cache/gitea-tools/session-state(override viaGITEA_MCP_SESSION_STATE_DIR), mode0o700/0o600, flock + atomic write, TTL (default 4h), keyed by kind + profile identity. Not host-global/tmp(#211).review_workflow_loadto persist/reload workflow load proof across processes; fail closed on profile-identity mismatch / expiry / stale hashes (PID-only gate removed for pool compatibility).gitea_mcp_serverto the same durable store with profile-lock + TTL checks.Validation
Worktree
/Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-559-durable-session-state@2a3d30fNotes for reviewer
/tmp, files are private, and a second process with the same profile can read a load recorded by the first.repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #562
issue: #559
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 82807-ace45b89143b
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-559-durable-session-state
phase: claimed
candidate_head:
2a3d30fb3atarget_branch: master
target_branch_sha:
1ffa911dbclast_activity: 2026-07-09T02:26:05Z
expires_at: 2026-07-09T04:26:05Z
blocker: none
APPROVE - PR #562 @
2a3d30fb3a0b1ff98b7261aa9eb9cb02705d187cReviewed from non-root worktree
/Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-559-durable-session-state.Scope: durable MCP session state for workflow-load proof and review decision lock across daemon processes (#559), using user-private cache storage instead of
/tmp, profile identity validation, TTL, and test isolation.Validation performed:
python3 -m pytest tests/test_mcp_session_state.py tests/test_review_workflow_load.py tests/test_review_workflow_boundary.py tests/test_terminal_review_hard_stop.py -q-> 37 passedpython3 -m py_compile mcp_session_state.py review_workflow_load.py gitea_mcp_server.py tests/test_mcp_session_state.py tests/test_review_workflow_load.py-> passedgit diff --check prgs/master...HEAD-> cleanNo self-review: reviewer identity
sysadmin; PR authorjcwalker3. Ready for gated merge pinned to2a3d30fb3a0b1ff98b7261aa9eb9cb02705d187c.repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #562
issue: #559
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 82807-ace45b89143b
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-559-durable-session-state
phase: released
candidate_head:
2a3d30fb3atarget_branch: master
target_branch_sha:
1ffa911dbclast_activity: 2026-07-09T02:31:39Z
expires_at: 2026-07-09T04:31:39Z
blocker: post-merge-moot