Add worktree_path binding to gitea_create_issue_comment #560

Closed
opened 2026-07-08 15:08:43 -05:00 by jcwalker3 · 1 comment
Owner

Problem

gitea_create_issue_comment is an issue-comment mutation and is correctly subject to the branches-only mutation guard, but the MCP tool schema does not expose a worktree_path parameter. When the live runtime binding points at the stable root checkout, author sessions cannot post canonical issue evidence comments from an isolated branches/ worktree.

Observed during the PR #553 / Issue #546 bootstrap-deadlock issue update:

  • Issue #557 already existed and needed one canonical evidence comment.
  • gitea_create_issue_comment failed the branches-only mutation guard.
  • The tool schema had no worktree_path parameter to prove the isolated author worktree.
  • The root checkout stayed content-read-only.
  • No bypass was used and no comment was posted.

Required behavior

Add a canonical way for gitea_create_issue_comment to satisfy the branches-only mutation guard using an explicit optional worktree_path, matching other mutating tools that already support explicit worktree binding.

Acceptance criteria

  • gitea_create_issue_comment accepts optional worktree_path in its MCP schema.
  • The implementation passes worktree_path into the existing role/workspace mutation verification path.
  • worktree_path is used only for guard/context verification and does not weaken identity, role, profile, or capability checks.
  • Explicit org and repo behavior remains intact.
  • Wrong repo/default repo mismatch protections still apply.
  • Tests prove comment creation succeeds when a valid branches/ worktree path is supplied.
  • Tests prove comment creation fails from the root/control checkout without valid binding.
  • Tests prove invalid or outside-root worktree paths fail closed.
  • Tests prove role/capability checks are still required.
  • Tests prove explicit org/repo comments still work safely.

Duplicate search performed

Searched for:

  • gitea_create_issue_comment worktree_path
  • issue comment branches-only guard
  • comment_issue worktree binding
  • create_issue_comment mutation guard
  • evidence comment blocked by no worktree_path

Closest related issues, not exact duplicates:

  • #540 handles reconciler role poisoning during comment preflight, not author worktree binding for issue comments.
  • #450 adds worktree_path to gitea_create_issue, not issue comments.
  • #496 validates canonical state comments, not workspace binding.
  • #557 tracks the bootstrap review path and exposed this blocker, but does not implement the issue-comment tool schema fix.

Related

  • #557: bootstrap review path issue where the evidence comment was blocked.
  • #546 / PR #553: motivating bootstrap-deadlock context.
  • #540: related comment preflight role issue.
  • #450: prior pattern for gitea_create_issue(worktree_path=...).
## Problem `gitea_create_issue_comment` is an issue-comment mutation and is correctly subject to the branches-only mutation guard, but the MCP tool schema does not expose a `worktree_path` parameter. When the live runtime binding points at the stable root checkout, author sessions cannot post canonical issue evidence comments from an isolated `branches/` worktree. Observed during the PR #553 / Issue #546 bootstrap-deadlock issue update: - Issue #557 already existed and needed one canonical evidence comment. - `gitea_create_issue_comment` failed the branches-only mutation guard. - The tool schema had no `worktree_path` parameter to prove the isolated author worktree. - The root checkout stayed content-read-only. - No bypass was used and no comment was posted. ## Required behavior Add a canonical way for `gitea_create_issue_comment` to satisfy the branches-only mutation guard using an explicit optional `worktree_path`, matching other mutating tools that already support explicit worktree binding. ## Acceptance criteria - `gitea_create_issue_comment` accepts optional `worktree_path` in its MCP schema. - The implementation passes `worktree_path` into the existing role/workspace mutation verification path. - `worktree_path` is used only for guard/context verification and does not weaken identity, role, profile, or capability checks. - Explicit `org` and `repo` behavior remains intact. - Wrong repo/default repo mismatch protections still apply. - Tests prove comment creation succeeds when a valid `branches/` worktree path is supplied. - Tests prove comment creation fails from the root/control checkout without valid binding. - Tests prove invalid or outside-root worktree paths fail closed. - Tests prove role/capability checks are still required. - Tests prove explicit `org`/`repo` comments still work safely. ## Duplicate search performed Searched for: - `gitea_create_issue_comment worktree_path` - `issue comment branches-only guard` - `comment_issue worktree binding` - `create_issue_comment mutation guard` - `evidence comment blocked by no worktree_path` Closest related issues, not exact duplicates: - #540 handles reconciler role poisoning during comment preflight, not author worktree binding for issue comments. - #450 adds `worktree_path` to `gitea_create_issue`, not issue comments. - #496 validates canonical state comments, not workspace binding. - #557 tracks the bootstrap review path and exposed this blocker, but does not implement the issue-comment tool schema fix. ## Related - #557: bootstrap review path issue where the evidence comment was blocked. - #546 / PR #553: motivating bootstrap-deadlock context. - #540: related comment preflight role issue. - #450: prior pattern for `gitea_create_issue(worktree_path=...)`.
jcwalker3 added the status:in-progress label 2026-07-08 20:44:58 -05:00
Author
Owner

Issue claim heartbeat

<!-- gitea-issue-claim-heartbeat:v1 --> **Issue claim heartbeat** - kind: claim - issue: #560 - branch: fix/issue-560-issue-comment-worktree-path - phase: claimed - profile: prgs-author - pr: none - blocker: none - next_action: create worktree and begin implementation
sysadmin removed the status:in-progress label 2026-07-08 21:09:02 -05:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#560