Skip to content

Pipeline Runner

PipelineRunner API

What this page is: Reference for PipelineRunner — the high-level orchestrator that runs every COGANT stage from a single configuration object.

Prerequisites: API overview, Quick Start, and basic familiarity with Session.

Reading time: ~6 minutes

Next steps: Session API · Bundle API · Configuration reference

The PipelineRunner orchestrates all stages in sequence with configuration.

Basic Usage

# doctest: +SKIP  # example requires runtime context or external resources
from cogant.api.pipeline import PipelineRunner, PipelineConfig

runner = PipelineRunner()
config = PipelineConfig(output_dir="output/")
bundle = runner.run("./my_repo", config)

Configuration

# doctest: +SKIP  # example requires runtime context or external resources
from cogant.api.pipeline import PipelineConfig

config = PipelineConfig(
    # Stages to execute in order
    stages=[
        "ingest",
        "static",
        "normalize",
        "graph",
        "translate",
        "statespace",
        "process",
        "export",
        "validate",
    ],
    # Skip specific stages
    skip_stages=["dynamic"],
    # Output directory
    output_dir="output/",
    # Enable verbose logging
    verbose=True,
    # Dry run (no side effects)
    dry_run=False,
)

bundle = runner.run("./my_repo", config)

Accessing Results

# Check for errors
if bundle.errors:
    print(f"Errors: {bundle.errors}")

# Get stage results
for stage, result in bundle.stage_results.items():
    print(f"{stage}: {result['type']}")

# Access specific stages
graph = bundle.stage_results.get("graph", {})
gnn = bundle.stage_results.get("translate", {})
state_space = bundle.stage_results.get("statespace", {})

Examples

PipelineRunner and PipelineConfig (including the stages / skip_stages / plugins knobs above) are exercised by: