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:
- Zoo:
examples/zoo/04_pomdp_minimal/— smallest target that meaningfully exercises every stage in the defaultstages=[...]list. - Zoo:
examples/zoo/12_full_pomdp/— full pipeline integration target includingprocessandvalidatestages. - Cookbook: Recipe 1: Scan your first Python project —
PipelineRunner.run()from a one-liner. - Cookbook: Recipe 5: Multi-project scans — reusing one
PipelineConfigacross many targets. - Cookbook: Recipe: Analyze a Flask app —
PipelineRunneragainst the canonical 98-node fixture. - Tutorial: Tutorial 1: Quickstart — Method 2 (orchestrated pipeline) walkthrough.
- Tutorial: Tutorial 3: Flask walkthrough — full
stageslist against a real-world repo.