feat: align claim/lock gates with branches-only worktrees (Closes #275) #280

Merged
sysadmin merged 4 commits from feat/issue-275-claim-lock-branches-worktree into master 2026-07-07 01:39:36 -05:00
Owner

Summary

Fixes the workflow conflict where LLMs must work only under branches/ but issue claim/lock gates still required the literal master/main branch name on the inspected worktree.

Changes

  • Issue lock validation (issue_lock_worktree.py): accept clean task worktrees whose HEAD matches origin/master/master/main/dev, even when the checked-out branch is a feature branch name.
  • Runtime preflight (gitea_mcp_server.py): gitea_get_runtime_context, gitea_mark_issue, and gitea_lock_issue accept worktree_path so preflight inspects the active task workspace instead of the shared MCP control checkout.
  • Capability map: add lock_issue resolver task for claim/lock gates.
  • Tests: base-match acceptance/rejection, preflight workspace diagnostics, lock_issue capability resolution.

Validation

python -m unittest tests.test_issue_lock_worktree tests.test_mcp_server.TestIssueLocking tests.test_mcp_server.TestPreflightVerification tests.test_resolve_task_capability -v

59 tests in targeted modules; all issue-lock/preflight/resolver tests pass.

Closes #275

## Summary Fixes the workflow conflict where LLMs must work only under `branches/` but issue claim/lock gates still required the literal `master`/`main` branch name on the inspected worktree. ## Changes - **Issue lock validation** (`issue_lock_worktree.py`): accept clean task worktrees whose HEAD matches `origin/master`/`master`/`main`/`dev`, even when the checked-out branch is a feature branch name. - **Runtime preflight** (`gitea_mcp_server.py`): `gitea_get_runtime_context`, `gitea_mark_issue`, and `gitea_lock_issue` accept `worktree_path` so preflight inspects the active task workspace instead of the shared MCP control checkout. - **Capability map**: add `lock_issue` resolver task for claim/lock gates. - **Tests**: base-match acceptance/rejection, preflight workspace diagnostics, lock_issue capability resolution. ## Validation ``` python -m unittest tests.test_issue_lock_worktree tests.test_mcp_server.TestIssueLocking tests.test_mcp_server.TestPreflightVerification tests.test_resolve_task_capability -v ``` 59 tests in targeted modules; all issue-lock/preflight/resolver tests pass. Closes #275
jcwalker3 added 1 commit 2026-07-06 13:49:16 -05:00
Allow issue lock from base-equivalent branches/ worktrees instead of
requiring the literal master/main branch name. Runtime preflight and
mark_issue/lock_issue now inspect the declared active task workspace so
dirty control-checkout state does not block clean task worktrees.

Closes #275

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
jcwalker3 added 2 commits 2026-07-06 13:51:25 -05:00
Allow issue lock from base-equivalent branches/ worktrees instead of
requiring the literal master/main branch name. Runtime preflight and
mark_issue/lock_issue now inspect the declared active task workspace so
dirty control-checkout state does not block clean task worktrees.

Closes #275

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
sysadmin added 1 commit 2026-07-07 00:59:53 -05:00
sysadmin requested changes 2026-07-07 01:12:51 -05:00
Dismissed
sysadmin left a comment
Owner

PR #280 has a test failure in tests/test_agent_temp_artifacts.py: TestIssueLockArtifactWarning.test_lock_success_includes_artifact_warning. The method gitea_lock_issue now checks for profile permissions via _profile_permission_block, but the test does not mock the profile capability or define GITEA_ALLOWED_OPERATIONS. Please update the test to set or mock the required allowed operations.

PR #280 has a test failure in tests/test_agent_temp_artifacts.py: TestIssueLockArtifactWarning.test_lock_success_includes_artifact_warning. The method gitea_lock_issue now checks for profile permissions via _profile_permission_block, but the test does not mock the profile capability or define GITEA_ALLOWED_OPERATIONS. Please update the test to set or mock the required allowed operations.
sysadmin approved these changes 2026-07-07 01:36:54 -05:00
sysadmin left a comment
Owner

LGTM. All targeted unit tests pass successfully. PR #280 resolves the workflow conflict by allowing clean branches/ worktrees to claim and lock issues, with comprehensive tests.

LGTM. All targeted unit tests pass successfully. PR #280 resolves the workflow conflict by allowing clean branches/ worktrees to claim and lock issues, with comprehensive tests.
sysadmin merged commit a5341684f6 into master 2026-07-07 01:39:36 -05:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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