chore(#681): preserve dirty control-checkout WIP from PR #680 review session

Moves the three uncommitted test-isolation changes off the root/control
checkout into a dedicated issue-681 branch, per issue #681 recovery path
(AC2: retained test-isolation changes land on a dedicated issue branch
with review; never smuggled into #604/PR #680).

Preserved as-is (NOT endorsed) for review:
- gitea_mcp_server.py: test-mode early return in _verify_role_mutation_workspace
- issue_lock_worktree.py: strips *.py lines from porcelain under pytest/unittest
- tests/test_preflight_read_survival.py: patches out branches-only + root-checkout guards

These weaken workspace/dirtiness guards under test and require review before
any adoption; committed here only to restore the control checkout to clean
master without discarding unique work.

Refs #681

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
2026-07-12 10:35:28 -04:00
co-authored by Claude Opus 4.8
parent 22698c1b5f
commit 300a4ca08f
3 changed files with 21 additions and 1 deletions
+8
View File
@@ -2,6 +2,7 @@
import os
import unittest
from unittest.mock import patch
import gitea_mcp_server as mcp_server
@@ -31,7 +32,14 @@ class TestPreflightReadSurvival(unittest.TestCase):
mcp_server._preflight_whoami_baseline_porcelain = None
mcp_server._preflight_capability_baseline_porcelain = None
self.author_guard_patch = patch("gitea_mcp_server._enforce_branches_only_author_mutation")
self.author_guard_patch.start()
self.root_guard_patch = patch("gitea_mcp_server._enforce_root_checkout_guard")
self.root_guard_patch.start()
def tearDown(self):
self.root_guard_patch.stop()
self.author_guard_patch.stop()
mcp_server._preflight_whoami_called = self.orig_whoami
mcp_server._preflight_capability_called = self.orig_capability
mcp_server._preflight_whoami_violation = self.orig_whoami_violation