igel-qe-core 1.0.3 → 1.0.7
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/dist/cli/index.js +638 -54
- package/dist/cli/platform.js +115 -72
- package/dist/mcp/server.js +258 -17
- package/package.json +4 -4
- package/src/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/agents/__init__.py +3 -0
- package/src/agents/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/automation_design_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/automation_design_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/automation_design_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/code_intelligence_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/code_intelligence_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/confidence_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/confidence_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/confidence_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/execution_validation_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/execution_validation_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/execution_validation_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/framework_analyzer_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/framework_analyzer_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/fusion_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/graph.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/intent_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/intent_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/kg_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/memory_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/reflection_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/regression_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/regression_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/requirement_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/requirement_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/requirement_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/retrieval_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/scenario_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/scenario_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/scenario_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/script_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/script_generator_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/script_generator_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/script_generator_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/state.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/temporal_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/testcase_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/testcase_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/testcase_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/validation_agent.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/validation_agent.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/validation_agent.cpython-314.pyc +0 -0
- package/src/agents/__pycache__/workflow_engine.cpython-311.pyc +0 -0
- package/src/agents/__pycache__/workflow_engine.cpython-313.pyc +0 -0
- package/src/agents/__pycache__/workflow_engine.cpython-314.pyc +0 -0
- package/{knowledge_base → src}/agents/automation_design_agent.py +14 -17
- package/{knowledge_base → src}/agents/code_intelligence_agent.py +2 -2
- package/src/agents/confidence_agent.py +114 -0
- package/{knowledge_base → src}/agents/execution_validation_agent.py +1 -1
- package/src/agents/feedback_agent.py +89 -0
- package/src/agents/framework_analyzer_agent.py +43 -0
- package/{knowledge_base → src}/agents/fusion_agent.py +3 -3
- package/{knowledge_base → src}/agents/graph.py +10 -10
- package/{knowledge_base → src}/agents/healing_agent.py +4 -4
- package/src/agents/intent_agent.py +30 -0
- package/src/agents/internal/__init__.py +3 -0
- package/src/agents/internal/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/agents/internal/__pycache__/approval_manager.cpython-313.pyc +0 -0
- package/src/agents/internal/__pycache__/question_engine.cpython-313.pyc +0 -0
- package/src/agents/internal/approval_manager.py +111 -0
- package/src/agents/internal/question_engine.py +111 -0
- package/src/agents/internal/workflow_engine.py +28 -0
- package/{knowledge_base → src}/agents/kg_agent.py +3 -3
- package/{knowledge_base → src}/agents/memory_agent.py +4 -4
- package/src/agents/orchestrator/__init__.py +3 -0
- package/src/agents/orchestrator/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/agents/orchestrator/__pycache__/orchestrator.cpython-313.pyc +0 -0
- package/src/agents/orchestrator/orchestrator.py +63 -0
- package/{knowledge_base → src}/agents/rca_agent.py +4 -4
- package/{knowledge_base → src}/agents/reflection_agent.py +1 -1
- package/{knowledge_base → src}/agents/regression_agent.py +2 -2
- package/src/agents/requirement_agent.py +97 -0
- package/{knowledge_base → src}/agents/retrieval_agent.py +2 -2
- package/{knowledge_base → src}/agents/scenario_agent.py +11 -17
- package/{knowledge_base → src}/agents/script_agent.py +6 -6
- package/{knowledge_base → src}/agents/script_generator_agent.py +12 -10
- package/{knowledge_base → src}/agents/temporal_agent.py +3 -3
- package/src/agents/testcase_agent.py +163 -0
- package/{knowledge_base → src}/agents/validation_agent.py +1 -1
- package/src/agents/workflow_engine.py +109 -0
- package/{knowledge_base → src}/alembic/README.md +4 -4
- package/{knowledge_base → src}/alembic/env.py +1 -1
- package/{knowledge_base → src}/alembic/script.py.mako +1 -1
- package/{knowledge_base → src}/api/middleware.py +3 -3
- package/{knowledge_base → src}/api/server.py +28 -28
- package/{knowledge_base → src}/chunking/chunker.py +3 -3
- package/src/cli/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/cli/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/cli/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/cli/__pycache__/workflow_cli.cpython-311.pyc +0 -0
- package/src/cli/__pycache__/workflow_cli.cpython-313.pyc +0 -0
- package/src/cli/__pycache__/workflow_cli.cpython-314.pyc +0 -0
- package/{knowledge_base → src}/cli/feedback_cli.py +10 -10
- package/{knowledge_base → src}/cli/generate.py +11 -11
- package/src/cli/index.ts +704 -0
- package/src/cli/platform.ts +147 -0
- package/src/cli/workflow_cli.py +930 -0
- package/{knowledge_base → src}/config/__init__.py +1 -1
- package/src/config/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/config/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/config/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/config/__pycache__/policy_config.cpython-311.pyc +0 -0
- package/src/config/__pycache__/policy_config.cpython-313.pyc +0 -0
- package/src/config/__pycache__/settings.cpython-311.pyc +0 -0
- package/src/config/__pycache__/settings.cpython-313.pyc +0 -0
- package/src/config/__pycache__/settings.cpython-314.pyc +0 -0
- package/src/config/policy_config.py +85 -0
- package/src/config/policy_rules.yaml +50 -0
- package/{knowledge_base → src}/config/settings.py +51 -6
- package/{knowledge_base → src}/connectors/__init__.py +1 -1
- package/src/connectors/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/connectors/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/connectors/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/connectors/__pycache__/base.cpython-311.pyc +0 -0
- package/src/connectors/__pycache__/base.cpython-313.pyc +0 -0
- package/src/connectors/__pycache__/base.cpython-314.pyc +0 -0
- package/src/connectors/__pycache__/jira_connector.cpython-311.pyc +0 -0
- package/src/connectors/__pycache__/jira_connector.cpython-313.pyc +0 -0
- package/src/connectors/__pycache__/jira_connector.cpython-314.pyc +0 -0
- package/src/connectors/__pycache__/query_bridge.cpython-313.pyc +0 -0
- package/src/connectors/__pycache__/query_bridge.cpython-314.pyc +0 -0
- package/src/connectors/bitbucket_connector.py +334 -0
- package/{knowledge_base → src}/connectors/community_connector.py +6 -6
- package/{knowledge_base → src}/connectors/confluence_connector.py +4 -4
- package/{knowledge_base → src}/connectors/jira_connector.py +7 -11
- package/{knowledge_base → src}/connectors/kb_igel_connector.py +6 -6
- package/{knowledge_base → src}/connectors/query_bridge.py +11 -11
- package/{knowledge_base → src}/connectors/search_backends.py +1 -1
- package/{knowledge_base → src}/connectors/serviceNow_connector.py +2 -2
- package/{knowledge_base → src}/connectors/sync_scheduler.py +12 -10
- package/{knowledge_base → src}/connectors/teamcity_connector.py +2 -2
- package/{knowledge_base → src}/connectors/testRail_connector.py +2 -2
- package/{knowledge_base → src}/connectors/web_fetcher.py +1 -1
- package/src/connectors/xray_connector.py +337 -0
- package/{knowledge_base → src}/core/__init__.py +1 -1
- package/src/core/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/core/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/core/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/core/__pycache__/circuit_breaker.cpython-313.pyc +0 -0
- package/src/core/__pycache__/circuit_breaker.cpython-314.pyc +0 -0
- package/src/core/__pycache__/confidence.cpython-311.pyc +0 -0
- package/src/core/__pycache__/confidence.cpython-313.pyc +0 -0
- package/src/core/__pycache__/confidence.cpython-314.pyc +0 -0
- package/src/core/__pycache__/context_engine.cpython-311.pyc +0 -0
- package/src/core/__pycache__/context_engine.cpython-313.pyc +0 -0
- package/src/core/__pycache__/evidence_resolver.cpython-311.pyc +0 -0
- package/src/core/__pycache__/evidence_resolver.cpython-313.pyc +0 -0
- package/src/core/__pycache__/guardrails.cpython-311.pyc +0 -0
- package/src/core/__pycache__/guardrails.cpython-313.pyc +0 -0
- package/src/core/__pycache__/hooks.cpython-311.pyc +0 -0
- package/src/core/__pycache__/hooks.cpython-313.pyc +0 -0
- package/src/core/__pycache__/intent_service.cpython-313.pyc +0 -0
- package/src/core/__pycache__/llm_executor.cpython-311.pyc +0 -0
- package/src/core/__pycache__/llm_executor.cpython-313.pyc +0 -0
- package/src/core/__pycache__/model_router.cpython-311.pyc +0 -0
- package/src/core/__pycache__/model_router.cpython-313.pyc +0 -0
- package/src/core/__pycache__/orchestration_contracts.cpython-311.pyc +0 -0
- package/src/core/__pycache__/orchestration_contracts.cpython-313.pyc +0 -0
- package/src/core/__pycache__/precedence.cpython-311.pyc +0 -0
- package/src/core/__pycache__/precedence.cpython-313.pyc +0 -0
- package/src/core/__pycache__/prompt_builder.cpython-311.pyc +0 -0
- package/src/core/__pycache__/prompt_builder.cpython-313.pyc +0 -0
- package/src/core/__pycache__/prompt_policy_engine.cpython-311.pyc +0 -0
- package/src/core/__pycache__/prompt_policy_engine.cpython-313.pyc +0 -0
- package/{knowledge_base → src}/core/cache.py +2 -2
- package/{knowledge_base → src}/core/confidence.py +2 -2
- package/src/core/context_engine.py +138 -0
- package/src/core/evidence_resolver.py +72 -0
- package/src/core/guardrails.py +22 -0
- package/src/core/hooks.py +57 -0
- package/src/core/intent_service.py +74 -0
- package/src/core/llm_executor.py +138 -0
- package/{knowledge_base → src}/core/logging_setup.py +1 -1
- package/src/core/model_router.py +246 -0
- package/src/core/orchestration_contracts.py +66 -0
- package/src/core/persistence_engine.py +159 -0
- package/src/core/prompt_builder.py +49 -0
- package/src/core/prompt_policy_engine.py +35 -0
- package/src/core/traceability_engine.py +56 -0
- package/src/db/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/db/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/db/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/db/__pycache__/client.cpython-311.pyc +0 -0
- package/src/db/__pycache__/client.cpython-313.pyc +0 -0
- package/src/db/__pycache__/client.cpython-314.pyc +0 -0
- package/src/db/__pycache__/igel_schema.cpython-311.pyc +0 -0
- package/src/db/__pycache__/igel_schema.cpython-313.pyc +0 -0
- package/src/db/__pycache__/igel_schema.cpython-314.pyc +0 -0
- package/src/db/__pycache__/kg_introspect.cpython-311.pyc +0 -0
- package/src/db/__pycache__/kg_introspect.cpython-313.pyc +0 -0
- package/{knowledge_base → src}/db/__pycache__/kg_introspect.cpython-314.pyc +0 -0
- package/{knowledge_base → src}/db/client.py +1 -1
- package/{knowledge_base → src}/db/connector_sync.py +1 -1
- package/{knowledge_base → src}/db/feedback_schema.py +2 -2
- package/{knowledge_base → src}/db/igel_schema.py +29 -4
- package/{knowledge_base → src}/db/kg_introspect.py +1 -1
- package/src/db/migrations.py +237 -0
- package/{knowledge_base → src}/db/schema.py +6 -6
- package/{knowledge_base → src}/deploy/Dockerfile +3 -3
- package/{knowledge_base → src}/deploy/feedback_automation.sh +3 -3
- package/{knowledge_base → src}/deploy/firecrawl-docker.sh +4 -4
- package/{knowledge_base → src}/deploy/igel-testgen.service +2 -2
- package/{knowledge_base → src}/deploy/install_reranker.sh +1 -1
- package/{knowledge_base → src}/deploy/requirements.txt +1 -2
- package/{knowledge_base → src}/deploy/run_server.sh +1 -1
- package/{knowledge_base → src}/docs/TEST_GENERATION_GUIDE.md +15 -15
- package/src/embeddings/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/embeddings/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/embeddings/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/embeddings/__pycache__/azure_embedder.cpython-311.pyc +0 -0
- package/src/embeddings/__pycache__/azure_embedder.cpython-313.pyc +0 -0
- package/{knowledge_base → src}/embeddings/__pycache__/azure_embedder.cpython-314.pyc +0 -0
- package/{knowledge_base → src}/embeddings/azure_embedder.py +10 -1
- package/{knowledge_base → src}/eval/__init__.py +3 -3
- package/{knowledge_base → src}/eval/__main__.py +7 -7
- package/src/eval/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/eval/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/eval/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/eval/__pycache__/baseline.cpython-311.pyc +0 -0
- package/src/eval/__pycache__/baseline.cpython-313.pyc +0 -0
- package/src/eval/__pycache__/baseline.cpython-314.pyc +0 -0
- package/src/eval/__pycache__/harness.cpython-311.pyc +0 -0
- package/src/eval/__pycache__/harness.cpython-313.pyc +0 -0
- package/src/eval/__pycache__/harness.cpython-314.pyc +0 -0
- package/src/eval/__pycache__/scorers.cpython-311.pyc +0 -0
- package/src/eval/__pycache__/scorers.cpython-313.pyc +0 -0
- package/src/eval/__pycache__/scorers.cpython-314.pyc +0 -0
- package/{knowledge_base → src}/eval/harness.py +6 -6
- package/{knowledge_base → src}/feedback/__init__.py +1 -1
- package/{knowledge_base → src}/feedback/analytics.py +1 -1
- package/{knowledge_base → src}/feedback/applier.py +4 -4
- package/{knowledge_base → src}/feedback/curator.py +2 -2
- package/{knowledge_base → src}/feedback/handler.py +1 -1
- package/src/generation/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/generation/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/generation/__pycache__/input_classifier.cpython-313.pyc +0 -0
- package/src/generation/__pycache__/manual_tc_parser.cpython-313.pyc +0 -0
- package/src/generation/__pycache__/prompts.cpython-313.pyc +0 -0
- package/src/generation/__pycache__/prompts.cpython-314.pyc +0 -0
- package/src/generation/__pycache__/test_generator.cpython-313.pyc +0 -0
- package/src/generation/__pycache__/test_generator.cpython-314.pyc +0 -0
- package/{knowledge_base → src}/generation/input_classifier.py +1 -1
- package/{knowledge_base → src}/generation/prompts.py +1 -1
- package/{knowledge_base → src}/generation/tc_transformer.py +10 -10
- package/{knowledge_base → src}/generation/test_generator.py +56 -10
- package/{knowledge_base → src}/graph_db/__init__.py +1 -1
- package/{knowledge_base → src}/graph_db/graphiti_client.py +2 -2
- package/{knowledge_base → src}/graph_db/kg_traversal.py +3 -3
- package/{knowledge_base → src}/graph_db/migrate_kg.py +4 -4
- package/{knowledge_base → src}/graph_db/neo4j_client.py +1 -1
- package/{knowledge_base → src}/graph_db/temporal_ingest.py +1 -1
- package/{knowledge_base → src}/ingestion/kg_extractor.py +6 -6
- package/{knowledge_base → src}/ingestion/web_ingest.py +6 -6
- package/src/intelligence/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/intelligence/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/intelligence/__pycache__/diff_analyzer.cpython-311.pyc +0 -0
- package/src/intelligence/__pycache__/diff_analyzer.cpython-313.pyc +0 -0
- package/src/intelligence/__pycache__/routing_engine.cpython-311.pyc +0 -0
- package/src/intelligence/__pycache__/routing_engine.cpython-313.pyc +0 -0
- package/src/intelligence/diff_analyzer.py +109 -0
- package/{knowledge_base → src}/intelligence/execution_ingest.py +3 -3
- package/src/intelligence/routing_engine.py +74 -0
- package/src/mcp/server.ts +384 -0
- package/src/memory/__init__.py +6 -0
- package/src/memory/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/memory/__pycache__/cognee_client.cpython-314.pyc +0 -0
- package/src/memory/__pycache__/memory_types.cpython-314.pyc +0 -0
- package/{knowledge_base → src}/memory/cognee_client.py +3 -3
- package/src/models/__pycache__/test_requirement.cpython-311.pyc +0 -0
- package/src/models/__pycache__/test_requirement.cpython-313.pyc +0 -0
- package/src/models/__pycache__/test_requirement.cpython-314.pyc +0 -0
- package/{knowledge_base → src}/models/test_requirement.py +12 -7
- package/{knowledge_base → src}/parsers/csv_parser.py +1 -1
- package/{knowledge_base → src}/parsers/doc_parser.py +1 -1
- package/{knowledge_base → src}/parsers/html_parser.py +1 -1
- package/{knowledge_base → src}/parsers/pdf_parser.py +1 -1
- package/src/project/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/project/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/project/__pycache__/ai_folder.cpython-311.pyc +0 -0
- package/src/project/__pycache__/ai_folder.cpython-313.pyc +0 -0
- package/src/project/__pycache__/context_enricher.cpython-313.pyc +0 -0
- package/src/project/__pycache__/context_projection_builder.cpython-311.pyc +0 -0
- package/src/project/__pycache__/context_projection_builder.cpython-313.pyc +0 -0
- package/src/project/__pycache__/context_requirement_sync.cpython-311.pyc +0 -0
- package/src/project/__pycache__/context_requirement_sync.cpython-313.pyc +0 -0
- package/src/project/ai_folder.py +602 -0
- package/src/project/context_enricher.py +333 -0
- package/src/project/context_projection_builder.py +167 -0
- package/src/project/context_requirement_sync.py +205 -0
- package/src/project/init_check.py +214 -0
- package/src/prompts/__pycache__/prompt_loader.cpython-313.pyc +0 -0
- package/src/prompts/automation_design.md +12 -0
- package/src/prompts/policies/automation_generation_policy.md +11 -0
- package/src/prompts/policies/generation_instructions.md +24 -0
- package/src/prompts/policies/guardrails.md +6 -0
- package/src/prompts/policies/traceability_policy.md +9 -0
- package/src/prompts/prompt_loader.py +56 -0
- package/src/prompts/requirement_understanding.md +17 -0
- package/src/prompts/scenario_generator.md +17 -0
- package/src/prompts/script_generator.md +13 -0
- package/src/prompts/test_case_generator.md +23 -0
- package/src/retrieval/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/retrieval/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/retrieval/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/retrieval/__pycache__/knowledge_graph.cpython-311.pyc +0 -0
- package/src/retrieval/__pycache__/knowledge_graph.cpython-313.pyc +0 -0
- package/src/retrieval/__pycache__/knowledge_graph.cpython-314.pyc +0 -0
- package/src/retrieval/__pycache__/retriever.cpython-311.pyc +0 -0
- package/src/retrieval/__pycache__/retriever.cpython-313.pyc +0 -0
- package/src/retrieval/__pycache__/retriever.cpython-314.pyc +0 -0
- package/src/retrieval/__pycache__/unified_query.cpython-313.pyc +0 -0
- package/src/retrieval/__pycache__/unified_query.cpython-314.pyc +0 -0
- package/{knowledge_base → src}/retrieval/context_fusion.py +3 -3
- package/{knowledge_base → src}/retrieval/knowledge_graph.py +4 -4
- package/{knowledge_base → src}/retrieval/reranker.py +2 -2
- package/{knowledge_base → src}/retrieval/retriever.py +11 -11
- package/{knowledge_base → src}/retrieval/unified_query.py +7 -7
- package/{knowledge_base → src}/retrieval/web_retriever.py +6 -6
- package/{knowledge_base → src}/validators/step_fidelity.py +1 -1
- package/src/vision/__init__.py +0 -0
- package/{knowledge_base → src}/vision/image_describer.py +1 -1
- package/knowledge_base/__pycache__/__init__.cpython-314.pyc +0 -0
- package/knowledge_base/agents/__init__.py +0 -6
- package/knowledge_base/agents/confidence_agent.py +0 -94
- package/knowledge_base/agents/feedback_agent.py +0 -56
- package/knowledge_base/agents/intent_agent.py +0 -76
- package/knowledge_base/agents/requirement_agent.py +0 -71
- package/knowledge_base/agents/testcase_agent.py +0 -111
- package/knowledge_base/agents/workflow_engine.py +0 -87
- package/knowledge_base/cli/generate_qcapps134.py +0 -391
- package/knowledge_base/cli/workflow_cli.py +0 -93
- package/knowledge_base/config/.env +0 -100
- package/knowledge_base/config/.env.example +0 -75
- package/knowledge_base/connectors/bitbucket_connector.py +0 -25
- package/knowledge_base/db/__pycache__/__init__.cpython-314.pyc +0 -0
- package/knowledge_base/db/__pycache__/client.cpython-314.pyc +0 -0
- package/knowledge_base/db/migrations.py +0 -22
- package/knowledge_base/embeddings/__pycache__/__init__.cpython-314.pyc +0 -0
- package/knowledge_base/ingestion/ingest.py +0 -346
- package/knowledge_base/ingestion/ingest_images.py +0 -330
- package/knowledge_base/memory/__init__.py +0 -6
- package/knowledge_base/memory/ingest_memory.py +0 -60
- /package/{knowledge_base → src}/__init__.py +0 -0
- /package/{knowledge_base → src}/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/confidence.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/config.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/config.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/config.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/context_fusion.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/context_fusion.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/feedback_analytics.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/feedback_applier.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/feedback_cli.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/feedback_curator.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/feedback_handler.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/generate.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/generate_qcapps134.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/input_classifier.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/input_classifier.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/kg_extractor.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/knowledge_graph.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/knowledge_graph.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/manual_tc_parser.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/manual_tc_parser.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/precedence.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/prompts.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/prompts.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/reranker.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/reranker.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/retrieval_debug.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/retrieval_debug.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/retriever.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/retriever.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/server.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/tc_transformer.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/tc_transformer.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/test_generator.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/__pycache__/test_generator.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/fusion_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/fusion_agent.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/graph.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/graph.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/healing_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/intent_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/intent_agent.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/kg_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/kg_agent.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/memory_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/memory_agent.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/rca_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/reflection_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/reflection_agent.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/regression_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/retrieval_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/retrieval_agent.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/script_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/script_agent.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/state.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/state.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/temporal_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/temporal_agent.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/validation_agent.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/agents/__pycache__/validation_agent.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/agents/state.py +0 -0
- /package/{knowledge_base → src}/alembic/__pycache__/env.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/alembic/__pycache__/env.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/alembic/versions/.gitkeep +0 -0
- /package/{knowledge_base → src}/alembic/versions/001_phase0_feedback.py +0 -0
- /package/{knowledge_base → src}/alembic/versions/002_feedback_promotions.py +0 -0
- /package/{knowledge_base → src}/alembic/versions/003_enterprise_hardening.py +0 -0
- /package/{knowledge_base → src}/alembic/versions/__pycache__/001_phase0_feedback.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/alembic/versions/__pycache__/001_phase0_feedback.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/alembic/versions/__pycache__/002_feedback_promotions.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/alembic/versions/__pycache__/002_feedback_promotions.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/api/__init__.py +0 -0
- /package/{knowledge_base → src}/api/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/api/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/api/__pycache__/middleware.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/api/__pycache__/server.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/api/__pycache__/server.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/chunking/__init__.py +0 -0
- /package/{knowledge_base → src}/chunking/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/chunking/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/chunking/__pycache__/chunker.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/chunking/__pycache__/chunker.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/chunking/__pycache__/validators.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/chunking/__pycache__/validators.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/chunking/validators.py +0 -0
- /package/{knowledge_base → src}/cli/__init__.py +0 -0
- /package/{knowledge_base → src}/cli/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/cli/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/cli/__pycache__/feedback_cli.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/cli/__pycache__/feedback_cli.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/cli/__pycache__/generate.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/cli/__pycache__/generate.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/cli/__pycache__/generate_qcapps134.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/config/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/config/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/config/__pycache__/settings.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/config/__pycache__/settings.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/base.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/base.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/bitbucket_connector.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/bitbucket_connector.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/community_connector.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/confluence_connector.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/confluence_connector.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/jira_connector.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/jira_connector.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/kb_igel_connector.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/playwright_fetcher.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/query_bridge.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/search_backends.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/serviceNow_connector.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/serviceNow_connector.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/sync_scheduler.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/sync_scheduler.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/teamcity_connector.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/teamcity_connector.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/testRail_connector.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/testRail_connector.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/__pycache__/web_fetcher.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/connectors/base.py +0 -0
- /package/{knowledge_base → src}/connectors/playwright_fetcher.py +0 -0
- /package/{knowledge_base → src}/core/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/cache.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/circuit_breaker.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/confidence.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/confidence.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/logging_setup.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/metrics.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/precedence.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/precedence.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/core/__pycache__/request_context.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/core/circuit_breaker.py +0 -0
- /package/{knowledge_base → src}/core/metrics.py +0 -0
- /package/{knowledge_base → src}/core/precedence.py +0 -0
- /package/{knowledge_base → src}/core/request_context.py +0 -0
- /package/{knowledge_base → src}/db/__init__.py +0 -0
- /package/{knowledge_base → src}/db/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/client.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/client.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/connector_sync.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/feedback_schema.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/feedback_schema.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/kg_introspect.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/kg_introspect.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/schema.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/db/__pycache__/schema.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/embeddings/__init__.py +0 -0
- /package/{knowledge_base → src}/embeddings/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/embeddings/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/embeddings/__pycache__/azure_embedder.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/embeddings/__pycache__/azure_embedder.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/eval/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/eval/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/eval/__pycache__/__main__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/eval/__pycache__/baseline.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/eval/__pycache__/baseline.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/eval/__pycache__/harness.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/eval/__pycache__/harness.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/eval/__pycache__/scorers.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/eval/__pycache__/scorers.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/eval/baseline.py +0 -0
- /package/{knowledge_base → src}/eval/queries_50.json +0 -0
- /package/{knowledge_base → src}/eval/scorers.py +0 -0
- /package/{knowledge_base → src}/exemplars/README.md +0 -0
- /package/{knowledge_base → src}/exemplars/__pycache__/pytest_reference_snippet.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/exemplars/gold_manual_concise_snippet.md +0 -0
- /package/{knowledge_base → src}/exemplars/gold_manual_detailed_snippet.md +0 -0
- /package/{knowledge_base → src}/exemplars/pytest_reference_snippet.py +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/analytics.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/analytics.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/applier.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/applier.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/curator.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/curator.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/handler.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/feedback/__pycache__/handler.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/generation/__init__.py +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/input_classifier.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/input_classifier.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/manual_tc_parser.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/manual_tc_parser.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/prompts.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/prompts.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/tc_transformer.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/test_generator.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/generation/__pycache__/test_generator.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/generation/manual_tc_parser.py +0 -0
- /package/{knowledge_base → src}/graph_db/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/graph_db/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/graph_db/__pycache__/graphiti_client.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/graph_db/__pycache__/kg_traversal.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/graph_db/__pycache__/migrate_kg.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/graph_db/__pycache__/neo4j_client.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/graph_db/__pycache__/neo4j_client.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/graph_db/__pycache__/schema.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/graph_db/__pycache__/temporal_ingest.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/graph_db/schema.py +0 -0
- /package/{knowledge_base → src}/ingestion/__init__.py +0 -0
- /package/{knowledge_base → src}/ingestion/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/ingestion/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/ingestion/__pycache__/ingest.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/ingestion/__pycache__/ingest.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/ingestion/__pycache__/ingest_images.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/ingestion/__pycache__/ingest_images.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/ingestion/__pycache__/kg_extractor.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/ingestion/__pycache__/kg_extractor.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/ingestion/__pycache__/web_ingest.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/intelligence/__init__.py +0 -0
- /package/{knowledge_base → src}/intelligence/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/intelligence/__pycache__/execution_ingest.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/intelligence/__pycache__/predictive_engine.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/intelligence/__pycache__/risk_scorer.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/intelligence/predictive_engine.py +0 -0
- /package/{knowledge_base → src}/intelligence/risk_scorer.py +0 -0
- /package/{knowledge_base → src}/memory/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/memory/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/memory/__pycache__/cognee_client.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/memory/__pycache__/cognee_client.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/memory/__pycache__/ingest_memory.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/memory/__pycache__/memory_types.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/memory/__pycache__/memory_types.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/memory/memory_types.py +0 -0
- /package/{knowledge_base → src}/parsers/__init__.py +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/csv_parser.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/csv_parser.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/doc_parser.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/doc_parser.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/html_parser.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/image_extractor.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/image_extractor.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/markdown_parser.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/markdown_parser.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/pdf_parser.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/parsers/__pycache__/pdf_parser.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/parsers/image_extractor.py +0 -0
- /package/{knowledge_base → src}/parsers/markdown_parser.py +0 -0
- /package/{knowledge_base/vision → src/project}/__init__.py +0 -0
- /package/{knowledge_base → src}/retrieval/__init__.py +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/context_fusion.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/context_fusion.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/knowledge_graph.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/knowledge_graph.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/reranker.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/reranker.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/retrieval_debug.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/retrieval_debug.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/retriever.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/retriever.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/unified_query.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/__pycache__/web_retriever.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/retrieval/retrieval_debug.py +0 -0
- /package/{knowledge_base → src}/validators/__init__.py +0 -0
- /package/{knowledge_base → src}/validators/__pycache__/__init__.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/validators/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/validators/__pycache__/step_fidelity.cpython-314.pyc +0 -0
- /package/{knowledge_base → src}/validators/__pycache__/step_fidelity.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/vision/__pycache__/__init__.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/vision/__pycache__/__init__.cpython-38.pyc +0 -0
- /package/{knowledge_base → src}/vision/__pycache__/image_describer.cpython-37.pyc +0 -0
- /package/{knowledge_base → src}/vision/__pycache__/image_describer.cpython-38.pyc +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Loads policy_rules.yaml at startup. Singleton via get_policy()."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
import yaml
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
_CONFIG_PATH = Path(__file__).parent / "policy_rules.yaml"
|
|
8
|
+
|
|
9
|
+
@dataclass(frozen=True)
|
|
10
|
+
class ConfidenceDimensions:
|
|
11
|
+
requirement_clarity: float = 0.25
|
|
12
|
+
evidence_quality: float = 0.20
|
|
13
|
+
business_rule_coverage: float = 0.15
|
|
14
|
+
traceability_coverage: float = 0.15
|
|
15
|
+
scenario_coverage: float = 0.15
|
|
16
|
+
structural_quality: float = 0.10
|
|
17
|
+
|
|
18
|
+
@dataclass(frozen=True)
|
|
19
|
+
class ConfidenceBands:
|
|
20
|
+
auto_approved: float = 0.80
|
|
21
|
+
qa_review: float = 0.60
|
|
22
|
+
sme_required: float = 0.40
|
|
23
|
+
|
|
24
|
+
@dataclass(frozen=True)
|
|
25
|
+
class PolicyConfig:
|
|
26
|
+
version: str = "1.0.0"
|
|
27
|
+
igel_os_version: str = "OS12"
|
|
28
|
+
max_prompt_chars: int = 30000
|
|
29
|
+
blocked_patterns: tuple[str, ...] = ()
|
|
30
|
+
confidence_dimensions: ConfidenceDimensions = field(default_factory=ConfidenceDimensions)
|
|
31
|
+
confidence_bands: ConfidenceBands = field(default_factory=ConfidenceBands)
|
|
32
|
+
top_k_chunks: int = 10
|
|
33
|
+
max_context_tokens: int = 8000
|
|
34
|
+
test_case_folder: str = "innominds/testcases"
|
|
35
|
+
automation_folder: str = "tests"
|
|
36
|
+
|
|
37
|
+
_policy: PolicyConfig | None = None
|
|
38
|
+
|
|
39
|
+
def get_policy() -> PolicyConfig:
|
|
40
|
+
global _policy
|
|
41
|
+
if _policy is None:
|
|
42
|
+
_policy = _load_policy()
|
|
43
|
+
return _policy
|
|
44
|
+
|
|
45
|
+
def _load_policy() -> PolicyConfig:
|
|
46
|
+
if not _CONFIG_PATH.exists():
|
|
47
|
+
return PolicyConfig()
|
|
48
|
+
|
|
49
|
+
with open(_CONFIG_PATH) as f:
|
|
50
|
+
raw = yaml.safe_load(f)
|
|
51
|
+
|
|
52
|
+
prompt_cfg = raw.get("prompt_policy", {})
|
|
53
|
+
conf_cfg = raw.get("confidence", {})
|
|
54
|
+
conf_dims = conf_cfg.get("dimensions", {})
|
|
55
|
+
conf_bands = conf_cfg.get("bands", {})
|
|
56
|
+
ctx_cfg = raw.get("context_engine", {})
|
|
57
|
+
folder_cfg = raw.get("folder_standards", {})
|
|
58
|
+
|
|
59
|
+
dims = ConfidenceDimensions(
|
|
60
|
+
requirement_clarity=conf_dims.get("requirement_clarity", 0.25),
|
|
61
|
+
evidence_quality=conf_dims.get("evidence_quality", 0.20),
|
|
62
|
+
business_rule_coverage=conf_dims.get("business_rule_coverage", 0.15),
|
|
63
|
+
traceability_coverage=conf_dims.get("traceability_coverage", 0.15),
|
|
64
|
+
scenario_coverage=conf_dims.get("scenario_coverage", 0.15),
|
|
65
|
+
structural_quality=conf_dims.get("structural_quality", 0.10)
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
bands = ConfidenceBands(
|
|
69
|
+
auto_approved=conf_bands.get("auto_approved", 0.80),
|
|
70
|
+
qa_review=conf_bands.get("qa_review", 0.60),
|
|
71
|
+
sme_required=conf_bands.get("sme_required", 0.40)
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
return PolicyConfig(
|
|
75
|
+
version=raw.get("version", "1.0.0"),
|
|
76
|
+
igel_os_version=raw.get("platform", {}).get("igel_os_version", "OS12"),
|
|
77
|
+
max_prompt_chars=prompt_cfg.get("max_prompt_chars", 30000),
|
|
78
|
+
blocked_patterns=tuple(prompt_cfg.get("blocked_patterns", [])),
|
|
79
|
+
confidence_dimensions=dims,
|
|
80
|
+
confidence_bands=bands,
|
|
81
|
+
top_k_chunks=ctx_cfg.get("top_k_chunks", 10),
|
|
82
|
+
max_context_tokens=ctx_cfg.get("max_context_tokens", 8000),
|
|
83
|
+
test_case_folder=folder_cfg.get("test_cases", "innominds/testcases"),
|
|
84
|
+
automation_folder=folder_cfg.get("automation_scripts", "tests")
|
|
85
|
+
)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
version: "1.0.0"
|
|
2
|
+
platform:
|
|
3
|
+
igel_os_version: "OS12" # OS12 only. Never reference OS11.
|
|
4
|
+
|
|
5
|
+
prompt_policy:
|
|
6
|
+
max_prompt_chars: 30000
|
|
7
|
+
blocked_patterns:
|
|
8
|
+
- "ignore all previous instructions"
|
|
9
|
+
- "reveal system prompt"
|
|
10
|
+
- "BEGIN PRIVATE KEY"
|
|
11
|
+
|
|
12
|
+
confidence:
|
|
13
|
+
dimensions:
|
|
14
|
+
requirement_clarity: 0.25
|
|
15
|
+
evidence_quality: 0.20
|
|
16
|
+
business_rule_coverage: 0.15
|
|
17
|
+
traceability_coverage: 0.15
|
|
18
|
+
scenario_coverage: 0.15
|
|
19
|
+
structural_quality: 0.10
|
|
20
|
+
bands:
|
|
21
|
+
auto_approved: 0.80 # >= 80% → auto-approved, ready for QA review
|
|
22
|
+
qa_review: 0.60 # 60–79% → QA review recommended
|
|
23
|
+
sme_required: 0.40 # 40–59% → SME review required
|
|
24
|
+
# < 40% → rejected, not persisted
|
|
25
|
+
|
|
26
|
+
approval:
|
|
27
|
+
existing_code_requires_user_approval: true
|
|
28
|
+
|
|
29
|
+
context_engine:
|
|
30
|
+
top_k_chunks: 10
|
|
31
|
+
max_context_tokens: 8000
|
|
32
|
+
source_priority:
|
|
33
|
+
- jira
|
|
34
|
+
- xray
|
|
35
|
+
- confluence
|
|
36
|
+
- postgres_kb
|
|
37
|
+
- igel_os12_docs
|
|
38
|
+
- igel_community_docs
|
|
39
|
+
|
|
40
|
+
folder_standards:
|
|
41
|
+
test_cases: "innominds/testcases"
|
|
42
|
+
automation_scripts: "tests"
|
|
43
|
+
|
|
44
|
+
security:
|
|
45
|
+
never_expose:
|
|
46
|
+
- api_keys
|
|
47
|
+
- tokens
|
|
48
|
+
- passwords
|
|
49
|
+
- credentials
|
|
50
|
+
- internal_secrets
|
|
@@ -3,11 +3,6 @@ from __future__ import annotations
|
|
|
3
3
|
import os
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
|
-
from dotenv import load_dotenv
|
|
7
|
-
|
|
8
|
-
_ENV_PATH = Path(__file__).parent / ".env"
|
|
9
|
-
load_dotenv(_ENV_PATH)
|
|
10
|
-
|
|
11
6
|
|
|
12
7
|
def _truthy(raw: str | None, default: bool = False) -> bool:
|
|
13
8
|
if raw is None or raw == "":
|
|
@@ -226,10 +221,54 @@ class Config:
|
|
|
226
221
|
CONFLUENCE_USERNAME: str = os.getenv("CONFLUENCE_USERNAME", "")
|
|
227
222
|
CONFLUENCE_API_TOKEN: str = os.getenv("CONFLUENCE_API_TOKEN", "")
|
|
228
223
|
|
|
224
|
+
# Jira OAuth2 client credentials (Atlassian OAuth 2.0 app)
|
|
225
|
+
JIRA_CLIENT_ID: str = os.getenv("JIRA_CLIENT_ID", "")
|
|
226
|
+
JIRA_CLIENT_SECRET: str = os.getenv("JIRA_CLIENT_SECRET", "")
|
|
227
|
+
JIRA_OAUTH_TOKEN_URL: str = os.getenv("JIRA_OAUTH_TOKEN_URL", "https://auth.atlassian.com/oauth/token")
|
|
228
|
+
|
|
229
|
+
# Confluence OAuth2 client credentials
|
|
230
|
+
CONFLUENCE_OAUTH_TOKEN: str = os.getenv("CONFLUENCE_OAUTH_TOKEN", "")
|
|
231
|
+
CONFLUENCE_CLIENT_ID: str = os.getenv("CONFLUENCE_CLIENT_ID", "")
|
|
232
|
+
CONFLUENCE_CLIENT_SECRET: str = os.getenv("CONFLUENCE_CLIENT_SECRET", "")
|
|
233
|
+
|
|
234
|
+
# Bitbucket
|
|
229
235
|
BITBUCKET_ENABLED: bool = _truthy(os.getenv("BITBUCKET_ENABLED"), False)
|
|
236
|
+
BITBUCKET_URL: str = os.getenv("BITBUCKET_URL", "https://bitbucket.org")
|
|
237
|
+
BITBUCKET_WORKSPACE: str = os.getenv("BITBUCKET_WORKSPACE", "")
|
|
238
|
+
BITBUCKET_REPO_SLUG: str = os.getenv("BITBUCKET_REPO_SLUG", "")
|
|
239
|
+
BITBUCKET_USERNAME: str = os.getenv("BITBUCKET_USERNAME", "")
|
|
240
|
+
BITBUCKET_APP_PASSWORD: str = os.getenv("BITBUCKET_APP_PASSWORD", "")
|
|
241
|
+
BITBUCKET_ACCESS_TOKEN: str = os.getenv("BITBUCKET_ACCESS_TOKEN", "")
|
|
242
|
+
BITBUCKET_CLIENT_ID: str = os.getenv("BITBUCKET_CLIENT_ID", "")
|
|
243
|
+
BITBUCKET_CLIENT_SECRET: str = os.getenv("BITBUCKET_CLIENT_SECRET", "")
|
|
244
|
+
BITBUCKET_WEBHOOK_SECRET: str = os.getenv("BITBUCKET_WEBHOOK_SECRET", "")
|
|
245
|
+
BITBUCKET_REPO_PATH: str = os.getenv("BITBUCKET_REPO_PATH", ".")
|
|
246
|
+
|
|
247
|
+
# Xray (Cloud: client_id/secret; Server/DC: api_token)
|
|
248
|
+
XRAY_ENABLED: bool = _truthy(os.getenv("XRAY_ENABLED"), False)
|
|
249
|
+
XRAY_CLIENT_ID: str = os.getenv("XRAY_CLIENT_ID", "")
|
|
250
|
+
XRAY_CLIENT_SECRET: str = os.getenv("XRAY_CLIENT_SECRET", "")
|
|
251
|
+
XRAY_API_TOKEN: str = os.getenv("XRAY_API_TOKEN", "")
|
|
252
|
+
XRAY_CLOUD_AUTH_URL: str = os.getenv(
|
|
253
|
+
"XRAY_CLOUD_AUTH_URL", "https://xray.cloud.getxray.app/api/v2/authenticate"
|
|
254
|
+
)
|
|
255
|
+
XRAY_CLOUD_BASE_URL: str = os.getenv(
|
|
256
|
+
"XRAY_CLOUD_BASE_URL", "https://xray.cloud.getxray.app/api/v2"
|
|
257
|
+
)
|
|
258
|
+
|
|
230
259
|
TEAMCITY_ENABLED: bool = _truthy(os.getenv("TEAMCITY_ENABLED"), False)
|
|
260
|
+
TEAMCITY_URL: str = os.getenv("TEAMCITY_URL", "")
|
|
261
|
+
TEAMCITY_TOKEN: str = os.getenv("TEAMCITY_TOKEN", "")
|
|
262
|
+
|
|
231
263
|
TESTRAIL_ENABLED: bool = _truthy(os.getenv("TESTRAIL_ENABLED"), False)
|
|
264
|
+
TESTRAIL_URL: str = os.getenv("TESTRAIL_URL", "")
|
|
265
|
+
TESTRAIL_USERNAME: str = os.getenv("TESTRAIL_USERNAME", "")
|
|
266
|
+
TESTRAIL_API_KEY: str = os.getenv("TESTRAIL_API_KEY", "")
|
|
267
|
+
|
|
232
268
|
SERVICENOW_ENABLED: bool = _truthy(os.getenv("SERVICENOW_ENABLED"), False)
|
|
269
|
+
SERVICENOW_URL: str = os.getenv("SERVICENOW_URL", "")
|
|
270
|
+
SERVICENOW_USERNAME: str = os.getenv("SERVICENOW_USERNAME", "")
|
|
271
|
+
SERVICENOW_PASSWORD: str = os.getenv("SERVICENOW_PASSWORD", "")
|
|
233
272
|
|
|
234
273
|
# ── Operational memory (Phase 4) ─────────────────────────────────────────
|
|
235
274
|
COGNEE_ENABLED: bool = _truthy(os.getenv("COGNEE_ENABLED"), True)
|
|
@@ -262,9 +301,15 @@ class Config:
|
|
|
262
301
|
# ── Generation modes (Phase I) ───────────────────────────────────────────
|
|
263
302
|
DEFAULT_GENERATION_MODE: str = os.getenv("DEFAULT_GENERATION_MODE", "pipeline")
|
|
264
303
|
|
|
304
|
+
# ── V2 Orchestrator and governance flags ─────────────────────────────────
|
|
305
|
+
V2_ORCHESTRATOR_ENABLED: bool = _truthy(os.getenv("V2_ORCHESTRATOR_ENABLED"), False)
|
|
306
|
+
V2_GOVERNANCE_ENFORCED: bool = _truthy(os.getenv("V2_GOVERNANCE_ENFORCED"), False)
|
|
307
|
+
V2_QUESTION_ENGINE_ENABLED: bool = _truthy(os.getenv("V2_QUESTION_ENGINE_ENABLED"), False)
|
|
308
|
+
V2_APPROVAL_MANAGER_ENABLED: bool = _truthy(os.getenv("V2_APPROVAL_MANAGER_ENABLED"), False)
|
|
309
|
+
|
|
265
310
|
@property
|
|
266
311
|
def api_key_map(self) -> dict[str, str]:
|
|
267
|
-
from
|
|
312
|
+
from src.core.request_context import parse_api_keys
|
|
268
313
|
keys = parse_api_keys(self.API_KEYS)
|
|
269
314
|
if self.API_KEY and self.API_KEY not in keys:
|
|
270
315
|
keys[self.API_KEY] = "admin"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
"""Bitbucket connector — full implementation with OAuth2 client credentials,
|
|
2
|
+
Basic Auth (App Password), and pull/push event webhook processing.
|
|
3
|
+
|
|
4
|
+
Supports:
|
|
5
|
+
- Bitbucket Cloud: OAuth2 consumer (BITBUCKET_CLIENT_ID + BITBUCKET_CLIENT_SECRET)
|
|
6
|
+
- Bitbucket Server/DC: App Password (BITBUCKET_USERNAME + BITBUCKET_APP_PASSWORD)
|
|
7
|
+
or Bearer token (BITBUCKET_ACCESS_TOKEN)
|
|
8
|
+
- Background pull sync: indexes changed file paths + LOC into DB on every push event
|
|
9
|
+
"""
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import hashlib
|
|
13
|
+
import hmac
|
|
14
|
+
import logging
|
|
15
|
+
import time
|
|
16
|
+
from datetime import datetime
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
import httpx
|
|
20
|
+
|
|
21
|
+
from src.config import cfg
|
|
22
|
+
from src.connectors.base import BaseConnector
|
|
23
|
+
|
|
24
|
+
logger = logging.getLogger(__name__)
|
|
25
|
+
|
|
26
|
+
_BITBUCKET_CLOUD_TOKEN_URL = "https://bitbucket.org/site/oauth2/access_token"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class BitbucketConnector(BaseConnector):
|
|
30
|
+
"""Full Bitbucket connector with webhook-driven pull sync → Asset Registry."""
|
|
31
|
+
|
|
32
|
+
name = "bitbucket"
|
|
33
|
+
enabled = cfg.BITBUCKET_ENABLED
|
|
34
|
+
supports_sync = True
|
|
35
|
+
|
|
36
|
+
def __init__(self) -> None:
|
|
37
|
+
super().__init__()
|
|
38
|
+
self._token: str | None = None
|
|
39
|
+
self._token_expiry: float = 0.0
|
|
40
|
+
self._use_oauth2 = bool(
|
|
41
|
+
getattr(cfg, "BITBUCKET_CLIENT_ID", "")
|
|
42
|
+
and getattr(cfg, "BITBUCKET_CLIENT_SECRET", "")
|
|
43
|
+
)
|
|
44
|
+
self._use_bearer = bool(getattr(cfg, "BITBUCKET_ACCESS_TOKEN", ""))
|
|
45
|
+
self._base_url = (getattr(cfg, "BITBUCKET_URL", "https://bitbucket.org") or "https://bitbucket.org").rstrip("/")
|
|
46
|
+
self._workspace = getattr(cfg, "BITBUCKET_WORKSPACE", "")
|
|
47
|
+
|
|
48
|
+
# ── Authentication ─────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
def _fetch_oauth2_token(self) -> str | None:
|
|
51
|
+
"""Fetch access token via OAuth2 client credentials (Bitbucket Cloud)."""
|
|
52
|
+
client_id = getattr(cfg, "BITBUCKET_CLIENT_ID", "")
|
|
53
|
+
client_secret = getattr(cfg, "BITBUCKET_CLIENT_SECRET", "")
|
|
54
|
+
try:
|
|
55
|
+
with httpx.Client(timeout=15.0) as client:
|
|
56
|
+
resp = client.post(
|
|
57
|
+
_BITBUCKET_CLOUD_TOKEN_URL,
|
|
58
|
+
data={"grant_type": "client_credentials"},
|
|
59
|
+
auth=(client_id, client_secret),
|
|
60
|
+
)
|
|
61
|
+
resp.raise_for_status()
|
|
62
|
+
data = resp.json()
|
|
63
|
+
self._token = data["access_token"]
|
|
64
|
+
self._token_expiry = time.time() + int(data.get("expires_in", 7200)) - 60
|
|
65
|
+
logger.info("Bitbucket OAuth2 token obtained (expires in %ss)", data.get("expires_in"))
|
|
66
|
+
return self._token
|
|
67
|
+
except Exception as e:
|
|
68
|
+
logger.error("Bitbucket OAuth2 token fetch failed: %s", e)
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
def _get_auth(self) -> dict:
|
|
72
|
+
"""Return httpx kwargs for the current auth mode."""
|
|
73
|
+
if self._use_oauth2:
|
|
74
|
+
if not self._token or time.time() >= self._token_expiry:
|
|
75
|
+
self._fetch_oauth2_token()
|
|
76
|
+
if self._token:
|
|
77
|
+
return {"headers": {"Authorization": f"Bearer {self._token}"}}
|
|
78
|
+
if self._use_bearer:
|
|
79
|
+
return {"headers": {"Authorization": f"Bearer {getattr(cfg, 'BITBUCKET_ACCESS_TOKEN', '')}"}}
|
|
80
|
+
username = getattr(cfg, "BITBUCKET_USERNAME", "")
|
|
81
|
+
password = getattr(cfg, "BITBUCKET_APP_PASSWORD", "")
|
|
82
|
+
if username and password:
|
|
83
|
+
return {"auth": (username, password)}
|
|
84
|
+
return {}
|
|
85
|
+
|
|
86
|
+
def connect(self) -> bool:
|
|
87
|
+
if not self.enabled:
|
|
88
|
+
return False
|
|
89
|
+
if not self._use_oauth2 and not self._use_bearer:
|
|
90
|
+
if not (getattr(cfg, "BITBUCKET_USERNAME", "") and getattr(cfg, "BITBUCKET_APP_PASSWORD", "")):
|
|
91
|
+
logger.warning("Bitbucket: no credentials configured")
|
|
92
|
+
return False
|
|
93
|
+
return True
|
|
94
|
+
|
|
95
|
+
# ── Webhook Signature Validation ───────────────────────────────────
|
|
96
|
+
|
|
97
|
+
def validate_webhook_signature(self, body: bytes, signature_header: str) -> bool:
|
|
98
|
+
"""Validate Bitbucket webhook HMAC-SHA256 signature.
|
|
99
|
+
|
|
100
|
+
Header format: "sha256=<hex_digest>"
|
|
101
|
+
Set BITBUCKET_WEBHOOK_SECRET in your environment.
|
|
102
|
+
"""
|
|
103
|
+
secret = getattr(cfg, "BITBUCKET_WEBHOOK_SECRET", "")
|
|
104
|
+
if not secret:
|
|
105
|
+
logger.warning("BITBUCKET_WEBHOOK_SECRET not set; skipping signature validation")
|
|
106
|
+
return True
|
|
107
|
+
try:
|
|
108
|
+
expected = hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
|
|
109
|
+
received = signature_header.replace("sha256=", "")
|
|
110
|
+
return hmac.compare_digest(expected, received)
|
|
111
|
+
except Exception as e:
|
|
112
|
+
logger.error("Webhook signature validation error: %s", e)
|
|
113
|
+
return False
|
|
114
|
+
|
|
115
|
+
# ── Pull / Push Event Processing (Background Sync) ─────────────────
|
|
116
|
+
|
|
117
|
+
def sync_pull_event(self, payload: dict) -> dict:
|
|
118
|
+
"""Process a Bitbucket push/PR-merge webhook payload.
|
|
119
|
+
|
|
120
|
+
Background process triggered when users pull/push to Bitbucket:
|
|
121
|
+
1. Extracts changed file paths from the push payload
|
|
122
|
+
2. Stores file_path + LOC metadata in igel_bitbucket_file_locs
|
|
123
|
+
3. Runs CodeIntelligenceAgent delta-sync on changed Python files
|
|
124
|
+
4. Runs RegressionAgent impact analysis
|
|
125
|
+
5. Returns a summary dict
|
|
126
|
+
|
|
127
|
+
Bitbucket Cloud push event payload shape:
|
|
128
|
+
{ "repository": {"slug": "...", "workspace": {"slug": "..."}},
|
|
129
|
+
"push": {"changes": [{"commits": [{"hash": "...", "date": "...",
|
|
130
|
+
"author": {"raw": "..."}}]}]} }
|
|
131
|
+
"""
|
|
132
|
+
if not self.enabled:
|
|
133
|
+
return {"status": "disabled", "files_indexed": 0}
|
|
134
|
+
|
|
135
|
+
repo_info = payload.get("repository") or {}
|
|
136
|
+
repo_slug = repo_info.get("slug", "")
|
|
137
|
+
workspace_info = repo_info.get("workspace", {})
|
|
138
|
+
workspace = (workspace_info.get("slug") if isinstance(workspace_info, dict) else workspace_info) or self._workspace
|
|
139
|
+
|
|
140
|
+
changed_files_info: list[dict] = []
|
|
141
|
+
changes = (payload.get("push") or {}).get("changes") or []
|
|
142
|
+
for change in changes:
|
|
143
|
+
for commit in (change.get("commits") or []):
|
|
144
|
+
commit_hash = commit.get("hash", "")
|
|
145
|
+
if not commit_hash:
|
|
146
|
+
continue
|
|
147
|
+
files = self._fetch_commit_diff_files(workspace, repo_slug, commit_hash)
|
|
148
|
+
for f in files:
|
|
149
|
+
f["commit"] = commit_hash
|
|
150
|
+
f["author"] = (commit.get("author") or {}).get("raw", "")
|
|
151
|
+
f["commit_date"] = commit.get("date", "")
|
|
152
|
+
changed_files_info.extend(files)
|
|
153
|
+
|
|
154
|
+
# Deduplicate by path (keep latest)
|
|
155
|
+
seen: dict[str, dict] = {}
|
|
156
|
+
for f in changed_files_info:
|
|
157
|
+
seen[f["file_path"]] = f
|
|
158
|
+
unique_files = list(seen.values())
|
|
159
|
+
|
|
160
|
+
# Persist file LOC data
|
|
161
|
+
self._store_file_locs(unique_files, repo_slug, workspace)
|
|
162
|
+
|
|
163
|
+
# Delta-sync automation assets (Python files only)
|
|
164
|
+
from src.agents.regression_agent import BitbucketSyncAgent, RegressionAgent
|
|
165
|
+
repo_path = Path(getattr(cfg, "BITBUCKET_REPO_PATH", "."))
|
|
166
|
+
|
|
167
|
+
files_indexed = 0
|
|
168
|
+
try:
|
|
169
|
+
sync_agent = BitbucketSyncAgent(repo_path)
|
|
170
|
+
local_changed = [repo_path / f["file_path"] for f in unique_files if (repo_path / f["file_path"]).exists()]
|
|
171
|
+
files_indexed = sync_agent.sync_changed_files(local_changed)
|
|
172
|
+
except Exception as e:
|
|
173
|
+
logger.error("BitbucketSyncAgent failed: %s", e)
|
|
174
|
+
|
|
175
|
+
# Impact analysis
|
|
176
|
+
impact: dict = {}
|
|
177
|
+
try:
|
|
178
|
+
changed_paths = [Path(f["file_path"]) for f in unique_files]
|
|
179
|
+
reg_agent = RegressionAgent()
|
|
180
|
+
impact = reg_agent.analyze_impact(changed_paths, repo_path)
|
|
181
|
+
except Exception as e:
|
|
182
|
+
logger.error("RegressionAgent failed: %s", e)
|
|
183
|
+
|
|
184
|
+
return {
|
|
185
|
+
"status": "complete",
|
|
186
|
+
"repo": f"{workspace}/{repo_slug}",
|
|
187
|
+
"files_changed": len(unique_files),
|
|
188
|
+
"files_indexed": files_indexed,
|
|
189
|
+
"affected_requirements": impact.get("affected_requirements", []),
|
|
190
|
+
"affected_scripts": impact.get("affected_scripts", []),
|
|
191
|
+
"affected_assets": impact.get("affected_assets", []),
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
def _fetch_commit_diff_files(self, workspace: str, repo_slug: str, commit_hash: str) -> list[dict]:
|
|
195
|
+
"""Fetch file diffs for a commit via Bitbucket diffstat API."""
|
|
196
|
+
if not workspace or not repo_slug or not commit_hash:
|
|
197
|
+
return []
|
|
198
|
+
auth = self._get_auth()
|
|
199
|
+
results: list[dict] = []
|
|
200
|
+
try:
|
|
201
|
+
with httpx.Client(timeout=20.0, **auth) as client:
|
|
202
|
+
url = f"{self._base_url}/2.0/repositories/{workspace}/{repo_slug}/diffstat/{commit_hash}"
|
|
203
|
+
while url:
|
|
204
|
+
resp = client.get(url, params={"pagelen": 50})
|
|
205
|
+
resp.raise_for_status()
|
|
206
|
+
data = resp.json()
|
|
207
|
+
for item in data.get("values") or []:
|
|
208
|
+
status = item.get("status", "modified")
|
|
209
|
+
new_path = (item.get("new") or {}).get("path") or ""
|
|
210
|
+
old_path = (item.get("old") or {}).get("path") or ""
|
|
211
|
+
file_path = new_path or old_path
|
|
212
|
+
if file_path:
|
|
213
|
+
results.append({
|
|
214
|
+
"file_path": file_path,
|
|
215
|
+
"status": status,
|
|
216
|
+
"lines_added": item.get("lines_added", 0),
|
|
217
|
+
"lines_removed": item.get("lines_removed", 0),
|
|
218
|
+
})
|
|
219
|
+
url = data.get("next")
|
|
220
|
+
except Exception as e:
|
|
221
|
+
logger.warning("Failed to fetch diffstat for %s@%s: %s", repo_slug, commit_hash[:8], e)
|
|
222
|
+
return results
|
|
223
|
+
|
|
224
|
+
def _store_file_locs(self, files: list[dict], repo_slug: str, workspace: str) -> None:
|
|
225
|
+
"""Persist file path + LOC data to igel_bitbucket_file_locs table."""
|
|
226
|
+
if not files:
|
|
227
|
+
return
|
|
228
|
+
try:
|
|
229
|
+
from src.db.client import get_conn
|
|
230
|
+
with get_conn() as conn:
|
|
231
|
+
with conn.cursor() as cur:
|
|
232
|
+
cur.execute("""
|
|
233
|
+
CREATE TABLE IF NOT EXISTS igel_bitbucket_file_locs (
|
|
234
|
+
id BIGSERIAL PRIMARY KEY,
|
|
235
|
+
workspace TEXT NOT NULL,
|
|
236
|
+
repo_slug TEXT NOT NULL,
|
|
237
|
+
file_path TEXT NOT NULL,
|
|
238
|
+
status TEXT,
|
|
239
|
+
lines_added INT DEFAULT 0,
|
|
240
|
+
lines_removed INT DEFAULT 0,
|
|
241
|
+
commit_hash TEXT,
|
|
242
|
+
author TEXT,
|
|
243
|
+
commit_date TIMESTAMPTZ,
|
|
244
|
+
recorded_at TIMESTAMPTZ DEFAULT NOW(),
|
|
245
|
+
UNIQUE (workspace, repo_slug, file_path, commit_hash)
|
|
246
|
+
)
|
|
247
|
+
""")
|
|
248
|
+
cur.execute("""
|
|
249
|
+
CREATE INDEX IF NOT EXISTS bb_file_locs_repo_idx
|
|
250
|
+
ON igel_bitbucket_file_locs(workspace, repo_slug)
|
|
251
|
+
""")
|
|
252
|
+
cur.execute("""
|
|
253
|
+
CREATE INDEX IF NOT EXISTS bb_file_locs_path_idx
|
|
254
|
+
ON igel_bitbucket_file_locs(file_path)
|
|
255
|
+
""")
|
|
256
|
+
for f in files:
|
|
257
|
+
commit_date = None
|
|
258
|
+
raw_date = f.get("commit_date")
|
|
259
|
+
if raw_date:
|
|
260
|
+
try:
|
|
261
|
+
from dateutil import parser as dateparser
|
|
262
|
+
commit_date = dateparser.parse(raw_date)
|
|
263
|
+
except Exception:
|
|
264
|
+
pass
|
|
265
|
+
cur.execute("""
|
|
266
|
+
INSERT INTO igel_bitbucket_file_locs
|
|
267
|
+
(workspace, repo_slug, file_path, status, lines_added,
|
|
268
|
+
lines_removed, commit_hash, author, commit_date)
|
|
269
|
+
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)
|
|
270
|
+
ON CONFLICT (workspace, repo_slug, file_path, commit_hash)
|
|
271
|
+
DO UPDATE SET
|
|
272
|
+
lines_added = EXCLUDED.lines_added,
|
|
273
|
+
lines_removed = EXCLUDED.lines_removed,
|
|
274
|
+
status = EXCLUDED.status,
|
|
275
|
+
recorded_at = NOW()
|
|
276
|
+
""", (
|
|
277
|
+
workspace, repo_slug,
|
|
278
|
+
f["file_path"], f.get("status", "modified"),
|
|
279
|
+
f.get("lines_added", 0), f.get("lines_removed", 0),
|
|
280
|
+
f.get("commit", ""), f.get("author", ""), commit_date,
|
|
281
|
+
))
|
|
282
|
+
conn.commit()
|
|
283
|
+
logger.info("Stored LOC data for %d files in igel_bitbucket_file_locs", len(files))
|
|
284
|
+
except Exception as e:
|
|
285
|
+
logger.error("Failed to store file LOC data: %s", e)
|
|
286
|
+
|
|
287
|
+
# ── File LOC Retrieval ─────────────────────────────────────────────
|
|
288
|
+
|
|
289
|
+
def fetch_file_locs(self, repo_slug: str, commit: str, workspace: str = "") -> list[dict]:
|
|
290
|
+
"""Fetch file LOC data for a specific commit via Bitbucket API."""
|
|
291
|
+
ws = workspace or self._workspace
|
|
292
|
+
return self._fetch_commit_diff_files(ws, repo_slug, commit)
|
|
293
|
+
|
|
294
|
+
def get_stored_file_locs(self, repo_slug: str, workspace: str = "", limit: int = 100) -> list[dict]:
|
|
295
|
+
"""Query DB for recently recorded file LOC data."""
|
|
296
|
+
ws = workspace or self._workspace
|
|
297
|
+
try:
|
|
298
|
+
from src.db.client import get_conn
|
|
299
|
+
with get_conn() as conn:
|
|
300
|
+
with conn.cursor() as cur:
|
|
301
|
+
cur.execute("""
|
|
302
|
+
SELECT file_path, status, lines_added, lines_removed,
|
|
303
|
+
commit_hash, author, commit_date, recorded_at
|
|
304
|
+
FROM igel_bitbucket_file_locs
|
|
305
|
+
WHERE workspace = %s AND repo_slug = %s
|
|
306
|
+
ORDER BY recorded_at DESC
|
|
307
|
+
LIMIT %s
|
|
308
|
+
""", (ws, repo_slug, limit))
|
|
309
|
+
cols = ["file_path", "status", "lines_added", "lines_removed",
|
|
310
|
+
"commit_hash", "author", "commit_date", "recorded_at"]
|
|
311
|
+
return [dict(zip(cols, row)) for row in cur.fetchall()]
|
|
312
|
+
except Exception as e:
|
|
313
|
+
logger.error("Failed to query file LOC data: %s", e)
|
|
314
|
+
return []
|
|
315
|
+
|
|
316
|
+
# ── BaseConnector interface ────────────────────────────────────────
|
|
317
|
+
|
|
318
|
+
def sync(self, since: datetime | None = None) -> list[dict]:
|
|
319
|
+
"""Returns recently stored file LOC records for configured repo."""
|
|
320
|
+
if not self.enabled or not self._workspace:
|
|
321
|
+
return []
|
|
322
|
+
repo_slug = getattr(cfg, "BITBUCKET_REPO_SLUG", "")
|
|
323
|
+
if not repo_slug:
|
|
324
|
+
return []
|
|
325
|
+
return self.get_stored_file_locs(repo_slug, self._workspace)
|
|
326
|
+
|
|
327
|
+
def ingest_to_kg(self, items: list[dict]) -> int:
|
|
328
|
+
return 0
|
|
329
|
+
|
|
330
|
+
def ingest_to_rag(self, items: list[dict]) -> int:
|
|
331
|
+
return 0
|
|
332
|
+
|
|
333
|
+
def search(self, query: str, limit: int = 5, timeout: float | None = None) -> list[str]:
|
|
334
|
+
return []
|
|
@@ -7,10 +7,10 @@ from datetime import datetime
|
|
|
7
7
|
from typing import Any
|
|
8
8
|
from urllib.parse import quote_plus
|
|
9
9
|
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
10
|
+
from src.config import cfg
|
|
11
|
+
from src.connectors.base import BaseConnector
|
|
12
|
+
from src.connectors.web_fetcher import fetch_url, search_confluence_site
|
|
13
|
+
from src.parsers.html_parser import parse_html_page
|
|
14
14
|
|
|
15
15
|
logger = logging.getLogger(__name__)
|
|
16
16
|
|
|
@@ -84,7 +84,7 @@ class CommunityConnector(BaseConnector):
|
|
|
84
84
|
def ingest_to_kg(self, items: list[dict]) -> int:
|
|
85
85
|
if not items:
|
|
86
86
|
return 0
|
|
87
|
-
from
|
|
87
|
+
from src.db.client import get_conn
|
|
88
88
|
import json
|
|
89
89
|
count = 0
|
|
90
90
|
with get_conn() as conn:
|
|
@@ -107,6 +107,6 @@ class CommunityConnector(BaseConnector):
|
|
|
107
107
|
return count
|
|
108
108
|
|
|
109
109
|
def ingest_to_rag(self, items: list[dict]) -> int:
|
|
110
|
-
from
|
|
110
|
+
from src.ingestion.web_ingest import ingest_web_items
|
|
111
111
|
|
|
112
112
|
return ingest_web_items(items, source_label="community.igel.com")
|