@consiliency/pipeline-runtime
v0.1.0
Published
Runtime, harness, and workflow modules for the governed-pipeline engine. The package owns BAML boundaries, executor adapters, runtime ledger/evidence stores, governance and Portal projection bridges, the runtime-agent surface, and the phase-loop closeout
Readme
@consiliency/pipeline-runtime
Runtime, harness, and workflow modules for the governed-pipeline engine. The package owns BAML boundaries, executor adapters, runtime ledger/evidence stores, governance and Portal projection bridges, the runtime-agent surface, and the phase-loop closeout ingest path.
Optional dependency: dotfiles phase-loop-runtime
The phase-loop runtime referenced by governed-pipeline's closeout ingest, status projection, and blocker normalization lives in dotfiles as a vendored Python package: ~/code/dotfiles/vendor/phase-loop-runtime/. governed-pipeline is consumption-only and does not require the package to be installed — all current behavior runs on the in-repo JSON parsing path.
If you want the schema-import shim to resolve from the installed package instead of the fallback constant, install it into a Python virtualenv and export the detection flag:
export DOTFILES_DIR=~/code/dotfiles
python3 -m venv ~/.venvs/phase-loop-runtime
source ~/.venvs/phase-loop-runtime/bin/activate
pip install -e "file://$DOTFILES_DIR/vendor/phase-loop-runtime"
export PHASE_LOOP_RUNTIME_AVAILABLE=1phase-loop and codex-phase-loop console scripts will then be on PATH. With PHASE_LOOP_RUNTIME_AVAILABLE=1, the shim at src/workflow/phase-loop-schema-import.mjs reports source: 'phase-loop-runtime' and includes the package version. Without the flag (or when the binary probe fails), it returns the frozen PHASE_LOOP_SCHEMA_FALLBACK and existing JSON parsing paths run unchanged.
The CI smoke test at test/phase-loop-runtime-install.test.mjs exercises the install in a temporary virtualenv. It skips automatically when:
SKIP_PHASE_LOOP_RUNTIME_INSTALL_TEST=1is set- The dotfiles vendored package is not present at
$PHASE_LOOP_RUNTIME_PACKAGE(defaults to~/code/dotfiles/vendor/phase-loop-runtime) python3, thevenvmodule, orpipis unavailable
Opt-in v17 metadata consumers
Each consumer reads a specific dotfiles v17 phase-loop field and returns a normalized record. All consumers default to no-op; pass { enabled: true } per call to activate. Records are frozen.
| Module | Reads | Use case |
| --- | --- | --- |
| workflow/phase-loop-execution-policy-consumer | execution_policy block from closeout | Surface per-phase resolved executor pin in audit metadata |
| workflow/phase-loop-auto-recovery-consumer | metadata.manual_repair.auto_recovery: true | Distinguish auto-recovered phases from operator-recovered phases |
| workflow/phase-loop-selected-executor-consumer | LoopEvent.selected_executor | Per-executor analytics, token-spread reporting |
| workflow/phase-loop-outage-class-consumer | blocker.blocker_class === 'unretryable_external_outage' | Reducer that rotates provider on outage but holds provider on auth failure |
Example:
import { consumeOutageClass } from '@consiliency/pipeline-runtime/workflow/phase-loop-outage-class-consumer';
const record = consumeOutageClass(closeoutPayload, { enabled: true });
if (record?.retry_strategy === 'rotate-provider') {
// wire downstream reducer
}Each consumer has a happy-path and absent-path test in test/phase-loop-*-consumer.test.mjs.
Tests
npm test -w @consiliency/pipeline-runtime # full suite
npm test -w @consiliency/pipeline-runtime -- runtime-agent # runtime-agent slice
npm test -w @consiliency/pipeline-runtime -- phase-loop-schema-import # GPADOPT shim
SKIP_PHASE_LOOP_RUNTIME_INSTALL_TEST=1 npm test -w @consiliency/pipeline-runtime # skip pip install smoke