Fix PR checks assessor defaulting empty status sets to pending #751
Closed
opened 2026-07-18 16:11:58 -05:00 by jcwalker3
·
1 comment
No Branch/Tag Specified
master
feat/issue-609-prepared-review-verdict-resume
issue-723-role-poisoning
fix/issue-723-capability-role-invariants
docs/mcp-stable-control-runtime-policy
fix/issue-695-native-quarantine-v2
chore/issue-681-preserve-review-session-wip
fix/issue-673-remediate-regressions-part2
feat/issue-610-live-remote-parity
feat/issue-503-reviewer-active-worktree
feat/issue-470-preflight-contract
feat/issue-440-lock-recovery
feat/issue-440-branch-recovery
feat/issue-458-queue-fail-closed-copy
feat/issue-400-early-duplicate-work-gate
feat/issue-308-reconcile-inventory-pagination
feat/issue-308-reconcile-pagination-proof
docs/issue-261-agent-temp-artifact-cleanup
feat/issue-262-map-commit-files
fix/infra-stop-conflict-marker-false-positive
feat/issue-139-role-aware-task-routing
feat/issue-188-continuation-selection-wall
feat/issue-189-continuation-mode-proofs
feat/issue-232-refresh-wiki-proof-heads
feat/issue-210-block-workspace-edits
feat/issue-204-exact-issue-lock
docs/issue-80-label-taxonomy
docs/issue-79-safety-boundary-updates
v1.1.0
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
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#751
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.
Problem
gitea_assess_pr_sync_statuscan permanently block an otherwise merge-ready pull request when the commit has no status contexts.This was reproduced on PR #750 at exact head
e349839fd739e10af2df9c0f429ac487e8ca8b9d, based on masterfdab6b6c69717d32a0d50e233413cf09be83f6e8.PR #750 was open and mergeable, zero commits behind master, and approval #466 was valid at the current head. Nevertheless, the assessor returned:
checks_status=pendingrecommended_next_action=blockedNo caller-supplied or invented
checks_statusvalue was used.Diagnosis
The production dataflow has several related defects:
gitea_mcp_server.py:15736-15739The wrapper reads the combined commit-status response and takes its
statevalue directly. Gitea can reportstate: pendingwhen the contained status-context collection is empty.The code does not inspect the number of status contexts. Its fallback to
checks_status="none"is effectively unreachable for a valid combined-status response containing a truthystate.pr_sync_status.py:76checks_requireddefaults toTrue.gitea_mcp_server.py:15561-15569The MCP wrapper exposes no sanctioned input or derived value for
checks_required, and production callers do not pass it.gitea_mcp_server.py:15370-15405The existing branch-protection reader handles the current-base rule but does not derive status-check requirements from fields such as
enable_status_checkorstatus_check_contexts.The result is that the assessor cannot reliably distinguish:
At both PR #750's head and base, read-only repository inspection found no Gitea Actions, GitHub Actions, Woodpecker, Drone, or other apparent CI workflow configuration capable of producing a status context.
Impact
The canonical merge workflow requires
recommended_next_action=merge_nowbefore merger acquisition. Therefore, a commit with no status contexts can become permanently blocked even though no check is running and waiting cannot change the result.PR #750 must remain unmerged until this defect is handled through the sanctioned workflow. The defect must not be bypassed by supplying a fabricated
checks_statusorchecks_requiredvalue.Acceptance criteria
Derive whether status checks are required from the live branch-protection rule.
Inspect the actual status-context collection instead of relying only on the combined
state.Represent these states distinctly:
Do not classify an empty status-context collection as executing CI merely because the combined state is
pending.Make the derived
checks_requiredvalue reachable by the production MCP assessment path.Preserve fail-closed behavior when required checks genuinely exist and are incomplete.
Add regression tests covering:
pending;Verify the canonical merger workflow receives an accurate
recommended_next_action.Do not weaken approval, current-head, current-base, lease, role-separation, or merge authorization gates.
Constraints
Recovery disclosure: implementation at
eac7afe5cbwas completed and pushed before the issue lock was acquired. The lock was subsequently adopted through the native own-branch path under explicit operator authorization. No code, commit, or branch content was changed during adoption.Canonical Issue State
STATE: open, implementation complete at
eac7afe5cb, issue lock adopted, no pull request created yetWHO_IS_NEXT: AUTHOR
NEXT_ACTION: Create one pull request from fix/issue-751-checks-assessor into master pinned to exact head
eac7afe5cb, citing the adoption proof and disclosing the late lock acquisition.NEXT_PROMPT:
WHAT_HAPPENED: The issue #751 implementation was authored, committed and pushed before any issue lock existed. gitea_lock_issue then refused the implementation worktree because it was not base-equivalent to master, and gitea_create_pr refused because no lock existed, producing a deadlock. Under explicit operator authorization, a clean recovery worktree was created detached at
fdab6b6c69, and the native own-branch adoption path adopted the existing pushed branch. Adoption proof recorded adopted_branch fix/issue-751-checks-assessor, adopted_branch_headeac7afe5cb, competing_branch_check clear, no_existing_pr_proof true, no_competing_live_lock_proof true.WHY: The lock-before-implementation ordering was violated by the earlier author run. This comment records the real chronology rather than concealing it, so the adopted lock is not mistaken for evidence that the lock preceded the work.
RELATED_PRS: 750 (open, untouched), 746 (open, untouched, advanced independently by another session)
BLOCKERS: no blocker
VALIDATION: Focused suite tests/test_issue_751_checks_assessor.py 40 passed. Pre-existing tests/test_pr_sync_status.py 28 passed unchanged. Affected suites 384 passed with 42 subtests. Full suite 3465 passed, 6 skipped, 2 failed, 365 subtests. The 2 failures were reproduced on a pristine detached worktree at
fdab6b6c69with none of this branch applied and are therefore pre-existing on master. git diff --check clean.LAST_UPDATED_BY: jcwalker3 / prgs-author
[THREAD STATE LEDGER]
What is true now
eac7afe5cbwas authored and pushed BEFORE any issue lock existed for issue 751. That ordering was incorrect and is recorded here rather than concealed.fdab6b6c69and has not moved.What changed
fdab6b6c69.eac7afe5cb, competing_branch_check clear, no_existing_pr_proof true, no_competing_live_lock_proof true.What is blocked
Who/what acts next
eac7afe5cb, citing this adoption proof and disclosing the late lock acquisition.