fix(orchestrator): inject --goal into persona_interests for autonomous resonance evaluation and fix scope shadowing bugs

This commit is contained in:
2026-04-29 19:30:21 +02:00
parent fc44633ebc
commit 849fb63426
3 changed files with 9 additions and 4 deletions

View File

@@ -177,6 +177,11 @@ def start_bot(**kwargs):
)
persona_interests = [p.strip() for p in persona_raw.split(",") if p.strip()] if persona_raw else []
global_goal = getattr(configs.args, "goal", None)
if global_goal:
persona_interests.insert(0, global_goal)
logger.info(f"🎯 [Autonomous Directive] Overriding target audience with high-level goal: {global_goal}", extra={"color": f"{Style.BRIGHT}{Fore.GREEN}"})
from GramAddict.core.interaction import LLMWriter
from GramAddict.core.qdrant_memory import DMMemoryDB, ParasocialCRMDB
from GramAddict.core.resonance_engine import ResonanceEngine

View File

@@ -63,7 +63,7 @@ def extract_post_content(context_xml: str, device=None) -> dict:
# 1. Learn/extract post author dynamically
author_node = telepath.find_best_node(
context_xml, "post author username header", min_confidence=0.75, device=device
context_xml, "post author username text (exclude bottom tabs)", min_confidence=0.75, device=device
)
# 🛡️ Anti-Hallucination Guard: Ensure we actually found text.
@@ -71,7 +71,9 @@ def extract_post_content(context_xml: str, device=None) -> dict:
result["username"] = author_node["original_attribs"]["text"].strip()
# 2. Learn/extract post media description dynamically
media_node = telepath.find_best_node(context_xml, "post media content", min_confidence=0.35, device=device)
media_node = telepath.find_best_node(
context_xml, "post media content (the actual image or video, exclude bottom tabs)", min_confidence=0.35, device=device
)
if media_node and media_node.get("original_attribs", {}).get("desc"):
result["description"] = media_node["original_attribs"]["desc"].strip()

View File

@@ -152,8 +152,6 @@ def align_active_post(device):
try:
xml = device.dump_hierarchy()
if "clips_video_container" in xml or "clips_viewer_container" in xml:
import logging
logger = logging.getLogger(__name__)
logger.info("🎯 [Alignment] Reels view detected. Auto-snapping is native.")
return True