ci / static reds main on any GitHub blip: the pinned shellcheck tarball is fetched per run with no retry or cache (HTTP 504 on 26339 + 26348) #332

Open
opened 2026-11-05 09:23:48 +00:00 by matou-build-agent · 1 comment

Symptom

ci / static has been red on main for three consecutive pushes
(26333 → f95e71f, 26339 → 5b5727c, 26348 → 107020c), which tripped the
watchdog's always-red signature 5653c0ad3cd5. ci / test was green
throughout.

Root cause — two different faults wearing one red

  1. 26333 (f95e71f) was a genuine lint finding: SC2155 at
    run-swarm.sh:454. Closed by #326 (5b5727c).

  2. 26339 and 26348 never reached shellcheck at all. The job's
    shellcheck -S warning -x step dies in its download:

    2026-11-05T09:15:13.685Z curl: (22) The requested URL returned error: 504
    2026-11-05T09:15:13.690Z ⚙️ [runner]: RUN exit status 22
    2026-11-05T09:15:14.078Z 🏁  Job failed
    

    (identical line at 08:56:48 in 26339). bash -n every script passed
    in both; the checkout passed; the only failure is the HTTP 504 from
    github.com for the pinned
    shellcheck-v0.11.0.linux.x86_64.tar.xz.

At 107020c both static steps are clean when the tarball is reachable —
verified on the runner host: bash -n over the same globs exits 0, and
shellcheck -S warning -x (v0.11.0, checksum-verified) exits 0 with no
findings. GitHub served the tarball 200 on 6/6 probes after the
incident, so the next push's ci / static should go green on its own.

The durable defect

.forgejo/workflows/ci.yml's static job fetches its pinned shellcheck
from github.com on every run, with a single un-retried curl under
set -euo pipefail. Any transient 5xx at GitHub therefore reds the gate
on main — and because the swarm pushes to main continuously, one
GitHub blip of a few minutes reds several consecutive runs and reads as
"always red", masking whether the tree actually lints.

The test job has no such dependency (bash + jq + git only), which is why
it stayed green and the asymmetry pointed straight at the download.

Suggested fix

In the static job's shellcheck step:

  • Cache the verified binary on the runner at a stable, version-keyed path
    (e.g. $HOME/.cache/matou-factory/shellcheck-<ver>/), re-verifying the
    pinned sha256 of the cached artefact on every run and re-downloading
    only on absence or mismatch — so a warm runner needs no network and the
    checksum rail is not weakened.
  • Retry the cold fetch with backoff (curl --retry 5 --retry-all-errors --retry-delay 3, or an explicit attempt loop) before failing.
  • Keep the step fail-closed: if shellcheck genuinely cannot be
    obtained after retries, the job must still fail rather than silently
    skip the lint.

Why the healer did not fix it

heal_rails (rehearsal-heal-lib.sh:175) hard-refuses any repair diff
matching ^\.forgejo/workflows/ as self-modification, so the healer
cannot land this change — it is a workflow edit by construction. Needs a
worker or a human.

Related: #211 (the originating CI static-checks ticket), #326 (fixed
fault 1).

Evidence: /tmp/matou-heal-Matou-dev-factory.y2iN2X on
matou-dev-server-01 (job-log.txt, job leg 1 of run 26348).

## Symptom `ci / static` has been red on `main` for three consecutive pushes (26333 → f95e71f, 26339 → 5b5727c, 26348 → 107020c), which tripped the watchdog's `always-red` signature `5653c0ad3cd5`. `ci / test` was green throughout. ## Root cause — two different faults wearing one red 1. **26333 (f95e71f)** was a genuine lint finding: `SC2155` at `run-swarm.sh:454`. Closed by #326 (5b5727c). 2. **26339 and 26348** never reached shellcheck at all. The job's `shellcheck -S warning -x` step dies in its *download*: ``` 2026-11-05T09:15:13.685Z curl: (22) The requested URL returned error: 504 2026-11-05T09:15:13.690Z ⚙️ [runner]: RUN exit status 22 2026-11-05T09:15:14.078Z 🏁 Job failed ``` (identical line at `08:56:48` in 26339). `bash -n every script` passed in both; the checkout passed; the only failure is the HTTP 504 from `github.com` for the pinned `shellcheck-v0.11.0.linux.x86_64.tar.xz`. At `107020c` both static steps are clean when the tarball *is* reachable — verified on the runner host: `bash -n` over the same globs exits 0, and `shellcheck -S warning -x` (v0.11.0, checksum-verified) exits 0 with no findings. GitHub served the tarball `200` on 6/6 probes after the incident, so the next push's `ci / static` should go green on its own. ## The durable defect `.forgejo/workflows/ci.yml`'s `static` job fetches its pinned shellcheck from `github.com` on **every run**, with a single un-retried `curl` under `set -euo pipefail`. Any transient 5xx at GitHub therefore reds the gate on `main` — and because the swarm pushes to `main` continuously, one GitHub blip of a few minutes reds several consecutive runs and reads as "always red", masking whether the tree actually lints. The `test` job has no such dependency (bash + jq + git only), which is why it stayed green and the asymmetry pointed straight at the download. ## Suggested fix In the `static` job's shellcheck step: - Cache the verified binary on the runner at a stable, version-keyed path (e.g. `$HOME/.cache/matou-factory/shellcheck-<ver>/`), re-verifying the pinned `sha256` of the cached artefact on every run and re-downloading only on absence or mismatch — so a warm runner needs no network and the checksum rail is not weakened. - Retry the cold fetch with backoff (`curl --retry 5 --retry-all-errors --retry-delay 3`, or an explicit attempt loop) before failing. - Keep the step **fail-closed**: if shellcheck genuinely cannot be obtained after retries, the job must still fail rather than silently skip the lint. ## Why the healer did not fix it `heal_rails` (`rehearsal-heal-lib.sh:175`) hard-refuses any repair diff matching `^\.forgejo/workflows/` as self-modification, so the healer cannot land this change — it is a workflow edit by construction. Needs a worker or a human. Related: #211 (the originating CI static-checks ticket), #326 (fixed fault 1). Evidence: `/tmp/matou-heal-Matou-dev-factory.y2iN2X` on `matou-dev-server-01` (`job-log.txt`, job leg 1 of run 26348).
Author
Member

Blocked — the fix is a protected-path change; handed to a session

The entire fix lives in .forgejo/workflows/ci.yml (the un-retried
curl -fsSL ".../shellcheck-${ver}..." in the static job's
shellcheck -S warning -x step). That directory is a fingerprinted
protected path (PP_PROTECTED_DIRS_DEFAULT=".sandcastle .forgejo"), so a
Sandcastle worker cannot land the diff — the protected-path boundary rolls it
back and reds the run, exactly as the ticket's own "why the healer did not fix
it" note anticipated (heal_rails refuses ^\.forgejo/workflows/ too).

Per CLAUDE.md rule 9 / the boundary's PP_ESCAPE_PATH, a protected-path
change needs an interactive session's standing, not a worker. I've filed
that work as #333 (labelled ready-for-session) with the full symptom,
root cause, the exact file/lines, and the concrete fix (version-keyed cache +
checksum re-verify + retry-with-backoff + fail-closed).

No root-file change is possible here — .forgejo/ has no root/vendored split;
it is this repo's own CI. So this ticket is blocked on #333.

To re-arm: once #333 lands the workflow fix, this report (#332) can be
closed as resolved by it (the always-red signature clears on its own once
the tarball is reachable or cached).

Swapping ready-for-agent → agent-blocked and releasing the claim.

## Blocked — the fix is a protected-path change; handed to a session The entire fix lives in `.forgejo/workflows/ci.yml` (the un-retried `curl -fsSL ".../shellcheck-${ver}..."` in the `static` job's `shellcheck -S warning -x` step). That directory is a fingerprinted **protected path** (`PP_PROTECTED_DIRS_DEFAULT=".sandcastle .forgejo"`), so a Sandcastle worker cannot land the diff — the protected-path boundary rolls it back and reds the run, exactly as the ticket's own "why the healer did not fix it" note anticipated (`heal_rails` refuses `^\.forgejo/workflows/` too). Per CLAUDE.md rule 9 / the boundary's `PP_ESCAPE_PATH`, a protected-path change needs an **interactive session's** standing, not a worker. I've filed that work as **#333** (labelled `ready-for-session`) with the full symptom, root cause, the exact file/lines, and the concrete fix (version-keyed cache + checksum re-verify + retry-with-backoff + fail-closed). No root-file change is possible here — `.forgejo/` has no root/vendored split; it is this repo's own CI. So this ticket is blocked on #333. **To re-arm:** once #333 lands the workflow fix, this report (#332) can be closed as resolved by it (the `always-red` signature clears on its own once the tarball is reachable or cached). Swapping `ready-for-agent` → `agent-blocked` and releasing the claim.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#332
No description provided.