@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,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared cluster ID derivation for knowledge graph processing.
|
|
3
|
+
* Used by both kg_bridge.ts and kg_scanner.ts.
|
|
4
|
+
*/
|
|
5
|
+
/** Default directories to skip when deriving cluster IDs from file paths. */
|
|
6
|
+
declare const DEFAULT_SKIP_DIRS: Set<string>;
|
|
7
|
+
/** Extended skip set that also excludes test directories. */
|
|
8
|
+
declare const SKIP_DIRS_WITH_TESTS: Set<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Normalize a name to a snake_case cluster ID.
|
|
11
|
+
* Handles camelCase conversion, then strips non-alphanumeric characters.
|
|
12
|
+
*/
|
|
13
|
+
export declare function normalizeToClusterId(name: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Derive a cluster ID from a node that has an optional filePath and name.
|
|
16
|
+
* Prefers file path grouping for consistency.
|
|
17
|
+
*/
|
|
18
|
+
export declare function deriveClusterId(node: {
|
|
19
|
+
filePath?: string;
|
|
20
|
+
name: string;
|
|
21
|
+
}, skipDirs?: Set<string>): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Derive a cluster ID from a file path by finding the first meaningful
|
|
24
|
+
* directory segment after skipping common structural prefixes.
|
|
25
|
+
*/
|
|
26
|
+
export declare function deriveClusterIdFromPath(filePath: string, skipDirs?: Set<string>): string | null;
|
|
27
|
+
export { DEFAULT_SKIP_DIRS, SKIP_DIRS_WITH_TESTS };
|
|
28
|
+
//# sourceMappingURL=cluster_utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster_utils.d.ts","sourceRoot":"","sources":["../../src/knowledge/cluster_utils.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,6EAA6E;AAC7E,QAAA,MAAM,iBAAiB,aAGrB,CAAC;AAEH,6DAA6D;AAC7D,QAAA,MAAM,oBAAoB,aAGxB,CAAC;AAEH;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMzD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC3B,IAAI,EAAE;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,EACvC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB,MAAM,GAAG,IAAI,CAMf;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,GAAG,CAAC,MAAM,CAAqB,GAC1C,MAAM,GAAG,IAAI,CAef;AAED,OAAO,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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.SKIP_DIRS_WITH_TESTS = exports.DEFAULT_SKIP_DIRS = void 0;
|
|
6
|
+
exports.normalizeToClusterId = normalizeToClusterId;
|
|
7
|
+
exports.deriveClusterId = deriveClusterId;
|
|
8
|
+
exports.deriveClusterIdFromPath = deriveClusterIdFromPath;
|
|
9
|
+
/**
|
|
10
|
+
* Shared cluster ID derivation for knowledge graph processing.
|
|
11
|
+
* Used by both kg_bridge.ts and kg_scanner.ts.
|
|
12
|
+
*/
|
|
13
|
+
/** Default directories to skip when deriving cluster IDs from file paths. */
|
|
14
|
+
const DEFAULT_SKIP_DIRS = new Set([
|
|
15
|
+
'src', 'app', 'lib', 'packages', 'server', 'api', 'pages',
|
|
16
|
+
'components', 'features', 'modules',
|
|
17
|
+
]);
|
|
18
|
+
exports.DEFAULT_SKIP_DIRS = DEFAULT_SKIP_DIRS;
|
|
19
|
+
/** Extended skip set that also excludes test directories. */
|
|
20
|
+
const SKIP_DIRS_WITH_TESTS = new Set([
|
|
21
|
+
...DEFAULT_SKIP_DIRS,
|
|
22
|
+
'test', 'tests', 'e2e', 'spec', 'specs',
|
|
23
|
+
]);
|
|
24
|
+
exports.SKIP_DIRS_WITH_TESTS = SKIP_DIRS_WITH_TESTS;
|
|
25
|
+
/**
|
|
26
|
+
* Normalize a name to a snake_case cluster ID.
|
|
27
|
+
* Handles camelCase conversion, then strips non-alphanumeric characters.
|
|
28
|
+
*/
|
|
29
|
+
function normalizeToClusterId(name) {
|
|
30
|
+
return name
|
|
31
|
+
.replace(/[A-Z]/g, (c, idx) => (idx > 0 ? `_${c.toLowerCase()}` : c.toLowerCase()))
|
|
32
|
+
.replace(/[^a-z0-9_]/g, '_')
|
|
33
|
+
.replace(/_+/g, '_')
|
|
34
|
+
.replace(/^_|_$/g, '');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Derive a cluster ID from a node that has an optional filePath and name.
|
|
38
|
+
* Prefers file path grouping for consistency.
|
|
39
|
+
*/
|
|
40
|
+
function deriveClusterId(node, skipDirs) {
|
|
41
|
+
if (node.filePath) {
|
|
42
|
+
return deriveClusterIdFromPath(node.filePath, skipDirs);
|
|
43
|
+
}
|
|
44
|
+
const name = normalizeToClusterId(node.name);
|
|
45
|
+
return name && name.length > 1 ? name : null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Derive a cluster ID from a file path by finding the first meaningful
|
|
49
|
+
* directory segment after skipping common structural prefixes.
|
|
50
|
+
*/
|
|
51
|
+
function deriveClusterIdFromPath(filePath, skipDirs = DEFAULT_SKIP_DIRS) {
|
|
52
|
+
const parts = filePath.replace(/\\/g, '/').split('/').filter(Boolean);
|
|
53
|
+
for (const part of parts) {
|
|
54
|
+
if (skipDirs.has(part))
|
|
55
|
+
continue;
|
|
56
|
+
if (part.includes('.'))
|
|
57
|
+
continue; // skip files
|
|
58
|
+
const normalized = part.toLowerCase()
|
|
59
|
+
.replace(/[^a-z0-9_]/g, '_')
|
|
60
|
+
.replace(/_+/g, '_')
|
|
61
|
+
.replace(/^_|_$/g, '');
|
|
62
|
+
if (normalized && normalized.length > 1) {
|
|
63
|
+
return normalized;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ContextDocument {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LoadedContext {
|
|
7
|
+
documents: ContextDocument[];
|
|
8
|
+
warnings: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function loadContextDocuments(testsRoot: string, appRoot?: string, additionalFiles?: string[]): LoadedContext;
|
|
11
|
+
export declare function formatContextForPrompt(context: LoadedContext): string;
|
|
12
|
+
export declare function loadSpecFileContent(testsRoot: string, relativePath: string, maxChars?: number): string | null;
|
|
13
|
+
//# sourceMappingURL=context_loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context_loader.d.ts","sourceRoot":"","sources":["../../src/knowledge/context_loader.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAWD,wBAAgB,oBAAoB,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,MAAM,EAAE,GAC3B,aAAa,CA4Df;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAOrE;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,SAAQ,GAAG,MAAM,GAAG,IAAI,CAW5G"}
|
|
@@ -0,0 +1,90 @@
|
|
|
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.loadContextDocuments = loadContextDocuments;
|
|
6
|
+
exports.formatContextForPrompt = formatContextForPrompt;
|
|
7
|
+
exports.loadSpecFileContent = loadSpecFileContent;
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const MAX_CHARS_PER_DOC = 15000;
|
|
11
|
+
const MAX_TOTAL_CHARS = 40000;
|
|
12
|
+
const DEFAULT_CONTEXT_FILES = [
|
|
13
|
+
'CLAUDE.OPTIONAL.md',
|
|
14
|
+
'.claude/CLAUDE.OPTIONAL.md',
|
|
15
|
+
'README.md',
|
|
16
|
+
];
|
|
17
|
+
function loadContextDocuments(testsRoot, appRoot, additionalFiles) {
|
|
18
|
+
const warnings = [];
|
|
19
|
+
const documents = [];
|
|
20
|
+
let totalChars = 0;
|
|
21
|
+
const files = [...DEFAULT_CONTEXT_FILES, ...(additionalFiles || [])];
|
|
22
|
+
const seen = new Set();
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
if (totalChars >= MAX_TOTAL_CHARS) {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
const candidates = [
|
|
28
|
+
(0, path_1.join)(testsRoot, file),
|
|
29
|
+
...(appRoot && appRoot !== testsRoot ? [(0, path_1.join)(appRoot, file)] : []),
|
|
30
|
+
];
|
|
31
|
+
let found = false;
|
|
32
|
+
for (const candidate of candidates) {
|
|
33
|
+
const normalized = candidate.replace(/\\/g, '/');
|
|
34
|
+
if (seen.has(normalized)) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
seen.add(normalized);
|
|
38
|
+
if (!(0, fs_1.existsSync)(candidate)) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const raw = (0, fs_1.readFileSync)(candidate, 'utf-8').trim();
|
|
43
|
+
if (!raw) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const remaining = MAX_TOTAL_CHARS - totalChars;
|
|
47
|
+
const content = raw.slice(0, Math.min(MAX_CHARS_PER_DOC, remaining));
|
|
48
|
+
documents.push({
|
|
49
|
+
name: file,
|
|
50
|
+
path: normalized,
|
|
51
|
+
content,
|
|
52
|
+
});
|
|
53
|
+
totalChars += content.length;
|
|
54
|
+
found = true;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (!found && DEFAULT_CONTEXT_FILES.includes(file)) {
|
|
62
|
+
// Only warn for default files, not user-provided ones
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (documents.length === 0) {
|
|
66
|
+
warnings.push('No context documents found (CLAUDE.OPTIONAL.md, README.md). AI agents will have reduced context.');
|
|
67
|
+
}
|
|
68
|
+
return { documents, warnings };
|
|
69
|
+
}
|
|
70
|
+
function formatContextForPrompt(context) {
|
|
71
|
+
if (context.documents.length === 0) {
|
|
72
|
+
return 'No repository context documents available.';
|
|
73
|
+
}
|
|
74
|
+
return context.documents
|
|
75
|
+
.map((doc) => `### Context: ${doc.name}\n${doc.content}`)
|
|
76
|
+
.join('\n\n');
|
|
77
|
+
}
|
|
78
|
+
function loadSpecFileContent(testsRoot, relativePath, maxChars = 20000) {
|
|
79
|
+
const fullPath = (0, path_1.join)(testsRoot, relativePath);
|
|
80
|
+
if (!(0, fs_1.existsSync)(fullPath)) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const content = (0, fs_1.readFileSync)(fullPath, 'utf-8');
|
|
85
|
+
return content.slice(0, maxChars);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface FailureCorrelation {
|
|
2
|
+
/** Source file that was changed */
|
|
3
|
+
changedFile: string;
|
|
4
|
+
/** Spec file that failed */
|
|
5
|
+
specFile: string;
|
|
6
|
+
/** Number of times this correlation has been observed */
|
|
7
|
+
count: number;
|
|
8
|
+
/** ISO timestamp of last observation */
|
|
9
|
+
lastSeen: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FailureHistory {
|
|
12
|
+
correlations: FailureCorrelation[];
|
|
13
|
+
/** Total runs recorded */
|
|
14
|
+
totalRuns: number;
|
|
15
|
+
/** ISO timestamp of last update */
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function loadFailureHistory(testsRoot: string): FailureHistory;
|
|
19
|
+
export declare function saveFailureHistory(testsRoot: string, history: FailureHistory): void;
|
|
20
|
+
/**
|
|
21
|
+
* Record that a set of changed files caused a set of spec failures.
|
|
22
|
+
* Call this after a test run where failures were observed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function recordFailures(history: FailureHistory, changedFiles: string[], failedSpecs: string[]): FailureHistory;
|
|
25
|
+
/**
|
|
26
|
+
* Get a confidence boost (0-20) for a file based on historical failure patterns.
|
|
27
|
+
* A file that historically causes test failures gets a higher confidence boost
|
|
28
|
+
* when detected as impacted, meaning the system is more confident it needs testing.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getConfidenceBoost(history: FailureHistory, changedFile: string): number;
|
|
31
|
+
/**
|
|
32
|
+
* Get the most likely failing specs for a set of changed files, based on history.
|
|
33
|
+
* Returns specs sorted by correlation strength (count * recency).
|
|
34
|
+
*/
|
|
35
|
+
export declare function getPredictedFailures(history: FailureHistory, changedFiles: string[], limit?: number): Array<{
|
|
36
|
+
specFile: string;
|
|
37
|
+
score: number;
|
|
38
|
+
}>;
|
|
39
|
+
//# sourceMappingURL=failure_history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure_history.d.ts","sourceRoot":"","sources":["../../src/knowledge/failure_history.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,kBAAkB;IAC/B,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC3B,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;CACrB;AAQD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAcpE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAYnF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,MAAM,EAAE,EACtB,WAAW,EAAE,MAAM,EAAE,GACtB,cAAc,CA8BhB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAevF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,MAAM,EAAE,EACtB,KAAK,SAAK,GACX,KAAK,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC,CAoB1C"}
|
|
@@ -0,0 +1,128 @@
|
|
|
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.loadFailureHistory = loadFailureHistory;
|
|
6
|
+
exports.saveFailureHistory = saveFailureHistory;
|
|
7
|
+
exports.recordFailures = recordFailures;
|
|
8
|
+
exports.getConfidenceBoost = getConfidenceBoost;
|
|
9
|
+
exports.getPredictedFailures = getPredictedFailures;
|
|
10
|
+
/**
|
|
11
|
+
* Tracks historical test failure correlations: which tests fail when certain files change.
|
|
12
|
+
* Used to boost confidence in impact analysis — if a file change historically breaks a test,
|
|
13
|
+
* future changes to that file should prioritize that test.
|
|
14
|
+
*
|
|
15
|
+
* Data is stored as a JSON file at .e2e-ai-agents/failure-history.json.
|
|
16
|
+
*/
|
|
17
|
+
const fs_1 = require("fs");
|
|
18
|
+
const path_1 = require("path");
|
|
19
|
+
const DEFAULT_HISTORY = {
|
|
20
|
+
correlations: [],
|
|
21
|
+
totalRuns: 0,
|
|
22
|
+
updatedAt: new Date().toISOString(),
|
|
23
|
+
};
|
|
24
|
+
function loadFailureHistory(testsRoot) {
|
|
25
|
+
const historyPath = (0, path_1.join)(testsRoot, '.e2e-ai-agents', 'failure-history.json');
|
|
26
|
+
if (!(0, fs_1.existsSync)(historyPath)) {
|
|
27
|
+
return { ...DEFAULT_HISTORY };
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const raw = JSON.parse((0, fs_1.readFileSync)(historyPath, 'utf-8'));
|
|
31
|
+
if (!Array.isArray(raw.correlations)) {
|
|
32
|
+
return { ...DEFAULT_HISTORY };
|
|
33
|
+
}
|
|
34
|
+
return raw;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return { ...DEFAULT_HISTORY };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function saveFailureHistory(testsRoot, history) {
|
|
41
|
+
const historyPath = (0, path_1.join)(testsRoot, '.e2e-ai-agents', 'failure-history.json');
|
|
42
|
+
try {
|
|
43
|
+
const dir = (0, path_1.dirname)(historyPath);
|
|
44
|
+
if (!(0, fs_1.existsSync)(dir)) {
|
|
45
|
+
(0, fs_1.mkdirSync)(dir, { recursive: true });
|
|
46
|
+
}
|
|
47
|
+
history.updatedAt = new Date().toISOString();
|
|
48
|
+
(0, fs_1.writeFileSync)(historyPath, JSON.stringify(history, null, 2), 'utf-8');
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// Non-fatal — history is advisory, not required
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Record that a set of changed files caused a set of spec failures.
|
|
56
|
+
* Call this after a test run where failures were observed.
|
|
57
|
+
*/
|
|
58
|
+
function recordFailures(history, changedFiles, failedSpecs) {
|
|
59
|
+
const now = new Date().toISOString();
|
|
60
|
+
const updated = { ...history, totalRuns: history.totalRuns + 1, correlations: [...history.correlations] };
|
|
61
|
+
for (const changedFile of changedFiles) {
|
|
62
|
+
for (const specFile of failedSpecs) {
|
|
63
|
+
const existing = updated.correlations.find((c) => c.changedFile === changedFile && c.specFile === specFile);
|
|
64
|
+
if (existing) {
|
|
65
|
+
existing.count++;
|
|
66
|
+
existing.lastSeen = now;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
updated.correlations.push({
|
|
70
|
+
changedFile,
|
|
71
|
+
specFile,
|
|
72
|
+
count: 1,
|
|
73
|
+
lastSeen: now,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// Prune stale correlations (not seen in 90 days)
|
|
79
|
+
const cutoff = new Date();
|
|
80
|
+
cutoff.setDate(cutoff.getDate() - 90);
|
|
81
|
+
const cutoffStr = cutoff.toISOString();
|
|
82
|
+
updated.correlations = updated.correlations.filter((c) => c.lastSeen >= cutoffStr);
|
|
83
|
+
return updated;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get a confidence boost (0-20) for a file based on historical failure patterns.
|
|
87
|
+
* A file that historically causes test failures gets a higher confidence boost
|
|
88
|
+
* when detected as impacted, meaning the system is more confident it needs testing.
|
|
89
|
+
*/
|
|
90
|
+
function getConfidenceBoost(history, changedFile) {
|
|
91
|
+
const correlations = history.correlations.filter((c) => c.changedFile === changedFile);
|
|
92
|
+
if (correlations.length === 0) {
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
// More correlations and higher counts = more confidence
|
|
96
|
+
const totalCount = correlations.reduce((sum, c) => sum + c.count, 0);
|
|
97
|
+
const uniqueSpecs = correlations.length;
|
|
98
|
+
// Scale: 1 correlation = +5, 3+ = +10, 5+ with high counts = +15, max +20
|
|
99
|
+
if (totalCount >= 10 && uniqueSpecs >= 5)
|
|
100
|
+
return 20;
|
|
101
|
+
if (totalCount >= 5 && uniqueSpecs >= 3)
|
|
102
|
+
return 15;
|
|
103
|
+
if (totalCount >= 3)
|
|
104
|
+
return 10;
|
|
105
|
+
return 5;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get the most likely failing specs for a set of changed files, based on history.
|
|
109
|
+
* Returns specs sorted by correlation strength (count * recency).
|
|
110
|
+
*/
|
|
111
|
+
function getPredictedFailures(history, changedFiles, limit = 10) {
|
|
112
|
+
const specScores = new Map();
|
|
113
|
+
for (const changedFile of changedFiles) {
|
|
114
|
+
for (const c of history.correlations) {
|
|
115
|
+
if (c.changedFile !== changedFile)
|
|
116
|
+
continue;
|
|
117
|
+
// Score: count weighted by recency (days since last seen)
|
|
118
|
+
const daysSince = (Date.now() - new Date(c.lastSeen).getTime()) / (1000 * 60 * 60 * 24);
|
|
119
|
+
const recencyWeight = Math.max(0.1, 1 - daysSince / 90);
|
|
120
|
+
const score = c.count * recencyWeight;
|
|
121
|
+
specScores.set(c.specFile, (specScores.get(c.specFile) || 0) + score);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return Array.from(specScores.entries())
|
|
125
|
+
.map(([specFile, score]) => ({ specFile, score }))
|
|
126
|
+
.sort((a, b) => b.score - a.score)
|
|
127
|
+
.slice(0, limit);
|
|
128
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { KnowledgeGraph, DiffOverlay } from './kg_types.js';
|
|
2
|
+
import type { RouteFamilyManifest } from './route_families.js';
|
|
3
|
+
export type ProjectType = 'frontend' | 'backend' | 'fullstack';
|
|
4
|
+
/**
|
|
5
|
+
* Loads the knowledge graph from .understand-anything/knowledge-graph.json
|
|
6
|
+
* or from a custom path when provided.
|
|
7
|
+
*/
|
|
8
|
+
export declare function loadKnowledgeGraph(projectRoot: string, customPath?: string): KnowledgeGraph | null;
|
|
9
|
+
/**
|
|
10
|
+
* Classifies project type based on KG framework metadata.
|
|
11
|
+
*/
|
|
12
|
+
export declare function classifyProjectType(kg: KnowledgeGraph): ProjectType;
|
|
13
|
+
/**
|
|
14
|
+
* Core bridge: transforms KG into a RouteFamilyManifest.
|
|
15
|
+
*
|
|
16
|
+
* Strategy:
|
|
17
|
+
* - Frontend: cluster UI-layer nodes into families by module/component groups
|
|
18
|
+
* - Backend: cluster API-layer nodes, follow calls edges into Service→Data layers
|
|
19
|
+
* - Priority: P0 = high fan-in nodes, P1 = moderate, P2 = leaf/utility
|
|
20
|
+
* - userFlows: derived from KG tour steps referencing family nodes
|
|
21
|
+
*/
|
|
22
|
+
export declare function transformKGToFamilies(kg: KnowledgeGraph): RouteFamilyManifest;
|
|
23
|
+
/**
|
|
24
|
+
* Loads the diff overlay from .understand-anything/diff-overlay.json
|
|
25
|
+
*/
|
|
26
|
+
export declare function loadDiffOverlay(projectRoot: string): DiffOverlay | null;
|
|
27
|
+
/**
|
|
28
|
+
* Maps diff overlay changes to file paths using KG node resolution.
|
|
29
|
+
*/
|
|
30
|
+
export declare function diffOverlayToChangedFiles(overlay: DiffOverlay, kg: KnowledgeGraph): string[];
|
|
31
|
+
//# sourceMappingURL=kg_bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kg_bridge.d.ts","sourceRoot":"","sources":["../../src/knowledge/kg_bridge.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,cAAc,EAAkB,WAAW,EAAc,MAAM,eAAe,CAAC;AAE5F,OAAO,KAAK,EAAc,mBAAmB,EAAkB,MAAM,qBAAqB,CAAC;AAE3F,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAkB/D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CA6DlG;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,cAAc,GAAG,WAAW,CAQnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,cAAc,GAAG,mBAAmB,CAwC7E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAevE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,cAAc,GAAG,MAAM,EAAE,CAkB5F"}
|