save_governor_spec
Register a natural language governor to control pipeline flow at steps like on_fail or on_success, with decisions to proceed, jump, halt, mark broken, or patch the pipeline.
Instructions
Register an LLM-governed governor for use in pipeline control flow.
Governors are evaluated at trigger points (on_fail, on_success) to decide the continuation. The spec is a natural language description of what the governor should decide. The governor LLM returns one of:
next — proceed normally
jump(target) — jump to a named step
halt — stop the pipeline cleanly
broken(reason) — stop and write broken status (visible via pipeline_status)
patch_pipeline — deep-merge patch the pipeline definition and continue
Each continuation also carries a free-form context dict that accumulates
across the pipeline and is written to /shared/governor-context.json, plus a
confidence score in [0.0, 1.0].
Reference a governor in a pipeline step: "on_fail": {"governor": "Failure"} "on_success": {"governor": "Validation"}
Args:
name: Unique governor name used to reference it from pipeline steps.
spec: Natural language description telling the LLM what to decide.
description: One-line summary shown in list_governor_specs.
model: Claude model for evaluation (default: haiku).
beam_width: Self-consistency beam width. When >1 the harness samples the
governor N times in parallel and commits to the confidence-weighted
majority decision. Losing candidates are preserved on the winner's
alternatives field for inspection. Default 1 (no beam).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| spec | Yes | ||
| description | No | ||
| model | No | claude-haiku-4-5-20251001 | |
| beam_width | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |