ci / static is always-red on main: four SC2155 findings landed with #375 and #373 (and the pre-push gate runs no shellcheck tier) #378

Closed
opened 2026-11-20 02:06:56 +00:00 by matou-build-agent · 4 comments

ci / static has failed on every push to main since 2026-11-19T23:46Z — 3/3 terminal runs in the watchdog window, which is what tripped the hourly sweep (always-red, signature 5653c0ad3cd5, heal run heal-Matou-dev-factory-1795140078-553106).

The gate is doing its job: it is reporting a real shellcheck -S warning regression that landed in product code at the repo root. ci / test is green throughout, so this is lint-only.

The four findings

Reproduced locally at the incident SHA c8d850d over the whole gate file set, with the pinned shellcheck v0.11.0 (the same binary the job uses, from the runner cache) — exit 1, and these are the only four findings in the tree:

list-ready-tasks.sh:308:66:         warning: Declare and assign separately to avoid masking return values. [SC2155]
tests/fleet-dispatch-test.sh:226:8: warning: Declare and assign separately to avoid masking return values. [SC2155]
tests/fleet-dispatch-test.sh:238:8: warning: Declare and assign separately to avoid masking return values. [SC2155]
tests/fleet-dispatch-test.sh:256:8: warning: Declare and assign separately to avoid masking return values. [SC2155]

Blame:

  • list-ready-tasks.sh:308 — export CLAIM_LIVENESS_CHECK=1 CLAIM_ALIVE_RUNS="$alive_runs" CLAIM_NOW="$(date -u +%s)" — landed in b6e875a (#375). First red run: 315711 (28985).
  • tests/fleet-dispatch-test.sh:226,238,256 — export WAITING_JSON="$(mk_waiting boxA 300)" — landed in c8d850d (#373). Added three more findings in run 315926 (28999).

Run 315879 (28995) in between was red on #375's single finding alone, so the redness is continuous, not two separate blips.

Fix

Split the declaration from the command substitution, per .shellcheckrc's stated contract ("Every other warning stays enabled and is fixed (or line-disabled with a stated reason)"). E.g.:

CLAIM_NOW="$(date -u +%s)"
export CLAIM_LIVENESS_CHECK=1 CLAIM_ALIVE_RUNS="$alive_runs" CLAIM_NOW

and in the test:

WAITING_JSON="$(mk_waiting boxA 300)"; export WAITING_JSON

Both are mechanical; neither changes behaviour. tests/fleet-dispatch-test.sh and tests/claim-liveness*-class suites must stay green (for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done).

Why nothing caught it before the push

git-hooks/pre-push / gate-lib.sh run no shellcheck tier — the only shellcheck strings under git-hooks/ are # shellcheck directives. So an SC-class regression is invisible until ci / static runs after the push, and the landing does not wait on it. Both offending commits were pushed by session-runner@bens-mac-04 straight onto main.

That is the structural half of this ticket, and it is why this is the second time in two days (cf. 130af7b, #371, SC1007 in the same gate; #332, the shellcheck tarball fetch). Worth deciding here: either add a shellcheck tier to the pre-push gate for the files a push touches (cheap — a changed-file-scoped run, not the ~3 min whole-tree pass), or accept post-push-only lint and document it as a hazard. A whole-tree shellcheck -S warning -x takes about 3 minutes on this tree, so a scoped tier is the only pre-push-affordable shape.

Healer notes

  • Class product — the fault is in root *.sh and tests/, so per the heal charter the healer filed this ticket and changed no code.
  • .sandcastle/FACTORY_REF is 9fd804b, which predates both offending commits, so the running vendored copy does not carry the fault; only main's CI is red. A root fix also will not reach the running copy until a human re-vendors (bash onboarding/onboard.sh vendor .sandcastle <sha>, GOTCHAS 4).
  • Host and tracker were healthy throughout: api_http=200 in 1.24s, disk 61%, runner servicing tasks normally, swarm lock free, no stuck git state.
  • A hazard body + docs/GOTCHAS.md index row keyed #<this ticket> should land with the fix, plus the docs/journal/ entry and STATUS.md touch the repo rule requires.
`ci / static` has failed on **every** push to `main` since 2026-11-19T23:46Z — 3/3 terminal runs in the watchdog window, which is what tripped the hourly sweep (`always-red`, signature `5653c0ad3cd5`, heal run `heal-Matou-dev-factory-1795140078-553106`). The gate is doing its job: it is reporting a real `shellcheck -S warning` regression that landed in product code at the repo root. `ci / test` is green throughout, so this is lint-only. ## The four findings Reproduced locally at the incident SHA `c8d850d` over the **whole** gate file set, with the pinned `shellcheck v0.11.0` (the same binary the job uses, from the runner cache) — exit 1, and these are the only four findings in the tree: ``` list-ready-tasks.sh:308:66: warning: Declare and assign separately to avoid masking return values. [SC2155] tests/fleet-dispatch-test.sh:226:8: warning: Declare and assign separately to avoid masking return values. [SC2155] tests/fleet-dispatch-test.sh:238:8: warning: Declare and assign separately to avoid masking return values. [SC2155] tests/fleet-dispatch-test.sh:256:8: warning: Declare and assign separately to avoid masking return values. [SC2155] ``` Blame: - `list-ready-tasks.sh:308` — `export CLAIM_LIVENESS_CHECK=1 CLAIM_ALIVE_RUNS="$alive_runs" CLAIM_NOW="$(date -u +%s)"` — landed in `b6e875a` (**#375**). First red run: 315711 (28985). - `tests/fleet-dispatch-test.sh:226,238,256` — `export WAITING_JSON="$(mk_waiting boxA 300)"` — landed in `c8d850d` (**#373**). Added three more findings in run 315926 (28999). Run 315879 (28995) in between was red on #375's single finding alone, so the redness is continuous, not two separate blips. ## Fix Split the declaration from the command substitution, per `.shellcheckrc`'s stated contract ("Every other warning stays enabled and is fixed (or line-disabled with a stated reason)"). E.g.: ```sh CLAIM_NOW="$(date -u +%s)" export CLAIM_LIVENESS_CHECK=1 CLAIM_ALIVE_RUNS="$alive_runs" CLAIM_NOW ``` and in the test: ```sh WAITING_JSON="$(mk_waiting boxA 300)"; export WAITING_JSON ``` Both are mechanical; neither changes behaviour. `tests/fleet-dispatch-test.sh` and `tests/claim-liveness*`-class suites must stay green (`for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done`). ## Why nothing caught it before the push `git-hooks/pre-push` / `gate-lib.sh` run **no** shellcheck tier — the only `shellcheck` strings under `git-hooks/` are `# shellcheck` directives. So an SC-class regression is invisible until `ci / static` runs *after* the push, and the landing does not wait on it. Both offending commits were pushed by `session-runner@bens-mac-04` straight onto `main`. That is the structural half of this ticket, and it is why this is the second time in two days (cf. `130af7b`, **#371**, SC1007 in the same gate; **#332**, the shellcheck tarball fetch). Worth deciding here: either add a shellcheck tier to the pre-push gate for the files a push touches (cheap — a changed-file-scoped run, not the ~3 min whole-tree pass), or accept post-push-only lint and document it as a hazard. A whole-tree `shellcheck -S warning -x` takes about 3 minutes on this tree, so a scoped tier is the only pre-push-affordable shape. ## Healer notes - Class **product** — the fault is in root `*.sh` and `tests/`, so per the heal charter the healer filed this ticket and changed no code. - `.sandcastle/FACTORY_REF` is `9fd804b`, which predates both offending commits, so the running vendored copy does **not** carry the fault; only `main`'s CI is red. A root fix also will not reach the running copy until a human re-vendors (`bash onboarding/onboard.sh vendor .sandcastle <sha>`, GOTCHAS 4). - Host and tracker were healthy throughout: `api_http=200` in 1.24s, disk 61%, runner servicing tasks normally, swarm lock `free`, no stuck git state. - A hazard body + `docs/GOTCHAS.md` index row keyed `#<this ticket>` should land with the fix, plus the `docs/journal/` entry and `STATUS.md` touch the repo rule requires.
Author
Member

swarm-claim host=bens-mac-04 run=29012
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=29012 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

The ticket raises a decision: add a scoped shellcheck tier to the pre-push gate, OR accept post-push-only lint and document it as a hazard. I am ruling for the latter in this ticket, and filing a separate ready-for-session follow-up for the former. Rationale and why this is a two-way door:

  • The mechanical half (the four SC2155 splits) restores ci / static to green and is the reported fault; it is landing in this ticket, verified clean over the whole gate file set with the pinned shellcheck v0.11.0.
  • The structural half (a shellcheck tier in gate-lib.sh) is genuine design work with a provisioning question I cannot prove safe from the sandbox: the other gate tiers (go/ts/gofmt/docs) fail closed, relying on the consumer flake / PATH to carry the toolchain. Whether every pool host and every consumer flake carries shellcheck is unknown here (cf. #332, the shellcheck-tarball fetch being fraught), and a fail-closed tier that resolves no shellcheck would block the live reconcile rail for every shell-touching push across consumers — a change not revertible by a later commit before it has already red-railed live hosts. That part is not mine to land blind.
  • Documenting the gap as a hazard + filing the tier as a focused follow-up IS a two-way door: fully revertible, and proven by tests/docs-budget-test.sh (the GOTCHAS/journal/STATUS surface) + the suite staying green. The follow-up can settle the fail-open/closed + per-consumer shellcheck provisioning on its own, with the host facts to hand.

Landing here: the 4 SC2155 fixes, GOTCHAS #378 (pre-push runs no shellcheck tier → SC regressions are CI-only, healed by the hourly sweep), a docs/journal/ entry + STATUS surface touch, and a ready-for-session follow-up ticket for the scoped pre-push shellcheck tier.

**Ruled by agent under ADR 0174 — veto anytime.** The ticket raises a decision: add a scoped shellcheck tier to the pre-push gate, OR accept post-push-only lint and document it as a hazard. I am ruling for the latter **in this ticket**, and filing a separate `ready-for-session` follow-up for the former. Rationale and why this is a two-way door: - The mechanical half (the four SC2155 splits) restores `ci / static` to green and is the reported fault; it is landing in this ticket, verified clean over the whole gate file set with the pinned `shellcheck v0.11.0`. - The structural half (a shellcheck tier in `gate-lib.sh`) is genuine design work with a provisioning question I **cannot prove safe from the sandbox**: the other gate tiers (go/ts/gofmt/docs) fail **closed**, relying on the consumer flake / PATH to carry the toolchain. Whether every pool host and every consumer flake carries `shellcheck` is unknown here (cf. #332, the shellcheck-tarball fetch being fraught), and a fail-closed tier that resolves no `shellcheck` would block the **live reconcile rail** for every shell-touching push across consumers — a change not revertible by a later commit *before* it has already red-railed live hosts. That part is not mine to land blind. - Documenting the gap as a hazard + filing the tier as a focused follow-up IS a two-way door: fully revertible, and proven by `tests/docs-budget-test.sh` (the GOTCHAS/journal/STATUS surface) + the suite staying green. The follow-up can settle the fail-open/closed + per-consumer `shellcheck` provisioning on its own, with the host facts to hand. Landing here: the 4 SC2155 fixes, GOTCHAS #378 (pre-push runs no shellcheck tier → SC regressions are CI-only, healed by the hourly sweep), a `docs/journal/` entry + STATUS surface touch, and a `ready-for-session` follow-up ticket for the scoped pre-push shellcheck tier.
Author
Member

⏩ independent reviewer for #378 — verdict unauthenticated

review JSON
{
  "verdict": "unauthenticated",
  "findings": []
}
:fast_forward: **independent reviewer** for #378 — verdict `unauthenticated` <details><summary>review JSON</summary> ```json { "verdict": "unauthenticated", "findings": [] } ``` </details>
Author
Member

close-report for #378 — status success

✅ close-report gates passed — every claim verified against the pushed worker branch sandcastle/worker/20261120020735-3225234 (pre-land — the host promotes it to main only after its post-run verify, #193/#283); issue closed.

envelope
{
  "issue": 378,
  "status": "success",
  "commits": [
    "d3b48f652b04a47b184ef5b7e9860de9710a1cf6"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "docs/gotchas/378-pre-push-runs-no-shellcheck-tier.md",
    "docs/journal/2026-11-20-378.md",
    "list-ready-tasks.sh",
    "tests/fleet-dispatch-test.sh"
  ],
  "tests": [
    {
      "command": "/tmp/scdir/shellcheck-v0.11.0/shellcheck -S warning -x *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence .forgejo/*.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/fleet-dispatch-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/list-ready-tasks-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/docs-budget-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The four SC2155 findings are fixed (list-ready-tasks.sh:308; tests/fleet-dispatch-test.sh:226,238,256) by splitting declaration from command substitution": "commit d3b48f6 — list-ready-tasks.sh splits CLAIM_NOW onto its own line then exports; tests/fleet-dispatch-test.sh uses `X=\"$(...)\"; export X` for the three WAITING_JSON exports",
    "ci/static's shellcheck tier passes over the whole gate file set with the pinned v0.11.0 (the only four findings in the tree cleared)": "shellcheck -S warning -x over the exact ci.yml file set with pinned v0.11.0 now exits 0 (was exit 1 with these four)",
    "tests/fleet-dispatch-test.sh and the claim-liveness/list-ready-tasks suites stay green": "fleet-dispatch-test 41 passed; list-ready-tasks-test 47 passed (full suite: only the two pre-existing environment failures provision-lib/run-swarm-ready-list, present on clean HEAD)",
    "The structural half (no pre-push shellcheck tier) is decided: documented as a hazard + the tier filed as a follow-up (ADR 0174 ruling)": "ADR 0174 ruling posted to #378; GOTCHAS #378 (docs/gotchas/378-pre-push-runs-no-shellcheck-tier.md + index row); scoped-tier follow-up filed as #379 (ready-for-session)",
    "A hazard body + GOTCHAS index row keyed #378, a docs/journal entry, and a STATUS.md surface touch land in the same commit": "commit d3b48f6 adds docs/gotchas/378-*.md + the index row, docs/journal/2026-11-20-378.md, and supersedes #360's stale ci/static blocker in STATUS.md (docs-budget headroom floor kept)"
  },
  "summary": "Cleared the four SC2155 findings reddening ci/static on main by splitting declaration from command substitution; documented the no-pre-push-shellcheck-tier gap as GOTCHAS #378 and filed #379 for the scoped tier (ADR 0174).",
  "blockers": []
}
**close-report** for #378 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the pushed worker branch `sandcastle/worker/20261120020735-3225234` (pre-land — the host promotes it to `main` only after its post-run verify, #193/#283); issue closed. <details><summary>envelope</summary> ```json { "issue": 378, "status": "success", "commits": [ "d3b48f652b04a47b184ef5b7e9860de9710a1cf6" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "docs/gotchas/378-pre-push-runs-no-shellcheck-tier.md", "docs/journal/2026-11-20-378.md", "list-ready-tasks.sh", "tests/fleet-dispatch-test.sh" ], "tests": [ { "command": "/tmp/scdir/shellcheck-v0.11.0/shellcheck -S warning -x *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence .forgejo/*.sh", "exit_code": 0 }, { "command": "bash tests/fleet-dispatch-test.sh", "exit_code": 0 }, { "command": "bash tests/list-ready-tasks-test.sh", "exit_code": 0 }, { "command": "bash tests/docs-budget-test.sh", "exit_code": 0 } ], "criteria": { "The four SC2155 findings are fixed (list-ready-tasks.sh:308; tests/fleet-dispatch-test.sh:226,238,256) by splitting declaration from command substitution": "commit d3b48f6 — list-ready-tasks.sh splits CLAIM_NOW onto its own line then exports; tests/fleet-dispatch-test.sh uses `X=\"$(...)\"; export X` for the three WAITING_JSON exports", "ci/static's shellcheck tier passes over the whole gate file set with the pinned v0.11.0 (the only four findings in the tree cleared)": "shellcheck -S warning -x over the exact ci.yml file set with pinned v0.11.0 now exits 0 (was exit 1 with these four)", "tests/fleet-dispatch-test.sh and the claim-liveness/list-ready-tasks suites stay green": "fleet-dispatch-test 41 passed; list-ready-tasks-test 47 passed (full suite: only the two pre-existing environment failures provision-lib/run-swarm-ready-list, present on clean HEAD)", "The structural half (no pre-push shellcheck tier) is decided: documented as a hazard + the tier filed as a follow-up (ADR 0174 ruling)": "ADR 0174 ruling posted to #378; GOTCHAS #378 (docs/gotchas/378-pre-push-runs-no-shellcheck-tier.md + index row); scoped-tier follow-up filed as #379 (ready-for-session)", "A hazard body + GOTCHAS index row keyed #378, a docs/journal entry, and a STATUS.md surface touch land in the same commit": "commit d3b48f6 adds docs/gotchas/378-*.md + the index row, docs/journal/2026-11-20-378.md, and supersedes #360's stale ci/static blocker in STATUS.md (docs-budget headroom floor kept)" }, "summary": "Cleared the four SC2155 findings reddening ci/static on main by splitting declaration from command substitution; documented the no-pre-push-shellcheck-tier gap as GOTCHAS #378 and filed #379 for the scoped tier (ADR 0174).", "blockers": [] } ``` </details>
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#378
No description provided.