Skip to content

Postmortem — Weekly roadmap summary bash syntax error (2026-05-18)

Postmortem — Weekly roadmap summary bash syntax error (2026-05-18)

Section titled “Postmortem — Weekly roadmap summary bash syntax error (2026-05-18)”

scripts/roadmap-summary.sh used [[ "$due" <= "$SOON" ]], which is invalid bash. The Weekly roadmap summary workflow has crashed on every Monday cron since PR #131 (2026-04-23). main-guard finally surfaced the failure as rig-docs#269, attributing it to PR #268 because that was the last merge before the May 18 cron fired.

ItemValue
Reported incidentrig-docs#269
Cited “culprit PR”#268 (docs-only postmortem; not the actual cause)
Real causeBash conditional [[ "$due" <= "$SOON" ]]<= is not a valid [[ ]] operator
Introduced in#1314b6ad66 (2026-04-23)
Mondays affected2026-04-27, 05-04, 05-11, 05-18 (4 silent failures)
Why undetectedmain-guard (rig-conductor Phase 1) only recently began monitoring cron workflows
FixReplace <= with ! > (i.e. [[ ! "$due" > "$SOON" ]]) and add bash -n coverage for scripts/*.sh to npm run build
  1. PR #131 (2026-04-23) added the Weekly roadmap summary workflow and scripts/roadmap-summary.sh.
  2. The script’s deadline_summary function used the bash conditional [[ "$due" <= "$SOON" ]]. Bash [[ ]] supports < and > for string comparison but not <= or >=. The presence of <= causes the function body to fail parsing at runtime → syntax error in conditional expression → exit 2.
  3. Because the syntax error fires when deadline_summary is invoked, every Monday cron run since 2026-04-23 has failed — but no monitor was watching cron failures.
  4. On 2026-05-18, main-guard (rig-conductor Phase 1) sampled the failed run and filed rig-docs#269. The cited “culprit” PR #268 was simply the last merge before the cron fired; PR #268 added a markdown postmortem and could not have caused the script failure.
Terminal window
git checkout ad0c912e # main HEAD before the fix
bash scripts/roadmap-summary.sh
# → scripts/roadmap-summary.sh: line 75: syntax error in conditional expression
# → exit 2
BeforeAfter
elif [[ "$due" <= "$SOON" ]]; thenelif [[ ! "$due" > "$SOON" ]]; then

! > expresses “not strictly after” — i.e. “on or before”. Equivalent to the intended <=.

Terminal window
bash -n scripts/roadmap-summary.sh # parse-ok

Plus an inline truth-table check (overdue and soon counts match expectations for sample dates around TODAY and SOON).

#Lesson
1Bash [[ ]] does not support <= or >=. Use ! > / ! < or fall back to ((..)) for numeric / date -d for dates.
2Run bash -n script.sh in CI for every new shell script. A single shellcheck/parse step would have caught this in PR #131.
3set -euo pipefail does not protect against syntax errors that only surface inside function bodies — those fire at call time, not at script load.
4main-guard correctly identified a real failing run but mis-attributed the culprit PR. Cron workflows have no merge-to-blame mapping; attribution should be <unknown culprit — cron schedule> rather than “last merge before fire time”. Track follow-up in rig-conductor.
5Long-running cron failures need a separate alert path. main-guard waited a month before catching this.

The build command now runs:

Terminal window
npm run check:shell && astro build

check:shell runs bash -n scripts/*.sh. That would have failed PR #131 before merge because bash -n scripts/roadmap-summary.sh exits with syntax error in conditional expression on the invalid operator.

  • File rig-conductor issue: main-guard should not attribute cron failures to the last merged PR; cron workflows lack a culprit.
  • Backfill: confirm no roadmap status was actually missed beyond the silent gap (no Discord posts since 2026-04-23).