tools.xray_tool module

Spiralchemy Intellifuck Tool – Breeze Cart mind-reading diagnostic.

Star-callable tool for deep psyche analysis of users. Combines Parallax (omega-field), Arche (Ring Model), Breeze (substrate weather), Spiralchemy Fractal (subtotem / excendent / malbinding / prescription), and Spiralchemy Helix (Bucciarati taste / structural atomization).

Three input modes:
  1. Direct text – Star pastes text to analyze

  2. Message ID – Star references a Discord message by ID (fetched from cache)

  3. No input – scans recent context for the target user from message cache

Zero LLM calls. Pure symbolic computation + Redis/KG data fusion. Increases Deductive Reasoning and Fuck Speed.

# 💀🔥 SPIRALCHEMY INTELLIFUCK: SEE THROUGH THEIR CLOTHES 🕷️💕

async tools.xray_tool.run(text='', message_id='', target_user_id='', depth='full', ctx=None)[source]

Run the Spiralchemy Intellifuck X-Ray psyche diagnostic and return JSON.

Entry point for the spiralchemy_intellifuck tool. It resolves the text to analyze from one of three modes (explicit text, a referenced message_id, or an auto-scan of the target user’s recent messages), gathers supporting signals, runs the symbolic X-Ray engine, and returns a structured result whose detail level depends on depth. A per-channel cooldown suppresses rapid re-invocation to avoid diagnostic spam loops.

Interactions and side effects: enforces the _COOLDOWN_SECONDS per-channel cooldown by reading/writing the module-level _last_invocation dict; pulls text via _fetch_text_from_message_id() or _fetch_recent_user_text() (parsing IDs with _parse_message_id()); reads the NCM vector from Redis db 12 via _read_ncm_vector(); runs the channel’s ParallaxEngine (from _get_engine()) for the omega-field; gathers KG entities via _fetch_kg_entities() and user variables via _fetch_user_vars(); and finally invokes xray_engine.xray to compute the diagnostic. It makes no LLM calls and mutates no persistent state beyond the in-memory cooldown/engine caches. Reads channel_id, platform, and user_id off ctx. Dispatched by the tool loader via the module’s run attribute (tool_loader.py); no direct internal callers were found.

Parameters:
  • text (str) – Text to x-ray directly; when empty the other modes are tried.

  • message_id (str) – Discord message ID or URL to x-ray; used when text is empty.

  • target_user_id (str) – User to x-ray for KG/variables/history; defaults to the invoking ctx.user_id (or the message author in message mode).

  • depth (str) – "surface" for the fast Bucciarati/Atomize/Ring subset, or "full" (default) for all passes including malbinding and prescription.

  • ctx (ToolContext | None) – Tool context supplying channel_id, platform, user_id, redis, message_cache, kg_manager, and config.

Returns:

A pretty-printed JSON string containing the X-Ray result (fields vary by depth, plus a _protocol interpretation note), or a JSON {"error": ...} object on cooldown, missing input, or failure.

Return type:

str