@yasserkhanorg/impact-gate 2.0.0
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.
- package/LICENSE +168 -0
- package/README.md +520 -0
- package/dist/adapters/cypress.d.ts +10 -0
- package/dist/adapters/cypress.d.ts.map +1 -0
- package/dist/adapters/cypress.js +86 -0
- package/dist/adapters/framework_adapter.d.ts +41 -0
- package/dist/adapters/framework_adapter.d.ts.map +1 -0
- package/dist/adapters/framework_adapter.js +152 -0
- package/dist/adapters/playwright.d.ts +10 -0
- package/dist/adapters/playwright.d.ts.map +1 -0
- package/dist/adapters/playwright.js +86 -0
- package/dist/adapters/pytest.d.ts +10 -0
- package/dist/adapters/pytest.d.ts.map +1 -0
- package/dist/adapters/pytest.js +96 -0
- package/dist/adapters/supertest.d.ts +12 -0
- package/dist/adapters/supertest.d.ts.map +1 -0
- package/dist/adapters/supertest.js +85 -0
- package/dist/agent/api_catalog.d.ts +11 -0
- package/dist/agent/api_catalog.d.ts.map +1 -0
- package/dist/agent/api_catalog.js +210 -0
- package/dist/agent/config.d.ts +193 -0
- package/dist/agent/config.d.ts.map +1 -0
- package/dist/agent/config.js +875 -0
- package/dist/agent/feedback.d.ts +91 -0
- package/dist/agent/feedback.d.ts.map +1 -0
- package/dist/agent/feedback.js +323 -0
- package/dist/agent/git.d.ts +19 -0
- package/dist/agent/git.d.ts.map +1 -0
- package/dist/agent/git.js +257 -0
- package/dist/agent/handoff.d.ts +22 -0
- package/dist/agent/handoff.d.ts.map +1 -0
- package/dist/agent/handoff.js +180 -0
- package/dist/agent/llm_agents_flow.d.ts +15 -0
- package/dist/agent/llm_agents_flow.d.ts.map +1 -0
- package/dist/agent/llm_agents_flow.js +434 -0
- package/dist/agent/native_flow.d.ts +6 -0
- package/dist/agent/native_flow.d.ts.map +1 -0
- package/dist/agent/native_flow.js +179 -0
- package/dist/agent/pipeline.d.ts +7 -0
- package/dist/agent/pipeline.d.ts.map +1 -0
- package/dist/agent/pipeline.js +260 -0
- package/dist/agent/pipeline_types.d.ts +54 -0
- package/dist/agent/pipeline_types.d.ts.map +1 -0
- package/dist/agent/pipeline_types.js +4 -0
- package/dist/agent/pipeline_utils.d.ts +12 -0
- package/dist/agent/pipeline_utils.d.ts.map +1 -0
- package/dist/agent/pipeline_utils.js +156 -0
- package/dist/agent/plan.d.ts +170 -0
- package/dist/agent/plan.d.ts.map +1 -0
- package/dist/agent/plan.js +86 -0
- package/dist/agent/playwright_report.d.ts +8 -0
- package/dist/agent/playwright_report.d.ts.map +1 -0
- package/dist/agent/playwright_report.js +126 -0
- package/dist/agent/process_runner.d.ts +10 -0
- package/dist/agent/process_runner.d.ts.map +1 -0
- package/dist/agent/process_runner.js +92 -0
- package/dist/agent/spec_generator.d.ts +5 -0
- package/dist/agent/spec_generator.d.ts.map +1 -0
- package/dist/agent/spec_generator.js +253 -0
- package/dist/agent/test_path.d.ts +2 -0
- package/dist/agent/test_path.d.ts.map +1 -0
- package/dist/agent/test_path.js +23 -0
- package/dist/agent/traceability_capture.d.ts +18 -0
- package/dist/agent/traceability_capture.d.ts.map +1 -0
- package/dist/agent/traceability_capture.js +313 -0
- package/dist/agent/traceability_ingest.d.ts +21 -0
- package/dist/agent/traceability_ingest.d.ts.map +1 -0
- package/dist/agent/traceability_ingest.js +237 -0
- package/dist/agent/types.d.ts +42 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +4 -0
- package/dist/agent/utils.d.ts +13 -0
- package/dist/agent/utils.d.ts.map +1 -0
- package/dist/agent/utils.js +152 -0
- package/dist/agent/validation_runner.d.ts +5 -0
- package/dist/agent/validation_runner.d.ts.map +1 -0
- package/dist/agent/validation_runner.js +77 -0
- package/dist/agentic/fix_loop.d.ts +26 -0
- package/dist/agentic/fix_loop.d.ts.map +1 -0
- package/dist/agentic/fix_loop.js +96 -0
- package/dist/agentic/playwright_runner.d.ts +43 -0
- package/dist/agentic/playwright_runner.d.ts.map +1 -0
- package/dist/agentic/playwright_runner.js +165 -0
- package/dist/agentic/runner.d.ts +27 -0
- package/dist/agentic/runner.d.ts.map +1 -0
- package/dist/agentic/runner.js +210 -0
- package/dist/agentic/types.d.ts +62 -0
- package/dist/agentic/types.d.ts.map +1 -0
- package/dist/agentic/types.js +4 -0
- package/dist/agents/coverage-evaluator.d.ts +8 -0
- package/dist/agents/coverage-evaluator.d.ts.map +1 -0
- package/dist/agents/coverage-evaluator.js +41 -0
- package/dist/agents/cross-impact.d.ts +13 -0
- package/dist/agents/cross-impact.d.ts.map +1 -0
- package/dist/agents/cross-impact.js +140 -0
- package/dist/agents/executor.d.ts +8 -0
- package/dist/agents/executor.d.ts.map +1 -0
- package/dist/agents/executor.js +75 -0
- package/dist/agents/explorer.d.ts +12 -0
- package/dist/agents/explorer.d.ts.map +1 -0
- package/dist/agents/explorer.js +43 -0
- package/dist/agents/generator.d.ts +8 -0
- package/dist/agents/generator.d.ts.map +1 -0
- package/dist/agents/generator.js +77 -0
- package/dist/agents/healer.d.ts +8 -0
- package/dist/agents/healer.d.ts.map +1 -0
- package/dist/agents/healer.js +31 -0
- package/dist/agents/impact-analyst.d.ts +8 -0
- package/dist/agents/impact-analyst.d.ts.map +1 -0
- package/dist/agents/impact-analyst.js +38 -0
- package/dist/agents/regression-advisor.d.ts +8 -0
- package/dist/agents/regression-advisor.d.ts.map +1 -0
- package/dist/agents/regression-advisor.js +116 -0
- package/dist/agents/strategist.d.ts +9 -0
- package/dist/agents/strategist.d.ts.map +1 -0
- package/dist/agents/strategist.js +92 -0
- package/dist/agents/test-designer.d.ts +8 -0
- package/dist/agents/test-designer.d.ts.map +1 -0
- package/dist/agents/test-designer.js +111 -0
- package/dist/anthropic_provider.d.ts +65 -0
- package/dist/anthropic_provider.d.ts.map +1 -0
- package/dist/anthropic_provider.js +334 -0
- package/dist/api.d.ts +48 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +151 -0
- package/dist/base_provider.d.ts +109 -0
- package/dist/base_provider.d.ts.map +1 -0
- package/dist/base_provider.js +203 -0
- package/dist/budget_ledger.d.ts +28 -0
- package/dist/budget_ledger.d.ts.map +1 -0
- package/dist/budget_ledger.js +62 -0
- package/dist/cache/cached_provider.d.ts +49 -0
- package/dist/cache/cached_provider.d.ts.map +1 -0
- package/dist/cache/cached_provider.js +91 -0
- package/dist/cache/response_cache.d.ts +79 -0
- package/dist/cache/response_cache.d.ts.map +1 -0
- package/dist/cache/response_cache.js +177 -0
- package/dist/cli/commands/analyze.d.ts +3 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +77 -0
- package/dist/cli/commands/bootstrap.d.ts +3 -0
- package/dist/cli/commands/bootstrap.d.ts.map +1 -0
- package/dist/cli/commands/bootstrap.js +109 -0
- package/dist/cli/commands/cost_report.d.ts +3 -0
- package/dist/cli/commands/cost_report.d.ts.map +1 -0
- package/dist/cli/commands/cost_report.js +115 -0
- package/dist/cli/commands/crew.d.ts +3 -0
- package/dist/cli/commands/crew.d.ts.map +1 -0
- package/dist/cli/commands/crew.js +255 -0
- package/dist/cli/commands/feedback.d.ts +3 -0
- package/dist/cli/commands/feedback.d.ts.map +1 -0
- package/dist/cli/commands/feedback.js +39 -0
- package/dist/cli/commands/finalize.d.ts +3 -0
- package/dist/cli/commands/finalize.d.ts.map +1 -0
- package/dist/cli/commands/finalize.js +41 -0
- package/dist/cli/commands/gate.d.ts +3 -0
- package/dist/cli/commands/gate.d.ts.map +1 -0
- package/dist/cli/commands/gate.js +89 -0
- package/dist/cli/commands/generate.d.ts +4 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +108 -0
- package/dist/cli/commands/heal.d.ts +3 -0
- package/dist/cli/commands/heal.d.ts.map +1 -0
- package/dist/cli/commands/heal.js +60 -0
- package/dist/cli/commands/impact.d.ts +4 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +33 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +169 -0
- package/dist/cli/commands/llm_health.d.ts +2 -0
- package/dist/cli/commands/llm_health.d.ts.map +1 -0
- package/dist/cli/commands/llm_health.js +22 -0
- package/dist/cli/commands/plan.d.ts +4 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +120 -0
- package/dist/cli/commands/plan_crew.d.ts +17 -0
- package/dist/cli/commands/plan_crew.d.ts.map +1 -0
- package/dist/cli/commands/plan_crew.js +316 -0
- package/dist/cli/commands/traceability.d.ts +4 -0
- package/dist/cli/commands/traceability.d.ts.map +1 -0
- package/dist/cli/commands/traceability.js +77 -0
- package/dist/cli/commands/train.d.ts +3 -0
- package/dist/cli/commands/train.d.ts.map +1 -0
- package/dist/cli/commands/train.js +391 -0
- package/dist/cli/defaults.d.ts +35 -0
- package/dist/cli/defaults.d.ts.map +1 -0
- package/dist/cli/defaults.js +172 -0
- package/dist/cli/errors.d.ts +27 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +57 -0
- package/dist/cli/parse_args.d.ts +6 -0
- package/dist/cli/parse_args.d.ts.map +1 -0
- package/dist/cli/parse_args.js +257 -0
- package/dist/cli/types.d.ts +87 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +4 -0
- package/dist/cli/usage.d.ts +2 -0
- package/dist/cli/usage.d.ts.map +1 -0
- package/dist/cli/usage.js +109 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +194 -0
- package/dist/crew/context.d.ts +55 -0
- package/dist/crew/context.d.ts.map +1 -0
- package/dist/crew/context.js +36 -0
- package/dist/crew/orchestrator.d.ts +50 -0
- package/dist/crew/orchestrator.d.ts.map +1 -0
- package/dist/crew/orchestrator.js +329 -0
- package/dist/crew/protocol.d.ts +46 -0
- package/dist/crew/protocol.d.ts.map +1 -0
- package/dist/crew/protocol.js +4 -0
- package/dist/crew/provider.d.ts +17 -0
- package/dist/crew/provider.d.ts.map +1 -0
- package/dist/crew/provider.js +36 -0
- package/dist/crew/sanitize.d.ts +3 -0
- package/dist/crew/sanitize.d.ts.map +1 -0
- package/dist/crew/sanitize.js +31 -0
- package/dist/crew/types.d.ts +52 -0
- package/dist/crew/types.d.ts.map +1 -0
- package/dist/crew/types.js +4 -0
- package/dist/crew/workflows.d.ts +52 -0
- package/dist/crew/workflows.d.ts.map +1 -0
- package/dist/crew/workflows.js +36 -0
- package/dist/custom_provider.d.ts +20 -0
- package/dist/custom_provider.d.ts.map +1 -0
- package/dist/custom_provider.js +277 -0
- package/dist/engine/ai_enrichment.d.ts +44 -0
- package/dist/engine/ai_enrichment.d.ts.map +1 -0
- package/dist/engine/ai_enrichment.js +267 -0
- package/dist/engine/diff_loader.d.ts +11 -0
- package/dist/engine/diff_loader.d.ts.map +1 -0
- package/dist/engine/diff_loader.js +63 -0
- package/dist/engine/impact_engine.d.ts +72 -0
- package/dist/engine/impact_engine.d.ts.map +1 -0
- package/dist/engine/impact_engine.js +298 -0
- package/dist/engine/plan_builder.d.ts +11 -0
- package/dist/engine/plan_builder.d.ts.map +1 -0
- package/dist/engine/plan_builder.js +599 -0
- package/dist/esm/adapters/cypress.js +49 -0
- package/dist/esm/adapters/framework_adapter.js +114 -0
- package/dist/esm/adapters/playwright.js +49 -0
- package/dist/esm/adapters/pytest.js +59 -0
- package/dist/esm/adapters/supertest.js +48 -0
- package/dist/esm/agent/api_catalog.js +199 -0
- package/dist/esm/agent/config.js +872 -0
- package/dist/esm/agent/feedback.js +317 -0
- package/dist/esm/agent/git.js +252 -0
- package/dist/esm/agent/handoff.js +177 -0
- package/dist/esm/agent/llm_agents_flow.js +421 -0
- package/dist/esm/agent/native_flow.js +175 -0
- package/dist/esm/agent/pipeline.js +256 -0
- package/dist/esm/agent/pipeline_types.js +3 -0
- package/dist/esm/agent/pipeline_utils.js +146 -0
- package/dist/esm/agent/plan.js +83 -0
- package/dist/esm/agent/playwright_report.js +123 -0
- package/dist/esm/agent/process_runner.js +83 -0
- package/dist/esm/agent/spec_generator.js +249 -0
- package/dist/esm/agent/test_path.js +20 -0
- package/dist/esm/agent/traceability_capture.js +310 -0
- package/dist/esm/agent/traceability_ingest.js +234 -0
- package/dist/esm/agent/types.js +3 -0
- package/dist/esm/agent/utils.js +138 -0
- package/dist/esm/agent/validation_runner.js +73 -0
- package/dist/esm/agentic/fix_loop.js +91 -0
- package/dist/esm/agentic/playwright_runner.js +161 -0
- package/dist/esm/agentic/runner.js +207 -0
- package/dist/esm/agentic/types.js +3 -0
- package/dist/esm/agents/coverage-evaluator.js +37 -0
- package/dist/esm/agents/cross-impact.js +136 -0
- package/dist/esm/agents/executor.js +71 -0
- package/dist/esm/agents/explorer.js +39 -0
- package/dist/esm/agents/generator.js +73 -0
- package/dist/esm/agents/healer.js +27 -0
- package/dist/esm/agents/impact-analyst.js +34 -0
- package/dist/esm/agents/regression-advisor.js +112 -0
- package/dist/esm/agents/strategist.js +88 -0
- package/dist/esm/agents/test-designer.js +107 -0
- package/dist/esm/anthropic_provider.js +326 -0
- package/dist/esm/api.js +143 -0
- package/dist/esm/base_provider.js +198 -0
- package/dist/esm/budget_ledger.js +58 -0
- package/dist/esm/cache/cached_provider.js +85 -0
- package/dist/esm/cache/response_cache.js +140 -0
- package/dist/esm/cli/commands/analyze.js +74 -0
- package/dist/esm/cli/commands/bootstrap.js +106 -0
- package/dist/esm/cli/commands/cost_report.js +112 -0
- package/dist/esm/cli/commands/crew.js +252 -0
- package/dist/esm/cli/commands/feedback.js +36 -0
- package/dist/esm/cli/commands/finalize.js +38 -0
- package/dist/esm/cli/commands/gate.js +86 -0
- package/dist/esm/cli/commands/generate.js +105 -0
- package/dist/esm/cli/commands/heal.js +57 -0
- package/dist/esm/cli/commands/impact.js +30 -0
- package/dist/esm/cli/commands/init.js +133 -0
- package/dist/esm/cli/commands/llm_health.js +19 -0
- package/dist/esm/cli/commands/plan.js +117 -0
- package/dist/esm/cli/commands/plan_crew.js +309 -0
- package/dist/esm/cli/commands/traceability.js +73 -0
- package/dist/esm/cli/commands/train.js +355 -0
- package/dist/esm/cli/defaults.js +165 -0
- package/dist/esm/cli/errors.js +52 -0
- package/dist/esm/cli/parse_args.js +251 -0
- package/dist/esm/cli/types.js +3 -0
- package/dist/esm/cli/usage.js +106 -0
- package/dist/esm/cli.js +192 -0
- package/dist/esm/crew/context.js +32 -0
- package/dist/esm/crew/orchestrator.js +325 -0
- package/dist/esm/crew/protocol.js +3 -0
- package/dist/esm/crew/provider.js +33 -0
- package/dist/esm/crew/sanitize.js +27 -0
- package/dist/esm/crew/types.js +3 -0
- package/dist/esm/crew/workflows.js +33 -0
- package/dist/esm/custom_provider.js +273 -0
- package/dist/esm/engine/ai_enrichment.js +264 -0
- package/dist/esm/engine/diff_loader.js +59 -0
- package/dist/esm/engine/impact_engine.js +291 -0
- package/dist/esm/engine/plan_builder.js +593 -0
- package/dist/esm/index.js +72 -0
- package/dist/esm/knowledge/api_surface.js +408 -0
- package/dist/esm/knowledge/cluster_utils.js +60 -0
- package/dist/esm/knowledge/context_loader.js +85 -0
- package/dist/esm/knowledge/failure_history.js +121 -0
- package/dist/esm/knowledge/kg_bridge.js +381 -0
- package/dist/esm/knowledge/kg_types.js +3 -0
- package/dist/esm/knowledge/route_families.js +393 -0
- package/dist/esm/knowledge/spec_index.js +122 -0
- package/dist/esm/logger.js +115 -0
- package/dist/esm/mcp-server.js +621 -0
- package/dist/esm/metrics/prometheus.js +149 -0
- package/dist/esm/model_router.js +59 -0
- package/dist/esm/ollama_provider.js +301 -0
- package/dist/esm/openai_provider.js +243 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/pipeline/orchestrator.js +228 -0
- package/dist/esm/pipeline/spec_verifier.js +75 -0
- package/dist/esm/pipeline/stage0_preprocess.js +102 -0
- package/dist/esm/pipeline/stage1_impact.js +140 -0
- package/dist/esm/pipeline/stage2_coverage.js +153 -0
- package/dist/esm/pipeline/stage3_generation.js +284 -0
- package/dist/esm/pipeline/stage4_heal.js +288 -0
- package/dist/esm/progress.js +112 -0
- package/dist/esm/prompts/coverage.js +57 -0
- package/dist/esm/prompts/cross-impact.js +53 -0
- package/dist/esm/prompts/generation.js +297 -0
- package/dist/esm/prompts/generation_profile.js +147 -0
- package/dist/esm/prompts/heal.js +91 -0
- package/dist/esm/prompts/impact.js +63 -0
- package/dist/esm/prompts/json_extract.js +36 -0
- package/dist/esm/prompts/strategist.js +61 -0
- package/dist/esm/prompts/test-designer.js +92 -0
- package/dist/esm/provider_factory.js +366 -0
- package/dist/esm/provider_interface.js +23 -0
- package/dist/esm/provider_utils.js +96 -0
- package/dist/esm/qa-agent/cli.js +205 -0
- package/dist/esm/qa-agent/orchestrator.js +120 -0
- package/dist/esm/qa-agent/phase1/runner.js +139 -0
- package/dist/esm/qa-agent/phase1/scope.js +126 -0
- package/dist/esm/qa-agent/phase2/agent_browser.js +95 -0
- package/dist/esm/qa-agent/phase2/agent_loop.js +351 -0
- package/dist/esm/qa-agent/phase2/exploration_state.js +97 -0
- package/dist/esm/qa-agent/phase2/tools.js +386 -0
- package/dist/esm/qa-agent/phase2/vision.js +75 -0
- package/dist/esm/qa-agent/phase3/feedback.js +34 -0
- package/dist/esm/qa-agent/phase3/reporter.js +145 -0
- package/dist/esm/qa-agent/phase3/spec_generator.js +62 -0
- package/dist/esm/qa-agent/phase3/verdict.js +66 -0
- package/dist/esm/qa-agent/safe_env.js +23 -0
- package/dist/esm/qa-agent/types.js +3 -0
- package/dist/esm/reporters/junit.js +86 -0
- package/dist/esm/reporters/reporter.js +3 -0
- package/dist/esm/reporters/sarif.js +132 -0
- package/dist/esm/resilience/circuit_breaker.js +78 -0
- package/dist/esm/resilience/retry.js +56 -0
- package/dist/esm/sanitize.js +66 -0
- package/dist/esm/training/enricher.js +345 -0
- package/dist/esm/training/kg_scanner.js +115 -0
- package/dist/esm/training/merger.js +204 -0
- package/dist/esm/training/scanner.js +923 -0
- package/dist/esm/training/types.js +6 -0
- package/dist/esm/training/validator.js +254 -0
- package/dist/esm/validation/guardrails.js +101 -0
- package/dist/esm/validation/output_schema.js +80 -0
- package/dist/esm/version.js +33 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +169 -0
- package/dist/knowledge/api_surface.d.ts +37 -0
- package/dist/knowledge/api_surface.d.ts.map +1 -0
- package/dist/knowledge/api_surface.js +418 -0
- package/dist/knowledge/cluster_utils.d.ts +28 -0
- package/dist/knowledge/cluster_utils.d.ts.map +1 -0
- package/dist/knowledge/cluster_utils.js +67 -0
- package/dist/knowledge/context_loader.d.ts +13 -0
- package/dist/knowledge/context_loader.d.ts.map +1 -0
- package/dist/knowledge/context_loader.js +90 -0
- package/dist/knowledge/failure_history.d.ts +39 -0
- package/dist/knowledge/failure_history.d.ts.map +1 -0
- package/dist/knowledge/failure_history.js +128 -0
- package/dist/knowledge/kg_bridge.d.ts +31 -0
- package/dist/knowledge/kg_bridge.d.ts.map +1 -0
- package/dist/knowledge/kg_bridge.js +388 -0
- package/dist/knowledge/kg_types.d.ts +75 -0
- package/dist/knowledge/kg_types.d.ts.map +1 -0
- package/dist/knowledge/kg_types.js +4 -0
- package/dist/knowledge/route_families.d.ts +98 -0
- package/dist/knowledge/route_families.d.ts.map +1 -0
- package/dist/knowledge/route_families.js +410 -0
- package/dist/knowledge/spec_index.d.ts +18 -0
- package/dist/knowledge/spec_index.d.ts.map +1 -0
- package/dist/knowledge/spec_index.js +128 -0
- package/dist/logger.d.ts +31 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +119 -0
- package/dist/mcp-server.d.ts +68 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +629 -0
- package/dist/metrics/prometheus.d.ts +37 -0
- package/dist/metrics/prometheus.d.ts.map +1 -0
- package/dist/metrics/prometheus.js +153 -0
- package/dist/model_router.d.ts +28 -0
- package/dist/model_router.d.ts.map +1 -0
- package/dist/model_router.js +63 -0
- package/dist/ollama_provider.d.ts +65 -0
- package/dist/ollama_provider.d.ts.map +1 -0
- package/dist/ollama_provider.js +309 -0
- package/dist/openai_provider.d.ts +23 -0
- package/dist/openai_provider.d.ts.map +1 -0
- package/dist/openai_provider.js +251 -0
- package/dist/pipeline/orchestrator.d.ts +33 -0
- package/dist/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/pipeline/orchestrator.js +231 -0
- package/dist/pipeline/spec_verifier.d.ts +20 -0
- package/dist/pipeline/spec_verifier.d.ts.map +1 -0
- package/dist/pipeline/spec_verifier.js +79 -0
- package/dist/pipeline/stage0_preprocess.d.ts +31 -0
- package/dist/pipeline/stage0_preprocess.d.ts.map +1 -0
- package/dist/pipeline/stage0_preprocess.js +105 -0
- package/dist/pipeline/stage1_impact.d.ts +19 -0
- package/dist/pipeline/stage1_impact.d.ts.map +1 -0
- package/dist/pipeline/stage1_impact.js +143 -0
- package/dist/pipeline/stage2_coverage.d.ts +19 -0
- package/dist/pipeline/stage2_coverage.d.ts.map +1 -0
- package/dist/pipeline/stage2_coverage.js +156 -0
- package/dist/pipeline/stage3_generation.d.ts +43 -0
- package/dist/pipeline/stage3_generation.d.ts.map +1 -0
- package/dist/pipeline/stage3_generation.js +287 -0
- package/dist/pipeline/stage4_heal.d.ts +62 -0
- package/dist/pipeline/stage4_heal.d.ts.map +1 -0
- package/dist/pipeline/stage4_heal.js +294 -0
- package/dist/progress.d.ts +22 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +116 -0
- package/dist/prompts/coverage.d.ts +39 -0
- package/dist/prompts/coverage.d.ts.map +1 -0
- package/dist/prompts/coverage.js +61 -0
- package/dist/prompts/cross-impact.d.ts +23 -0
- package/dist/prompts/cross-impact.d.ts.map +1 -0
- package/dist/prompts/cross-impact.js +57 -0
- package/dist/prompts/generation.d.ts +25 -0
- package/dist/prompts/generation.d.ts.map +1 -0
- package/dist/prompts/generation.js +302 -0
- package/dist/prompts/generation_profile.d.ts +29 -0
- package/dist/prompts/generation_profile.d.ts.map +1 -0
- package/dist/prompts/generation_profile.js +151 -0
- package/dist/prompts/heal.d.ts +23 -0
- package/dist/prompts/heal.d.ts.map +1 -0
- package/dist/prompts/heal.js +95 -0
- package/dist/prompts/impact.d.ts +31 -0
- package/dist/prompts/impact.d.ts.map +1 -0
- package/dist/prompts/impact.js +67 -0
- package/dist/prompts/json_extract.d.ts +14 -0
- package/dist/prompts/json_extract.d.ts.map +1 -0
- package/dist/prompts/json_extract.js +39 -0
- package/dist/prompts/strategist.d.ts +25 -0
- package/dist/prompts/strategist.d.ts.map +1 -0
- package/dist/prompts/strategist.js +65 -0
- package/dist/prompts/test-designer.d.ts +35 -0
- package/dist/prompts/test-designer.d.ts.map +1 -0
- package/dist/prompts/test-designer.js +96 -0
- package/dist/provider_factory.d.ts +104 -0
- package/dist/provider_factory.d.ts.map +1 -0
- package/dist/provider_factory.js +371 -0
- package/dist/provider_interface.d.ts +365 -0
- package/dist/provider_interface.d.ts.map +1 -0
- package/dist/provider_interface.js +28 -0
- package/dist/provider_utils.d.ts +39 -0
- package/dist/provider_utils.d.ts.map +1 -0
- package/dist/provider_utils.js +103 -0
- package/dist/qa-agent/cli.d.ts +3 -0
- package/dist/qa-agent/cli.d.ts.map +1 -0
- package/dist/qa-agent/cli.js +207 -0
- package/dist/qa-agent/orchestrator.d.ts +3 -0
- package/dist/qa-agent/orchestrator.d.ts.map +1 -0
- package/dist/qa-agent/orchestrator.js +123 -0
- package/dist/qa-agent/phase1/runner.d.ts +3 -0
- package/dist/qa-agent/phase1/runner.d.ts.map +1 -0
- package/dist/qa-agent/phase1/runner.js +142 -0
- package/dist/qa-agent/phase1/scope.d.ts +6 -0
- package/dist/qa-agent/phase1/scope.d.ts.map +1 -0
- package/dist/qa-agent/phase1/scope.js +129 -0
- package/dist/qa-agent/phase2/agent_browser.d.ts +35 -0
- package/dist/qa-agent/phase2/agent_browser.d.ts.map +1 -0
- package/dist/qa-agent/phase2/agent_browser.js +99 -0
- package/dist/qa-agent/phase2/agent_loop.d.ts +3 -0
- package/dist/qa-agent/phase2/agent_loop.d.ts.map +1 -0
- package/dist/qa-agent/phase2/agent_loop.js +357 -0
- package/dist/qa-agent/phase2/exploration_state.d.ts +12 -0
- package/dist/qa-agent/phase2/exploration_state.d.ts.map +1 -0
- package/dist/qa-agent/phase2/exploration_state.js +109 -0
- package/dist/qa-agent/phase2/tools.d.ts +28 -0
- package/dist/qa-agent/phase2/tools.d.ts.map +1 -0
- package/dist/qa-agent/phase2/tools.js +390 -0
- package/dist/qa-agent/phase2/vision.d.ts +3 -0
- package/dist/qa-agent/phase2/vision.d.ts.map +1 -0
- package/dist/qa-agent/phase2/vision.js +78 -0
- package/dist/qa-agent/phase3/feedback.d.ts +3 -0
- package/dist/qa-agent/phase3/feedback.d.ts.map +1 -0
- package/dist/qa-agent/phase3/feedback.js +37 -0
- package/dist/qa-agent/phase3/reporter.d.ts +3 -0
- package/dist/qa-agent/phase3/reporter.d.ts.map +1 -0
- package/dist/qa-agent/phase3/reporter.js +148 -0
- package/dist/qa-agent/phase3/spec_generator.d.ts +3 -0
- package/dist/qa-agent/phase3/spec_generator.d.ts.map +1 -0
- package/dist/qa-agent/phase3/spec_generator.js +65 -0
- package/dist/qa-agent/phase3/verdict.d.ts +3 -0
- package/dist/qa-agent/phase3/verdict.d.ts.map +1 -0
- package/dist/qa-agent/phase3/verdict.js +69 -0
- package/dist/qa-agent/safe_env.d.ts +3 -0
- package/dist/qa-agent/safe_env.d.ts.map +1 -0
- package/dist/qa-agent/safe_env.js +26 -0
- package/dist/qa-agent/types.d.ts +130 -0
- package/dist/qa-agent/types.d.ts.map +1 -0
- package/dist/qa-agent/types.js +4 -0
- package/dist/reporters/junit.d.ts +6 -0
- package/dist/reporters/junit.d.ts.map +1 -0
- package/dist/reporters/junit.js +89 -0
- package/dist/reporters/reporter.d.ts +42 -0
- package/dist/reporters/reporter.d.ts.map +1 -0
- package/dist/reporters/reporter.js +4 -0
- package/dist/reporters/sarif.d.ts +7 -0
- package/dist/reporters/sarif.d.ts.map +1 -0
- package/dist/reporters/sarif.js +135 -0
- package/dist/resilience/circuit_breaker.d.ts +36 -0
- package/dist/resilience/circuit_breaker.d.ts.map +1 -0
- package/dist/resilience/circuit_breaker.js +82 -0
- package/dist/resilience/retry.d.ts +11 -0
- package/dist/resilience/retry.d.ts.map +1 -0
- package/dist/resilience/retry.js +59 -0
- package/dist/sanitize.d.ts +15 -0
- package/dist/sanitize.d.ts.map +1 -0
- package/dist/sanitize.js +71 -0
- package/dist/training/enricher.d.ts +17 -0
- package/dist/training/enricher.d.ts.map +1 -0
- package/dist/training/enricher.js +350 -0
- package/dist/training/kg_scanner.d.ts +13 -0
- package/dist/training/kg_scanner.d.ts.map +1 -0
- package/dist/training/kg_scanner.js +118 -0
- package/dist/training/merger.d.ts +15 -0
- package/dist/training/merger.d.ts.map +1 -0
- package/dist/training/merger.js +208 -0
- package/dist/training/scanner.d.ts +36 -0
- package/dist/training/scanner.d.ts.map +1 -0
- package/dist/training/scanner.js +932 -0
- package/dist/training/types.d.ts +117 -0
- package/dist/training/types.d.ts.map +1 -0
- package/dist/training/types.js +9 -0
- package/dist/training/validator.d.ts +21 -0
- package/dist/training/validator.d.ts.map +1 -0
- package/dist/training/validator.js +262 -0
- package/dist/validation/guardrails.d.ts +31 -0
- package/dist/validation/guardrails.d.ts.map +1 -0
- package/dist/validation/guardrails.js +112 -0
- package/dist/validation/output_schema.d.ts +67 -0
- package/dist/validation/output_schema.d.ts.map +1 -0
- package/dist/validation/output_schema.js +84 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +36 -0
- package/package.json +126 -0
- package/schemas/flow-decision.schema.json +83 -0
- package/schemas/gap.schema.json +18 -0
- package/schemas/impact.schema.json +455 -0
- package/schemas/plan.schema.json +491 -0
- package/schemas/route-families.schema.json +137 -0
- package/schemas/subsystem-risk-map.schema.json +62 -0
- package/schemas/traceability-input.schema.json +122 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'fs';
|
|
4
|
+
import { join, resolve } from 'path';
|
|
5
|
+
import { isPathWithinRoot, normalizePath } from './utils.js';
|
|
6
|
+
import { createMcpStatus, toSafeSlug, buildNativeStrategyOrder } from './pipeline_utils.js';
|
|
7
|
+
import { validateGeneratedSpecContent, createNativePlaywrightSpec } from './spec_generator.js';
|
|
8
|
+
import { resolvePlaywrightBinary } from './process_runner.js';
|
|
9
|
+
import { runPlaywrightListValidation } from './validation_runner.js';
|
|
10
|
+
import { buildApiSurfaceCatalog } from './api_catalog.js';
|
|
11
|
+
import { resolveAgentSeedSpec } from './llm_agents_flow.js';
|
|
12
|
+
export function runPackageNativeFlow(testsRoot, flow, pipeline, outputDir, testFile, playwrightBinary, apiSurface) {
|
|
13
|
+
const flowId = flow.id;
|
|
14
|
+
const flowName = flow.name;
|
|
15
|
+
const existingFile = existsSync(testFile);
|
|
16
|
+
const originalContent = existingFile ? readFileSync(testFile, 'utf-8') : null;
|
|
17
|
+
if (existingFile && !pipeline.heal) {
|
|
18
|
+
return {
|
|
19
|
+
flowId,
|
|
20
|
+
flowName,
|
|
21
|
+
generatedDir: outputDir,
|
|
22
|
+
generateStatus: 'skipped',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const slug = toSafeSlug(flow.id);
|
|
26
|
+
const strategies = buildNativeStrategyOrder(flow);
|
|
27
|
+
const attempts = [];
|
|
28
|
+
const candidates = [];
|
|
29
|
+
if (pipeline.heal && originalContent !== null) {
|
|
30
|
+
candidates.push({
|
|
31
|
+
label: 'existing',
|
|
32
|
+
content: originalContent,
|
|
33
|
+
write: false,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
for (const strategy of strategies) {
|
|
37
|
+
candidates.push({
|
|
38
|
+
label: strategy,
|
|
39
|
+
strategy,
|
|
40
|
+
content: createNativePlaywrightSpec(flow, slug, strategy),
|
|
41
|
+
write: true,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
mkdirSync(outputDir, { recursive: true });
|
|
45
|
+
let wroteNewFile = false;
|
|
46
|
+
for (let i = 0; i < candidates.length; i += 1) {
|
|
47
|
+
const candidate = candidates[i];
|
|
48
|
+
if (candidate.write) {
|
|
49
|
+
writeFileSync(testFile, candidate.content, 'utf-8');
|
|
50
|
+
wroteNewFile = true;
|
|
51
|
+
}
|
|
52
|
+
const currentContent = candidate.write ? candidate.content : (originalContent || '');
|
|
53
|
+
const qualityIssues = validateGeneratedSpecContent(currentContent, apiSurface);
|
|
54
|
+
if (qualityIssues.length > 0) {
|
|
55
|
+
attempts.push(`${candidate.label}: ${qualityIssues.map((issue) => issue.message).join(' ')}`);
|
|
56
|
+
if (pipeline.heal && i < candidates.length - 1) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (originalContent !== null) {
|
|
60
|
+
writeFileSync(testFile, originalContent, 'utf-8');
|
|
61
|
+
}
|
|
62
|
+
else if (wroteNewFile && existsSync(testFile)) {
|
|
63
|
+
rmSync(testFile, { force: true });
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
flowId,
|
|
67
|
+
flowName,
|
|
68
|
+
generatedDir: outputDir,
|
|
69
|
+
generateStatus: 'failed',
|
|
70
|
+
healStatus: pipeline.heal ? 'failed' : undefined,
|
|
71
|
+
error: `Quality checks failed. Attempts: ${attempts.join(' | ')}`,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (pipeline.heal) {
|
|
75
|
+
const validation = runPlaywrightListValidation(testsRoot, testFile, pipeline, playwrightBinary);
|
|
76
|
+
if (validation.status === 'failed') {
|
|
77
|
+
attempts.push(`${candidate.label}: ${validation.detail || 'playwright validation failed'}`);
|
|
78
|
+
if (i < candidates.length - 1) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (originalContent !== null) {
|
|
82
|
+
writeFileSync(testFile, originalContent, 'utf-8');
|
|
83
|
+
}
|
|
84
|
+
else if (wroteNewFile && existsSync(testFile)) {
|
|
85
|
+
rmSync(testFile, { force: true });
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
flowId,
|
|
89
|
+
flowName,
|
|
90
|
+
generatedDir: outputDir,
|
|
91
|
+
generateStatus: 'failed',
|
|
92
|
+
healStatus: 'failed',
|
|
93
|
+
error: `Heal validation failed. Attempts: ${attempts.join(' | ')}`,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
flowId,
|
|
99
|
+
flowName,
|
|
100
|
+
generatedDir: outputDir,
|
|
101
|
+
generateStatus: candidate.write ? 'success' : 'skipped',
|
|
102
|
+
healStatus: pipeline.heal ? 'success' : undefined,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (originalContent !== null) {
|
|
106
|
+
writeFileSync(testFile, originalContent, 'utf-8');
|
|
107
|
+
}
|
|
108
|
+
else if (wroteNewFile && existsSync(testFile)) {
|
|
109
|
+
rmSync(testFile, { force: true });
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
flowId,
|
|
113
|
+
flowName,
|
|
114
|
+
generatedDir: outputDir,
|
|
115
|
+
generateStatus: 'failed',
|
|
116
|
+
healStatus: pipeline.heal ? 'failed' : undefined,
|
|
117
|
+
error: attempts.length > 0 ? attempts.join(' | ') : 'No generation candidates were available.',
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export function runPackageNativePipeline(testsRoot, flows, pipeline, baseWarnings = []) {
|
|
121
|
+
const warningSet = new Set(baseWarnings);
|
|
122
|
+
const mcp = createMcpStatus('package-native', Boolean(pipeline.mcp));
|
|
123
|
+
const playwrightBinary = pipeline.heal ? resolvePlaywrightBinary(testsRoot) : null;
|
|
124
|
+
const seedFile = resolveAgentSeedSpec(testsRoot) || 'specs/seed.spec.ts';
|
|
125
|
+
const apiSurface = buildApiSurfaceCatalog(testsRoot, seedFile);
|
|
126
|
+
if (pipeline.heal && !playwrightBinary) {
|
|
127
|
+
warningSet.add('Playwright binary was not found. Heal uses static quality checks without runtime compile validation.');
|
|
128
|
+
}
|
|
129
|
+
const results = [];
|
|
130
|
+
const outputBase = resolve(testsRoot, pipeline.outputDir || 'specs/functional/ai-assisted');
|
|
131
|
+
if (!isPathWithinRoot(testsRoot, outputBase)) {
|
|
132
|
+
warningSet.add(`Pipeline outputDir resolves outside testsRoot and was blocked: ${pipeline.outputDir}`);
|
|
133
|
+
return { runner: 'unknown', results, warnings: Array.from(warningSet), mcp: createMcpStatus('unknown', Boolean(pipeline.mcp)) };
|
|
134
|
+
}
|
|
135
|
+
for (const flow of flows) {
|
|
136
|
+
if (flow.priority !== 'P0' && flow.priority !== 'P1') {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const slug = toSafeSlug(flow.id);
|
|
140
|
+
const outputDir = normalizePath(join(outputBase, slug));
|
|
141
|
+
if (!isPathWithinRoot(testsRoot, outputDir)) {
|
|
142
|
+
results.push({
|
|
143
|
+
flowId: flow.id,
|
|
144
|
+
flowName: flow.name,
|
|
145
|
+
generatedDir: outputDir,
|
|
146
|
+
generateStatus: 'failed',
|
|
147
|
+
error: 'output directory resolves outside testsRoot',
|
|
148
|
+
});
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (pipeline.dryRun) {
|
|
152
|
+
results.push({
|
|
153
|
+
flowId: flow.id,
|
|
154
|
+
flowName: flow.name,
|
|
155
|
+
generatedDir: outputDir,
|
|
156
|
+
generateStatus: 'skipped',
|
|
157
|
+
healStatus: pipeline.heal ? 'skipped' : undefined,
|
|
158
|
+
});
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
const testFile = normalizePath(join(outputDir, `${slug}.spec.ts`));
|
|
162
|
+
if (!isPathWithinRoot(testsRoot, testFile)) {
|
|
163
|
+
results.push({
|
|
164
|
+
flowId: flow.id,
|
|
165
|
+
flowName: flow.name,
|
|
166
|
+
generatedDir: outputDir,
|
|
167
|
+
generateStatus: 'failed',
|
|
168
|
+
error: 'generated test path resolves outside testsRoot',
|
|
169
|
+
});
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
results.push(runPackageNativeFlow(testsRoot, flow, pipeline, outputDir, testFile, playwrightBinary, apiSurface));
|
|
173
|
+
}
|
|
174
|
+
return { runner: 'package-native', results, warnings: Array.from(warningSet), mcp };
|
|
175
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
import { existsSync } from 'fs';
|
|
4
|
+
import { dirname, join, relative, resolve } from 'path';
|
|
5
|
+
import { isPathWithinRoot, normalizePath } from './utils.js';
|
|
6
|
+
import { createMcpStatus, finalizePipelineSummary, buildSyntheticFlowFromSpecTarget } from './pipeline_utils.js';
|
|
7
|
+
import { buildApiSurfaceCatalog } from './api_catalog.js';
|
|
8
|
+
import { resolvePlaywrightBinary, runCommand, summarizeCommandOutput } from './process_runner.js';
|
|
9
|
+
import { runPackageNativeFlow, runPackageNativePipeline } from './native_flow.js';
|
|
10
|
+
import { findDisallowedDescribeFiles, resolveAgentSeedSpec, runPlaywrightAgentsPipeline } from './llm_agents_flow.js';
|
|
11
|
+
function hasE2eTestGenCLI(testsRoot) {
|
|
12
|
+
const cliPath = join(testsRoot, 'e2e-test-gen-cli.ts');
|
|
13
|
+
return existsSync(cliPath) ? cliPath : null;
|
|
14
|
+
}
|
|
15
|
+
export function runTargetedSpecHeal(testsRoot, targets, pipeline) {
|
|
16
|
+
const warnings = new Set();
|
|
17
|
+
const results = [];
|
|
18
|
+
const mcp = createMcpStatus('package-native', Boolean(pipeline.mcp));
|
|
19
|
+
if (targets.length === 0) {
|
|
20
|
+
warnings.add('No targeted specs provided for heal.');
|
|
21
|
+
return finalizePipelineSummary({
|
|
22
|
+
runner: 'package-native',
|
|
23
|
+
results,
|
|
24
|
+
warnings: Array.from(warnings),
|
|
25
|
+
mcp,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const playwrightBinary = pipeline.heal ? resolvePlaywrightBinary(testsRoot) : null;
|
|
29
|
+
const seedFile = resolveAgentSeedSpec(testsRoot) || 'specs/seed.spec.ts';
|
|
30
|
+
const apiSurface = buildApiSurfaceCatalog(testsRoot, seedFile);
|
|
31
|
+
if (pipeline.heal && !playwrightBinary) {
|
|
32
|
+
warnings.add('Playwright binary was not found. Targeted heal uses static quality checks without runtime compile validation.');
|
|
33
|
+
}
|
|
34
|
+
for (const target of targets) {
|
|
35
|
+
const inputPath = target.specPath || '';
|
|
36
|
+
const absoluteSpecPath = normalizePath(resolve(testsRoot, inputPath));
|
|
37
|
+
if (!isPathWithinRoot(testsRoot, absoluteSpecPath)) {
|
|
38
|
+
results.push({
|
|
39
|
+
flowId: inputPath || 'unknown',
|
|
40
|
+
flowName: inputPath || 'Unknown Spec',
|
|
41
|
+
generatedDir: normalizePath(dirname(absoluteSpecPath)),
|
|
42
|
+
generateStatus: 'failed',
|
|
43
|
+
healStatus: pipeline.heal ? 'failed' : undefined,
|
|
44
|
+
error: `Targeted spec resolves outside testsRoot: ${inputPath}`,
|
|
45
|
+
});
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (!existsSync(absoluteSpecPath)) {
|
|
49
|
+
results.push({
|
|
50
|
+
flowId: inputPath || 'unknown',
|
|
51
|
+
flowName: inputPath || 'Unknown Spec',
|
|
52
|
+
generatedDir: normalizePath(dirname(absoluteSpecPath)),
|
|
53
|
+
generateStatus: 'failed',
|
|
54
|
+
healStatus: pipeline.heal ? 'failed' : undefined,
|
|
55
|
+
error: `Targeted spec does not exist: ${inputPath}`,
|
|
56
|
+
});
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const relativeSpecPath = normalizePath(relative(testsRoot, absoluteSpecPath));
|
|
60
|
+
if (!/\.(spec|test)\.[tj]sx?$/.test(relativeSpecPath)) {
|
|
61
|
+
warnings.add(`Skipping non-spec target path: ${relativeSpecPath}`);
|
|
62
|
+
results.push({
|
|
63
|
+
flowId: relativeSpecPath,
|
|
64
|
+
flowName: relativeSpecPath,
|
|
65
|
+
generatedDir: normalizePath(dirname(absoluteSpecPath)),
|
|
66
|
+
generateStatus: 'skipped',
|
|
67
|
+
healStatus: pipeline.heal ? 'skipped' : undefined,
|
|
68
|
+
});
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (pipeline.dryRun) {
|
|
72
|
+
results.push({
|
|
73
|
+
flowId: relativeSpecPath,
|
|
74
|
+
flowName: relativeSpecPath,
|
|
75
|
+
generatedDir: normalizePath(dirname(absoluteSpecPath)),
|
|
76
|
+
generateStatus: 'skipped',
|
|
77
|
+
healStatus: pipeline.heal ? 'skipped' : undefined,
|
|
78
|
+
});
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const syntheticFlow = buildSyntheticFlowFromSpecTarget(relativeSpecPath, target);
|
|
82
|
+
results.push(runPackageNativeFlow(testsRoot, syntheticFlow, pipeline, normalizePath(dirname(absoluteSpecPath)), absoluteSpecPath, playwrightBinary, apiSurface));
|
|
83
|
+
}
|
|
84
|
+
return finalizePipelineSummary({
|
|
85
|
+
runner: 'package-native',
|
|
86
|
+
results,
|
|
87
|
+
warnings: Array.from(warnings),
|
|
88
|
+
mcp,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
export function runPlaywrightPipeline(testsRoot, flows, pipeline) {
|
|
92
|
+
const mcpFallbackWarnings = [];
|
|
93
|
+
// MCP-only mode requires MCP to be enabled
|
|
94
|
+
if (pipeline.mcpOnly && !pipeline.mcp) {
|
|
95
|
+
const warnings = [
|
|
96
|
+
'❌ MCP-Only Mode Error: --pipeline-mcp-only requires --pipeline-mcp flag',
|
|
97
|
+
'Run with: npm run gen:tests -- --pipeline-mcp',
|
|
98
|
+
];
|
|
99
|
+
return finalizePipelineSummary({
|
|
100
|
+
runner: 'unknown',
|
|
101
|
+
results: [],
|
|
102
|
+
warnings,
|
|
103
|
+
mcp: createMcpStatus('unknown', false),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (pipeline.mcp) {
|
|
107
|
+
const agentsSummary = runPlaywrightAgentsPipeline(testsRoot, flows, pipeline);
|
|
108
|
+
if (agentsSummary.runner !== 'unknown' || agentsSummary.results.length > 0) {
|
|
109
|
+
return finalizePipelineSummary(agentsSummary);
|
|
110
|
+
}
|
|
111
|
+
// Handle strict MCP-only mode
|
|
112
|
+
if (pipeline.mcpOnly) {
|
|
113
|
+
const warnings = [
|
|
114
|
+
...agentsSummary.warnings,
|
|
115
|
+
'❌ MCP-Only Mode Error: Claude Code CLI / Playwright Agents MCP is not available',
|
|
116
|
+
'Please install Claude Code CLI: brew install anthropic/tap/claude-code',
|
|
117
|
+
'Or check that the MCP server is properly configured',
|
|
118
|
+
];
|
|
119
|
+
return finalizePipelineSummary({
|
|
120
|
+
runner: 'unknown',
|
|
121
|
+
results: agentsSummary.results,
|
|
122
|
+
warnings,
|
|
123
|
+
mcp: createMcpStatus('unknown', true),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (!pipeline.mcpAllowFallback) {
|
|
127
|
+
const warnings = [
|
|
128
|
+
...agentsSummary.warnings,
|
|
129
|
+
'Official Playwright MCP mode is strict; fallback generation is disabled unless pipeline.mcpAllowFallback=true.',
|
|
130
|
+
];
|
|
131
|
+
return finalizePipelineSummary({
|
|
132
|
+
runner: 'unknown',
|
|
133
|
+
results: agentsSummary.results,
|
|
134
|
+
warnings,
|
|
135
|
+
mcp: createMcpStatus('unknown', true),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
mcpFallbackWarnings.push(...agentsSummary.warnings);
|
|
139
|
+
}
|
|
140
|
+
const cliPath = hasE2eTestGenCLI(testsRoot);
|
|
141
|
+
if (!cliPath) {
|
|
142
|
+
return finalizePipelineSummary(runPackageNativePipeline(testsRoot, flows, pipeline, mcpFallbackWarnings));
|
|
143
|
+
}
|
|
144
|
+
const warnings = [...mcpFallbackWarnings];
|
|
145
|
+
const results = [];
|
|
146
|
+
const outputBase = resolve(testsRoot, pipeline.outputDir || 'specs/functional/ai-assisted');
|
|
147
|
+
if (!isPathWithinRoot(testsRoot, outputBase)) {
|
|
148
|
+
warnings.push(`Pipeline outputDir resolves outside testsRoot and was blocked: ${pipeline.outputDir}`);
|
|
149
|
+
return finalizePipelineSummary({
|
|
150
|
+
runner: 'unknown',
|
|
151
|
+
results,
|
|
152
|
+
warnings,
|
|
153
|
+
mcp: createMcpStatus('unknown', Boolean(pipeline.mcp)),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
for (const flow of flows) {
|
|
157
|
+
if (flow.priority !== 'P0' && flow.priority !== 'P1') {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const slug = flow.id.replace(/[^a-zA-Z0-9._-]+/g, '-');
|
|
161
|
+
const outputDir = normalizePath(join(outputBase, slug));
|
|
162
|
+
if (!isPathWithinRoot(testsRoot, outputDir)) {
|
|
163
|
+
results.push({
|
|
164
|
+
flowId: flow.id,
|
|
165
|
+
flowName: flow.name,
|
|
166
|
+
generatedDir: outputDir,
|
|
167
|
+
generateStatus: 'failed',
|
|
168
|
+
error: 'output directory resolves outside testsRoot',
|
|
169
|
+
});
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
if (pipeline.dryRun) {
|
|
173
|
+
results.push({
|
|
174
|
+
flowId: flow.id,
|
|
175
|
+
flowName: flow.name,
|
|
176
|
+
generatedDir: outputDir,
|
|
177
|
+
generateStatus: 'skipped',
|
|
178
|
+
healStatus: 'skipped',
|
|
179
|
+
});
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
const generateArgs = ['tsx', cliPath, 'generate', flow.name, '--output', outputDir, '--scenarios', `${pipeline.scenarios}`];
|
|
183
|
+
if (pipeline.baseUrl) {
|
|
184
|
+
generateArgs.push('--base-url', pipeline.baseUrl);
|
|
185
|
+
}
|
|
186
|
+
if (pipeline.headless) {
|
|
187
|
+
generateArgs.push('--headless');
|
|
188
|
+
}
|
|
189
|
+
if (pipeline.browser) {
|
|
190
|
+
generateArgs.push('--browser', pipeline.browser);
|
|
191
|
+
}
|
|
192
|
+
if (pipeline.project) {
|
|
193
|
+
generateArgs.push('--project', pipeline.project);
|
|
194
|
+
}
|
|
195
|
+
if (pipeline.parallel) {
|
|
196
|
+
generateArgs.push('--parallel');
|
|
197
|
+
}
|
|
198
|
+
if (pipeline.mcp) {
|
|
199
|
+
generateArgs.push('--mcp');
|
|
200
|
+
}
|
|
201
|
+
const generateResult = runCommand('npx', generateArgs, testsRoot);
|
|
202
|
+
if (generateResult.status !== 0) {
|
|
203
|
+
results.push({
|
|
204
|
+
flowId: flow.id,
|
|
205
|
+
flowName: flow.name,
|
|
206
|
+
generatedDir: outputDir,
|
|
207
|
+
generateStatus: 'failed',
|
|
208
|
+
error: summarizeCommandOutput(generateResult.stdout, generateResult.stderr) || generateResult.error || 'generate failed',
|
|
209
|
+
});
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
let healStatus = 'skipped';
|
|
213
|
+
if (pipeline.heal) {
|
|
214
|
+
const healArgs = ['tsx', cliPath, 'heal', outputDir];
|
|
215
|
+
if (pipeline.browser) {
|
|
216
|
+
healArgs.push('--browser', pipeline.browser);
|
|
217
|
+
}
|
|
218
|
+
if (pipeline.project) {
|
|
219
|
+
healArgs.push('--project', pipeline.project);
|
|
220
|
+
}
|
|
221
|
+
if (pipeline.parallel) {
|
|
222
|
+
healArgs.push('--parallel');
|
|
223
|
+
}
|
|
224
|
+
if (pipeline.mcp) {
|
|
225
|
+
healArgs.push('--mcp');
|
|
226
|
+
}
|
|
227
|
+
const healResult = runCommand('npx', healArgs, testsRoot);
|
|
228
|
+
healStatus = healResult.status === 0 ? 'success' : 'failed';
|
|
229
|
+
}
|
|
230
|
+
const disallowedDescribeFiles = findDisallowedDescribeFiles(outputDir);
|
|
231
|
+
if (disallowedDescribeFiles.length > 0) {
|
|
232
|
+
results.push({
|
|
233
|
+
flowId: flow.id,
|
|
234
|
+
flowName: flow.name,
|
|
235
|
+
generatedDir: outputDir,
|
|
236
|
+
generateStatus: 'failed',
|
|
237
|
+
healStatus,
|
|
238
|
+
error: `Generated tests contain test.describe (disallowed): ${disallowedDescribeFiles.join(', ')}`,
|
|
239
|
+
});
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
results.push({
|
|
243
|
+
flowId: flow.id,
|
|
244
|
+
flowName: flow.name,
|
|
245
|
+
generatedDir: outputDir,
|
|
246
|
+
generateStatus: 'success',
|
|
247
|
+
healStatus,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return finalizePipelineSummary({
|
|
251
|
+
runner: 'e2e-test-gen',
|
|
252
|
+
results,
|
|
253
|
+
warnings,
|
|
254
|
+
mcp: createMcpStatus('e2e-test-gen', Boolean(pipeline.mcp)),
|
|
255
|
+
});
|
|
256
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
import { basename } from 'path';
|
|
4
|
+
import { baseNameWithoutExt, normalizePath, titleCase, tokenize, uniqueTokens } from './utils.js';
|
|
5
|
+
export function createMcpStatus(backend, requested) {
|
|
6
|
+
return {
|
|
7
|
+
requested,
|
|
8
|
+
active: requested && (backend === 'e2e-test-gen' || backend === 'playwright-agents'),
|
|
9
|
+
backend,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function classifyPipelineFailure(result) {
|
|
13
|
+
if (result.failureCategory || result.failureCode) {
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
if (!result.error) {
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
const errorText = result.error.toLowerCase();
|
|
20
|
+
if (errorText.includes('etimedout') || errorText.includes('timed out')) {
|
|
21
|
+
return { ...result, failureCategory: 'environment', failureCode: 'mcp_timeout' };
|
|
22
|
+
}
|
|
23
|
+
if (errorText.includes('outside testsroot')) {
|
|
24
|
+
return { ...result, failureCategory: 'path-safety', failureCode: 'path_outside_tests_root' };
|
|
25
|
+
}
|
|
26
|
+
if (errorText.includes('playwright binary') || errorText.includes('not found')) {
|
|
27
|
+
return { ...result, failureCategory: 'environment', failureCode: 'dependency_missing' };
|
|
28
|
+
}
|
|
29
|
+
if (errorText.includes('compile validation')) {
|
|
30
|
+
return { ...result, failureCategory: 'validation', failureCode: 'compile_validation_failed' };
|
|
31
|
+
}
|
|
32
|
+
if (errorText.includes('runtime validation') || errorText.includes('playwright test failed')) {
|
|
33
|
+
return { ...result, failureCategory: 'runtime', failureCode: 'runtime_validation_failed' };
|
|
34
|
+
}
|
|
35
|
+
if (errorText.includes('quality checks failed') || errorText.includes('invalid test content')) {
|
|
36
|
+
return { ...result, failureCategory: 'quality', failureCode: 'quality_guard_failed' };
|
|
37
|
+
}
|
|
38
|
+
if (errorText.includes('generate failed') || errorText.includes('did not produce expected test file')) {
|
|
39
|
+
return { ...result, failureCategory: 'generation', failureCode: 'generation_failed' };
|
|
40
|
+
}
|
|
41
|
+
return { ...result, failureCategory: 'unknown', failureCode: 'unknown' };
|
|
42
|
+
}
|
|
43
|
+
export function finalizePipelineSummary(summary) {
|
|
44
|
+
return {
|
|
45
|
+
...summary,
|
|
46
|
+
results: summary.results.map(classifyPipelineFailure),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function toSafeSlug(value) {
|
|
50
|
+
return value.replace(/[^a-zA-Z0-9._-]+/g, '-').replace(/^-+|-+$/g, '') || 'flow';
|
|
51
|
+
}
|
|
52
|
+
export function stripSpecSuffix(value) {
|
|
53
|
+
return value.replace(/\.(spec|test)\.[^.]+$/i, '').replace(/\.[^.]+$/, '');
|
|
54
|
+
}
|
|
55
|
+
export function buildSyntheticFlowFromSpecTarget(relativeSpecPath, target) {
|
|
56
|
+
const normalizedSpecPath = normalizePath(relativeSpecPath);
|
|
57
|
+
const noSuffix = stripSpecSuffix(normalizedSpecPath);
|
|
58
|
+
const flowId = toSafeSlug(noSuffix.replace(/\//g, '.'));
|
|
59
|
+
const base = baseNameWithoutExt(stripSpecSuffix(basename(normalizedSpecPath)));
|
|
60
|
+
const flowName = titleCase(base.replace(/[._-]+/g, ' ')) || 'Recovered Spec';
|
|
61
|
+
const keywords = uniqueTokens(tokenize(noSuffix.replace(/[/.]/g, ' ')));
|
|
62
|
+
const reasons = [
|
|
63
|
+
`Playwright report marked this spec as ${target.status || 'unstable'}.`,
|
|
64
|
+
target.reason || `Auto-heal target: ${normalizedSpecPath}`,
|
|
65
|
+
];
|
|
66
|
+
return {
|
|
67
|
+
id: flowId,
|
|
68
|
+
name: flowName,
|
|
69
|
+
kind: 'flow',
|
|
70
|
+
score: target.status === 'failed' ? 12 : 9,
|
|
71
|
+
priority: target.status === 'failed' ? 'P0' : 'P1',
|
|
72
|
+
reasons,
|
|
73
|
+
keywords,
|
|
74
|
+
files: [normalizedSpecPath],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export function firstFlowFiles(flow) {
|
|
78
|
+
return (flow.files || []).filter(Boolean).slice(0, 5);
|
|
79
|
+
}
|
|
80
|
+
export function buildNativeStrategyOrder(flow) {
|
|
81
|
+
const flowId = (flow.id || '').toLowerCase();
|
|
82
|
+
const haystack = [
|
|
83
|
+
flow.id,
|
|
84
|
+
flow.name,
|
|
85
|
+
...(flow.files || []),
|
|
86
|
+
...(flow.reasons || []),
|
|
87
|
+
...(flow.keywords || []),
|
|
88
|
+
].join(' ').toLowerCase();
|
|
89
|
+
const strategies = [];
|
|
90
|
+
if (flowId.includes('search')) {
|
|
91
|
+
strategies.push('search-baseline');
|
|
92
|
+
}
|
|
93
|
+
if (flowId.includes('threads') || flowId.includes('thread')) {
|
|
94
|
+
strategies.push('thread-reply');
|
|
95
|
+
}
|
|
96
|
+
if (flowId.includes('channels.lifecycle')) {
|
|
97
|
+
strategies.push('lifecycle-channel');
|
|
98
|
+
}
|
|
99
|
+
if (flowId.includes('channels.settings')) {
|
|
100
|
+
strategies.push('channel-settings');
|
|
101
|
+
}
|
|
102
|
+
if (flowId.includes('channels.switch')) {
|
|
103
|
+
strategies.push('channel-switch');
|
|
104
|
+
}
|
|
105
|
+
if (flowId.includes('messaging.markdown')) {
|
|
106
|
+
strategies.push('markdown-post');
|
|
107
|
+
}
|
|
108
|
+
if (flowId.includes('messaging.mentions')) {
|
|
109
|
+
strategies.push('mentions-post');
|
|
110
|
+
}
|
|
111
|
+
if (flowId.includes('messaging.realtime')) {
|
|
112
|
+
strategies.push('realtime-post');
|
|
113
|
+
}
|
|
114
|
+
if (/(thread|reply|rhs|sidebar[_-]?right)/.test(haystack)) {
|
|
115
|
+
strategies.push('thread-reply');
|
|
116
|
+
}
|
|
117
|
+
if (/(create|join|leave|invite)/.test(haystack)) {
|
|
118
|
+
strategies.push('lifecycle-channel');
|
|
119
|
+
}
|
|
120
|
+
if (/(settings|preferences)/.test(haystack)) {
|
|
121
|
+
strategies.push('channel-settings');
|
|
122
|
+
}
|
|
123
|
+
if (/(switch|quick\\s*switch)/.test(haystack)) {
|
|
124
|
+
strategies.push('channel-switch');
|
|
125
|
+
}
|
|
126
|
+
if (/(markdown|format)/.test(haystack)) {
|
|
127
|
+
strategies.push('markdown-post');
|
|
128
|
+
}
|
|
129
|
+
if (/(mention|@)/.test(haystack)) {
|
|
130
|
+
strategies.push('mentions-post');
|
|
131
|
+
}
|
|
132
|
+
if (/(realtime|websocket|presence)/.test(haystack)) {
|
|
133
|
+
strategies.push('realtime-post');
|
|
134
|
+
}
|
|
135
|
+
if (/(search|find|spotlight)/.test(haystack)) {
|
|
136
|
+
strategies.push('search-baseline');
|
|
137
|
+
}
|
|
138
|
+
if (/(message|post|realtime|websocket|chat)/.test(haystack)) {
|
|
139
|
+
strategies.push('message-post');
|
|
140
|
+
}
|
|
141
|
+
if (/(channel|navigation|sidebar|switch)/.test(haystack)) {
|
|
142
|
+
strategies.push('channel-baseline');
|
|
143
|
+
}
|
|
144
|
+
strategies.push('generic-baseline');
|
|
145
|
+
return Array.from(new Set(strategies));
|
|
146
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
const PLAN_METRICS_EVENTS_PATH = '.e2e-ai-agents/metrics.jsonl';
|
|
6
|
+
const PLAN_METRICS_SUMMARY_PATH = '.e2e-ai-agents/metrics-summary.json';
|
|
7
|
+
function parsePlanMetricLine(line) {
|
|
8
|
+
const trimmed = line.trim();
|
|
9
|
+
if (!trimmed) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const parsed = JSON.parse(trimmed);
|
|
14
|
+
if (!parsed || parsed.schemaVersion !== '1.0.0' || typeof parsed.runId !== 'string') {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return parsed;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function appendPlanMetrics(appRoot, plan) {
|
|
24
|
+
const baseDir = join(appRoot, '.e2e-ai-agents');
|
|
25
|
+
mkdirSync(baseDir, { recursive: true });
|
|
26
|
+
const eventsPath = join(appRoot, PLAN_METRICS_EVENTS_PATH);
|
|
27
|
+
const summaryPath = join(appRoot, PLAN_METRICS_SUMMARY_PATH);
|
|
28
|
+
const event = {
|
|
29
|
+
schemaVersion: '1.0.0',
|
|
30
|
+
timestamp: new Date().toISOString(),
|
|
31
|
+
runId: plan.runId,
|
|
32
|
+
sourceRunId: plan.sourceRunId,
|
|
33
|
+
action: plan.decision.action,
|
|
34
|
+
runSet: plan.runSet,
|
|
35
|
+
confidence: plan.confidence,
|
|
36
|
+
changedFiles: plan.metrics.changedFiles,
|
|
37
|
+
impactedFlows: plan.metrics.impactedFlows,
|
|
38
|
+
uncoveredP0P1Flows: plan.metrics.uncoveredP0P1Flows,
|
|
39
|
+
warnings: plan.metrics.warnings,
|
|
40
|
+
enforcementMode: plan.enforcement.mode,
|
|
41
|
+
enforcementShouldFail: plan.enforcement.shouldFail,
|
|
42
|
+
};
|
|
43
|
+
appendFileSync(eventsPath, `${JSON.stringify(event)}\n`, 'utf-8');
|
|
44
|
+
const allEvents = existsSync(eventsPath)
|
|
45
|
+
? readFileSync(eventsPath, 'utf-8')
|
|
46
|
+
.split('\n')
|
|
47
|
+
.map(parsePlanMetricLine)
|
|
48
|
+
.filter((item) => Boolean(item))
|
|
49
|
+
: [event];
|
|
50
|
+
const byAction = {
|
|
51
|
+
'run-now': 0,
|
|
52
|
+
'must-add-tests': 0,
|
|
53
|
+
'safe-to-merge': 0,
|
|
54
|
+
};
|
|
55
|
+
const byRunSet = {
|
|
56
|
+
smoke: 0,
|
|
57
|
+
targeted: 0,
|
|
58
|
+
full: 0,
|
|
59
|
+
};
|
|
60
|
+
let totalConfidence = 0;
|
|
61
|
+
let blockingRecommendations = 0;
|
|
62
|
+
for (const metricEvent of allEvents) {
|
|
63
|
+
byAction[metricEvent.action] += 1;
|
|
64
|
+
byRunSet[metricEvent.runSet] += 1;
|
|
65
|
+
totalConfidence += metricEvent.confidence;
|
|
66
|
+
if (metricEvent.enforcementShouldFail) {
|
|
67
|
+
blockingRecommendations += 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const totalRuns = allEvents.length;
|
|
71
|
+
const summary = {
|
|
72
|
+
schemaVersion: '1.0.0',
|
|
73
|
+
generatedAt: new Date().toISOString(),
|
|
74
|
+
totalRuns,
|
|
75
|
+
averageConfidence: totalRuns > 0 ? Number((totalConfidence / totalRuns).toFixed(2)) : 0,
|
|
76
|
+
byAction,
|
|
77
|
+
byRunSet,
|
|
78
|
+
blockingRecommendations,
|
|
79
|
+
blockingRate: totalRuns > 0 ? Number((blockingRecommendations / totalRuns).toFixed(4)) : 0,
|
|
80
|
+
};
|
|
81
|
+
writeFileSync(summaryPath, JSON.stringify(summary, null, 2), 'utf-8');
|
|
82
|
+
return { eventsPath, summaryPath };
|
|
83
|
+
}
|