agentic-qe 3.2.3 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/v3/qe-accessibility-auditor.md +90 -0
- package/README.md +43 -5
- package/package.json +3 -2
- package/scripts/cloud-db-config.json +37 -0
- package/scripts/cloud-db-connect.sh +37 -0
- package/scripts/cloud-db-tunnel.sh +23 -0
- package/v3/CHANGELOG.md +165 -0
- package/v3/README.md +59 -1
- package/v3/assets/agents/v3/qe-accessibility-auditor.md +90 -0
- package/v3/dist/adapters/claude-flow/index.d.ts +54 -0
- package/v3/dist/adapters/claude-flow/index.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/index.js +79 -0
- package/v3/dist/adapters/claude-flow/index.js.map +1 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.d.ts +70 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.js +203 -0
- package/v3/dist/adapters/claude-flow/model-router-bridge.js.map +1 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.d.ts +73 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.js +276 -0
- package/v3/dist/adapters/claude-flow/pretrain-bridge.js.map +1 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.d.ts +70 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.js +205 -0
- package/v3/dist/adapters/claude-flow/trajectory-bridge.js.map +1 -0
- package/v3/dist/adapters/claude-flow/types.d.ts +99 -0
- package/v3/dist/adapters/claude-flow/types.d.ts.map +1 -0
- package/v3/dist/adapters/claude-flow/types.js +6 -0
- package/v3/dist/adapters/claude-flow/types.js.map +1 -0
- package/v3/dist/causal-discovery/causal-graph.d.ts +80 -1
- package/v3/dist/causal-discovery/causal-graph.d.ts.map +1 -1
- package/v3/dist/causal-discovery/causal-graph.js +111 -1
- package/v3/dist/causal-discovery/causal-graph.js.map +1 -1
- package/v3/dist/cli/bundle.js +11612 -4929
- package/v3/dist/cli/commands/claude-flow-setup.d.ts +82 -0
- package/v3/dist/cli/commands/claude-flow-setup.d.ts.map +1 -0
- package/v3/dist/cli/commands/claude-flow-setup.js +334 -0
- package/v3/dist/cli/commands/claude-flow-setup.js.map +1 -0
- package/v3/dist/cli/commands/hooks.d.ts +2 -0
- package/v3/dist/cli/commands/hooks.d.ts.map +1 -1
- package/v3/dist/cli/commands/hooks.js +13 -2
- package/v3/dist/cli/commands/hooks.js.map +1 -1
- package/v3/dist/cli/commands/init.d.ts +19 -0
- package/v3/dist/cli/commands/init.d.ts.map +1 -0
- package/v3/dist/cli/commands/init.js +345 -0
- package/v3/dist/cli/commands/init.js.map +1 -0
- package/v3/dist/cli/index.js +110 -2
- package/v3/dist/cli/index.js.map +1 -1
- package/v3/dist/coordination/mincut/interfaces.d.ts +8 -2
- package/v3/dist/coordination/mincut/interfaces.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/interfaces.js.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts +5 -0
- package/v3/dist/coordination/mincut/mincut-health-monitor.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/mincut-health-monitor.js +22 -4
- package/v3/dist/coordination/mincut/mincut-health-monitor.js.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.d.ts +4 -0
- package/v3/dist/coordination/mincut/queen-integration.d.ts.map +1 -1
- package/v3/dist/coordination/mincut/queen-integration.js +14 -1
- package/v3/dist/coordination/mincut/queen-integration.js.map +1 -1
- package/v3/dist/coordination/queen-coordinator.d.ts +5 -0
- package/v3/dist/coordination/queen-coordinator.d.ts.map +1 -1
- package/v3/dist/coordination/queen-coordinator.js +45 -7
- package/v3/dist/coordination/queen-coordinator.js.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.d.ts +5 -0
- package/v3/dist/domains/learning-optimization/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.js +79 -0
- package/v3/dist/domains/learning-optimization/coordinator.js.map +1 -1
- package/v3/dist/domains/test-generation/coherence-gate.d.ts +245 -0
- package/v3/dist/domains/test-generation/coherence-gate.d.ts.map +1 -0
- package/v3/dist/domains/test-generation/coherence-gate.js +454 -0
- package/v3/dist/domains/test-generation/coherence-gate.js.map +1 -0
- package/v3/dist/domains/test-generation/coordinator.d.ts +32 -1
- package/v3/dist/domains/test-generation/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.js +70 -1
- package/v3/dist/domains/test-generation/coordinator.js.map +1 -1
- package/v3/dist/domains/test-generation/index.d.ts +1 -0
- package/v3/dist/domains/test-generation/index.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/index.js +4 -0
- package/v3/dist/domains/test-generation/index.js.map +1 -1
- package/v3/dist/domains/test-generation/services/index.d.ts +1 -0
- package/v3/dist/domains/test-generation/services/index.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/index.js +2 -0
- package/v3/dist/domains/test-generation/services/index.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/index.d.ts +2 -1
- package/v3/dist/domains/visual-accessibility/index.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/index.js +1 -0
- package/v3/dist/domains/visual-accessibility/index.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/interfaces.d.ts +131 -0
- package/v3/dist/domains/visual-accessibility/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.d.ts +26 -0
- package/v3/dist/domains/visual-accessibility/plugin.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.js +151 -0
- package/v3/dist/domains/visual-accessibility/plugin.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +42 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.js +69 -0
- package/v3/dist/domains/visual-accessibility/services/accessibility-tester.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.d.ts +138 -0
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.d.ts.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.js +830 -0
- package/v3/dist/domains/visual-accessibility/services/eu-compliance.js.map +1 -0
- package/v3/dist/domains/visual-accessibility/services/index.d.ts +1 -0
- package/v3/dist/domains/visual-accessibility/services/index.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/index.js +1 -0
- package/v3/dist/domains/visual-accessibility/services/index.js.map +1 -1
- package/v3/dist/init/enhancements/claude-flow-adapter.d.ts +84 -0
- package/v3/dist/init/enhancements/claude-flow-adapter.d.ts.map +1 -0
- package/v3/dist/init/enhancements/claude-flow-adapter.js +250 -0
- package/v3/dist/init/enhancements/claude-flow-adapter.js.map +1 -0
- package/v3/dist/init/enhancements/detector.d.ts +10 -0
- package/v3/dist/init/enhancements/detector.d.ts.map +1 -0
- package/v3/dist/init/enhancements/detector.js +87 -0
- package/v3/dist/init/enhancements/detector.js.map +1 -0
- package/v3/dist/init/enhancements/index.d.ts +13 -0
- package/v3/dist/init/enhancements/index.d.ts.map +1 -0
- package/v3/dist/init/enhancements/index.js +25 -0
- package/v3/dist/init/enhancements/index.js.map +1 -0
- package/v3/dist/init/enhancements/types.d.ts +93 -0
- package/v3/dist/init/enhancements/types.d.ts.map +1 -0
- package/v3/dist/init/enhancements/types.js +6 -0
- package/v3/dist/init/enhancements/types.js.map +1 -0
- package/v3/dist/init/index.d.ts +8 -0
- package/v3/dist/init/index.d.ts.map +1 -1
- package/v3/dist/init/index.js +4 -0
- package/v3/dist/init/index.js.map +1 -1
- package/v3/dist/init/migration/config-migrator.d.ts +31 -0
- package/v3/dist/init/migration/config-migrator.d.ts.map +1 -0
- package/v3/dist/init/migration/config-migrator.js +133 -0
- package/v3/dist/init/migration/config-migrator.js.map +1 -0
- package/v3/dist/init/migration/data-migrator.d.ts +72 -0
- package/v3/dist/init/migration/data-migrator.d.ts.map +1 -0
- package/v3/dist/init/migration/data-migrator.js +233 -0
- package/v3/dist/init/migration/data-migrator.js.map +1 -0
- package/v3/dist/init/migration/detector.d.ts +44 -0
- package/v3/dist/init/migration/detector.d.ts.map +1 -0
- package/v3/dist/init/migration/detector.js +106 -0
- package/v3/dist/init/migration/detector.js.map +1 -0
- package/v3/dist/init/migration/index.d.ts +8 -0
- package/v3/dist/init/migration/index.d.ts.map +1 -0
- package/v3/dist/init/migration/index.js +8 -0
- package/v3/dist/init/migration/index.js.map +1 -0
- package/v3/dist/init/orchestrator.d.ts +68 -0
- package/v3/dist/init/orchestrator.d.ts.map +1 -0
- package/v3/dist/init/orchestrator.js +239 -0
- package/v3/dist/init/orchestrator.js.map +1 -0
- package/v3/dist/init/phases/01-detection.d.ts +30 -0
- package/v3/dist/init/phases/01-detection.d.ts.map +1 -0
- package/v3/dist/init/phases/01-detection.js +143 -0
- package/v3/dist/init/phases/01-detection.js.map +1 -0
- package/v3/dist/init/phases/02-analysis.d.ts +18 -0
- package/v3/dist/init/phases/02-analysis.d.ts.map +1 -0
- package/v3/dist/init/phases/02-analysis.js +28 -0
- package/v3/dist/init/phases/02-analysis.js.map +1 -0
- package/v3/dist/init/phases/03-configuration.d.ts +26 -0
- package/v3/dist/init/phases/03-configuration.d.ts.map +1 -0
- package/v3/dist/init/phases/03-configuration.js +98 -0
- package/v3/dist/init/phases/03-configuration.js.map +1 -0
- package/v3/dist/init/phases/04-database.d.ts +22 -0
- package/v3/dist/init/phases/04-database.d.ts.map +1 -0
- package/v3/dist/init/phases/04-database.js +88 -0
- package/v3/dist/init/phases/04-database.js.map +1 -0
- package/v3/dist/init/phases/05-learning.d.ts +28 -0
- package/v3/dist/init/phases/05-learning.d.ts.map +1 -0
- package/v3/dist/init/phases/05-learning.js +98 -0
- package/v3/dist/init/phases/05-learning.js.map +1 -0
- package/v3/dist/init/phases/06-code-intelligence.d.ts +33 -0
- package/v3/dist/init/phases/06-code-intelligence.d.ts.map +1 -0
- package/v3/dist/init/phases/06-code-intelligence.js +115 -0
- package/v3/dist/init/phases/06-code-intelligence.js.map +1 -0
- package/v3/dist/init/phases/07-hooks.d.ts +27 -0
- package/v3/dist/init/phases/07-hooks.d.ts.map +1 -0
- package/v3/dist/init/phases/07-hooks.js +209 -0
- package/v3/dist/init/phases/07-hooks.js.map +1 -0
- package/v3/dist/init/phases/08-mcp.d.ts +22 -0
- package/v3/dist/init/phases/08-mcp.d.ts.map +1 -0
- package/v3/dist/init/phases/08-mcp.js +62 -0
- package/v3/dist/init/phases/08-mcp.js.map +1 -0
- package/v3/dist/init/phases/09-assets.d.ts +23 -0
- package/v3/dist/init/phases/09-assets.d.ts.map +1 -0
- package/v3/dist/init/phases/09-assets.js +82 -0
- package/v3/dist/init/phases/09-assets.js.map +1 -0
- package/v3/dist/init/phases/10-workers.d.ts +23 -0
- package/v3/dist/init/phases/10-workers.d.ts.map +1 -0
- package/v3/dist/init/phases/10-workers.js +111 -0
- package/v3/dist/init/phases/10-workers.js.map +1 -0
- package/v3/dist/init/phases/11-claude-md.d.ts +26 -0
- package/v3/dist/init/phases/11-claude-md.d.ts.map +1 -0
- package/v3/dist/init/phases/11-claude-md.js +121 -0
- package/v3/dist/init/phases/11-claude-md.js.map +1 -0
- package/v3/dist/init/phases/12-verification.d.ts +38 -0
- package/v3/dist/init/phases/12-verification.d.ts.map +1 -0
- package/v3/dist/init/phases/12-verification.js +187 -0
- package/v3/dist/init/phases/12-verification.js.map +1 -0
- package/v3/dist/init/phases/index.d.ts +46 -0
- package/v3/dist/init/phases/index.d.ts.map +1 -0
- package/v3/dist/init/phases/index.js +64 -0
- package/v3/dist/init/phases/index.js.map +1 -0
- package/v3/dist/init/phases/phase-interface.d.ts +193 -0
- package/v3/dist/init/phases/phase-interface.d.ts.map +1 -0
- package/v3/dist/init/phases/phase-interface.js +119 -0
- package/v3/dist/init/phases/phase-interface.js.map +1 -0
- package/v3/dist/integrations/coherence/coherence-service.d.ts +323 -0
- package/v3/dist/integrations/coherence/coherence-service.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/coherence-service.js +799 -0
- package/v3/dist/integrations/coherence/coherence-service.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.d.ts +170 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.js +403 -0
- package/v3/dist/integrations/coherence/engines/category-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.d.ts +159 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.js +348 -0
- package/v3/dist/integrations/coherence/engines/causal-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.d.ts +174 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.js +401 -0
- package/v3/dist/integrations/coherence/engines/cohomology-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.d.ts +201 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.js +324 -0
- package/v3/dist/integrations/coherence/engines/homotopy-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/index.d.ts +20 -0
- package/v3/dist/integrations/coherence/engines/index.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/index.js +26 -0
- package/v3/dist/integrations/coherence/engines/index.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.d.ts +193 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js +476 -0
- package/v3/dist/integrations/coherence/engines/spectral-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.d.ts +175 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.js +377 -0
- package/v3/dist/integrations/coherence/engines/witness-adapter.js.map +1 -0
- package/v3/dist/integrations/coherence/index.d.ts +84 -0
- package/v3/dist/integrations/coherence/index.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/index.js +114 -0
- package/v3/dist/integrations/coherence/index.js.map +1 -0
- package/v3/dist/integrations/coherence/threshold-tuner.d.ts +396 -0
- package/v3/dist/integrations/coherence/threshold-tuner.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/threshold-tuner.js +538 -0
- package/v3/dist/integrations/coherence/threshold-tuner.js.map +1 -0
- package/v3/dist/integrations/coherence/types.d.ts +879 -0
- package/v3/dist/integrations/coherence/types.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/types.js +134 -0
- package/v3/dist/integrations/coherence/types.js.map +1 -0
- package/v3/dist/integrations/coherence/wasm-loader.d.ts +351 -0
- package/v3/dist/integrations/coherence/wasm-loader.d.ts.map +1 -0
- package/v3/dist/integrations/coherence/wasm-loader.js +842 -0
- package/v3/dist/integrations/coherence/wasm-loader.js.map +1 -0
- package/v3/dist/integrations/embeddings/index/HNSWIndex.d.ts.map +1 -1
- package/v3/dist/integrations/embeddings/index/HNSWIndex.js +4 -1
- package/v3/dist/integrations/embeddings/index/HNSWIndex.js.map +1 -1
- package/v3/dist/kernel/interfaces.d.ts +8 -1
- package/v3/dist/kernel/interfaces.d.ts.map +1 -1
- package/v3/dist/learning/aqe-learning-engine.d.ts +272 -0
- package/v3/dist/learning/aqe-learning-engine.d.ts.map +1 -0
- package/v3/dist/learning/aqe-learning-engine.js +708 -0
- package/v3/dist/learning/aqe-learning-engine.js.map +1 -0
- package/v3/dist/learning/causal-verifier.d.ts +244 -0
- package/v3/dist/learning/causal-verifier.d.ts.map +1 -0
- package/v3/dist/learning/causal-verifier.js +300 -0
- package/v3/dist/learning/causal-verifier.js.map +1 -0
- package/v3/dist/learning/experience-capture.d.ts +266 -0
- package/v3/dist/learning/experience-capture.d.ts.map +1 -0
- package/v3/dist/learning/experience-capture.js +647 -0
- package/v3/dist/learning/experience-capture.js.map +1 -0
- package/v3/dist/learning/index.d.ts +8 -0
- package/v3/dist/learning/index.d.ts.map +1 -1
- package/v3/dist/learning/index.js +16 -0
- package/v3/dist/learning/index.js.map +1 -1
- package/v3/dist/learning/memory-auditor.d.ts +235 -0
- package/v3/dist/learning/memory-auditor.d.ts.map +1 -0
- package/v3/dist/learning/memory-auditor.js +478 -0
- package/v3/dist/learning/memory-auditor.js.map +1 -0
- package/v3/dist/learning/pattern-store.d.ts.map +1 -1
- package/v3/dist/learning/pattern-store.js +27 -6
- package/v3/dist/learning/pattern-store.js.map +1 -1
- package/v3/dist/learning/qe-patterns.d.ts +15 -1
- package/v3/dist/learning/qe-patterns.d.ts.map +1 -1
- package/v3/dist/learning/qe-patterns.js +26 -5
- package/v3/dist/learning/qe-patterns.js.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.d.ts +38 -2
- package/v3/dist/learning/qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/qe-reasoning-bank.js +86 -4
- package/v3/dist/learning/qe-reasoning-bank.js.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts +32 -2
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.js +61 -6
- package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
- package/v3/dist/mcp/bundle.js +6303 -266
- package/v3/dist/mcp/tools/coherence/audit.d.ts +107 -0
- package/v3/dist/mcp/tools/coherence/audit.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/audit.js +236 -0
- package/v3/dist/mcp/tools/coherence/audit.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/check.d.ts +106 -0
- package/v3/dist/mcp/tools/coherence/check.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/check.js +205 -0
- package/v3/dist/mcp/tools/coherence/check.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/collapse.d.ts +123 -0
- package/v3/dist/mcp/tools/coherence/collapse.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/collapse.js +279 -0
- package/v3/dist/mcp/tools/coherence/collapse.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/consensus.d.ts +100 -0
- package/v3/dist/mcp/tools/coherence/consensus.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/consensus.js +201 -0
- package/v3/dist/mcp/tools/coherence/consensus.js.map +1 -0
- package/v3/dist/mcp/tools/coherence/index.d.ts +31 -0
- package/v3/dist/mcp/tools/coherence/index.d.ts.map +1 -0
- package/v3/dist/mcp/tools/coherence/index.js +42 -0
- package/v3/dist/mcp/tools/coherence/index.js.map +1 -0
- package/v3/dist/mcp/tools/index.d.ts +6 -1
- package/v3/dist/mcp/tools/index.d.ts.map +1 -1
- package/v3/dist/mcp/tools/index.js +9 -1
- package/v3/dist/mcp/tools/index.js.map +1 -1
- package/v3/dist/mcp/tools/mincut/index.d.ts +1 -1
- package/v3/dist/mcp/tools/mincut/index.d.ts.map +1 -1
- package/v3/dist/mcp/tools/mincut/index.js.map +1 -1
- package/v3/dist/mcp/tools/registry.d.ts +4 -0
- package/v3/dist/mcp/tools/registry.d.ts.map +1 -1
- package/v3/dist/mcp/tools/registry.js +5 -0
- package/v3/dist/mcp/tools/registry.js.map +1 -1
- package/v3/dist/mcp/types.d.ts +1 -1
- package/v3/dist/mcp/types.d.ts.map +1 -1
- package/v3/dist/strange-loop/belief-reconciler.d.ts +357 -0
- package/v3/dist/strange-loop/belief-reconciler.d.ts.map +1 -0
- package/v3/dist/strange-loop/belief-reconciler.js +696 -0
- package/v3/dist/strange-loop/belief-reconciler.js.map +1 -0
- package/v3/dist/strange-loop/index.d.ts +1 -0
- package/v3/dist/strange-loop/index.d.ts.map +1 -1
- package/v3/dist/strange-loop/index.js +2 -0
- package/v3/dist/strange-loop/index.js.map +1 -1
- package/v3/dist/strange-loop/strange-loop.d.ts +177 -5
- package/v3/dist/strange-loop/strange-loop.d.ts.map +1 -1
- package/v3/dist/strange-loop/strange-loop.js +452 -9
- package/v3/dist/strange-loop/strange-loop.js.map +1 -1
- package/v3/dist/strange-loop/types.d.ts +205 -1
- package/v3/dist/strange-loop/types.d.ts.map +1 -1
- package/v3/dist/strange-loop/types.js +5 -0
- package/v3/dist/strange-loop/types.js.map +1 -1
- package/v3/package.json +5 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Cohomology Engine Adapter
|
|
3
|
+
*
|
|
4
|
+
* Wraps the Prime Radiant CohomologyEngine for sheaf cohomology operations.
|
|
5
|
+
* Used for contradiction detection using sheaf Laplacian energy.
|
|
6
|
+
*
|
|
7
|
+
* Sheaf Laplacian Energy Formula:
|
|
8
|
+
* E(S) = sum of w_e * ||rho_u(x_u) - rho_v(x_v)||^2
|
|
9
|
+
*
|
|
10
|
+
* Where:
|
|
11
|
+
* - w_e: Edge weight (relationship importance)
|
|
12
|
+
* - rho: Restriction maps (information transformation)
|
|
13
|
+
* - x: Node states (embedded representations)
|
|
14
|
+
* - Lower energy = higher coherence
|
|
15
|
+
*
|
|
16
|
+
* @module integrations/coherence/engines/cohomology-adapter
|
|
17
|
+
*/
|
|
18
|
+
import type { CoherenceNode, CoherenceEdge, Contradiction, IWasmLoader, CoherenceLogger } from '../types';
|
|
19
|
+
/**
|
|
20
|
+
* Interface for the cohomology adapter
|
|
21
|
+
*/
|
|
22
|
+
export interface ICohomologyAdapter {
|
|
23
|
+
/** Initialize the adapter */
|
|
24
|
+
initialize(): Promise<void>;
|
|
25
|
+
/** Check if initialized */
|
|
26
|
+
isInitialized(): boolean;
|
|
27
|
+
/** Add a node to the graph */
|
|
28
|
+
addNode(node: CoherenceNode): void;
|
|
29
|
+
/** Add an edge between nodes */
|
|
30
|
+
addEdge(edge: CoherenceEdge): void;
|
|
31
|
+
/** Remove a node */
|
|
32
|
+
removeNode(nodeId: string): void;
|
|
33
|
+
/** Remove an edge */
|
|
34
|
+
removeEdge(source: string, target: string): void;
|
|
35
|
+
/** Compute sheaf Laplacian energy */
|
|
36
|
+
computeEnergy(): number;
|
|
37
|
+
/** Detect contradictions */
|
|
38
|
+
detectContradictions(threshold?: number): Contradiction[];
|
|
39
|
+
/** Clear the graph */
|
|
40
|
+
clear(): void;
|
|
41
|
+
/** Dispose of resources */
|
|
42
|
+
dispose(): void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Adapter for the Prime Radiant CohomologyEngine
|
|
46
|
+
*
|
|
47
|
+
* Provides sheaf cohomology operations for detecting contradictions
|
|
48
|
+
* in belief systems and agent states.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const adapter = new CohomologyAdapter(wasmLoader, logger);
|
|
53
|
+
* await adapter.initialize();
|
|
54
|
+
*
|
|
55
|
+
* adapter.addNode({ id: 'belief-1', embedding: [...] });
|
|
56
|
+
* adapter.addNode({ id: 'belief-2', embedding: [...] });
|
|
57
|
+
* adapter.addEdge({ source: 'belief-1', target: 'belief-2', weight: 0.8 });
|
|
58
|
+
*
|
|
59
|
+
* const energy = adapter.computeEnergy();
|
|
60
|
+
* const contradictions = adapter.detectContradictions(0.1);
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare class CohomologyAdapter implements ICohomologyAdapter {
|
|
64
|
+
private readonly wasmLoader;
|
|
65
|
+
private readonly logger;
|
|
66
|
+
private engine;
|
|
67
|
+
private initialized;
|
|
68
|
+
private readonly nodes;
|
|
69
|
+
private readonly edges;
|
|
70
|
+
/**
|
|
71
|
+
* Create a new CohomologyAdapter
|
|
72
|
+
*
|
|
73
|
+
* @param wasmLoader - WASM module loader
|
|
74
|
+
* @param logger - Optional logger for diagnostics
|
|
75
|
+
*/
|
|
76
|
+
constructor(wasmLoader: IWasmLoader, logger?: CoherenceLogger);
|
|
77
|
+
/**
|
|
78
|
+
* Initialize the adapter by loading the WASM module
|
|
79
|
+
*/
|
|
80
|
+
initialize(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Check if the adapter is initialized
|
|
83
|
+
*/
|
|
84
|
+
isInitialized(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Ensure the adapter is initialized before use
|
|
87
|
+
*/
|
|
88
|
+
private ensureInitialized;
|
|
89
|
+
/**
|
|
90
|
+
* Add a node to the coherence graph
|
|
91
|
+
*
|
|
92
|
+
* @param node - The node to add
|
|
93
|
+
*/
|
|
94
|
+
addNode(node: CoherenceNode): void;
|
|
95
|
+
/**
|
|
96
|
+
* Add an edge between two nodes
|
|
97
|
+
*
|
|
98
|
+
* @param edge - The edge to add
|
|
99
|
+
*/
|
|
100
|
+
addEdge(edge: CoherenceEdge): void;
|
|
101
|
+
/**
|
|
102
|
+
* Remove a node from the graph
|
|
103
|
+
*
|
|
104
|
+
* @param nodeId - ID of the node to remove
|
|
105
|
+
*/
|
|
106
|
+
removeNode(nodeId: string): void;
|
|
107
|
+
/**
|
|
108
|
+
* Remove an edge from the graph
|
|
109
|
+
*
|
|
110
|
+
* @param source - Source node ID
|
|
111
|
+
* @param target - Target node ID
|
|
112
|
+
*/
|
|
113
|
+
removeEdge(source: string, target: string): void;
|
|
114
|
+
/**
|
|
115
|
+
* Compute the sheaf Laplacian energy of the graph
|
|
116
|
+
*
|
|
117
|
+
* Lower energy indicates higher coherence.
|
|
118
|
+
*
|
|
119
|
+
* @returns The energy value (>= 0)
|
|
120
|
+
*/
|
|
121
|
+
computeEnergy(): number;
|
|
122
|
+
/**
|
|
123
|
+
* Detect contradictions in the graph
|
|
124
|
+
*
|
|
125
|
+
* @param threshold - Energy threshold for contradiction detection (default: 0.1)
|
|
126
|
+
* @returns List of detected contradictions
|
|
127
|
+
*/
|
|
128
|
+
detectContradictions(threshold?: number): Contradiction[];
|
|
129
|
+
/**
|
|
130
|
+
* Transform raw WASM contradiction to domain type
|
|
131
|
+
*/
|
|
132
|
+
private transformContradiction;
|
|
133
|
+
/**
|
|
134
|
+
* Map severity score to severity level
|
|
135
|
+
*/
|
|
136
|
+
private severityFromDistance;
|
|
137
|
+
/**
|
|
138
|
+
* Generate a human-readable description of the contradiction
|
|
139
|
+
*/
|
|
140
|
+
private generateContradictionDescription;
|
|
141
|
+
/**
|
|
142
|
+
* Suggest a resolution for the contradiction
|
|
143
|
+
*/
|
|
144
|
+
private suggestResolution;
|
|
145
|
+
/**
|
|
146
|
+
* Clear all nodes and edges from the graph
|
|
147
|
+
*/
|
|
148
|
+
clear(): void;
|
|
149
|
+
/**
|
|
150
|
+
* Dispose of adapter resources
|
|
151
|
+
*/
|
|
152
|
+
dispose(): void;
|
|
153
|
+
/**
|
|
154
|
+
* Get the number of nodes in the graph
|
|
155
|
+
*/
|
|
156
|
+
getNodeCount(): number;
|
|
157
|
+
/**
|
|
158
|
+
* Get the number of edges in the graph
|
|
159
|
+
*/
|
|
160
|
+
getEdgeCount(): number;
|
|
161
|
+
/**
|
|
162
|
+
* Get a node by ID
|
|
163
|
+
*/
|
|
164
|
+
getNode(nodeId: string): CoherenceNode | undefined;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Create and initialize a CohomologyAdapter
|
|
168
|
+
*
|
|
169
|
+
* @param wasmLoader - WASM module loader
|
|
170
|
+
* @param logger - Optional logger
|
|
171
|
+
* @returns Initialized adapter
|
|
172
|
+
*/
|
|
173
|
+
export declare function createCohomologyAdapter(wasmLoader: IWasmLoader, logger?: CoherenceLogger): Promise<CohomologyAdapter>;
|
|
174
|
+
//# sourceMappingURL=cohomology-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohomology-adapter.d.ts","sourceRoot":"","sources":["../../../../src/integrations/coherence/engines/cohomology-adapter.ts"],"names":[],"mappings":"AAAA;;;;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AEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAgBlC;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAgBlC;;;;OAIG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAkBhC;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAgBhD;;;;;;OAMG;IACH,aAAa,IAAI,MAAM;IAUvB;;;;;OAKG;IACH,oBAAoB,CAAC,SAAS,GAAE,MAAY,GAAG,aAAa,EAAE;IAiB9D;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAU9B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAQ5B;;OAEG;IACH,OAAO,CAAC,gCAAgC;IAWxC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,KAAK,IAAI,IAAI;IAUb;;OAEG;IACH,OAAO,IAAI,IAAI;IAYf;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;CAGnD;AAMD;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,WAAW,EACvB,MAAM,CAAC,EAAE,eAAe,GACvB,OAAO,CAAC,iBAAiB,CAAC,CAI5B"}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Cohomology Engine Adapter
|
|
3
|
+
*
|
|
4
|
+
* Wraps the Prime Radiant CohomologyEngine for sheaf cohomology operations.
|
|
5
|
+
* Used for contradiction detection using sheaf Laplacian energy.
|
|
6
|
+
*
|
|
7
|
+
* Sheaf Laplacian Energy Formula:
|
|
8
|
+
* E(S) = sum of w_e * ||rho_u(x_u) - rho_v(x_v)||^2
|
|
9
|
+
*
|
|
10
|
+
* Where:
|
|
11
|
+
* - w_e: Edge weight (relationship importance)
|
|
12
|
+
* - rho: Restriction maps (information transformation)
|
|
13
|
+
* - x: Node states (embedded representations)
|
|
14
|
+
* - Lower energy = higher coherence
|
|
15
|
+
*
|
|
16
|
+
* @module integrations/coherence/engines/cohomology-adapter
|
|
17
|
+
*/
|
|
18
|
+
import { WasmNotLoadedError, DEFAULT_COHERENCE_LOGGER } from '../types';
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// WASM Engine Wrapper
|
|
21
|
+
// ============================================================================
|
|
22
|
+
/**
|
|
23
|
+
* Creates an ICohomologyEngine wrapper around the raw WASM engine
|
|
24
|
+
* Translates from snake_case adapter interface to camelCase WASM API
|
|
25
|
+
*
|
|
26
|
+
* IMPORTANT: WASM expects numeric node IDs (usize), so we maintain
|
|
27
|
+
* a bidirectional mapping between string IDs and numeric indices.
|
|
28
|
+
*/
|
|
29
|
+
function createCohomologyEngineWrapper(rawEngine) {
|
|
30
|
+
// Internal state for graph building
|
|
31
|
+
const nodes = new Map();
|
|
32
|
+
const edges = [];
|
|
33
|
+
// Bidirectional mapping: string ID <-> numeric index
|
|
34
|
+
// WASM expects usize (unsigned integer) for node IDs
|
|
35
|
+
const stringToIndex = new Map();
|
|
36
|
+
const indexToString = new Map();
|
|
37
|
+
let nextIndex = 0;
|
|
38
|
+
// Get or create numeric index for a string ID
|
|
39
|
+
const getOrCreateIndex = (id) => {
|
|
40
|
+
let idx = stringToIndex.get(id);
|
|
41
|
+
if (idx === undefined) {
|
|
42
|
+
idx = nextIndex++;
|
|
43
|
+
stringToIndex.set(id, idx);
|
|
44
|
+
indexToString.set(idx, id);
|
|
45
|
+
}
|
|
46
|
+
return idx;
|
|
47
|
+
};
|
|
48
|
+
// Get string ID from numeric index
|
|
49
|
+
const getStringId = (idx) => {
|
|
50
|
+
return indexToString.get(idx) ?? `unknown-${idx}`;
|
|
51
|
+
};
|
|
52
|
+
// Build graph representation for WASM calls using numeric IDs
|
|
53
|
+
// WASM sheaf cohomology expects:
|
|
54
|
+
// { nodes: [{id: number, label: string, section: number[], weight: number}], edges: [...] }
|
|
55
|
+
// "section" is the sheaf theory term for local data at each stalk
|
|
56
|
+
const buildGraph = () => ({
|
|
57
|
+
nodes: Array.from(nodes.entries()).map(([id, data]) => ({
|
|
58
|
+
id: getOrCreateIndex(id), // Convert string ID to numeric index
|
|
59
|
+
label: id, // Original string ID as label
|
|
60
|
+
section: Array.from(data.embedding), // Sheaf section = the embedding data
|
|
61
|
+
weight: 1.0, // Node weight (importance) - default to 1.0
|
|
62
|
+
})),
|
|
63
|
+
edges: edges.map(e => ({
|
|
64
|
+
source: getOrCreateIndex(e.source), // Convert to numeric
|
|
65
|
+
target: getOrCreateIndex(e.target), // Convert to numeric
|
|
66
|
+
weight: e.weight,
|
|
67
|
+
})),
|
|
68
|
+
});
|
|
69
|
+
return {
|
|
70
|
+
add_node(id, embedding) {
|
|
71
|
+
nodes.set(id, { embedding });
|
|
72
|
+
getOrCreateIndex(id); // Pre-register the ID
|
|
73
|
+
},
|
|
74
|
+
add_edge(source, target, weight) {
|
|
75
|
+
edges.push({ source, target, weight });
|
|
76
|
+
// Pre-register edge endpoint IDs
|
|
77
|
+
getOrCreateIndex(source);
|
|
78
|
+
getOrCreateIndex(target);
|
|
79
|
+
},
|
|
80
|
+
remove_node(id) {
|
|
81
|
+
nodes.delete(id);
|
|
82
|
+
// Note: We don't remove from index mappings to maintain consistency
|
|
83
|
+
// (indices are reused to avoid graph corruption)
|
|
84
|
+
// Remove associated edges
|
|
85
|
+
for (let i = edges.length - 1; i >= 0; i--) {
|
|
86
|
+
if (edges[i].source === id || edges[i].target === id) {
|
|
87
|
+
edges.splice(i, 1);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
remove_edge(source, target) {
|
|
92
|
+
const idx = edges.findIndex(e => e.source === source && e.target === target);
|
|
93
|
+
if (idx >= 0)
|
|
94
|
+
edges.splice(idx, 1);
|
|
95
|
+
},
|
|
96
|
+
sheaf_laplacian_energy() {
|
|
97
|
+
const graph = buildGraph();
|
|
98
|
+
return rawEngine.consistencyEnergy(graph);
|
|
99
|
+
},
|
|
100
|
+
detect_contradictions(threshold) {
|
|
101
|
+
const graph = buildGraph();
|
|
102
|
+
const obstructions = rawEngine.detectObstructions(graph);
|
|
103
|
+
if (!obstructions)
|
|
104
|
+
return [];
|
|
105
|
+
return obstructions
|
|
106
|
+
.filter(o => o.energy > threshold)
|
|
107
|
+
.map(o => ({
|
|
108
|
+
node1: getStringId(o.node1), // Convert back to string ID
|
|
109
|
+
node2: getStringId(o.node2), // Convert back to string ID
|
|
110
|
+
severity: o.energy,
|
|
111
|
+
distance: o.energy,
|
|
112
|
+
}));
|
|
113
|
+
},
|
|
114
|
+
clear() {
|
|
115
|
+
nodes.clear();
|
|
116
|
+
edges.length = 0;
|
|
117
|
+
stringToIndex.clear();
|
|
118
|
+
indexToString.clear();
|
|
119
|
+
nextIndex = 0;
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
// ============================================================================
|
|
124
|
+
// Cohomology Adapter Implementation
|
|
125
|
+
// ============================================================================
|
|
126
|
+
/**
|
|
127
|
+
* Adapter for the Prime Radiant CohomologyEngine
|
|
128
|
+
*
|
|
129
|
+
* Provides sheaf cohomology operations for detecting contradictions
|
|
130
|
+
* in belief systems and agent states.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* const adapter = new CohomologyAdapter(wasmLoader, logger);
|
|
135
|
+
* await adapter.initialize();
|
|
136
|
+
*
|
|
137
|
+
* adapter.addNode({ id: 'belief-1', embedding: [...] });
|
|
138
|
+
* adapter.addNode({ id: 'belief-2', embedding: [...] });
|
|
139
|
+
* adapter.addEdge({ source: 'belief-1', target: 'belief-2', weight: 0.8 });
|
|
140
|
+
*
|
|
141
|
+
* const energy = adapter.computeEnergy();
|
|
142
|
+
* const contradictions = adapter.detectContradictions(0.1);
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
export class CohomologyAdapter {
|
|
146
|
+
wasmLoader;
|
|
147
|
+
logger;
|
|
148
|
+
engine = null;
|
|
149
|
+
initialized = false;
|
|
150
|
+
nodes = new Map();
|
|
151
|
+
edges = [];
|
|
152
|
+
/**
|
|
153
|
+
* Create a new CohomologyAdapter
|
|
154
|
+
*
|
|
155
|
+
* @param wasmLoader - WASM module loader
|
|
156
|
+
* @param logger - Optional logger for diagnostics
|
|
157
|
+
*/
|
|
158
|
+
constructor(wasmLoader, logger = DEFAULT_COHERENCE_LOGGER) {
|
|
159
|
+
this.wasmLoader = wasmLoader;
|
|
160
|
+
this.logger = logger;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Initialize the adapter by loading the WASM module
|
|
164
|
+
*/
|
|
165
|
+
async initialize() {
|
|
166
|
+
if (this.initialized)
|
|
167
|
+
return;
|
|
168
|
+
this.logger.debug('Initializing CohomologyAdapter');
|
|
169
|
+
const isAvailable = await this.wasmLoader.isAvailable();
|
|
170
|
+
if (!isAvailable) {
|
|
171
|
+
throw new WasmNotLoadedError('WASM module is not available. Cannot initialize CohomologyAdapter.');
|
|
172
|
+
}
|
|
173
|
+
const module = await this.wasmLoader.load();
|
|
174
|
+
// Create wrapper around raw WASM engine
|
|
175
|
+
const rawEngine = new module.CohomologyEngine();
|
|
176
|
+
this.engine = createCohomologyEngineWrapper(rawEngine);
|
|
177
|
+
this.initialized = true;
|
|
178
|
+
this.logger.info('CohomologyAdapter initialized successfully');
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Check if the adapter is initialized
|
|
182
|
+
*/
|
|
183
|
+
isInitialized() {
|
|
184
|
+
return this.initialized;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Ensure the adapter is initialized before use
|
|
188
|
+
*/
|
|
189
|
+
ensureInitialized() {
|
|
190
|
+
if (!this.initialized || !this.engine) {
|
|
191
|
+
throw new WasmNotLoadedError('CohomologyAdapter not initialized. Call initialize() first.');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Add a node to the coherence graph
|
|
196
|
+
*
|
|
197
|
+
* @param node - The node to add
|
|
198
|
+
*/
|
|
199
|
+
addNode(node) {
|
|
200
|
+
this.ensureInitialized();
|
|
201
|
+
// Store locally for reference
|
|
202
|
+
this.nodes.set(node.id, node);
|
|
203
|
+
// Add to WASM engine
|
|
204
|
+
const embedding = new Float64Array(node.embedding);
|
|
205
|
+
this.engine.add_node(node.id, embedding);
|
|
206
|
+
this.logger.debug('Added node to cohomology graph', {
|
|
207
|
+
nodeId: node.id,
|
|
208
|
+
embeddingDim: node.embedding.length,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Add an edge between two nodes
|
|
213
|
+
*
|
|
214
|
+
* @param edge - The edge to add
|
|
215
|
+
*/
|
|
216
|
+
addEdge(edge) {
|
|
217
|
+
this.ensureInitialized();
|
|
218
|
+
// Store locally for reference
|
|
219
|
+
this.edges.push(edge);
|
|
220
|
+
// Add to WASM engine
|
|
221
|
+
this.engine.add_edge(edge.source, edge.target, edge.weight);
|
|
222
|
+
this.logger.debug('Added edge to cohomology graph', {
|
|
223
|
+
source: edge.source,
|
|
224
|
+
target: edge.target,
|
|
225
|
+
weight: edge.weight,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Remove a node from the graph
|
|
230
|
+
*
|
|
231
|
+
* @param nodeId - ID of the node to remove
|
|
232
|
+
*/
|
|
233
|
+
removeNode(nodeId) {
|
|
234
|
+
this.ensureInitialized();
|
|
235
|
+
this.nodes.delete(nodeId);
|
|
236
|
+
this.engine.remove_node(nodeId);
|
|
237
|
+
// Also remove edges connected to this node
|
|
238
|
+
const indicesToRemove = [];
|
|
239
|
+
this.edges.forEach((edge, index) => {
|
|
240
|
+
if (edge.source === nodeId || edge.target === nodeId) {
|
|
241
|
+
indicesToRemove.push(index);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
indicesToRemove.reverse().forEach(i => this.edges.splice(i, 1));
|
|
245
|
+
this.logger.debug('Removed node from cohomology graph', { nodeId });
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Remove an edge from the graph
|
|
249
|
+
*
|
|
250
|
+
* @param source - Source node ID
|
|
251
|
+
* @param target - Target node ID
|
|
252
|
+
*/
|
|
253
|
+
removeEdge(source, target) {
|
|
254
|
+
this.ensureInitialized();
|
|
255
|
+
// Remove from local storage
|
|
256
|
+
const index = this.edges.findIndex(e => e.source === source && e.target === target);
|
|
257
|
+
if (index >= 0) {
|
|
258
|
+
this.edges.splice(index, 1);
|
|
259
|
+
}
|
|
260
|
+
this.engine.remove_edge(source, target);
|
|
261
|
+
this.logger.debug('Removed edge from cohomology graph', { source, target });
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Compute the sheaf Laplacian energy of the graph
|
|
265
|
+
*
|
|
266
|
+
* Lower energy indicates higher coherence.
|
|
267
|
+
*
|
|
268
|
+
* @returns The energy value (>= 0)
|
|
269
|
+
*/
|
|
270
|
+
computeEnergy() {
|
|
271
|
+
this.ensureInitialized();
|
|
272
|
+
const energy = this.engine.sheaf_laplacian_energy();
|
|
273
|
+
this.logger.debug('Computed sheaf Laplacian energy', { energy });
|
|
274
|
+
return energy;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Detect contradictions in the graph
|
|
278
|
+
*
|
|
279
|
+
* @param threshold - Energy threshold for contradiction detection (default: 0.1)
|
|
280
|
+
* @returns List of detected contradictions
|
|
281
|
+
*/
|
|
282
|
+
detectContradictions(threshold = 0.1) {
|
|
283
|
+
this.ensureInitialized();
|
|
284
|
+
const rawContradictions = this.engine.detect_contradictions(threshold);
|
|
285
|
+
const contradictions = rawContradictions.map(raw => this.transformContradiction(raw));
|
|
286
|
+
this.logger.debug('Detected contradictions', {
|
|
287
|
+
count: contradictions.length,
|
|
288
|
+
threshold,
|
|
289
|
+
});
|
|
290
|
+
return contradictions;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Transform raw WASM contradiction to domain type
|
|
294
|
+
*/
|
|
295
|
+
transformContradiction(raw) {
|
|
296
|
+
return {
|
|
297
|
+
nodeIds: [raw.node1, raw.node2],
|
|
298
|
+
severity: this.severityFromDistance(raw.severity),
|
|
299
|
+
description: this.generateContradictionDescription(raw),
|
|
300
|
+
confidence: 1 - raw.distance, // Higher distance = lower confidence it's a true contradiction
|
|
301
|
+
resolution: this.suggestResolution(raw),
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Map severity score to severity level
|
|
306
|
+
*/
|
|
307
|
+
severityFromDistance(severity) {
|
|
308
|
+
if (severity >= 0.9)
|
|
309
|
+
return 'critical';
|
|
310
|
+
if (severity >= 0.7)
|
|
311
|
+
return 'high';
|
|
312
|
+
if (severity >= 0.4)
|
|
313
|
+
return 'medium';
|
|
314
|
+
if (severity >= 0.2)
|
|
315
|
+
return 'low';
|
|
316
|
+
return 'info';
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Generate a human-readable description of the contradiction
|
|
320
|
+
*/
|
|
321
|
+
generateContradictionDescription(raw) {
|
|
322
|
+
const node1 = this.nodes.get(raw.node1);
|
|
323
|
+
const node2 = this.nodes.get(raw.node2);
|
|
324
|
+
if (node1?.metadata?.statement && node2?.metadata?.statement) {
|
|
325
|
+
return `Contradiction detected between "${node1.metadata.statement}" and "${node2.metadata.statement}"`;
|
|
326
|
+
}
|
|
327
|
+
return `Contradiction detected between nodes '${raw.node1}' and '${raw.node2}' with distance ${raw.distance.toFixed(3)}`;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Suggest a resolution for the contradiction
|
|
331
|
+
*/
|
|
332
|
+
suggestResolution(raw) {
|
|
333
|
+
if (raw.severity >= 0.9) {
|
|
334
|
+
return 'Critical contradiction requires manual review. Consider removing one of the conflicting beliefs.';
|
|
335
|
+
}
|
|
336
|
+
if (raw.severity >= 0.7) {
|
|
337
|
+
return 'High-severity contradiction. Recommend gathering additional evidence to determine which belief is correct.';
|
|
338
|
+
}
|
|
339
|
+
if (raw.severity >= 0.4) {
|
|
340
|
+
return 'Moderate contradiction. Consider adding context or constraints to differentiate the beliefs.';
|
|
341
|
+
}
|
|
342
|
+
return 'Low-severity contradiction. May be resolved with additional context or can be safely ignored.';
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Clear all nodes and edges from the graph
|
|
346
|
+
*/
|
|
347
|
+
clear() {
|
|
348
|
+
this.ensureInitialized();
|
|
349
|
+
this.nodes.clear();
|
|
350
|
+
this.edges.length = 0;
|
|
351
|
+
this.engine.clear();
|
|
352
|
+
this.logger.debug('Cleared cohomology graph');
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Dispose of adapter resources
|
|
356
|
+
*/
|
|
357
|
+
dispose() {
|
|
358
|
+
if (this.engine) {
|
|
359
|
+
this.engine.clear();
|
|
360
|
+
this.engine = null;
|
|
361
|
+
}
|
|
362
|
+
this.nodes.clear();
|
|
363
|
+
this.edges.length = 0;
|
|
364
|
+
this.initialized = false;
|
|
365
|
+
this.logger.info('CohomologyAdapter disposed');
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Get the number of nodes in the graph
|
|
369
|
+
*/
|
|
370
|
+
getNodeCount() {
|
|
371
|
+
return this.nodes.size;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Get the number of edges in the graph
|
|
375
|
+
*/
|
|
376
|
+
getEdgeCount() {
|
|
377
|
+
return this.edges.length;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Get a node by ID
|
|
381
|
+
*/
|
|
382
|
+
getNode(nodeId) {
|
|
383
|
+
return this.nodes.get(nodeId);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
// ============================================================================
|
|
387
|
+
// Factory Function
|
|
388
|
+
// ============================================================================
|
|
389
|
+
/**
|
|
390
|
+
* Create and initialize a CohomologyAdapter
|
|
391
|
+
*
|
|
392
|
+
* @param wasmLoader - WASM module loader
|
|
393
|
+
* @param logger - Optional logger
|
|
394
|
+
* @returns Initialized adapter
|
|
395
|
+
*/
|
|
396
|
+
export async function createCohomologyAdapter(wasmLoader, logger) {
|
|
397
|
+
const adapter = new CohomologyAdapter(wasmLoader, logger);
|
|
398
|
+
await adapter.initialize();
|
|
399
|
+
return adapter;
|
|
400
|
+
}
|
|
401
|
+
//# sourceMappingURL=cohomology-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohomology-adapter.js","sourceRoot":"","sources":["../../../../src/integrations/coherence/engines/cohomology-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAaH,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGxE,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E;;;;;;GAMG;AACH,SAAS,6BAA6B,CAAC,SAA+B;IACpE,oCAAoC;IACpC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAuC,CAAC;IAC7D,MAAM,KAAK,GAA8D,EAAE,CAAC;IAE5E,qDAAqD;IACrD,qDAAqD;IACrD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAChD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAChD,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,8CAA8C;IAC9C,MAAM,gBAAgB,GAAG,CAAC,EAAU,EAAU,EAAE;QAC9C,IAAI,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,GAAG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