@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,316 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.runPlanCrewAnalysis = runPlanCrewAnalysis;
|
|
6
|
+
exports.buildCrewMarkdown = buildCrewMarkdown;
|
|
7
|
+
exports.appendCrewToSummary = appendCrewToSummary;
|
|
8
|
+
exports.buildCrewTestPlan = buildCrewTestPlan;
|
|
9
|
+
exports.writeCrewArtifacts = writeCrewArtifacts;
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const cross_impact_js_1 = require("../../agents/cross-impact.js");
|
|
13
|
+
const impact_analyst_js_1 = require("../../agents/impact-analyst.js");
|
|
14
|
+
const regression_advisor_js_1 = require("../../agents/regression-advisor.js");
|
|
15
|
+
const strategist_js_1 = require("../../agents/strategist.js");
|
|
16
|
+
const test_designer_js_1 = require("../../agents/test-designer.js");
|
|
17
|
+
const orchestrator_js_1 = require("../../crew/orchestrator.js");
|
|
18
|
+
const VALID_WORKFLOWS = new Set(['full-qa', 'quick-check', 'design-only']);
|
|
19
|
+
function uniqueStrings(values) {
|
|
20
|
+
return Array.from(new Set(values.filter(Boolean)));
|
|
21
|
+
}
|
|
22
|
+
function singleLine(value) {
|
|
23
|
+
return value.replace(/\s+/g, ' ').trim();
|
|
24
|
+
}
|
|
25
|
+
function chooseCrewWorkflow(explicitWorkflow, plan) {
|
|
26
|
+
if (explicitWorkflow && VALID_WORKFLOWS.has(explicitWorkflow)) {
|
|
27
|
+
return explicitWorkflow;
|
|
28
|
+
}
|
|
29
|
+
if (plan.decision.action === 'must-add-tests' || plan.metrics.uncoveredP0P1Flows > 0) {
|
|
30
|
+
return 'design-only';
|
|
31
|
+
}
|
|
32
|
+
return 'quick-check';
|
|
33
|
+
}
|
|
34
|
+
function registerCrewAgents(orchestrator) {
|
|
35
|
+
orchestrator.registerAgent(new impact_analyst_js_1.ImpactAnalystAgent());
|
|
36
|
+
orchestrator.registerAgent(new strategist_js_1.StrategistAgent());
|
|
37
|
+
orchestrator.registerAgent(new test_designer_js_1.TestDesignerAgent());
|
|
38
|
+
orchestrator.registerAgent(new cross_impact_js_1.CrossImpactAgent());
|
|
39
|
+
orchestrator.registerAgent(new regression_advisor_js_1.RegressionAdvisorAgent());
|
|
40
|
+
}
|
|
41
|
+
async function runPlanCrewAnalysis(plan, config, args) {
|
|
42
|
+
const reportRoot = config.testsRoot || config.path;
|
|
43
|
+
const workflow = chooseCrewWorkflow(args.crewWorkflow, plan);
|
|
44
|
+
const normalizedProvider = config.llm.provider?.trim().toLowerCase();
|
|
45
|
+
const providerOverride = normalizedProvider && normalizedProvider !== 'auto' ? normalizedProvider : 'auto';
|
|
46
|
+
const orchestrator = new orchestrator_js_1.CrewOrchestrator();
|
|
47
|
+
registerCrewAgents(orchestrator);
|
|
48
|
+
const result = await orchestrator.run({
|
|
49
|
+
appPath: config.path,
|
|
50
|
+
testsRoot: reportRoot,
|
|
51
|
+
gitSince: args.gitSince || config.git.since,
|
|
52
|
+
routeFamilies: config.routeFamilies,
|
|
53
|
+
apiSurface: config.apiSurface,
|
|
54
|
+
workflow,
|
|
55
|
+
providerOverride: providerOverride === 'auto' ? undefined : providerOverride,
|
|
56
|
+
budgetUSD: args.budgetUSD,
|
|
57
|
+
dryRun: args.dryRun,
|
|
58
|
+
});
|
|
59
|
+
const ctx = result.context;
|
|
60
|
+
const highRiskCrossImpacts = ctx.crossImpacts.filter((entry) => entry.riskLevel === 'high');
|
|
61
|
+
const manualReviewEntries = ctx.strategyEntries.filter((entry) => entry.approach === 'manual-review');
|
|
62
|
+
return {
|
|
63
|
+
workflow,
|
|
64
|
+
providerOverride,
|
|
65
|
+
summary: {
|
|
66
|
+
impactedFlows: ctx.impactedFlows.length,
|
|
67
|
+
strategyEntries: ctx.strategyEntries.length,
|
|
68
|
+
testDesigns: ctx.testDesigns.length,
|
|
69
|
+
crossImpacts: ctx.crossImpacts.length,
|
|
70
|
+
highRiskCrossImpacts: highRiskCrossImpacts.length,
|
|
71
|
+
regressionRisks: ctx.regressionRisks.length,
|
|
72
|
+
findings: ctx.findings.length,
|
|
73
|
+
generatedSpecs: ctx.generatedSpecs.length,
|
|
74
|
+
manualReviewEntries: manualReviewEntries.length,
|
|
75
|
+
totalCostUSD: Number(ctx.usage.totalCost.toFixed(4)),
|
|
76
|
+
totalTokens: ctx.usage.totalTokens,
|
|
77
|
+
},
|
|
78
|
+
impactedFlows: ctx.impactedFlows,
|
|
79
|
+
strategyEntries: ctx.strategyEntries,
|
|
80
|
+
testDesigns: ctx.testDesigns,
|
|
81
|
+
crossImpacts: ctx.crossImpacts,
|
|
82
|
+
regressionRisks: ctx.regressionRisks,
|
|
83
|
+
findings: ctx.findings,
|
|
84
|
+
warnings: uniqueStrings([...ctx.warnings, ...result.warnings]),
|
|
85
|
+
timings: result.timings,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Match a strategy/design entry against a set of gap family IDs.
|
|
90
|
+
*/
|
|
91
|
+
function matchesGapFamily(flowId, flowName, gapFamilies) {
|
|
92
|
+
return Array.from(gapFamilies).some((fam) => flowId.startsWith(fam) || flowName.toLowerCase().includes(fam.replace(/_/g, ' ')));
|
|
93
|
+
}
|
|
94
|
+
function buildCrewMarkdown(crew, plan) {
|
|
95
|
+
const totalCases = crew.testDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
96
|
+
const gapFamilies = new Set((plan?.gapDetails ?? []).map((g) => g.id));
|
|
97
|
+
const lines = [
|
|
98
|
+
'### Crew Analysis — What to Test',
|
|
99
|
+
'',
|
|
100
|
+
`Crew analyzed the diff and recommends what to verify before merging.`,
|
|
101
|
+
'',
|
|
102
|
+
`Impacted flows: **${crew.summary.impactedFlows}** | Strategy entries: **${crew.summary.strategyEntries}**`,
|
|
103
|
+
];
|
|
104
|
+
if (totalCases > 0) {
|
|
105
|
+
const gapDesigns = gapFamilies.size > 0
|
|
106
|
+
? crew.testDesigns.filter((td) => matchesGapFamily(td.flowId, td.flowName, gapFamilies))
|
|
107
|
+
: [];
|
|
108
|
+
const gapCases = gapDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
109
|
+
const gapP0Cases = gapDesigns.reduce((n, td) => n + td.testCases.filter((tc) => tc.priority === 'P0').length, 0);
|
|
110
|
+
lines.push(`Structured test designs: **${crew.summary.testDesigns}** flows, **${totalCases}** test cases`);
|
|
111
|
+
if (gapDesigns.length > 0) {
|
|
112
|
+
lines.push(`Gap-focused: **${gapDesigns.length}** flows, **${gapCases}** test cases (**${gapP0Cases}** P0)`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (crew.summary.crossImpacts > 0) {
|
|
116
|
+
lines.push(`Cross-impacts: **${crew.summary.crossImpacts}** (${crew.summary.highRiskCrossImpacts} high risk)`);
|
|
117
|
+
}
|
|
118
|
+
lines.push(`Estimated AI cost: **$${crew.summary.totalCostUSD.toFixed(4)}**`);
|
|
119
|
+
if (crew.strategyEntries.length > 0) {
|
|
120
|
+
lines.push('');
|
|
121
|
+
lines.push('Top Strategy Recommendations:');
|
|
122
|
+
for (const entry of crew.strategyEntries.slice(0, 5)) {
|
|
123
|
+
lines.push(`- ${entry.priority} ${entry.flowName} -> ${entry.approach} (${entry.crossImpactRisk} cross-impact risk)`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (crew.testDesigns.length > 0) {
|
|
127
|
+
lines.push('');
|
|
128
|
+
lines.push('Structured Test Designs:');
|
|
129
|
+
for (const design of crew.testDesigns.slice(0, 3)) {
|
|
130
|
+
lines.push(`- ${design.flowName}: ${design.testCases.length} designed test case(s)`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const riskyCrossImpacts = crew.crossImpacts.filter((entry) => entry.riskLevel === 'high');
|
|
134
|
+
if (riskyCrossImpacts.length > 0) {
|
|
135
|
+
lines.push('');
|
|
136
|
+
lines.push('High-Risk Cross-Impacts:');
|
|
137
|
+
for (const entry of riskyCrossImpacts.slice(0, 5)) {
|
|
138
|
+
lines.push(`- ${entry.sourceFamily} -> ${entry.affectedFamily}: ${entry.sharedDependency}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (crew.findings.length > 0) {
|
|
142
|
+
lines.push('');
|
|
143
|
+
lines.push('Crew Findings:');
|
|
144
|
+
for (const finding of crew.findings.slice(0, 5)) {
|
|
145
|
+
lines.push(`- ${finding.severity} ${finding.type}: ${finding.summary}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (crew.warnings.length > 0) {
|
|
149
|
+
lines.push('');
|
|
150
|
+
lines.push('Crew Warnings:');
|
|
151
|
+
for (const warning of crew.warnings.slice(0, 5)) {
|
|
152
|
+
lines.push(`- ${singleLine(warning)}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return lines.join('\n');
|
|
156
|
+
}
|
|
157
|
+
function appendCrewToSummary(baseMarkdown, crew, plan) {
|
|
158
|
+
return `${baseMarkdown}\n\n---\n\n${buildCrewMarkdown(crew, plan)}`;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Build a full structured test plan as a Markdown document.
|
|
162
|
+
* Sections: gap flows first (P0 cases expanded), then covered-flow smoke tests.
|
|
163
|
+
*/
|
|
164
|
+
function buildCrewTestPlan(crew, plan) {
|
|
165
|
+
const gapFamilies = new Set((plan?.gapDetails ?? []).map((g) => g.id));
|
|
166
|
+
const hasTestDesigns = crew.testDesigns.length > 0;
|
|
167
|
+
const totalCases = crew.testDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
168
|
+
// Split strategy entries into gap-related and covered
|
|
169
|
+
const gapStrategies = gapFamilies.size > 0
|
|
170
|
+
? crew.strategyEntries.filter((s) => matchesGapFamily(s.flowId, s.flowName, gapFamilies))
|
|
171
|
+
: [];
|
|
172
|
+
const coveredStrategies = crew.strategyEntries.filter((s) => !gapStrategies.includes(s));
|
|
173
|
+
// Split test designs (if present) into gap-related and covered
|
|
174
|
+
const gapDesigns = [];
|
|
175
|
+
const coveredDesigns = [];
|
|
176
|
+
for (const td of crew.testDesigns) {
|
|
177
|
+
if (matchesGapFamily(td.flowId, td.flowName, gapFamilies)) {
|
|
178
|
+
gapDesigns.push(td);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
coveredDesigns.push(td);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const gapCases = gapDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
185
|
+
const coveredCases = coveredDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
186
|
+
const lines = [
|
|
187
|
+
'# Crew Test Plan — What to Verify',
|
|
188
|
+
'',
|
|
189
|
+
'> **This is a test recommendation, not a test execution report.**',
|
|
190
|
+
'> Crew analyzed the code diff and identified what needs to be tested.',
|
|
191
|
+
'> Use this plan to guide manual QA or write automated E2E tests.',
|
|
192
|
+
'',
|
|
193
|
+
`_Auto-generated by impact-gate crew (\`${crew.workflow}\` workflow)_`,
|
|
194
|
+
'',
|
|
195
|
+
'## Summary',
|
|
196
|
+
'',
|
|
197
|
+
`| Metric | Count |`,
|
|
198
|
+
`|--------|-------|`,
|
|
199
|
+
`| Gap flows — **no existing tests, must verify** | ${gapStrategies.length} flows${hasTestDesigns ? `, **${gapCases} test cases**` : ''} |`,
|
|
200
|
+
`| Covered flows — **has tests, verify no regressions** | ${coveredStrategies.length} flows${hasTestDesigns ? `, ${coveredCases} test cases` : ''} |`,
|
|
201
|
+
`| Total | ${crew.strategyEntries.length} flows${hasTestDesigns ? `, ${totalCases} test cases` : ''} |`,
|
|
202
|
+
`| High-risk cross-impacts | ${crew.summary.highRiskCrossImpacts} |`,
|
|
203
|
+
`| AI cost | $${crew.summary.totalCostUSD.toFixed(4)} |`,
|
|
204
|
+
'',
|
|
205
|
+
];
|
|
206
|
+
// ── Gap flows ──
|
|
207
|
+
if (gapStrategies.length > 0) {
|
|
208
|
+
lines.push('## Action Required: Gap Flows (No Existing Tests)');
|
|
209
|
+
lines.push('');
|
|
210
|
+
lines.push('These flows have **no automated E2E coverage**. Before merging, either:');
|
|
211
|
+
lines.push('1. **Write E2E tests** for the critical scenarios below, or');
|
|
212
|
+
lines.push('2. **Manually verify** each flow works as expected');
|
|
213
|
+
lines.push('');
|
|
214
|
+
for (const strategy of gapStrategies) {
|
|
215
|
+
const td = crew.testDesigns.find((d) => d.flowId === strategy.flowId);
|
|
216
|
+
lines.push(`### ${strategy.flowName}`);
|
|
217
|
+
lines.push('');
|
|
218
|
+
const actionVerb = strategy.approach === 'full-test' ? 'Write full E2E test or verify manually'
|
|
219
|
+
: strategy.approach === 'smoke-test' ? 'Smoke-test manually or add basic E2E coverage'
|
|
220
|
+
: strategy.approach === 'manual-review' ? 'Manual review required'
|
|
221
|
+
: 'Can skip — low risk';
|
|
222
|
+
lines.push(`**${strategy.priority}** | Recommended: **${strategy.approach}** | Cross-impact risk: **${strategy.crossImpactRisk}**`);
|
|
223
|
+
lines.push(`> ${actionVerb}`);
|
|
224
|
+
if (strategy.rationale && !strategy.rationale.includes('Default strategy')) {
|
|
225
|
+
lines.push(`> Rationale: ${strategy.rationale}`);
|
|
226
|
+
}
|
|
227
|
+
if (strategy.testCategories.length > 0) {
|
|
228
|
+
lines.push(`> Test types to cover: ${strategy.testCategories.join(', ')}`);
|
|
229
|
+
}
|
|
230
|
+
lines.push('');
|
|
231
|
+
// If test designs exist, show P0/P1 cases
|
|
232
|
+
if (td && td.testCases.length > 0) {
|
|
233
|
+
const p0Cases = td.testCases.filter((tc) => tc.priority === 'P0');
|
|
234
|
+
const p1Cases = td.testCases.filter((tc) => tc.priority === 'P1');
|
|
235
|
+
if (p0Cases.length > 0) {
|
|
236
|
+
lines.push('**P0 — Must test:**');
|
|
237
|
+
lines.push('');
|
|
238
|
+
for (const tc of p0Cases) {
|
|
239
|
+
lines.push(`- [ ] **${tc.name}** (${tc.type})`);
|
|
240
|
+
if (tc.preconditions.length > 0) {
|
|
241
|
+
lines.push(` - Preconditions: ${tc.preconditions.join('; ')}`);
|
|
242
|
+
}
|
|
243
|
+
lines.push(` - Steps: ${tc.steps.join(' → ')}`);
|
|
244
|
+
lines.push(` - Expected: ${tc.expectedOutcome}`);
|
|
245
|
+
}
|
|
246
|
+
lines.push('');
|
|
247
|
+
}
|
|
248
|
+
if (p1Cases.length > 0) {
|
|
249
|
+
lines.push(`<details><summary>P1 — Should test (${p1Cases.length})</summary>`);
|
|
250
|
+
lines.push('');
|
|
251
|
+
for (const tc of p1Cases) {
|
|
252
|
+
lines.push(`- [ ] **${tc.name}** (${tc.type}) — ${tc.expectedOutcome}`);
|
|
253
|
+
}
|
|
254
|
+
lines.push('');
|
|
255
|
+
lines.push('</details>');
|
|
256
|
+
lines.push('');
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// ── Covered flows ──
|
|
262
|
+
if (coveredStrategies.length > 0) {
|
|
263
|
+
lines.push('## Regression Check: Covered Flows (Already Have Tests)');
|
|
264
|
+
lines.push('');
|
|
265
|
+
lines.push('These flows have existing E2E specs. The existing tests should catch regressions automatically.');
|
|
266
|
+
lines.push('**No manual action required** unless CI tests fail on these flows.');
|
|
267
|
+
lines.push('');
|
|
268
|
+
for (const strategy of coveredStrategies) {
|
|
269
|
+
const td = crew.testDesigns.find((d) => d.flowId === strategy.flowId);
|
|
270
|
+
const caseCount = td ? td.testCases.length : 0;
|
|
271
|
+
const detail = caseCount > 0 ? ` | ${caseCount} cases` : '';
|
|
272
|
+
lines.push(`<details><summary><strong>${strategy.flowName}</strong> — ${strategy.approach}${detail} (${strategy.priority})</summary>`);
|
|
273
|
+
lines.push('');
|
|
274
|
+
lines.push(`Existing tests should cover this. Cross-impact risk: ${strategy.crossImpactRisk}`);
|
|
275
|
+
if (strategy.rationale && !strategy.rationale.includes('Default strategy')) {
|
|
276
|
+
lines.push(`> ${strategy.rationale}`);
|
|
277
|
+
}
|
|
278
|
+
if (strategy.testCategories.length > 0) {
|
|
279
|
+
lines.push(`Test categories: ${strategy.testCategories.join(', ')}`);
|
|
280
|
+
}
|
|
281
|
+
if (td && td.testCases.length > 0) {
|
|
282
|
+
lines.push('');
|
|
283
|
+
for (const tc of td.testCases) {
|
|
284
|
+
lines.push(`- [ ] **${tc.name}** (${tc.priority}, ${tc.type}) — ${tc.expectedOutcome}`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
lines.push('');
|
|
288
|
+
lines.push('</details>');
|
|
289
|
+
lines.push('');
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// ── Cross-impacts ──
|
|
293
|
+
const highRisk = crew.crossImpacts.filter((ci) => ci.riskLevel === 'high');
|
|
294
|
+
if (highRisk.length > 0) {
|
|
295
|
+
lines.push('## High-Risk Cross-Impacts — Verify Before Release');
|
|
296
|
+
lines.push('');
|
|
297
|
+
lines.push('Changes in one area may break these related areas. Manually verify or ensure E2E tests cover both sides:');
|
|
298
|
+
lines.push('');
|
|
299
|
+
for (const ci of highRisk) {
|
|
300
|
+
lines.push(`- **${ci.sourceFamily}** → **${ci.affectedFamily}**: ${ci.sharedDependency}`);
|
|
301
|
+
}
|
|
302
|
+
lines.push('');
|
|
303
|
+
}
|
|
304
|
+
return lines.join('\n');
|
|
305
|
+
}
|
|
306
|
+
function writeCrewArtifacts(reportRoot, crew, plan) {
|
|
307
|
+
const outputDir = (0, path_1.join)(reportRoot, '.e2e-ai-agents');
|
|
308
|
+
(0, fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
309
|
+
const crewSummaryPath = (0, path_1.join)(outputDir, 'crew-summary.json');
|
|
310
|
+
const crewMarkdownPath = (0, path_1.join)(outputDir, 'crew-summary.md');
|
|
311
|
+
const crewTestPlanPath = (0, path_1.join)(outputDir, 'crew-test-plan.md');
|
|
312
|
+
(0, fs_1.writeFileSync)(crewSummaryPath, JSON.stringify(crew, null, 2), 'utf-8');
|
|
313
|
+
(0, fs_1.writeFileSync)(crewMarkdownPath, buildCrewMarkdown(crew, plan), 'utf-8');
|
|
314
|
+
(0, fs_1.writeFileSync)(crewTestPlanPath, buildCrewTestPlan(crew, plan), 'utf-8');
|
|
315
|
+
return { crewSummaryPath, crewMarkdownPath, crewTestPlanPath };
|
|
316
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ParsedArgs } from '../types.js';
|
|
2
|
+
export declare function runTraceabilityCaptureCommand(args: ParsedArgs, autoConfig: string | undefined): void;
|
|
3
|
+
export declare function runTraceabilityIngestCommand(args: ParsedArgs, autoConfig: string | undefined): void;
|
|
4
|
+
//# sourceMappingURL=traceability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceability.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/traceability.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAE5C,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAmCpG;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAqCnG"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.runTraceabilityCaptureCommand = runTraceabilityCaptureCommand;
|
|
6
|
+
exports.runTraceabilityIngestCommand = runTraceabilityIngestCommand;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const config_js_1 = require("../../agent/config.js");
|
|
9
|
+
const traceability_capture_js_1 = require("../../agent/traceability_capture.js");
|
|
10
|
+
const traceability_ingest_js_1 = require("../../agent/traceability_ingest.js");
|
|
11
|
+
function runTraceabilityCaptureCommand(args, autoConfig) {
|
|
12
|
+
if (!args.path && !autoConfig) {
|
|
13
|
+
console.error('Error: --path is required for traceability-capture command');
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
if (!args.traceabilityReportPath) {
|
|
17
|
+
console.error('Error: --traceability-report <path> is required for traceability-capture command');
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
const { config } = (0, config_js_1.resolveConfig)(process.cwd(), autoConfig, {
|
|
21
|
+
path: args.path,
|
|
22
|
+
profile: args.profile,
|
|
23
|
+
testsRoot: args.testsRoot,
|
|
24
|
+
mode: 'impact',
|
|
25
|
+
gitSince: args.gitSince,
|
|
26
|
+
llmProvider: args.llmProvider,
|
|
27
|
+
});
|
|
28
|
+
const reportRoot = config.testsRoot || config.path;
|
|
29
|
+
const output = (0, traceability_capture_js_1.captureTraceabilityInput)({
|
|
30
|
+
appPath: config.path,
|
|
31
|
+
testsRoot: reportRoot,
|
|
32
|
+
reportPath: args.traceabilityReportPath,
|
|
33
|
+
sinceRef: args.gitSince || config.git.since,
|
|
34
|
+
outputPath: args.traceabilityCaptureOutputPath,
|
|
35
|
+
coverageMapPath: args.traceabilityCoverageMapPath,
|
|
36
|
+
changedFilesPath: args.traceabilityChangedFilesPath,
|
|
37
|
+
});
|
|
38
|
+
console.log(`Traceability input: ${output.outputPath}`);
|
|
39
|
+
console.log(`Traceability tests seen: ${output.testsSeen}`);
|
|
40
|
+
console.log(`Traceability runs generated: ${output.runsGenerated}`);
|
|
41
|
+
console.log(`Traceability changed files used: ${output.changedFilesUsed}`);
|
|
42
|
+
if (output.warnings.length > 0) {
|
|
43
|
+
console.log(`Traceability warnings: ${output.warnings.join(' | ')}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function runTraceabilityIngestCommand(args, autoConfig) {
|
|
47
|
+
if (!args.path && !autoConfig) {
|
|
48
|
+
console.error('Error: --path is required for traceability-ingest command');
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
if (!args.traceabilityInputPath) {
|
|
52
|
+
console.error('Error: --traceability-input <path> is required for traceability-ingest command');
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
const { config } = (0, config_js_1.resolveConfig)(process.cwd(), autoConfig, {
|
|
56
|
+
path: args.path,
|
|
57
|
+
profile: args.profile,
|
|
58
|
+
testsRoot: args.testsRoot,
|
|
59
|
+
mode: 'impact',
|
|
60
|
+
llmProvider: args.llmProvider,
|
|
61
|
+
});
|
|
62
|
+
const reportRoot = config.testsRoot || config.path;
|
|
63
|
+
const raw = JSON.parse((0, fs_1.readFileSync)(args.traceabilityInputPath, 'utf-8'));
|
|
64
|
+
const output = (0, traceability_ingest_js_1.ingestTraceabilityInput)(reportRoot, config.impact.traceability, raw, {
|
|
65
|
+
minHits: args.traceabilityMinHits,
|
|
66
|
+
maxFilesPerTest: args.traceabilityMaxFilesPerTest,
|
|
67
|
+
maxAgeDays: args.traceabilityMaxAgeDays,
|
|
68
|
+
});
|
|
69
|
+
console.log(`Traceability manifest: ${output.manifestPath}`);
|
|
70
|
+
console.log(`Traceability state: ${output.statePath}`);
|
|
71
|
+
console.log(`Traceability ingested entries: ${output.entriesIngested}`);
|
|
72
|
+
console.log(`Traceability tracked tests: ${output.testsTracked}`);
|
|
73
|
+
console.log(`Traceability tracked edges: ${output.edgesTracked}`);
|
|
74
|
+
if (output.warnings.length > 0) {
|
|
75
|
+
console.log(`Traceability warnings: ${output.warnings.join(' | ')}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"train.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/train.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAqI5C,wBAAsB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgQ1F"}
|