Class HealerService
java.lang.Object
com.shaft.mcp.HealerService
MCP healer loop for guarded SHAFT/Selenium reruns and review-only repair suggestions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionrunFailedTest(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, String backend) Reruns a failing SHAFT/Selenium test and returns evidence-backed repair suggestions.verifyFocused(String repositoryRoot, List<String> command, boolean networkValidationApproved) Runs a guarded, tokenized Maven verification command headlessly and returns a bounded pass/fail summary.
-
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; optional backend (web|playwright, defaults to web) selects the generated snippets' engine, absorbing playwright_healer_run_failed_test") 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, @ToolParam(required=false) String backend) Reruns a failing SHAFT/Selenium test and returns evidence-backed repair suggestions.- Parameters:
repositoryRoot- Git/Maven project root inside the MCP workspacetestCommand- tokenized Maven command for the failing testoutputDirectory- healer and Doctor output directory inside the MCP workspacemaxAttempts- maximum rerun attempts, clamped to 1..5includeScreenshots- explicit approval to retain screenshot evidenceincludePageSnapshots- explicit approval to retain page-source evidenceallowedSourcePaths- optional repository-relative source paths approved for provider evidencenetworkValidationApproved- whether Maven may run without offline modeuseConfiguredAi- whether to request configured SHAFT provider snippets in addition to agent handoffallowLocalAi- explicit local provider consent when configured AI is requestedallowRemoteAi- explicit remote provider consent when configured AI is requesteddriverVariableName- Java driver variable name used in snippets- Returns:
- guarded rerun attempts plus review-only remediation
-
verifyFocused
@Tool(name="verify_run_focused", description="runs a guarded, tokenized Maven verification command (compile, test-compile, test, verify, package) headlessly inside the MCP workspace and returns a bounded pass/fail summary; release and deploy goals are rejected") public McpVerificationResult verifyFocused(String repositoryRoot, List<String> command, boolean networkValidationApproved) Runs a guarded, tokenized Maven verification command headlessly and returns a bounded pass/fail summary.Reuses the healer command allowlist: only compile/test-compile/test/verify/package/install goals run, release and deploy goals are rejected, tests are forced headless, and offline mode is added unless network validation is explicitly approved. This lets clients run the coding-partner plan's focused verification command without leaving the MCP session.
- Parameters:
repositoryRoot- Maven project root inside the MCP workspace; blank uses the workspace rootcommand- tokenized Maven verification command, for example ["mvn","-q","test-compile"]networkValidationApproved- whether Maven may resolve dependencies online instead of offline- Returns:
- guarded verification result
-