Skip to content

Commit 6c64676

Browse files
committed
Updated standalone post-binary logic tool
1 parent 712cc40 commit 6c64676

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

post_binary_logic_tool/paradox_oscillator..py renamed to post_binary_logic_tool/paradox_oscillator.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#V06262026
1+
#V06272026
22
# =============================================================================
33
# Chaos AI-OS Paradox Oscillation Layer (CPOL with gating and modes).
44
# Copyright (c) 2025 Jonathan Schack (EL_Xaber) jon@cai-os.com
@@ -60,6 +60,16 @@
6060
from typing import Dict, Any, List, Optional
6161
from datetime import datetime, timezone
6262

63+
# =============================================================================
64+
# OPTIONAL KB INTEGRATION
65+
# =============================================================================
66+
try:
67+
import knowledge_base as kb
68+
KB_AVAILABLE = True
69+
except ImportError:
70+
KB_AVAILABLE = False
71+
print("[INFO] knowledge_base not available. Running without KB persistence.")
72+
6373
# =============================================================================
6474
# UTILITY FUNCTIONS
6575
# =============================================================================
@@ -311,12 +321,21 @@ def _extract_domain(self, text: str) -> str:
311321
if any(re.search(r'\b' + kw + r'\b', text_lower) for kw in keywords):
312322
return domain
313323

314-
# Extract noun phrases as potential new domain
315-
words = text_lower.split()
316-
if len(words) > 2:
317-
return words[0] # First word as proxy
324+
# If no domain matches, return "general" (orchestrator will override in full system)
318325
return "general"
319326

327+
# =========================================================================
328+
# UNCOMMENT BELOW FOR ORCHESTRATOR INTEGRATION:
329+
# The full CAIOS orchestrator overrides this with LLM-based domain
330+
# classification. The first-word proxy is a placeholder for that flow.
331+
# =========================================================================
332+
#
333+
# # Extract noun phrases as potential new domain
334+
# words = text_lower.split()
335+
# if len(words) > 2:
336+
# return words[0] # First word as proxy
337+
# return "general"
338+
320339
def _score_evidence(self, text: str) -> float:
321340
"""Score query for factual evidence/grounding."""
322341
text_lower = text.lower()
@@ -656,7 +675,6 @@ def run_cpol_chatbot(query_text: str,
656675
shared_mem = session_state if session_state else {'distress_density': 0.0}
657676
result = kernel.run_cpol_decision(
658677
contradiction_density=density,
659-
kernel=kernel,
660678
query_text=query_text,
661679
shared_memory=shared_mem
662680
)

0 commit comments

Comments
 (0)