Skip to content

Troubleshooting

This page is organized around the boundary that most often explains a surprising result: what YAGA was explicitly given, what it is allowed to inspect, and whether the result is a policy finding or an operational error.

Read the exit code first

Deterministic policy checks, advisory commit quality, repository aggregation, and receipt evaluation use this three-way contract:

Exit Meaning Typical response
0 The selected input passed. Continue the workflow.
1 Policy/advisory findings or failed/incomplete receipt obligations. Fix the input, finish required work, or change policy deliberately.
2 YAGA could not safely complete the check. Fix invocation, configuration, checkout, Git, or resource limits.

Test policy validation and planning, configuration commands, and review-policy check/plan/template use only 0 and 2; planning does not claim tests or reviews passed. The trusted GitHub lifecycle operations (gate agent-review prepare, request, and their peers) have a separate contract: GateError, including missing GitHub context, returns 1. Do not interpret that as a policy finding. See the command index for formats and surfaces.

For checks supporting JSON, keep standard output and error separate. Passed reports and policy findings use stdout; structured operational errors use stderr. This Bash example also preserves the exit code when the caller has enabled set -e:

status=0
yaga commit check --file message.txt --format json > report.json 2> error.txt || status=$?
case "$status" in
  0|1) cat report.json ;;  # JSON report: inspect findings as well as the exit code.
  2) cat error.txt >&2 ;; # Structured command error or plain CLI usage error.
esac

Missing required options or invalid option values can be CLI usage errors even with --format json; error.txt is not guaranteed to contain JSON. Parse it as JSON only after checking that it is a valid error document. Human-readable output is for people; supported GitHub output escapes and bounds workflow annotations. Do not treat every nonzero result as a policy failure.

“Configuration not found” or unexpected defaults

Commit checks discover exactly one nearest .yaga.toml or pyproject.toml; files are not merged. A same-directory .yaga.toml wins. Use --config to make the source explicit, and use config show to inspect the selected file and effective defaults:

yaga config show --repo .
yaga config show --repo . --format json
yaga commit check --repo . --config .yaga.toml --message "feat: example"

Standalone provider policies (.yaga/*-policy.toml) are never discovered by a provider. Pass their path explicitly or reference it from a repository plan.

Quality checks fail before a model result

An old Hugging Face configuration or an invocation with no provider returns a migration message. Choose the service that should receive the selected commit text. For local inference, start a compatible server, make the model available there and select openai-compatible with its model name. Set YAGA_OPENAI_COMPATIBLE_BASE_URL if the server uses a different address.

For a hosted provider, check the model identifier, credentials and account access. For Bedrock, also check the selected AWS region and permission to call Converse. An unavailable endpoint, invalid model output or use of --offline returns exit 2. A successful provider response that flags a message returns exit 1. See commit quality for examples.

“Exactly one source” errors

commit check accepts one of --title, --edit, --message, --file, --stdin, --commit, or --range, and defaults to HEAD only when none is supplied. Do not combine them. A range requires complete history and is evaluated oldest first; YAGA will not fetch missing commits.

For a pull request, pass the exact base and head SHAs supplied by the event, usually as one quoted environment variable. Do not interpolate untrusted values into shell source.

Committed-tree checks pass locally but fail in CI

tree, path, mode, and size inspect one exact committed tree. They do not inspect the index, working tree, or untracked files. Confirm that the revision exists in the CI checkout and that the policy path is available in the trusted checkout used to run the command:

git cat-file -e "$YAGA_REVISION^{commit}"
yaga tree check --policy .yaga/tree-policy.toml --revision "$YAGA_REVISION"

For size check, the selected blob objects must also be present. A shallow checkout is supported only when all required objects exist; use a complete checkout when the revision or objects may be absent.

Repository plans reject a path or option

Plans are opt-in and versioned. --plan cannot be combined with provider-selection flags such as --check, --workflow-path, or --mode-policy. Runtime state remains outside the plan: --repo, --config, --commit, --range, --revision, and --format belong on the command line.

Plan policy paths are resolved under --repo, not beside the plan. Unknown keys, duplicate providers, absolute or parent-traversing paths, unused provider keys, and a missing required policy are intentional errors. Start with the smallest explicit plan and add providers one at a time:

plan-version = 2
checks = ["tree"]
tree-policy = ".yaga/tree-policy.toml"
yaga repo check --repo . --plan .yaga/checks/ci.toml --revision HEAD

Workflow checks disagree

The workflow providers are independent: workflow check validates immutable references, workflow security validates the selected trust profile, and workflow lint runs pinned actionlint in a hardened container. One passing provider does not replace another.

The security profiles are cumulative: recommended-v1 is the frozen default, v2 additionally requires persist-credentials: false on direct runner-resolved checkout steps, and v3 additionally rejects exact pull-requests: write and statuses: write under pull_request triggers. Use an exact custom rule selection only when the repository intentionally owns that policy.

Workflow lint cannot start or clean Docker

workflow lint runs the pinned actionlint image in a private, labeled Docker volume. It requires a working Docker daemon even though the workflow files themselves are read-only inputs. Check the daemon and the active context before changing YAGA policy:

docker info
docker context show
docker image inspect "rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667"

YAGA uses that audited digest in its installed runtime. Docker may pull the image when it is missing, despite networking being disabled inside the container. Preload it for offline use. The active Docker context can target a remote daemon, which receives the bounded workflow snapshot. An unavailable daemon, failed pull, or other startup failure is an operational error (2), not an actionlint finding.

Cleanup failures include the exact private workspace name and a bounded, sanitized Docker cause, for example Docker could not remove private actionlint workspace ...: .... Inspect only that named resource if the message identifies one:

docker volume inspect <exact-name-from-the-error>
docker volume rm --force <exact-name-from-the-error>

Do not use broad docker system prune commands to recover a YAGA check: they can remove unrelated containers, images, or volumes. YAGA retries exact container and volume cleanup within a hard deadline and labels resources so a late-created resource can still be found. If docker info fails, restart or select the intended Docker engine first and rerun the check; if the exact volume remains after a successful daemon check, preserve the error text when reporting the environment issue.

Preview or publish the docs

Run a clean strict build before committing documentation changes:

make docs
make docs-serve

The preview server serves http://localhost:9000 by default. Override it with make docs-serve DOCS_ADDR=127.0.0.1:8000 if that port is occupied. The Pages workflow publishes only from main; if the build passes locally but deployment fails, inspect the latest docs.yml run and confirm that the repository has GitHub Pages configured for workflow deployment.