Skip to content

fix(audits): run on bash 3.2 — mapfile and declare -A retired from the gate scripts - #29

Merged
indykish merged 2 commits into
mainfrom
fix/bash-32-portability-gloss-and-logging
Sep 4, 2026
Merged

fix(audits): run on bash 3.2 — mapfile and declare -A retired from the gate scripts#29
indykish merged 2 commits into
mainfrom
fix/bash-32-portability-gloss-and-logging

Conversation

@indykish

@indykish indykish commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

macOS ships bash 3.2, and the gate scripts used mapfile and declare -A, both bash 4+. Every eval and every pre-push make audit died at the first one on a developer machine, so the audit only ever really ran in CI on ubuntu.

mapfile -t becomes a while read loop; the gloss map becomes a case-based lookup; the Zig loop is guarded. Behaviour is unchanged on bash 5.

Verified on macOS bash 3.2: make audit green (fixture evals 43/43, parity 5/5, ledger 23/23).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BSLUVqAJkk9Yj3TfSC3U2Z

indykish and others added 2 commits September 1, 2026 10:08
…om the gate scripts

Mirrored from agentsfleet cb5c1e6f5: eleven mapfile sites and one
associative array made every materialised gate unable to run on a
machine whose only bash is macOS's 3.2. Same while-read idiom the
playbook runner already documents; behaviour identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5YvktdMxgWFA718hFMF7n
…e Zig loop

macOS ships bash 3.2 and every gate script is `#!/usr/bin/env bash`, so two
constructs aborted audits on a stock Mac.

- dispatch/lib.sh: DISPATCH_GLOSS was `declare -A`, bash 4+. It is now a
  heredoc string of the same `[CODE]="Gloss"` lines, looked up by parameter
  expansion — no fork per finding. The line shape is load-bearing:
  evals/dispatch/coverage.sh greps lib.sh for it in checks (f) and (g), and
  both still pass, so the map stays byte-comparable with RULES.md.
- audits/logging.sh: the `scoped_eligible` loop expanded "${zig_nontest[@]}"
  unguarded. Under `set -u`, bash 3.2 treats an empty array expansion as
  unbound (fixed only in 4.4), so the audit died with `zig_nontest[@]:
  unbound variable` in any repository with no Zig sources — the Rust
  repository that found this. Now guarded like its five sibling loops.

Verified under /bin/bash 3.2.57: every audits/*.sh and dispatch/*.sh runs to
completion, dispatch_gloss resolves known and unknown codes, and
evals/dispatch/coverage.sh reports ALL CHECKS PASSED.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014zKP6T6yddUB5xaxNPrpR1
@indykish
indykish merged commit b39e345 into main Sep 4, 2026
4 checks passed
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants