Skip to main content

scenario_pipeliner

scenario_pipeliner is a v0 plugin migration planner and optional worker runtime.

Consumer guide (installed library):

Example plugin skeleton and thin launcher: examples/.

Current v0 scope:

  • load and validate plugin.manifest.json,
  • apply registry policy checks (compatibility + checksum),
  • build dry-run migration plan as JSON,
  • apply core DB migrations (db migrate-core) via Alembic,
  • apply plugin SQL (db migrate-plugins, PostgreSQL),
  • run worker via scenario_pipeliner run or examples/main.py (plugins stay external),
  • parent/subtask lifecycle (WAITING → FINISHED / FINISHED_WITH_ERROR).

Out of scope in v0:

  • bundling scenario plugins inside the published wheel.

Install (development)

From the repository root:

uv sync --dev

From PyPI:

pip install scenario-pipeliner

Installed-library flow: docs/CONSUMER.md.

Lint commands (CI source of truth)

Use exactly the lint commands from ./.github/workflows/ci.yml:

uv run ruff check .
uv run ruff format --check .
uv run mypy .

CLI usage (v0)

# validate plugins / dry-run plan
uv run scenario_pipeliner migrate --dry-run --format json

# core schema
uv run scenario_pipeliner db migrate-core

# plugin SQL (reads SCENARIO_PIPELINER_PLUGINS_ROOT)
uv run scenario_pipeliner db migrate-plugins

# worker (optional migrations + execute existing tasks)
uv run scenario_pipeliner run
uv run scenario_pipeliner run --skip-migrations

# compute / write plugin unpacked checksum
uv run scenario_pipeliner plugin checksum examples/plugins/hello_scenario
uv run scenario_pipeliner plugin checksum examples/plugins/hello_scenario --write

--skip-migrations requires a previous db migrate-core (library tables live in SCENARIO_PIPELINER_DB_SCHEMA, default sp, not public).

Thin equivalent of run:

uv run python examples/main.py

Environment variables: see docs/CONSUMER.md and examples/.env.example. Python model bases (Settings / FrozenSettings): docs/CONSUMER.md.

CLI loads .env from the current working directory (and parents) automatically; already-exported process environment variables still win.

Common discovery vars:

  • SCENARIO_PIPELINER_MODE: dev (default) or prod
  • SCENARIO_PIPELINER_PLUGINS_ROOT: plugin root path (default: plugins)
  • SCENARIO_PIPELINER_CORE_VERSION: core version string for core_compat checks

Exit codes for migrate --dry-run:

  • 0: report status ok or warning
  • 1: report status error

API usage (stable surface)

from pathlib import Path

from scenario_pipeliner import (
    Mode,
    ScenarioPipelinerConfig,
    apply_migrations,
)

config = ScenarioPipelinerConfig(
    mode=Mode.DEV,
    plugins_root=Path("plugins"),
)
# db_backend defaults to postgresql; core_version defaults to __version__

report = apply_migrations(config, dry_run=True)
payload = report.model_dump(mode="json")

dry_run=False is not implemented in v0 and raises NotImplementedError.

Core schema bootstrap API:

from scenario_pipeliner import CoreMigrationConfig, DbBackend, apply_core_migrations

report = apply_core_migrations(
    CoreMigrationConfig(
        db_backend=DbBackend.POSTGRESQL,
        db_schema="sp",
        postgres_host="localhost",
        postgres_db="scenario_pipeliner",
        postgres_user="postgres",
        postgres_password="postgres",
    )
)

From an already-running event loop (FastAPI, nested worker) use await apply_core_migrations_async(config) instead. The sync wrapper is CLI-only.

Plugin result semantics

Each plugin in report.plugins has one of:

  • loaded: plugin passed checks and has migration plan for selected backend.
  • skipped: plugin passed checks, but either has no migrations section or has no migration path for selected backend.
  • error: plugin failed validation/policy checks.

For skipped, plugin is registered in dry-run context and keeps checksum/policy warnings in reasons, plus the skip reason (no migration path for backend=...).

Task payload

tasks.payload, broker TaskDraft.payload, and pipeline TaskState.payload are TaskPayload (type_doc, data, optional params). The library does not read params. Full contract: docs/CONSUMER.md.

Checksum notes

  • prod: checksum mismatch is a hard error.
  • dev: checksum mismatch is warning-only (best effort).
  • Directory checksum excludes symlinks.
  • Hardlinked files are included in checksum content.
  • plugin.manifest.json is hashed as canonical JSON with checksum.value omitted.

Metadata

Release files for scenario-pipeliner 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scenario-pipeliner 0.0.1
File Size Uploaded
scenario_pipeliner-0.0.1.tar.gz 113.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scenario-pipeliner 0.0.1
File Interpreter ABI Platform
scenario_pipeliner-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 222.9 kB

Release files / scenario_pipeliner-0.0.1.tar.gz

Download URL scenario_pipeliner-0.0.1.tar.gz
Size 113.9 kB
Tags Source
SHA-256 checksum
How to use checksums
865736ac9b6e018e717edf3abff008cdb81419bad951f705cf3b3e536347cc33
BLAKE2b-256 checksum
How to use checksums
26cbfab849854ea5c6af8dbf98bfb46be3be2a1e20f56278ac6f8df02485f324
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / scenario_pipeliner-0.0.1-py3-none-any.whl

Download URL scenario_pipeliner-0.0.1-py3-none-any.whl
Size 109.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a5628b3f799d8ac886848aa576e7f44ca75311000e2b0ab3a29860588b51e4d
BLAKE2b-256 checksum
How to use checksums
07f8dd19dbf128e3db845d1f46f5adb0dc1f0e690fe1af358b0cdd8f9fff91fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.2

2 release files

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page