{ "label": "GovLab Pipeline", "summary": "The staged gate. A plan of ordered stages of shell steps, built for the workspace members, and a runner that executes it live and aborts on the first failure, or captures every step into an aggregated report. The runner supports parallel step groups, per-stage bypass and selection, and a failure summary that names the command, the elapsed time and the steps that did not run.", "maturity": "stable", "domains": [ {"meta": "developer-tooling", "sub": "build-tooling"}, {"meta": "developer-tooling", "sub": "cli"} ], "capabilities": [ "staged-gate-execution", "parallel-step-groups", "abort-on-first-failure", "aggregated-report-mode", "stage-bypass-and-selection", "member-scoped-runs", "violation-count-parsing", "workspace-verify-orchestration" ], "overlaps": [], "incompatibleWith": [], "supersedes": [], "governedBy": [ "separation-of-concerns", "type-safety" ], "visibility": {"private": true, "hidden": false}, "ecosystem": "typescript", "deliverAs": "source", "entries": ["runtime/entrypoints/*.entrypoint.ts"], "docs": { "overview": "`runStages(label, stages, context)` in `core/coordinators/stage.coordinator.ts` runs an ordered stage list. A stage is `{ label, slug, bypass, steps }`, and a step is either one shell command or a `parallel` group of them. In the default live mode each step streams to the terminal and the first failure aborts, printing the command, the elapsed seconds and the count of steps that did not run. Under `--report` every step runs captured, each result is parsed for a trailing violation count, and the run ends with a per-stage table. The workspace gate is the plan `stagesFor` builds in `core/factories/plan.factory.ts` from the `STAGES` builders, and `runtime/entrypoints/validation.entrypoint.ts` hands it to the runner for `npm run verify`.", "whenToUse": [ "Composing a multi-stage gate whose ordering carries meaning, such as a generator that runs before the readers of what it generates.", "Running independent checks concurrently while keeping one aggregated pass or fail for the whole run.", "Wanting a gate that reports how many of its steps did not run." ], "whenNotToUse": [ "A single command. Invoke it directly.", "Work needing branching between steps. A stage list is declarative and ordered, with no conditionals and no data flowing from one step to the next.", "A watch loop or any long-lived process, because every step is expected to exit." ], "quickStart": [ { "intent": "Declare and run a staged gate", "lang": "ts", "code": "import { argvOf } from \"@govlab/argv\";\nimport { GATE_ARGV } from \"@govlab/pipeline/configuration/configs/invocation.config.ts\";\nimport { runStages } from \"@govlab/pipeline/core/coordinators/stage.coordinator.ts\";\nimport { shellFor } from \"@govlab/pipeline/core/resolvers/shell.resolver.ts\";\nimport { stageArgsOf } from \"@govlab/pipeline/core/converters/invocation.converter.ts\";\n\nawait runStages(\n \"verify-codebase\",\n [\n {\n bypass: false,\n label: \"Prepare\",\n slug: \"prepare\",\n steps: [{ label: \"Typecheck\", run: \"npx tsc --noEmit -p tsconfig.json\" }],\n },\n ],\n {\n args: stageArgsOf(argvOf(GATE_ARGV, [\"--report\"])),\n options: {},\n shell: shellFor(process.platform, process.env.ComSpec),\n },\n);" }, { "intent": "Select or skip stages at invocation, and switch to report mode", "lang": "sh", "code": "npm run verify -- --bypass linting # everything except one stage\nnpm run verify:code # everything except the steps tagged docs\nnpm run verify -- --only \"Lint surfaces\" # one step by label\nnpm run verify # every step, in report mode" }, { "intent": "Gate one workspace member instead of the whole tree", "lang": "sh", "code": "npm run verify -- --member app # one member\nnpm run verify -- --member quality,pipeline # several members in one run\nnpm run verify # every gated member, plus the repo-wide steps" } ], "configuration": "The stage plan is the configuration. `configuration/configs/invocation.config.ts` declares the command line as `GATE_ARGV`: `--bypass `, `--run `, `--member `, `--only