agentic-qe 3.6.7 → 3.6.9
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/.claude/skills/README.md +1 -1
- package/.claude/skills/skills-manifest.json +1 -1
- package/package.json +5 -2
- package/scripts/benchmark-aqe-baseline.ts +614 -0
- package/v3/CHANGELOG.md +33 -0
- package/v3/dist/adapters/a2a/agent-cards/generator.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/agent-cards/generator.js +2 -1
- package/v3/dist/adapters/a2a/agent-cards/generator.js.map +1 -1
- package/v3/dist/adapters/a2a/auth/jwt-utils.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/auth/jwt-utils.js +3 -2
- package/v3/dist/adapters/a2a/auth/jwt-utils.js.map +1 -1
- package/v3/dist/adapters/a2a/auth/middleware.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/auth/middleware.js +3 -0
- package/v3/dist/adapters/a2a/auth/middleware.js.map +1 -1
- package/v3/dist/adapters/a2a/discovery/agent-health.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/discovery/agent-health.js +4 -3
- package/v3/dist/adapters/a2a/discovery/agent-health.js.map +1 -1
- package/v3/dist/adapters/a2a/discovery/file-watcher.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/discovery/file-watcher.js +3 -2
- package/v3/dist/adapters/a2a/discovery/file-watcher.js.map +1 -1
- package/v3/dist/adapters/a2a/discovery/hot-reload-service.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/discovery/hot-reload-service.js +6 -5
- package/v3/dist/adapters/a2a/discovery/hot-reload-service.js.map +1 -1
- package/v3/dist/adapters/a2a/jsonrpc/envelope.d.ts.map +1 -1
- package/v3/dist/adapters/a2a/jsonrpc/envelope.js +5 -4
- package/v3/dist/adapters/a2a/jsonrpc/envelope.js.map +1 -1
- package/v3/dist/adapters/ag-ui/event-adapter.d.ts.map +1 -1
- package/v3/dist/adapters/ag-ui/event-adapter.js +2 -1
- package/v3/dist/adapters/ag-ui/event-adapter.js.map +1 -1
- package/v3/dist/adapters/ag-ui/event-batcher.d.ts.map +1 -1
- package/v3/dist/adapters/ag-ui/event-batcher.js +2 -1
- package/v3/dist/adapters/ag-ui/event-batcher.js.map +1 -1
- package/v3/dist/adapters/ag-ui/json-patch-utils.d.ts.map +1 -1
- package/v3/dist/adapters/ag-ui/json-patch-utils.js +2 -1
- package/v3/dist/adapters/ag-ui/json-patch-utils.js.map +1 -1
- package/v3/dist/adapters/ag-ui/json-patch.d.ts +1 -1
- package/v3/dist/adapters/ag-ui/json-patch.d.ts.map +1 -1
- package/v3/dist/adapters/ag-ui/json-patch.js +4 -6
- package/v3/dist/adapters/ag-ui/json-patch.js.map +1 -1
- package/v3/dist/adapters/ag-ui/stream-controller.d.ts.map +1 -1
- package/v3/dist/adapters/ag-ui/stream-controller.js +3 -0
- package/v3/dist/adapters/ag-ui/stream-controller.js.map +1 -1
- package/v3/dist/adapters/claude-flow/detect.d.ts.map +1 -1
- package/v3/dist/adapters/claude-flow/detect.js +4 -3
- package/v3/dist/adapters/claude-flow/detect.js.map +1 -1
- package/v3/dist/adapters/claude-flow/pretrain-bridge.d.ts.map +1 -1
- package/v3/dist/adapters/claude-flow/pretrain-bridge.js +7 -5
- package/v3/dist/adapters/claude-flow/pretrain-bridge.js.map +1 -1
- package/v3/dist/adapters/claude-flow/trajectory-bridge.d.ts.map +1 -1
- package/v3/dist/adapters/claude-flow/trajectory-bridge.js +2 -14
- package/v3/dist/adapters/claude-flow/trajectory-bridge.js.map +1 -1
- package/v3/dist/adapters/trajectory-adapter.d.ts.map +1 -1
- package/v3/dist/adapters/trajectory-adapter.js +5 -3
- package/v3/dist/adapters/trajectory-adapter.js.map +1 -1
- package/v3/dist/agents/claim-verifier/verifiers/test-verifier.d.ts.map +1 -1
- package/v3/dist/agents/claim-verifier/verifiers/test-verifier.js +2 -1
- package/v3/dist/agents/claim-verifier/verifiers/test-verifier.js.map +1 -1
- package/v3/dist/benchmarks/performance-benchmarks.d.ts.map +1 -1
- package/v3/dist/benchmarks/performance-benchmarks.js +4 -3
- package/v3/dist/benchmarks/performance-benchmarks.js.map +1 -1
- package/v3/dist/benchmarks/run-benchmarks.js +27 -45
- package/v3/dist/benchmarks/run-benchmarks.js.map +1 -1
- package/v3/dist/cli/bundle.js +13395 -14755
- package/v3/dist/cli/commands/claude-flow-setup.d.ts.map +1 -1
- package/v3/dist/cli/commands/claude-flow-setup.js +7 -5
- package/v3/dist/cli/commands/claude-flow-setup.js.map +1 -1
- package/v3/dist/cli/commands/hooks.d.ts.map +1 -1
- package/v3/dist/cli/commands/hooks.js +2 -1
- package/v3/dist/cli/commands/hooks.js.map +1 -1
- package/v3/dist/cli/commands/init.d.ts.map +1 -1
- package/v3/dist/cli/commands/init.js +2 -1
- package/v3/dist/cli/commands/init.js.map +1 -1
- package/v3/dist/cli/commands/learning-helpers.d.ts +101 -0
- package/v3/dist/cli/commands/learning-helpers.d.ts.map +1 -0
- package/v3/dist/cli/commands/learning-helpers.js +294 -0
- package/v3/dist/cli/commands/learning-helpers.js.map +1 -0
- package/v3/dist/cli/commands/learning.d.ts +1 -6
- package/v3/dist/cli/commands/learning.d.ts.map +1 -1
- package/v3/dist/cli/commands/learning.js +230 -839
- package/v3/dist/cli/commands/learning.js.map +1 -1
- package/v3/dist/cli/commands/qe-tools.d.ts.map +1 -1
- package/v3/dist/cli/commands/qe-tools.js +2 -1
- package/v3/dist/cli/commands/qe-tools.js.map +1 -1
- package/v3/dist/cli/commands/sync.d.ts.map +1 -1
- package/v3/dist/cli/commands/sync.js +5 -4
- package/v3/dist/cli/commands/sync.js.map +1 -1
- package/v3/dist/cli/commands/token-usage.d.ts.map +1 -1
- package/v3/dist/cli/commands/token-usage.js +2 -1
- package/v3/dist/cli/commands/token-usage.js.map +1 -1
- package/v3/dist/cli/commands/validate.d.ts.map +1 -1
- package/v3/dist/cli/commands/validate.js +3 -2
- package/v3/dist/cli/commands/validate.js.map +1 -1
- package/v3/dist/cli/config/cli-config.d.ts.map +1 -1
- package/v3/dist/cli/config/cli-config.js +2 -1
- package/v3/dist/cli/config/cli-config.js.map +1 -1
- package/v3/dist/cli/handlers/init-handler.d.ts.map +1 -1
- package/v3/dist/cli/handlers/init-handler.js +3 -2
- package/v3/dist/cli/handlers/init-handler.js.map +1 -1
- package/v3/dist/cli/helpers/safe-json.d.ts +4 -48
- package/v3/dist/cli/helpers/safe-json.d.ts.map +1 -1
- package/v3/dist/cli/helpers/safe-json.js +4 -68
- package/v3/dist/cli/helpers/safe-json.js.map +1 -1
- package/v3/dist/cli/index.js +3 -2
- package/v3/dist/cli/index.js.map +1 -1
- package/v3/dist/cli/scheduler/persistent-scheduler.d.ts.map +1 -1
- package/v3/dist/cli/scheduler/persistent-scheduler.js +4 -2
- package/v3/dist/cli/scheduler/persistent-scheduler.js.map +1 -1
- package/v3/dist/cli/wizards/test-wizard.d.ts.map +1 -1
- package/v3/dist/cli/wizards/test-wizard.js +2 -1
- package/v3/dist/cli/wizards/test-wizard.js.map +1 -1
- package/v3/dist/coordination/agent-teams/tracing.d.ts.map +1 -1
- package/v3/dist/coordination/agent-teams/tracing.js +2 -1
- package/v3/dist/coordination/agent-teams/tracing.js.map +1 -1
- package/v3/dist/coordination/circuit-breaker/breaker-registry.d.ts.map +1 -1
- package/v3/dist/coordination/circuit-breaker/breaker-registry.js +3 -2
- package/v3/dist/coordination/circuit-breaker/breaker-registry.js.map +1 -1
- package/v3/dist/coordination/circuit-breaker/domain-circuit-breaker.d.ts.map +1 -1
- package/v3/dist/coordination/circuit-breaker/domain-circuit-breaker.js +3 -2
- package/v3/dist/coordination/circuit-breaker/domain-circuit-breaker.js.map +1 -1
- package/v3/dist/coordination/consensus/consensus-engine.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/consensus-engine.js +7 -6
- package/v3/dist/coordination/consensus/consensus-engine.js.map +1 -1
- package/v3/dist/coordination/consensus/model-provider.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/model-provider.js +2 -1
- package/v3/dist/coordination/consensus/model-provider.js.map +1 -1
- package/v3/dist/coordination/consensus/providers/claude-provider.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/providers/claude-provider.js +13 -12
- package/v3/dist/coordination/consensus/providers/claude-provider.js.map +1 -1
- package/v3/dist/coordination/consensus/providers/gemini-provider.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/providers/gemini-provider.js +13 -12
- package/v3/dist/coordination/consensus/providers/gemini-provider.js.map +1 -1
- package/v3/dist/coordination/consensus/providers/native-learning-provider.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/providers/native-learning-provider.js +3 -2
- package/v3/dist/coordination/consensus/providers/native-learning-provider.js.map +1 -1
- package/v3/dist/coordination/consensus/providers/ollama-provider.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/providers/ollama-provider.js +3 -2
- package/v3/dist/coordination/consensus/providers/ollama-provider.js.map +1 -1
- package/v3/dist/coordination/consensus/providers/openai-provider.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/providers/openai-provider.js +3 -2
- package/v3/dist/coordination/consensus/providers/openai-provider.js.map +1 -1
- package/v3/dist/coordination/consensus/providers/openrouter-provider.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/providers/openrouter-provider.js +3 -2
- package/v3/dist/coordination/consensus/providers/openrouter-provider.js.map +1 -1
- package/v3/dist/coordination/dynamic-scaling/dynamic-scaler.d.ts.map +1 -1
- package/v3/dist/coordination/dynamic-scaling/dynamic-scaler.js +5 -4
- package/v3/dist/coordination/dynamic-scaling/dynamic-scaler.js.map +1 -1
- package/v3/dist/coordination/mincut/dream-integration.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/dream-integration.js.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts +4 -2
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.js +13 -3
- package/v3/dist/coordination/mincut/mincut-health-monitor.js.map +1 -1
- package/v3/dist/coordination/mincut/mincut-persistence.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/mincut-persistence.js +5 -4
- package/v3/dist/coordination/mincut/mincut-persistence.js.map +1 -1
- package/v3/dist/coordination/mincut/neural-goap.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/neural-goap.js +2 -1
- package/v3/dist/coordination/mincut/neural-goap.js.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.js +7 -2
- package/v3/dist/coordination/mincut/queen-integration.js.map +1 -1
- package/v3/dist/coordination/mincut/strange-loop.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/strange-loop.js +10 -2
- package/v3/dist/coordination/mincut/strange-loop.js.map +1 -1
- package/v3/dist/coordination/mincut/time-crystal.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/time-crystal.js +2 -1
- package/v3/dist/coordination/mincut/time-crystal.js.map +1 -1
- package/v3/dist/coordination/mixins/consensus-enabled-domain.d.ts +19 -3
- package/v3/dist/coordination/mixins/consensus-enabled-domain.d.ts.map +1 -1
- package/v3/dist/coordination/mixins/consensus-enabled-domain.js +6 -2
- package/v3/dist/coordination/mixins/consensus-enabled-domain.js.map +1 -1
- package/v3/dist/coordination/plugin.d.ts +1 -1
- package/v3/dist/coordination/plugin.d.ts.map +1 -1
- package/v3/dist/coordination/plugin.js +1 -1
- package/v3/dist/coordination/plugin.js.map +1 -1
- package/v3/dist/coordination/protocol-executor.d.ts.map +1 -1
- package/v3/dist/coordination/protocol-executor.js +4 -3
- package/v3/dist/coordination/protocol-executor.js.map +1 -1
- package/v3/dist/coordination/protocols/code-intelligence-index.d.ts +1 -1
- package/v3/dist/coordination/protocols/code-intelligence-index.d.ts.map +1 -1
- package/v3/dist/coordination/protocols/code-intelligence-index.js +22 -10
- package/v3/dist/coordination/protocols/code-intelligence-index.js.map +1 -1
- package/v3/dist/coordination/protocols/defect-investigation.d.ts +2 -2
- package/v3/dist/coordination/protocols/defect-investigation.d.ts.map +1 -1
- package/v3/dist/coordination/protocols/defect-investigation.js +16 -7
- package/v3/dist/coordination/protocols/defect-investigation.js.map +1 -1
- package/v3/dist/coordination/protocols/learning-consolidation.d.ts +1 -1
- package/v3/dist/coordination/protocols/learning-consolidation.d.ts.map +1 -1
- package/v3/dist/coordination/protocols/learning-consolidation.js +6 -5
- package/v3/dist/coordination/protocols/learning-consolidation.js.map +1 -1
- package/v3/dist/coordination/protocols/morning-sync.d.ts.map +1 -1
- package/v3/dist/coordination/protocols/morning-sync.js +2 -1
- package/v3/dist/coordination/protocols/morning-sync.js.map +1 -1
- package/v3/dist/coordination/protocols/quality-gate.d.ts.map +1 -1
- package/v3/dist/coordination/protocols/quality-gate.js +6 -5
- package/v3/dist/coordination/protocols/quality-gate.js.map +1 -1
- package/v3/dist/coordination/protocols/security-audit.d.ts +1 -1
- package/v3/dist/coordination/protocols/security-audit.d.ts.map +1 -1
- package/v3/dist/coordination/protocols/security-audit.js +35 -13
- package/v3/dist/coordination/protocols/security-audit.js.map +1 -1
- package/v3/dist/coordination/queen-coordinator.d.ts +26 -257
- package/v3/dist/coordination/queen-coordinator.d.ts.map +1 -1
- package/v3/dist/coordination/queen-coordinator.js +282 -1175
- package/v3/dist/coordination/queen-coordinator.js.map +1 -1
- package/v3/dist/coordination/queen-event-handlers.d.ts +61 -0
- package/v3/dist/coordination/queen-event-handlers.d.ts.map +1 -0
- package/v3/dist/coordination/queen-event-handlers.js +311 -0
- package/v3/dist/coordination/queen-event-handlers.js.map +1 -0
- package/v3/dist/coordination/queen-lifecycle.d.ts +61 -0
- package/v3/dist/coordination/queen-lifecycle.d.ts.map +1 -0
- package/v3/dist/coordination/queen-lifecycle.js +162 -0
- package/v3/dist/coordination/queen-lifecycle.js.map +1 -0
- package/v3/dist/coordination/queen-task-management.d.ts +84 -0
- package/v3/dist/coordination/queen-task-management.d.ts.map +1 -0
- package/v3/dist/coordination/queen-task-management.js +333 -0
- package/v3/dist/coordination/queen-task-management.js.map +1 -0
- package/v3/dist/coordination/queen-types.d.ts +175 -0
- package/v3/dist/coordination/queen-types.d.ts.map +1 -0
- package/v3/dist/coordination/queen-types.js +80 -0
- package/v3/dist/coordination/queen-types.js.map +1 -0
- package/v3/dist/coordination/queen-work-stealing.d.ts +33 -0
- package/v3/dist/coordination/queen-work-stealing.d.ts.map +1 -0
- package/v3/dist/coordination/queen-work-stealing.js +78 -0
- package/v3/dist/coordination/queen-work-stealing.js.map +1 -0
- package/v3/dist/coordination/result-saver.d.ts.map +1 -1
- package/v3/dist/coordination/result-saver.js +2 -1
- package/v3/dist/coordination/result-saver.js.map +1 -1
- package/v3/dist/coordination/task-executor.d.ts +45 -2
- package/v3/dist/coordination/task-executor.d.ts.map +1 -1
- package/v3/dist/coordination/task-executor.js +643 -570
- package/v3/dist/coordination/task-executor.js.map +1 -1
- package/v3/dist/coordination/workflow-builtin.d.ts +17 -0
- package/v3/dist/coordination/workflow-builtin.d.ts.map +1 -0
- package/v3/dist/coordination/workflow-builtin.js +648 -0
- package/v3/dist/coordination/workflow-builtin.js.map +1 -0
- package/v3/dist/coordination/workflow-orchestrator.d.ts +13 -300
- package/v3/dist/coordination/workflow-orchestrator.d.ts.map +1 -1
- package/v3/dist/coordination/workflow-orchestrator.js +142 -1009
- package/v3/dist/coordination/workflow-orchestrator.js.map +1 -1
- package/v3/dist/coordination/workflow-types.d.ts +250 -0
- package/v3/dist/coordination/workflow-types.d.ts.map +1 -0
- package/v3/dist/coordination/workflow-types.js +27 -0
- package/v3/dist/coordination/workflow-types.js.map +1 -0
- package/v3/dist/domains/base-domain-coordinator.d.ts +119 -0
- package/v3/dist/domains/base-domain-coordinator.d.ts.map +1 -0
- package/v3/dist/domains/base-domain-coordinator.js +200 -0
- package/v3/dist/domains/base-domain-coordinator.js.map +1 -0
- package/v3/dist/domains/chaos-resilience/coordinator.d.ts +12 -70
- package/v3/dist/domains/chaos-resilience/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/chaos-resilience/coordinator.js +25 -181
- package/v3/dist/domains/chaos-resilience/coordinator.js.map +1 -1
- package/v3/dist/domains/chaos-resilience/plugin.d.ts.map +1 -1
- package/v3/dist/domains/chaos-resilience/plugin.js +2 -1
- package/v3/dist/domains/chaos-resilience/plugin.js.map +1 -1
- package/v3/dist/domains/chaos-resilience/services/chaos-engineer.d.ts.map +1 -1
- package/v3/dist/domains/chaos-resilience/services/chaos-engineer.js +15 -13
- package/v3/dist/domains/chaos-resilience/services/chaos-engineer.js.map +1 -1
- package/v3/dist/domains/chaos-resilience/services/load-tester.d.ts.map +1 -1
- package/v3/dist/domains/chaos-resilience/services/load-tester.js +8 -7
- package/v3/dist/domains/chaos-resilience/services/load-tester.js.map +1 -1
- package/v3/dist/domains/chaos-resilience/services/performance-profiler.d.ts.map +1 -1
- package/v3/dist/domains/chaos-resilience/services/performance-profiler.js +7 -5
- package/v3/dist/domains/chaos-resilience/services/performance-profiler.js.map +1 -1
- package/v3/dist/domains/code-intelligence/coordinator-consensus.d.ts +33 -0
- package/v3/dist/domains/code-intelligence/coordinator-consensus.d.ts.map +1 -0
- package/v3/dist/domains/code-intelligence/coordinator-consensus.js +81 -0
- package/v3/dist/domains/code-intelligence/coordinator-consensus.js.map +1 -0
- package/v3/dist/domains/code-intelligence/coordinator-gnn.d.ts +44 -0
- package/v3/dist/domains/code-intelligence/coordinator-gnn.d.ts.map +1 -0
- package/v3/dist/domains/code-intelligence/coordinator-gnn.js +183 -0
- package/v3/dist/domains/code-intelligence/coordinator-gnn.js.map +1 -0
- package/v3/dist/domains/code-intelligence/coordinator-hypergraph.d.ts +40 -0
- package/v3/dist/domains/code-intelligence/coordinator-hypergraph.d.ts.map +1 -0
- package/v3/dist/domains/code-intelligence/coordinator-hypergraph.js +191 -0
- package/v3/dist/domains/code-intelligence/coordinator-hypergraph.js.map +1 -0
- package/v3/dist/domains/code-intelligence/coordinator.d.ts +17 -93
- package/v3/dist/domains/code-intelligence/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/coordinator.js +46 -565
- package/v3/dist/domains/code-intelligence/coordinator.js.map +1 -1
- package/v3/dist/domains/code-intelligence/index.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/index.js +10 -0
- package/v3/dist/domains/code-intelligence/index.js.map +1 -1
- package/v3/dist/domains/code-intelligence/plugin.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/plugin.js +2 -1
- package/v3/dist/domains/code-intelligence/plugin.js.map +1 -1
- package/v3/dist/domains/code-intelligence/services/c4-model/index.d.ts +3 -3
- package/v3/dist/domains/code-intelligence/services/c4-model/index.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/services/c4-model/index.js +2 -2
- package/v3/dist/domains/code-intelligence/services/c4-model/index.js.map +1 -1
- package/v3/dist/domains/code-intelligence/services/c4-model/types.d.ts +1 -1
- package/v3/dist/domains/code-intelligence/services/c4-model/types.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/services/impact-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/services/impact-analyzer.js +3 -2
- package/v3/dist/domains/code-intelligence/services/impact-analyzer.js.map +1 -1
- package/v3/dist/domains/code-intelligence/services/knowledge-graph.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/services/knowledge-graph.js +8 -6
- package/v3/dist/domains/code-intelligence/services/knowledge-graph.js.map +1 -1
- package/v3/dist/domains/code-intelligence/services/metric-collector/loc-counter.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/services/metric-collector/loc-counter.js +3 -2
- package/v3/dist/domains/code-intelligence/services/metric-collector/loc-counter.js.map +1 -1
- package/v3/dist/domains/code-intelligence/services/metric-collector/test-counter.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/services/metric-collector/test-counter.js +3 -2
- package/v3/dist/domains/code-intelligence/services/metric-collector/test-counter.js.map +1 -1
- package/v3/dist/domains/code-intelligence/services/product-factors-bridge.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/services/product-factors-bridge.js +8 -6
- package/v3/dist/domains/code-intelligence/services/product-factors-bridge.js.map +1 -1
- package/v3/dist/domains/code-intelligence/services/semantic-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/services/semantic-analyzer.js +5 -4
- package/v3/dist/domains/code-intelligence/services/semantic-analyzer.js.map +1 -1
- package/v3/dist/domains/contract-testing/coordinator.d.ts +13 -89
- package/v3/dist/domains/contract-testing/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/contract-testing/coordinator.js +43 -215
- package/v3/dist/domains/contract-testing/coordinator.js.map +1 -1
- package/v3/dist/domains/contract-testing/plugin.d.ts.map +1 -1
- package/v3/dist/domains/contract-testing/plugin.js +5 -4
- package/v3/dist/domains/contract-testing/plugin.js.map +1 -1
- package/v3/dist/domains/contract-testing/services/api-compatibility.d.ts.map +1 -1
- package/v3/dist/domains/contract-testing/services/api-compatibility.js +7 -5
- package/v3/dist/domains/contract-testing/services/api-compatibility.js.map +1 -1
- package/v3/dist/domains/contract-testing/services/contract-validator.d.ts.map +1 -1
- package/v3/dist/domains/contract-testing/services/contract-validator.js +10 -8
- package/v3/dist/domains/contract-testing/services/contract-validator.js.map +1 -1
- package/v3/dist/domains/contract-testing/services/schema-validator.d.ts.map +1 -1
- package/v3/dist/domains/contract-testing/services/schema-validator.js +10 -8
- package/v3/dist/domains/contract-testing/services/schema-validator.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/coordinator.d.ts +8 -59
- package/v3/dist/domains/coverage-analysis/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/coordinator.js +30 -138
- package/v3/dist/domains/coverage-analysis/coordinator.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/index.js +7 -0
- package/v3/dist/domains/coverage-analysis/index.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/coverage-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/coverage-analyzer.js +5 -3
- package/v3/dist/domains/coverage-analysis/services/coverage-analyzer.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/coverage-parser.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/coverage-parser.js +2 -1
- package/v3/dist/domains/coverage-analysis/services/coverage-parser.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/gap-detector.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/gap-detector.js +6 -4
- package/v3/dist/domains/coverage-analysis/services/gap-detector.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.js +5 -4
- package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/risk-scorer.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/risk-scorer.js +3 -2
- package/v3/dist/domains/coverage-analysis/services/risk-scorer.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/sublinear-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/sublinear-analyzer.js +4 -3
- package/v3/dist/domains/coverage-analysis/services/sublinear-analyzer.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/coordinator.d.ts +10 -58
- package/v3/dist/domains/defect-intelligence/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/coordinator.js +50 -171
- package/v3/dist/domains/defect-intelligence/coordinator.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/plugin.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/plugin.js +2 -1
- package/v3/dist/domains/defect-intelligence/plugin.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +4 -3
- package/v3/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/defect-predictor.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/defect-predictor.js +6 -4
- package/v3/dist/domains/defect-intelligence/services/defect-predictor.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/pattern-learner.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/pattern-learner.js +4 -3
- package/v3/dist/domains/defect-intelligence/services/pattern-learner.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/root-cause-analyzer.js +6 -4
- package/v3/dist/domains/defect-intelligence/services/root-cause-analyzer.js.map +1 -1
- package/v3/dist/domains/domain-interface.d.ts +6 -219
- package/v3/dist/domains/domain-interface.d.ts.map +1 -1
- package/v3/dist/domains/domain-interface.js +6 -312
- package/v3/dist/domains/domain-interface.js.map +1 -1
- package/v3/dist/domains/enterprise-integration/coordinator.d.ts +11 -37
- package/v3/dist/domains/enterprise-integration/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/enterprise-integration/coordinator.js +39 -148
- package/v3/dist/domains/enterprise-integration/coordinator.js.map +1 -1
- package/v3/dist/domains/enterprise-integration/plugin.d.ts.map +1 -1
- package/v3/dist/domains/enterprise-integration/plugin.js +2 -1
- package/v3/dist/domains/enterprise-integration/plugin.js.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.d.ts.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.js +7 -5
- package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.js.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/message-broker-service.d.ts.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/message-broker-service.js +11 -9
- package/v3/dist/domains/enterprise-integration/services/message-broker-service.js.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/odata-service.d.ts.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/odata-service.js +4 -3
- package/v3/dist/domains/enterprise-integration/services/odata-service.js.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/sap-integration-service.d.ts.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/sap-integration-service.js +5 -3
- package/v3/dist/domains/enterprise-integration/services/sap-integration-service.js.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.d.ts.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.js +4 -3
- package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.js.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.d.ts.map +1 -1
- package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.js +3 -2
- package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.js.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator-consensus.d.ts +37 -0
- package/v3/dist/domains/learning-optimization/coordinator-consensus.d.ts.map +1 -0
- package/v3/dist/domains/learning-optimization/coordinator-consensus.js +82 -0
- package/v3/dist/domains/learning-optimization/coordinator-consensus.js.map +1 -0
- package/v3/dist/domains/learning-optimization/coordinator-dream.d.ts +32 -0
- package/v3/dist/domains/learning-optimization/coordinator-dream.d.ts.map +1 -0
- package/v3/dist/domains/learning-optimization/coordinator-dream.js +43 -0
- package/v3/dist/domains/learning-optimization/coordinator-dream.js.map +1 -0
- package/v3/dist/domains/learning-optimization/coordinator-helpers.d.ts +56 -0
- package/v3/dist/domains/learning-optimization/coordinator-helpers.d.ts.map +1 -0
- package/v3/dist/domains/learning-optimization/coordinator-helpers.js +142 -0
- package/v3/dist/domains/learning-optimization/coordinator-helpers.js.map +1 -0
- package/v3/dist/domains/learning-optimization/coordinator-sona-methods.d.ts +64 -0
- package/v3/dist/domains/learning-optimization/coordinator-sona-methods.d.ts.map +1 -0
- package/v3/dist/domains/learning-optimization/coordinator-sona-methods.js +73 -0
- package/v3/dist/domains/learning-optimization/coordinator-sona-methods.js.map +1 -0
- package/v3/dist/domains/learning-optimization/coordinator.d.ts +17 -82
- package/v3/dist/domains/learning-optimization/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.js +36 -320
- package/v3/dist/domains/learning-optimization/coordinator.js.map +1 -1
- package/v3/dist/domains/learning-optimization/plugin.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/plugin.js +2 -1
- package/v3/dist/domains/learning-optimization/plugin.js.map +1 -1
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.js +11 -10
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.js.map +1 -1
- package/v3/dist/domains/learning-optimization/services/metrics-optimizer.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/services/metrics-optimizer.js +8 -7
- package/v3/dist/domains/learning-optimization/services/metrics-optimizer.js.map +1 -1
- package/v3/dist/domains/learning-optimization/services/production-intel.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/services/production-intel.js +11 -10
- package/v3/dist/domains/learning-optimization/services/production-intel.js.map +1 -1
- package/v3/dist/domains/learning-optimization/services/transfer-specialist.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/services/transfer-specialist.js +8 -7
- package/v3/dist/domains/learning-optimization/services/transfer-specialist.js.map +1 -1
- package/v3/dist/domains/quality-assessment/coordinator-claim-verifier.d.ts +41 -0
- package/v3/dist/domains/quality-assessment/coordinator-claim-verifier.d.ts.map +1 -0
- package/v3/dist/domains/quality-assessment/coordinator-claim-verifier.js +157 -0
- package/v3/dist/domains/quality-assessment/coordinator-claim-verifier.js.map +1 -0
- package/v3/dist/domains/quality-assessment/coordinator-gate-evaluation.d.ts +26 -0
- package/v3/dist/domains/quality-assessment/coordinator-gate-evaluation.d.ts.map +1 -0
- package/v3/dist/domains/quality-assessment/coordinator-gate-evaluation.js +135 -0
- package/v3/dist/domains/quality-assessment/coordinator-gate-evaluation.js.map +1 -0
- package/v3/dist/domains/quality-assessment/coordinator-reports.d.ts +90 -0
- package/v3/dist/domains/quality-assessment/coordinator-reports.d.ts.map +1 -0
- package/v3/dist/domains/quality-assessment/coordinator-reports.js +265 -0
- package/v3/dist/domains/quality-assessment/coordinator-reports.js.map +1 -0
- package/v3/dist/domains/quality-assessment/coordinator-rl-integration.d.ts +92 -0
- package/v3/dist/domains/quality-assessment/coordinator-rl-integration.d.ts.map +1 -0
- package/v3/dist/domains/quality-assessment/coordinator-rl-integration.js +321 -0
- package/v3/dist/domains/quality-assessment/coordinator-rl-integration.js.map +1 -0
- package/v3/dist/domains/quality-assessment/coordinator.d.ts +18 -127
- package/v3/dist/domains/quality-assessment/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/coordinator.js +58 -1022
- package/v3/dist/domains/quality-assessment/coordinator.js.map +1 -1
- package/v3/dist/domains/quality-assessment/index.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/index.js +10 -0
- package/v3/dist/domains/quality-assessment/index.js.map +1 -1
- package/v3/dist/domains/quality-assessment/plugin.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/plugin.js +2 -1
- package/v3/dist/domains/quality-assessment/plugin.js.map +1 -1
- package/v3/dist/domains/quality-assessment/services/coherence-gate.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/services/coherence-gate.js +2 -1
- package/v3/dist/domains/quality-assessment/services/coherence-gate.js.map +1 -1
- package/v3/dist/domains/quality-assessment/services/deployment-advisor.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/services/deployment-advisor.js +5 -3
- package/v3/dist/domains/quality-assessment/services/deployment-advisor.js.map +1 -1
- package/v3/dist/domains/quality-assessment/services/quality-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/services/quality-analyzer.js +6 -4
- package/v3/dist/domains/quality-assessment/services/quality-analyzer.js.map +1 -1
- package/v3/dist/domains/quality-assessment/services/quality-gate.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/services/quality-gate.js +3 -2
- package/v3/dist/domains/quality-assessment/services/quality-gate.js.map +1 -1
- package/v3/dist/domains/requirements-validation/coordinator.d.ts +17 -61
- package/v3/dist/domains/requirements-validation/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/coordinator.js +25 -175
- package/v3/dist/domains/requirements-validation/coordinator.js.map +1 -1
- package/v3/dist/domains/requirements-validation/plugin.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/plugin.js +2 -1
- package/v3/dist/domains/requirements-validation/plugin.js.map +1 -1
- package/v3/dist/domains/requirements-validation/qcsd-ideation-plugin.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/qcsd-ideation-plugin.js +12 -11
- package/v3/dist/domains/requirements-validation/qcsd-ideation-plugin.js.map +1 -1
- package/v3/dist/domains/requirements-validation/qcsd-refinement-plugin.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/qcsd-refinement-plugin.js +11 -10
- package/v3/dist/domains/requirements-validation/qcsd-refinement-plugin.js.map +1 -1
- package/v3/dist/domains/requirements-validation/services/bdd-scenario-writer.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/services/bdd-scenario-writer.js +4 -3
- package/v3/dist/domains/requirements-validation/services/bdd-scenario-writer.js.map +1 -1
- package/v3/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.js +3 -2
- package/v3/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.js.map +1 -1
- package/v3/dist/domains/requirements-validation/services/requirements-validator.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/services/requirements-validator.js +7 -5
- package/v3/dist/domains/requirements-validation/services/requirements-validator.js.map +1 -1
- package/v3/dist/domains/requirements-validation/services/testability-scorer.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/services/testability-scorer.js +4 -3
- package/v3/dist/domains/requirements-validation/services/testability-scorer.js.map +1 -1
- package/v3/dist/domains/security-compliance/coordinator.d.ts +12 -58
- package/v3/dist/domains/security-compliance/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/coordinator.js +22 -164
- package/v3/dist/domains/security-compliance/coordinator.js.map +1 -1
- package/v3/dist/domains/security-compliance/index.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/index.js +14 -0
- package/v3/dist/domains/security-compliance/index.js.map +1 -1
- package/v3/dist/domains/security-compliance/plugin.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/plugin.js +2 -1
- package/v3/dist/domains/security-compliance/plugin.js.map +1 -1
- package/v3/dist/domains/security-compliance/services/compliance-validator.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/compliance-validator.js +6 -5
- package/v3/dist/domains/security-compliance/services/compliance-validator.js.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/dast-helpers.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/dast-helpers.js +2 -1
- package/v3/dist/domains/security-compliance/services/scanners/dast-helpers.js.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/dast-scanner.d.ts +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/dast-scanner.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/dast-scanner.js +4 -3
- package/v3/dist/domains/security-compliance/services/scanners/dast-scanner.js.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/dependency-scanner.d.ts +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/dependency-scanner.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/dependency-scanner.js +7 -5
- package/v3/dist/domains/security-compliance/services/scanners/dependency-scanner.js.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/sast-scanner.d.ts +2 -2
- package/v3/dist/domains/security-compliance/services/scanners/sast-scanner.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/sast-scanner.js +6 -4
- package/v3/dist/domains/security-compliance/services/scanners/sast-scanner.js.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/scanner-orchestrator.d.ts +2 -2
- package/v3/dist/domains/security-compliance/services/scanners/scanner-orchestrator.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/scanner-orchestrator.js +3 -2
- package/v3/dist/domains/security-compliance/services/scanners/scanner-orchestrator.js.map +1 -1
- package/v3/dist/domains/security-compliance/services/scanners/scanner-types.d.ts +2 -2
- package/v3/dist/domains/security-compliance/services/scanners/scanner-types.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/security-auditor-dast.d.ts +11 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-dast.d.ts.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-dast.js +284 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-dast.js.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-reports.d.ts +44 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-reports.d.ts.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-reports.js +193 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-reports.js.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-sast.d.ts +27 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-sast.d.ts.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-sast.js +279 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-sast.js.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-secrets.d.ts +34 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-secrets.d.ts.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-secrets.js +236 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-secrets.js.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-types.d.ts +93 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-types.d.ts.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-types.js +50 -0
- package/v3/dist/domains/security-compliance/services/security-auditor-types.js.map +1 -0
- package/v3/dist/domains/security-compliance/services/security-auditor.d.ts +12 -132
- package/v3/dist/domains/security-compliance/services/security-auditor.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/security-auditor.js +71 -1188
- package/v3/dist/domains/security-compliance/services/security-auditor.js.map +1 -1
- package/v3/dist/domains/security-compliance/services/semgrep-integration.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/semgrep-integration.js +4 -2
- package/v3/dist/domains/security-compliance/services/semgrep-integration.js.map +1 -1
- package/v3/dist/domains/test-execution/coordinator.d.ts +8 -60
- package/v3/dist/domains/test-execution/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/coordinator.js +19 -132
- package/v3/dist/domains/test-execution/coordinator.js.map +1 -1
- package/v3/dist/domains/test-execution/services/auth-state-manager.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/auth-state-manager.js +2 -1
- package/v3/dist/domains/test-execution/services/auth-state-manager.js.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/assertion-handlers.d.ts +2 -2
- package/v3/dist/domains/test-execution/services/e2e/assertion-handlers.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/browser-orchestrator.d.ts +2 -2
- package/v3/dist/domains/test-execution/services/e2e/browser-orchestrator.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/browser-orchestrator.js +2 -1
- package/v3/dist/domains/test-execution/services/e2e/browser-orchestrator.js.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/e2e-coordinator.d.ts +2 -2
- package/v3/dist/domains/test-execution/services/e2e/e2e-coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/e2e-coordinator.js +3 -2
- package/v3/dist/domains/test-execution/services/e2e/e2e-coordinator.js.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/result-collector.d.ts +1 -1
- package/v3/dist/domains/test-execution/services/e2e/result-collector.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/step-executors.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/step-executors.js +2 -1
- package/v3/dist/domains/test-execution/services/e2e/step-executors.js.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/step-retry-handler.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/step-retry-handler.js +3 -2
- package/v3/dist/domains/test-execution/services/e2e/step-retry-handler.js.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/types.d.ts +2 -2
- package/v3/dist/domains/test-execution/services/e2e/types.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/e2e/wait-condition-handler.d.ts +1 -1
- package/v3/dist/domains/test-execution/services/e2e/wait-condition-handler.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/flaky-detector.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/flaky-detector.js +7 -5
- package/v3/dist/domains/test-execution/services/flaky-detector.js.map +1 -1
- package/v3/dist/domains/test-execution/services/retry-handler.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/retry-handler.js +8 -6
- package/v3/dist/domains/test-execution/services/retry-handler.js.map +1 -1
- package/v3/dist/domains/test-execution/services/test-executor.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/test-executor.js +8 -6
- package/v3/dist/domains/test-execution/services/test-executor.js.map +1 -1
- package/v3/dist/domains/test-execution/services/test-prioritizer.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/test-prioritizer.js +2 -1
- package/v3/dist/domains/test-execution/services/test-prioritizer.js.map +1 -1
- package/v3/dist/domains/test-execution/services/user-flow-generator.d.ts +28 -0
- package/v3/dist/domains/test-execution/services/user-flow-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/user-flow-generator.js +156 -189
- package/v3/dist/domains/test-execution/services/user-flow-generator.js.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.d.ts +14 -78
- package/v3/dist/domains/test-generation/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.js +58 -202
- package/v3/dist/domains/test-generation/coordinator.js.map +1 -1
- package/v3/dist/domains/test-generation/generators/base-test-generator.d.ts +10 -0
- package/v3/dist/domains/test-generation/generators/base-test-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/generators/base-test-generator.js +37 -30
- package/v3/dist/domains/test-generation/generators/base-test-generator.js.map +1 -1
- package/v3/dist/domains/test-generation/index.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/index.js +10 -0
- package/v3/dist/domains/test-generation/index.js.map +1 -1
- package/v3/dist/domains/test-generation/plugin.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/plugin.js +2 -1
- package/v3/dist/domains/test-generation/plugin.js.map +1 -1
- package/v3/dist/domains/test-generation/services/code-transform-integration.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/code-transform-integration.js +2 -1
- package/v3/dist/domains/test-generation/services/code-transform-integration.js.map +1 -1
- package/v3/dist/domains/test-generation/services/pattern-matcher.d.ts +10 -0
- package/v3/dist/domains/test-generation/services/pattern-matcher.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/pattern-matcher.js +43 -41
- package/v3/dist/domains/test-generation/services/pattern-matcher.js.map +1 -1
- package/v3/dist/domains/test-generation/services/test-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/test-generator.js +47 -17
- package/v3/dist/domains/test-generation/services/test-generator.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/coordinator.d.ts +17 -60
- package/v3/dist/domains/visual-accessibility/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/coordinator.js +32 -183
- package/v3/dist/domains/visual-accessibility/coordinator.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.js +4 -3
- package/v3/dist/domains/visual-accessibility/plugin.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts +114 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester-browser.js +578 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester-browser.js.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester-heuristics.d.ts +54 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester-heuristics.d.ts.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester-heuristics.js +403 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester-heuristics.js.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +1 -314
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.js +79 -1467
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/axe-core-audit.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/axe-core-audit.js +2 -1
- package/v3/dist/domains/visual-accessibility/services/axe-core-audit.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/axe-core-integration.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/axe-core-integration.js +5 -4
- package/v3/dist/domains/visual-accessibility/services/axe-core-integration.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/browser-security-scanner.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/browser-security-scanner.js +5 -4
- package/v3/dist/domains/visual-accessibility/services/browser-security-scanner.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/browser-swarm-coordinator.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js +8 -7
- package/v3/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.js +2 -1
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/responsive-tester.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/responsive-tester.js +5 -4
- package/v3/dist/domains/visual-accessibility/services/responsive-tester.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/viewport-capture.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/viewport-capture.js +7 -6
- package/v3/dist/domains/visual-accessibility/services/viewport-capture.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/visual-regression.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/visual-regression.js +11 -10
- package/v3/dist/domains/visual-accessibility/services/visual-regression.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/visual-tester.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/visual-tester.js +7 -6
- package/v3/dist/domains/visual-accessibility/services/visual-tester.js.map +1 -1
- package/v3/dist/early-exit/early-exit-controller.d.ts.map +1 -1
- package/v3/dist/early-exit/early-exit-controller.js +4 -3
- package/v3/dist/early-exit/early-exit-controller.js.map +1 -1
- package/v3/dist/feedback/coverage-learner.d.ts.map +1 -1
- package/v3/dist/feedback/coverage-learner.js +7 -5
- package/v3/dist/feedback/coverage-learner.js.map +1 -1
- package/v3/dist/feedback/test-outcome-tracker.d.ts.map +1 -1
- package/v3/dist/feedback/test-outcome-tracker.js +6 -4
- package/v3/dist/feedback/test-outcome-tracker.js.map +1 -1
- package/v3/dist/governance/adversarial-defense-integration.d.ts +0 -18
- package/v3/dist/governance/adversarial-defense-integration.d.ts.map +1 -1
- package/v3/dist/governance/adversarial-defense-integration.js +2 -1
- package/v3/dist/governance/adversarial-defense-integration.js.map +1 -1
- package/v3/dist/governance/compliance-reporter.d.ts +0 -16
- package/v3/dist/governance/compliance-reporter.d.ts.map +1 -1
- package/v3/dist/governance/compliance-reporter.js +6 -8
- package/v3/dist/governance/compliance-reporter.js.map +1 -1
- package/v3/dist/governance/continue-gate-integration.d.ts.map +1 -1
- package/v3/dist/governance/continue-gate-integration.js +3 -2
- package/v3/dist/governance/continue-gate-integration.js.map +1 -1
- package/v3/dist/governance/evolution-pipeline-integration.d.ts.map +1 -1
- package/v3/dist/governance/evolution-pipeline-integration.js +3 -2
- package/v3/dist/governance/evolution-pipeline-integration.js.map +1 -1
- package/v3/dist/governance/proof-envelope-integration.d.ts.map +1 -1
- package/v3/dist/governance/proof-envelope-integration.js +4 -4
- package/v3/dist/governance/proof-envelope-integration.js.map +1 -1
- package/v3/dist/governance/shard-embeddings.d.ts.map +1 -1
- package/v3/dist/governance/shard-embeddings.js +16 -2
- package/v3/dist/governance/shard-embeddings.js.map +1 -1
- package/v3/dist/governance/shard-retriever-integration.d.ts.map +1 -1
- package/v3/dist/governance/shard-retriever-integration.js +4 -3
- package/v3/dist/governance/shard-retriever-integration.js.map +1 -1
- package/v3/dist/governance/wasm-kernel-integration.d.ts.map +1 -1
- package/v3/dist/governance/wasm-kernel-integration.js +4 -2
- package/v3/dist/governance/wasm-kernel-integration.js.map +1 -1
- package/v3/dist/hooks/reasoning-bank-pattern-store.d.ts.map +1 -1
- package/v3/dist/hooks/reasoning-bank-pattern-store.js +3 -2
- package/v3/dist/hooks/reasoning-bank-pattern-store.js.map +1 -1
- package/v3/dist/hooks/task-completed-hook.d.ts.map +1 -1
- package/v3/dist/hooks/task-completed-hook.js +3 -2
- package/v3/dist/hooks/task-completed-hook.js.map +1 -1
- package/v3/dist/init/agents-installer.d.ts.map +1 -1
- package/v3/dist/init/agents-installer.js +2 -1
- package/v3/dist/init/agents-installer.js.map +1 -1
- package/v3/dist/init/enhancements/claude-flow-adapter.d.ts.map +1 -1
- package/v3/dist/init/enhancements/claude-flow-adapter.js +3 -2
- package/v3/dist/init/enhancements/claude-flow-adapter.js.map +1 -1
- package/v3/dist/init/fleet-integration.d.ts.map +1 -1
- package/v3/dist/init/fleet-integration.js +2 -1
- package/v3/dist/init/fleet-integration.js.map +1 -1
- package/v3/dist/init/governance-installer.d.ts.map +1 -1
- package/v3/dist/init/governance-installer.js +5 -4
- package/v3/dist/init/governance-installer.js.map +1 -1
- package/v3/dist/init/init-wizard-hooks.d.ts +26 -0
- package/v3/dist/init/init-wizard-hooks.d.ts.map +1 -0
- package/v3/dist/init/init-wizard-hooks.js +555 -0
- package/v3/dist/init/init-wizard-hooks.js.map +1 -0
- package/v3/dist/init/init-wizard-migration.d.ts +52 -0
- package/v3/dist/init/init-wizard-migration.d.ts.map +1 -0
- package/v3/dist/init/init-wizard-migration.js +349 -0
- package/v3/dist/init/init-wizard-migration.js.map +1 -0
- package/v3/dist/init/init-wizard-steps.d.ts +68 -0
- package/v3/dist/init/init-wizard-steps.d.ts.map +1 -0
- package/v3/dist/init/init-wizard-steps.js +457 -0
- package/v3/dist/init/init-wizard-steps.js.map +1 -0
- package/v3/dist/init/init-wizard.d.ts +8 -130
- package/v3/dist/init/init-wizard.d.ts.map +1 -1
- package/v3/dist/init/init-wizard.js +108 -1528
- package/v3/dist/init/init-wizard.js.map +1 -1
- package/v3/dist/init/migration/config-migrator.d.ts.map +1 -1
- package/v3/dist/init/migration/config-migrator.js +2 -1
- package/v3/dist/init/migration/config-migrator.js.map +1 -1
- package/v3/dist/init/migration/data-migrator.d.ts.map +1 -1
- package/v3/dist/init/migration/data-migrator.js +10 -9
- package/v3/dist/init/migration/data-migrator.js.map +1 -1
- package/v3/dist/init/migration/detector.d.ts.map +1 -1
- package/v3/dist/init/migration/detector.js +2 -1
- package/v3/dist/init/migration/detector.js.map +1 -1
- package/v3/dist/init/n8n-installer.d.ts.map +1 -1
- package/v3/dist/init/n8n-installer.js +4 -3
- package/v3/dist/init/n8n-installer.js.map +1 -1
- package/v3/dist/init/orchestrator.d.ts.map +1 -1
- package/v3/dist/init/orchestrator.js +2 -1
- package/v3/dist/init/orchestrator.js.map +1 -1
- package/v3/dist/init/phases/01-detection.d.ts.map +1 -1
- package/v3/dist/init/phases/01-detection.js +2 -1
- package/v3/dist/init/phases/01-detection.js.map +1 -1
- package/v3/dist/init/phases/06-code-intelligence.d.ts.map +1 -1
- package/v3/dist/init/phases/06-code-intelligence.js +2 -1
- package/v3/dist/init/phases/06-code-intelligence.js.map +1 -1
- package/v3/dist/init/phases/07-hooks.d.ts.map +1 -1
- package/v3/dist/init/phases/07-hooks.js +2 -1
- package/v3/dist/init/phases/07-hooks.js.map +1 -1
- package/v3/dist/init/phases/08-mcp.d.ts.map +1 -1
- package/v3/dist/init/phases/08-mcp.js +3 -2
- package/v3/dist/init/phases/08-mcp.js.map +1 -1
- package/v3/dist/init/phases/phase-interface.d.ts.map +1 -1
- package/v3/dist/init/phases/phase-interface.js +3 -2
- package/v3/dist/init/phases/phase-interface.js.map +1 -1
- package/v3/dist/init/project-analyzer.d.ts.map +1 -1
- package/v3/dist/init/project-analyzer.js +3 -2
- package/v3/dist/init/project-analyzer.js.map +1 -1
- package/v3/dist/init/skills-installer.d.ts.map +1 -1
- package/v3/dist/init/skills-installer.js +2 -1
- package/v3/dist/init/skills-installer.js.map +1 -1
- package/v3/dist/integrations/agent-booster-wasm/index.d.ts.map +1 -1
- package/v3/dist/integrations/agent-booster-wasm/index.js +4 -1
- package/v3/dist/integrations/agent-booster-wasm/index.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/metrics/pattern-updater.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/metrics/pattern-updater.js +6 -4
- package/v3/dist/integrations/agentic-flow/metrics/pattern-updater.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/onnx-embeddings/adapter.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/onnx-embeddings/adapter.js +10 -0
- package/v3/dist/integrations/agentic-flow/onnx-embeddings/adapter.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/pattern-loader.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/pattern-loader.js +4 -2
- package/v3/dist/integrations/agentic-flow/pattern-loader.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts +4 -2
- package/v3/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +70 -43
- package/v3/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/index.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/index.js +2 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/index.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.js +6 -5
- package/v3/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js +7 -6
- package/v3/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js.map +1 -1
- package/v3/dist/integrations/browser/agent-browser/client.d.ts.map +1 -1
- package/v3/dist/integrations/browser/agent-browser/client.js +33 -31
- package/v3/dist/integrations/browser/agent-browser/client.js.map +1 -1
- package/v3/dist/integrations/browser/agent-browser/command-executor.d.ts.map +1 -1
- package/v3/dist/integrations/browser/agent-browser/command-executor.js +42 -22
- package/v3/dist/integrations/browser/agent-browser/command-executor.js.map +1 -1
- package/v3/dist/integrations/browser/agent-browser/snapshot-parser.d.ts.map +1 -1
- package/v3/dist/integrations/browser/agent-browser/snapshot-parser.js +2 -1
- package/v3/dist/integrations/browser/agent-browser/snapshot-parser.js.map +1 -1
- package/v3/dist/integrations/browser/web-content-fetcher.d.ts.map +1 -1
- package/v3/dist/integrations/browser/web-content-fetcher.js +4 -2
- package/v3/dist/integrations/browser/web-content-fetcher.js.map +1 -1
- package/v3/dist/integrations/coherence/coherence-service.d.ts.map +1 -1
- package/v3/dist/integrations/coherence/coherence-service.js +4 -3
- package/v3/dist/integrations/coherence/coherence-service.js.map +1 -1
- package/v3/dist/integrations/coherence/engines/spectral-adapter.d.ts.map +1 -1
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js +4 -3
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js.map +1 -1
- package/v3/dist/integrations/coherence/wasm-loader.d.ts.map +1 -1
- package/v3/dist/integrations/coherence/wasm-loader.js +4 -3
- package/v3/dist/integrations/coherence/wasm-loader.js.map +1 -1
- package/v3/dist/integrations/embeddings/cache/EmbeddingCache.d.ts +6 -0
- package/v3/dist/integrations/embeddings/cache/EmbeddingCache.d.ts.map +1 -1
- package/v3/dist/integrations/embeddings/cache/EmbeddingCache.js +35 -6
- package/v3/dist/integrations/embeddings/cache/EmbeddingCache.js.map +1 -1
- package/v3/dist/integrations/n8n/agent-factory.d.ts.map +1 -1
- package/v3/dist/integrations/n8n/agent-factory.js +2 -1
- package/v3/dist/integrations/n8n/agent-factory.js.map +1 -1
- package/v3/dist/integrations/rl-suite/base-algorithm.d.ts.map +1 -1
- package/v3/dist/integrations/rl-suite/base-algorithm.js +8 -3
- package/v3/dist/integrations/rl-suite/base-algorithm.js.map +1 -1
- package/v3/dist/integrations/rl-suite/persistence/q-value-store.d.ts.map +1 -1
- package/v3/dist/integrations/rl-suite/persistence/q-value-store.js +2 -1
- package/v3/dist/integrations/rl-suite/persistence/q-value-store.js.map +1 -1
- package/v3/dist/integrations/ruvector/ast-complexity.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/ast-complexity.js +3 -2
- package/v3/dist/integrations/ruvector/ast-complexity.js.map +1 -1
- package/v3/dist/integrations/ruvector/attention-wrapper.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/attention-wrapper.js +2 -1
- package/v3/dist/integrations/ruvector/attention-wrapper.js.map +1 -1
- package/v3/dist/integrations/ruvector/coverage-router.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/coverage-router.js +3 -2
- package/v3/dist/integrations/ruvector/coverage-router.js.map +1 -1
- package/v3/dist/integrations/ruvector/diff-risk-classifier.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/diff-risk-classifier.js +3 -2
- package/v3/dist/integrations/ruvector/diff-risk-classifier.js.map +1 -1
- package/v3/dist/integrations/ruvector/gnn-wrapper.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/gnn-wrapper.js +2 -1
- package/v3/dist/integrations/ruvector/gnn-wrapper.js.map +1 -1
- package/v3/dist/integrations/ruvector/graph-boundaries.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/graph-boundaries.js +3 -2
- package/v3/dist/integrations/ruvector/graph-boundaries.js.map +1 -1
- package/v3/dist/integrations/ruvector/hypergraph-engine.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/hypergraph-engine.js +68 -67
- package/v3/dist/integrations/ruvector/hypergraph-engine.js.map +1 -1
- package/v3/dist/integrations/ruvector/hypergraph-schema.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/hypergraph-schema.js +3 -2
- package/v3/dist/integrations/ruvector/hypergraph-schema.js.map +1 -1
- package/v3/dist/integrations/ruvector/persistent-q-router.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/persistent-q-router.js +35 -11
- package/v3/dist/integrations/ruvector/persistent-q-router.js.map +1 -1
- package/v3/dist/integrations/ruvector/q-learning-router.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/q-learning-router.js +3 -2
- package/v3/dist/integrations/ruvector/q-learning-router.js.map +1 -1
- package/v3/dist/integrations/ruvector/server-client.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/server-client.js +23 -10
- package/v3/dist/integrations/ruvector/server-client.js.map +1 -1
- package/v3/dist/integrations/ruvector/sona-persistence.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/sona-persistence.js +11 -6
- package/v3/dist/integrations/ruvector/sona-persistence.js.map +1 -1
- package/v3/dist/integrations/vibium/client.d.ts.map +1 -1
- package/v3/dist/integrations/vibium/client.js +11 -10
- package/v3/dist/integrations/vibium/client.js.map +1 -1
- package/v3/dist/kernel/anti-drift-middleware.d.ts.map +1 -1
- package/v3/dist/kernel/anti-drift-middleware.js +8 -3
- package/v3/dist/kernel/anti-drift-middleware.js.map +1 -1
- package/v3/dist/kernel/hybrid-backend.d.ts.map +1 -1
- package/v3/dist/kernel/hybrid-backend.js +4 -0
- package/v3/dist/kernel/hybrid-backend.js.map +1 -1
- package/v3/dist/kernel/index.d.ts +1 -1
- package/v3/dist/kernel/index.d.ts.map +1 -1
- package/v3/dist/kernel/index.js +1 -1
- package/v3/dist/kernel/index.js.map +1 -1
- package/v3/dist/kernel/kernel.d.ts +5 -0
- package/v3/dist/kernel/kernel.d.ts.map +1 -1
- package/v3/dist/kernel/kernel.js +43 -22
- package/v3/dist/kernel/kernel.js.map +1 -1
- package/v3/dist/kernel/memory-factory.d.ts.map +1 -1
- package/v3/dist/kernel/memory-factory.js +12 -4
- package/v3/dist/kernel/memory-factory.js.map +1 -1
- package/v3/dist/kernel/plugin-loader.d.ts.map +1 -1
- package/v3/dist/kernel/plugin-loader.js +4 -1
- package/v3/dist/kernel/plugin-loader.js.map +1 -1
- package/v3/dist/kernel/unified-memory-hnsw.d.ts +101 -0
- package/v3/dist/kernel/unified-memory-hnsw.d.ts.map +1 -0
- package/v3/dist/kernel/unified-memory-hnsw.js +411 -0
- package/v3/dist/kernel/unified-memory-hnsw.js.map +1 -0
- package/v3/dist/kernel/unified-memory-migration.d.ts.map +1 -1
- package/v3/dist/kernel/unified-memory-migration.js +14 -15
- package/v3/dist/kernel/unified-memory-migration.js.map +1 -1
- package/v3/dist/kernel/unified-memory-schemas.d.ts +21 -0
- package/v3/dist/kernel/unified-memory-schemas.d.ts.map +1 -0
- package/v3/dist/kernel/unified-memory-schemas.js +581 -0
- package/v3/dist/kernel/unified-memory-schemas.js.map +1 -0
- package/v3/dist/kernel/unified-memory.d.ts +13 -197
- package/v3/dist/kernel/unified-memory.d.ts.map +1 -1
- package/v3/dist/kernel/unified-memory.js +117 -1379
- package/v3/dist/kernel/unified-memory.js.map +1 -1
- package/v3/dist/kernel/unified-persistence.d.ts.map +1 -1
- package/v3/dist/kernel/unified-persistence.js +6 -4
- package/v3/dist/kernel/unified-persistence.js.map +1 -1
- package/v3/dist/learning/aqe-learning-engine.d.ts.map +1 -1
- package/v3/dist/learning/aqe-learning-engine.js +11 -9
- package/v3/dist/learning/aqe-learning-engine.js.map +1 -1
- package/v3/dist/learning/dream/concept-graph.d.ts.map +1 -1
- package/v3/dist/learning/dream/concept-graph.js +6 -4
- package/v3/dist/learning/dream/concept-graph.js.map +1 -1
- package/v3/dist/learning/dream/dream-engine.d.ts +8 -0
- package/v3/dist/learning/dream/dream-engine.d.ts.map +1 -1
- package/v3/dist/learning/dream/dream-engine.js +35 -5
- package/v3/dist/learning/dream/dream-engine.js.map +1 -1
- package/v3/dist/learning/dream/dream-scheduler.d.ts.map +1 -1
- package/v3/dist/learning/dream/dream-scheduler.js +34 -22
- package/v3/dist/learning/dream/dream-scheduler.js.map +1 -1
- package/v3/dist/learning/experience-capture-middleware.d.ts.map +1 -1
- package/v3/dist/learning/experience-capture-middleware.js +2 -1
- package/v3/dist/learning/experience-capture-middleware.js.map +1 -1
- package/v3/dist/learning/experience-capture.d.ts.map +1 -1
- package/v3/dist/learning/experience-capture.js +4 -1
- package/v3/dist/learning/experience-capture.js.map +1 -1
- package/v3/dist/learning/memory-auditor.d.ts.map +1 -1
- package/v3/dist/learning/memory-auditor.js +3 -2
- package/v3/dist/learning/memory-auditor.js.map +1 -1
- package/v3/dist/learning/metrics-tracker.d.ts.map +1 -1
- package/v3/dist/learning/metrics-tracker.js +6 -2
- package/v3/dist/learning/metrics-tracker.js.map +1 -1
- package/v3/dist/learning/pattern-lifecycle.d.ts.map +1 -1
- package/v3/dist/learning/pattern-lifecycle.js +11 -5
- package/v3/dist/learning/pattern-lifecycle.js.map +1 -1
- package/v3/dist/learning/pattern-store.d.ts +7 -0
- package/v3/dist/learning/pattern-store.d.ts.map +1 -1
- package/v3/dist/learning/pattern-store.js +32 -4
- package/v3/dist/learning/pattern-store.js.map +1 -1
- package/v3/dist/learning/qe-hooks.d.ts.map +1 -1
- package/v3/dist/learning/qe-hooks.js +55 -10
- package/v3/dist/learning/qe-hooks.js.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.d.ts +13 -0
- package/v3/dist/learning/qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.js +64 -24
- package/v3/dist/learning/qe-reasoning-bank.js.map +1 -1
- package/v3/dist/learning/qe-unified-memory.d.ts.map +1 -1
- package/v3/dist/learning/qe-unified-memory.js +31 -21
- package/v3/dist/learning/qe-unified-memory.js.map +1 -1
- package/v3/dist/learning/real-embeddings.d.ts.map +1 -1
- package/v3/dist/learning/real-embeddings.js +2 -1
- package/v3/dist/learning/real-embeddings.js.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.js +47 -34
- package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
- package/v3/dist/learning/skill-validation-learner.d.ts.map +1 -1
- package/v3/dist/learning/skill-validation-learner.js +21 -12
- package/v3/dist/learning/skill-validation-learner.js.map +1 -1
- package/v3/dist/learning/sqlite-persistence.d.ts +9 -0
- package/v3/dist/learning/sqlite-persistence.d.ts.map +1 -1
- package/v3/dist/learning/sqlite-persistence.js +65 -6
- package/v3/dist/learning/sqlite-persistence.js.map +1 -1
- package/v3/dist/learning/token-tracker.d.ts.map +1 -1
- package/v3/dist/learning/token-tracker.js +4 -2
- package/v3/dist/learning/token-tracker.js.map +1 -1
- package/v3/dist/learning/v2-to-v3-migration.d.ts.map +1 -1
- package/v3/dist/learning/v2-to-v3-migration.js +9 -4
- package/v3/dist/learning/v2-to-v3-migration.js.map +1 -1
- package/v3/dist/mcp/bundle.js +15199 -13931
- package/v3/dist/mcp/entry.js +21 -1
- package/v3/dist/mcp/entry.js.map +1 -1
- package/v3/dist/mcp/handlers/agent-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/agent-handlers.js +5 -4
- package/v3/dist/mcp/handlers/agent-handlers.js.map +1 -1
- package/v3/dist/mcp/handlers/core-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/core-handlers.js +4 -3
- package/v3/dist/mcp/handlers/core-handlers.js.map +1 -1
- package/v3/dist/mcp/handlers/handler-factory.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/handler-factory.js +12 -3
- package/v3/dist/mcp/handlers/handler-factory.js.map +1 -1
- package/v3/dist/mcp/handlers/memory-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/memory-handlers.js +8 -8
- package/v3/dist/mcp/handlers/memory-handlers.js.map +1 -1
- package/v3/dist/mcp/handlers/task-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/task-handlers.js +11 -10
- package/v3/dist/mcp/handlers/task-handlers.js.map +1 -1
- package/v3/dist/mcp/http-server.js +1 -1
- package/v3/dist/mcp/http-server.js.map +1 -1
- package/v3/dist/mcp/security/index.d.ts +2 -6
- package/v3/dist/mcp/security/index.d.ts.map +1 -1
- package/v3/dist/mcp/security/index.js +2 -2
- package/v3/dist/mcp/security/index.js.map +1 -1
- package/v3/dist/mcp/security/oauth21-provider.d.ts +7 -0
- package/v3/dist/mcp/security/oauth21-provider.d.ts.map +1 -1
- package/v3/dist/mcp/security/oauth21-provider.js +15 -3
- package/v3/dist/mcp/security/oauth21-provider.js.map +1 -1
- package/v3/dist/mcp/server.d.ts.map +1 -1
- package/v3/dist/mcp/server.js +10 -24
- package/v3/dist/mcp/server.js.map +1 -1
- package/v3/dist/mcp/tool-registry.d.ts.map +1 -1
- package/v3/dist/mcp/tool-registry.js +2 -1
- package/v3/dist/mcp/tool-registry.js.map +1 -1
- package/v3/dist/mcp/tools/analysis/token-usage.d.ts.map +1 -1
- package/v3/dist/mcp/tools/analysis/token-usage.js +2 -1
- package/v3/dist/mcp/tools/analysis/token-usage.js.map +1 -1
- package/v3/dist/mcp/tools/base.d.ts.map +1 -1
- package/v3/dist/mcp/tools/base.js +2 -1
- package/v3/dist/mcp/tools/base.js.map +1 -1
- package/v3/dist/mcp/tools/chaos-resilience/inject.d.ts.map +1 -1
- package/v3/dist/mcp/tools/chaos-resilience/inject.js +2 -1
- package/v3/dist/mcp/tools/chaos-resilience/inject.js.map +1 -1
- package/v3/dist/mcp/tools/code-intelligence/analyze.d.ts.map +1 -1
- package/v3/dist/mcp/tools/code-intelligence/analyze.js +2 -1
- package/v3/dist/mcp/tools/code-intelligence/analyze.js.map +1 -1
- package/v3/dist/mcp/tools/coherence/audit.d.ts.map +1 -1
- package/v3/dist/mcp/tools/coherence/audit.js +2 -1
- package/v3/dist/mcp/tools/coherence/audit.js.map +1 -1
- package/v3/dist/mcp/tools/coherence/check.d.ts.map +1 -1
- package/v3/dist/mcp/tools/coherence/check.js +2 -1
- package/v3/dist/mcp/tools/coherence/check.js.map +1 -1
- package/v3/dist/mcp/tools/coherence/collapse.d.ts.map +1 -1
- package/v3/dist/mcp/tools/coherence/collapse.js +2 -1
- package/v3/dist/mcp/tools/coherence/collapse.js.map +1 -1
- package/v3/dist/mcp/tools/coherence/consensus.d.ts.map +1 -1
- package/v3/dist/mcp/tools/coherence/consensus.js +2 -1
- package/v3/dist/mcp/tools/coherence/consensus.js.map +1 -1
- package/v3/dist/mcp/tools/contract-testing/validate.d.ts.map +1 -1
- package/v3/dist/mcp/tools/contract-testing/validate.js +4 -3
- package/v3/dist/mcp/tools/contract-testing/validate.js.map +1 -1
- package/v3/dist/mcp/tools/coverage-analysis/index.d.ts.map +1 -1
- package/v3/dist/mcp/tools/coverage-analysis/index.js +7 -6
- package/v3/dist/mcp/tools/coverage-analysis/index.js.map +1 -1
- package/v3/dist/mcp/tools/defect-intelligence/predict.d.ts.map +1 -1
- package/v3/dist/mcp/tools/defect-intelligence/predict.js +2 -1
- package/v3/dist/mcp/tools/defect-intelligence/predict.js.map +1 -1
- package/v3/dist/mcp/tools/embeddings/embedding.d.ts.map +1 -1
- package/v3/dist/mcp/tools/embeddings/embedding.js +6 -5
- package/v3/dist/mcp/tools/embeddings/embedding.js.map +1 -1
- package/v3/dist/mcp/tools/learning-optimization/dream.d.ts.map +1 -1
- package/v3/dist/mcp/tools/learning-optimization/dream.js +3 -2
- package/v3/dist/mcp/tools/learning-optimization/dream.js.map +1 -1
- package/v3/dist/mcp/tools/learning-optimization/optimize.d.ts.map +1 -1
- package/v3/dist/mcp/tools/learning-optimization/optimize.js +2 -1
- package/v3/dist/mcp/tools/learning-optimization/optimize.js.map +1 -1
- package/v3/dist/mcp/tools/planning/goap-execute.d.ts.map +1 -1
- package/v3/dist/mcp/tools/planning/goap-execute.js +2 -1
- package/v3/dist/mcp/tools/planning/goap-execute.js.map +1 -1
- package/v3/dist/mcp/tools/planning/goap-plan.d.ts.map +1 -1
- package/v3/dist/mcp/tools/planning/goap-plan.js +2 -1
- package/v3/dist/mcp/tools/planning/goap-plan.js.map +1 -1
- package/v3/dist/mcp/tools/planning/goap-status.d.ts.map +1 -1
- package/v3/dist/mcp/tools/planning/goap-status.js +2 -1
- package/v3/dist/mcp/tools/planning/goap-status.js.map +1 -1
- package/v3/dist/mcp/tools/quality-assessment/evaluate.d.ts.map +1 -1
- package/v3/dist/mcp/tools/quality-assessment/evaluate.js +2 -1
- package/v3/dist/mcp/tools/quality-assessment/evaluate.js.map +1 -1
- package/v3/dist/mcp/tools/qx-analysis/analyze.d.ts.map +1 -1
- package/v3/dist/mcp/tools/qx-analysis/analyze.js +2 -1
- package/v3/dist/mcp/tools/qx-analysis/analyze.js.map +1 -1
- package/v3/dist/mcp/tools/qx-analysis/impact-analyzer.d.ts +12 -0
- package/v3/dist/mcp/tools/qx-analysis/impact-analyzer.d.ts.map +1 -1
- package/v3/dist/mcp/tools/qx-analysis/impact-analyzer.js +158 -109
- package/v3/dist/mcp/tools/qx-analysis/impact-analyzer.js.map +1 -1
- package/v3/dist/mcp/tools/requirements-validation/quality-criteria.d.ts.map +1 -1
- package/v3/dist/mcp/tools/requirements-validation/quality-criteria.js +2 -1
- package/v3/dist/mcp/tools/requirements-validation/quality-criteria.js.map +1 -1
- package/v3/dist/mcp/tools/requirements-validation/validate.d.ts.map +1 -1
- package/v3/dist/mcp/tools/requirements-validation/validate.js +2 -1
- package/v3/dist/mcp/tools/requirements-validation/validate.js.map +1 -1
- package/v3/dist/mcp/tools/security-compliance/scan.d.ts.map +1 -1
- package/v3/dist/mcp/tools/security-compliance/scan.js +2 -1
- package/v3/dist/mcp/tools/security-compliance/scan.js.map +1 -1
- package/v3/dist/mcp/tools/test-execution/e2e-execute.d.ts.map +1 -1
- package/v3/dist/mcp/tools/test-execution/e2e-execute.js +2 -1
- package/v3/dist/mcp/tools/test-execution/e2e-execute.js.map +1 -1
- package/v3/dist/mcp/tools/test-execution/execute.d.ts.map +1 -1
- package/v3/dist/mcp/tools/test-execution/execute.js +2 -1
- package/v3/dist/mcp/tools/test-execution/execute.js.map +1 -1
- package/v3/dist/mcp/tools/test-generation/generate.d.ts.map +1 -1
- package/v3/dist/mcp/tools/test-generation/generate.js +2 -1
- package/v3/dist/mcp/tools/test-generation/generate.js.map +1 -1
- package/v3/dist/mcp/tools/visual-accessibility/index.d.ts.map +1 -1
- package/v3/dist/mcp/tools/visual-accessibility/index.js +3 -2
- package/v3/dist/mcp/tools/visual-accessibility/index.js.map +1 -1
- package/v3/dist/mcp/transport/sse/sse-transport.js +1 -1
- package/v3/dist/mcp/transport/sse/sse-transport.js.map +1 -1
- package/v3/dist/mcp/transport/stdio.js +1 -1
- package/v3/dist/mcp/transport/stdio.js.map +1 -1
- package/v3/dist/mcp/transport/websocket/websocket-transport.js +1 -1
- package/v3/dist/mcp/transport/websocket/websocket-transport.js.map +1 -1
- package/v3/dist/memory/crdt/or-set.d.ts.map +1 -1
- package/v3/dist/memory/crdt/or-set.js +2 -1
- package/v3/dist/memory/crdt/or-set.js.map +1 -1
- package/v3/dist/optimization/auto-tuner.d.ts.map +1 -1
- package/v3/dist/optimization/auto-tuner.js +2 -1
- package/v3/dist/optimization/auto-tuner.js.map +1 -1
- package/v3/dist/optimization/early-exit-token-optimizer.d.ts.map +1 -1
- package/v3/dist/optimization/early-exit-token-optimizer.js +2 -1
- package/v3/dist/optimization/early-exit-token-optimizer.js.map +1 -1
- package/v3/dist/optimization/qe-workers.d.ts.map +1 -1
- package/v3/dist/optimization/qe-workers.js +2 -1
- package/v3/dist/optimization/qe-workers.js.map +1 -1
- package/v3/dist/performance/benchmarks.d.ts.map +1 -1
- package/v3/dist/performance/benchmarks.js +2 -1
- package/v3/dist/performance/benchmarks.js.map +1 -1
- package/v3/dist/performance/optimizer.d.ts.map +1 -1
- package/v3/dist/performance/optimizer.js +119 -71
- package/v3/dist/performance/optimizer.js.map +1 -1
- package/v3/dist/performance/run-gates.js +2 -1
- package/v3/dist/performance/run-gates.js.map +1 -1
- package/v3/dist/planning/goap-planner.d.ts +4 -1
- package/v3/dist/planning/goap-planner.d.ts.map +1 -1
- package/v3/dist/planning/goap-planner.js +128 -46
- package/v3/dist/planning/goap-planner.js.map +1 -1
- package/v3/dist/planning/index.d.ts +1 -1
- package/v3/dist/planning/index.d.ts.map +1 -1
- package/v3/dist/planning/index.js.map +1 -1
- package/v3/dist/planning/plan-executor.d.ts.map +1 -1
- package/v3/dist/planning/plan-executor.js +7 -5
- package/v3/dist/planning/plan-executor.js.map +1 -1
- package/v3/dist/planning/types.d.ts +0 -16
- package/v3/dist/planning/types.d.ts.map +1 -1
- package/v3/dist/routing/routing-feedback.d.ts.map +1 -1
- package/v3/dist/routing/routing-feedback.js +7 -5
- package/v3/dist/routing/routing-feedback.js.map +1 -1
- package/v3/dist/shared/base-domain-plugin.d.ts +198 -0
- package/v3/dist/shared/base-domain-plugin.d.ts.map +1 -0
- package/v3/dist/shared/base-domain-plugin.js +292 -0
- package/v3/dist/shared/base-domain-plugin.js.map +1 -0
- package/v3/dist/shared/domain-service-registry.d.ts +70 -0
- package/v3/dist/shared/domain-service-registry.d.ts.map +1 -0
- package/v3/dist/shared/domain-service-registry.js +87 -0
- package/v3/dist/shared/domain-service-registry.js.map +1 -0
- package/v3/dist/shared/embeddings/nomic-embedder.d.ts.map +1 -1
- package/v3/dist/shared/embeddings/nomic-embedder.js +2 -1
- package/v3/dist/shared/embeddings/nomic-embedder.js.map +1 -1
- package/v3/dist/shared/embeddings/ollama-client.d.ts.map +1 -1
- package/v3/dist/shared/embeddings/ollama-client.js +2 -1
- package/v3/dist/shared/embeddings/ollama-client.js.map +1 -1
- package/v3/dist/shared/error-utils.d.ts +16 -0
- package/v3/dist/shared/error-utils.d.ts.map +1 -0
- package/v3/dist/shared/error-utils.js +20 -0
- package/v3/dist/shared/error-utils.js.map +1 -0
- package/v3/dist/shared/http/http-client.d.ts.map +1 -1
- package/v3/dist/shared/http/http-client.js +2 -1
- package/v3/dist/shared/http/http-client.js.map +1 -1
- package/v3/dist/shared/index.d.ts +3 -0
- package/v3/dist/shared/index.d.ts.map +1 -1
- package/v3/dist/shared/index.js +3 -0
- package/v3/dist/shared/index.js.map +1 -1
- package/v3/dist/shared/io/file-reader.d.ts.map +1 -1
- package/v3/dist/shared/io/file-reader.js +2 -1
- package/v3/dist/shared/io/file-reader.js.map +1 -1
- package/v3/dist/shared/llm/circuit-breaker.d.ts.map +1 -1
- package/v3/dist/shared/llm/circuit-breaker.js +2 -1
- package/v3/dist/shared/llm/circuit-breaker.js.map +1 -1
- package/v3/dist/shared/llm/metrics/cost-metrics.js.map +1 -1
- package/v3/dist/shared/llm/metrics/router-metrics.d.ts.map +1 -1
- package/v3/dist/shared/llm/metrics/router-metrics.js.map +1 -1
- package/v3/dist/shared/llm/provider-manager.d.ts.map +1 -1
- package/v3/dist/shared/llm/provider-manager.js +2 -1
- package/v3/dist/shared/llm/provider-manager.js.map +1 -1
- package/v3/dist/shared/llm/providers/azure-openai.d.ts.map +1 -1
- package/v3/dist/shared/llm/providers/azure-openai.js +2 -1
- package/v3/dist/shared/llm/providers/azure-openai.js.map +1 -1
- package/v3/dist/shared/llm/providers/bedrock.d.ts.map +1 -1
- package/v3/dist/shared/llm/providers/bedrock.js +2 -1
- package/v3/dist/shared/llm/providers/bedrock.js.map +1 -1
- package/v3/dist/shared/llm/providers/claude.d.ts.map +1 -1
- package/v3/dist/shared/llm/providers/claude.js +2 -1
- package/v3/dist/shared/llm/providers/claude.js.map +1 -1
- package/v3/dist/shared/llm/providers/gemini.d.ts.map +1 -1
- package/v3/dist/shared/llm/providers/gemini.js +4 -2
- package/v3/dist/shared/llm/providers/gemini.js.map +1 -1
- package/v3/dist/shared/llm/providers/openai.d.ts.map +1 -1
- package/v3/dist/shared/llm/providers/openai.js +2 -1
- package/v3/dist/shared/llm/providers/openai.js.map +1 -1
- package/v3/dist/shared/llm/providers/openrouter.d.ts.map +1 -1
- package/v3/dist/shared/llm/providers/openrouter.js +4 -2
- package/v3/dist/shared/llm/providers/openrouter.js.map +1 -1
- package/v3/dist/shared/llm/router/hybrid-router.d.ts.map +1 -1
- package/v3/dist/shared/llm/router/hybrid-router.js +2 -1
- package/v3/dist/shared/llm/router/hybrid-router.js.map +1 -1
- package/v3/dist/shared/llm/translation/prompt-translator.d.ts.map +1 -1
- package/v3/dist/shared/llm/translation/prompt-translator.js +2 -1
- package/v3/dist/shared/llm/translation/prompt-translator.js.map +1 -1
- package/v3/dist/shared/safe-json.d.ts +57 -0
- package/v3/dist/shared/safe-json.d.ts.map +1 -0
- package/v3/dist/shared/safe-json.js +78 -0
- package/v3/dist/shared/safe-json.js.map +1 -0
- package/v3/dist/shared/sql-safety.d.ts +9 -0
- package/v3/dist/shared/sql-safety.d.ts.map +1 -1
- package/v3/dist/shared/sql-safety.js +20 -1
- package/v3/dist/shared/sql-safety.js.map +1 -1
- package/v3/dist/shared/utils/circular-buffer.js +1 -1
- package/v3/dist/shared/utils/circular-buffer.js.map +1 -1
- package/v3/dist/skills/security-visual-testing/index.d.ts.map +1 -1
- package/v3/dist/skills/security-visual-testing/index.js +6 -5
- package/v3/dist/skills/security-visual-testing/index.js.map +1 -1
- package/v3/dist/strange-loop/strange-loop.d.ts +0 -9
- package/v3/dist/strange-loop/strange-loop.d.ts.map +1 -1
- package/v3/dist/strange-loop/strange-loop.js +23 -15
- package/v3/dist/strange-loop/strange-loop.js.map +1 -1
- package/v3/dist/sync/claude-flow-bridge.d.ts.map +1 -1
- package/v3/dist/sync/claude-flow-bridge.js +2 -1
- package/v3/dist/sync/claude-flow-bridge.js.map +1 -1
- package/v3/dist/sync/cloud/index.d.ts +1 -1
- package/v3/dist/sync/cloud/index.d.ts.map +1 -1
- package/v3/dist/sync/cloud/index.js +1 -1
- package/v3/dist/sync/cloud/index.js.map +1 -1
- package/v3/dist/sync/cloud/postgres-writer.d.ts.map +1 -1
- package/v3/dist/sync/cloud/postgres-writer.js +20 -9
- package/v3/dist/sync/cloud/postgres-writer.js.map +1 -1
- package/v3/dist/sync/cloud/tunnel-manager.d.ts +17 -1
- package/v3/dist/sync/cloud/tunnel-manager.d.ts.map +1 -1
- package/v3/dist/sync/cloud/tunnel-manager.js +36 -1
- package/v3/dist/sync/cloud/tunnel-manager.js.map +1 -1
- package/v3/dist/sync/embeddings/sync-embedding-generator.d.ts.map +1 -1
- package/v3/dist/sync/embeddings/sync-embedding-generator.js +11 -5
- package/v3/dist/sync/embeddings/sync-embedding-generator.js.map +1 -1
- package/v3/dist/sync/readers/json-reader.d.ts.map +1 -1
- package/v3/dist/sync/readers/json-reader.js +2 -1
- package/v3/dist/sync/readers/json-reader.js.map +1 -1
- package/v3/dist/sync/readers/sqlite-reader.d.ts.map +1 -1
- package/v3/dist/sync/readers/sqlite-reader.js +14 -6
- package/v3/dist/sync/readers/sqlite-reader.js.map +1 -1
- package/v3/dist/sync/sync-agent.d.ts.map +1 -1
- package/v3/dist/sync/sync-agent.js +10 -6
- package/v3/dist/sync/sync-agent.js.map +1 -1
- package/v3/dist/test-scheduling/executors/vitest-executor.d.ts.map +1 -1
- package/v3/dist/test-scheduling/executors/vitest-executor.js +3 -2
- package/v3/dist/test-scheduling/executors/vitest-executor.js.map +1 -1
- package/v3/dist/test-scheduling/flaky-tracking/flaky-tracker.d.ts.map +1 -1
- package/v3/dist/test-scheduling/flaky-tracking/flaky-tracker.js +2 -1
- package/v3/dist/test-scheduling/flaky-tracking/flaky-tracker.js.map +1 -1
- package/v3/dist/testing/load/agent-load-tester.d.ts.map +1 -1
- package/v3/dist/testing/load/agent-load-tester.js +2 -1
- package/v3/dist/testing/load/agent-load-tester.js.map +1 -1
- package/v3/dist/validation/parallel-eval-runner.d.ts.map +1 -1
- package/v3/dist/validation/parallel-eval-runner.js +83 -37
- package/v3/dist/validation/parallel-eval-runner.js.map +1 -1
- package/v3/dist/validation/swarm-skill-validator.d.ts.map +1 -1
- package/v3/dist/validation/swarm-skill-validator.js +2 -1
- package/v3/dist/validation/swarm-skill-validator.js.map +1 -1
- package/v3/dist/validation/validation-result-aggregator.d.ts.map +1 -1
- package/v3/dist/validation/validation-result-aggregator.js +2 -1
- package/v3/dist/validation/validation-result-aggregator.js.map +1 -1
- package/v3/dist/workers/base-worker.d.ts.map +1 -1
- package/v3/dist/workers/base-worker.js +2 -1
- package/v3/dist/workers/base-worker.js.map +1 -1
- package/v3/dist/workers/workers/cloud-sync.d.ts.map +1 -1
- package/v3/dist/workers/workers/cloud-sync.js +2 -1
- package/v3/dist/workers/workers/cloud-sync.js.map +1 -1
- package/v3/dist/workers/workers/learning-consolidation.d.ts.map +1 -1
- package/v3/dist/workers/workers/learning-consolidation.js +4 -3
- package/v3/dist/workers/workers/learning-consolidation.js.map +1 -1
- package/v3/dist/workers/workers/test-health.d.ts.map +1 -1
- package/v3/dist/workers/workers/test-health.js +2 -1
- package/v3/dist/workers/workers/test-health.js.map +1 -1
- package/v3/package.json +3 -2
|
@@ -15,24 +15,42 @@
|
|
|
15
15
|
* - v2 backward compatibility (existing memory.db migrates seamlessly)
|
|
16
16
|
* - Atomic cross-feature transactions
|
|
17
17
|
* - No confusion about where data lives
|
|
18
|
+
*
|
|
19
|
+
* Module structure (extracted for maintainability):
|
|
20
|
+
* - unified-memory-schemas.ts: SQL schema definitions
|
|
21
|
+
* - unified-memory-hnsw.ts: HNSW index + BinaryHeap
|
|
22
|
+
* - unified-memory.ts: UnifiedMemoryManager class (this file, facade)
|
|
18
23
|
*/
|
|
19
24
|
import Database from 'better-sqlite3';
|
|
25
|
+
import { safeJsonParse } from '../shared/safe-json.js';
|
|
26
|
+
import { toErrorMessage } from '../shared/error-utils.js';
|
|
20
27
|
import * as fs from 'fs';
|
|
21
28
|
import * as path from 'path';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
// ============================================================================
|
|
26
|
-
// SQL Table Name Allowlist (defense-in-depth against SQL injection)
|
|
27
|
-
// ============================================================================
|
|
29
|
+
import { MEMORY_CONSTANTS } from './constants.js';
|
|
30
|
+
import { LoggerFactory } from '../logging/index.js';
|
|
31
|
+
const logger = LoggerFactory.create('unified-memory');
|
|
28
32
|
// Re-export from shared module for backward compatibility
|
|
29
33
|
export { validateTableName, ALLOWED_TABLE_NAMES } from '../shared/sql-safety.js';
|
|
30
34
|
import { validateTableName } from '../shared/sql-safety.js';
|
|
35
|
+
// Re-export extracted modules for backward compatibility
|
|
36
|
+
export { BinaryHeap, InMemoryHNSWIndex } from './unified-memory-hnsw.js';
|
|
37
|
+
import { InMemoryHNSWIndex } from './unified-memory-hnsw.js';
|
|
38
|
+
// Import schemas
|
|
39
|
+
import { SCHEMA_VERSION, SCHEMA_VERSION_TABLE, KV_STORE_SCHEMA, VECTORS_SCHEMA, RL_QVALUES_SCHEMA, GOAP_SCHEMA, DREAM_SCHEMA, QE_PATTERNS_SCHEMA, MINCUT_SCHEMA, SONA_PATTERNS_SCHEMA, FEEDBACK_SCHEMA, HYPERGRAPH_SCHEMA, STATS_TABLES, } from './unified-memory-schemas.js';
|
|
31
40
|
// CRDT imports for distributed state synchronization
|
|
32
41
|
import { createCRDTStore, } from '../memory/crdt/index.js';
|
|
33
42
|
// ============================================================================
|
|
34
43
|
// Project Root Detection
|
|
35
44
|
// ============================================================================
|
|
45
|
+
/** Module-level cache for findProjectRoot result. */
|
|
46
|
+
let _cachedProjectRoot = null;
|
|
47
|
+
/**
|
|
48
|
+
* Clear the cached project root. Useful for testing or when the
|
|
49
|
+
* environment changes at runtime.
|
|
50
|
+
*/
|
|
51
|
+
export function clearProjectRootCache() {
|
|
52
|
+
_cachedProjectRoot = null;
|
|
53
|
+
}
|
|
36
54
|
/**
|
|
37
55
|
* Find the project root by walking up the directory tree.
|
|
38
56
|
*
|
|
@@ -43,54 +61,50 @@ import { createCRDTStore, } from '../memory/crdt/index.js';
|
|
|
43
61
|
* 4. Walk up looking for package.json WITHOUT node_modules sibling (monorepo root)
|
|
44
62
|
* 5. Fallback to current working directory
|
|
45
63
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
64
|
+
* Optimized: single upward walk checks all markers in one pass,
|
|
65
|
+
* and the result is cached at module level for subsequent calls.
|
|
48
66
|
*/
|
|
49
67
|
export function findProjectRoot(startDir = process.cwd()) {
|
|
50
|
-
|
|
68
|
+
if (_cachedProjectRoot) {
|
|
69
|
+
return _cachedProjectRoot;
|
|
70
|
+
}
|
|
51
71
|
if (process.env.AQE_PROJECT_ROOT) {
|
|
52
|
-
|
|
72
|
+
_cachedProjectRoot = process.env.AQE_PROJECT_ROOT;
|
|
73
|
+
return _cachedProjectRoot;
|
|
53
74
|
}
|
|
54
|
-
|
|
75
|
+
const dir = startDir;
|
|
55
76
|
const root = path.parse(dir).root;
|
|
56
|
-
// Priority 2: Look for existing .agentic-qe directory (AQE project marker)
|
|
57
|
-
// Walk ALL the way up and use the TOPMOST .agentic-qe found, not the first.
|
|
58
|
-
// This prevents subdirectories (e.g. v3/.agentic-qe) from shadowing the
|
|
59
|
-
// root project database, which caused a split-brain with two DBs growing.
|
|
60
77
|
let checkDir = dir;
|
|
61
78
|
let topmostAqeDir = null;
|
|
79
|
+
let lowestGitDir = null;
|
|
80
|
+
let topmostPackageJson = null;
|
|
62
81
|
while (checkDir !== root) {
|
|
63
82
|
if (fs.existsSync(path.join(checkDir, '.agentic-qe'))) {
|
|
64
83
|
topmostAqeDir = checkDir;
|
|
65
84
|
}
|
|
66
|
-
checkDir = path.dirname(checkDir);
|
|
67
|
-
}
|
|
68
|
-
if (topmostAqeDir) {
|
|
69
|
-
return topmostAqeDir;
|
|
70
|
-
}
|
|
71
|
-
// Priority 3: Look for .git directory (repo root)
|
|
72
|
-
checkDir = dir;
|
|
73
|
-
while (checkDir !== root) {
|
|
74
85
|
if (fs.existsSync(path.join(checkDir, '.git'))) {
|
|
75
|
-
|
|
86
|
+
if (lowestGitDir === null) {
|
|
87
|
+
lowestGitDir = checkDir;
|
|
88
|
+
}
|
|
76
89
|
}
|
|
77
|
-
checkDir = path.dirname(checkDir);
|
|
78
|
-
}
|
|
79
|
-
// Priority 4: Look for root package.json (skip monorepo subdirectories)
|
|
80
|
-
// A root package.json typically has workspaces or is not inside node_modules
|
|
81
|
-
checkDir = dir;
|
|
82
|
-
let lastPackageJson = null;
|
|
83
|
-
while (checkDir !== root) {
|
|
84
90
|
if (fs.existsSync(path.join(checkDir, 'package.json'))) {
|
|
85
|
-
|
|
91
|
+
topmostPackageJson = checkDir;
|
|
86
92
|
}
|
|
87
93
|
checkDir = path.dirname(checkDir);
|
|
88
94
|
}
|
|
89
|
-
if (
|
|
90
|
-
|
|
95
|
+
if (topmostAqeDir) {
|
|
96
|
+
_cachedProjectRoot = topmostAqeDir;
|
|
97
|
+
}
|
|
98
|
+
else if (lowestGitDir) {
|
|
99
|
+
_cachedProjectRoot = lowestGitDir;
|
|
91
100
|
}
|
|
92
|
-
|
|
93
|
-
|
|
101
|
+
else if (topmostPackageJson) {
|
|
102
|
+
_cachedProjectRoot = topmostPackageJson;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
_cachedProjectRoot = process.cwd();
|
|
106
|
+
}
|
|
107
|
+
return _cachedProjectRoot;
|
|
94
108
|
}
|
|
95
109
|
/**
|
|
96
110
|
* Get the default database path using project root detection.
|
|
@@ -100,25 +114,14 @@ export function getDefaultDbPath() {
|
|
|
100
114
|
const projectRoot = findProjectRoot();
|
|
101
115
|
return path.join(projectRoot, '.agentic-qe', 'memory.db');
|
|
102
116
|
}
|
|
103
|
-
/**
|
|
104
|
-
* Default config uses project root detection for the database path.
|
|
105
|
-
* This ensures all V3 systems (MCP, CLI, hooks) use the same database.
|
|
106
|
-
*
|
|
107
|
-
* NOTE: dbPath is resolved lazily via getDefaultDbPath() when config
|
|
108
|
-
* is first used. The static value here is a fallback for edge cases.
|
|
109
|
-
*/
|
|
110
117
|
export const DEFAULT_UNIFIED_MEMORY_CONFIG = {
|
|
111
|
-
dbPath: '.agentic-qe/memory.db',
|
|
118
|
+
dbPath: '.agentic-qe/memory.db',
|
|
112
119
|
walMode: true,
|
|
113
120
|
mmapSize: MEMORY_CONSTANTS.MMAP_SIZE_BYTES,
|
|
114
121
|
cacheSize: MEMORY_CONSTANTS.CACHE_SIZE_KB,
|
|
115
122
|
busyTimeout: MEMORY_CONSTANTS.BUSY_TIMEOUT_MS,
|
|
116
123
|
vectorDimensions: MEMORY_CONSTANTS.DEFAULT_VECTOR_DIMENSIONS,
|
|
117
124
|
};
|
|
118
|
-
/**
|
|
119
|
-
* Get the resolved default config with project root detection applied.
|
|
120
|
-
* Call this instead of using DEFAULT_UNIFIED_MEMORY_CONFIG directly.
|
|
121
|
-
*/
|
|
122
125
|
export function getResolvedDefaultConfig() {
|
|
123
126
|
return {
|
|
124
127
|
...DEFAULT_UNIFIED_MEMORY_CONFIG,
|
|
@@ -136,7 +139,7 @@ export function getResolvedDefaultConfig() {
|
|
|
136
139
|
//
|
|
137
140
|
// Tables actively wired (DO NOT remove):
|
|
138
141
|
// - embeddings, executed_steps, execution_results,
|
|
139
|
-
//
|
|
142
|
+
// goap_goals, goap_plan_signatures,
|
|
140
143
|
// hypergraph_edges, hypergraph_nodes
|
|
141
144
|
//
|
|
142
145
|
// Tables partially wired (in allowlist, need INSERT code):
|
|
@@ -144,958 +147,6 @@ export function getResolvedDefaultConfig() {
|
|
|
144
147
|
// workflow_state, experience_applications
|
|
145
148
|
// ============================================================================
|
|
146
149
|
// ============================================================================
|
|
147
|
-
// Schema Version for Migrations
|
|
148
|
-
// ============================================================================
|
|
149
|
-
const SCHEMA_VERSION = 8; // v8: adds feedback loop persistence tables (ADR-023, ADR-022)
|
|
150
|
-
const SCHEMA_VERSION_TABLE = `
|
|
151
|
-
CREATE TABLE IF NOT EXISTS schema_version (
|
|
152
|
-
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
153
|
-
version INTEGER NOT NULL,
|
|
154
|
-
migrated_at TEXT DEFAULT (datetime('now'))
|
|
155
|
-
);
|
|
156
|
-
`;
|
|
157
|
-
// ============================================================================
|
|
158
|
-
// Schema Definitions
|
|
159
|
-
// ============================================================================
|
|
160
|
-
const KV_STORE_SCHEMA = `
|
|
161
|
-
-- Key-Value Store (v2 compatible - same schema as HybridBackend)
|
|
162
|
-
CREATE TABLE IF NOT EXISTS kv_store (
|
|
163
|
-
key TEXT NOT NULL,
|
|
164
|
-
namespace TEXT NOT NULL,
|
|
165
|
-
value TEXT NOT NULL,
|
|
166
|
-
expires_at INTEGER,
|
|
167
|
-
created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),
|
|
168
|
-
PRIMARY KEY (namespace, key)
|
|
169
|
-
);
|
|
170
|
-
CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);
|
|
171
|
-
CREATE INDEX IF NOT EXISTS idx_kv_expires ON kv_store(expires_at) WHERE expires_at IS NOT NULL;
|
|
172
|
-
`;
|
|
173
|
-
const VECTORS_SCHEMA = `
|
|
174
|
-
-- Vector Embeddings (new in v3 - replaces in-memory AgentDB)
|
|
175
|
-
CREATE TABLE IF NOT EXISTS vectors (
|
|
176
|
-
id TEXT PRIMARY KEY,
|
|
177
|
-
namespace TEXT NOT NULL DEFAULT 'default',
|
|
178
|
-
embedding BLOB NOT NULL,
|
|
179
|
-
dimensions INTEGER NOT NULL,
|
|
180
|
-
metadata TEXT,
|
|
181
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
182
|
-
updated_at TEXT DEFAULT (datetime('now'))
|
|
183
|
-
);
|
|
184
|
-
CREATE INDEX IF NOT EXISTS idx_vectors_namespace ON vectors(namespace);
|
|
185
|
-
CREATE INDEX IF NOT EXISTS idx_vectors_dimensions ON vectors(dimensions);
|
|
186
|
-
`;
|
|
187
|
-
const RL_QVALUES_SCHEMA = `
|
|
188
|
-
-- Q-Values for RL algorithms (ADR-046)
|
|
189
|
-
CREATE TABLE IF NOT EXISTS rl_q_values (
|
|
190
|
-
id TEXT PRIMARY KEY,
|
|
191
|
-
algorithm TEXT NOT NULL,
|
|
192
|
-
agent_id TEXT NOT NULL,
|
|
193
|
-
state_key TEXT NOT NULL,
|
|
194
|
-
action_key TEXT NOT NULL,
|
|
195
|
-
q_value REAL NOT NULL DEFAULT 0.0,
|
|
196
|
-
visits INTEGER NOT NULL DEFAULT 0,
|
|
197
|
-
last_reward REAL,
|
|
198
|
-
domain TEXT,
|
|
199
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
200
|
-
updated_at TEXT DEFAULT (datetime('now')),
|
|
201
|
-
UNIQUE(algorithm, agent_id, state_key, action_key)
|
|
202
|
-
);
|
|
203
|
-
CREATE INDEX IF NOT EXISTS idx_qvalues_agent ON rl_q_values(agent_id);
|
|
204
|
-
CREATE INDEX IF NOT EXISTS idx_qvalues_algorithm ON rl_q_values(algorithm);
|
|
205
|
-
CREATE INDEX IF NOT EXISTS idx_qvalues_state ON rl_q_values(agent_id, state_key);
|
|
206
|
-
CREATE INDEX IF NOT EXISTS idx_qvalues_domain ON rl_q_values(domain);
|
|
207
|
-
CREATE INDEX IF NOT EXISTS idx_qvalues_updated ON rl_q_values(updated_at);
|
|
208
|
-
`;
|
|
209
|
-
const GOAP_SCHEMA = `
|
|
210
|
-
-- GOAP Goals
|
|
211
|
-
CREATE TABLE IF NOT EXISTS goap_goals (
|
|
212
|
-
id TEXT PRIMARY KEY,
|
|
213
|
-
name TEXT NOT NULL,
|
|
214
|
-
description TEXT,
|
|
215
|
-
conditions TEXT NOT NULL,
|
|
216
|
-
priority INTEGER DEFAULT 3,
|
|
217
|
-
qe_domain TEXT,
|
|
218
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
-- GOAP Actions
|
|
222
|
-
CREATE TABLE IF NOT EXISTS goap_actions (
|
|
223
|
-
id TEXT PRIMARY KEY,
|
|
224
|
-
name TEXT NOT NULL,
|
|
225
|
-
description TEXT,
|
|
226
|
-
agent_type TEXT NOT NULL,
|
|
227
|
-
preconditions TEXT NOT NULL,
|
|
228
|
-
effects TEXT NOT NULL,
|
|
229
|
-
cost REAL DEFAULT 1.0,
|
|
230
|
-
estimated_duration_ms INTEGER,
|
|
231
|
-
success_rate REAL DEFAULT 1.0,
|
|
232
|
-
execution_count INTEGER DEFAULT 0,
|
|
233
|
-
category TEXT NOT NULL,
|
|
234
|
-
qe_domain TEXT,
|
|
235
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
236
|
-
updated_at TEXT DEFAULT (datetime('now'))
|
|
237
|
-
);
|
|
238
|
-
|
|
239
|
-
-- GOAP Plans
|
|
240
|
-
CREATE TABLE IF NOT EXISTS goap_plans (
|
|
241
|
-
id TEXT PRIMARY KEY,
|
|
242
|
-
goal_id TEXT,
|
|
243
|
-
initial_state TEXT NOT NULL,
|
|
244
|
-
goal_state TEXT NOT NULL,
|
|
245
|
-
action_sequence TEXT NOT NULL,
|
|
246
|
-
total_cost REAL,
|
|
247
|
-
estimated_duration_ms INTEGER,
|
|
248
|
-
status TEXT DEFAULT 'pending',
|
|
249
|
-
reused_from TEXT,
|
|
250
|
-
similarity_score REAL,
|
|
251
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
252
|
-
executed_at TEXT,
|
|
253
|
-
completed_at TEXT,
|
|
254
|
-
FOREIGN KEY (goal_id) REFERENCES goap_goals(id)
|
|
255
|
-
);
|
|
256
|
-
|
|
257
|
-
-- GOAP Execution Steps
|
|
258
|
-
CREATE TABLE IF NOT EXISTS goap_execution_steps (
|
|
259
|
-
id TEXT PRIMARY KEY,
|
|
260
|
-
plan_id TEXT NOT NULL,
|
|
261
|
-
action_id TEXT NOT NULL,
|
|
262
|
-
step_order INTEGER NOT NULL,
|
|
263
|
-
world_state_before TEXT,
|
|
264
|
-
world_state_after TEXT,
|
|
265
|
-
status TEXT DEFAULT 'pending',
|
|
266
|
-
duration_ms INTEGER,
|
|
267
|
-
agent_id TEXT,
|
|
268
|
-
error_message TEXT,
|
|
269
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
270
|
-
FOREIGN KEY (plan_id) REFERENCES goap_plans(id),
|
|
271
|
-
FOREIGN KEY (action_id) REFERENCES goap_actions(id)
|
|
272
|
-
);
|
|
273
|
-
|
|
274
|
-
-- Plan Signatures (for similarity matching)
|
|
275
|
-
CREATE TABLE IF NOT EXISTS goap_plan_signatures (
|
|
276
|
-
id TEXT PRIMARY KEY,
|
|
277
|
-
plan_id TEXT NOT NULL UNIQUE,
|
|
278
|
-
goal_hash TEXT NOT NULL,
|
|
279
|
-
state_vector TEXT NOT NULL,
|
|
280
|
-
action_sequence TEXT NOT NULL,
|
|
281
|
-
total_cost REAL NOT NULL,
|
|
282
|
-
success_rate REAL DEFAULT 1.0,
|
|
283
|
-
usage_count INTEGER DEFAULT 0,
|
|
284
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
285
|
-
);
|
|
286
|
-
|
|
287
|
-
-- GOAP Indexes
|
|
288
|
-
CREATE INDEX IF NOT EXISTS idx_goap_actions_category ON goap_actions(category);
|
|
289
|
-
CREATE INDEX IF NOT EXISTS idx_goap_actions_agent ON goap_actions(agent_type);
|
|
290
|
-
CREATE INDEX IF NOT EXISTS idx_goap_plans_status ON goap_plans(status);
|
|
291
|
-
CREATE INDEX IF NOT EXISTS idx_goap_steps_plan ON goap_execution_steps(plan_id);
|
|
292
|
-
CREATE INDEX IF NOT EXISTS idx_goap_sig_goal ON goap_plan_signatures(goal_hash);
|
|
293
|
-
`;
|
|
294
|
-
const DREAM_SCHEMA = `
|
|
295
|
-
-- Concept Graph Nodes (Dream Engine)
|
|
296
|
-
CREATE TABLE IF NOT EXISTS concept_nodes (
|
|
297
|
-
id TEXT PRIMARY KEY,
|
|
298
|
-
concept_type TEXT NOT NULL,
|
|
299
|
-
content TEXT NOT NULL,
|
|
300
|
-
embedding BLOB,
|
|
301
|
-
activation_level REAL DEFAULT 0.0,
|
|
302
|
-
last_activated TEXT,
|
|
303
|
-
pattern_id TEXT,
|
|
304
|
-
metadata TEXT,
|
|
305
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
306
|
-
);
|
|
307
|
-
|
|
308
|
-
-- Concept Edges
|
|
309
|
-
CREATE TABLE IF NOT EXISTS concept_edges (
|
|
310
|
-
id TEXT PRIMARY KEY,
|
|
311
|
-
source TEXT NOT NULL,
|
|
312
|
-
target TEXT NOT NULL,
|
|
313
|
-
weight REAL NOT NULL DEFAULT 1.0,
|
|
314
|
-
edge_type TEXT NOT NULL,
|
|
315
|
-
evidence INTEGER DEFAULT 1,
|
|
316
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
317
|
-
updated_at TEXT DEFAULT (datetime('now')),
|
|
318
|
-
FOREIGN KEY (source) REFERENCES concept_nodes(id) ON DELETE CASCADE,
|
|
319
|
-
FOREIGN KEY (target) REFERENCES concept_nodes(id) ON DELETE CASCADE
|
|
320
|
-
);
|
|
321
|
-
|
|
322
|
-
-- Dream Cycles
|
|
323
|
-
CREATE TABLE IF NOT EXISTS dream_cycles (
|
|
324
|
-
id TEXT PRIMARY KEY,
|
|
325
|
-
start_time TEXT NOT NULL,
|
|
326
|
-
end_time TEXT,
|
|
327
|
-
duration_ms INTEGER,
|
|
328
|
-
concepts_processed INTEGER DEFAULT 0,
|
|
329
|
-
associations_found INTEGER DEFAULT 0,
|
|
330
|
-
insights_generated INTEGER DEFAULT 0,
|
|
331
|
-
status TEXT DEFAULT 'running',
|
|
332
|
-
error TEXT,
|
|
333
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
334
|
-
);
|
|
335
|
-
|
|
336
|
-
-- Dream Insights
|
|
337
|
-
CREATE TABLE IF NOT EXISTS dream_insights (
|
|
338
|
-
id TEXT PRIMARY KEY,
|
|
339
|
-
cycle_id TEXT NOT NULL,
|
|
340
|
-
insight_type TEXT NOT NULL,
|
|
341
|
-
source_concepts TEXT NOT NULL,
|
|
342
|
-
description TEXT NOT NULL,
|
|
343
|
-
novelty_score REAL DEFAULT 0.5,
|
|
344
|
-
confidence_score REAL DEFAULT 0.5,
|
|
345
|
-
actionable INTEGER DEFAULT 0,
|
|
346
|
-
applied INTEGER DEFAULT 0,
|
|
347
|
-
suggested_action TEXT,
|
|
348
|
-
pattern_id TEXT,
|
|
349
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
350
|
-
FOREIGN KEY (cycle_id) REFERENCES dream_cycles(id) ON DELETE CASCADE
|
|
351
|
-
);
|
|
352
|
-
|
|
353
|
-
-- Dream Indexes
|
|
354
|
-
CREATE INDEX IF NOT EXISTS idx_concept_type ON concept_nodes(concept_type);
|
|
355
|
-
CREATE INDEX IF NOT EXISTS idx_concept_activation ON concept_nodes(activation_level);
|
|
356
|
-
CREATE INDEX IF NOT EXISTS idx_concept_pattern ON concept_nodes(pattern_id);
|
|
357
|
-
CREATE INDEX IF NOT EXISTS idx_edge_source ON concept_edges(source);
|
|
358
|
-
CREATE INDEX IF NOT EXISTS idx_edge_target ON concept_edges(target);
|
|
359
|
-
CREATE INDEX IF NOT EXISTS idx_edge_type ON concept_edges(edge_type);
|
|
360
|
-
CREATE INDEX IF NOT EXISTS idx_edge_weight ON concept_edges(weight DESC);
|
|
361
|
-
CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id);
|
|
362
|
-
CREATE INDEX IF NOT EXISTS idx_dream_status ON dream_cycles(status);
|
|
363
|
-
`;
|
|
364
|
-
const QE_PATTERNS_SCHEMA = `
|
|
365
|
-
-- QE Patterns table (unified from sqlite-persistence.ts)
|
|
366
|
-
CREATE TABLE IF NOT EXISTS qe_patterns (
|
|
367
|
-
id TEXT PRIMARY KEY,
|
|
368
|
-
pattern_type TEXT NOT NULL,
|
|
369
|
-
qe_domain TEXT NOT NULL,
|
|
370
|
-
domain TEXT NOT NULL,
|
|
371
|
-
name TEXT NOT NULL,
|
|
372
|
-
description TEXT,
|
|
373
|
-
confidence REAL DEFAULT 0.5,
|
|
374
|
-
usage_count INTEGER DEFAULT 0,
|
|
375
|
-
success_rate REAL DEFAULT 0.0,
|
|
376
|
-
quality_score REAL DEFAULT 0.0,
|
|
377
|
-
tier TEXT DEFAULT 'short-term',
|
|
378
|
-
template_json TEXT,
|
|
379
|
-
context_json TEXT,
|
|
380
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
381
|
-
updated_at TEXT DEFAULT (datetime('now')),
|
|
382
|
-
last_used_at TEXT,
|
|
383
|
-
successful_uses INTEGER DEFAULT 0,
|
|
384
|
-
tokens_used INTEGER,
|
|
385
|
-
input_tokens INTEGER,
|
|
386
|
-
output_tokens INTEGER,
|
|
387
|
-
latency_ms REAL,
|
|
388
|
-
reusable INTEGER DEFAULT 0,
|
|
389
|
-
reuse_count INTEGER DEFAULT 0,
|
|
390
|
-
average_token_savings REAL DEFAULT 0,
|
|
391
|
-
total_tokens_saved INTEGER
|
|
392
|
-
);
|
|
393
|
-
|
|
394
|
-
-- Pattern embeddings table (BLOB storage for vectors)
|
|
395
|
-
CREATE TABLE IF NOT EXISTS qe_pattern_embeddings (
|
|
396
|
-
pattern_id TEXT PRIMARY KEY,
|
|
397
|
-
embedding BLOB NOT NULL,
|
|
398
|
-
dimension INTEGER NOT NULL,
|
|
399
|
-
model TEXT DEFAULT 'all-MiniLM-L6-v2',
|
|
400
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
401
|
-
FOREIGN KEY (pattern_id) REFERENCES qe_patterns(id) ON DELETE CASCADE
|
|
402
|
-
);
|
|
403
|
-
|
|
404
|
-
-- Pattern usage history (no FK — used as analytics log by hooks with synthetic IDs)
|
|
405
|
-
CREATE TABLE IF NOT EXISTS qe_pattern_usage (
|
|
406
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
407
|
-
pattern_id TEXT NOT NULL,
|
|
408
|
-
success INTEGER NOT NULL,
|
|
409
|
-
metrics_json TEXT,
|
|
410
|
-
feedback TEXT,
|
|
411
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
412
|
-
);
|
|
413
|
-
|
|
414
|
-
-- Learning trajectories
|
|
415
|
-
CREATE TABLE IF NOT EXISTS qe_trajectories (
|
|
416
|
-
id TEXT PRIMARY KEY,
|
|
417
|
-
task TEXT NOT NULL,
|
|
418
|
-
agent TEXT,
|
|
419
|
-
domain TEXT,
|
|
420
|
-
started_at TEXT DEFAULT (datetime('now')),
|
|
421
|
-
ended_at TEXT,
|
|
422
|
-
success INTEGER,
|
|
423
|
-
steps_json TEXT,
|
|
424
|
-
metadata_json TEXT
|
|
425
|
-
);
|
|
426
|
-
|
|
427
|
-
-- Embeddings table (unified from EmbeddingCache.ts)
|
|
428
|
-
-- Renamed from 'embedding_cache' to 'embeddings' to match existing code
|
|
429
|
-
CREATE TABLE IF NOT EXISTS embeddings (
|
|
430
|
-
key TEXT NOT NULL,
|
|
431
|
-
namespace TEXT NOT NULL,
|
|
432
|
-
vector BLOB NOT NULL,
|
|
433
|
-
dimension INTEGER NOT NULL,
|
|
434
|
-
text TEXT NOT NULL,
|
|
435
|
-
timestamp INTEGER NOT NULL,
|
|
436
|
-
quantization TEXT NOT NULL,
|
|
437
|
-
metadata TEXT,
|
|
438
|
-
access_count INTEGER DEFAULT 1,
|
|
439
|
-
last_access INTEGER NOT NULL,
|
|
440
|
-
PRIMARY KEY (key, namespace)
|
|
441
|
-
);
|
|
442
|
-
|
|
443
|
-
-- Execution results table (unified from plan-executor.ts)
|
|
444
|
-
CREATE TABLE IF NOT EXISTS execution_results (
|
|
445
|
-
id TEXT PRIMARY KEY,
|
|
446
|
-
plan_id TEXT NOT NULL,
|
|
447
|
-
status TEXT NOT NULL,
|
|
448
|
-
steps_completed INTEGER DEFAULT 0,
|
|
449
|
-
steps_failed INTEGER DEFAULT 0,
|
|
450
|
-
total_duration_ms INTEGER DEFAULT 0,
|
|
451
|
-
final_world_state TEXT,
|
|
452
|
-
error_message TEXT,
|
|
453
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
454
|
-
);
|
|
455
|
-
|
|
456
|
-
-- Executed steps table (unified from plan-executor.ts)
|
|
457
|
-
CREATE TABLE IF NOT EXISTS executed_steps (
|
|
458
|
-
id TEXT PRIMARY KEY,
|
|
459
|
-
execution_id TEXT NOT NULL,
|
|
460
|
-
plan_id TEXT NOT NULL,
|
|
461
|
-
action_id TEXT NOT NULL,
|
|
462
|
-
step_order INTEGER NOT NULL,
|
|
463
|
-
status TEXT NOT NULL,
|
|
464
|
-
retries INTEGER DEFAULT 0,
|
|
465
|
-
started_at TEXT NOT NULL,
|
|
466
|
-
completed_at TEXT,
|
|
467
|
-
duration_ms INTEGER,
|
|
468
|
-
agent_id TEXT,
|
|
469
|
-
agent_output TEXT,
|
|
470
|
-
world_state_before TEXT,
|
|
471
|
-
world_state_after TEXT,
|
|
472
|
-
error_message TEXT,
|
|
473
|
-
FOREIGN KEY (execution_id) REFERENCES execution_results(id)
|
|
474
|
-
);
|
|
475
|
-
|
|
476
|
-
-- QE Patterns indexes
|
|
477
|
-
CREATE INDEX IF NOT EXISTS idx_qe_patterns_domain ON qe_patterns(qe_domain);
|
|
478
|
-
CREATE INDEX IF NOT EXISTS idx_qe_patterns_type ON qe_patterns(pattern_type);
|
|
479
|
-
CREATE INDEX IF NOT EXISTS idx_qe_patterns_tier ON qe_patterns(tier);
|
|
480
|
-
CREATE INDEX IF NOT EXISTS idx_qe_patterns_quality ON qe_patterns(quality_score DESC);
|
|
481
|
-
CREATE INDEX IF NOT EXISTS idx_qe_usage_pattern ON qe_pattern_usage(pattern_id);
|
|
482
|
-
CREATE INDEX IF NOT EXISTS idx_qe_trajectories_domain ON qe_trajectories(domain);
|
|
483
|
-
CREATE INDEX IF NOT EXISTS idx_embeddings_namespace ON embeddings(namespace);
|
|
484
|
-
CREATE INDEX IF NOT EXISTS idx_embeddings_timestamp ON embeddings(timestamp);
|
|
485
|
-
CREATE INDEX IF NOT EXISTS idx_execution_results_plan ON execution_results(plan_id);
|
|
486
|
-
CREATE INDEX IF NOT EXISTS idx_execution_results_status ON execution_results(status);
|
|
487
|
-
CREATE INDEX IF NOT EXISTS idx_executed_steps_execution ON executed_steps(execution_id);
|
|
488
|
-
CREATE INDEX IF NOT EXISTS idx_executed_steps_action ON executed_steps(action_id);
|
|
489
|
-
`;
|
|
490
|
-
const MINCUT_SCHEMA = `
|
|
491
|
-
-- MinCut Graph Snapshots (ADR-047)
|
|
492
|
-
CREATE TABLE IF NOT EXISTS mincut_snapshots (
|
|
493
|
-
id TEXT PRIMARY KEY,
|
|
494
|
-
timestamp TEXT NOT NULL DEFAULT (datetime('now')),
|
|
495
|
-
vertex_count INTEGER NOT NULL,
|
|
496
|
-
edge_count INTEGER NOT NULL,
|
|
497
|
-
total_weight REAL NOT NULL DEFAULT 0.0,
|
|
498
|
-
is_connected INTEGER NOT NULL DEFAULT 1,
|
|
499
|
-
component_count INTEGER NOT NULL DEFAULT 1,
|
|
500
|
-
vertices_json TEXT NOT NULL,
|
|
501
|
-
edges_json TEXT NOT NULL,
|
|
502
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
503
|
-
);
|
|
504
|
-
|
|
505
|
-
-- MinCut History (time-series MinCut values)
|
|
506
|
-
CREATE TABLE IF NOT EXISTS mincut_history (
|
|
507
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
508
|
-
timestamp TEXT NOT NULL DEFAULT (datetime('now')),
|
|
509
|
-
mincut_value REAL NOT NULL,
|
|
510
|
-
vertex_count INTEGER NOT NULL,
|
|
511
|
-
edge_count INTEGER NOT NULL,
|
|
512
|
-
algorithm TEXT NOT NULL DEFAULT 'weighted-degree',
|
|
513
|
-
duration_ms INTEGER,
|
|
514
|
-
snapshot_id TEXT,
|
|
515
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
516
|
-
FOREIGN KEY (snapshot_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL
|
|
517
|
-
);
|
|
518
|
-
|
|
519
|
-
-- MinCut Weak Vertices (detected bottlenecks)
|
|
520
|
-
CREATE TABLE IF NOT EXISTS mincut_weak_vertices (
|
|
521
|
-
id TEXT PRIMARY KEY,
|
|
522
|
-
vertex_id TEXT NOT NULL,
|
|
523
|
-
weighted_degree REAL NOT NULL,
|
|
524
|
-
risk_score REAL NOT NULL,
|
|
525
|
-
reason TEXT NOT NULL,
|
|
526
|
-
domain TEXT,
|
|
527
|
-
vertex_type TEXT NOT NULL,
|
|
528
|
-
suggestions_json TEXT,
|
|
529
|
-
detected_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
530
|
-
resolved_at TEXT,
|
|
531
|
-
snapshot_id TEXT,
|
|
532
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
533
|
-
FOREIGN KEY (snapshot_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL
|
|
534
|
-
);
|
|
535
|
-
|
|
536
|
-
-- MinCut Alerts
|
|
537
|
-
CREATE TABLE IF NOT EXISTS mincut_alerts (
|
|
538
|
-
id TEXT PRIMARY KEY,
|
|
539
|
-
severity TEXT NOT NULL,
|
|
540
|
-
message TEXT NOT NULL,
|
|
541
|
-
mincut_value REAL NOT NULL,
|
|
542
|
-
threshold REAL NOT NULL,
|
|
543
|
-
affected_vertices_json TEXT,
|
|
544
|
-
remediations_json TEXT,
|
|
545
|
-
acknowledged INTEGER DEFAULT 0,
|
|
546
|
-
acknowledged_at TEXT,
|
|
547
|
-
acknowledged_by TEXT,
|
|
548
|
-
timestamp TEXT NOT NULL DEFAULT (datetime('now')),
|
|
549
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
550
|
-
);
|
|
551
|
-
|
|
552
|
-
-- MinCut Healing Actions (self-healing history)
|
|
553
|
-
CREATE TABLE IF NOT EXISTS mincut_healing_actions (
|
|
554
|
-
id TEXT PRIMARY KEY,
|
|
555
|
-
action_type TEXT NOT NULL,
|
|
556
|
-
action_params_json TEXT NOT NULL,
|
|
557
|
-
success INTEGER NOT NULL,
|
|
558
|
-
mincut_before REAL NOT NULL,
|
|
559
|
-
mincut_after REAL NOT NULL,
|
|
560
|
-
improvement REAL NOT NULL DEFAULT 0.0,
|
|
561
|
-
error_message TEXT,
|
|
562
|
-
duration_ms INTEGER NOT NULL,
|
|
563
|
-
triggered_by TEXT,
|
|
564
|
-
snapshot_before_id TEXT,
|
|
565
|
-
snapshot_after_id TEXT,
|
|
566
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
567
|
-
FOREIGN KEY (snapshot_before_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL,
|
|
568
|
-
FOREIGN KEY (snapshot_after_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL
|
|
569
|
-
);
|
|
570
|
-
|
|
571
|
-
-- MinCut Strange Loop Observations (P1: self-organizing)
|
|
572
|
-
CREATE TABLE IF NOT EXISTS mincut_observations (
|
|
573
|
-
id TEXT PRIMARY KEY,
|
|
574
|
-
iteration INTEGER NOT NULL,
|
|
575
|
-
mincut_value REAL NOT NULL,
|
|
576
|
-
weak_vertex_count INTEGER NOT NULL DEFAULT 0,
|
|
577
|
-
weak_vertices_json TEXT,
|
|
578
|
-
snapshot_id TEXT,
|
|
579
|
-
prediction_json TEXT,
|
|
580
|
-
actual_vs_predicted_diff REAL,
|
|
581
|
-
timestamp TEXT NOT NULL DEFAULT (datetime('now')),
|
|
582
|
-
FOREIGN KEY (snapshot_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL
|
|
583
|
-
);
|
|
584
|
-
|
|
585
|
-
-- MinCut Indexes
|
|
586
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_history_timestamp ON mincut_history(timestamp DESC);
|
|
587
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_history_value ON mincut_history(mincut_value);
|
|
588
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_weak_vertex ON mincut_weak_vertices(vertex_id);
|
|
589
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_weak_risk ON mincut_weak_vertices(risk_score DESC);
|
|
590
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_weak_resolved ON mincut_weak_vertices(resolved_at);
|
|
591
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_alerts_severity ON mincut_alerts(severity);
|
|
592
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_alerts_ack ON mincut_alerts(acknowledged);
|
|
593
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_healing_type ON mincut_healing_actions(action_type);
|
|
594
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_healing_success ON mincut_healing_actions(success);
|
|
595
|
-
CREATE INDEX IF NOT EXISTS idx_mincut_observations_iter ON mincut_observations(iteration);
|
|
596
|
-
`;
|
|
597
|
-
const SONA_PATTERNS_SCHEMA = `
|
|
598
|
-
-- SONA Patterns table (ADR-046: Pattern Persistence for Neural Backbone)
|
|
599
|
-
CREATE TABLE IF NOT EXISTS sona_patterns (
|
|
600
|
-
id TEXT PRIMARY KEY,
|
|
601
|
-
type TEXT NOT NULL,
|
|
602
|
-
domain TEXT NOT NULL,
|
|
603
|
-
state_embedding BLOB,
|
|
604
|
-
action_embedding BLOB,
|
|
605
|
-
action_type TEXT NOT NULL,
|
|
606
|
-
action_value TEXT,
|
|
607
|
-
outcome_reward REAL NOT NULL DEFAULT 0.0,
|
|
608
|
-
outcome_success INTEGER NOT NULL DEFAULT 0,
|
|
609
|
-
outcome_quality REAL NOT NULL DEFAULT 0.0,
|
|
610
|
-
confidence REAL DEFAULT 0.5,
|
|
611
|
-
usage_count INTEGER DEFAULT 0,
|
|
612
|
-
success_count INTEGER DEFAULT 0,
|
|
613
|
-
failure_count INTEGER DEFAULT 0,
|
|
614
|
-
metadata TEXT,
|
|
615
|
-
created_at TEXT DEFAULT (datetime('now')),
|
|
616
|
-
updated_at TEXT DEFAULT (datetime('now')),
|
|
617
|
-
last_used_at TEXT
|
|
618
|
-
);
|
|
619
|
-
CREATE INDEX IF NOT EXISTS idx_sona_patterns_type ON sona_patterns(type);
|
|
620
|
-
CREATE INDEX IF NOT EXISTS idx_sona_patterns_domain ON sona_patterns(domain);
|
|
621
|
-
CREATE INDEX IF NOT EXISTS idx_sona_patterns_confidence ON sona_patterns(confidence DESC);
|
|
622
|
-
CREATE INDEX IF NOT EXISTS idx_sona_patterns_updated ON sona_patterns(updated_at DESC);
|
|
623
|
-
`;
|
|
624
|
-
const FEEDBACK_SCHEMA = `
|
|
625
|
-
-- Test outcomes (ADR-023: Quality Feedback Loop)
|
|
626
|
-
CREATE TABLE IF NOT EXISTS test_outcomes (
|
|
627
|
-
id TEXT PRIMARY KEY,
|
|
628
|
-
test_id TEXT NOT NULL,
|
|
629
|
-
test_name TEXT NOT NULL,
|
|
630
|
-
generated_by TEXT NOT NULL,
|
|
631
|
-
pattern_id TEXT,
|
|
632
|
-
framework TEXT NOT NULL,
|
|
633
|
-
language TEXT NOT NULL,
|
|
634
|
-
domain TEXT NOT NULL,
|
|
635
|
-
passed INTEGER NOT NULL,
|
|
636
|
-
error_message TEXT,
|
|
637
|
-
coverage_lines REAL DEFAULT 0,
|
|
638
|
-
coverage_branches REAL DEFAULT 0,
|
|
639
|
-
coverage_functions REAL DEFAULT 0,
|
|
640
|
-
mutation_score REAL,
|
|
641
|
-
execution_time_ms REAL NOT NULL,
|
|
642
|
-
flaky INTEGER DEFAULT 0,
|
|
643
|
-
flakiness_score REAL,
|
|
644
|
-
maintainability_score REAL NOT NULL,
|
|
645
|
-
complexity REAL,
|
|
646
|
-
lines_of_code INTEGER,
|
|
647
|
-
assertion_count INTEGER,
|
|
648
|
-
file_path TEXT,
|
|
649
|
-
source_file_path TEXT,
|
|
650
|
-
metadata_json TEXT,
|
|
651
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
652
|
-
);
|
|
653
|
-
CREATE INDEX IF NOT EXISTS idx_test_outcomes_pattern ON test_outcomes(pattern_id);
|
|
654
|
-
CREATE INDEX IF NOT EXISTS idx_test_outcomes_agent ON test_outcomes(generated_by);
|
|
655
|
-
CREATE INDEX IF NOT EXISTS idx_test_outcomes_domain ON test_outcomes(domain);
|
|
656
|
-
CREATE INDEX IF NOT EXISTS idx_test_outcomes_created ON test_outcomes(created_at);
|
|
657
|
-
|
|
658
|
-
-- Routing outcomes (ADR-022: Adaptive QE Agent Routing)
|
|
659
|
-
CREATE TABLE IF NOT EXISTS routing_outcomes (
|
|
660
|
-
id TEXT PRIMARY KEY,
|
|
661
|
-
task_json TEXT NOT NULL,
|
|
662
|
-
decision_json TEXT NOT NULL,
|
|
663
|
-
used_agent TEXT NOT NULL,
|
|
664
|
-
followed_recommendation INTEGER NOT NULL,
|
|
665
|
-
success INTEGER NOT NULL,
|
|
666
|
-
quality_score REAL NOT NULL,
|
|
667
|
-
duration_ms REAL NOT NULL,
|
|
668
|
-
error TEXT,
|
|
669
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
670
|
-
);
|
|
671
|
-
CREATE INDEX IF NOT EXISTS idx_routing_outcomes_agent ON routing_outcomes(used_agent);
|
|
672
|
-
CREATE INDEX IF NOT EXISTS idx_routing_outcomes_created ON routing_outcomes(created_at);
|
|
673
|
-
|
|
674
|
-
-- Coverage sessions (ADR-023: Coverage Learning)
|
|
675
|
-
CREATE TABLE IF NOT EXISTS coverage_sessions (
|
|
676
|
-
id TEXT PRIMARY KEY,
|
|
677
|
-
target_path TEXT NOT NULL,
|
|
678
|
-
agent_id TEXT NOT NULL,
|
|
679
|
-
technique TEXT NOT NULL,
|
|
680
|
-
before_lines REAL DEFAULT 0,
|
|
681
|
-
before_branches REAL DEFAULT 0,
|
|
682
|
-
before_functions REAL DEFAULT 0,
|
|
683
|
-
after_lines REAL DEFAULT 0,
|
|
684
|
-
after_branches REAL DEFAULT 0,
|
|
685
|
-
after_functions REAL DEFAULT 0,
|
|
686
|
-
tests_generated INTEGER DEFAULT 0,
|
|
687
|
-
tests_passed INTEGER DEFAULT 0,
|
|
688
|
-
gaps_json TEXT,
|
|
689
|
-
duration_ms REAL NOT NULL,
|
|
690
|
-
started_at TEXT NOT NULL,
|
|
691
|
-
completed_at TEXT NOT NULL,
|
|
692
|
-
context_json TEXT,
|
|
693
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
694
|
-
);
|
|
695
|
-
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_technique ON coverage_sessions(technique);
|
|
696
|
-
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_agent ON coverage_sessions(agent_id);
|
|
697
|
-
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_created ON coverage_sessions(created_at);
|
|
698
|
-
`;
|
|
699
|
-
// ============================================================================
|
|
700
|
-
// In-Memory HNSW Index for Fast Vector Search
|
|
701
|
-
// ============================================================================
|
|
702
|
-
/**
|
|
703
|
-
* Binary min/max heap for O(log n) insertion and extraction.
|
|
704
|
-
* Replaces sorted arrays with O(n) splice in HNSW beam search.
|
|
705
|
-
*/
|
|
706
|
-
class BinaryHeap {
|
|
707
|
-
data = [];
|
|
708
|
-
compareFn;
|
|
709
|
-
constructor(compareFn) {
|
|
710
|
-
this.compareFn = compareFn;
|
|
711
|
-
}
|
|
712
|
-
push(item) {
|
|
713
|
-
this.data.push(item);
|
|
714
|
-
this.bubbleUp(this.data.length - 1);
|
|
715
|
-
}
|
|
716
|
-
pop() {
|
|
717
|
-
if (this.data.length === 0)
|
|
718
|
-
return undefined;
|
|
719
|
-
const top = this.data[0];
|
|
720
|
-
const last = this.data.pop();
|
|
721
|
-
if (this.data.length > 0) {
|
|
722
|
-
this.data[0] = last;
|
|
723
|
-
this.sinkDown(0);
|
|
724
|
-
}
|
|
725
|
-
return top;
|
|
726
|
-
}
|
|
727
|
-
peek() {
|
|
728
|
-
return this.data[0];
|
|
729
|
-
}
|
|
730
|
-
size() {
|
|
731
|
-
return this.data.length;
|
|
732
|
-
}
|
|
733
|
-
bubbleUp(i) {
|
|
734
|
-
while (i > 0) {
|
|
735
|
-
const parent = (i - 1) >> 1;
|
|
736
|
-
if (this.compareFn(this.data[i], this.data[parent]) < 0) {
|
|
737
|
-
[this.data[i], this.data[parent]] = [this.data[parent], this.data[i]];
|
|
738
|
-
i = parent;
|
|
739
|
-
}
|
|
740
|
-
else {
|
|
741
|
-
break;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
sinkDown(i) {
|
|
746
|
-
const n = this.data.length;
|
|
747
|
-
while (true) {
|
|
748
|
-
let smallest = i;
|
|
749
|
-
const left = 2 * i + 1;
|
|
750
|
-
const right = 2 * i + 2;
|
|
751
|
-
if (left < n && this.compareFn(this.data[left], this.data[smallest]) < 0) {
|
|
752
|
-
smallest = left;
|
|
753
|
-
}
|
|
754
|
-
if (right < n && this.compareFn(this.data[right], this.data[smallest]) < 0) {
|
|
755
|
-
smallest = right;
|
|
756
|
-
}
|
|
757
|
-
if (smallest !== i) {
|
|
758
|
-
[this.data[i], this.data[smallest]] = [this.data[smallest], this.data[i]];
|
|
759
|
-
i = smallest;
|
|
760
|
-
}
|
|
761
|
-
else {
|
|
762
|
-
break;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
/**
|
|
768
|
-
* In-memory HNSW (Hierarchical Navigable Small World) index built from
|
|
769
|
-
* SQLite vectors on startup. Provides O(log n) approximate nearest
|
|
770
|
-
* neighbor search via a multi-layer navigable small-world graph.
|
|
771
|
-
*
|
|
772
|
-
* Algorithm reference: Malkov & Yashunin, "Efficient and robust approximate
|
|
773
|
-
* nearest neighbor search using Hierarchical Navigable Small World graphs",
|
|
774
|
-
* IEEE TPAMI 2018.
|
|
775
|
-
*/
|
|
776
|
-
class InMemoryHNSWIndex {
|
|
777
|
-
nodes = new Map();
|
|
778
|
-
M = HNSW_CONSTANTS.M_CONNECTIONS;
|
|
779
|
-
Mmax0 = HNSW_CONSTANTS.M_CONNECTIONS * 2;
|
|
780
|
-
efConstruction = HNSW_CONSTANTS.EF_CONSTRUCTION;
|
|
781
|
-
efSearch = HNSW_CONSTANTS.EF_SEARCH;
|
|
782
|
-
mL = 1 / Math.log(HNSW_CONSTANTS.M_CONNECTIONS);
|
|
783
|
-
maxLevel = 16;
|
|
784
|
-
entryPoint = null;
|
|
785
|
-
currentMaxLevel = -1;
|
|
786
|
-
/**
|
|
787
|
-
* Assign a random layer for a new node using a geometric distribution.
|
|
788
|
-
* level = floor(-ln(uniform_random) * mL), capped at maxLevel.
|
|
789
|
-
*/
|
|
790
|
-
randomLevel() {
|
|
791
|
-
return Math.min(Math.floor(-Math.log(Math.random()) * this.mL), this.maxLevel);
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
* Compute cosine similarity between a query vector and a stored node.
|
|
795
|
-
*/
|
|
796
|
-
similarity(query, nodeId) {
|
|
797
|
-
const node = this.nodes.get(nodeId);
|
|
798
|
-
if (!node)
|
|
799
|
-
return -1;
|
|
800
|
-
return cosineSimilarity(query, node.embedding);
|
|
801
|
-
}
|
|
802
|
-
/**
|
|
803
|
-
* Greedy search at a single layer: starting from a single entry point,
|
|
804
|
-
* greedily move to the neighbor closest to the query until no improvement.
|
|
805
|
-
* Returns the closest node found.
|
|
806
|
-
*/
|
|
807
|
-
searchLayer(query, entryId, level) {
|
|
808
|
-
let current = entryId;
|
|
809
|
-
let currentDist = this.similarity(query, current);
|
|
810
|
-
let improved = true;
|
|
811
|
-
while (improved) {
|
|
812
|
-
improved = false;
|
|
813
|
-
const node = this.nodes.get(current);
|
|
814
|
-
if (!node)
|
|
815
|
-
break;
|
|
816
|
-
const neighbors = node.neighbors.get(level) ?? [];
|
|
817
|
-
for (const neighborId of neighbors) {
|
|
818
|
-
if (!this.nodes.has(neighborId))
|
|
819
|
-
continue;
|
|
820
|
-
const dist = this.similarity(query, neighborId);
|
|
821
|
-
if (dist > currentDist) {
|
|
822
|
-
current = neighborId;
|
|
823
|
-
currentDist = dist;
|
|
824
|
-
improved = true;
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
return current;
|
|
829
|
-
}
|
|
830
|
-
/**
|
|
831
|
-
* Beam search at a single layer: starting from an entry point, explore
|
|
832
|
-
* up to `ef` candidates and return the `ef` closest found.
|
|
833
|
-
* Uses a max-heap for candidates and a min-heap for results to achieve
|
|
834
|
-
* O(log n) insertion instead of O(n) Array.splice.
|
|
835
|
-
* Returns results sorted by descending similarity.
|
|
836
|
-
*/
|
|
837
|
-
searchLayerBeam(query, entryIds, level, ef) {
|
|
838
|
-
const visited = new Set(entryIds);
|
|
839
|
-
const initial = entryIds
|
|
840
|
-
.filter(id => this.nodes.has(id))
|
|
841
|
-
.map(id => ({ id, score: this.similarity(query, id) }));
|
|
842
|
-
// Max-heap for candidates (best score = highest priority)
|
|
843
|
-
const candidateHeap = new BinaryHeap((a, b) => b.score - a.score // max-heap: highest score first
|
|
844
|
-
);
|
|
845
|
-
// Min-heap for results (worst score at top for fast eviction)
|
|
846
|
-
const resultHeap = new BinaryHeap((a, b) => a.score - b.score // min-heap: lowest score first
|
|
847
|
-
);
|
|
848
|
-
for (const entry of initial) {
|
|
849
|
-
candidateHeap.push(entry);
|
|
850
|
-
resultHeap.push(entry);
|
|
851
|
-
}
|
|
852
|
-
while (candidateHeap.size() > 0) {
|
|
853
|
-
const closest = candidateHeap.pop();
|
|
854
|
-
// If the closest candidate is worse than the worst in results
|
|
855
|
-
// and we already have ef results, stop
|
|
856
|
-
if (resultHeap.size() >= ef && closest.score < resultHeap.peek().score) {
|
|
857
|
-
break;
|
|
858
|
-
}
|
|
859
|
-
const node = this.nodes.get(closest.id);
|
|
860
|
-
if (!node)
|
|
861
|
-
continue;
|
|
862
|
-
const neighbors = node.neighbors.get(level) ?? [];
|
|
863
|
-
for (const neighborId of neighbors) {
|
|
864
|
-
if (visited.has(neighborId))
|
|
865
|
-
continue;
|
|
866
|
-
visited.add(neighborId);
|
|
867
|
-
if (!this.nodes.has(neighborId))
|
|
868
|
-
continue;
|
|
869
|
-
const score = this.similarity(query, neighborId);
|
|
870
|
-
const worstResult = resultHeap.size() >= ef ? resultHeap.peek().score : -Infinity;
|
|
871
|
-
if (resultHeap.size() < ef || score > worstResult) {
|
|
872
|
-
const entry = { id: neighborId, score };
|
|
873
|
-
candidateHeap.push(entry);
|
|
874
|
-
resultHeap.push(entry);
|
|
875
|
-
// Evict worst result if over capacity
|
|
876
|
-
if (resultHeap.size() > ef) {
|
|
877
|
-
resultHeap.pop();
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
// Drain result heap into array sorted descending by score
|
|
883
|
-
const results = [];
|
|
884
|
-
while (resultHeap.size() > 0) {
|
|
885
|
-
results.push(resultHeap.pop());
|
|
886
|
-
}
|
|
887
|
-
results.reverse(); // min-heap drains ascending, reverse for descending
|
|
888
|
-
return results;
|
|
889
|
-
}
|
|
890
|
-
/**
|
|
891
|
-
* Select the M best neighbors from candidates for a node, using the
|
|
892
|
-
* simple heuristic (closest M by similarity).
|
|
893
|
-
*/
|
|
894
|
-
selectNeighbors(query, candidates, maxConnections) {
|
|
895
|
-
return candidates
|
|
896
|
-
.sort((a, b) => b.score - a.score)
|
|
897
|
-
.slice(0, maxConnections)
|
|
898
|
-
.map(c => c.id);
|
|
899
|
-
}
|
|
900
|
-
/**
|
|
901
|
-
* Get max connections allowed at a given level.
|
|
902
|
-
* Level 0 allows Mmax0 (= 2*M), higher levels allow M.
|
|
903
|
-
*/
|
|
904
|
-
getMaxConnections(level) {
|
|
905
|
-
return level === 0 ? this.Mmax0 : this.M;
|
|
906
|
-
}
|
|
907
|
-
/**
|
|
908
|
-
* Add a vector to the HNSW index with proper graph construction.
|
|
909
|
-
* O(log n) amortized via hierarchical layer structure.
|
|
910
|
-
*/
|
|
911
|
-
add(id, embedding) {
|
|
912
|
-
// Handle duplicate: remove old node first
|
|
913
|
-
if (this.nodes.has(id)) {
|
|
914
|
-
this.remove(id);
|
|
915
|
-
}
|
|
916
|
-
const nodeLevel = this.randomLevel();
|
|
917
|
-
const newNode = {
|
|
918
|
-
id,
|
|
919
|
-
embedding,
|
|
920
|
-
neighbors: new Map(),
|
|
921
|
-
};
|
|
922
|
-
// Initialize neighbor lists for each layer
|
|
923
|
-
for (let l = 0; l <= nodeLevel; l++) {
|
|
924
|
-
newNode.neighbors.set(l, []);
|
|
925
|
-
}
|
|
926
|
-
this.nodes.set(id, newNode);
|
|
927
|
-
// First node: set as entry point
|
|
928
|
-
if (this.entryPoint === null) {
|
|
929
|
-
this.entryPoint = id;
|
|
930
|
-
this.currentMaxLevel = nodeLevel;
|
|
931
|
-
return;
|
|
932
|
-
}
|
|
933
|
-
let currentEntry = this.entryPoint;
|
|
934
|
-
// Phase 1: Traverse layers above the new node's level (greedy descent)
|
|
935
|
-
for (let l = this.currentMaxLevel; l > nodeLevel; l--) {
|
|
936
|
-
currentEntry = this.searchLayer(embedding, currentEntry, l);
|
|
937
|
-
}
|
|
938
|
-
// Phase 2: For each layer from nodeLevel down to 0, find neighbors and link
|
|
939
|
-
for (let l = Math.min(nodeLevel, this.currentMaxLevel); l >= 0; l--) {
|
|
940
|
-
const maxConn = this.getMaxConnections(l);
|
|
941
|
-
// Beam search to find efConstruction nearest neighbors at this layer
|
|
942
|
-
const nearest = this.searchLayerBeam(embedding, [currentEntry], l, this.efConstruction);
|
|
943
|
-
// Select M best neighbors
|
|
944
|
-
const selectedIds = this.selectNeighbors(embedding, nearest, maxConn);
|
|
945
|
-
// Set the new node's neighbors at this layer
|
|
946
|
-
newNode.neighbors.set(l, [...selectedIds]);
|
|
947
|
-
// Add bidirectional connections and prune if over capacity
|
|
948
|
-
for (const neighborId of selectedIds) {
|
|
949
|
-
const neighbor = this.nodes.get(neighborId);
|
|
950
|
-
if (!neighbor)
|
|
951
|
-
continue;
|
|
952
|
-
const neighborList = neighbor.neighbors.get(l) ?? [];
|
|
953
|
-
neighborList.push(id);
|
|
954
|
-
// Prune if neighbor has too many connections
|
|
955
|
-
if (neighborList.length > maxConn) {
|
|
956
|
-
// Keep the maxConn closest neighbors
|
|
957
|
-
const scored = neighborList
|
|
958
|
-
.filter(nId => this.nodes.has(nId))
|
|
959
|
-
.map(nId => ({
|
|
960
|
-
id: nId,
|
|
961
|
-
score: cosineSimilarity(neighbor.embedding, this.nodes.get(nId).embedding),
|
|
962
|
-
}));
|
|
963
|
-
scored.sort((a, b) => b.score - a.score);
|
|
964
|
-
neighbor.neighbors.set(l, scored.slice(0, maxConn).map(s => s.id));
|
|
965
|
-
}
|
|
966
|
-
else {
|
|
967
|
-
neighbor.neighbors.set(l, neighborList);
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
// Update entry for next layer down
|
|
971
|
-
if (nearest.length > 0) {
|
|
972
|
-
currentEntry = nearest[0].id;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
// Update entry point if new node's level exceeds current max
|
|
976
|
-
if (nodeLevel > this.currentMaxLevel) {
|
|
977
|
-
this.entryPoint = id;
|
|
978
|
-
this.currentMaxLevel = nodeLevel;
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
/**
|
|
982
|
-
* Remove a node from the HNSW index and repair connections.
|
|
983
|
-
* Orphaned neighbors are reconnected to the removed node's other neighbors.
|
|
984
|
-
*/
|
|
985
|
-
remove(id) {
|
|
986
|
-
const node = this.nodes.get(id);
|
|
987
|
-
if (!node)
|
|
988
|
-
return false;
|
|
989
|
-
// For each layer the node exists in, remove from neighbor lists and repair
|
|
990
|
-
for (const [level, neighbors] of node.neighbors.entries()) {
|
|
991
|
-
for (const neighborId of neighbors) {
|
|
992
|
-
const neighbor = this.nodes.get(neighborId);
|
|
993
|
-
if (!neighbor)
|
|
994
|
-
continue;
|
|
995
|
-
const neighborList = neighbor.neighbors.get(level);
|
|
996
|
-
if (!neighborList)
|
|
997
|
-
continue;
|
|
998
|
-
// Remove the deleted node from this neighbor's list
|
|
999
|
-
const idx = neighborList.indexOf(id);
|
|
1000
|
-
if (idx !== -1) {
|
|
1001
|
-
neighborList.splice(idx, 1);
|
|
1002
|
-
}
|
|
1003
|
-
// Try to reconnect: for each of the deleted node's other neighbors,
|
|
1004
|
-
// add a connection if capacity allows and not already connected
|
|
1005
|
-
const maxConn = this.getMaxConnections(level);
|
|
1006
|
-
if (neighborList.length < maxConn) {
|
|
1007
|
-
for (const otherNeighborId of neighbors) {
|
|
1008
|
-
if (otherNeighborId !== neighborId &&
|
|
1009
|
-
otherNeighborId !== id &&
|
|
1010
|
-
this.nodes.has(otherNeighborId) &&
|
|
1011
|
-
!neighborList.includes(otherNeighborId)) {
|
|
1012
|
-
neighborList.push(otherNeighborId);
|
|
1013
|
-
// Add reverse connection too
|
|
1014
|
-
const otherNeighbor = this.nodes.get(otherNeighborId);
|
|
1015
|
-
if (otherNeighbor) {
|
|
1016
|
-
const otherList = otherNeighbor.neighbors.get(level) ?? [];
|
|
1017
|
-
if (!otherList.includes(neighborId) && otherList.length < maxConn) {
|
|
1018
|
-
otherList.push(neighborId);
|
|
1019
|
-
otherNeighbor.neighbors.set(level, otherList);
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
if (neighborList.length >= maxConn)
|
|
1023
|
-
break;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
neighbor.neighbors.set(level, neighborList);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
// Delete the node
|
|
1031
|
-
this.nodes.delete(id);
|
|
1032
|
-
// If the entry point was removed, pick a replacement
|
|
1033
|
-
if (this.entryPoint === id) {
|
|
1034
|
-
if (this.nodes.size === 0) {
|
|
1035
|
-
this.entryPoint = null;
|
|
1036
|
-
this.currentMaxLevel = -1;
|
|
1037
|
-
}
|
|
1038
|
-
else {
|
|
1039
|
-
// Find the node with the highest level to be the new entry point
|
|
1040
|
-
let bestId = null;
|
|
1041
|
-
let bestLevel = -1;
|
|
1042
|
-
for (const [nodeId, n] of this.nodes.entries()) {
|
|
1043
|
-
let maxNodeLevel = -1;
|
|
1044
|
-
for (const l of n.neighbors.keys()) {
|
|
1045
|
-
if (l > maxNodeLevel)
|
|
1046
|
-
maxNodeLevel = l;
|
|
1047
|
-
}
|
|
1048
|
-
if (maxNodeLevel > bestLevel) {
|
|
1049
|
-
bestLevel = maxNodeLevel;
|
|
1050
|
-
bestId = nodeId;
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
this.entryPoint = bestId;
|
|
1054
|
-
this.currentMaxLevel = bestLevel;
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
return true;
|
|
1058
|
-
}
|
|
1059
|
-
/**
|
|
1060
|
-
* Search for k approximate nearest neighbors using HNSW traversal.
|
|
1061
|
-
* O(log n) via hierarchical layer descent + beam search at base layer.
|
|
1062
|
-
*/
|
|
1063
|
-
search(query, k) {
|
|
1064
|
-
if (this.nodes.size === 0 || this.entryPoint === null) {
|
|
1065
|
-
return [];
|
|
1066
|
-
}
|
|
1067
|
-
// Single node shortcut
|
|
1068
|
-
if (this.nodes.size === 1) {
|
|
1069
|
-
const node = this.nodes.get(this.entryPoint);
|
|
1070
|
-
return [{ id: node.id, score: cosineSimilarity(query, node.embedding) }];
|
|
1071
|
-
}
|
|
1072
|
-
let currentEntry = this.entryPoint;
|
|
1073
|
-
// Phase 1: Greedily traverse layers above base to find local minimum
|
|
1074
|
-
for (let l = this.currentMaxLevel; l > 0; l--) {
|
|
1075
|
-
currentEntry = this.searchLayer(query, currentEntry, l);
|
|
1076
|
-
}
|
|
1077
|
-
// Phase 2: Beam search at layer 0 with efSearch candidates
|
|
1078
|
-
const ef = Math.max(this.efSearch, k);
|
|
1079
|
-
const results = this.searchLayerBeam(query, [currentEntry], 0, ef);
|
|
1080
|
-
// Return top-k results sorted by descending similarity
|
|
1081
|
-
return results.slice(0, k);
|
|
1082
|
-
}
|
|
1083
|
-
/**
|
|
1084
|
-
* Get index size
|
|
1085
|
-
*/
|
|
1086
|
-
size() {
|
|
1087
|
-
return this.nodes.size;
|
|
1088
|
-
}
|
|
1089
|
-
/**
|
|
1090
|
-
* Clear the index and reset entry point
|
|
1091
|
-
*/
|
|
1092
|
-
clear() {
|
|
1093
|
-
this.nodes.clear();
|
|
1094
|
-
this.entryPoint = null;
|
|
1095
|
-
this.currentMaxLevel = -1;
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
// ============================================================================
|
|
1099
150
|
// Unified Memory Manager
|
|
1100
151
|
// ============================================================================
|
|
1101
152
|
/**
|
|
@@ -1123,33 +174,24 @@ export class UnifiedMemoryManager {
|
|
|
1123
174
|
// CRDT store for distributed state synchronization
|
|
1124
175
|
crdtStore = null;
|
|
1125
176
|
constructor(config) {
|
|
1126
|
-
// Use resolved config with project root detection for the dbPath
|
|
1127
177
|
const resolvedDefaults = getResolvedDefaultConfig();
|
|
1128
178
|
this.config = { ...resolvedDefaults, ...config };
|
|
179
|
+
if (!path.isAbsolute(this.config.dbPath)) {
|
|
180
|
+
const projectRoot = findProjectRoot();
|
|
181
|
+
this.config.dbPath = path.join(projectRoot, this.config.dbPath);
|
|
182
|
+
}
|
|
1129
183
|
}
|
|
1130
|
-
/**
|
|
1131
|
-
* Get or create the singleton instance (synchronous).
|
|
1132
|
-
* Thread-safe: JS is single-threaded for synchronous code.
|
|
1133
|
-
*/
|
|
1134
184
|
static getInstance(config) {
|
|
1135
|
-
// Synchronous return if already created
|
|
1136
185
|
if (UnifiedMemoryManager.instance) {
|
|
1137
186
|
return UnifiedMemoryManager.instance;
|
|
1138
187
|
}
|
|
1139
|
-
// Synchronous creation - JS single-threaded execution prevents race here
|
|
1140
188
|
UnifiedMemoryManager.instance = new UnifiedMemoryManager(config);
|
|
1141
189
|
return UnifiedMemoryManager.instance;
|
|
1142
190
|
}
|
|
1143
|
-
/**
|
|
1144
|
-
* Get or create the singleton instance with async initialization.
|
|
1145
|
-
* Thread-safe: Uses Promise lock to prevent concurrent initialization races.
|
|
1146
|
-
*/
|
|
1147
191
|
static async getInstanceAsync(config) {
|
|
1148
|
-
// Fast path: already fully initialized
|
|
1149
192
|
if (UnifiedMemoryManager.instance?.initialized) {
|
|
1150
193
|
return UnifiedMemoryManager.instance;
|
|
1151
194
|
}
|
|
1152
|
-
// Use Promise lock to prevent concurrent initialization
|
|
1153
195
|
if (!UnifiedMemoryManager.instancePromise) {
|
|
1154
196
|
UnifiedMemoryManager.instancePromise = (async () => {
|
|
1155
197
|
const instance = UnifiedMemoryManager.getInstance(config);
|
|
@@ -1159,9 +201,6 @@ export class UnifiedMemoryManager {
|
|
|
1159
201
|
}
|
|
1160
202
|
return UnifiedMemoryManager.instancePromise;
|
|
1161
203
|
}
|
|
1162
|
-
/**
|
|
1163
|
-
* Reset the singleton (for testing)
|
|
1164
|
-
*/
|
|
1165
204
|
static resetInstance() {
|
|
1166
205
|
if (UnifiedMemoryManager.instance) {
|
|
1167
206
|
UnifiedMemoryManager.instance.close();
|
|
@@ -1169,36 +208,23 @@ export class UnifiedMemoryManager {
|
|
|
1169
208
|
}
|
|
1170
209
|
UnifiedMemoryManager.instancePromise = null;
|
|
1171
210
|
}
|
|
1172
|
-
/**
|
|
1173
|
-
* Initialize the database, run migrations, and load vector index.
|
|
1174
|
-
* Thread-safe: Uses Promise lock to prevent concurrent initialization races.
|
|
1175
|
-
*/
|
|
1176
211
|
async initialize() {
|
|
1177
|
-
// Fast path: already initialized
|
|
1178
212
|
if (this.initialized)
|
|
1179
213
|
return;
|
|
1180
|
-
// Use Promise lock to prevent concurrent initialization
|
|
1181
214
|
if (!this.initPromise) {
|
|
1182
215
|
this.initPromise = this._doInitialize();
|
|
1183
216
|
}
|
|
1184
217
|
return this.initPromise;
|
|
1185
218
|
}
|
|
1186
|
-
/**
|
|
1187
|
-
* Internal initialization implementation
|
|
1188
|
-
*/
|
|
1189
219
|
async _doInitialize() {
|
|
1190
|
-
// Double-check after acquiring promise lock
|
|
1191
220
|
if (this.initialized)
|
|
1192
221
|
return;
|
|
1193
222
|
try {
|
|
1194
|
-
// Ensure directory exists
|
|
1195
223
|
const dir = path.dirname(this.config.dbPath);
|
|
1196
224
|
if (!fs.existsSync(dir)) {
|
|
1197
225
|
fs.mkdirSync(dir, { recursive: true });
|
|
1198
226
|
}
|
|
1199
|
-
// Open database
|
|
1200
227
|
this.db = new Database(this.config.dbPath);
|
|
1201
|
-
// Configure for performance
|
|
1202
228
|
if (this.config.walMode) {
|
|
1203
229
|
this.db.pragma('journal_mode = WAL');
|
|
1204
230
|
}
|
|
@@ -1206,25 +232,17 @@ export class UnifiedMemoryManager {
|
|
|
1206
232
|
this.db.pragma(`cache_size = ${this.config.cacheSize}`);
|
|
1207
233
|
this.db.pragma(`busy_timeout = ${this.config.busyTimeout}`);
|
|
1208
234
|
this.db.pragma('foreign_keys = ON');
|
|
1209
|
-
// Run migrations
|
|
1210
235
|
await this.runMigrations();
|
|
1211
|
-
// Defer vector index loading until first search (startup optimization)
|
|
1212
236
|
this.vectorsLoaded = false;
|
|
1213
237
|
this.initialized = true;
|
|
1214
238
|
console.log(`[UnifiedMemory] Initialized: ${this.config.dbPath}`);
|
|
1215
|
-
// Guard: warn if duplicate .agentic-qe/memory.db files exist in project tree
|
|
1216
239
|
this.warnIfDuplicateDatabases();
|
|
1217
240
|
}
|
|
1218
241
|
catch (error) {
|
|
1219
|
-
// Allow retry on failure by clearing the promise
|
|
1220
242
|
this.initPromise = null;
|
|
1221
|
-
throw new Error(`Failed to initialize UnifiedMemoryManager: ${
|
|
243
|
+
throw new Error(`Failed to initialize UnifiedMemoryManager: ${toErrorMessage(error)}`);
|
|
1222
244
|
}
|
|
1223
245
|
}
|
|
1224
|
-
/**
|
|
1225
|
-
* Warn if multiple .agentic-qe/memory.db files exist in the project tree.
|
|
1226
|
-
* This prevents silent data splits where different modules write to different DBs.
|
|
1227
|
-
*/
|
|
1228
246
|
warnIfDuplicateDatabases() {
|
|
1229
247
|
try {
|
|
1230
248
|
const projectRoot = findProjectRoot();
|
|
@@ -1243,13 +261,11 @@ export class UnifiedMemoryManager {
|
|
|
1243
261
|
` This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`);
|
|
1244
262
|
}
|
|
1245
263
|
}
|
|
1246
|
-
catch {
|
|
1247
|
-
// Non-critical
|
|
264
|
+
catch (e) {
|
|
265
|
+
// Non-critical
|
|
266
|
+
logger.debug('Duplicate database check failed', { error: e instanceof Error ? e.message : String(e) });
|
|
1248
267
|
}
|
|
1249
268
|
}
|
|
1250
|
-
/**
|
|
1251
|
-
* Check if a column exists in a table
|
|
1252
|
-
*/
|
|
1253
269
|
columnExists(tableName, columnName) {
|
|
1254
270
|
if (!this.db)
|
|
1255
271
|
return false;
|
|
@@ -1258,95 +274,59 @@ export class UnifiedMemoryManager {
|
|
|
1258
274
|
const info = this.db.prepare(`PRAGMA table_info(${safeName})`).all();
|
|
1259
275
|
return info.some(col => col.name === columnName);
|
|
1260
276
|
}
|
|
1261
|
-
catch {
|
|
277
|
+
catch (e) {
|
|
278
|
+
logger.debug('Column existence check failed', { table: tableName, column: columnName, error: e instanceof Error ? e.message : String(e) });
|
|
1262
279
|
return false;
|
|
1263
280
|
}
|
|
1264
281
|
}
|
|
1265
|
-
/**
|
|
1266
|
-
* Handle v2 schema incompatibilities by dropping and recreating tables
|
|
1267
|
-
* that have incompatible schemas (missing columns that v3 requires)
|
|
1268
|
-
*/
|
|
1269
282
|
handleV2SchemaIncompatibilities() {
|
|
1270
283
|
if (!this.db)
|
|
1271
284
|
return;
|
|
1272
|
-
// Tables that may exist from v2 with incompatible schemas
|
|
1273
|
-
// Only list tables where v2 has DIFFERENT schema than v3
|
|
1274
|
-
// The 'requiredColumn' must be a column that EXISTS in v3 but NOT in v2
|
|
1275
285
|
const v2IncompatibleTables = [
|
|
1276
|
-
|
|
1277
|
-
{ table: '
|
|
1278
|
-
{ table: '
|
|
1279
|
-
{ table: '
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
{ table: 'concept_nodes', requiredColumn: 'concept_type' }, // v2 has 'type'
|
|
1283
|
-
{ table: 'concept_edges', requiredColumn: 'edge_type' }, // v2 has 'type'
|
|
1284
|
-
{ table: 'dream_insights', requiredColumn: 'cycle_id' }, // v2 missing foreign key
|
|
1285
|
-
// RL tables - v2 has simpler schema
|
|
1286
|
-
{ table: 'rl_q_values', requiredColumn: 'algorithm' }, // v2 missing algorithm field
|
|
286
|
+
{ table: 'goap_plans', requiredColumn: 'status' },
|
|
287
|
+
{ table: 'goap_actions', requiredColumn: 'agent_type' },
|
|
288
|
+
{ table: 'concept_nodes', requiredColumn: 'concept_type' },
|
|
289
|
+
{ table: 'concept_edges', requiredColumn: 'edge_type' },
|
|
290
|
+
{ table: 'dream_insights', requiredColumn: 'cycle_id' },
|
|
291
|
+
{ table: 'rl_q_values', requiredColumn: 'algorithm' },
|
|
1287
292
|
];
|
|
1288
293
|
for (const { table, requiredColumn } of v2IncompatibleTables) {
|
|
1289
|
-
// Check if table exists
|
|
1290
294
|
const tableExists = this.db.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name=?`).get(table);
|
|
1291
295
|
if (tableExists && !this.columnExists(table, requiredColumn)) {
|
|
1292
296
|
console.log(`[UnifiedMemory] Upgrading v2 table: ${table} (missing ${requiredColumn})`);
|
|
1293
|
-
// Drop the old table - will be recreated with v3 schema
|
|
1294
297
|
this.db.exec(`DROP TABLE IF EXISTS ${validateTableName(table)}`);
|
|
1295
298
|
}
|
|
1296
299
|
}
|
|
1297
300
|
}
|
|
1298
|
-
/**
|
|
1299
|
-
* Run schema migrations
|
|
1300
|
-
*/
|
|
1301
301
|
async runMigrations() {
|
|
1302
302
|
if (!this.db)
|
|
1303
303
|
throw new Error('Database not initialized');
|
|
1304
|
-
// Create schema version table
|
|
1305
304
|
this.db.exec(SCHEMA_VERSION_TABLE);
|
|
1306
|
-
// Handle v2 schema incompatibilities BEFORE migration
|
|
1307
305
|
this.handleV2SchemaIncompatibilities();
|
|
1308
|
-
// Get current version
|
|
1309
306
|
const versionRow = this.db.prepare('SELECT version FROM schema_version WHERE id = 1').get();
|
|
1310
307
|
const currentVersion = versionRow?.version ?? 0;
|
|
1311
308
|
if (currentVersion < SCHEMA_VERSION) {
|
|
1312
309
|
console.log(`[UnifiedMemory] Migrating from v${currentVersion} to v${SCHEMA_VERSION}`);
|
|
1313
|
-
// Create all schemas using transaction
|
|
1314
310
|
const migrate = this.db.transaction(() => {
|
|
1315
|
-
|
|
1316
|
-
if (currentVersion < 1) {
|
|
311
|
+
if (currentVersion < 1)
|
|
1317
312
|
this.db.exec(KV_STORE_SCHEMA);
|
|
1318
|
-
|
|
1319
|
-
// v2: Vectors table
|
|
1320
|
-
if (currentVersion < 2) {
|
|
313
|
+
if (currentVersion < 2)
|
|
1321
314
|
this.db.exec(VECTORS_SCHEMA);
|
|
1322
|
-
}
|
|
1323
|
-
// v3: Learning features (Q-Values, GOAP, Dreams)
|
|
1324
315
|
if (currentVersion < 3) {
|
|
1325
316
|
this.db.exec(RL_QVALUES_SCHEMA);
|
|
1326
317
|
this.db.exec(GOAP_SCHEMA);
|
|
1327
318
|
this.db.exec(DREAM_SCHEMA);
|
|
1328
319
|
}
|
|
1329
|
-
|
|
1330
|
-
if (currentVersion < 4) {
|
|
320
|
+
if (currentVersion < 4)
|
|
1331
321
|
this.db.exec(QE_PATTERNS_SCHEMA);
|
|
1332
|
-
|
|
1333
|
-
// v5: MinCut tables (ADR-047)
|
|
1334
|
-
if (currentVersion < 5) {
|
|
322
|
+
if (currentVersion < 5)
|
|
1335
323
|
this.db.exec(MINCUT_SCHEMA);
|
|
1336
|
-
|
|
1337
|
-
// v6: Hypergraph tables (Neural Backbone)
|
|
1338
|
-
if (currentVersion < 6) {
|
|
324
|
+
if (currentVersion < 6)
|
|
1339
325
|
this.db.exec(HYPERGRAPH_SCHEMA);
|
|
1340
|
-
|
|
1341
|
-
// v7: SONA Patterns table (Neural Backbone)
|
|
1342
|
-
if (currentVersion < 7) {
|
|
326
|
+
if (currentVersion < 7)
|
|
1343
327
|
this.db.exec(SONA_PATTERNS_SCHEMA);
|
|
1344
|
-
|
|
1345
|
-
// v8: Feedback loop persistence tables (ADR-023, ADR-022)
|
|
1346
|
-
if (currentVersion < 8) {
|
|
328
|
+
if (currentVersion < 8)
|
|
1347
329
|
this.db.exec(FEEDBACK_SCHEMA);
|
|
1348
|
-
}
|
|
1349
|
-
// Update schema version
|
|
1350
330
|
this.db.prepare(`
|
|
1351
331
|
INSERT OR REPLACE INTO schema_version (id, version, migrated_at)
|
|
1352
332
|
VALUES (1, ?, datetime('now'))
|
|
@@ -1356,9 +336,6 @@ export class UnifiedMemoryManager {
|
|
|
1356
336
|
console.log(`[UnifiedMemory] Migration complete`);
|
|
1357
337
|
}
|
|
1358
338
|
}
|
|
1359
|
-
/**
|
|
1360
|
-
* Load all vectors from SQLite into HNSW index
|
|
1361
|
-
*/
|
|
1362
339
|
async loadVectorIndex() {
|
|
1363
340
|
if (this.vectorsLoaded)
|
|
1364
341
|
return;
|
|
@@ -1376,9 +353,6 @@ export class UnifiedMemoryManager {
|
|
|
1376
353
|
// ============================================================================
|
|
1377
354
|
// KV Store Operations (v2 compatible)
|
|
1378
355
|
// ============================================================================
|
|
1379
|
-
/**
|
|
1380
|
-
* Store a key-value pair
|
|
1381
|
-
*/
|
|
1382
356
|
async kvSet(key, value, namespace = 'default', ttl) {
|
|
1383
357
|
this.ensureInitialized();
|
|
1384
358
|
const expiresAt = ttl ? Date.now() + ttl * 1000 : null;
|
|
@@ -1388,9 +362,6 @@ export class UnifiedMemoryManager {
|
|
|
1388
362
|
VALUES (?, ?, ?, ?)
|
|
1389
363
|
`).run(key, namespace, serialized, expiresAt);
|
|
1390
364
|
}
|
|
1391
|
-
/**
|
|
1392
|
-
* Get a value by key
|
|
1393
|
-
*/
|
|
1394
365
|
async kvGet(key, namespace = 'default') {
|
|
1395
366
|
this.ensureInitialized();
|
|
1396
367
|
const row = this.db.prepare(`
|
|
@@ -1399,24 +370,17 @@ export class UnifiedMemoryManager {
|
|
|
1399
370
|
`).get(key, namespace);
|
|
1400
371
|
if (!row)
|
|
1401
372
|
return undefined;
|
|
1402
|
-
// Check expiration
|
|
1403
373
|
if (row.expires_at && Date.now() > row.expires_at) {
|
|
1404
374
|
this.db.prepare('DELETE FROM kv_store WHERE key = ? AND namespace = ?').run(key, namespace);
|
|
1405
375
|
return undefined;
|
|
1406
376
|
}
|
|
1407
|
-
return
|
|
377
|
+
return safeJsonParse(row.value);
|
|
1408
378
|
}
|
|
1409
|
-
/**
|
|
1410
|
-
* Delete a key
|
|
1411
|
-
*/
|
|
1412
379
|
async kvDelete(key, namespace = 'default') {
|
|
1413
380
|
this.ensureInitialized();
|
|
1414
381
|
const result = this.db.prepare('DELETE FROM kv_store WHERE key = ? AND namespace = ?').run(key, namespace);
|
|
1415
382
|
return result.changes > 0;
|
|
1416
383
|
}
|
|
1417
|
-
/**
|
|
1418
|
-
* Check if key exists
|
|
1419
|
-
*/
|
|
1420
384
|
async kvExists(key, namespace = 'default') {
|
|
1421
385
|
this.ensureInitialized();
|
|
1422
386
|
const row = this.db.prepare(`
|
|
@@ -1425,9 +389,6 @@ export class UnifiedMemoryManager {
|
|
|
1425
389
|
`).get(key, namespace, Date.now());
|
|
1426
390
|
return row !== undefined;
|
|
1427
391
|
}
|
|
1428
|
-
/**
|
|
1429
|
-
* Search keys by pattern
|
|
1430
|
-
*/
|
|
1431
392
|
async kvSearch(pattern, namespace = 'default', limit = 100) {
|
|
1432
393
|
this.ensureInitialized();
|
|
1433
394
|
const sqlPattern = pattern.replace(/\*/g, '%').replace(/\?/g, '_');
|
|
@@ -1439,20 +400,14 @@ export class UnifiedMemoryManager {
|
|
|
1439
400
|
`).all(namespace, sqlPattern, Date.now(), limit);
|
|
1440
401
|
return rows.map(r => r.key);
|
|
1441
402
|
}
|
|
1442
|
-
/**
|
|
1443
|
-
* Cleanup expired entries
|
|
1444
|
-
*/
|
|
1445
403
|
async kvCleanupExpired() {
|
|
1446
404
|
this.ensureInitialized();
|
|
1447
405
|
const result = this.db.prepare('DELETE FROM kv_store WHERE expires_at IS NOT NULL AND expires_at < ?').run(Date.now());
|
|
1448
406
|
return result.changes;
|
|
1449
407
|
}
|
|
1450
408
|
// ============================================================================
|
|
1451
|
-
// Vector Operations
|
|
409
|
+
// Vector Operations
|
|
1452
410
|
// ============================================================================
|
|
1453
|
-
/**
|
|
1454
|
-
* Store a vector embedding
|
|
1455
|
-
*/
|
|
1456
411
|
async vectorStore(id, embedding, namespace = 'default', metadata) {
|
|
1457
412
|
this.ensureInitialized();
|
|
1458
413
|
const buffer = this.floatArrayToBuffer(embedding);
|
|
@@ -1461,12 +416,8 @@ export class UnifiedMemoryManager {
|
|
|
1461
416
|
INSERT OR REPLACE INTO vectors (id, namespace, embedding, dimensions, metadata, updated_at)
|
|
1462
417
|
VALUES (?, ?, ?, ?, ?, datetime('now'))
|
|
1463
418
|
`).run(id, namespace, buffer, embedding.length, metadataJson);
|
|
1464
|
-
// Update in-memory index
|
|
1465
419
|
this.vectorIndex.add(id, embedding);
|
|
1466
420
|
}
|
|
1467
|
-
/**
|
|
1468
|
-
* Get a vector by ID
|
|
1469
|
-
*/
|
|
1470
421
|
async vectorGet(id) {
|
|
1471
422
|
this.ensureInitialized();
|
|
1472
423
|
const row = this.db.prepare(`
|
|
@@ -1476,33 +427,23 @@ export class UnifiedMemoryManager {
|
|
|
1476
427
|
return undefined;
|
|
1477
428
|
return {
|
|
1478
429
|
embedding: this.bufferToFloatArray(row.embedding, row.dimensions),
|
|
1479
|
-
metadata: row.metadata ?
|
|
430
|
+
metadata: row.metadata ? safeJsonParse(row.metadata) : undefined,
|
|
1480
431
|
};
|
|
1481
432
|
}
|
|
1482
|
-
/**
|
|
1483
|
-
* Delete a vector
|
|
1484
|
-
*/
|
|
1485
433
|
async vectorDelete(id) {
|
|
1486
434
|
this.ensureInitialized();
|
|
1487
435
|
const result = this.db.prepare('DELETE FROM vectors WHERE id = ?').run(id);
|
|
1488
436
|
this.vectorIndex.remove(id);
|
|
1489
437
|
return result.changes > 0;
|
|
1490
438
|
}
|
|
1491
|
-
/**
|
|
1492
|
-
* Search for similar vectors.
|
|
1493
|
-
* Uses batch SQL query instead of N+1 individual queries for metadata enrichment.
|
|
1494
|
-
*/
|
|
1495
439
|
async vectorSearch(query, k = 10, namespace) {
|
|
1496
440
|
this.ensureInitialized();
|
|
1497
|
-
// Lazy-load vectors on first search (deferred from startup for fast init)
|
|
1498
441
|
if (!this.vectorsLoaded) {
|
|
1499
442
|
await this.loadVectorIndex();
|
|
1500
443
|
}
|
|
1501
|
-
|
|
1502
|
-
const results = this.vectorIndex.search(query, k * 2); // Get extra for namespace filtering
|
|
444
|
+
const results = this.vectorIndex.search(query, k * 2);
|
|
1503
445
|
if (results.length === 0)
|
|
1504
446
|
return [];
|
|
1505
|
-
// Batch fetch metadata for all result IDs in a single query (fixes N+1)
|
|
1506
447
|
const ids = results.map(r => r.id);
|
|
1507
448
|
const placeholders = ids.map(() => '?').join(',');
|
|
1508
449
|
const rows = this.db.prepare(`SELECT id, namespace, metadata FROM vectors WHERE id IN (${placeholders})`).all(...ids);
|
|
@@ -1513,9 +454,8 @@ export class UnifiedMemoryManager {
|
|
|
1513
454
|
const row = metadataMap.get(result.id);
|
|
1514
455
|
if (row && row.namespace === namespace) {
|
|
1515
456
|
filteredResults.push({
|
|
1516
|
-
id: result.id,
|
|
1517
|
-
|
|
1518
|
-
metadata: row.metadata ? JSON.parse(row.metadata) : undefined,
|
|
457
|
+
id: result.id, score: result.score,
|
|
458
|
+
metadata: row.metadata ? safeJsonParse(row.metadata) : undefined,
|
|
1519
459
|
});
|
|
1520
460
|
if (filteredResults.length >= k)
|
|
1521
461
|
break;
|
|
@@ -1523,19 +463,14 @@ export class UnifiedMemoryManager {
|
|
|
1523
463
|
}
|
|
1524
464
|
return filteredResults;
|
|
1525
465
|
}
|
|
1526
|
-
// No namespace filter, just enrich with metadata
|
|
1527
466
|
return results.slice(0, k).map(result => {
|
|
1528
467
|
const row = metadataMap.get(result.id);
|
|
1529
468
|
return {
|
|
1530
|
-
id: result.id,
|
|
1531
|
-
|
|
1532
|
-
metadata: row?.metadata ? JSON.parse(row.metadata) : undefined,
|
|
469
|
+
id: result.id, score: result.score,
|
|
470
|
+
metadata: row?.metadata ? safeJsonParse(row.metadata) : undefined,
|
|
1533
471
|
};
|
|
1534
472
|
});
|
|
1535
473
|
}
|
|
1536
|
-
/**
|
|
1537
|
-
* Get vector count
|
|
1538
|
-
*/
|
|
1539
474
|
async vectorCount(namespace) {
|
|
1540
475
|
this.ensureInitialized();
|
|
1541
476
|
if (namespace) {
|
|
@@ -1546,14 +481,8 @@ export class UnifiedMemoryManager {
|
|
|
1546
481
|
return row.count;
|
|
1547
482
|
}
|
|
1548
483
|
// ============================================================================
|
|
1549
|
-
// CRDT Operations
|
|
484
|
+
// CRDT Operations
|
|
1550
485
|
// ============================================================================
|
|
1551
|
-
/**
|
|
1552
|
-
* Initialize CRDT store for distributed state synchronization.
|
|
1553
|
-
* Call this with a unique node ID for each agent/node in the cluster.
|
|
1554
|
-
*
|
|
1555
|
-
* @param nodeId - Unique identifier for this node (e.g., 'agent-001', 'mcp-server-1')
|
|
1556
|
-
*/
|
|
1557
486
|
initializeCRDT(nodeId) {
|
|
1558
487
|
if (this.crdtStore) {
|
|
1559
488
|
console.warn('[UnifiedMemory] CRDT store already initialized');
|
|
@@ -1562,182 +491,84 @@ export class UnifiedMemoryManager {
|
|
|
1562
491
|
this.crdtStore = createCRDTStore({ nodeId });
|
|
1563
492
|
console.log(`[UnifiedMemory] CRDT store initialized for node: ${nodeId}`);
|
|
1564
493
|
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
* Returns null if CRDT has not been initialized.
|
|
1568
|
-
*/
|
|
1569
|
-
getCRDTStore() {
|
|
1570
|
-
return this.crdtStore;
|
|
1571
|
-
}
|
|
1572
|
-
/**
|
|
1573
|
-
* Check if CRDT is initialized
|
|
1574
|
-
*/
|
|
1575
|
-
isCRDTInitialized() {
|
|
1576
|
-
return this.crdtStore !== null;
|
|
1577
|
-
}
|
|
1578
|
-
/**
|
|
1579
|
-
* Set a value in both CRDT store and KV store for durability.
|
|
1580
|
-
* The CRDT store provides conflict-free merge semantics,
|
|
1581
|
-
* while the KV store provides persistence.
|
|
1582
|
-
*
|
|
1583
|
-
* @param key - Key to store
|
|
1584
|
-
* @param value - Value to store
|
|
1585
|
-
* @param namespace - Optional namespace (default: 'crdt')
|
|
1586
|
-
*/
|
|
494
|
+
getCRDTStore() { return this.crdtStore; }
|
|
495
|
+
isCRDTInitialized() { return this.crdtStore !== null; }
|
|
1587
496
|
async crdtSet(key, value, namespace = 'crdt') {
|
|
1588
497
|
this.ensureInitialized();
|
|
1589
|
-
|
|
1590
|
-
if (this.crdtStore) {
|
|
498
|
+
if (this.crdtStore)
|
|
1591
499
|
this.crdtStore.setRegister(key, value);
|
|
1592
|
-
}
|
|
1593
|
-
// Persist to KV store
|
|
1594
500
|
await this.kvSet(key, value, namespace);
|
|
1595
501
|
}
|
|
1596
|
-
/**
|
|
1597
|
-
* Get a value from CRDT store (or fallback to KV store)
|
|
1598
|
-
*
|
|
1599
|
-
* @param key - Key to retrieve
|
|
1600
|
-
* @param namespace - Optional namespace (default: 'crdt')
|
|
1601
|
-
*/
|
|
1602
502
|
async crdtGet(key, namespace = 'crdt') {
|
|
1603
|
-
// Try CRDT store first (has latest merged state)
|
|
1604
503
|
if (this.crdtStore) {
|
|
1605
504
|
const register = this.crdtStore.getRegister(key);
|
|
1606
|
-
if (register)
|
|
505
|
+
if (register)
|
|
1607
506
|
return register.get();
|
|
1608
|
-
}
|
|
1609
507
|
}
|
|
1610
|
-
// Fallback to KV store
|
|
1611
508
|
return this.kvGet(key, namespace);
|
|
1612
509
|
}
|
|
1613
|
-
/**
|
|
1614
|
-
* Increment a distributed counter (CRDT G-Counter)
|
|
1615
|
-
*
|
|
1616
|
-
* @param key - Counter key
|
|
1617
|
-
* @param amount - Amount to increment (default: 1)
|
|
1618
|
-
*/
|
|
1619
510
|
crdtIncrement(key, amount = 1) {
|
|
1620
|
-
if (!this.crdtStore)
|
|
511
|
+
if (!this.crdtStore)
|
|
1621
512
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1622
|
-
}
|
|
1623
|
-
// Get or create counter
|
|
1624
513
|
let counter = this.crdtStore.getCounter(key);
|
|
1625
514
|
if (!counter) {
|
|
1626
|
-
this.crdtStore.incrementCounter(key, 0);
|
|
515
|
+
this.crdtStore.incrementCounter(key, 0);
|
|
1627
516
|
counter = this.crdtStore.getCounter(key);
|
|
1628
517
|
}
|
|
1629
|
-
|
|
1630
|
-
for (let i = 0; i < amount; i++) {
|
|
518
|
+
for (let i = 0; i < amount; i++)
|
|
1631
519
|
this.crdtStore.incrementCounter(key);
|
|
1632
|
-
}
|
|
1633
520
|
}
|
|
1634
|
-
/**
|
|
1635
|
-
* Get distributed counter value
|
|
1636
|
-
*
|
|
1637
|
-
* @param key - Counter key
|
|
1638
|
-
*/
|
|
1639
521
|
crdtGetCounter(key) {
|
|
1640
|
-
if (!this.crdtStore)
|
|
522
|
+
if (!this.crdtStore)
|
|
1641
523
|
return 0;
|
|
1642
|
-
}
|
|
1643
524
|
const counter = this.crdtStore.getCounter(key);
|
|
1644
525
|
return counter?.get() ?? 0;
|
|
1645
526
|
}
|
|
1646
|
-
/**
|
|
1647
|
-
* Add item to distributed set (CRDT OR-Set)
|
|
1648
|
-
*
|
|
1649
|
-
* @param key - Set key
|
|
1650
|
-
* @param item - Item to add
|
|
1651
|
-
*/
|
|
1652
527
|
crdtAddToSet(key, item) {
|
|
1653
|
-
if (!this.crdtStore)
|
|
528
|
+
if (!this.crdtStore)
|
|
1654
529
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1655
|
-
}
|
|
1656
530
|
this.crdtStore.addToSet(key, item);
|
|
1657
531
|
}
|
|
1658
|
-
/**
|
|
1659
|
-
* Remove item from distributed set
|
|
1660
|
-
*
|
|
1661
|
-
* @param key - Set key
|
|
1662
|
-
* @param item - Item to remove
|
|
1663
|
-
*/
|
|
1664
532
|
crdtRemoveFromSet(key, item) {
|
|
1665
|
-
if (!this.crdtStore)
|
|
533
|
+
if (!this.crdtStore)
|
|
1666
534
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1667
|
-
}
|
|
1668
535
|
this.crdtStore.removeFromSet(key, item);
|
|
1669
536
|
}
|
|
1670
|
-
/**
|
|
1671
|
-
* Get all items from distributed set
|
|
1672
|
-
*
|
|
1673
|
-
* @param key - Set key
|
|
1674
|
-
*/
|
|
1675
537
|
crdtGetSet(key) {
|
|
1676
|
-
if (!this.crdtStore)
|
|
538
|
+
if (!this.crdtStore)
|
|
1677
539
|
return new Set();
|
|
1678
|
-
}
|
|
1679
540
|
const orSet = this.crdtStore.getSet(key);
|
|
1680
|
-
// ORSet.values() returns T[], convert to Set<T>
|
|
1681
541
|
return new Set(orSet.values());
|
|
1682
542
|
}
|
|
1683
|
-
/**
|
|
1684
|
-
* Get the current CRDT state for replication
|
|
1685
|
-
*/
|
|
1686
543
|
crdtGetState() {
|
|
1687
|
-
if (!this.crdtStore)
|
|
544
|
+
if (!this.crdtStore)
|
|
1688
545
|
return null;
|
|
1689
|
-
}
|
|
1690
546
|
return this.crdtStore.getState();
|
|
1691
547
|
}
|
|
1692
|
-
/**
|
|
1693
|
-
* Get a delta of changes since a given version
|
|
1694
|
-
*/
|
|
1695
548
|
crdtGetDelta(sinceVersion) {
|
|
1696
|
-
if (!this.crdtStore)
|
|
549
|
+
if (!this.crdtStore)
|
|
1697
550
|
return null;
|
|
1698
|
-
}
|
|
1699
551
|
return this.crdtStore.getDelta(sinceVersion ?? 0);
|
|
1700
552
|
}
|
|
1701
|
-
/**
|
|
1702
|
-
* Merge remote CRDT state into local store.
|
|
1703
|
-
* This operation is commutative, associative, and idempotent.
|
|
1704
|
-
*
|
|
1705
|
-
* @param remoteState - State from another node
|
|
1706
|
-
*/
|
|
1707
553
|
crdtMerge(remoteState) {
|
|
1708
|
-
if (!this.crdtStore)
|
|
554
|
+
if (!this.crdtStore)
|
|
1709
555
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1710
|
-
}
|
|
1711
556
|
this.crdtStore.applyState(remoteState);
|
|
1712
557
|
}
|
|
1713
|
-
/**
|
|
1714
|
-
* Apply a delta from another node
|
|
1715
|
-
*
|
|
1716
|
-
* @param delta - Delta changes from another node
|
|
1717
|
-
*/
|
|
1718
558
|
crdtApplyDelta(delta) {
|
|
1719
|
-
if (!this.crdtStore)
|
|
559
|
+
if (!this.crdtStore)
|
|
1720
560
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1721
|
-
}
|
|
1722
561
|
this.crdtStore.applyDelta(delta);
|
|
1723
562
|
}
|
|
1724
|
-
/**
|
|
1725
|
-
* Persist current CRDT state to KV store for recovery
|
|
1726
|
-
*/
|
|
1727
563
|
async crdtPersist() {
|
|
1728
|
-
if (!this.crdtStore)
|
|
564
|
+
if (!this.crdtStore)
|
|
1729
565
|
return;
|
|
1730
|
-
}
|
|
1731
566
|
const state = this.crdtStore.getState();
|
|
1732
567
|
await this.kvSet('__crdt_state__', state, 'crdt-internal');
|
|
1733
568
|
}
|
|
1734
|
-
/**
|
|
1735
|
-
* Restore CRDT state from KV store
|
|
1736
|
-
*/
|
|
1737
569
|
async crdtRestore() {
|
|
1738
|
-
if (!this.crdtStore)
|
|
570
|
+
if (!this.crdtStore)
|
|
1739
571
|
return false;
|
|
1740
|
-
}
|
|
1741
572
|
const state = await this.kvGet('__crdt_state__', 'crdt-internal');
|
|
1742
573
|
if (state) {
|
|
1743
574
|
this.crdtStore.applyState(state);
|
|
@@ -1746,32 +577,15 @@ export class UnifiedMemoryManager {
|
|
|
1746
577
|
return false;
|
|
1747
578
|
}
|
|
1748
579
|
// ============================================================================
|
|
1749
|
-
// Raw Database Access
|
|
580
|
+
// Raw Database Access
|
|
1750
581
|
// ============================================================================
|
|
1751
|
-
/**
|
|
1752
|
-
* Get the raw database connection
|
|
1753
|
-
*/
|
|
1754
582
|
getDatabase() {
|
|
1755
|
-
if (!this.db || !this.initialized)
|
|
583
|
+
if (!this.db || !this.initialized)
|
|
1756
584
|
throw new Error('UnifiedMemoryManager not initialized');
|
|
1757
|
-
}
|
|
1758
585
|
return this.db;
|
|
1759
586
|
}
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
*/
|
|
1763
|
-
isInitialized() {
|
|
1764
|
-
return this.initialized;
|
|
1765
|
-
}
|
|
1766
|
-
/**
|
|
1767
|
-
* Get the database path
|
|
1768
|
-
*/
|
|
1769
|
-
getDbPath() {
|
|
1770
|
-
return this.config.dbPath;
|
|
1771
|
-
}
|
|
1772
|
-
/**
|
|
1773
|
-
* Prepare and cache a statement
|
|
1774
|
-
*/
|
|
587
|
+
isInitialized() { return this.initialized; }
|
|
588
|
+
getDbPath() { return this.config.dbPath; }
|
|
1775
589
|
prepare(name, sql) {
|
|
1776
590
|
if (!this.db)
|
|
1777
591
|
throw new Error('Database not initialized');
|
|
@@ -1782,104 +596,48 @@ export class UnifiedMemoryManager {
|
|
|
1782
596
|
}
|
|
1783
597
|
return stmt;
|
|
1784
598
|
}
|
|
1785
|
-
/**
|
|
1786
|
-
* Execute a transaction
|
|
1787
|
-
*/
|
|
1788
599
|
transaction(fn) {
|
|
1789
600
|
if (!this.db)
|
|
1790
601
|
throw new Error('Database not initialized');
|
|
1791
602
|
return this.db.transaction(fn)();
|
|
1792
603
|
}
|
|
1793
|
-
/**
|
|
1794
|
-
* Get database statistics
|
|
1795
|
-
*/
|
|
1796
604
|
getStats() {
|
|
1797
605
|
if (!this.db)
|
|
1798
606
|
throw new Error('Database not initialized');
|
|
1799
|
-
const
|
|
1800
|
-
'kv_store',
|
|
1801
|
-
'vectors',
|
|
1802
|
-
'rl_q_values',
|
|
1803
|
-
'goap_actions',
|
|
1804
|
-
'goap_goals',
|
|
1805
|
-
'goap_plans',
|
|
1806
|
-
'goap_execution_steps',
|
|
1807
|
-
'goap_plan_signatures',
|
|
1808
|
-
'concept_nodes',
|
|
1809
|
-
'concept_edges',
|
|
1810
|
-
'dream_cycles',
|
|
1811
|
-
'dream_insights',
|
|
1812
|
-
// v4: QE Patterns tables (ADR-046)
|
|
1813
|
-
'qe_patterns',
|
|
1814
|
-
'qe_pattern_embeddings',
|
|
1815
|
-
'qe_pattern_usage',
|
|
1816
|
-
'qe_trajectories',
|
|
1817
|
-
'embeddings',
|
|
1818
|
-
'execution_results',
|
|
1819
|
-
'executed_steps',
|
|
1820
|
-
// v5: MinCut tables (ADR-047)
|
|
1821
|
-
'mincut_snapshots',
|
|
1822
|
-
'mincut_history',
|
|
1823
|
-
'mincut_weak_vertices',
|
|
1824
|
-
'mincut_alerts',
|
|
1825
|
-
'mincut_healing_actions',
|
|
1826
|
-
'mincut_observations',
|
|
1827
|
-
// v6: Hypergraph tables (Neural Backbone)
|
|
1828
|
-
'hypergraph_nodes',
|
|
1829
|
-
'hypergraph_edges',
|
|
1830
|
-
// v7: SONA Patterns table (Neural Backbone)
|
|
1831
|
-
'sona_patterns',
|
|
1832
|
-
];
|
|
1833
|
-
const tableStats = tables.map(name => {
|
|
607
|
+
const tableStats = STATS_TABLES.map(name => {
|
|
1834
608
|
try {
|
|
1835
609
|
const row = this.db.prepare(`SELECT COUNT(*) as count FROM ${name}`).get();
|
|
1836
610
|
return { name, rowCount: row.count };
|
|
1837
611
|
}
|
|
1838
|
-
catch {
|
|
612
|
+
catch (e) {
|
|
613
|
+
logger.debug('Table row count query failed', { table: name, error: e instanceof Error ? e.message : String(e) });
|
|
1839
614
|
return { name, rowCount: 0 };
|
|
1840
615
|
}
|
|
1841
616
|
});
|
|
1842
617
|
let fileSize = 0;
|
|
1843
618
|
let walSize = 0;
|
|
1844
619
|
try {
|
|
1845
|
-
if (fs.existsSync(this.config.dbPath))
|
|
620
|
+
if (fs.existsSync(this.config.dbPath))
|
|
1846
621
|
fileSize = fs.statSync(this.config.dbPath).size;
|
|
1847
|
-
}
|
|
1848
622
|
const walPath = this.config.dbPath + '-wal';
|
|
1849
|
-
if (fs.existsSync(walPath))
|
|
623
|
+
if (fs.existsSync(walPath))
|
|
1850
624
|
walSize = fs.statSync(walPath).size;
|
|
1851
|
-
}
|
|
1852
625
|
}
|
|
1853
626
|
catch (error) {
|
|
1854
|
-
// Non-critical: file stat errors during storage stats
|
|
1855
627
|
console.debug('[UnifiedMemory] File stat error:', error instanceof Error ? error.message : error);
|
|
1856
628
|
}
|
|
1857
|
-
return {
|
|
1858
|
-
tables: tableStats,
|
|
1859
|
-
fileSize,
|
|
1860
|
-
walSize,
|
|
1861
|
-
vectorIndexSize: this.vectorIndex.size(),
|
|
1862
|
-
};
|
|
629
|
+
return { tables: tableStats, fileSize, walSize, vectorIndexSize: this.vectorIndex.size() };
|
|
1863
630
|
}
|
|
1864
|
-
/**
|
|
1865
|
-
* Vacuum the database
|
|
1866
|
-
*/
|
|
1867
631
|
vacuum() {
|
|
1868
632
|
if (!this.db)
|
|
1869
633
|
throw new Error('Database not initialized');
|
|
1870
634
|
this.db.exec('VACUUM');
|
|
1871
635
|
}
|
|
1872
|
-
/**
|
|
1873
|
-
* Checkpoint WAL
|
|
1874
|
-
*/
|
|
1875
636
|
checkpoint() {
|
|
1876
637
|
if (!this.db)
|
|
1877
638
|
throw new Error('Database not initialized');
|
|
1878
639
|
this.db.pragma('wal_checkpoint(TRUNCATE)');
|
|
1879
640
|
}
|
|
1880
|
-
/**
|
|
1881
|
-
* Close the database connection
|
|
1882
|
-
*/
|
|
1883
641
|
close() {
|
|
1884
642
|
if (this.db) {
|
|
1885
643
|
this.preparedStatements.clear();
|
|
@@ -1900,44 +658,33 @@ export class UnifiedMemoryManager {
|
|
|
1900
658
|
}
|
|
1901
659
|
floatArrayToBuffer(arr) {
|
|
1902
660
|
const buffer = Buffer.alloc(arr.length * 4);
|
|
1903
|
-
for (let i = 0; i < arr.length; i++)
|
|
661
|
+
for (let i = 0; i < arr.length; i++)
|
|
1904
662
|
buffer.writeFloatLE(arr[i], i * 4);
|
|
1905
|
-
}
|
|
1906
663
|
return buffer;
|
|
1907
664
|
}
|
|
1908
665
|
bufferToFloatArray(buffer, dimensions) {
|
|
1909
666
|
const arr = [];
|
|
1910
|
-
for (let i = 0; i < dimensions; i++)
|
|
667
|
+
for (let i = 0; i < dimensions; i++)
|
|
1911
668
|
arr.push(buffer.readFloatLE(i * 4));
|
|
1912
|
-
}
|
|
1913
669
|
return arr;
|
|
1914
670
|
}
|
|
1915
671
|
}
|
|
1916
672
|
// ============================================================================
|
|
1917
673
|
// Convenience Functions
|
|
1918
674
|
// ============================================================================
|
|
1919
|
-
/**
|
|
1920
|
-
* Get the shared unified memory manager instance
|
|
1921
|
-
*/
|
|
1922
675
|
export function getUnifiedMemory(config) {
|
|
1923
676
|
return UnifiedMemoryManager.getInstance(config);
|
|
1924
677
|
}
|
|
1925
|
-
/**
|
|
1926
|
-
* Initialize the shared unified memory manager
|
|
1927
|
-
*/
|
|
1928
678
|
export async function initializeUnifiedMemory(config) {
|
|
1929
679
|
const manager = getUnifiedMemory(config);
|
|
1930
680
|
await manager.initialize();
|
|
1931
681
|
return manager;
|
|
1932
682
|
}
|
|
1933
|
-
/**
|
|
1934
|
-
* Reset the shared unified memory manager (for testing)
|
|
1935
|
-
*/
|
|
1936
683
|
export function resetUnifiedMemory() {
|
|
1937
684
|
UnifiedMemoryManager.resetInstance();
|
|
1938
685
|
}
|
|
1939
686
|
// ============================================================================
|
|
1940
|
-
// Process Exit Handlers
|
|
687
|
+
// Process Exit Handlers
|
|
1941
688
|
// ============================================================================
|
|
1942
689
|
let exitHandlersRegistered = false;
|
|
1943
690
|
function registerExitHandlers() {
|
|
@@ -1947,25 +694,16 @@ function registerExitHandlers() {
|
|
|
1947
694
|
const cleanup = () => {
|
|
1948
695
|
try {
|
|
1949
696
|
const instance = UnifiedMemoryManager['instance'];
|
|
1950
|
-
if (instance)
|
|
697
|
+
if (instance)
|
|
1951
698
|
instance.close();
|
|
1952
|
-
}
|
|
1953
699
|
}
|
|
1954
700
|
catch (error) {
|
|
1955
|
-
// Non-critical: cleanup errors during shutdown
|
|
1956
701
|
console.debug('[UnifiedMemory] Cleanup error:', error instanceof Error ? error.message : error);
|
|
1957
702
|
}
|
|
1958
703
|
};
|
|
1959
704
|
process.on('beforeExit', cleanup);
|
|
1960
|
-
process.on('SIGINT', () => {
|
|
1961
|
-
|
|
1962
|
-
process.exit(0);
|
|
1963
|
-
});
|
|
1964
|
-
process.on('SIGTERM', () => {
|
|
1965
|
-
cleanup();
|
|
1966
|
-
process.exit(0);
|
|
1967
|
-
});
|
|
705
|
+
process.on('SIGINT', () => { cleanup(); process.exit(0); });
|
|
706
|
+
process.on('SIGTERM', () => { cleanup(); process.exit(0); });
|
|
1968
707
|
}
|
|
1969
|
-
// Register exit handlers when module is loaded
|
|
1970
708
|
registerExitHandlers();
|
|
1971
709
|
//# sourceMappingURL=unified-memory.js.map
|