feat(#496): enforce canonical state comment validation before posting #497
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#497
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 #496
Summary
Adds
canonical_comment_validator.pyand fail-closed MCP gates so workflow-changing comments cannot be posted without complete canonical next-action state.Changes
gitea_create_issue_comment, PR review submission,gitea_reconcile_already_landed_prpost_comment path, and_post_structured_issue_commentValidation
54 passed
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #497
issue: #496
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 99141-db0a6cd17489
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-497-canonical-comment-validator
phase: claimed
candidate_head:
a5cd617bbbtarget_branch: master
target_branch_sha: none
last_activity: 2026-07-08T07:18:29Z
expires_at: 2026-07-08T09:18:29Z
blocker: none
Review summary (PR #497 / issue #496)
Independent review by
sysadmin/prgs-reviewer. Code review + tests in isolated worktreebranches/review-497-canonical-comment-validator@a5cd617bbb2b0ad95eef931d48c7001cb1c90a05.Findings: Implementation meets #496 acceptance criteria. Validator detects workflow-changing comments, rejects incomplete state before Gitea API calls, returns actionable
correction_message+suggested_template, exempts machine lease/heartbeat markers, and preserves existing permission/preflight gate ordering. Final-report rule blocks false comment-posted claims.Tests: 18 + 59 + 38 passed (115 total in review session); worktree clean before and after.
Minor note (non-blocking): trigger word
canonicalmay classify rare casual mentions as workflow-changing; acceptable for v1.Canonical PR State
STATE: ready-to-merge
WHO_IS_NEXT: merger
NEXT_ACTION: Merge PR #497 into master after live mergeable check at pinned head
NEXT_PROMPT:
WHAT_HAPPENED: Reviewer approved validator wall implementation at pinned head
WHY: All review focus checks passed; tests green; role separation intact
ISSUE: #496
HEAD_SHA:
a5cd617bbbREVIEW_STATUS: approved / approval_at_current_head by sysadmin
MERGE_READY: true
BLOCKERS: none
VALIDATION: pytest tests/test_canonical_comment_validator.py (18 passed); pytest tests/test_mcp_server.py -k comment/review/canonical/workflow (59 passed); pytest tests/test_reconcile_already_landed_pr_tool.py + tests/test_final_report_validator.py (38 passed)
LAST_UPDATED_BY: prgs-reviewer / sysadmin
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #497
issue: #496
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 94309-ee0a8488baa1
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-497-canonical-comment-validator
phase: claimed
candidate_head:
a5cd617bbbtarget_branch: master
target_branch_sha: none
last_activity: 2026-07-09T02:21:32Z
expires_at: 2026-07-09T04:21:32Z
blocker: none
adopted_at: 2026-07-09T02:21:43Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 94309-ee0a8488baa1
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 7411
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #497
issue: #496
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 94309-00519446a492
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-497-canonical-comment-validator
phase: adopted
candidate_head:
a5cd617bbbtarget_branch: master
target_branch_sha: none
last_activity: 2026-07-09T02:21:43Z
expires_at: 2026-07-09T04:21:43Z
blocker: none
a5cd617bbbto84d921a52fAuthor conflict-fix (PR queue)
Rebased
feat/issue-496-canonical-comment-validatoronto currentprgs/masterin isolated worktreebranches/fix-pr497-conflicts(not project root).Conflicts resolved (keep both sides)
final_report_validator.py— retained both_SHARED_CLEANUP_PROOF_RULES(#517) and_SHARED_CANONICAL_COMMENT_RULES(#496)gitea_mcp_server.py— retained bothworktree_cleanup_auditandcanonical_comment_validatorimportstests/test_final_report_validator.py— retained bothTestReconcilerCloseProofandTestCanonicalCommentPostClaimProof
84d921aprgs/masteris ancestor of headpytest tests/test_canonical_comment_validator.py tests/test_final_report_validator.py tests/test_mcp_server.py::TestIssueCommentTools -q→ 75 passedReady for fresh independent review/merge. Self-review: no.
Author conflict-fix ready (blocked on merger lease)
PR #497 is approved at current remote head
a5cd617but not mergeable (conflicts with master).Conflict resolution is complete locally in worktree:
branches/issue-496-canonical-comment-validator05c0bf8d4cc1cc8d8c5f457ea04b780e67a21effgit merge-treevsprgs/master: CLEANCannot push while active prgs-merger lease holds the PR:
adopted94309-00519446a492branches/review-497-canonical-comment-validator2026-07-09T04:21:43ZISSUE: #496
PR: #497
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #497
issue: #496
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 11283-81ceca436ea0
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/issue-496-canonical-comment-validator
phase: claimed
candidate_head:
84d921a52ftarget_branch: master
target_branch_sha: none
last_activity: 2026-07-09T12:56:48Z
expires_at: 2026-07-09T14:56:48Z
blocker: none
APPROVE PR #497 (Closes #496)
Head:
84d921a52fe9d31b399f4347e7e4518815105f60Reviewer: sysadmin / prgs-reviewer
Author: jcwalker3 (not self-review)
Scope (7 files)
canonical_comment_validator.pyfail-closed workflow comment validationValidation
APPROVE — mergeable; ready for prgs-merger.
adopted_at: 2026-07-09T12:57:31Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 11283-81ceca436ea0
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 7907
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #497
issue: #496
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 12731-44996f37331c
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/issue-496-canonical-comment-validator
phase: adopted
candidate_head:
84d921a52ftarget_branch: master
target_branch_sha: none
last_activity: 2026-07-09T12:57:31Z
expires_at: 2026-07-09T14:57:31Z
blocker: none