agentic-qe 3.6.8 → 3.6.10
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/.validation/schemas/skill-eval.schema.json +11 -1
- package/.claude/skills/README.md +1 -1
- package/.claude/skills/pr-review/SKILL.md +2 -2
- package/.claude/skills/qcsd-production-swarm/SKILL.md +2781 -0
- package/.claude/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +246 -0
- package/.claude/skills/qcsd-production-swarm/schemas/output.json +505 -0
- package/.claude/skills/qcsd-production-swarm/scripts/validate-config.json +25 -0
- package/.claude/skills/skills-manifest.json +5 -5
- package/package.json +3 -2
- package/scripts/benchmark-hnsw-loading.ts +480 -0
- package/scripts/benchmark-kg-assisted.ts +725 -0
- package/scripts/collect-production-telemetry.sh +291 -0
- package/scripts/detect-skill-conflicts.ts +347 -0
- package/scripts/eval-driven-workflow.ts +704 -0
- package/scripts/run-skill-eval.ts +210 -10
- package/scripts/score-skill-quality.ts +511 -0
- package/v3/CHANGELOG.md +39 -0
- package/v3/assets/skills/pr-review/SKILL.md +2 -2
- 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 +14596 -15275
- 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 +145 -3
- 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/test.d.ts.map +1 -1
- package/v3/dist/cli/commands/test.js +6 -0
- package/v3/dist/cli/commands/test.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/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/generators/jest-vitest-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.js +58 -6
- package/v3/dist/domains/test-generation/generators/jest-vitest-generator.js.map +1 -1
- package/v3/dist/domains/test-generation/generators/mocha-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/generators/mocha-generator.js +79 -7
- package/v3/dist/domains/test-generation/generators/mocha-generator.js.map +1 -1
- package/v3/dist/domains/test-generation/generators/pytest-generator.d.ts +4 -0
- package/v3/dist/domains/test-generation/generators/pytest-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/generators/pytest-generator.js +77 -10
- package/v3/dist/domains/test-generation/generators/pytest-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/interfaces/test-generator.interface.d.ts +21 -0
- package/v3/dist/domains/test-generation/interfaces/test-generator.interface.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/interfaces.d.ts +21 -0
- package/v3/dist/domains/test-generation/interfaces.d.ts.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 +22 -0
- package/v3/dist/domains/test-generation/services/test-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/test-generator.js +210 -20
- 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 +5 -3
- 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.map +1 -1
- package/v3/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +4 -3
- 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 +42 -29
- 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 +130 -0
- package/v3/dist/kernel/unified-memory-hnsw.d.ts.map +1 -0
- package/v3/dist/kernel/unified-memory-hnsw.js +547 -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 +14 -198
- package/v3/dist/kernel/unified-memory.d.ts.map +1 -1
- package/v3/dist/kernel/unified-memory.js +117 -1388
- 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 +89 -13
- 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 +15756 -14023
- 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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Consolidates ALL persistence into one file:
|
|
7
7
|
* - KV Store (v2 compatible)
|
|
8
|
-
* - Vectors (BLOB storage,
|
|
8
|
+
* - Vectors (BLOB storage, @ruvector/gnn flat index for fast loading)
|
|
9
9
|
* - Q-Values (RL algorithms)
|
|
10
10
|
* - GOAP (planning)
|
|
11
11
|
* - Dreams (concept graph)
|
|
@@ -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, RuvectorFlatIndex } from './unified-memory-hnsw.js';
|
|
37
|
+
import { RuvectorFlatIndex } 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
|
/**
|
|
@@ -1119,44 +170,28 @@ export class UnifiedMemoryManager {
|
|
|
1119
170
|
vectorsLoaded = false;
|
|
1120
171
|
initPromise = null;
|
|
1121
172
|
preparedStatements = new Map();
|
|
1122
|
-
vectorIndex = new
|
|
173
|
+
vectorIndex = new RuvectorFlatIndex();
|
|
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 };
|
|
1129
|
-
// CRITICAL: If dbPath is relative (e.g. '.agentic-qe/memory.db' from a caller
|
|
1130
|
-
// that used a static default), resolve it through findProjectRoot() to prevent
|
|
1131
|
-
// split-brain where CWD-relative paths create duplicate databases in subdirectories.
|
|
1132
179
|
if (!path.isAbsolute(this.config.dbPath)) {
|
|
1133
180
|
const projectRoot = findProjectRoot();
|
|
1134
181
|
this.config.dbPath = path.join(projectRoot, this.config.dbPath);
|
|
1135
182
|
}
|
|
1136
183
|
}
|
|
1137
|
-
/**
|
|
1138
|
-
* Get or create the singleton instance (synchronous).
|
|
1139
|
-
* Thread-safe: JS is single-threaded for synchronous code.
|
|
1140
|
-
*/
|
|
1141
184
|
static getInstance(config) {
|
|
1142
|
-
// Synchronous return if already created
|
|
1143
185
|
if (UnifiedMemoryManager.instance) {
|
|
1144
186
|
return UnifiedMemoryManager.instance;
|
|
1145
187
|
}
|
|
1146
|
-
// Synchronous creation - JS single-threaded execution prevents race here
|
|
1147
188
|
UnifiedMemoryManager.instance = new UnifiedMemoryManager(config);
|
|
1148
189
|
return UnifiedMemoryManager.instance;
|
|
1149
190
|
}
|
|
1150
|
-
/**
|
|
1151
|
-
* Get or create the singleton instance with async initialization.
|
|
1152
|
-
* Thread-safe: Uses Promise lock to prevent concurrent initialization races.
|
|
1153
|
-
*/
|
|
1154
191
|
static async getInstanceAsync(config) {
|
|
1155
|
-
// Fast path: already fully initialized
|
|
1156
192
|
if (UnifiedMemoryManager.instance?.initialized) {
|
|
1157
193
|
return UnifiedMemoryManager.instance;
|
|
1158
194
|
}
|
|
1159
|
-
// Use Promise lock to prevent concurrent initialization
|
|
1160
195
|
if (!UnifiedMemoryManager.instancePromise) {
|
|
1161
196
|
UnifiedMemoryManager.instancePromise = (async () => {
|
|
1162
197
|
const instance = UnifiedMemoryManager.getInstance(config);
|
|
@@ -1166,9 +201,6 @@ export class UnifiedMemoryManager {
|
|
|
1166
201
|
}
|
|
1167
202
|
return UnifiedMemoryManager.instancePromise;
|
|
1168
203
|
}
|
|
1169
|
-
/**
|
|
1170
|
-
* Reset the singleton (for testing)
|
|
1171
|
-
*/
|
|
1172
204
|
static resetInstance() {
|
|
1173
205
|
if (UnifiedMemoryManager.instance) {
|
|
1174
206
|
UnifiedMemoryManager.instance.close();
|
|
@@ -1176,36 +208,23 @@ export class UnifiedMemoryManager {
|
|
|
1176
208
|
}
|
|
1177
209
|
UnifiedMemoryManager.instancePromise = null;
|
|
1178
210
|
}
|
|
1179
|
-
/**
|
|
1180
|
-
* Initialize the database, run migrations, and load vector index.
|
|
1181
|
-
* Thread-safe: Uses Promise lock to prevent concurrent initialization races.
|
|
1182
|
-
*/
|
|
1183
211
|
async initialize() {
|
|
1184
|
-
// Fast path: already initialized
|
|
1185
212
|
if (this.initialized)
|
|
1186
213
|
return;
|
|
1187
|
-
// Use Promise lock to prevent concurrent initialization
|
|
1188
214
|
if (!this.initPromise) {
|
|
1189
215
|
this.initPromise = this._doInitialize();
|
|
1190
216
|
}
|
|
1191
217
|
return this.initPromise;
|
|
1192
218
|
}
|
|
1193
|
-
/**
|
|
1194
|
-
* Internal initialization implementation
|
|
1195
|
-
*/
|
|
1196
219
|
async _doInitialize() {
|
|
1197
|
-
// Double-check after acquiring promise lock
|
|
1198
220
|
if (this.initialized)
|
|
1199
221
|
return;
|
|
1200
222
|
try {
|
|
1201
|
-
// Ensure directory exists
|
|
1202
223
|
const dir = path.dirname(this.config.dbPath);
|
|
1203
224
|
if (!fs.existsSync(dir)) {
|
|
1204
225
|
fs.mkdirSync(dir, { recursive: true });
|
|
1205
226
|
}
|
|
1206
|
-
// Open database
|
|
1207
227
|
this.db = new Database(this.config.dbPath);
|
|
1208
|
-
// Configure for performance
|
|
1209
228
|
if (this.config.walMode) {
|
|
1210
229
|
this.db.pragma('journal_mode = WAL');
|
|
1211
230
|
}
|
|
@@ -1213,25 +232,17 @@ export class UnifiedMemoryManager {
|
|
|
1213
232
|
this.db.pragma(`cache_size = ${this.config.cacheSize}`);
|
|
1214
233
|
this.db.pragma(`busy_timeout = ${this.config.busyTimeout}`);
|
|
1215
234
|
this.db.pragma('foreign_keys = ON');
|
|
1216
|
-
// Run migrations
|
|
1217
235
|
await this.runMigrations();
|
|
1218
|
-
// Defer vector index loading until first search (startup optimization)
|
|
1219
236
|
this.vectorsLoaded = false;
|
|
1220
237
|
this.initialized = true;
|
|
1221
238
|
console.log(`[UnifiedMemory] Initialized: ${this.config.dbPath}`);
|
|
1222
|
-
// Guard: warn if duplicate .agentic-qe/memory.db files exist in project tree
|
|
1223
239
|
this.warnIfDuplicateDatabases();
|
|
1224
240
|
}
|
|
1225
241
|
catch (error) {
|
|
1226
|
-
// Allow retry on failure by clearing the promise
|
|
1227
242
|
this.initPromise = null;
|
|
1228
|
-
throw new Error(`Failed to initialize UnifiedMemoryManager: ${
|
|
243
|
+
throw new Error(`Failed to initialize UnifiedMemoryManager: ${toErrorMessage(error)}`);
|
|
1229
244
|
}
|
|
1230
245
|
}
|
|
1231
|
-
/**
|
|
1232
|
-
* Warn if multiple .agentic-qe/memory.db files exist in the project tree.
|
|
1233
|
-
* This prevents silent data splits where different modules write to different DBs.
|
|
1234
|
-
*/
|
|
1235
246
|
warnIfDuplicateDatabases() {
|
|
1236
247
|
try {
|
|
1237
248
|
const projectRoot = findProjectRoot();
|
|
@@ -1250,13 +261,11 @@ export class UnifiedMemoryManager {
|
|
|
1250
261
|
` This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`);
|
|
1251
262
|
}
|
|
1252
263
|
}
|
|
1253
|
-
catch {
|
|
1254
|
-
// Non-critical
|
|
264
|
+
catch (e) {
|
|
265
|
+
// Non-critical
|
|
266
|
+
logger.debug('Duplicate database check failed', { error: e instanceof Error ? e.message : String(e) });
|
|
1255
267
|
}
|
|
1256
268
|
}
|
|
1257
|
-
/**
|
|
1258
|
-
* Check if a column exists in a table
|
|
1259
|
-
*/
|
|
1260
269
|
columnExists(tableName, columnName) {
|
|
1261
270
|
if (!this.db)
|
|
1262
271
|
return false;
|
|
@@ -1265,95 +274,59 @@ export class UnifiedMemoryManager {
|
|
|
1265
274
|
const info = this.db.prepare(`PRAGMA table_info(${safeName})`).all();
|
|
1266
275
|
return info.some(col => col.name === columnName);
|
|
1267
276
|
}
|
|
1268
|
-
catch {
|
|
277
|
+
catch (e) {
|
|
278
|
+
logger.debug('Column existence check failed', { table: tableName, column: columnName, error: e instanceof Error ? e.message : String(e) });
|
|
1269
279
|
return false;
|
|
1270
280
|
}
|
|
1271
281
|
}
|
|
1272
|
-
/**
|
|
1273
|
-
* Handle v2 schema incompatibilities by dropping and recreating tables
|
|
1274
|
-
* that have incompatible schemas (missing columns that v3 requires)
|
|
1275
|
-
*/
|
|
1276
282
|
handleV2SchemaIncompatibilities() {
|
|
1277
283
|
if (!this.db)
|
|
1278
284
|
return;
|
|
1279
|
-
// Tables that may exist from v2 with incompatible schemas
|
|
1280
|
-
// Only list tables where v2 has DIFFERENT schema than v3
|
|
1281
|
-
// The 'requiredColumn' must be a column that EXISTS in v3 but NOT in v2
|
|
1282
285
|
const v2IncompatibleTables = [
|
|
1283
|
-
|
|
1284
|
-
{ table: '
|
|
1285
|
-
{ table: '
|
|
1286
|
-
{ table: '
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
{ table: 'concept_nodes', requiredColumn: 'concept_type' }, // v2 has 'type'
|
|
1290
|
-
{ table: 'concept_edges', requiredColumn: 'edge_type' }, // v2 has 'type'
|
|
1291
|
-
{ table: 'dream_insights', requiredColumn: 'cycle_id' }, // v2 missing foreign key
|
|
1292
|
-
// RL tables - v2 has simpler schema
|
|
1293
|
-
{ 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' },
|
|
1294
292
|
];
|
|
1295
293
|
for (const { table, requiredColumn } of v2IncompatibleTables) {
|
|
1296
|
-
// Check if table exists
|
|
1297
294
|
const tableExists = this.db.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name=?`).get(table);
|
|
1298
295
|
if (tableExists && !this.columnExists(table, requiredColumn)) {
|
|
1299
296
|
console.log(`[UnifiedMemory] Upgrading v2 table: ${table} (missing ${requiredColumn})`);
|
|
1300
|
-
// Drop the old table - will be recreated with v3 schema
|
|
1301
297
|
this.db.exec(`DROP TABLE IF EXISTS ${validateTableName(table)}`);
|
|
1302
298
|
}
|
|
1303
299
|
}
|
|
1304
300
|
}
|
|
1305
|
-
/**
|
|
1306
|
-
* Run schema migrations
|
|
1307
|
-
*/
|
|
1308
301
|
async runMigrations() {
|
|
1309
302
|
if (!this.db)
|
|
1310
303
|
throw new Error('Database not initialized');
|
|
1311
|
-
// Create schema version table
|
|
1312
304
|
this.db.exec(SCHEMA_VERSION_TABLE);
|
|
1313
|
-
// Handle v2 schema incompatibilities BEFORE migration
|
|
1314
305
|
this.handleV2SchemaIncompatibilities();
|
|
1315
|
-
// Get current version
|
|
1316
306
|
const versionRow = this.db.prepare('SELECT version FROM schema_version WHERE id = 1').get();
|
|
1317
307
|
const currentVersion = versionRow?.version ?? 0;
|
|
1318
308
|
if (currentVersion < SCHEMA_VERSION) {
|
|
1319
309
|
console.log(`[UnifiedMemory] Migrating from v${currentVersion} to v${SCHEMA_VERSION}`);
|
|
1320
|
-
// Create all schemas using transaction
|
|
1321
310
|
const migrate = this.db.transaction(() => {
|
|
1322
|
-
|
|
1323
|
-
if (currentVersion < 1) {
|
|
311
|
+
if (currentVersion < 1)
|
|
1324
312
|
this.db.exec(KV_STORE_SCHEMA);
|
|
1325
|
-
|
|
1326
|
-
// v2: Vectors table
|
|
1327
|
-
if (currentVersion < 2) {
|
|
313
|
+
if (currentVersion < 2)
|
|
1328
314
|
this.db.exec(VECTORS_SCHEMA);
|
|
1329
|
-
}
|
|
1330
|
-
// v3: Learning features (Q-Values, GOAP, Dreams)
|
|
1331
315
|
if (currentVersion < 3) {
|
|
1332
316
|
this.db.exec(RL_QVALUES_SCHEMA);
|
|
1333
317
|
this.db.exec(GOAP_SCHEMA);
|
|
1334
318
|
this.db.exec(DREAM_SCHEMA);
|
|
1335
319
|
}
|
|
1336
|
-
|
|
1337
|
-
if (currentVersion < 4) {
|
|
320
|
+
if (currentVersion < 4)
|
|
1338
321
|
this.db.exec(QE_PATTERNS_SCHEMA);
|
|
1339
|
-
|
|
1340
|
-
// v5: MinCut tables (ADR-047)
|
|
1341
|
-
if (currentVersion < 5) {
|
|
322
|
+
if (currentVersion < 5)
|
|
1342
323
|
this.db.exec(MINCUT_SCHEMA);
|
|
1343
|
-
|
|
1344
|
-
// v6: Hypergraph tables (Neural Backbone)
|
|
1345
|
-
if (currentVersion < 6) {
|
|
324
|
+
if (currentVersion < 6)
|
|
1346
325
|
this.db.exec(HYPERGRAPH_SCHEMA);
|
|
1347
|
-
|
|
1348
|
-
// v7: SONA Patterns table (Neural Backbone)
|
|
1349
|
-
if (currentVersion < 7) {
|
|
326
|
+
if (currentVersion < 7)
|
|
1350
327
|
this.db.exec(SONA_PATTERNS_SCHEMA);
|
|
1351
|
-
|
|
1352
|
-
// v8: Feedback loop persistence tables (ADR-023, ADR-022)
|
|
1353
|
-
if (currentVersion < 8) {
|
|
328
|
+
if (currentVersion < 8)
|
|
1354
329
|
this.db.exec(FEEDBACK_SCHEMA);
|
|
1355
|
-
}
|
|
1356
|
-
// Update schema version
|
|
1357
330
|
this.db.prepare(`
|
|
1358
331
|
INSERT OR REPLACE INTO schema_version (id, version, migrated_at)
|
|
1359
332
|
VALUES (1, ?, datetime('now'))
|
|
@@ -1363,9 +336,6 @@ export class UnifiedMemoryManager {
|
|
|
1363
336
|
console.log(`[UnifiedMemory] Migration complete`);
|
|
1364
337
|
}
|
|
1365
338
|
}
|
|
1366
|
-
/**
|
|
1367
|
-
* Load all vectors from SQLite into HNSW index
|
|
1368
|
-
*/
|
|
1369
339
|
async loadVectorIndex() {
|
|
1370
340
|
if (this.vectorsLoaded)
|
|
1371
341
|
return;
|
|
@@ -1378,14 +348,11 @@ export class UnifiedMemoryManager {
|
|
|
1378
348
|
this.vectorIndex.add(row.id, embedding);
|
|
1379
349
|
}
|
|
1380
350
|
this.vectorsLoaded = true;
|
|
1381
|
-
console.log(`[UnifiedMemory] Loaded ${rows.length} vectors into
|
|
351
|
+
console.log(`[UnifiedMemory] Loaded ${rows.length} vectors into vector index (ruvector flat)`);
|
|
1382
352
|
}
|
|
1383
353
|
// ============================================================================
|
|
1384
354
|
// KV Store Operations (v2 compatible)
|
|
1385
355
|
// ============================================================================
|
|
1386
|
-
/**
|
|
1387
|
-
* Store a key-value pair
|
|
1388
|
-
*/
|
|
1389
356
|
async kvSet(key, value, namespace = 'default', ttl) {
|
|
1390
357
|
this.ensureInitialized();
|
|
1391
358
|
const expiresAt = ttl ? Date.now() + ttl * 1000 : null;
|
|
@@ -1395,9 +362,6 @@ export class UnifiedMemoryManager {
|
|
|
1395
362
|
VALUES (?, ?, ?, ?)
|
|
1396
363
|
`).run(key, namespace, serialized, expiresAt);
|
|
1397
364
|
}
|
|
1398
|
-
/**
|
|
1399
|
-
* Get a value by key
|
|
1400
|
-
*/
|
|
1401
365
|
async kvGet(key, namespace = 'default') {
|
|
1402
366
|
this.ensureInitialized();
|
|
1403
367
|
const row = this.db.prepare(`
|
|
@@ -1406,24 +370,17 @@ export class UnifiedMemoryManager {
|
|
|
1406
370
|
`).get(key, namespace);
|
|
1407
371
|
if (!row)
|
|
1408
372
|
return undefined;
|
|
1409
|
-
// Check expiration
|
|
1410
373
|
if (row.expires_at && Date.now() > row.expires_at) {
|
|
1411
374
|
this.db.prepare('DELETE FROM kv_store WHERE key = ? AND namespace = ?').run(key, namespace);
|
|
1412
375
|
return undefined;
|
|
1413
376
|
}
|
|
1414
|
-
return
|
|
377
|
+
return safeJsonParse(row.value);
|
|
1415
378
|
}
|
|
1416
|
-
/**
|
|
1417
|
-
* Delete a key
|
|
1418
|
-
*/
|
|
1419
379
|
async kvDelete(key, namespace = 'default') {
|
|
1420
380
|
this.ensureInitialized();
|
|
1421
381
|
const result = this.db.prepare('DELETE FROM kv_store WHERE key = ? AND namespace = ?').run(key, namespace);
|
|
1422
382
|
return result.changes > 0;
|
|
1423
383
|
}
|
|
1424
|
-
/**
|
|
1425
|
-
* Check if key exists
|
|
1426
|
-
*/
|
|
1427
384
|
async kvExists(key, namespace = 'default') {
|
|
1428
385
|
this.ensureInitialized();
|
|
1429
386
|
const row = this.db.prepare(`
|
|
@@ -1432,9 +389,6 @@ export class UnifiedMemoryManager {
|
|
|
1432
389
|
`).get(key, namespace, Date.now());
|
|
1433
390
|
return row !== undefined;
|
|
1434
391
|
}
|
|
1435
|
-
/**
|
|
1436
|
-
* Search keys by pattern
|
|
1437
|
-
*/
|
|
1438
392
|
async kvSearch(pattern, namespace = 'default', limit = 100) {
|
|
1439
393
|
this.ensureInitialized();
|
|
1440
394
|
const sqlPattern = pattern.replace(/\*/g, '%').replace(/\?/g, '_');
|
|
@@ -1446,20 +400,14 @@ export class UnifiedMemoryManager {
|
|
|
1446
400
|
`).all(namespace, sqlPattern, Date.now(), limit);
|
|
1447
401
|
return rows.map(r => r.key);
|
|
1448
402
|
}
|
|
1449
|
-
/**
|
|
1450
|
-
* Cleanup expired entries
|
|
1451
|
-
*/
|
|
1452
403
|
async kvCleanupExpired() {
|
|
1453
404
|
this.ensureInitialized();
|
|
1454
405
|
const result = this.db.prepare('DELETE FROM kv_store WHERE expires_at IS NOT NULL AND expires_at < ?').run(Date.now());
|
|
1455
406
|
return result.changes;
|
|
1456
407
|
}
|
|
1457
408
|
// ============================================================================
|
|
1458
|
-
// Vector Operations
|
|
409
|
+
// Vector Operations
|
|
1459
410
|
// ============================================================================
|
|
1460
|
-
/**
|
|
1461
|
-
* Store a vector embedding
|
|
1462
|
-
*/
|
|
1463
411
|
async vectorStore(id, embedding, namespace = 'default', metadata) {
|
|
1464
412
|
this.ensureInitialized();
|
|
1465
413
|
const buffer = this.floatArrayToBuffer(embedding);
|
|
@@ -1468,12 +416,8 @@ export class UnifiedMemoryManager {
|
|
|
1468
416
|
INSERT OR REPLACE INTO vectors (id, namespace, embedding, dimensions, metadata, updated_at)
|
|
1469
417
|
VALUES (?, ?, ?, ?, ?, datetime('now'))
|
|
1470
418
|
`).run(id, namespace, buffer, embedding.length, metadataJson);
|
|
1471
|
-
// Update in-memory index
|
|
1472
419
|
this.vectorIndex.add(id, embedding);
|
|
1473
420
|
}
|
|
1474
|
-
/**
|
|
1475
|
-
* Get a vector by ID
|
|
1476
|
-
*/
|
|
1477
421
|
async vectorGet(id) {
|
|
1478
422
|
this.ensureInitialized();
|
|
1479
423
|
const row = this.db.prepare(`
|
|
@@ -1483,33 +427,23 @@ export class UnifiedMemoryManager {
|
|
|
1483
427
|
return undefined;
|
|
1484
428
|
return {
|
|
1485
429
|
embedding: this.bufferToFloatArray(row.embedding, row.dimensions),
|
|
1486
|
-
metadata: row.metadata ?
|
|
430
|
+
metadata: row.metadata ? safeJsonParse(row.metadata) : undefined,
|
|
1487
431
|
};
|
|
1488
432
|
}
|
|
1489
|
-
/**
|
|
1490
|
-
* Delete a vector
|
|
1491
|
-
*/
|
|
1492
433
|
async vectorDelete(id) {
|
|
1493
434
|
this.ensureInitialized();
|
|
1494
435
|
const result = this.db.prepare('DELETE FROM vectors WHERE id = ?').run(id);
|
|
1495
436
|
this.vectorIndex.remove(id);
|
|
1496
437
|
return result.changes > 0;
|
|
1497
438
|
}
|
|
1498
|
-
/**
|
|
1499
|
-
* Search for similar vectors.
|
|
1500
|
-
* Uses batch SQL query instead of N+1 individual queries for metadata enrichment.
|
|
1501
|
-
*/
|
|
1502
439
|
async vectorSearch(query, k = 10, namespace) {
|
|
1503
440
|
this.ensureInitialized();
|
|
1504
|
-
// Lazy-load vectors on first search (deferred from startup for fast init)
|
|
1505
441
|
if (!this.vectorsLoaded) {
|
|
1506
442
|
await this.loadVectorIndex();
|
|
1507
443
|
}
|
|
1508
|
-
|
|
1509
|
-
const results = this.vectorIndex.search(query, k * 2); // Get extra for namespace filtering
|
|
444
|
+
const results = this.vectorIndex.search(query, k * 2);
|
|
1510
445
|
if (results.length === 0)
|
|
1511
446
|
return [];
|
|
1512
|
-
// Batch fetch metadata for all result IDs in a single query (fixes N+1)
|
|
1513
447
|
const ids = results.map(r => r.id);
|
|
1514
448
|
const placeholders = ids.map(() => '?').join(',');
|
|
1515
449
|
const rows = this.db.prepare(`SELECT id, namespace, metadata FROM vectors WHERE id IN (${placeholders})`).all(...ids);
|
|
@@ -1520,9 +454,8 @@ export class UnifiedMemoryManager {
|
|
|
1520
454
|
const row = metadataMap.get(result.id);
|
|
1521
455
|
if (row && row.namespace === namespace) {
|
|
1522
456
|
filteredResults.push({
|
|
1523
|
-
id: result.id,
|
|
1524
|
-
|
|
1525
|
-
metadata: row.metadata ? JSON.parse(row.metadata) : undefined,
|
|
457
|
+
id: result.id, score: result.score,
|
|
458
|
+
metadata: row.metadata ? safeJsonParse(row.metadata) : undefined,
|
|
1526
459
|
});
|
|
1527
460
|
if (filteredResults.length >= k)
|
|
1528
461
|
break;
|
|
@@ -1530,19 +463,14 @@ export class UnifiedMemoryManager {
|
|
|
1530
463
|
}
|
|
1531
464
|
return filteredResults;
|
|
1532
465
|
}
|
|
1533
|
-
// No namespace filter, just enrich with metadata
|
|
1534
466
|
return results.slice(0, k).map(result => {
|
|
1535
467
|
const row = metadataMap.get(result.id);
|
|
1536
468
|
return {
|
|
1537
|
-
id: result.id,
|
|
1538
|
-
|
|
1539
|
-
metadata: row?.metadata ? JSON.parse(row.metadata) : undefined,
|
|
469
|
+
id: result.id, score: result.score,
|
|
470
|
+
metadata: row?.metadata ? safeJsonParse(row.metadata) : undefined,
|
|
1540
471
|
};
|
|
1541
472
|
});
|
|
1542
473
|
}
|
|
1543
|
-
/**
|
|
1544
|
-
* Get vector count
|
|
1545
|
-
*/
|
|
1546
474
|
async vectorCount(namespace) {
|
|
1547
475
|
this.ensureInitialized();
|
|
1548
476
|
if (namespace) {
|
|
@@ -1553,14 +481,8 @@ export class UnifiedMemoryManager {
|
|
|
1553
481
|
return row.count;
|
|
1554
482
|
}
|
|
1555
483
|
// ============================================================================
|
|
1556
|
-
// CRDT Operations
|
|
484
|
+
// CRDT Operations
|
|
1557
485
|
// ============================================================================
|
|
1558
|
-
/**
|
|
1559
|
-
* Initialize CRDT store for distributed state synchronization.
|
|
1560
|
-
* Call this with a unique node ID for each agent/node in the cluster.
|
|
1561
|
-
*
|
|
1562
|
-
* @param nodeId - Unique identifier for this node (e.g., 'agent-001', 'mcp-server-1')
|
|
1563
|
-
*/
|
|
1564
486
|
initializeCRDT(nodeId) {
|
|
1565
487
|
if (this.crdtStore) {
|
|
1566
488
|
console.warn('[UnifiedMemory] CRDT store already initialized');
|
|
@@ -1569,182 +491,84 @@ export class UnifiedMemoryManager {
|
|
|
1569
491
|
this.crdtStore = createCRDTStore({ nodeId });
|
|
1570
492
|
console.log(`[UnifiedMemory] CRDT store initialized for node: ${nodeId}`);
|
|
1571
493
|
}
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
* Returns null if CRDT has not been initialized.
|
|
1575
|
-
*/
|
|
1576
|
-
getCRDTStore() {
|
|
1577
|
-
return this.crdtStore;
|
|
1578
|
-
}
|
|
1579
|
-
/**
|
|
1580
|
-
* Check if CRDT is initialized
|
|
1581
|
-
*/
|
|
1582
|
-
isCRDTInitialized() {
|
|
1583
|
-
return this.crdtStore !== null;
|
|
1584
|
-
}
|
|
1585
|
-
/**
|
|
1586
|
-
* Set a value in both CRDT store and KV store for durability.
|
|
1587
|
-
* The CRDT store provides conflict-free merge semantics,
|
|
1588
|
-
* while the KV store provides persistence.
|
|
1589
|
-
*
|
|
1590
|
-
* @param key - Key to store
|
|
1591
|
-
* @param value - Value to store
|
|
1592
|
-
* @param namespace - Optional namespace (default: 'crdt')
|
|
1593
|
-
*/
|
|
494
|
+
getCRDTStore() { return this.crdtStore; }
|
|
495
|
+
isCRDTInitialized() { return this.crdtStore !== null; }
|
|
1594
496
|
async crdtSet(key, value, namespace = 'crdt') {
|
|
1595
497
|
this.ensureInitialized();
|
|
1596
|
-
|
|
1597
|
-
if (this.crdtStore) {
|
|
498
|
+
if (this.crdtStore)
|
|
1598
499
|
this.crdtStore.setRegister(key, value);
|
|
1599
|
-
}
|
|
1600
|
-
// Persist to KV store
|
|
1601
500
|
await this.kvSet(key, value, namespace);
|
|
1602
501
|
}
|
|
1603
|
-
/**
|
|
1604
|
-
* Get a value from CRDT store (or fallback to KV store)
|
|
1605
|
-
*
|
|
1606
|
-
* @param key - Key to retrieve
|
|
1607
|
-
* @param namespace - Optional namespace (default: 'crdt')
|
|
1608
|
-
*/
|
|
1609
502
|
async crdtGet(key, namespace = 'crdt') {
|
|
1610
|
-
// Try CRDT store first (has latest merged state)
|
|
1611
503
|
if (this.crdtStore) {
|
|
1612
504
|
const register = this.crdtStore.getRegister(key);
|
|
1613
|
-
if (register)
|
|
505
|
+
if (register)
|
|
1614
506
|
return register.get();
|
|
1615
|
-
}
|
|
1616
507
|
}
|
|
1617
|
-
// Fallback to KV store
|
|
1618
508
|
return this.kvGet(key, namespace);
|
|
1619
509
|
}
|
|
1620
|
-
/**
|
|
1621
|
-
* Increment a distributed counter (CRDT G-Counter)
|
|
1622
|
-
*
|
|
1623
|
-
* @param key - Counter key
|
|
1624
|
-
* @param amount - Amount to increment (default: 1)
|
|
1625
|
-
*/
|
|
1626
510
|
crdtIncrement(key, amount = 1) {
|
|
1627
|
-
if (!this.crdtStore)
|
|
511
|
+
if (!this.crdtStore)
|
|
1628
512
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1629
|
-
}
|
|
1630
|
-
// Get or create counter
|
|
1631
513
|
let counter = this.crdtStore.getCounter(key);
|
|
1632
514
|
if (!counter) {
|
|
1633
|
-
this.crdtStore.incrementCounter(key, 0);
|
|
515
|
+
this.crdtStore.incrementCounter(key, 0);
|
|
1634
516
|
counter = this.crdtStore.getCounter(key);
|
|
1635
517
|
}
|
|
1636
|
-
|
|
1637
|
-
for (let i = 0; i < amount; i++) {
|
|
518
|
+
for (let i = 0; i < amount; i++)
|
|
1638
519
|
this.crdtStore.incrementCounter(key);
|
|
1639
|
-
}
|
|
1640
520
|
}
|
|
1641
|
-
/**
|
|
1642
|
-
* Get distributed counter value
|
|
1643
|
-
*
|
|
1644
|
-
* @param key - Counter key
|
|
1645
|
-
*/
|
|
1646
521
|
crdtGetCounter(key) {
|
|
1647
|
-
if (!this.crdtStore)
|
|
522
|
+
if (!this.crdtStore)
|
|
1648
523
|
return 0;
|
|
1649
|
-
}
|
|
1650
524
|
const counter = this.crdtStore.getCounter(key);
|
|
1651
525
|
return counter?.get() ?? 0;
|
|
1652
526
|
}
|
|
1653
|
-
/**
|
|
1654
|
-
* Add item to distributed set (CRDT OR-Set)
|
|
1655
|
-
*
|
|
1656
|
-
* @param key - Set key
|
|
1657
|
-
* @param item - Item to add
|
|
1658
|
-
*/
|
|
1659
527
|
crdtAddToSet(key, item) {
|
|
1660
|
-
if (!this.crdtStore)
|
|
528
|
+
if (!this.crdtStore)
|
|
1661
529
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1662
|
-
}
|
|
1663
530
|
this.crdtStore.addToSet(key, item);
|
|
1664
531
|
}
|
|
1665
|
-
/**
|
|
1666
|
-
* Remove item from distributed set
|
|
1667
|
-
*
|
|
1668
|
-
* @param key - Set key
|
|
1669
|
-
* @param item - Item to remove
|
|
1670
|
-
*/
|
|
1671
532
|
crdtRemoveFromSet(key, item) {
|
|
1672
|
-
if (!this.crdtStore)
|
|
533
|
+
if (!this.crdtStore)
|
|
1673
534
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1674
|
-
}
|
|
1675
535
|
this.crdtStore.removeFromSet(key, item);
|
|
1676
536
|
}
|
|
1677
|
-
/**
|
|
1678
|
-
* Get all items from distributed set
|
|
1679
|
-
*
|
|
1680
|
-
* @param key - Set key
|
|
1681
|
-
*/
|
|
1682
537
|
crdtGetSet(key) {
|
|
1683
|
-
if (!this.crdtStore)
|
|
538
|
+
if (!this.crdtStore)
|
|
1684
539
|
return new Set();
|
|
1685
|
-
}
|
|
1686
540
|
const orSet = this.crdtStore.getSet(key);
|
|
1687
|
-
// ORSet.values() returns T[], convert to Set<T>
|
|
1688
541
|
return new Set(orSet.values());
|
|
1689
542
|
}
|
|
1690
|
-
/**
|
|
1691
|
-
* Get the current CRDT state for replication
|
|
1692
|
-
*/
|
|
1693
543
|
crdtGetState() {
|
|
1694
|
-
if (!this.crdtStore)
|
|
544
|
+
if (!this.crdtStore)
|
|
1695
545
|
return null;
|
|
1696
|
-
}
|
|
1697
546
|
return this.crdtStore.getState();
|
|
1698
547
|
}
|
|
1699
|
-
/**
|
|
1700
|
-
* Get a delta of changes since a given version
|
|
1701
|
-
*/
|
|
1702
548
|
crdtGetDelta(sinceVersion) {
|
|
1703
|
-
if (!this.crdtStore)
|
|
549
|
+
if (!this.crdtStore)
|
|
1704
550
|
return null;
|
|
1705
|
-
}
|
|
1706
551
|
return this.crdtStore.getDelta(sinceVersion ?? 0);
|
|
1707
552
|
}
|
|
1708
|
-
/**
|
|
1709
|
-
* Merge remote CRDT state into local store.
|
|
1710
|
-
* This operation is commutative, associative, and idempotent.
|
|
1711
|
-
*
|
|
1712
|
-
* @param remoteState - State from another node
|
|
1713
|
-
*/
|
|
1714
553
|
crdtMerge(remoteState) {
|
|
1715
|
-
if (!this.crdtStore)
|
|
554
|
+
if (!this.crdtStore)
|
|
1716
555
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1717
|
-
}
|
|
1718
556
|
this.crdtStore.applyState(remoteState);
|
|
1719
557
|
}
|
|
1720
|
-
/**
|
|
1721
|
-
* Apply a delta from another node
|
|
1722
|
-
*
|
|
1723
|
-
* @param delta - Delta changes from another node
|
|
1724
|
-
*/
|
|
1725
558
|
crdtApplyDelta(delta) {
|
|
1726
|
-
if (!this.crdtStore)
|
|
559
|
+
if (!this.crdtStore)
|
|
1727
560
|
throw new Error('CRDT store not initialized. Call initializeCRDT first.');
|
|
1728
|
-
}
|
|
1729
561
|
this.crdtStore.applyDelta(delta);
|
|
1730
562
|
}
|
|
1731
|
-
/**
|
|
1732
|
-
* Persist current CRDT state to KV store for recovery
|
|
1733
|
-
*/
|
|
1734
563
|
async crdtPersist() {
|
|
1735
|
-
if (!this.crdtStore)
|
|
564
|
+
if (!this.crdtStore)
|
|
1736
565
|
return;
|
|
1737
|
-
}
|
|
1738
566
|
const state = this.crdtStore.getState();
|
|
1739
567
|
await this.kvSet('__crdt_state__', state, 'crdt-internal');
|
|
1740
568
|
}
|
|
1741
|
-
/**
|
|
1742
|
-
* Restore CRDT state from KV store
|
|
1743
|
-
*/
|
|
1744
569
|
async crdtRestore() {
|
|
1745
|
-
if (!this.crdtStore)
|
|
570
|
+
if (!this.crdtStore)
|
|
1746
571
|
return false;
|
|
1747
|
-
}
|
|
1748
572
|
const state = await this.kvGet('__crdt_state__', 'crdt-internal');
|
|
1749
573
|
if (state) {
|
|
1750
574
|
this.crdtStore.applyState(state);
|
|
@@ -1753,32 +577,15 @@ export class UnifiedMemoryManager {
|
|
|
1753
577
|
return false;
|
|
1754
578
|
}
|
|
1755
579
|
// ============================================================================
|
|
1756
|
-
// Raw Database Access
|
|
580
|
+
// Raw Database Access
|
|
1757
581
|
// ============================================================================
|
|
1758
|
-
/**
|
|
1759
|
-
* Get the raw database connection
|
|
1760
|
-
*/
|
|
1761
582
|
getDatabase() {
|
|
1762
|
-
if (!this.db || !this.initialized)
|
|
583
|
+
if (!this.db || !this.initialized)
|
|
1763
584
|
throw new Error('UnifiedMemoryManager not initialized');
|
|
1764
|
-
}
|
|
1765
585
|
return this.db;
|
|
1766
586
|
}
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
*/
|
|
1770
|
-
isInitialized() {
|
|
1771
|
-
return this.initialized;
|
|
1772
|
-
}
|
|
1773
|
-
/**
|
|
1774
|
-
* Get the database path
|
|
1775
|
-
*/
|
|
1776
|
-
getDbPath() {
|
|
1777
|
-
return this.config.dbPath;
|
|
1778
|
-
}
|
|
1779
|
-
/**
|
|
1780
|
-
* Prepare and cache a statement
|
|
1781
|
-
*/
|
|
587
|
+
isInitialized() { return this.initialized; }
|
|
588
|
+
getDbPath() { return this.config.dbPath; }
|
|
1782
589
|
prepare(name, sql) {
|
|
1783
590
|
if (!this.db)
|
|
1784
591
|
throw new Error('Database not initialized');
|
|
@@ -1789,104 +596,48 @@ export class UnifiedMemoryManager {
|
|
|
1789
596
|
}
|
|
1790
597
|
return stmt;
|
|
1791
598
|
}
|
|
1792
|
-
/**
|
|
1793
|
-
* Execute a transaction
|
|
1794
|
-
*/
|
|
1795
599
|
transaction(fn) {
|
|
1796
600
|
if (!this.db)
|
|
1797
601
|
throw new Error('Database not initialized');
|
|
1798
602
|
return this.db.transaction(fn)();
|
|
1799
603
|
}
|
|
1800
|
-
/**
|
|
1801
|
-
* Get database statistics
|
|
1802
|
-
*/
|
|
1803
604
|
getStats() {
|
|
1804
605
|
if (!this.db)
|
|
1805
606
|
throw new Error('Database not initialized');
|
|
1806
|
-
const
|
|
1807
|
-
'kv_store',
|
|
1808
|
-
'vectors',
|
|
1809
|
-
'rl_q_values',
|
|
1810
|
-
'goap_actions',
|
|
1811
|
-
'goap_goals',
|
|
1812
|
-
'goap_plans',
|
|
1813
|
-
'goap_execution_steps',
|
|
1814
|
-
'goap_plan_signatures',
|
|
1815
|
-
'concept_nodes',
|
|
1816
|
-
'concept_edges',
|
|
1817
|
-
'dream_cycles',
|
|
1818
|
-
'dream_insights',
|
|
1819
|
-
// v4: QE Patterns tables (ADR-046)
|
|
1820
|
-
'qe_patterns',
|
|
1821
|
-
'qe_pattern_embeddings',
|
|
1822
|
-
'qe_pattern_usage',
|
|
1823
|
-
'qe_trajectories',
|
|
1824
|
-
'embeddings',
|
|
1825
|
-
'execution_results',
|
|
1826
|
-
'executed_steps',
|
|
1827
|
-
// v5: MinCut tables (ADR-047)
|
|
1828
|
-
'mincut_snapshots',
|
|
1829
|
-
'mincut_history',
|
|
1830
|
-
'mincut_weak_vertices',
|
|
1831
|
-
'mincut_alerts',
|
|
1832
|
-
'mincut_healing_actions',
|
|
1833
|
-
'mincut_observations',
|
|
1834
|
-
// v6: Hypergraph tables (Neural Backbone)
|
|
1835
|
-
'hypergraph_nodes',
|
|
1836
|
-
'hypergraph_edges',
|
|
1837
|
-
// v7: SONA Patterns table (Neural Backbone)
|
|
1838
|
-
'sona_patterns',
|
|
1839
|
-
];
|
|
1840
|
-
const tableStats = tables.map(name => {
|
|
607
|
+
const tableStats = STATS_TABLES.map(name => {
|
|
1841
608
|
try {
|
|
1842
609
|
const row = this.db.prepare(`SELECT COUNT(*) as count FROM ${name}`).get();
|
|
1843
610
|
return { name, rowCount: row.count };
|
|
1844
611
|
}
|
|
1845
|
-
catch {
|
|
612
|
+
catch (e) {
|
|
613
|
+
logger.debug('Table row count query failed', { table: name, error: e instanceof Error ? e.message : String(e) });
|
|
1846
614
|
return { name, rowCount: 0 };
|
|
1847
615
|
}
|
|
1848
616
|
});
|
|
1849
617
|
let fileSize = 0;
|
|
1850
618
|
let walSize = 0;
|
|
1851
619
|
try {
|
|
1852
|
-
if (fs.existsSync(this.config.dbPath))
|
|
620
|
+
if (fs.existsSync(this.config.dbPath))
|
|
1853
621
|
fileSize = fs.statSync(this.config.dbPath).size;
|
|
1854
|
-
}
|
|
1855
622
|
const walPath = this.config.dbPath + '-wal';
|
|
1856
|
-
if (fs.existsSync(walPath))
|
|
623
|
+
if (fs.existsSync(walPath))
|
|
1857
624
|
walSize = fs.statSync(walPath).size;
|
|
1858
|
-
}
|
|
1859
625
|
}
|
|
1860
626
|
catch (error) {
|
|
1861
|
-
// Non-critical: file stat errors during storage stats
|
|
1862
627
|
console.debug('[UnifiedMemory] File stat error:', error instanceof Error ? error.message : error);
|
|
1863
628
|
}
|
|
1864
|
-
return {
|
|
1865
|
-
tables: tableStats,
|
|
1866
|
-
fileSize,
|
|
1867
|
-
walSize,
|
|
1868
|
-
vectorIndexSize: this.vectorIndex.size(),
|
|
1869
|
-
};
|
|
629
|
+
return { tables: tableStats, fileSize, walSize, vectorIndexSize: this.vectorIndex.size() };
|
|
1870
630
|
}
|
|
1871
|
-
/**
|
|
1872
|
-
* Vacuum the database
|
|
1873
|
-
*/
|
|
1874
631
|
vacuum() {
|
|
1875
632
|
if (!this.db)
|
|
1876
633
|
throw new Error('Database not initialized');
|
|
1877
634
|
this.db.exec('VACUUM');
|
|
1878
635
|
}
|
|
1879
|
-
/**
|
|
1880
|
-
* Checkpoint WAL
|
|
1881
|
-
*/
|
|
1882
636
|
checkpoint() {
|
|
1883
637
|
if (!this.db)
|
|
1884
638
|
throw new Error('Database not initialized');
|
|
1885
639
|
this.db.pragma('wal_checkpoint(TRUNCATE)');
|
|
1886
640
|
}
|
|
1887
|
-
/**
|
|
1888
|
-
* Close the database connection
|
|
1889
|
-
*/
|
|
1890
641
|
close() {
|
|
1891
642
|
if (this.db) {
|
|
1892
643
|
this.preparedStatements.clear();
|
|
@@ -1907,44 +658,31 @@ export class UnifiedMemoryManager {
|
|
|
1907
658
|
}
|
|
1908
659
|
floatArrayToBuffer(arr) {
|
|
1909
660
|
const buffer = Buffer.alloc(arr.length * 4);
|
|
1910
|
-
for (let i = 0; i < arr.length; i++)
|
|
661
|
+
for (let i = 0; i < arr.length; i++)
|
|
1911
662
|
buffer.writeFloatLE(arr[i], i * 4);
|
|
1912
|
-
}
|
|
1913
663
|
return buffer;
|
|
1914
664
|
}
|
|
1915
665
|
bufferToFloatArray(buffer, dimensions) {
|
|
1916
|
-
const
|
|
1917
|
-
|
|
1918
|
-
arr.push(buffer.readFloatLE(i * 4));
|
|
1919
|
-
}
|
|
1920
|
-
return arr;
|
|
666
|
+
const f32 = new Float32Array(buffer.buffer, buffer.byteOffset, dimensions);
|
|
667
|
+
return Array.from(f32);
|
|
1921
668
|
}
|
|
1922
669
|
}
|
|
1923
670
|
// ============================================================================
|
|
1924
671
|
// Convenience Functions
|
|
1925
672
|
// ============================================================================
|
|
1926
|
-
/**
|
|
1927
|
-
* Get the shared unified memory manager instance
|
|
1928
|
-
*/
|
|
1929
673
|
export function getUnifiedMemory(config) {
|
|
1930
674
|
return UnifiedMemoryManager.getInstance(config);
|
|
1931
675
|
}
|
|
1932
|
-
/**
|
|
1933
|
-
* Initialize the shared unified memory manager
|
|
1934
|
-
*/
|
|
1935
676
|
export async function initializeUnifiedMemory(config) {
|
|
1936
677
|
const manager = getUnifiedMemory(config);
|
|
1937
678
|
await manager.initialize();
|
|
1938
679
|
return manager;
|
|
1939
680
|
}
|
|
1940
|
-
/**
|
|
1941
|
-
* Reset the shared unified memory manager (for testing)
|
|
1942
|
-
*/
|
|
1943
681
|
export function resetUnifiedMemory() {
|
|
1944
682
|
UnifiedMemoryManager.resetInstance();
|
|
1945
683
|
}
|
|
1946
684
|
// ============================================================================
|
|
1947
|
-
// Process Exit Handlers
|
|
685
|
+
// Process Exit Handlers
|
|
1948
686
|
// ============================================================================
|
|
1949
687
|
let exitHandlersRegistered = false;
|
|
1950
688
|
function registerExitHandlers() {
|
|
@@ -1954,25 +692,16 @@ function registerExitHandlers() {
|
|
|
1954
692
|
const cleanup = () => {
|
|
1955
693
|
try {
|
|
1956
694
|
const instance = UnifiedMemoryManager['instance'];
|
|
1957
|
-
if (instance)
|
|
695
|
+
if (instance)
|
|
1958
696
|
instance.close();
|
|
1959
|
-
}
|
|
1960
697
|
}
|
|
1961
698
|
catch (error) {
|
|
1962
|
-
// Non-critical: cleanup errors during shutdown
|
|
1963
699
|
console.debug('[UnifiedMemory] Cleanup error:', error instanceof Error ? error.message : error);
|
|
1964
700
|
}
|
|
1965
701
|
};
|
|
1966
702
|
process.on('beforeExit', cleanup);
|
|
1967
|
-
process.on('SIGINT', () => {
|
|
1968
|
-
|
|
1969
|
-
process.exit(0);
|
|
1970
|
-
});
|
|
1971
|
-
process.on('SIGTERM', () => {
|
|
1972
|
-
cleanup();
|
|
1973
|
-
process.exit(0);
|
|
1974
|
-
});
|
|
703
|
+
process.on('SIGINT', () => { cleanup(); process.exit(0); });
|
|
704
|
+
process.on('SIGTERM', () => { cleanup(); process.exit(0); });
|
|
1975
705
|
}
|
|
1976
|
-
// Register exit handlers when module is loaded
|
|
1977
706
|
registerExitHandlers();
|
|
1978
707
|
//# sourceMappingURL=unified-memory.js.map
|