Repository navigation
Description
Follow-up nit from FIDO's pass-3 review of #1832 (merged). Filed rather than fixed in-PR because the review verdict was APPROVE/merge-as-is and the path is not reachable from either real producer.
Measured
workflows/squad.md, Step PC-0, normalizes the dispatched command with an awk program gated on NR==1:
printf '%s\n' "$SQUAD_DISPATCH_COMMAND" | awk 'NR==1{sub(/\r$/,""); sub(/^[[:space:]]+/,""); sub(/[[:space:]]+$/,""); if($0==""){print "EMPTY_DISPATCH"; exit} if($0 ~ /^\/squad([[:space:]]|$)/) print; else print "/squad " $0}'Because the program only ever inspects record 1, a value whose first character is a newline puts an empty string on that record:
PC0($'\nimplement') → EMPTY_DISPATCH
EMPTY_DISPATCH routes to the activation guard, which halts with a ::warning:: and no comment — by design, so that empty activation probes stay side-effect free (PR #1777, junk issues #12/#14). So a structurally valid implement dispatch would halt silently rather than run.
Silent-halt-on-valid-input is the same defect class #1824 and #1832 exist to close.
Why this is a nit and not a defect
FIDO enumerated the producers that can reach PC-0:
workflows/squad-implement-worker.md:259— relays a literal single-token value ("command": "implement").- The
workflow_dispatchUI input — single-line by schema.
Neither can emit a leading newline. Reaching this requires a crafted actions: write API payload, and an actor holding actions: write has strictly larger capabilities available already. FIDO marked the mechanism real but unreachable, and untested.
Suggested fix
Scan the first non-empty line instead of record 1, so leading blank lines are skipped rather than treated as an empty command. Keep EMPTY_DISPATCH for genuinely empty/whitespace-only input.
Add a test alongside the existing PC-0 cases in test/gh-aw-command-parse.test.ts. Per the standing bar, the test must be mutation-proven capable of failing, and its failure message must name the offending input — a status-only assertion would pass a truncating parser.
Acceptance
PC0($'\nimplement')yields/squad implement.PC0('')andPC0(' ')still yieldEMPTY_DISPATCH.- Reverting the fix turns the new test red, and the failure text names the input.
- Existing PC-0 cases (idempotent prefix, whitespace trim, empty dispatch) stay green, and the load-bearing PC-1 cases (indented, mid-sentence) are untouched.
Source: FIDO pass-3, probe A — https://github.com/bradygaster/squad/pull/1832#issuecomment-5383877533
Activity
fix(gh-aw): scan the first non-empty line in PC-0, not record 1 (gith…