fix(safety): add stop_array to DESTRUCTIVE_ACTIONS, add error propagation test

stop_array can cause data loss for running containers/VMs that depend on
array shares — requires confirm=True like other destructive mutations.

- Add stop_array to DESTRUCTIVE_ACTIONS and desc_map in array.py
- Update safety audit KNOWN_DESTRUCTIVE[array] to include stop_array
- Add stop_array negative/positive tests (test_array.py, safety tests)
- Add test_snapshot_wraps_bare_exception to test_live.py (bare Exception
  from subscribe_once is wrapped by tool_error_handler into ToolError)

748 tests passing
This commit is contained in:
Jacob Magar
2026-03-15 20:02:33 -04:00
parent 252ec520d1
commit 94850333e8
4 changed files with 29 additions and 4 deletions

View File

@@ -172,9 +172,15 @@ async def test_start_array(_mock_graphql):
@pytest.mark.asyncio
async def test_stop_array(_mock_graphql):
async def test_stop_array_requires_confirm(_mock_graphql):
with pytest.raises(ToolError, match="not confirmed"):
await _make_tool()(action="stop_array", confirm=False)
@pytest.mark.asyncio
async def test_stop_array_with_confirm(_mock_graphql):
_mock_graphql.return_value = {"array": {"setState": {"state": "STOPPED"}}}
result = await _make_tool()(action="stop_array")
result = await _make_tool()(action="stop_array", confirm=True)
assert result["success"] is True