ci / static: shellcheck reds main on every push since e8ea248 — 8 warnings in the two fleet test files slice 5 (#358) added #360

Closed
opened 2026-11-19 14:13:37 +00:00 by matou-build-agent · 3 comments

Symptom

ci / static has been red on every push to main since e8ea248 and
stays red on current main (040a648). Bisect from the tracker's own task
list (/actions/tasks):

commit static
d468efc, 7a508d6, 9ba740c, 993d238 (slice 1), d2dce28 (slice 2), b9b93a4 (slice 3) success
e8ea248 (slice 5, #358) failure (312392)
280021e failure (314074)
040a648 failure (314152)

ci / test is green throughout — only the static leg is red, so the gate
produces no usable signal on main.

Root cause

shellcheck -S warning -x finds 8 warnings, all in the two test files
e8ea248 added/extended. Reproduced byte-for-byte at 280021e with the
pinned shellcheck v0.11.0 from the runner cache (whole-tree run: these
8 and nothing else):

tests/fleet-landing-detect-lib-test.sh:119  SC2164  cd "$repo" without || exit
tests/fleet-landing-detect-lib-test.sh:172  SC1007  FLEET_LANDING_NOW= date ... (space after =)
tests/fleet-landing-detect-lib-test.sh:173  SC1007  FLEET_LANDING_NOW= date ... (space after =)
tests/fleet-landing-detect-lib-test.sh:207  SC2155  export CURL_LOG="$(tmpdir)/curl.log"
tests/fleet-dispatch-test.sh:106            SC2164  cd "$det" without || exit
tests/fleet-dispatch-test.sh:116            SC2155  export LANDED_SHA=/STRANDED_SHA="$(cat ...)"
tests/fleet-dispatch-test.sh:119            SC2155  export CR_10="$(cr_comment ...)"
tests/fleet-dispatch-test.sh:120            SC2155  export CR_11="$(cr_comment ...)"

The static job runs set -euo pipefail and fails closed, so these warnings
red the leg. The lint gate landed in #215 and the fleet slices were written
against a green tree — slice 5 is the first that was merged without the leg
passing.

The two SC1007 hits are worth a second look, not just a mechanical fix:

old_iso="$(FLEET_LANDING_NOW= date -u -d @$(( FLEET_LANDING_NOW - FLEET_LANDING_WORKING_GRACE - 60 )) ...)"

The FLEET_LANDING_NOW= prefix blanks the var for date, while the $(( ))
arithmetic is expanded by the parent shell before the assignment applies —
so it happens to compute the intended timestamp, but the prefix reads as a
typo and does nothing useful. Decide whether it was meant to be there at all
rather than quoting around the warning.

Fix

Fix the 8 findings in tests/fleet-landing-detect-lib-test.sh and
tests/fleet-dispatch-test.sh (cd … || exit; split declare/assign for the
export lines; resolve the FLEET_LANDING_NOW= prefixes deliberately), then
prove the whole leg locally before closing:

for f in *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence; do bash -n "$f"; done
shellcheck -S warning -x *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence

and re-run the offline suite, since the test files themselves are changing.

Scope note

This is product-class — the fault is in the factory source at the repo
root (tests/*.sh), not in the running vendored .sandcastle/ copy, so the
healer did not touch it (charter: file, don't fix). Nothing reaches a running
worker here either way: tests/ is not vendored, so no re-vendor is needed
once this lands — but note that a root fix in general does not reach the
running .sandcastle/ copy until a human bumps FACTORY_REF.

Evidence

  • Healer signature 5653c0ad3cd5, mode watchdog (always-red), heal run
    heal-Matou-dev-factory-1795097255-2232812, host matou-dev-server-01.
  • runs.json: static 2/2 failure, test 2/2 success in the window.
  • The bundled job-log.txt is the green test leg — this Forgejo exposes
    no job-log endpoint (/actions/runs/28833/jobs → 404), so the static leg's
    own output is not in the bundle. The findings above come from a local
    re-run of the job's exact command in a fresh clone at 280021e.
  • Per-change state: this needs a docs/journal/ entry + a STATUS.md
    blocker row per CLAUDE.md when it lands.
## Symptom `ci / static` has been red on **every** push to `main` since e8ea248 and stays red on current `main` (040a648). Bisect from the tracker's own task list (`/actions/tasks`): | commit | `static` | | --- | --- | | d468efc, 7a508d6, 9ba740c, 993d238 (slice 1), d2dce28 (slice 2), b9b93a4 (slice 3) | success | | **e8ea248** (slice 5, #358) | **failure** (312392) | | 280021e | failure (314074) | | 040a648 | failure (314152) | `ci / test` is green throughout — only the static leg is red, so the gate produces no usable signal on `main`. ## Root cause `shellcheck -S warning -x` finds 8 warnings, all in the two test files e8ea248 added/extended. Reproduced byte-for-byte at 280021e with the pinned `shellcheck v0.11.0` from the runner cache (whole-tree run: these 8 and nothing else): ``` tests/fleet-landing-detect-lib-test.sh:119 SC2164 cd "$repo" without || exit tests/fleet-landing-detect-lib-test.sh:172 SC1007 FLEET_LANDING_NOW= date ... (space after =) tests/fleet-landing-detect-lib-test.sh:173 SC1007 FLEET_LANDING_NOW= date ... (space after =) tests/fleet-landing-detect-lib-test.sh:207 SC2155 export CURL_LOG="$(tmpdir)/curl.log" tests/fleet-dispatch-test.sh:106 SC2164 cd "$det" without || exit tests/fleet-dispatch-test.sh:116 SC2155 export LANDED_SHA=/STRANDED_SHA="$(cat ...)" tests/fleet-dispatch-test.sh:119 SC2155 export CR_10="$(cr_comment ...)" tests/fleet-dispatch-test.sh:120 SC2155 export CR_11="$(cr_comment ...)" ``` The `static` job runs `set -euo pipefail` and fails closed, so these warnings red the leg. The lint gate landed in #215 and the fleet slices were written against a green tree — slice 5 is the first that was merged without the leg passing. The two **SC1007** hits are worth a second look, not just a mechanical fix: ```sh old_iso="$(FLEET_LANDING_NOW= date -u -d @$(( FLEET_LANDING_NOW - FLEET_LANDING_WORKING_GRACE - 60 )) ...)" ``` The `FLEET_LANDING_NOW=` prefix blanks the var for `date`, while the `$(( ))` arithmetic is expanded by the *parent* shell before the assignment applies — so it happens to compute the intended timestamp, but the prefix reads as a typo and does nothing useful. Decide whether it was meant to be there at all rather than quoting around the warning. ## Fix Fix the 8 findings in `tests/fleet-landing-detect-lib-test.sh` and `tests/fleet-dispatch-test.sh` (`cd … || exit`; split declare/assign for the `export` lines; resolve the `FLEET_LANDING_NOW=` prefixes deliberately), then prove the whole leg locally before closing: ```sh for f in *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence; do bash -n "$f"; done shellcheck -S warning -x *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence ``` and re-run the offline suite, since the test files themselves are changing. ## Scope note This is **product-class** — the fault is in the factory source at the repo root (`tests/*.sh`), not in the running vendored `.sandcastle/` copy, so the healer did not touch it (charter: file, don't fix). Nothing reaches a running worker here either way: `tests/` is not vendored, so no re-vendor is needed once this lands — but note that a root fix in general does not reach the running `.sandcastle/` copy until a human bumps `FACTORY_REF`. ## Evidence - Healer signature `5653c0ad3cd5`, mode watchdog (`always-red`), heal run `heal-Matou-dev-factory-1795097255-2232812`, host `matou-dev-server-01`. - `runs.json`: `static` 2/2 failure, `test` 2/2 success in the window. - The bundled `job-log.txt` is the **green `test`** leg — this Forgejo exposes no job-log endpoint (`/actions/runs/28833/jobs` → 404), so the static leg's own output is not in the bundle. The findings above come from a local re-run of the job's exact command in a fresh clone at 280021e. - Per-change state: this needs a `docs/journal/` entry + a `STATUS.md` blocker row per CLAUDE.md when it lands.
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=28843
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=28843 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

⏩ independent reviewer for #360 — verdict unauthenticated

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

close-report for #360 — status success

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

envelope
{
  "issue": 360,
  "status": "success",
  "commits": [
    "b845c29"
  ],
  "changed_files": [
    "tests/fleet-dispatch-test.sh",
    "tests/fleet-landing-detect-lib-test.sh",
    "STATUS.md",
    "docs/journal/2026-11-19-360.md"
  ],
  "tests": [
    {
      "command": "shellcheck -S warning -x *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence (v0.11.0)",
      "exit_code": 0
    },
    {
      "command": "for f in *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence; do bash -n \"$f\"; done",
      "exit_code": 0
    },
    {
      "command": "bash tests/fleet-landing-detect-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/fleet-dispatch-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/docs-budget-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Fix the 8 shellcheck findings in the two fleet test files": "commit b845c29: SC2164 cd||exit (both files); SC2155 split declare/assign on the 4 export lines; SC1007 FLEET_LANDING_NOW= prefixes removed as dead",
    "Resolve the FLEET_LANDING_NOW= prefixes deliberately, not by quoting": "removed entirely — FLEET_LANDING_NOW is a fixed fixture (=1000000), date never reads it, the $(( )) arithmetic uses the parent shell's exported value; behaviour byte-identical (see commit msg + journal)",
    "Prove the whole static leg locally before closing (bash -n + shellcheck whole tree)": "both ran clean with pinned shellcheck v0.11.0 over *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence",
    "Re-run the offline suite since the test files changed": "both touched files green; full suite green except pre-existing env-dependent tests/provision-lib-test.sh (needs docker /var/lib data root, confirmed failing on clean tree, outside slice)",
    "Per-change state: docs/journal entry + STATUS.md blocker row": "docs/journal/2026-11-19-360.md added + STATUS.md #360 blocker row, same commit"
  },
  "summary": "Fixed the 8 shellcheck warnings in the two fleet test files that reddened ci/static on main since e8ea248.",
  "blockers": []
}
**close-report** for #360 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the pushed worker branch `sandcastle/worker/20261119-141805-b375a7` (pre-land — the host promotes it to `main` only after its post-run verify, #193/#283); issue closed. <details><summary>envelope</summary> ```json { "issue": 360, "status": "success", "commits": [ "b845c29" ], "changed_files": [ "tests/fleet-dispatch-test.sh", "tests/fleet-landing-detect-lib-test.sh", "STATUS.md", "docs/journal/2026-11-19-360.md" ], "tests": [ { "command": "shellcheck -S warning -x *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence (v0.11.0)", "exit_code": 0 }, { "command": "for f in *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence; do bash -n \"$f\"; done", "exit_code": 0 }, { "command": "bash tests/fleet-landing-detect-lib-test.sh", "exit_code": 0 }, { "command": "bash tests/fleet-dispatch-test.sh", "exit_code": 0 }, { "command": "bash tests/docs-budget-test.sh", "exit_code": 0 } ], "criteria": { "Fix the 8 shellcheck findings in the two fleet test files": "commit b845c29: SC2164 cd||exit (both files); SC2155 split declare/assign on the 4 export lines; SC1007 FLEET_LANDING_NOW= prefixes removed as dead", "Resolve the FLEET_LANDING_NOW= prefixes deliberately, not by quoting": "removed entirely — FLEET_LANDING_NOW is a fixed fixture (=1000000), date never reads it, the $(( )) arithmetic uses the parent shell's exported value; behaviour byte-identical (see commit msg + journal)", "Prove the whole static leg locally before closing (bash -n + shellcheck whole tree)": "both ran clean with pinned shellcheck v0.11.0 over *.sh onboarding/*.sh onboarding/tests/*.sh tests/*.sh git-hooks/* git-fence", "Re-run the offline suite since the test files changed": "both touched files green; full suite green except pre-existing env-dependent tests/provision-lib-test.sh (needs docker /var/lib data root, confirmed failing on clean tree, outside slice)", "Per-change state: docs/journal entry + STATUS.md blocker row": "docs/journal/2026-11-19-360.md added + STATUS.md #360 blocker row, same commit" }, "summary": "Fixed the 8 shellcheck warnings in the two fleet test files that reddened ci/static on main since e8ea248.", "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#360
No description provided.