vmware-aiops 2.3.1__tar.gz → 2.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.claude-plugin/plugin.json +1 -1
  2. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.mcp.json +1 -1
  3. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/PKG-INFO +6 -2
  4. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/README-CN.md +3 -0
  5. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/README.md +4 -0
  6. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/RELEASE_NOTES.md +25 -0
  7. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/openclaw.plugin.json +1 -1
  8. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/package.json +1 -1
  9. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/pyproject.toml +2 -2
  10. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/server.json +2 -2
  11. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/skills/vmware-aiops/SKILL.md +2 -2
  12. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/skills/vmware-aiops/references/setup-guide.md +9 -5
  13. vmware_aiops-2.4.0/tests/eval/regression/test_host_paths_protected.py +239 -0
  14. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_guest_tools_gate.py +3 -1
  15. vmware_aiops-2.4.0/tests/test_policy_roles.py +117 -0
  16. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/uv.lock +6 -6
  17. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/__init__.py +1 -1
  18. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/guest_gate.py +5 -0
  19. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/guest_ops.py +65 -4
  20. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/ova_deploy.py +3 -0
  21. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/planner.py +26 -5
  22. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/vm_deploy.py +3 -0
  23. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/policy_environment.py +3 -0
  24. vmware_aiops-2.4.0/vmware_aiops/policy_roles.py +123 -0
  25. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.clawhubignore +0 -0
  26. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.env.example +0 -0
  27. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  28. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  29. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  30. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  31. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.github/dependabot.yml +0 -0
  32. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/.gitignore +0 -0
  33. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/Dockerfile +0 -0
  34. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/LICENSE +0 -0
  35. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/SECURITY.md +0 -0
  36. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/config.example.yaml +0 -0
  37. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/docker-compose.yml +0 -0
  38. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/docs/integrations/continue.md +0 -0
  39. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/docs/integrations/cursor.md +0 -0
  40. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/docs/integrations/goose.md +0 -0
  41. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/docs/integrations/localcowork.md +0 -0
  42. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/docs/integrations/mcp-agent.md +0 -0
  43. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/docs/integrations/vscode-copilot.md +0 -0
  44. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/docs/plans/2026-03-09-plan-apply-design.md +0 -0
  45. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/deploy.yaml +0 -0
  46. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/mcp-configs/README.md +0 -0
  47. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/mcp-configs/claude-code.json +0 -0
  48. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/mcp-configs/continue.yaml +0 -0
  49. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/mcp-configs/cursor.json +0 -0
  50. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/mcp-configs/goose.json +0 -0
  51. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/mcp-configs/localcowork.json +0 -0
  52. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/mcp-configs/mcp-agent.yaml +0 -0
  53. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/mcp-configs/vscode-copilot.json +0 -0
  54. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/examples/ollama-local-setup.md +0 -0
  55. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/skills/vmware-aiops/evals/evals.json +0 -0
  56. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/skills/vmware-aiops/references/agent-guardrails.md +0 -0
  57. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/skills/vmware-aiops/references/capabilities.md +0 -0
  58. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/skills/vmware-aiops/references/cli-reference.md +0 -0
  59. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/skills/vmware-aiops/references/investigation-protocol.md +0 -0
  60. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/smithery.yaml +0 -0
  61. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/__init__.py +0 -0
  62. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/conftest.py +0 -0
  63. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/__init__.py +0 -0
  64. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/__init__.py +0 -0
  65. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/_family.py +0 -0
  66. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/_scores.json +0 -0
  67. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/_scoring.py +0 -0
  68. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/_skill.py +0 -0
  69. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/conftest.py +0 -0
  70. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/test_entity_reachability.py +0 -0
  71. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/test_error_actionability.py +0 -0
  72. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/test_tool_description_quality.py +0 -0
  73. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/capability/test_tool_manifest_budget.py +0 -0
  74. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/__init__.py +0 -0
  75. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/_diag_fakes.py +0 -0
  76. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/_pc_fakes.py +0 -0
  77. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_aiops_specific.py +0 -0
  78. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_alarm_health_scale_n1.py +0 -0
  79. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_atexit_handlers_do_not_accumulate.py +0 -0
  80. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_capability_grader.py +0 -0
  81. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_cli_destructive_guards.py +0 -0
  82. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_cli_writes_guarded.py +0 -0
  83. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_cluster_health_summary_delegation.py +0 -0
  84. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_code_review_fixes.py +0 -0
  85. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_config_path_resolution_is_shared.py +0 -0
  86. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_daemon_calls_are_audited.py +0 -0
  87. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_daemon_host_log_cycles.py +0 -0
  88. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_deploy_correctness.py +0 -0
  89. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_doctor_authenticates_every_target.py +0 -0
  90. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_documented_gates_match_the_registry.py +0 -0
  91. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_enum_params_match_implementation.py +0 -0
  92. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_env_secret_obfuscation.py +0 -0
  93. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_event_sets_match_real_class_names.py +0 -0
  94. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_events_are_read_newest_first.py +0 -0
  95. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_guest_download_writes_the_local_disk.py +0 -0
  96. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_guest_username_is_explicit.py +0 -0
  97. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_host_log_scan_reads_real_logs.py +0 -0
  98. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_instructions_name_targets.py +0 -0
  99. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_inventory_scale_issue31.py +0 -0
  100. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_list_envelope_conformance.py +0 -0
  101. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_list_plans_is_non_destructive.py +0 -0
  102. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_login_without_vsphere_role.py +0 -0
  103. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_mcp_frame_marks_failures.py +0 -0
  104. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_ova_network_mapping.py +0 -0
  105. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_release_blockers.py +0 -0
  106. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_result_envelope.py +0 -0
  107. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_returned_failure_is_audited.py +0 -0
  108. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_session_probe_eviction.py +0 -0
  109. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_set_ttl_safety.py +0 -0
  110. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_snapshot_async.py +0 -0
  111. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_text_io_declares_encoding.py +0 -0
  112. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_tool_annotations_match_behaviour.py +0 -0
  113. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_unreachable_host_vmks.py +0 -0
  114. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_v1_5_25_blockers.py +0 -0
  115. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/eval/regression/test_vim_attribute_conformance.py +0 -0
  116. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_access_info.py +0 -0
  117. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_cluster_mgmt_sanitize.py +0 -0
  118. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_cluster_ttl_plan_gate.py +0 -0
  119. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_concurrent_local_state.py +0 -0
  120. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_config.py +0 -0
  121. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_drs_rules.py +0 -0
  122. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_gate_review_fixes.py +0 -0
  123. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_host_network_mgmt.py +0 -0
  124. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_init_and_onboarding.py +0 -0
  125. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_network_mgmt.py +0 -0
  126. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_no_destructive_ops.py +0 -0
  127. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_plan_gate_narrow_fixes.py +0 -0
  128. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_plan_rollback_final_fixes.py +0 -0
  129. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_reset_alarm_gate.py +0 -0
  130. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_results_name_their_target.py +0 -0
  131. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_safe_error_passthrough.py +0 -0
  132. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_session_pool.py +0 -0
  133. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_stop_signal_runs_atexit.py +0 -0
  134. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_vm_delete_blast_radius.py +0 -0
  135. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/tests/test_vm_tools_gate.py +0 -0
  136. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/_fsutil.py +0 -0
  137. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/access_requirements.py +0 -0
  138. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/__init__.py +0 -0
  139. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/_common.py +0 -0
  140. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/_root.py +0 -0
  141. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/access.py +0 -0
  142. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/alarm.py +0 -0
  143. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/cluster.py +0 -0
  144. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/deploy.py +0 -0
  145. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/doctor.py +0 -0
  146. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/hub.py +0 -0
  147. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/investigate.py +0 -0
  148. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/mcp_config.py +0 -0
  149. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/plan.py +0 -0
  150. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/scan.py +0 -0
  151. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/summary.py +0 -0
  152. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/cli/vm.py +0 -0
  153. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/config.py +0 -0
  154. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/connection.py +0 -0
  155. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/doctor.py +0 -0
  156. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/init_wizard.py +0 -0
  157. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/__init__.py +0 -0
  158. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/__main__.py +0 -0
  159. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/_shared.py +0 -0
  160. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/server.py +0 -0
  161. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/__init__.py +0 -0
  162. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/access.py +0 -0
  163. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/alarm.py +0 -0
  164. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/cluster.py +0 -0
  165. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/datastore.py +0 -0
  166. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/deploy.py +0 -0
  167. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/guest.py +0 -0
  168. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/network.py +0 -0
  169. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/plan.py +0 -0
  170. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/summary.py +0 -0
  171. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/ttl.py +0 -0
  172. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/mcp_server/tools/vm.py +0 -0
  173. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/notify/__init__.py +0 -0
  174. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/notify/audit.py +0 -0
  175. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/notify/logger.py +0 -0
  176. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/notify/webhook.py +0 -0
  177. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/__init__.py +0 -0
  178. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/_paging.py +0 -0
  179. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/alarm_mgmt.py +0 -0
  180. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/cluster_gate.py +0 -0
  181. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/cluster_mgmt.py +0 -0
  182. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/datastore_browser.py +0 -0
  183. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/gate.py +0 -0
  184. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/health.py +0 -0
  185. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/host_network_mgmt.py +0 -0
  186. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/inventory.py +0 -0
  187. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/iscsi_config.py +0 -0
  188. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/network_mgmt.py +0 -0
  189. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/plan_executor.py +0 -0
  190. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/plan_gate.py +0 -0
  191. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/ttl.py +0 -0
  192. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/vm_delete_gate.py +0 -0
  193. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/vm_gate.py +0 -0
  194. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/ops/vm_lifecycle.py +0 -0
  195. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/scanner/__init__.py +0 -0
  196. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/scanner/alarm_scanner.py +0 -0
  197. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/scanner/log_scanner.py +0 -0
  198. {vmware_aiops-2.3.1 → vmware_aiops-2.4.0}/vmware_aiops/scanner/scheduler.py +0 -0
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://anthropic.com/claude-code/plugin.schema.json",
3
3
  "name": "vmware-aiops",
4
4
  "displayName": "VMware AIops",
5
- "version": "2.3.1",
5
+ "version": "2.4.0",
6
6
  "description": "AI-powered VMware vCenter/ESXi VM lifecycle and deployment with 61 MCP tools.",
7
7
  "author": {
8
8
  "name": "Wei Zhou",
@@ -5,7 +5,7 @@
5
5
  "command": "uvx",
6
6
  "args": [
7
7
  "--from",
8
- "vmware-aiops==2.3.1",
8
+ "vmware-aiops==2.4.0",
9
9
  "vmware-aiops-mcp"
10
10
  ]
11
11
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: vmware-aiops
3
- Version: 2.3.1
3
+ Version: 2.4.0
4
4
  Summary: VMware vCenter/ESXi AI-powered VM lifecycle and deployment tool
5
5
  Project-URL: Homepage, https://github.com/vmware-skills/VMware-AIops
6
6
  Project-URL: Repository, https://github.com/vmware-skills/VMware-AIops
@@ -19,7 +19,7 @@ Requires-Dist: pyvmomi<10.0,>=8.0.3.0
19
19
  Requires-Dist: rich<16.0,>=13.0
20
20
  Requires-Dist: typer<1.0,>=0.12
21
21
  Requires-Dist: vmware-monitor<3.0,>=2.3.1
22
- Requires-Dist: vmware-policy<2.0,>=1.23.0
22
+ Requires-Dist: vmware-policy<2.0,>=1.23.1
23
23
  Description-Content-Type: text/markdown
24
24
 
25
25
  <!-- mcp-name: io.github.vmware-skills/vmware-aiops -->
@@ -1197,10 +1197,14 @@ claude mcp add --transport http vmware-aiops https://mcp.example.com:8443/mcp \
1197
1197
  (vmware-policy ≥ 1.23.0).
1198
1198
  - Send `traceparent` or `X-Request-ID` with each request to have it stored on the audit row;
1199
1199
  `vmware-audit log --correlation-id ID` then finds the calls behind one platform request.
1200
+ - Tools that read or write files on this server (here: guest file upload/download, OVA and deployment-spec files) never touch its configuration, tokens, audit log or
1201
+ TLS key, and over the network they are off unless `VMWARE_MCP_FILE_ROOT` names a directory for them
1202
+ (vmware-policy ≥ 1.23.1).
1200
1203
  - The audit log records each caller as `token:<name>`. Calls run side by side, with up to `VMWARE_MCP_POOL_SIZE`
1201
1204
  (default 2) sessions per target; each session is a login on the target, and a call waits at most 300 s for one.
1202
1205
  - **Everyone who can reach the endpoint acts with this server's account.** Tokens identify callers; they grant
1203
1206
  nothing on the platform. Run one endpoint per privilege level.
1207
+ - **Several people or roles on one endpoint:** run `vmware-audit roles enable` once, then give each token a role (`vmware-audit token create NAME --role reader`, or a role in `roles.yaml` naming tools and targets; vmware-policy ≥ 1.24.0). A role limits what the token may call on this endpoint; it cannot grant more than the account has. See vmware-policy's README, "Roles for network callers".
1204
1208
 
1205
1209
  **Offer only read tools, plus the writes you choose:**
1206
1210
 
@@ -837,10 +837,13 @@ claude mcp add --transport http vmware-aiops https://mcp.example.com:8443/mcp \
837
837
  `{"status": "ok"}`(需 vmware-policy ≥ 1.23.0)。
838
838
  - 每个请求带上 `traceparent` 或 `X-Request-ID`,它会记进审计记录;用 `vmware-audit log --correlation-id ID`
839
839
  就能查到平台上某一次请求对应的调用。
840
+ - 会读写本机文件的工具(这里是:虚拟机文件上传/下载、OVA 和部署 spec 文件)永远碰不到本机的配置、token、审计日志和 TLS 私钥;通过网络访问时,
841
+ 除非用 `VMWARE_MCP_FILE_ROOT` 指定一个目录,否则这些工具不能访问本机文件(需 vmware-policy ≥ 1.23.1)。
840
842
  - 审计日志把每个调用者记为 `token:<名字>`。调用并行执行,每个 target 最多 `VMWARE_MCP_POOL_SIZE`(默认 2)
841
843
  个会话;每个会话都是在该 target 上的一次登录,一个调用最多等待 300 秒拿到会话。
842
844
  - **能连到这个端点的人,都以该 server 配置的账号操作。** token 只用来识别调用者,不在平台上授予任何权限。
843
845
  每个权限级别单独起一个端点。
846
+ - **一个端点给多人或多种角色用:** 先运行一次 `vmware-audit roles enable`,再给每个 token 指定角色(`vmware-audit token create 名字 --role reader`,或在 `roles.yaml` 里定义可用的工具和 target;需 vmware-policy ≥ 1.24.0)。角色只能限定这个 token 在本端点上能调用什么,不能超出账号本身的权限。详见 vmware-policy README 的「网络调用者的角色」一节。
844
847
 
845
848
  **只提供读工具,加上你选定的写工具:**
846
849
 
@@ -1173,10 +1173,14 @@ claude mcp add --transport http vmware-aiops https://mcp.example.com:8443/mcp \
1173
1173
  (vmware-policy ≥ 1.23.0).
1174
1174
  - Send `traceparent` or `X-Request-ID` with each request to have it stored on the audit row;
1175
1175
  `vmware-audit log --correlation-id ID` then finds the calls behind one platform request.
1176
+ - Tools that read or write files on this server (here: guest file upload/download, OVA and deployment-spec files) never touch its configuration, tokens, audit log or
1177
+ TLS key, and over the network they are off unless `VMWARE_MCP_FILE_ROOT` names a directory for them
1178
+ (vmware-policy ≥ 1.23.1).
1176
1179
  - The audit log records each caller as `token:<name>`. Calls run side by side, with up to `VMWARE_MCP_POOL_SIZE`
1177
1180
  (default 2) sessions per target; each session is a login on the target, and a call waits at most 300 s for one.
1178
1181
  - **Everyone who can reach the endpoint acts with this server's account.** Tokens identify callers; they grant
1179
1182
  nothing on the platform. Run one endpoint per privilege level.
1183
+ - **Several people or roles on one endpoint:** run `vmware-audit roles enable` once, then give each token a role (`vmware-audit token create NAME --role reader`, or a role in `roles.yaml` naming tools and targets; vmware-policy ≥ 1.24.0). A role limits what the token may call on this endpoint; it cannot grant more than the account has. See vmware-policy's README, "Roles for network callers".
1180
1184
 
1181
1185
  **Offer only read tools, plus the writes you choose:**
1182
1186
 
@@ -1,3 +1,28 @@
1
+ ## v2.4.0 — roles for network callers (HLD §18)
2
+
3
+ * Declares the role metadata vmware-policy ≥ 1.24.0 needs to apply **roles** to this server over HTTPS
4
+ (HLD §18): how a missing target resolves, the guest and host-file tools that escape a role, and what each composite tool can run — `apply_vm_plan` and `rollback_vm_plan` reach every tool a plan step maps to plus `delete_vm` (rollback), `set_vm_ttl` reaches `delete_vm`, the batch tools reach the deploy and clone tools and the follow-up steps their arguments ask for (`reconfigure_vm`, `create_vm_snapshot`, `power_on_vm`, and `attach_iso_to_vm` for a deployment spec); a test derives these from what the batch code calls. A role may allow a composite only if it allows all of them. A test fails when a new plan action is not mapped to a tool. With an older vmware-policy nothing changes. Once an operator runs
5
+ `vmware-audit roles enable`, a token's role decides which tools and targets it may use here; a refused call is
6
+ audited as `denied`. See vmware-policy's README, "Roles for network callers".
7
+ * A target-limited role is checked against the same config the connection uses: the copy the server's connection manager loaded on its first connection. Edit `config.yaml` and restart for both to see the change.
8
+ * README and setup guide: one endpoint for several people or roles (run `vmware-audit roles enable` first).
9
+
10
+ ## v2.3.2 — tools may not touch this server's own control files
11
+
12
+ * **Security fix (HLD §18 step 0).** guest file download/upload, OVA and deployment-spec paths could name this server's own files, so over HTTPS a token holder could
13
+ overwrite `$OPS_HOME/mcp-tokens` or `rules.yaml`, or read a skill's `.env`. A path that resolves into `$OPS_HOME`,
14
+ a `~/.vmware-*` directory, a `VMWARE_*_CONFIG` directory, or the server's token file or TLS key/certificate is now
15
+ refused before anything is read or written. Over a network transport these tools read and write host files only
16
+ inside `VMWARE_MCP_FILE_ROOT` (unset: refused). Needs vmware-policy 1.23.1.
17
+ * `download_vm_guest_file` writes without following a link swapped in during the transfer (`O_NOFOLLOW`, a
18
+ re-check after the transfer) and refuses a hard-linked destination; the `provision_vm_guest` preview no longer
19
+ reports the size of a file the run would refuse. Uploads read the source the same way, and a FIFO no longer
20
+ blocks either direction.
21
+ * **`plan_id` can no longer name a path.** `apply_vm_plan` / `rollback_vm_plan` / `list`/`delete` built the plan file
22
+ name from the caller's `plan_id`, and saving used the id stored in the file, so a crafted plan could be written to
23
+ any `*.json` on the host. Plan ids are now `plan-` plus letters, digits and hyphens, and a plan file whose stored id
24
+ differs from its name is refused.
25
+
1
26
  ## v2.3.1 — an account with no vSphere role is named, not passed (AIops#47)
2
27
 
3
28
  Needs vmware-policy 1.23.0, and the vmware-monitor release with the same fix for the `attention` part.
@@ -11,7 +11,7 @@
11
11
  "command": "uvx",
12
12
  "args": [
13
13
  "--from",
14
- "vmware-aiops==2.3.1",
14
+ "vmware-aiops==2.4.0",
15
15
  "vmware-aiops-mcp"
16
16
  ]
17
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zw008/vmware-aiops",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "AI-powered VMware vCenter/ESXi VM lifecycle and deployment with 61 MCP tools.",
5
5
  "private": true,
6
6
  "license": "MIT",
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "vmware-aiops"
7
- version = "2.3.1"
7
+ version = "2.4.0"
8
8
  description = "VMware vCenter/ESXi AI-powered VM lifecycle and deployment tool"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -19,7 +19,7 @@ dependencies = [
19
19
  "httpx>=0.27,<1.0",
20
20
  "python-dotenv>=1.0,<2.0",
21
21
  "mcp[cli]>=1.28,<2.0",
22
- "vmware-policy>=1.23.0,<2.0",
22
+ "vmware-policy>=1.23.1,<2.0",
23
23
  # Read-only cluster-health triage (summary + HTML snapshot) is owned by
24
24
  # vmware-monitor; AIops delegates to it so a conversation with the AIops
25
25
  # entry point can produce the same report without duplicating the code.
@@ -7,12 +7,12 @@
7
7
  "url": "https://github.com/vmware-skills/VMware-AIops",
8
8
  "source": "github"
9
9
  },
10
- "version": "2.3.1",
10
+ "version": "2.4.0",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "pypi",
14
14
  "identifier": "vmware-aiops",
15
- "version": "2.3.1",
15
+ "version": "2.4.0",
16
16
  "runtimeHint": "uvx",
17
17
  "packageArguments": [
18
18
  {
@@ -63,7 +63,7 @@ Read before connecting an agent. Per-tool inventory: `references/capabilities.md
63
63
  ## Quick Install
64
64
 
65
65
  ```bash
66
- uv tool install vmware-aiops==2.3.1
66
+ uv tool install vmware-aiops==2.4.0
67
67
  vmware-aiops doctor
68
68
  vmware-aiops hub status # see which family members are installed
69
69
  ```
@@ -303,7 +303,7 @@ The account has no vSphere role. Assign one (Read-Only or higher) on the vCenter
303
303
  ## Setup
304
304
 
305
305
  ```bash
306
- uv tool install vmware-aiops==2.3.1
306
+ uv tool install vmware-aiops==2.4.0
307
307
  mkdir -p ~/.vmware-aiops
308
308
  vmware-aiops init # generates config.yaml and .env templates
309
309
  chmod 600 ~/.vmware-aiops/.env
@@ -6,13 +6,13 @@ All install methods fetch from the same source: [github.com/vmware-skills/VMware
6
6
 
7
7
  ```bash
8
8
  # Via PyPI (recommended for version pinning)
9
- uv tool install vmware-aiops==2.3.1
9
+ uv tool install vmware-aiops==2.4.0
10
10
 
11
11
  # Via Skills.sh (fetches from GitHub)
12
- npx skills add vmware-skills/VMware-AIops#v2.3.1
12
+ npx skills add vmware-skills/VMware-AIops#v2.4.0
13
13
 
14
14
  # Via ClawHub (fetches from ClawHub registry snapshot of GitHub)
15
- clawhub install @zw008/vmware-aiops --version 2.3.1
15
+ clawhub install @zw008/vmware-aiops --version 2.4.0
16
16
  ```
17
17
 
18
18
  ### Claude Code
@@ -35,7 +35,7 @@ claude mcp add vmware-aiops -- vmware-aiops mcp
35
35
 
36
36
  ```bash
37
37
  # 1. Install from PyPI (source: github.com/vmware-skills/VMware-AIops)
38
- uv tool install vmware-aiops==2.3.1
38
+ uv tool install vmware-aiops==2.4.0
39
39
 
40
40
  # 2. Verify installation source
41
41
  vmware-aiops --version # confirms installed version
@@ -73,7 +73,7 @@ The `vmware-aiops` package installs a Python CLI binary and its dependencies (py
73
73
  ## Development Install
74
74
 
75
75
  ```bash
76
- git clone --branch v2.3.1 https://github.com/vmware-skills/VMware-AIops.git
76
+ git clone --branch v2.4.0 https://github.com/vmware-skills/VMware-AIops.git
77
77
  cd VMware-AIops
78
78
  uv venv && source .venv/bin/activate
79
79
  # --no-sources: pyproject's [tool.uv.sources] points vmware-monitor at a sibling
@@ -233,6 +233,9 @@ vmware-aiops mcp --transport https --host 0.0.0.0 --port 8443 \
233
233
  - Correlation: each audit row stores the caller's `traceparent` trace-id, else its `X-Request-ID` /
234
234
  `X-Correlation-ID`. Have the agent platform send one, and `vmware-audit log --correlation-id ID` lists the calls
235
235
  behind one platform request.
236
+ - Tools that read or write files on this server (here: guest file upload/download, OVA and deployment-spec files) never touch its configuration, tokens, audit log or
237
+ TLS key, and over the network they are off unless `VMWARE_MCP_FILE_ROOT` names a directory for them
238
+ (vmware-policy ≥ 1.23.1).
236
239
  - `vmware-audit token list` / `token revoke NAME` manage callers; a revoked token is refused from its next request.
237
240
  Replace a leaked token under a new name.
238
241
  - The server will not start without at least one token, and checks before it binds that unauthenticated requests
@@ -242,4 +245,5 @@ vmware-aiops mcp --transport https --host 0.0.0.0 --port 8443 \
242
245
  - **Everyone who can reach the endpoint acts with this server's account.** Tokens identify callers; they grant
243
246
  nothing on the platform. Run one endpoint per privilege level (for example a read-only account behind
244
247
  `--expose read`, and a separate endpoint for operators).
248
+ - **Several people or roles on one endpoint:** run `vmware-audit roles enable` once, then give each token a role (`vmware-audit token create NAME --role reader`, or a role in `roles.yaml` naming tools and targets; vmware-policy ≥ 1.24.0). A role limits what the token may call on this endpoint; it cannot grant more than the account has. See vmware-policy's README, "Roles for network callers".
245
249
 
@@ -0,0 +1,239 @@
1
+ """Regression: tools could read or write this server's own control files (HLD §18 step 0).
2
+
3
+ Over HTTPS any token holder could call ``download_vm_guest_file(local_path=
4
+ "~/.vmware/mcp-tokens", overwrite=True)`` and replace the token file, or upload
5
+ a skill's ``.env`` into a VM. Every place that opens a caller-supplied host path
6
+ now refuses one that resolves into ``$OPS_HOME`` or a ``~/.vmware-*`` directory,
7
+ before anything is read, written or transferred.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import os
13
+ from pathlib import Path
14
+ from unittest.mock import MagicMock, patch
15
+
16
+ import pytest
17
+ from vmware_policy.hostpaths import HostPathRefusedError
18
+
19
+ from vmware_aiops.ops import guest_ops, ova_deploy, vm_deploy
20
+
21
+
22
+ @pytest.fixture
23
+ def ops_home() -> Path:
24
+ home = Path(os.environ["OPS_HOME"]) # the sandbox conftest set
25
+ home.mkdir(parents=True, exist_ok=True)
26
+ tokens = home / "mcp-tokens"
27
+ tokens.write_text("alice:abc\n", encoding="utf-8")
28
+ return home
29
+
30
+
31
+ def test_download_cannot_overwrite_the_token_file(ops_home):
32
+ si = MagicMock()
33
+ with pytest.raises(HostPathRefusedError):
34
+ guest_ops.guest_download(
35
+ si, "vm1", "/etc/hosts", str(ops_home / "mcp-tokens"), "u", "p", overwrite=True
36
+ )
37
+ assert (ops_home / "mcp-tokens").read_text(encoding="utf-8") == "alice:abc\n"
38
+ si.RetrieveContent.assert_not_called()
39
+
40
+
41
+ def test_upload_cannot_send_a_control_file_into_a_vm(ops_home):
42
+ si = MagicMock()
43
+ with patch.object(guest_ops, "_require_vm_with_tools", return_value=MagicMock()), \
44
+ patch("urllib.request.urlopen") as urlopen:
45
+ with pytest.raises(HostPathRefusedError):
46
+ guest_ops.guest_upload(
47
+ si, "vm1", str(ops_home / "mcp-tokens"), "/tmp/x", "u", "p"
48
+ )
49
+ urlopen.assert_not_called()
50
+ fm = si.RetrieveContent.return_value.guestOperationsManager.fileManager
51
+ fm.InitiateFileTransferToGuest.assert_not_called()
52
+
53
+
54
+ def test_a_deploy_spec_inside_ops_home_is_not_read(ops_home):
55
+ with pytest.raises(HostPathRefusedError):
56
+ vm_deploy.load_deploy_spec(str(ops_home / "rules.yaml"))
57
+
58
+
59
+ def test_an_ova_inside_ops_home_is_not_read(ops_home):
60
+ with pytest.raises(HostPathRefusedError):
61
+ ova_deploy._read_ovf_from_ova(str(ops_home / "audit.db"))
62
+
63
+
64
+ def test_the_mcp_tool_refuses_before_running(ops_home):
65
+ from vmware_aiops.mcp_server.tools import guest as guest_tools
66
+
67
+ with patch.object(guest_tools, "_get_connection") as connect:
68
+ with pytest.raises(HostPathRefusedError):
69
+ guest_tools.download_vm_guest_file(
70
+ vm_name="vm1",
71
+ guest_path="/etc/hosts",
72
+ local_path=str(ops_home / "mcp-tokens"),
73
+ username="u",
74
+ password="p",
75
+ overwrite=True,
76
+ )
77
+ connect.assert_not_called()
78
+
79
+
80
+ def test_ordinary_paths_still_work(tmp_path):
81
+ spec = tmp_path / "spec.yaml"
82
+ spec.write_text("vms: []\n", encoding="utf-8")
83
+ assert vm_deploy.load_deploy_spec(str(spec)) is not None
84
+
85
+
86
+ # ── review 2026-10-16: hard links, symlink swapped in after the check, preview ──
87
+
88
+
89
+ def _download_with_fake_transfer(local: str, overwrite: bool, before_write=None):
90
+ """Run guest_download with the guest transfer faked; call before_write after the check."""
91
+ si = MagicMock()
92
+ vm = MagicMock()
93
+ resp = MagicMock()
94
+ resp.__enter__.return_value.read.return_value = b"payload"
95
+
96
+ def urlopen(*a, **k):
97
+ if before_write:
98
+ before_write()
99
+ return resp
100
+
101
+ with patch.object(guest_ops, "_require_vm_with_tools", return_value=vm), \
102
+ patch("urllib.request.urlopen", side_effect=urlopen), \
103
+ patch.object(guest_ops, "get_verify_ssl", return_value=True):
104
+ return guest_ops.guest_download(
105
+ si, "vm1", "/etc/motd", local, "u", "p", overwrite=overwrite
106
+ )
107
+
108
+
109
+ def test_a_hard_link_to_a_protected_file_is_not_written_through(ops_home, tmp_path):
110
+ outside = tmp_path / "innocent.txt"
111
+ os.link(ops_home / "mcp-tokens", outside)
112
+ with pytest.raises(ValueError, match="hard link"):
113
+ _download_with_fake_transfer(str(outside), overwrite=True)
114
+ assert (ops_home / "mcp-tokens").read_text(encoding="utf-8") == "alice:abc\n"
115
+
116
+
117
+ def test_a_symlink_swapped_in_during_the_transfer_is_not_followed(ops_home, tmp_path):
118
+ dest = tmp_path / "out.txt"
119
+
120
+ def swap():
121
+ dest.symlink_to(ops_home / "mcp-tokens")
122
+
123
+ with pytest.raises((HostPathRefusedError, OSError)):
124
+ _download_with_fake_transfer(str(dest), overwrite=True, before_write=swap)
125
+ assert (ops_home / "mcp-tokens").read_text(encoding="utf-8") == "alice:abc\n"
126
+
127
+
128
+ def test_an_ordinary_download_is_written(tmp_path):
129
+ dest = tmp_path / "out.txt"
130
+ _download_with_fake_transfer(str(dest), overwrite=False)
131
+ assert dest.read_bytes() == b"payload"
132
+
133
+
134
+ def test_the_provision_preview_does_not_reveal_a_protected_file(ops_home):
135
+ from vmware_aiops.ops import guest_gate
136
+
137
+ info, blocker = guest_gate._local_file(str(ops_home / "mcp-tokens"))
138
+ assert info["local_size_bytes"] is None
139
+ assert blocker and "configuration, tokens and audit log" in blocker
140
+
141
+
142
+ def test_a_parent_dir_swapped_for_a_link_during_the_transfer_is_caught(ops_home, tmp_path):
143
+ # O_NOFOLLOW guards only the last component; the re-check after the transfer
144
+ # catches a parent directory replaced by a link into OPS_HOME.
145
+ sub = tmp_path / "sub"
146
+ sub.mkdir()
147
+
148
+ def swap():
149
+ sub.rmdir()
150
+ sub.symlink_to(ops_home, target_is_directory=True)
151
+
152
+ with pytest.raises(HostPathRefusedError):
153
+ _download_with_fake_transfer(str(sub / "rules.yaml"), overwrite=False, before_write=swap)
154
+ assert not (ops_home / "rules.yaml").exists()
155
+
156
+
157
+ # ── second review 2026-10-16: plan_id was an unchecked host path ──────────────
158
+
159
+
160
+ @pytest.mark.parametrize(
161
+ "bad",
162
+ ["/tmp/evil", "../../.cursor/mcp", "plan-x/../../evil", "plan-..", "", "plan-a.b", "x" * 300],
163
+ )
164
+ def test_a_plan_id_cannot_name_a_path(bad, tmp_path, monkeypatch):
165
+ from vmware_aiops.ops import planner
166
+
167
+ monkeypatch.setattr(planner, "_PLANS_DIR", tmp_path / "plans")
168
+ with pytest.raises(ValueError, match="plan id"):
169
+ planner.load_plan(bad)
170
+ with pytest.raises(ValueError, match="plan id"):
171
+ planner.delete_plan(bad)
172
+ with pytest.raises(ValueError, match="plan id"):
173
+ planner.save_plan({"plan_id": bad, "steps": []})
174
+
175
+
176
+ def test_a_plan_file_naming_another_plan_id_is_refused(tmp_path, monkeypatch):
177
+ import json
178
+
179
+ from vmware_aiops.ops import planner
180
+
181
+ plans = tmp_path / "plans"
182
+ plans.mkdir()
183
+ monkeypatch.setattr(planner, "_PLANS_DIR", plans)
184
+ (plans / "plan-20261016-000000-abcd.json").write_text(
185
+ json.dumps({"plan_id": "../../.cursor/mcp", "steps": []}), encoding="utf-8"
186
+ )
187
+ with pytest.raises(ValueError, match="plan id"):
188
+ planner.load_plan("plan-20261016-000000-abcd")
189
+
190
+
191
+ def test_a_generated_plan_id_round_trips(tmp_path, monkeypatch):
192
+ from vmware_aiops.ops import planner
193
+
194
+ monkeypatch.setattr(planner, "_PLANS_DIR", tmp_path / "plans")
195
+ (tmp_path / "plans").mkdir()
196
+ pid = planner._generate_plan_id()
197
+ planner.save_plan({"plan_id": pid, "steps": []})
198
+ assert planner.load_plan(pid)["plan_id"] == pid
199
+ planner.delete_plan(pid)
200
+ assert planner.load_plan(pid) is None
201
+
202
+
203
+ def test_download_onto_a_fifo_does_not_hang(tmp_path):
204
+ fifo = tmp_path / "pipe"
205
+ os.mkfifo(fifo)
206
+ with pytest.raises((ValueError, OSError)):
207
+ _download_with_fake_transfer(str(fifo), overwrite=True)
208
+
209
+
210
+ def test_upload_reads_a_regular_file_without_following_a_swapped_link(ops_home, tmp_path):
211
+ src = tmp_path / "src.txt"
212
+ src.write_text("data", encoding="utf-8")
213
+ assert guest_ops._read_upload_source(src) == b"data"
214
+ link = tmp_path / "link.txt"
215
+ link.symlink_to(ops_home / "mcp-tokens")
216
+ with pytest.raises(OSError):
217
+ guest_ops._read_upload_source(link)
218
+
219
+
220
+ def test_upload_source_swapped_for_a_fifo_is_refused_not_hung(tmp_path):
221
+ fifo = tmp_path / "pipe"
222
+ os.mkfifo(fifo)
223
+ with pytest.raises(ValueError, match="regular file"):
224
+ guest_ops._read_upload_source(fifo)
225
+
226
+
227
+ def test_a_plan_id_with_a_trailing_newline_is_refused(tmp_path, monkeypatch):
228
+ from vmware_aiops.ops import planner
229
+
230
+ monkeypatch.setattr(planner, "_PLANS_DIR", tmp_path / "plans")
231
+ with pytest.raises(ValueError, match="plan id"):
232
+ planner.load_plan("plan-abc\n")
233
+
234
+
235
+ def test_an_upload_source_that_is_a_hard_link_is_refused(ops_home, tmp_path):
236
+ link = tmp_path / "innocent.txt"
237
+ os.link(ops_home / "mcp-tokens", link)
238
+ with pytest.raises(ValueError, match="hard link"):
239
+ guest_ops._read_upload_source(link)
@@ -37,7 +37,9 @@ GATED = ("run_vm_guest_command", "run_vm_guest_command_with_output", "upload_vm_
37
37
 
38
38
  @pytest.fixture(autouse=True)
39
39
  def harness(tmp_path, monkeypatch):
40
- monkeypatch.setenv("OPS_HOME", str(tmp_path))
40
+ # OPS_HOME in its own subdirectory: the files these tests upload live in
41
+ # tmp_path, and a file inside OPS_HOME is refused (HLD §18 step 0).
42
+ monkeypatch.setenv("OPS_HOME", str(tmp_path / "ops"))
41
43
  reset_policy_engine()
42
44
  reset_budget()
43
45
  reset_undo_store()
@@ -0,0 +1,117 @@
1
+ """HLD §18 D-22: the role metadata this skill declares matches its real code."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import asyncio
6
+
7
+ import pytest
8
+
9
+ from vmware_aiops import policy_roles
10
+ from vmware_aiops.ops.plan_executor import dispatch_actions
11
+ from vmware_aiops.ops.plan_gate import REFUSED_ACTIONS
12
+
13
+
14
+ def _registry() -> set[str]:
15
+ from vmware_aiops.mcp_server.server import mcp
16
+
17
+ return {t.name for t in asyncio.run(mcp.list_tools())}
18
+
19
+
20
+ @pytest.mark.unit
21
+ def test_every_plan_action_is_mapped_or_refused():
22
+ """A new plan action must name the tool it amounts to, or a role could reach it unlisted."""
23
+ missing = dispatch_actions() - set(policy_roles.ACTION_TOOLS) - set(REFUSED_ACTIONS)
24
+ assert not missing, f"map these plan actions in policy_roles.ACTION_TOOLS: {sorted(missing)}"
25
+
26
+
27
+ @pytest.mark.unit
28
+ def test_every_declared_name_is_a_real_tool():
29
+ tools = _registry()
30
+ named = set(policy_roles.ESCAPES) | set(policy_roles.REACHES)
31
+ for reached in policy_roles.REACHES.values():
32
+ named |= reached
33
+ named |= set(policy_roles.ACTION_TOOLS.values())
34
+ assert named - tools == set(), sorted(named - tools)
35
+
36
+
37
+ @pytest.mark.unit
38
+ def test_plans_reach_delete_through_rollback():
39
+ assert "delete_vm" in policy_roles.REACHES["apply_vm_plan"]
40
+ assert "delete_vm" in policy_roles.REACHES["set_vm_ttl"]
41
+
42
+
43
+ @pytest.mark.unit
44
+ def test_metadata_is_declared_when_policy_has_roles():
45
+ roles = pytest.importorskip("vmware_policy.roles")
46
+ meta = roles.metadata("aiops")
47
+ assert meta is not None and meta.version == 1
48
+ assert meta.reaches["apply_vm_plan"] == policy_roles.REACHES["apply_vm_plan"]
49
+ assert "run_vm_guest_command" in meta.escapes
50
+
51
+
52
+ #: ops function a batch calls → the tool that does the same thing alone.
53
+ _OPS_TOOL = {
54
+ "clone_vm": "clone_vm",
55
+ "reconfigure_vm": "reconfigure_vm",
56
+ "create_snapshot": "create_vm_snapshot",
57
+ "power_on_vm": "power_on_vm",
58
+ "attach_iso": "attach_iso_to_vm",
59
+ "linked_clone": "deploy_linked_clone",
60
+ "deploy_from_template": "deploy_vm_from_template",
61
+ "deploy_ova": "deploy_vm_from_ova",
62
+ "create_vm": "create_vm",
63
+ }
64
+
65
+ #: batch tool → its ops function in vmware_aiops/ops/vm_deploy.py
66
+ _BATCH_OPS = {
67
+ "batch_clone_vms": "batch_clone",
68
+ "batch_linked_clone_vms": "batch_linked_clone",
69
+ "batch_deploy_from_spec": "batch_deploy",
70
+ }
71
+
72
+
73
+ def _calls_in(func_name: str) -> set[str]:
74
+ import ast
75
+ import inspect
76
+
77
+ from vmware_aiops.ops import vm_deploy
78
+
79
+ tree = ast.parse(inspect.getsource(getattr(vm_deploy, func_name)))
80
+ return {
81
+ n.func.id if isinstance(n.func, ast.Name) else n.func.attr
82
+ for n in ast.walk(tree)
83
+ if isinstance(n, ast.Call) and isinstance(n.func, (ast.Name, ast.Attribute))
84
+ }
85
+
86
+
87
+ @pytest.mark.unit
88
+ @pytest.mark.parametrize("tool", sorted(_BATCH_OPS))
89
+ def test_batch_reach_covers_every_step_it_runs(tool):
90
+ """Review M1: a batch that also reconfigures/snapshots/powers on reaches those tools."""
91
+ called = _calls_in(_BATCH_OPS[tool])
92
+ reached = {_OPS_TOOL[c] for c in called if c in _OPS_TOOL}
93
+ assert reached, f"{_BATCH_OPS[tool]} calls none of the known ops; update _OPS_TOOL"
94
+ assert reached <= policy_roles.REACHES[tool], sorted(reached - policy_roles.REACHES[tool])
95
+
96
+
97
+ @pytest.mark.unit
98
+ def test_the_resolver_uses_the_config_the_connection_manager_holds(monkeypatch):
99
+ """Review H1/H-1: once the server's connection manager exists, a config edit must
100
+ not move the role check off the config it connects with; before, read the file."""
101
+ import importlib
102
+ import types
103
+
104
+ from vmware_aiops import policy_roles as pr
105
+
106
+ server = importlib.import_module("vmware_aiops.mcp_server._shared")
107
+ assert hasattr(server, "_conn_mgr"), "policy_roles looks up a global the server does not have"
108
+ edited, loads = object(), []
109
+ monkeypatch.setattr(pr, "load_config", lambda: loads.append(1) or edited)
110
+
111
+ monkeypatch.setattr(server, "_conn_mgr", None)
112
+ assert pr._connection_config() is edited and pr._connection_config() is edited
113
+ assert len(loads) == 2 # no manager yet: the file as it is now, every time
114
+
115
+ held = object()
116
+ monkeypatch.setattr(server, "_conn_mgr", types.SimpleNamespace(_config=held))
117
+ assert pr._connection_config() is held # the manager's copy, not the edited file
@@ -1195,7 +1195,7 @@ wheels = [
1195
1195
 
1196
1196
  [[package]]
1197
1197
  name = "vmware-aiops"
1198
- version = "2.3.1"
1198
+ version = "2.4.0"
1199
1199
  source = { editable = "." }
1200
1200
  dependencies = [
1201
1201
  { name = "apscheduler" },
@@ -1228,7 +1228,7 @@ requires-dist = [
1228
1228
  { name = "rich", specifier = ">=13.0,<16.0" },
1229
1229
  { name = "typer", specifier = ">=0.12,<1.0" },
1230
1230
  { name = "vmware-monitor", editable = "../VMware-Monitor" },
1231
- { name = "vmware-policy", specifier = ">=1.23.0,<2.0" },
1231
+ { name = "vmware-policy", specifier = ">=1.23.1,<2.0" },
1232
1232
  ]
1233
1233
 
1234
1234
  [package.metadata.requires-dev]
@@ -1240,7 +1240,7 @@ dev = [
1240
1240
 
1241
1241
  [[package]]
1242
1242
  name = "vmware-monitor"
1243
- version = "2.3.1"
1243
+ version = "2.4.0"
1244
1244
  source = { editable = "../VMware-Monitor" }
1245
1245
  dependencies = [
1246
1246
  { name = "apscheduler" },
@@ -1276,14 +1276,14 @@ dev = [
1276
1276
 
1277
1277
  [[package]]
1278
1278
  name = "vmware-policy"
1279
- version = "1.23.0"
1279
+ version = "1.24.0"
1280
1280
  source = { registry = "https://pypi.org/simple" }
1281
1281
  dependencies = [
1282
1282
  { name = "pyyaml" },
1283
1283
  { name = "rich" },
1284
1284
  { name = "typer" },
1285
1285
  ]
1286
- sdist = { url = "https://files.pythonhosted.org/packages/1b/ef/2c56cc93e0744d7e68b75f7a288f580215865b4685a07b9d58e49773819b/vmware_policy-1.23.0.tar.gz", hash = "sha256:70a682fa44e36fadee7ca09c7c5411fff51c9e25ad9d638f9877737361e2ae31", size = 325401, upload-time = "2026-10-16T00:10:32.297Z" }
1286
+ sdist = { url = "https://files.pythonhosted.org/packages/4a/62/3a3cb83af77e3dd3c8fc92cb3b7968bfda04a2f71bf0d6f9b72ee3198441/vmware_policy-1.24.0.tar.gz", hash = "sha256:fba12732ccbd4371232c15d9fd014f9f5d697497210aedff2515d1d205ed3577", size = 361302, upload-time = "2026-10-16T07:18:28.317Z" }
1287
1287
  wheels = [
1288
- { url = "https://files.pythonhosted.org/packages/e3/ca/bdfc9e50cedf6684ed7d34348177f7688323617ce26d492f55b3d80cd45c/vmware_policy-1.23.0-py3-none-any.whl", hash = "sha256:2f35a97f7d0997dd49ab5a0d8d0fd5f4eae11ef66ca8ed26bc9e4b395cb0d45c", size = 110836, upload-time = "2026-10-16T00:10:30.55Z" },
1288
+ { url = "https://files.pythonhosted.org/packages/3d/f2/fe3d9d384712023916e2cacddc385f14b095509c5e00aea417d1a9550e98/vmware_policy-1.24.0-py3-none-any.whl", hash = "sha256:cf615d0256134f01fb84c39b083649281a66d2c064c2eaa28786a0fa95ec6e58", size = 131460, upload-time = "2026-10-16T07:18:26.907Z" },
1289
1289
  ]
@@ -1,3 +1,3 @@
1
1
  """VMware AIops - AI-powered vCenter/ESXi monitoring and operations."""
2
2
 
3
- __version__ = "2.3.1"
3
+ __version__ = "2.4.0"