Files
skills/skills/kvb-ci-artifacts/SKILL.md
T
Kevin Veen-BirkenbachandClaude Opus 5.5 f0d5eafcac feat(ci): kvb-ci-track keeps one fingerprinted list of CI failures until each is acked
New skill kvb-ci-track: track.py add/poll/wait/ack/known follows workflow runs, PR checks, code-scanning and secret alerts and issues, clusters each failing job by its failing line (ci_failures.failing, now split from signature without a change in behaviour), fingerprints every cluster, and prints only clusters nobody acked yet. A failing line that matches a hotfix register signature carries that hotfix as a hint. kvb-ci-observe and kvb-ci-triage poll through it instead of re-reading every log; kvb-ci-artifacts names failing().

Untrusted text never reaches the terminal raw: printable() drops every character str.isprintable() refuses (escape sequences, zero-width characters), a tab or other whitespace control becoming a space. masked() runs it before hiding URL credentials, assigned secrets and 24-character tokens, and report() cleans every cell, so a log line, title or job name cannot send a terminal sequence, forge a tab-separated cell or dodge an ack with an invisible character.

Tests: tests/test_ci_track.py, including test_control_and_zero_width_characters_never_reach_a_cell. Written, not run: the full suite runs once on master after all bundles (operator order). Both new expectations checked inline; ci_failures.signature() proven identical on every path, the empty-log sentinel included.

Security: MEDUSA over the staged tree on master: 100, 8 files covered, 0 findings. 6 low findings accepted as false positives after a skeptic review and the operator's accept on 2026-11-22: MP-SCAN-1781 at track.py 516, 557, 571, 572 and MP-SCAN-1878 at 557, 571, all on the word 'ack' in the CLI's own subcommand and messages.

🎯 Fix: 90 %
💥 Break: 4 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 86
🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 %

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:09:28 +00:00

3.4 KiB

name, description
name description
kvb-ci-artifacts Pull failed CI job logs, clustered by error line, and cause-holding artifacts. Trigger to explain a CI failure.

A job log tells you what broke. An artifact tells you why.

Getting the log

For a GitHub Actions run, one call does it:

${CLAUDE_SKILL_DIR}/scripts/ci_failures.py <RUN_ID> [--repo <owner>/<repo>] [--artifacts]

It prints how far HEAD moved since the run's commit, saves every finished failed job's log to /tmp/ci-logs-<run>/ (colour stripped, even while the run is still in progress), and clusters the jobs by the normalised error line that ended them. Results that failed_when: false or ignore_errors tolerate never end a job. Jobs still running are listed, not fetched: their API log can stop hours early. The clustering is a heuristic; check each boundary against the logs.

Grep the saved files repeatedly instead of re-fetching a log.

Getting the artifacts

gh api /repos/<owner>/<repo>/actions/runs/<RUN_ID>/artifacts --paginate \
  --jq '.artifacts[] | "\(.name)\t\(.size_in_bytes)"'
gh run download <RUN_ID> --repo <owner>/<repo> -n <NAME> -D <DIR>

Choose by content, not by name length:

  • Rescue / diagnostics bundles carry the reverse-proxy access and error log, the per-service and per-container logs, the journal, and the event stream. This is where causes live. Prefer them.
  • Test-report bundles (Playwright and friends) are mostly video and traces and can run to hundreds of megabytes for one assertion string. Pull one only when you need the assertion text or the error-context file.
  • Inventory / runtime dumps settle "what was actually deployed" questions.

Inside a rescue bundle, read in this order: the reverse-proxy log (it shows status code, upstream, and time-to-response for the exact failing request), the application container log, then the journal and event stream for restarts and OOM kills.

An access-log line is a timing witness. A 499 means the client gave up; the server was still working. A 504 or an upstream timed out ... while reading upstream means your backend never answered. ReqTime versus UpstreamTime tells you whether the proxy or the upstream burned the seconds.

Grep hygiene

Two failure modes turn a search into a false conclusion:

  • Clustered flags silently change the pattern. Write them separately: grep -r -a -i -l -F "needle" dir/, not -ariel. A cluster where one letter takes an argument consumes your pattern and searches for something else, and the run still exits successfully.
  • Substring matches lie. A protocol token like h2c matches inside veth2cb3f8c; a short id matches inside a hash. Before concluding anything from a hit, print its context (grep -o ".\{30\}needle.\{30\}") and look at it. Before concluding anything from a miss, prove the command was well-formed by searching for a string you know is present.

Binary-ish logs need -a, or grep reports "binary file matches" and you see nothing.

Rules

  • Download before theorising. Do it even when the job log looks conclusive: a log that explains the symptom rarely explains the cause.
  • Quote literally, with the file path and line number. Never paraphrase a log line you did not read, and never reconstruct one from memory.
  • A negative result is a finding only when the search was verified sound.
  • "The artifact does not settle this" is a legitimate answer. Say it instead of filling the gap with a plausible mechanism.