feat: add native MCP preference gate and shell circuit breaker (Closes #270) #377

Merged
sysadmin merged 1 commits from feat/issue-270-native-mcp-preference into master 2026-07-07 08:54:03 -05:00
Owner

Summary

Enforce native MCP-first paths for Gitea mutations. Block shell scripts, direct API calls, WebFetch, Playwright, and helper encoders when MCP is available unless explicit recovery-mode proof is complete.

Changes

  • Add native_mcp_preference assessment helpers and shell spawn circuit breaker
  • Expose gitea_assess_gitea_operation_path, gitea_record_shell_spawn_outcome, and gitea_get_shell_health MCP tools
  • Include shell health in gitea_get_runtime_context
  • Add operator-guide native_mcp_preference rule

Validation

  • pytest tests/test_native_mcp_preference.py -q → 10 passed

Closes #270

## Summary Enforce native MCP-first paths for Gitea mutations. Block shell scripts, direct API calls, WebFetch, Playwright, and helper encoders when MCP is available unless explicit recovery-mode proof is complete. ## Changes - Add `native_mcp_preference` assessment helpers and shell spawn circuit breaker - Expose `gitea_assess_gitea_operation_path`, `gitea_record_shell_spawn_outcome`, and `gitea_get_shell_health` MCP tools - Include shell health in `gitea_get_runtime_context` - Add operator-guide `native_mcp_preference` rule ## Validation - `pytest tests/test_native_mcp_preference.py -q` → 10 passed Closes #270
jcwalker3 added 1 commit 2026-07-07 08:11:30 -05:00
Enforce native MCP-first paths for Gitea mutations with fail-closed
assessment helpers, shell spawn circuit breaker tracking, and MCP tools
for operation-path assessment and shell health reporting.

Closes #270
sysadmin approved these changes 2026-07-07 08:53:50 -05:00
sysadmin left a comment
Owner

All tests pass successfully after merging master (1388 passed, 1 failed [pre-existing]). Reviewed the implementation of native_mcp_preference.py and the test coverage in tests/test_native_mcp_preference.py. It correctly enforces native MCP preference over shell / direct API / helper script fallbacks for Gitea mutations, and implements the shell spawn failure circuit breaker to prevent unproven/unsafe fallbacks when MCP is broken. Verified that the remaining failure is pre-existing on master.

All tests pass successfully after merging master (1388 passed, 1 failed [pre-existing]). Reviewed the implementation of `native_mcp_preference.py` and the test coverage in `tests/test_native_mcp_preference.py`. It correctly enforces native MCP preference over shell / direct API / helper script fallbacks for Gitea mutations, and implements the shell spawn failure circuit breaker to prevent unproven/unsafe fallbacks when MCP is broken. Verified that the remaining failure is pre-existing on master.
sysadmin merged commit 47b4ee4791 into master 2026-07-07 08:54:03 -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#377