Class HealerService

java.lang.Object
com.shaft.mcp.HealerService

@Service public class HealerService extends Object
MCP healer loop for guarded SHAFT/Selenium reruns and review-only repair suggestions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the default local MCP healer service.
  • Method Summary

    Modifier and Type
    Method
    Description
    runFailedPlaywrightTest(String repositoryRoot, List<String> testCommand, String outputDirectory, int maxAttempts, boolean includeScreenshots, boolean includePageSnapshots, List<String> allowedSourcePaths, boolean networkValidationApproved, boolean useConfiguredAi, boolean allowLocalAi, boolean allowRemoteAi, String driverVariableName)
    Reruns a failing SHAFT Playwright test and returns evidence-backed repair suggestions.
    runFailedTest(String repositoryRoot, List<String> testCommand, String outputDirectory, int maxAttempts, boolean includeScreenshots, boolean includePageSnapshots, List<String> allowedSourcePaths, boolean networkValidationApproved, boolean useConfiguredAi, boolean allowLocalAi, boolean allowRemoteAi, String driverVariableName)
    Reruns a failing SHAFT/Selenium test and returns evidence-backed repair suggestions.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HealerService

      public HealerService()
      Creates the default local MCP healer service.
  • Method Details

    • runFailedTest

      @Tool(name="healer_run_failed_test", description="reruns a failing SHAFT/Selenium test, analyzes fresh Allure evidence, and returns review-only fixes plus agent replay guidance") public McpHealerRunResult runFailedTest(String repositoryRoot, List<String> testCommand, String outputDirectory, int maxAttempts, boolean includeScreenshots, boolean includePageSnapshots, List<String> allowedSourcePaths, boolean networkValidationApproved, boolean useConfiguredAi, boolean allowLocalAi, boolean allowRemoteAi, String driverVariableName)
      Reruns a failing SHAFT/Selenium test and returns evidence-backed repair suggestions.
      Parameters:
      repositoryRoot - Git/Maven project root inside the MCP workspace
      testCommand - tokenized Maven command for the failing test
      outputDirectory - healer and Doctor output directory inside the MCP workspace
      maxAttempts - maximum rerun attempts, clamped to 1..5
      includeScreenshots - explicit approval to retain screenshot evidence
      includePageSnapshots - explicit approval to retain page-source evidence
      allowedSourcePaths - optional repository-relative source paths approved for provider evidence
      networkValidationApproved - whether Maven may run without offline mode
      useConfiguredAi - whether to request configured SHAFT provider snippets in addition to agent handoff
      allowLocalAi - explicit local provider consent when configured AI is requested
      allowRemoteAi - explicit remote provider consent when configured AI is requested
      driverVariableName - Java driver variable name used in snippets
      Returns:
      guarded rerun attempts plus review-only remediation
    • runFailedPlaywrightTest

      @Tool(name="playwright_healer_run_failed_test", description="reruns a failing SHAFT Playwright test, analyzes fresh Allure evidence, and returns review-only fixes plus agent replay guidance") public McpHealerRunResult runFailedPlaywrightTest(String repositoryRoot, List<String> testCommand, String outputDirectory, int maxAttempts, boolean includeScreenshots, boolean includePageSnapshots, List<String> allowedSourcePaths, boolean networkValidationApproved, boolean useConfiguredAi, boolean allowLocalAi, boolean allowRemoteAi, String driverVariableName)
      Reruns a failing SHAFT Playwright test and returns evidence-backed repair suggestions.
      Parameters:
      repositoryRoot - Git/Maven project root inside the MCP workspace
      testCommand - tokenized Maven command for the failing test
      outputDirectory - healer and Doctor output directory inside the MCP workspace
      maxAttempts - maximum rerun attempts, clamped to 1..5
      includeScreenshots - explicit approval to retain screenshot evidence
      includePageSnapshots - explicit approval to retain page-source evidence
      allowedSourcePaths - optional repository-relative source paths approved for provider evidence
      networkValidationApproved - whether Maven may run without offline mode
      useConfiguredAi - whether to request configured SHAFT provider snippets in addition to agent handoff
      allowLocalAi - explicit local provider consent when configured AI is requested
      allowRemoteAi - explicit remote provider consent when configured AI is requested
      driverVariableName - Java driver variable name used in snippets
      Returns:
      guarded rerun attempts plus review-only remediation