Add native MCP bootstrap for allocated author issue worktrees #850
Open
opened 2026-07-23 14:37:59 -05:00 by jcwalker3
·
1 comment
No Branch/Tag Specified
master
fix/issue-864-dirty-same-claimant-session-rebind
fix/issue-860-dirty-orphan-worktree-recovery
feat/issue-642-sanctioned-restart-controls
fix/issue-850-native-mcp-bootstrap
fix/issue-858-audit-merged-pr-aware
feat/issue-639-webui-system-health-dashboard
docs/issue-656-mcp-restart-governance
fix/issue-842-conflict-fix-lease-lifecycle
feat/issue-628-autonomous-handoffs-orchestration
fix/issue-790-slice-a-heartbeat-policy
feat/issue-637-timeline-model
feat/issue-646-policy-guardrail-visibility
feat/issue-638-webui-app-shell-phase1
fix/issue-851-cleanup-worktree-before-remote-delete
fix/issue-843-cross-role-allocation-handoff
fix/issue-844-exclude-epic-containers
feat/issue-634-readonly-system-health-api
fix/issue-840-cross-role-queue-allocation
feat/issue-822-atomic-install-authority-kernel
feat/issue-633-console-authz-audit-model
feat/issue-636-inventory-api
fix/issue-815-preflight-worktree-forwarding
feat/issue-812-publish-unpublished-commit
feat/issue-635-project-registry-api
feat/issue-798-worker-registry-schema
feat/issue-610-live-remote-parity
docs/issue-632-web-console-architecture
fix/issue-760-exact-owner-renewal
fix/issue-787-kill-segment-separators
chore/issue-681-preserve-review-session-wip
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#850
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 statement
An unattended controller-routed author cycle cannot start a newly selected issue using only sanctioned Gitea-Tools MCP operations.
For live Issue #639, the controller preview correctly routed
author / implementtogitea-author. The author namespace passed identity, role, capability, namespace-health, workflow-skill, and master-parity checks, but it had no issue worktree yet. That is task-bound state before allocation, not itself an error. The required next transition is:selected issue → assignment/lease → issue lock → validated branch/worktree under branches/The live author tool registry exposes allocation/lease operations and
gitea_lock_issue, but no native MCP operation that creates and binds the registered issue worktree needed bygitea_lock_issue. The runtime's only recovery guidance isscripts/worktree-startorgit worktree add, which MCP-only scheduled workers are prohibited from using.Affected runtime
Scaled-Tech-Consulting/Gitea-Toolsprgsgitea-author / prgs-author / jcwalker3 / authorimplement, candidate fingerprint82f19c3936eda98f9cf7c1923fc16a07c53749aad8b01dc007c9d4853fd42db71c455b6ec0f9cb761fe6248de68c17e061fb5ecdwork-issue.mdSHA-25614e515cdaa6a859c756c51091b71b4ed98e72b72e85ffa349b64bcff83b4c6d91gitea_lock_issueregisteredExpected behavior
After atomic controller allocation, a role-correct author namespace must expose one sanctioned MCP transition that creates or recovers the issue branch and registered worktree under
branches/, binds it to the assignment/lease, and makes it eligible for the canonical issue lock without touching the stable control checkout.Actual behavior
No native MCP branch/worktree bootstrap operation is registered. The canonical tool inventory contains worktree audit/snapshot tools but no create/bind operation.
gitea_get_runtime_contextreports the stable control checkout and instructs the worker to use a shell helper or raw Git. In an MCP-only scheduled run, applying the allocation would therefore knowingly create a lease that cannot advance to the required issue lock/worktree state.No allocation was applied for #639, and no branch, worktree, lock, file, commit, push, or PR mutation was produced.
Recovery attempts and authoritative evidence
gitea-workflowmounts and clean instruction boundary.prgs.gitea_assess_work_issue_duplicate(issue_number=639, phase=pre_claim): no linked open PR, conflicting branch, or active claim.docs/mcp-tool-inventory.md: only worktree audit/snapshot/cleanup assessment tools exist; no native create/bind transition exists.Assignment and lease impact
Scheduled-run impact
Every fresh MCP-only scheduled author cycle that selects an issue without an existing registered worktree must stop before allocation or create an unadvanceable lease. The live recovery text directs workers toward operations that the automation security boundary forbids.
Duplicate search
Searched all 469 open and closed issue titles and inspected the closest bodies.
create_issuebootstrap; they do not bootstrap post-issue author worktrees.No issue fully covers this root cause.
Acceptance criteria
assigned issue → issue branch → registered branches/ worktree → bound workflow lease/assignment → issue-lock-ready state..git/worktreesmetadata, lock state, issue lock, assignment, and workflow lease.Non-goals
branches/.Specification amendment — durable, idempotent provisioning transition
This comment is an authoritative amendment to Issue #850. It refines the existing AC1–AC10 and replaces any implication of an unrealistic cross-system atomic transaction.
The provisioning operation MUST persist a durable phase journal for the transition. Each completed phase MUST have authoritative read-after-write evidence sufficient to resume safely after interruption.
The journal MUST distinguish at least:
The operation MUST accept or authoritatively derive an idempotency key.
Replaying the same request with the same key and compatible authoritative inputs MUST return or recover the same transition and artifacts. It MUST NOT create duplicate branches, paths, worktrees, registrations, locks, assignments, or leases.
Reuse is permitted only after exact identity and compatibility are proven.
The request MUST carry an authoritative expected-base/concurrency pin.
If the live base, allocation, ownership, branch, path, worktree registration, or other protected state no longer matches the pin, the operation MUST fail closed with a typed stale-pin result. It MUST NOT silently rebase, repoint, overwrite, or continue against newer state.
Rollback is compensating recovery, not a cross-system transaction.
Recovery MUST affect only artifacts proven to have been created by this journaled transition. Preexisting or foreign-owned refs, directories, worktrees, registrations, locks, assignments, leases, and tracked or untracked content MUST remain byte-for-byte unchanged.
The MCP server MAY internally reuse vetted worktree-start logic or equivalent repository helpers.
The prohibition applies to callers and scheduled workers invoking shell Git, Bash, or helper scripts as a fallback. It does not prohibit validated server-side reuse behind the sanctioned MCP operation.
The operation MUST reject:
Every blocking result MUST provide an exact_next_action that the caller can actually perform through its sanctioned capabilities at the phase where the blocker is emitted.
A scheduled MCP-only worker MUST NOT be directed to run scripts/worktree-start, git worktree add, Bash, or another forbidden fallback.
Tests MUST cover at least:
These requirements extend #850 without expanding it into stale-daemon, namespace-availability, restart-required, post-merge resynchronization, general lease-renewal, or cycle-terminal-state-classifier work.
Canonical Issue State
STATE: ready
WHO_IS_NEXT: controller
NEXT_ACTION: Controller assesses eligibility and allocates Issue #850 after specification amendment verification
NEXT_PROMPT:
WHAT_HAPPENED: Author appended authoritative specification amendment for durable, idempotent provisioning transition to Issue #850.
WHY: Refines AC1-AC10 into journaled phases, idempotency key, concurrency pin, compensating recovery, server-side reuse, canonical path/preservation, and satisfiable next action.
RELATED_PRS: none
BLOCKERS: none
VALIDATION: Author verified Issue #850 open, read prior state, resolved comment_issue capability, and posted authoritative amendment comment with read-after-write verification.
LAST_UPDATED_BY: jcwalker3 (prgs-author)