No sanctioned first-mutation path: create_issue requires a branches/ worktree the issue-first gate forbids creating #749
Closed
opened 2026-07-18 13:03:04 -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#749
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
The first author mutation of any task — creating the tracking issue — has no sanctioned path from a clean control checkout. Two rules that are each individually correct contradict each other at exactly that moment:
gitea_create_issueby #450) rejects any author mutation whose workspace is the stable control checkout, and demands a session-owned worktree underbranches/.So creating the issue requires a
branches/worktree, and creating abranches/worktree requires the issue. Neither rule can be satisfied first.Observed
From a clean control checkout on master, with a valid
prgs-authorprofile andcreate_issuecapability resolved:The prescribed
exact_next_actionis itself unsatisfiable at this phase: it namesbranches/issue-<N>-*, but<N>is precisely the issue number that does not yet exist.Why this matters
The deadlock is not theoretical, and the escapes observed so far are all unsatisfactory:
mkdira dummy worktree — this is what happened during the #712 incident, recorded verbatim in #713: an operator ranmkdir -p branches/issue-creation-dummyand retried. That directory is not a registered Git worktree, which is the exact hole #713 AC1 proposes to close.worktree_pathpointing at a clean, unrelated scratch worktree (branches/chore-tmp-create-issue-pytest-runner, left untouched with no commits). It satisfies the guard only by accident, since that worktree has no connection to the work being filed. This issue itself was filed the same way, because no other path exists.Every current escape either weakens a guard or launders an unrelated binding through it. That is worth fixing deliberately rather than leaving each session to improvise.
Sequencing with #713 (important)
#713 asks to make this guard stricter: require proof of a registered Git worktree (
git worktree listmembership) rather than mere directory existence. That is correct and it closes escape (2) above. But #713 as written makes this deadlock strictly worse, because it removes the improvised hatch without supplying a legitimate first-mutation path.Any fix here must therefore satisfy #713 AC1 rather than route around it. A bootstrap exception implemented as "skip the guard when no worktree exists" would directly reintroduce what #713 is trying to eliminate.
Proposed direction (not prescriptive)
Options worth weighing, in rough order of preference:
create_issueas a pre-issue phase where no issue-backed worktree can exist by definition, and permit it from the control checkout provided the checkout is clean and the operation creates no local mutation. Issue creation writes nothing to the working tree — it is a pure remote mutation — so the branches-only guard is arguably protecting against a hazard this call does not present.branches/author-bootstrap) explicitly recognized for pre-issue mutations, created and registered by tooling rather than improvised per session. Satisfies #713 because it is a genuine registered worktree.Acceptance criteria
exact_next_actionis satisfiable at the phase it is emitted in. It must not instruct the caller to createbranches/issue-<N>-*at a point where<N>cannot be known.References
gitea_close_issuealso has no sanctioned path under #274. A shared solution is plausible.branches/worktree does not exist for the task, create one before doing work") shows the issue-first ordering was not anticipated.worktree_paththroughgitea_create_issueand introduced the fail-closed behaviour now deadlocking.create_issueandcreate_issue_commentenforce the binding differently).Filed while working #747; the deadlock was hit and worked around during that task's issue creation.
Issue claim heartbeat