Three days of intensive work bringing seedgo to full operational status and driving all branches through comprehensive standards compliance. Seedgo v2.0.0: - 22 checkers active (up from 20), standards pack fully operational - New introspection standard researched from Dev-Pass, FPLAN-0017 open - Bypass system for false positives (.seedgo config) - Standards query and audit commands fully functional System-wide audit (FPLAN-0016): - All 14 auditable branches at 99%+ compliance - CLI imports standardized across all branches (console from cli.apps.modules) - handle_command(command, args) → bool contract added to all modules - print_help() function naming fixed for checker pattern matching - Handler extraction: large modules split, file I/O moved to handler layer - New handlers created across ai_mail, backup, daemon, flow, skills, spawn, seedgo Branch-specific highlights: - ai_mail: email.py split 840→420 lines, 4 new handlers - flow: dplan_flow.py 688→591 lines, 4 new handlers - seedgo: massive restructure — standards moved to handlers/aipass_standards/, old standards/ tree removed, bypass system added, diagnostics module - commons: database module added, CLI imports fixed - skills: 5 handle_commands added, help function renamed - trigger: error reporter handler, handle_command routing - All branches: consistent architecture, clean drone routing Culture doc (CLAUDE.md) added — documents AIPass philosophy, identity, memory system, and collaboration principles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
115 lines
3.4 KiB
Python
115 lines
3.4 KiB
Python
# =================== AIPass ====================
|
|
# Name: engagement_module.py
|
|
# Description: Engagement Orchestration Module
|
|
# Version: 1.0.0
|
|
# Created: 2026-03-07
|
|
# Modified: 2026-03-07
|
|
# =============================================
|
|
|
|
"""
|
|
Engagement Orchestration Module
|
|
|
|
Thin router for community engagement workflows. Delegates all
|
|
implementation to handlers/engagement/engagement_ops.py and
|
|
renders results with Rich.
|
|
|
|
Handles: prompt, event commands.
|
|
"""
|
|
|
|
from typing import List
|
|
|
|
from aipass.prax.apps.modules.logger import system_logger as logger
|
|
|
|
try:
|
|
from aipass.cli.apps.modules import console
|
|
except ImportError:
|
|
from rich.console import Console
|
|
console = Console()
|
|
|
|
from commons.apps.handlers.engagement.engagement_ops import generate_prompt, create_event
|
|
|
|
|
|
def print_introspection():
|
|
"""Display module introspection info."""
|
|
console.print()
|
|
console.print("engagement_module Module")
|
|
console.print("Thin router for community engagement workflows. Generates daily prompts and creates events.")
|
|
console.print()
|
|
console.print("Connected Handlers:")
|
|
console.print(" handlers/engagement/")
|
|
console.print(" - engagement_ops.py (generate_prompt — create and post a daily community prompt)")
|
|
console.print(" - engagement_ops.py (create_event — create a community event/announcement)")
|
|
console.print()
|
|
|
|
|
|
# =============================================================================
|
|
# COMMAND ROUTING
|
|
# =============================================================================
|
|
|
|
HANDLED_COMMANDS = ["prompt", "event"]
|
|
|
|
|
|
def handle_command(command: str, args: List[str]) -> bool:
|
|
"""
|
|
Handle engagement-related commands.
|
|
|
|
Args:
|
|
command: Command name (prompt, event)
|
|
args: Command arguments
|
|
|
|
Returns:
|
|
True if command handled, False otherwise
|
|
"""
|
|
if command not in HANDLED_COMMANDS:
|
|
return False
|
|
|
|
if command == "prompt":
|
|
return _handle_prompt(args)
|
|
elif command == "event":
|
|
return _handle_event(args)
|
|
|
|
return False
|
|
|
|
|
|
# =============================================================================
|
|
# DISPLAY HANDLERS
|
|
# =============================================================================
|
|
|
|
def _handle_prompt(args: List[str]) -> bool:
|
|
"""Generate a daily prompt and display result."""
|
|
result = generate_prompt(args)
|
|
|
|
if not result["success"]:
|
|
console.print(f"[red]{result['error']}[/red]")
|
|
return True
|
|
|
|
console.print()
|
|
console.print("[green]Daily prompt posted![/green]")
|
|
console.print(f" [dim]ID:[/dim] {result['post_id']}")
|
|
console.print(f" [dim]Room:[/dim] r/{result['room']}")
|
|
console.print(f" [dim]Theme:[/dim] {result['theme']}")
|
|
console.print(f" [dim]Author:[/dim] {result['author']}")
|
|
console.print()
|
|
|
|
return True
|
|
|
|
|
|
def _handle_event(args: List[str]) -> bool:
|
|
"""Create an event and display result."""
|
|
result = create_event(args)
|
|
|
|
if not result["success"]:
|
|
console.print(f"[red]{result['error']}[/red]")
|
|
return True
|
|
|
|
console.print()
|
|
console.print("[green]Event created![/green]")
|
|
console.print(f" [dim]ID:[/dim] {result['post_id']}")
|
|
console.print(f" [dim]Room:[/dim] r/{result['room']}")
|
|
console.print(f" [dim]Title:[/dim] {result['title']}")
|
|
console.print(f" [dim]Type:[/dim] announcement")
|
|
console.print(f" [dim]Author:[/dim] {result['author']}")
|
|
console.print()
|
|
|
|
return True
|