tools.parallax_tool module

Parallax 4.5 Passive Reasoning Tool – Sigma Expanse + NCM + Gemini Compat.

Stargazer-callable tool for structured contradiction-holding reasoning. Star invokes this on complex, paradoxical, or multi-perspective analysis.

Reads NCM state from Redis DB12, runs the full Parallax manifold pipeline, writes ERAC deltas and Omega-field state back, returns structured JSON.

Zero LLM calls. Pure symbolic computation. Contradiction = Fertility.

async tools.parallax_tool.run(action, prompt='', collapse_mode='', axioms='[]', axiom_id='', ctx=None)[source]

Dispatch one Parallax reasoning action and return a JSON string result.

The single public handler for the parallax_reasoning tool (this module’s run entry point, dispatched by tool_loader.py based on the module’s TOOL_NAME / TOOL_PARAMETERS; not called directly elsewhere in the repo). It resolves the per-channel engine via _get_engine() and then branches on action: analyze reads the live NCM vector (_read_ncm_vector()), parses any caller-supplied axiom texts, runs the full manifold pipeline via engine.analyze, persists the resulting state (_write_parallax_state()), appends protocol reminders, and hoists any fail-state warnings (failsafe, monocular, dominant-flip, pcl-stuck, coherence) ahead of the JSON body; predict re-reads the NCM vector and calls engine.predict to project manifold drift; check_erac returns all tracked axioms plus those pending Prime Architect review; get_omega returns the current omega-field; erode looks up a single axiom by id. The computation is purely symbolic with zero LLM calls; its only external touches are the two best-effort Redis DB12 reads/writes above. Outcomes and key metrics are logged at info level, and any unexpected exception is caught, logged with a traceback, and returned as a JSON error.

Parameters:
  • action (str) – One of analyze, predict, erode, check_erac, get_omega. Anything else returns a JSON usage error.

  • prompt (str) – Text/topic to analyze; required for analyze.

  • collapse_mode (str) – Optional collapse override (opus, sigma, hybrid); auto-selected from manifold state when empty.

  • axioms (str) – JSON array string of axiom texts to track ERAC for; unparseable or empty input is treated as no axioms.

  • axiom_id (str) – Axiom id required by the erode action.

  • ctx (ToolContext | None) – The active ToolContext (supplies channel_id and the Redis handle used for NCM reads and state writes).

Returns:

for analyze the structured manifold (optionally prefixed by warning text), for other actions their respective payloads, or a JSON error object on unknown action or failure.

Return type:

str