testsAndMisc/docs/superpowers/evidence/i3blocks-claude-usage-ci-jq-2026-08-10.json
Krzysztof kuhy Rudnicki 590bc2004d
Some checks are pending
Pre-commit checks / pre-commit (push) Waiting to run
Python tests / test (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
ci: install jq for the shell tests, and probe for it explicitly
The claude_usage i3blocks tests failed on CI while passing locally.
archlinux:base-devel ships no jq, and claude_usage.sh parses its cache
with it, so the block degraded to its "no data" path and every
percentage assertion failed. That degradation is correct at runtime —
the bar should not break because a tool is missing — but it made a
missing dependency look like a logic bug.

Install jq alongside git and strace, and probe for it at the top of the
section so the failure names its own cause. The probe runs jq rather
than calling `command -v`: a jq that exists but cannot execute produces
exactly the same "no data" output as an absent one, and `command -v`
passes in that case — verified by stubbing a jq that exits 127.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YQLwdquDCNmWtvgi3Lk72J
2026-08-10 15:40:42 +02:00

38 lines
2.2 KiB
JSON

{
"intent": "Make the claude_usage i3blocks tests pass on CI, where they failed because the Arch container had no jq.",
"scope": [
".github/workflows/shell-tests.yml (arch-tests container dependencies)",
"linux_configuration/tests/test_i3blocks_efficiency.sh (dependency probe)",
"Non-goal: changing claude_usage.sh runtime behaviour — degrading to 'no data' without jq is correct"
],
"changes": [
"Install jq in the arch-tests container. archlinux:base-devel ships neither git, strace nor jq; the first two were already installed, and claude_usage.sh parses its cache with jq.",
"Guard the claude_usage test section on a working jq. The probe runs `printf '{}' | jq -e .` rather than `command -v jq`, because a jq that exists but cannot execute produces exactly the same 'no data' output as an absent one, and `command -v` would pass in that case."
],
"verification": [
{
"command": "bash linux_configuration/tests/test_i3blocks_efficiency.sh",
"result": "pass",
"evidence": "EXIT=0 with jq present."
},
{
"command": "PATH=<stub-with-failing-jq> bash linux_configuration/tests/test_i3blocks_efficiency.sh",
"result": "pass",
"evidence": "Reports 'FAIL: a working jq is required for the claude_usage tests (pacman -S jq)' instead of the previous misleading \"expected '🤖 5h 34% · 7d 55%', actual: '🤖 no data'\" — the failure now names its real cause. Confirmed the earlier `command -v jq` form did NOT catch this case."
},
{
"command": "reproduce CI failure locally",
"result": "pass",
"evidence": "Running claude_usage.sh with a failing jq on PATH reproduced the exact CI output '🤖 no data', confirming the missing dependency rather than a logic defect."
}
],
"risks": [
"Adds one package to the CI container install step, marginally increasing job setup time.",
"The guard makes a missing dependency a hard failure rather than a skip; that is intended, since silently skipping would hide the block's assertions entirely."
],
"rollback": [
"git revert the commit; CI returns to failing on the claude_usage assertions until jq is installed another way.",
"Validate with: gh run list --limit 3 after the next push."
]
}