A failed pipeline dumps thousands of log lines; the actual cause is usually three of them. AI assistants are genuinely good at this needle-finding — build-log triage is one of the best-evidenced AI wins in ops — but they are also confident about wrong answers when the log is ambiguous.
Tier: Foundation · Workflow area: CI/CD & release engineering
This playbook gets you a ranked hypothesis list in minutes and a habit of confirming the hypothesis before acting on it.
Skip AI when the error is explicit ("secret FOO not set") — read it and fix it.
Collect evidence, not just the error. Grab: the failing job log, the last green run's timestamp, and git log --oneline <last-green>..HEAD. Cause is usually in the delta.
Prompt for ranked hypotheses with evidence, not a single answer.
This CI job started failing. Below: the failing log, and the commits since
the last green run.
Task:
1. Identify the first line where the run actually goes wrong (not the last
error — the first).
2. Give your top 3 causes ranked by likelihood. For each: the exact log
lines supporting it, and one cheap check I can run to confirm or kill it.
3. Say which commits could plausibly have caused it, or "none — likely
environmental."
Do not propose fixes yet.
--- LOG ---
<paste>
--- COMMITS ---
<paste>
Run the cheapest confirming check first. Good checks: rerun the failing step locally, docker pull the exact image tag, hit the flaky endpoint with curl, rerun the job with debug logging. Confirm before you fix — this is the step that separates diagnosis from guessing.
Ask for the fix only after confirmation. "Cause #2 confirmed: the base image tag was repointed upstream. Propose the minimal fix." Minimal matters — assistants over-fix, pinning ten things when one was broken.
Log the failure class. Keep a running note (repo wiki or team channel) of failure → cause → AI verdict. After a month you will know exactly which failure classes the assistant nails (dependency, cache, syntax) and which it fumbles (runner infra, race conditions) — that is your personal trust map.
Always ask for the FIRST bad line. Build logs cascade — the final error is usually a symptom four steps downstream of the real fault.
gh run view, local rebuild) — fastest loop, watch what commands it wants to run before approving.Diagnosis has its own gate chain — treat "the AI said X broke it" as a plan, not an apply:
|| true silencers.Client CI logs frequently contain client hostnames, account IDs, and tokens that must not enter public AI tools. Pipe the log through a redaction pass first (sed/awk rules for account IDs, URLs, emails — keep a shared scrub script in your team repo), or run the whole workflow against a local model via Ollama; log triage works well on mid-size local models since the task is extraction, not deep reasoning. On air-gapped client estates, the structured prompt in step 2 still pays off with the client's approved internal assistant.