fix(brief): restore bash 3.2 parse of the no-mistakes definition-of-done - #1163
Open
ICGNU3 wants to merge 1 commit into
Open
fix(brief): restore bash 3.2 parse of the no-mistakes definition-of-done#1163ICGNU3 wants to merge 1 commit into
ICGNU3 wants to merge 1 commit into
Conversation
bin/fm-brief.sh has not parsed under stock macOS bash since kunchenguid#945: bin/fm-brief.sh: line 314: unexpected EOF while looking for matching `'' bin/fm-brief.sh: line 388: syntax error: unexpected end of file Bash 3.2 mis-scans a bare apostrophe inside a heredoc nested in $( ), treating it as an unterminated quote and failing the entire file. The apostrophe in "firstmate's authority check" is enough to trigger it. Interpolate it through $APOS so the scanner never sees a bare quote. The generated brief text is unchanged byte for byte, which matters because tests/fm-ask-user-authority.test.sh pins that exact sentence. Scope is one file. bin/fm-teardown.sh and every other script are untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V5bvMEeW6SqECT3kg4Utry
This was referenced Jul 28, 2026
|
Firstmate's own tooling can't start any worker right now — the step that writes a worker's instructions crashes on this Mac's built-in shell. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failure mode
bin/fm-brief.shhas not parsed under stock macOS bash since #945:Bash 3.2 mis-scans a bare apostrophe inside a heredoc nested in
$( ), treating it as an unterminated single quote and failing the whole file. The apostrophe infirstmate's authority check(line 328, added by #945) is enough on its own.Minimal reproduction:
Quoting the delimiter (
<<'EOF') does not help; the$( )scan is what breaks.Why CI is green: the runner is Linux with bash 5, where the file is valid. This is invisible from CI and only bites macOS users, where
fm-brief.shcannot execute at all, so brief scaffolding is dead.ShellCheck also reports the file as clean, since it parses as modern bash.
bash -nunder 3.2 is the only signal.This is a regression, not an unsupported platform. Every other script in
bin/parses under bash 3.2, and the repo uses no bash 4+ constructs (nodeclare -A, no${var,,}, nomapfile/readarray).Correction
Interpolate the apostrophe through
$APOSso the scanner never encounters a bare quote. The heredoc is unquoted, so${APOS}expands normally and the generated brief text is unchanged byte for byte — which matters, becausetests/fm-ask-user-authority.test.shpins that exact sentence.I first tried simply rewording the possessive; that broke the contract test, which is the correct outcome. The brief text is a contract, so the mechanism is what changed instead.
Scope
One file.
bin/fm-brief.sh, +9/-1, and the only behavioral line is the${APOS}interpolation; the rest is the comment explaining the constraint.bin/fm-teardown.shis untouched, as is every other script. Confirmed against this branch:git diff --name-only origin/mainlistsbin/fm-brief.shand nothing elsetests/fm-teardown.test.sh: 32/32, identical to theorigin/mainbaselineTests
On this branch (
origin/main+ this commit), macOS bash 3.2:fm-brieffm-ask-user-authorityfm-tangle-guardfm-secondmate-safetyfm-teardownfm-secondmate-safetygoing from an immediate abort to 59 passing shows the reach: it depends on brief scaffolding and could not get past it.shellcheck -e SC1091 bin/fm-brief.shis clean, and/bin/bash -n bin/fm-brief.shnow exits 0.