feat: add canonical state handoff ledger (Closes #494) #498
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#498
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 #494
Adds templates, helpers, validators, and documentation so discussions, issues, and PRs carry canonical state comments and final reports include next-action handoff fields (current status, next actor, next action, next prompt).
Changes
state_handoff_ledger.py— render/parse state comment templates; assess next-action handoff and contradictory state claimsfinal_report_validator.py— wire shared state-handoff rules across all task kindsdocs/state-handoff-ledger.md— lifecycle, queue-controller priority, discussion rulesdocs/llm-workflow-runbooks.md— link to state handoff ledgertests/test_state_handoff_ledger.py— template, validation, and contradiction coveragetests/test_final_report_validator.py— update fixtures with required next-action fieldsValidation
Worktree
branches/issue-494-state-handoff-ledger@d50328abranches/issue-494-lock-baserepo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 94309-9c7af56b8b79
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr498
phase: claimed
candidate_head:
d50328aea4target_branch: master
target_branch_sha: none
last_activity: 2026-07-09T02:30:25Z
expires_at: 2026-07-09T04:30:25Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 94309-9c7af56b8b79
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr498
phase: claimed
candidate_head:
e0c583db75target_branch: master
target_branch_sha:
719de6fb7alast_activity: 2026-07-09T03:04:41Z
expires_at: 2026-07-09T05:04:41Z
blocker: none
Reviewer verdict: APPROVE
Reviewed at head
e0c583d(merge of master intofeat/issue-494-state-handoff-ledger).Scope — clean, matches issue #494 exactly. 6 files, +764/-0:
state_handoff_ledger.py(new) — render/parse canonical state comments; next-action handoff + contradiction assessorsfinal_report_validator.py— additive_rule_shared_state_handoff_next_actionwired across task kinds (no regression to existing gates)docs/state-handoff-ledger.md,docs/llm-workflow-runbooks.mdtests/test_state_handoff_ledger.py,tests/test_final_report_validator.pyNo unrelated files, no secrets, pure functions (no network/side effects).
Validation — ran the two test files at this head with the repo venv: 56 passed, 3 subtests passed.
Notes (non-blocking) — missing trailing newline in
state_handoff_ledger.py;_handoff_field_mapconsumes allkey: valuelines after the## Controller Handoffheading (lenient); a few contradiction heuristics could false-positive on reconcile reports. All covered by tests; fine to address in follow-up.Approving — ready to merge.
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 94309-9c7af56b8b79
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr498
phase: approved
candidate_head:
e0c583db75target_branch: master
target_branch_sha:
719de6fb7alast_activity: 2026-07-09T03:06:39Z
expires_at: 2026-07-09T05:06:39Z
blocker: none
adopted_at: 2026-07-09T03:07:38Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 94309-9c7af56b8b79
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 7622
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 12053-dddd5e489b8b
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr498
phase: adopted
candidate_head:
e0c583db75target_branch: master
target_branch_sha:
719de6fb7alast_activity: 2026-07-09T03:07:38Z
expires_at: 2026-07-09T05:07:38Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 12053-dddd5e489b8b
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr498
phase: released
candidate_head:
e0c583db75target_branch: master
target_branch_sha:
719de6fb7alast_activity: 2026-07-09T03:14:36Z
expires_at: 2026-07-09T05:14:36Z
blocker: post-merge-moot