Repository navigation
Conversation
…ffolding
The no-mistakes (default-mode) Definition-of-done block was assigned via
DOD=$(cat <<EOF ... EOF), and its body contains an apostrophe ("no-mistakes'").
GNU bash 3.2.57 (stock /bin/bash on macOS) mis-tokenizes that apostrophe inside
$(...) command substitution as an opening single-quote and scans to EOF for a
match, so `bash -n bin/fm-brief.sh` errors and the default task path cannot
scaffold a brief at all on a stock-bash machine. Bash 5.x parses it fine, and
the --scout / direct-PR / local-only here-docs happen to contain no apostrophe,
which is why it went unnoticed.
A quoted delimiter (<<'EOF') does not help: the bug is in the command-sub
parser, not heredoc quoting. The same here-doc body parses fine at statement
level. Fix moves every mode's Definition-of-done out of $(...) and appends it
directly to the brief with `cat >> "$BRIEF" <<EOF`. Bodies are byte-identical
and the assembled brief output is unchanged for all modes (verified: identical
single blank line at the join, backticks and $ID interpolation preserved).
$ /bin/bash -n bin/fm-brief.sh # before: error line 211/263; after: exit 0
|
@scar-sh sorry my claude was trying to operate on my fork and it commented here. I think this fix is valid |
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Nov 2, 2026
…nchenguid#121) * fix(bin): stop bounded probes losing their answer to the terminal fm_run_timeout runs its command in its own process group so a timeout can kill the whole group. That also moves the command out of the terminal's foreground process group, so a probed CLI that touches the terminal takes SIGTTOU and stops until the bound kills it. The caller then reads an empty answer from a perfectly healthy tool. The failure is invisible without a terminal, which is why it reached a release: every non-interactive caller and test saw the same probe pass. Interactively it refused `firstmate claude`, whose account seat check read nothing from a logged-in home and concluded it could not prove the seat. Codex profiles were unaffected only because no account is pinned for them. Detach stdin instead of surrendering the group kill, so runaway children stay bounded. Every caller here is a read-only probe with no stdin to pass through, and bin/fm-toolchain-lib.sh already carried this redirect at its own call site before the helper owned it. Verified under a real pseudo-terminal: unfixed reads OUT=[] RC=124, fixed reads OUT=[PROBE-OK] RC=0, on both the timeout(1) and perl fallback paths. * no-mistakes(review): harden pty test drain, leak guard, python3 prereq; drop redundant redirect * no-mistakes(document): test: self-skip timeout pty test without python3 * fix(fork-surface): claim tests/fm-timeout-lib.test.sh under upstream-drift-detect The new pty test for bin/fm-timeout-lib.sh was an unclaimed fork-only path, which failed the Declared fork surface check and the live-manifest assertion in tests/fm-fork-surface.test.sh inside portable-serial-1. The capability that owns the helper now owns and is proven by its test. Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
Problem
On stock macOS Bash (GNU bash 3.2.57, i.e.
/bin/bash),bin/fm-brief.shfails to parse:This breaks the default task path: no-mistakes-mode briefs cannot be scaffolded at all on a stock-bash machine. It went unnoticed because modern bash (5.x) parses the file fine.
Root cause
The no-mistakes (default-mode) Definition-of-done block was assigned via command substitution wrapping a here-doc:
That here-doc body contains an apostrophe (
no-mistakes'). Bash 3.2's command-substitution parser mis-tokenizes the apostrophe inside$(...)as an opening single-quote and scans to EOF looking for its match. The--scout,direct-PR, andlocal-onlyhere-docs happen to contain no apostrophe, so only the default path errored.A quoted delimiter (
<<'EOF') does not fix it — the bug is in the$(...)command-substitution parser itself, not heredoc quoting (verified: an apostrophe in a<<'EOF'body inside$(...)still breaks bash 3.2). The same here-doc body parses fine at statement level.Fix
Move every mode's Definition-of-done out of
$(...)and append it directly to the brief withcat >> "$BRIEF" <<EOF. The here-doc bodies are byte-identical to before — this is a parser-compatibility fix, not a content change. The assembled brief output is unchanged for all modes: same single blank line at the Project-memory → Definition-of-done join, and$IDinterpolation plus escaped backticks preserved.Validation (stock Bash 3.2.57,
/bin/bash)bash -nbefore vs after:Functionally scaffolded a complete, correct brief under
/bin/bashfor every mode and inspected the output:data/projects.md); unknown-project fallback (→ no-mistakes) also exercised./no-mistakesinvocation,no-mistakes axi run --help, the ask-user /--yesrules, and thedone: PR {url} checks greenline.\`), and$IDinterpolated correctly in Setup, Rule 1, and the local-only/direct-PR DoD.Diff is limited to
bin/fm-brief.sh.