AttractorEx Overview

Copy Markdown View Source

AttractorEx is the standalone pipeline engine embedded in this Phoenix project. It implements a practical, execution-oriented subset of the strongDM Attractor specification and extends it with an HTTP control plane, human-in-the-loop adapters, a unified LLM client layer, and a coding-agent session model.

What It Does

At a high level, AttractorEx turns DOT graphs into executable workflows:

  1. Parse a DOT graph into a normalized runtime model.
  2. Validate structural, routing, and handler-specific constraints.
  3. Execute nodes from start to exit.
  4. Route across edges by condition, status, preferred labels, or suggested next IDs.
  5. Persist status artifacts, checkpoints, and per-stage outputs.

Architecture

The library is organized into a small set of focused layers:

LayerMain modulesResponsibility
Entry pointsAttractorEx, AttractorEx.EnginePublic API and execution orchestration
DOT modelAttractorEx.Parser, AttractorEx.Graph, AttractorEx.Node, AttractorEx.EdgeParse and normalize the graph
ValidationAttractorEx.Validator, AttractorEx.Condition, AttractorEx.ModelStylesheetLinting, schema checks, and selector-based styling
Runtime handlersAttractorEx.HandlerRegistry, AttractorEx.Handlers.*Node execution semantics
Human gatesAttractorEx.HumanGate, AttractorEx.Interviewer, AttractorEx.Interviewers.*wait.human workflows and answer normalization
HTTP serviceAttractorEx.HTTP, AttractorEx.HTTP.Manager, AttractorEx.HTTP.RouterRemote pipeline execution and SSE updates
Phoenix adapterAttractorExPhx, AttractorExPhx.Client, AttractorExPhx.HTTPServerPhoenix-facing integration seam over the standalone engine
Unified LLMAttractorEx.LLM.*Provider-agnostic completion and streaming
Agent loopAttractorEx.Agent.*Spec-inspired coding-agent session primitives

Core Execution Flow

AttractorEx.run/3 follows the same broad lifecycle documented in the upstream spec:

  1. Parse DOT input.
  2. Apply built-in and custom graph transforms.
  3. Validate the transformed graph.
  4. Create a run directory and manifest.
  5. Execute node handlers one step at a time.
  6. Write status.json and checkpoint.json artifacts.
  7. Emit structured events for observers and the HTTP service.

Output Artifacts

Each run writes runtime artifacts under the configured logs root:

  • manifest.json for run metadata.
  • checkpoint.json for resumable state.
  • status.json for per-stage and final outcome serialization.
  • Handler-specific files such as prompt.md, response.md, and tool hook logs.

Reading The Docs

The rest of this documentation is structured to match how the code is used:

For source-level details, browse the grouped module documentation in the sidebar.