============================= test session starts ==============================
platform darwin -- Python 3.11.14, pytest-7.4.4, pluggy-1.6.0 -- /opt/homebrew/opt/python@3.11/bin/python3.11
cachedir: .pytest_cache
rootdir: /Users/lokeshgarg/ai-mvp-backend/mcp-server-nucleus
configfile: pyproject.toml
plugins: anyio-4.12.1, asyncio-0.21.1, cov-7.0.0
asyncio: mode=Mode.STRICT
collecting ... collected 3 items

tests/e2e/test_e2e_scenarios.py::test_egress_firewall_allowed FAILED     [ 33%]
tests/e2e/test_e2e_scenarios.py::test_egress_firewall_blocked FAILED     [ 66%]
tests/e2e/test_e2e_scenarios.py::test_rpc_firewall_interception FAILED   [100%]

=================================== FAILURES ===================================
_________________________ test_egress_firewall_allowed _________________________

mcp_client = <test_e2e_scenarios.MockMCPClient object at 0x1092e5150>

    def test_egress_firewall_allowed(mcp_client):
        """Verify that nucleus_curl succeeds on allowed domains (github)."""
        resp = mcp_client.call_tool("nucleus_governance", {
            "action": "curl",
            "params": {
                "url": "https://raw.githubusercontent.com/eidetic-works/mcp-server-nucleus/main/README.md",
                "method": "GET"
            }
        })
    
>       assert "result" in resp, f"Expected result payload, got: {resp}"
E       AssertionError: Expected result payload, got: {'jsonrpc': '2.0', 'id': 1, 'error': {'code': -32602, 'message': 'Invalid request parameters', 'data': ''}}
E       assert 'result' in {'error': {'code': -32602, 'data': '', 'message': 'Invalid request parameters'}, 'id': 1, 'jsonrpc': '2.0'}

tests/e2e/test_e2e_scenarios.py:103: AssertionError
_________________________ test_egress_firewall_blocked _________________________

mcp_client = <test_e2e_scenarios.MockMCPClient object at 0x1092da7d0>

    def test_egress_firewall_blocked(mcp_client):
        """Verify that nucleus_curl aggressively blocks unlisted domains."""
        resp = mcp_client.call_tool("nucleus_governance", {
            "action": "curl",
            "params": {
                "url": "https://www.google.com",
                "method": "GET"
            }
        })
    
>       assert "result" in resp
E       AssertionError: assert 'result' in {'error': {'code': -32602, 'data': '', 'message': 'Invalid request parameters'}, 'id': 1, 'jsonrpc': '2.0'}

tests/e2e/test_e2e_scenarios.py:123: AssertionError
________________________ test_rpc_firewall_interception ________________________

mcp_client = <test_e2e_scenarios.MockMCPClient object at 0x1092db5d0>

    def test_rpc_firewall_interception(mcp_client):
        """
        Verify that tools mutating state are intercepted.
        We'll test context_update (which is a valid tool).
        """
        # Note: testing watch_resource or editing is harder in a raw E2E without
        # setting up the full handoff.md structure.
        # We will test a safe tool just to ensure the RPC loop is alive.
        resp = mcp_client.call_tool("nucleus_governance", {"action": "status", "params": {}})
>       assert "result" in resp
E       AssertionError: assert 'result' in {'error': {'code': -32602, 'data': '', 'message': 'Invalid request parameters'}, 'id': 1, 'jsonrpc': '2.0'}

tests/e2e/test_e2e_scenarios.py:139: AssertionError
=============================== warnings summary ===============================
tests/e2e/test_e2e_scenarios.py:9
  /Users/lokeshgarg/ai-mvp-backend/mcp-server-nucleus/tests/e2e/test_e2e_scenarios.py:9: PytestUnknownMarkWarning: Unknown pytest.mark.e2e - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    pytestmark = pytest.mark.e2e

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/e2e/test_e2e_scenarios.py::test_egress_firewall_allowed - Assert...
FAILED tests/e2e/test_e2e_scenarios.py::test_egress_firewall_blocked - Assert...
FAILED tests/e2e/test_e2e_scenarios.py::test_rpc_firewall_interception - Asse...
========================= 3 failed, 1 warning in 3.24s =========================
