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.2

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.2
File Size Uploaded
scenario_pipeliner-0.0.2.tar.gz 121.6 kB Details

Built distribution (wheel)

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

Total release size: 235.5 kB

Release files / scenario_pipeliner-0.0.2.tar.gz

Download URL scenario_pipeliner-0.0.2.tar.gz
Size 121.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b204b6a599997f59a8f7aabec22e61795ee59dd10eb4bf1a452ef46a2b268abb
BLAKE2b-256 checksum
How to use checksums
7952b9a7b9db7175922fa38a72dcd9f4c8a6da9dafc819f7f0a5422c573e8986
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 Oct 14, 2026.

Transparency log

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

Download URL scenario_pipeliner-0.0.2-py3-none-any.whl
Size 113.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15eb9de0386748992c9c5a25901a8718b9e0f167cc665ed280b123a3c23f0fc9
BLAKE2b-256 checksum
How to use checksums
882baef7e9a2e3aa7c9bbfdb76dad67c4f694083fc31ef68b8b0610592ab9c33
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 Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

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