From ed37ae8e9373e932c684bc1d8910e965f70284af Mon Sep 17 00:00:00 2001 From: Mike Levin Date: Mon, 15 Jun 2026 13:35:55 -0400 Subject: [PATCH] refactor: Forward FIGURATE to native wand core --- imports/ascii_displays.py | 49 +++------------------------------------ 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/imports/ascii_displays.py b/imports/ascii_displays.py index e469822e..4575ef12 100644 --- a/imports/ascii_displays.py +++ b/imports/ascii_displays.py @@ -43,52 +43,9 @@ def figurate(name: str, context: Optional[str] = None) -> FigurateResult: - """🎨 FIGURATE: Centralized dual-output ASCII art renderer. - - Looks up `name` in the FIGURATE_REGISTRY and returns a FigurateResult - with both a Rich-formatted human version and a plain-text AI version. - - Falls back gracefully if the name is not yet registered. - - Args: - name: Registry key for the art piece (e.g., "white_rabbit") - context: Optional contextual note logged alongside the AI version - - Returns: - FigurateResult with .human (Rich) and .ai (plain) attributes - """ - entry = FIGURATE_REGISTRY.get(name) - if entry is None: - fallback = f"[figurate: '{name}' not yet registered]" - return FigurateResult(name=name, human=fallback, ai=fallback, drift=0) - - render_fn: Callable = entry.get("render") - if render_fn is None: - fallback = f"[figurate: '{name}' has no render function]" - return FigurateResult(name=name, human=fallback, ai=fallback, drift=0) - - # render_fn must return (human_renderable, ai_plain_str) - human_out, ai_out = render_fn() - - # Drift detection: CRC32 values are not ordered, so drift is binary — 0 or 1. - drift = 0 - expected_crc = FIGURATE_LEDGER.get(name) - if expected_crc is not None: - computed_crc = binascii.crc32(ai_out.encode('utf-8')) - if computed_crc != expected_crc: - drift = 1 - logger.warning(f"🎨 FIGURATE: DRIFT DETECTED in '{name}' — expected CRC {expected_crc}, got {computed_crc}") - - if context: - logger.info(f"🎨 FIGURATE: {name} | {context} | drift={drift}") - - # Guaranteed AI visibility through the unified logging pipeline when active - figurate_logger.info(f"🎨 FINDER_TOKEN: ASCII_ART_FIGURATE - {name}\n{ai_out}") - - # Also use the existing share function for full AI transparency - share_ascii_with_ai(ai_out, f"figurate('{name}') called", "🎨") - - return FigurateResult(name=name, human=human_out, ai=ai_out, drift=drift) + """🎨 FIGURATE: Forwarded cleanly to the native wand core.""" + from pipulate import wand + return wand._core_figurate(name, context=context) def conjure_window(*args, **kwargs) -> None: