@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,112 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
/**
|
|
4
|
+
* CLI command: cost-report — displays LLM cost breakdown from metrics.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, readFileSync } from 'fs';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
function parseMetricsFile(filePath) {
|
|
9
|
+
if (!existsSync(filePath)) {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
const lines = readFileSync(filePath, 'utf-8').split('\n');
|
|
13
|
+
const events = [];
|
|
14
|
+
for (const line of lines) {
|
|
15
|
+
const trimmed = line.trim();
|
|
16
|
+
if (!trimmed)
|
|
17
|
+
continue;
|
|
18
|
+
try {
|
|
19
|
+
const parsed = JSON.parse(trimmed);
|
|
20
|
+
if (parsed.type === 'crew-run') {
|
|
21
|
+
events.push(parsed);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return events;
|
|
29
|
+
}
|
|
30
|
+
function filterByDays(events, days) {
|
|
31
|
+
const cutoff = Date.now() - days * 24 * 60 * 60 * 1000;
|
|
32
|
+
return events.filter((e) => new Date(e.timestamp).getTime() >= cutoff);
|
|
33
|
+
}
|
|
34
|
+
export function runCostReportCommand(args) {
|
|
35
|
+
const reportRoot = args.path || args.testsRoot || process.cwd();
|
|
36
|
+
const metricsPath = join(reportRoot, '.e2e-ai-agents', 'metrics.jsonl');
|
|
37
|
+
const days = 30; // Default; could be added as a CLI flag later
|
|
38
|
+
const allEvents = parseMetricsFile(metricsPath);
|
|
39
|
+
const events = filterByDays(allEvents, days);
|
|
40
|
+
if (events.length === 0) {
|
|
41
|
+
console.log('No crew metrics found.');
|
|
42
|
+
if (!existsSync(metricsPath)) {
|
|
43
|
+
console.log(`Metrics file not found at: ${metricsPath}`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.log('Run `impact-gate crew` to generate cost data.');
|
|
47
|
+
}
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
// JSON output
|
|
51
|
+
if (args.jsonOutput) {
|
|
52
|
+
const report = buildReport(events, days);
|
|
53
|
+
console.log(JSON.stringify(report, null, 2));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// Human-readable output
|
|
57
|
+
const totalCost = events.reduce((sum, e) => sum + e.totalCost, 0);
|
|
58
|
+
const totalRuns = events.length;
|
|
59
|
+
console.log(`Impact Gate Cost Report (last ${days} days)`);
|
|
60
|
+
console.log('='.repeat(45));
|
|
61
|
+
console.log(`\nTotal: $${totalCost.toFixed(2)} across ${totalRuns} runs\n`);
|
|
62
|
+
// By workflow
|
|
63
|
+
const byWorkflow = new Map();
|
|
64
|
+
for (const e of events) {
|
|
65
|
+
const entry = byWorkflow.get(e.workflow) || { runs: 0, cost: 0 };
|
|
66
|
+
entry.runs++;
|
|
67
|
+
entry.cost += e.totalCost;
|
|
68
|
+
byWorkflow.set(e.workflow, entry);
|
|
69
|
+
}
|
|
70
|
+
console.log('By workflow:');
|
|
71
|
+
for (const [workflow, data] of [...byWorkflow.entries()].sort((a, b) => b[1].cost - a[1].cost)) {
|
|
72
|
+
const avg = data.cost / data.runs;
|
|
73
|
+
console.log(` ${workflow.padEnd(14)} | ${String(data.runs).padStart(3)} runs | $${data.cost.toFixed(2).padStart(6)} | avg $${avg.toFixed(2)}/run`);
|
|
74
|
+
}
|
|
75
|
+
// By agent (top 5)
|
|
76
|
+
const byAgent = new Map();
|
|
77
|
+
for (const e of events) {
|
|
78
|
+
for (const au of e.agentUsage) {
|
|
79
|
+
byAgent.set(au.agent, (byAgent.get(au.agent) || 0) + au.cost);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const sortedAgents = [...byAgent.entries()].sort((a, b) => b[1] - a[1]).slice(0, 5);
|
|
83
|
+
if (sortedAgents.length > 0) {
|
|
84
|
+
console.log('\nBy agent (top 5):');
|
|
85
|
+
for (const [agent, cost] of sortedAgents) {
|
|
86
|
+
const pct = totalCost > 0 ? ((cost / totalCost) * 100).toFixed(0) : '0';
|
|
87
|
+
console.log(` ${agent.padEnd(20)} | $${cost.toFixed(2).padStart(6)} | ${pct.padStart(3)}%`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function buildReport(events, days) {
|
|
92
|
+
const totalCost = events.reduce((sum, e) => sum + e.totalCost, 0);
|
|
93
|
+
const byWorkflow = {};
|
|
94
|
+
const byAgent = {};
|
|
95
|
+
for (const e of events) {
|
|
96
|
+
if (!byWorkflow[e.workflow]) {
|
|
97
|
+
byWorkflow[e.workflow] = { runs: 0, cost: 0 };
|
|
98
|
+
}
|
|
99
|
+
byWorkflow[e.workflow].runs++;
|
|
100
|
+
byWorkflow[e.workflow].cost += e.totalCost;
|
|
101
|
+
for (const au of e.agentUsage) {
|
|
102
|
+
byAgent[au.agent] = (byAgent[au.agent] || 0) + au.cost;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
days,
|
|
107
|
+
totalRuns: events.length,
|
|
108
|
+
totalCost,
|
|
109
|
+
byWorkflow,
|
|
110
|
+
byAgent,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
/**
|
|
4
|
+
* CLI command: crew — runs multi-agent QA analysis workflows.
|
|
5
|
+
*/
|
|
6
|
+
import { appendFileSync, mkdirSync } from 'fs';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
import { resolveConfig } from '../../agent/config.js';
|
|
9
|
+
import { CrewOrchestrator } from '../../crew/orchestrator.js';
|
|
10
|
+
import { ResponseCache } from '../../cache/response_cache.js';
|
|
11
|
+
import { WORKFLOWS } from '../../crew/workflows.js';
|
|
12
|
+
import { ImpactAnalystAgent } from '../../agents/impact-analyst.js';
|
|
13
|
+
import { GeneratorAgent } from '../../agents/generator.js';
|
|
14
|
+
import { ExecutorAgent } from '../../agents/executor.js';
|
|
15
|
+
import { HealerAgent } from '../../agents/healer.js';
|
|
16
|
+
import { StrategistAgent } from '../../agents/strategist.js';
|
|
17
|
+
import { TestDesignerAgent } from '../../agents/test-designer.js';
|
|
18
|
+
import { CrossImpactAgent } from '../../agents/cross-impact.js';
|
|
19
|
+
import { RegressionAdvisorAgent } from '../../agents/regression-advisor.js';
|
|
20
|
+
const VALID_WORKFLOWS = ['full-qa', 'quick-check', 'design-only'];
|
|
21
|
+
export async function runCrewCommand(args, autoConfig) {
|
|
22
|
+
if (!args.path && !autoConfig) {
|
|
23
|
+
console.error('Error: --path is required for crew command');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
const { config } = resolveConfig(process.cwd(), autoConfig, {
|
|
27
|
+
path: args.path,
|
|
28
|
+
profile: args.profile,
|
|
29
|
+
testsRoot: args.testsRoot,
|
|
30
|
+
mode: 'impact',
|
|
31
|
+
gitSince: args.gitSince,
|
|
32
|
+
llmProvider: args.llmProvider,
|
|
33
|
+
});
|
|
34
|
+
const testsRoot = config.testsRoot || config.path;
|
|
35
|
+
const rawWorkflow = args.crewWorkflow || 'full-qa';
|
|
36
|
+
if (!VALID_WORKFLOWS.includes(rawWorkflow)) {
|
|
37
|
+
console.error(`Error: invalid workflow '${rawWorkflow}'. Valid: ${VALID_WORKFLOWS.join(', ')}`);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
const workflowName = rawWorkflow;
|
|
41
|
+
// Degraded mode: skip all AI features, deterministic analysis only
|
|
42
|
+
const degraded = args.degradedMode || process.env.E2E_AGENTS_DEGRADED === 'true';
|
|
43
|
+
if (degraded) {
|
|
44
|
+
console.log('Running in degraded mode — deterministic analysis only, no LLM calls.');
|
|
45
|
+
}
|
|
46
|
+
// Prune expired cache entries to prevent unbounded growth on CI
|
|
47
|
+
try {
|
|
48
|
+
const cache = new ResponseCache(testsRoot);
|
|
49
|
+
const pruned = cache.prune();
|
|
50
|
+
if (pruned > 0) {
|
|
51
|
+
console.log(`Cache: pruned ${pruned} expired entries.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
56
|
+
console.error(`Cache prune warning: ${msg}`);
|
|
57
|
+
}
|
|
58
|
+
const crewConfig = {
|
|
59
|
+
appPath: config.path,
|
|
60
|
+
testsRoot,
|
|
61
|
+
gitSince: args.gitSince || config.git.since,
|
|
62
|
+
routeFamilies: config.routeFamilies,
|
|
63
|
+
apiSurface: config.apiSurface,
|
|
64
|
+
workflow: workflowName,
|
|
65
|
+
providerOverride: args.llmProvider,
|
|
66
|
+
budgetUSD: args.budgetUSD,
|
|
67
|
+
dryRun: degraded || args.dryRun,
|
|
68
|
+
plugins: args.plugins,
|
|
69
|
+
};
|
|
70
|
+
// Create orchestrator and register all agents
|
|
71
|
+
const orchestrator = new CrewOrchestrator();
|
|
72
|
+
orchestrator.registerAgent(new ImpactAnalystAgent());
|
|
73
|
+
orchestrator.registerAgent(new GeneratorAgent());
|
|
74
|
+
orchestrator.registerAgent(new ExecutorAgent());
|
|
75
|
+
orchestrator.registerAgent(new HealerAgent());
|
|
76
|
+
orchestrator.registerAgent(new StrategistAgent());
|
|
77
|
+
orchestrator.registerAgent(new TestDesignerAgent());
|
|
78
|
+
orchestrator.registerAgent(new CrossImpactAgent());
|
|
79
|
+
orchestrator.registerAgent(new RegressionAdvisorAgent());
|
|
80
|
+
let result;
|
|
81
|
+
try {
|
|
82
|
+
result = await orchestrator.run(crewConfig);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
86
|
+
console.error(`Crew workflow failed: ${message}`);
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
const ctx = result.context;
|
|
90
|
+
// Dry-run output
|
|
91
|
+
if (result.dryRun) {
|
|
92
|
+
printDryRunOutput(result, workflowName, args.jsonOutput);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
// Write crew metrics to metrics.jsonl for cost-report
|
|
96
|
+
if (ctx.usage.requestCount > 0) {
|
|
97
|
+
try {
|
|
98
|
+
const baseDir = join(testsRoot, '.e2e-ai-agents');
|
|
99
|
+
mkdirSync(baseDir, { recursive: true });
|
|
100
|
+
const metricsPath = join(baseDir, 'metrics.jsonl');
|
|
101
|
+
const crewMetric = {
|
|
102
|
+
type: 'crew-run',
|
|
103
|
+
timestamp: new Date().toISOString(),
|
|
104
|
+
workflow: workflowName,
|
|
105
|
+
totalCost: ctx.usage.totalCost,
|
|
106
|
+
totalTokens: ctx.usage.totalTokens,
|
|
107
|
+
totalInputTokens: ctx.usage.totalInputTokens,
|
|
108
|
+
totalOutputTokens: ctx.usage.totalOutputTokens,
|
|
109
|
+
agentUsage: ctx.agentUsage,
|
|
110
|
+
};
|
|
111
|
+
appendFileSync(metricsPath, `${JSON.stringify(crewMetric)}\n`, 'utf-8');
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// Non-fatal: metrics writing should not break the workflow
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// JSON output mode
|
|
118
|
+
if (args.jsonOutput) {
|
|
119
|
+
const jsonReport = {
|
|
120
|
+
workflow: workflowName,
|
|
121
|
+
changedFiles: ctx.changedFiles.length,
|
|
122
|
+
impactedFlows: ctx.impactedFlows,
|
|
123
|
+
strategyEntries: ctx.strategyEntries,
|
|
124
|
+
testDesigns: ctx.testDesigns,
|
|
125
|
+
crossImpacts: ctx.crossImpacts,
|
|
126
|
+
regressionRisks: ctx.regressionRisks,
|
|
127
|
+
findings: ctx.findings,
|
|
128
|
+
generatedSpecs: ctx.generatedSpecs.map((s) => ({ flowId: s.flowId, specPath: s.specPath, mode: s.mode, written: s.written })),
|
|
129
|
+
usage: { cost: ctx.usage.totalCost, requests: ctx.usage.requestCount, tokens: ctx.usage.totalTokens },
|
|
130
|
+
timings: result.timings,
|
|
131
|
+
warnings: result.warnings,
|
|
132
|
+
};
|
|
133
|
+
console.log(JSON.stringify(jsonReport, null, 2));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
// Human-readable output
|
|
137
|
+
console.log(`Crew workflow: ${workflowName}`);
|
|
138
|
+
console.log(`Changed files: ${ctx.changedFiles.length}`);
|
|
139
|
+
console.log(`Impacted flows: ${ctx.impactedFlows.length}`);
|
|
140
|
+
console.log(`Strategy entries: ${ctx.strategyEntries.length}`);
|
|
141
|
+
console.log(`Test designs: ${ctx.testDesigns.length} (${ctx.testDesigns.reduce((sum, td) => sum + td.testCases.length, 0)} test cases)`);
|
|
142
|
+
console.log(`Cross-impacts: ${ctx.crossImpacts.length}`);
|
|
143
|
+
console.log(`Regression risks: ${ctx.regressionRisks.length}`);
|
|
144
|
+
console.log(`Findings: ${ctx.findings.length}`);
|
|
145
|
+
console.log(`Generated specs: ${ctx.generatedSpecs.length}`);
|
|
146
|
+
console.log(`Cost: $${ctx.usage.totalCost.toFixed(4)}`);
|
|
147
|
+
if (ctx.strategyEntries.length > 0) {
|
|
148
|
+
console.log('\nTest Strategy:');
|
|
149
|
+
for (const entry of ctx.strategyEntries) {
|
|
150
|
+
console.log(` ${entry.priority} ${entry.flowName} → ${entry.approach} [${entry.testCategories.join(', ')}]`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (ctx.testDesigns.length > 0) {
|
|
154
|
+
console.log('\nTest Designs:');
|
|
155
|
+
for (const design of ctx.testDesigns) {
|
|
156
|
+
console.log(` ${design.flowName}: ${design.testCases.length} test cases`);
|
|
157
|
+
for (const tc of design.testCases) {
|
|
158
|
+
console.log(` [${tc.type}] ${tc.name} (${tc.priority})`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (ctx.crossImpacts.length > 0) {
|
|
163
|
+
console.log('\nCross-Family Impacts:');
|
|
164
|
+
for (const ci of ctx.crossImpacts) {
|
|
165
|
+
console.log(` ${ci.sourceFamily} → ${ci.affectedFamily} (${ci.riskLevel}): ${ci.sharedDependency}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (result.timings && Object.keys(result.timings).length > 0) {
|
|
169
|
+
console.log('\nPhase timings:');
|
|
170
|
+
for (const [phase, ms] of Object.entries(result.timings)) {
|
|
171
|
+
console.log(` ${phase}: ${ms}ms`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (result.warnings.length > 0) {
|
|
175
|
+
console.log(`\nWarnings: ${result.warnings.length}`);
|
|
176
|
+
for (const w of result.warnings.slice(0, 10)) {
|
|
177
|
+
console.log(` - ${w}`);
|
|
178
|
+
}
|
|
179
|
+
if (result.warnings.length > 10) {
|
|
180
|
+
console.log(` ... and ${result.warnings.length - 10} more`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function printDryRunOutput(result, workflowName, jsonOutput) {
|
|
185
|
+
const ctx = result.context;
|
|
186
|
+
const workflow = WORKFLOWS[workflowName];
|
|
187
|
+
if (jsonOutput) {
|
|
188
|
+
console.log(JSON.stringify({
|
|
189
|
+
dryRun: true,
|
|
190
|
+
workflow: workflowName,
|
|
191
|
+
changedFiles: ctx.changedFiles,
|
|
192
|
+
familyGroups: ctx.familyGroups.map((fg) => ({
|
|
193
|
+
familyId: fg.familyId,
|
|
194
|
+
featureId: fg.featureId,
|
|
195
|
+
files: fg.files,
|
|
196
|
+
})),
|
|
197
|
+
phases: workflow.phases.map((p) => ({
|
|
198
|
+
name: p.name,
|
|
199
|
+
agents: p.parallel || p.sequential || [],
|
|
200
|
+
})),
|
|
201
|
+
manifestSource: ctx.manifest?.source || 'none',
|
|
202
|
+
warnings: result.warnings,
|
|
203
|
+
}, null, 2));
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
console.log('Dry run — no LLM calls will be made.\n');
|
|
207
|
+
console.log(`Changed files (${ctx.changedFiles.length}):`);
|
|
208
|
+
for (const f of ctx.changedFiles.slice(0, 20)) {
|
|
209
|
+
console.log(` ${f}`);
|
|
210
|
+
}
|
|
211
|
+
if (ctx.changedFiles.length > 20) {
|
|
212
|
+
console.log(` ... and ${ctx.changedFiles.length - 20} more`);
|
|
213
|
+
}
|
|
214
|
+
console.log(`\nAffected families (${ctx.familyGroups.length}):`);
|
|
215
|
+
for (const fg of ctx.familyGroups) {
|
|
216
|
+
const label = fg.featureId ? `${fg.familyId}/${fg.featureId}` : fg.familyId;
|
|
217
|
+
console.log(` ${label} (${fg.files.length} files)`);
|
|
218
|
+
}
|
|
219
|
+
if (ctx.manifest?.source === 'heuristic') {
|
|
220
|
+
console.log('\n Note: Using directory-based heuristics. Run `impact-gate train` for better accuracy.');
|
|
221
|
+
}
|
|
222
|
+
console.log(`\nWorkflow: ${workflowName}`);
|
|
223
|
+
const phaseNames = workflow.phases
|
|
224
|
+
.map((p) => {
|
|
225
|
+
const agents = p.parallel || p.sequential || [];
|
|
226
|
+
return agents.length > 0 ? `${p.name} (${agents.join(', ')})` : p.name;
|
|
227
|
+
})
|
|
228
|
+
.join(' → ');
|
|
229
|
+
console.log(`Phases: ${phaseNames}`);
|
|
230
|
+
// Cost estimation based on workflow and family count
|
|
231
|
+
const familyCount = Math.max(ctx.familyGroups.length, 1);
|
|
232
|
+
const agentCount = workflow.phases.reduce((sum, p) => sum + (p.parallel?.length || 0) + (p.sequential?.length || 0), 0);
|
|
233
|
+
const costEstimate = estimateCost(workflowName, familyCount, agentCount);
|
|
234
|
+
console.log(`\nEstimated cost: $${costEstimate.low.toFixed(2)}-$${costEstimate.high.toFixed(2)}`);
|
|
235
|
+
if (ctx.modelRoutingProviderType) {
|
|
236
|
+
console.log(` With model routing: $${(costEstimate.low * 0.5).toFixed(2)}-$${(costEstimate.high * 0.5).toFixed(2)} (Haiku for classification)`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/** Rough cost estimation based on observed averages per workflow type */
|
|
240
|
+
function estimateCost(workflow, families, _agents) {
|
|
241
|
+
// Per-family cost ranges by workflow (based on typical Sonnet pricing)
|
|
242
|
+
const ranges = {
|
|
243
|
+
'quick-check': { low: 0.03, high: 0.10 },
|
|
244
|
+
'design-only': { low: 0.10, high: 0.40 },
|
|
245
|
+
'full-qa': { low: 0.30, high: 1.00 },
|
|
246
|
+
};
|
|
247
|
+
const range = ranges[workflow] || ranges['full-qa'];
|
|
248
|
+
return {
|
|
249
|
+
low: range.low * families,
|
|
250
|
+
high: range.high * families,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
import { readFileSync } from 'fs';
|
|
4
|
+
import { resolveConfig } from '../../agent/config.js';
|
|
5
|
+
import { appendFeedbackAndRecompute } from '../../agent/feedback.js';
|
|
6
|
+
export function runFeedbackCommand(args, autoConfig) {
|
|
7
|
+
if (!args.path && !autoConfig) {
|
|
8
|
+
console.error('Error: --path is required for feedback command');
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
if (!args.feedbackInputPath) {
|
|
12
|
+
console.error('Error: --feedback-input <path> is required for feedback command');
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
const { config } = resolveConfig(process.cwd(), autoConfig, {
|
|
16
|
+
path: args.path,
|
|
17
|
+
profile: args.profile,
|
|
18
|
+
testsRoot: args.testsRoot,
|
|
19
|
+
mode: 'impact',
|
|
20
|
+
llmProvider: args.llmProvider,
|
|
21
|
+
});
|
|
22
|
+
const reportRoot = config.testsRoot || config.path;
|
|
23
|
+
const raw = JSON.parse(readFileSync(args.feedbackInputPath, 'utf-8'));
|
|
24
|
+
const payload = {
|
|
25
|
+
timestamp: raw.timestamp || new Date().toISOString(),
|
|
26
|
+
runSet: raw.runSet || 'targeted',
|
|
27
|
+
recommendedTests: raw.recommendedTests || [],
|
|
28
|
+
executedTests: raw.executedTests || [],
|
|
29
|
+
failedTests: raw.failedTests || [],
|
|
30
|
+
escapedFailures: raw.escapedFailures || [],
|
|
31
|
+
};
|
|
32
|
+
const output = appendFeedbackAndRecompute(reportRoot, payload);
|
|
33
|
+
console.log(`Feedback data: ${output.feedbackPath}`);
|
|
34
|
+
console.log(`Calibration data: ${output.calibrationPath}`);
|
|
35
|
+
console.log(`Calibration overall: precision=${output.calibration.overall.precision}, recall=${output.calibration.overall.recall}, fnr=${output.calibration.overall.falseNegativeRate}`);
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
import { resolveConfig } from '../../agent/config.js';
|
|
4
|
+
import { finalizeGeneratedTests } from '../../agent/handoff.js';
|
|
5
|
+
export function runFinalizeCommand(args, autoConfig) {
|
|
6
|
+
if (!args.path && !autoConfig) {
|
|
7
|
+
console.error('Error: --path is required for finalize-generated-tests command');
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
const { config } = resolveConfig(process.cwd(), autoConfig, {
|
|
11
|
+
path: args.path,
|
|
12
|
+
profile: args.profile,
|
|
13
|
+
testsRoot: args.testsRoot,
|
|
14
|
+
mode: 'gap',
|
|
15
|
+
llmProvider: args.llmProvider,
|
|
16
|
+
});
|
|
17
|
+
const result = finalizeGeneratedTests({
|
|
18
|
+
appPath: config.path,
|
|
19
|
+
testsRoot: config.testsRoot || config.path,
|
|
20
|
+
branch: args.branch,
|
|
21
|
+
commitMessage: args.commitMessage,
|
|
22
|
+
createPr: args.createPr,
|
|
23
|
+
prTitle: args.prTitle,
|
|
24
|
+
prBody: args.prBody,
|
|
25
|
+
baseBranch: args.prBase,
|
|
26
|
+
dryRun: args.dryRun,
|
|
27
|
+
});
|
|
28
|
+
console.log(`Finalize repo root: ${result.repoRoot}`);
|
|
29
|
+
console.log(`Finalize branch: ${result.branch}`);
|
|
30
|
+
console.log(`Finalize staged paths: ${result.stagedPaths.join(', ') || 'none'}`);
|
|
31
|
+
console.log(`Finalize commit: ${result.committed ? 'created' : 'skipped'}`);
|
|
32
|
+
if (result.commitSha) {
|
|
33
|
+
console.log(`Finalize commit sha: ${result.commitSha}`);
|
|
34
|
+
}
|
|
35
|
+
if (result.prUrl) {
|
|
36
|
+
console.log(`Finalize PR: ${result.prUrl}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
/**
|
|
4
|
+
* CLI command: gate — CI coverage gate that exits 1 if coverage is below threshold.
|
|
5
|
+
*
|
|
6
|
+
* Runs deterministic impact analysis (no LLM required) and checks what
|
|
7
|
+
* percentage of impacted features have test coverage.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* impact-gate gate --threshold 80 --path . --since origin/main
|
|
11
|
+
*/
|
|
12
|
+
import { resolveConfig } from '../../agent/config.js';
|
|
13
|
+
import { getChangedFiles } from '../../agent/git.js';
|
|
14
|
+
import { analyzeImpact } from '../../engine/impact_engine.js';
|
|
15
|
+
export async function runGateCommand(args, autoConfig) {
|
|
16
|
+
if (!args.path && !autoConfig) {
|
|
17
|
+
console.error('Error: --path is required for gate command');
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
let threshold = args.gateThreshold ?? 80;
|
|
21
|
+
if (threshold > 0 && threshold < 1) {
|
|
22
|
+
threshold = threshold * 100;
|
|
23
|
+
}
|
|
24
|
+
const { config } = resolveConfig(process.cwd(), autoConfig, {
|
|
25
|
+
path: args.path,
|
|
26
|
+
profile: args.profile,
|
|
27
|
+
testsRoot: args.testsRoot,
|
|
28
|
+
mode: 'impact',
|
|
29
|
+
gitSince: args.gitSince,
|
|
30
|
+
});
|
|
31
|
+
const testsRoot = config.testsRoot || config.path;
|
|
32
|
+
const gitSince = args.gitSince || config.git.since;
|
|
33
|
+
// Get changed files
|
|
34
|
+
const result = await getChangedFiles(config.path, gitSince);
|
|
35
|
+
const changedFiles = result.files;
|
|
36
|
+
if (changedFiles.length === 0) {
|
|
37
|
+
console.log('No changed files detected. Gate passes.');
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
// Run deterministic impact analysis
|
|
41
|
+
const impact = analyzeImpact(changedFiles, {
|
|
42
|
+
testsRoot,
|
|
43
|
+
routeFamilies: config.routeFamilies,
|
|
44
|
+
});
|
|
45
|
+
const totalFeatures = impact.impactedFeatures.length;
|
|
46
|
+
if (totalFeatures === 0) {
|
|
47
|
+
console.log('No impacted features detected. Gate passes.');
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
const coveredFeatures = impact.impactedFeatures.filter((f) => f.coverageStatus === 'covered' || f.coverageStatus === 'partial').length;
|
|
51
|
+
const coveragePercent = Math.round((coveredFeatures / totalFeatures) * 100);
|
|
52
|
+
// Output
|
|
53
|
+
if (args.jsonOutput) {
|
|
54
|
+
console.log(JSON.stringify({
|
|
55
|
+
threshold,
|
|
56
|
+
coveragePercent,
|
|
57
|
+
totalFeatures,
|
|
58
|
+
coveredFeatures,
|
|
59
|
+
passed: coveragePercent >= threshold,
|
|
60
|
+
uncoveredFeatures: impact.impactedFeatures
|
|
61
|
+
.filter((f) => f.coverageStatus === 'uncovered')
|
|
62
|
+
.map((f) => ({ id: f.featureId || f.familyId, priority: f.priority })),
|
|
63
|
+
}, null, 2));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
console.log(`Coverage gate: ${coveragePercent}% (${coveredFeatures}/${totalFeatures} features covered)`);
|
|
67
|
+
console.log(`Threshold: ${threshold}%`);
|
|
68
|
+
if (coveragePercent < threshold) {
|
|
69
|
+
console.log(`\nFAILED — coverage ${coveragePercent}% is below ${threshold}% threshold`);
|
|
70
|
+
const uncovered = impact.impactedFeatures.filter((f) => f.coverageStatus === 'uncovered');
|
|
71
|
+
if (uncovered.length > 0) {
|
|
72
|
+
console.log('\nUncovered features:');
|
|
73
|
+
for (const f of uncovered.slice(0, 10)) {
|
|
74
|
+
console.log(` ${f.priority || 'P2'} ${f.featureId || f.familyId}`);
|
|
75
|
+
}
|
|
76
|
+
if (uncovered.length > 10) {
|
|
77
|
+
console.log(` ... and ${uncovered.length - 10} more`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
console.log('\nPASSED');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
process.exit(coveragePercent >= threshold ? 0 : 1);
|
|
86
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
+
// See LICENSE.txt for license information.
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { LLMProviderFactory } from '../../provider_factory.js';
|
|
6
|
+
import { runAgenticGeneration } from '../../agentic/runner.js';
|
|
7
|
+
import { loadOrBuildApiSurface } from '../../knowledge/api_surface.js';
|
|
8
|
+
export async function runGenerateCommand(args, config) {
|
|
9
|
+
const reportRoot = config.testsRoot || config.path;
|
|
10
|
+
// Load scenarios from --scenarios flag or plan-report.json
|
|
11
|
+
let scenarios = [];
|
|
12
|
+
if (args.generateScenarios) {
|
|
13
|
+
let raw;
|
|
14
|
+
if (existsSync(args.generateScenarios)) {
|
|
15
|
+
raw = JSON.parse(readFileSync(args.generateScenarios, 'utf-8'));
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
raw = JSON.parse(args.generateScenarios);
|
|
19
|
+
}
|
|
20
|
+
if (!Array.isArray(raw)) {
|
|
21
|
+
console.error('--scenarios must be a JSON array of ScenarioInput objects.');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
for (const item of raw) {
|
|
25
|
+
if (!item.id || !item.name || !Array.isArray(item.scenarios) || !item.routeFamily || !item.priority) {
|
|
26
|
+
console.error(`Invalid scenario: each must have id, name, scenarios[], routeFamily, priority.`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
scenarios = raw;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
// Try plan.json first (written by plan/suggest command), then plan-report.json (legacy)
|
|
34
|
+
const planJsonPath = join(reportRoot, '.e2e-ai-agents', 'plan.json');
|
|
35
|
+
const planReportPath = join(reportRoot, '.e2e-ai-agents', 'plan-report.json');
|
|
36
|
+
const resolvedPlanPath = existsSync(planJsonPath) ? planJsonPath : existsSync(planReportPath) ? planReportPath : null;
|
|
37
|
+
if (!resolvedPlanPath) {
|
|
38
|
+
console.error('No plan report found. Run `plan` first or pass --scenarios.');
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
const planReport = JSON.parse(readFileSync(resolvedPlanPath, 'utf-8'));
|
|
42
|
+
scenarios = (planReport.gapDetails || []).map((gap) => ({
|
|
43
|
+
id: gap.id,
|
|
44
|
+
name: gap.id,
|
|
45
|
+
scenarios: gap.missingScenarios || gap.reasons || ['Verify core user flow'],
|
|
46
|
+
routeFamily: gap.id.split('.')[0] || gap.id,
|
|
47
|
+
priority: 'P1',
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
if (scenarios.length === 0) {
|
|
51
|
+
console.log('No scenarios to generate tests for.');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
let apiSurface;
|
|
55
|
+
try {
|
|
56
|
+
apiSurface = loadOrBuildApiSurface(reportRoot, config.apiSurface);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
console.warn('Could not load API surface catalog. Generation will use generic selectors.');
|
|
60
|
+
}
|
|
61
|
+
const provider = await LLMProviderFactory.createFromPreference(config.llm.provider);
|
|
62
|
+
console.log(`Generating tests for ${scenarios.length} scenario(s)...`);
|
|
63
|
+
const summary = await runAgenticGeneration({
|
|
64
|
+
scenarios,
|
|
65
|
+
config: {
|
|
66
|
+
maxAttempts: args.maxAttempts || 3,
|
|
67
|
+
project: args.pipelineProject || 'chrome',
|
|
68
|
+
baseUrl: args.pipelineBaseUrl,
|
|
69
|
+
testTimeoutMs: 120000,
|
|
70
|
+
testsRoot: reportRoot,
|
|
71
|
+
dryRun: args.dryRun,
|
|
72
|
+
},
|
|
73
|
+
provider,
|
|
74
|
+
apiSurface,
|
|
75
|
+
});
|
|
76
|
+
console.log(`\nAgentic Generation Summary:`);
|
|
77
|
+
console.log(` Generated: ${summary.totalGenerated}`);
|
|
78
|
+
console.log(` Passed: ${summary.totalPassed}`);
|
|
79
|
+
console.log(` Failed: ${summary.totalFailed}`);
|
|
80
|
+
console.log(` Attempts: ${summary.totalAttempts}`);
|
|
81
|
+
console.log(` Duration: ${(summary.durationMs / 1000).toFixed(1)}s`);
|
|
82
|
+
for (const result of summary.results) {
|
|
83
|
+
const icon = result.status === 'passed' ? 'PASS' : result.status === 'skipped' ? 'SKIP' : 'FAIL';
|
|
84
|
+
console.log(` [${icon}] ${result.scenarioSource} (${result.attempts} attempts)`);
|
|
85
|
+
if (result.status === 'passed' || result.status === 'skipped') {
|
|
86
|
+
console.log(` ${result.specPath}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (summary.warnings.length > 0) {
|
|
90
|
+
console.log(`\nWarnings:`);
|
|
91
|
+
for (const w of summary.warnings) {
|
|
92
|
+
console.warn(` - ${w}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const summaryDir = join(reportRoot, '.e2e-ai-agents');
|
|
96
|
+
if (!existsSync(summaryDir)) {
|
|
97
|
+
mkdirSync(summaryDir, { recursive: true });
|
|
98
|
+
}
|
|
99
|
+
const summaryPath = join(summaryDir, 'agentic-summary.json');
|
|
100
|
+
writeFileSync(summaryPath, JSON.stringify(summary, null, 2), 'utf-8');
|
|
101
|
+
console.log(`\nReport: ${summaryPath}`);
|
|
102
|
+
if (summary.totalFailed > 0) {
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
}
|