Both arity assertions matched on `jq) returned N field(s)` — a needle
that starts in the middle of the script's `(parser name)` parenthetical.
On a real failure the harness prints `missing <needle>`, so the line
came out as:
FAIL: empty parser output count: missing jq) returned 0 field(s)
which reads as if the script's own message had an unbalanced paren. It
does not; the needle was just sliced. Matching on
`policy parser (jq) returned N field(s)` makes the failure readable and
also pins that the refusal names the parser it used, which the narrower
needle did not.
make_jq() PATH-prefixes a fake jq, so `_PARSER_NAME` is deterministically
"jq" in both tests; the wider needle cannot flake on a host without jq.
Re-proved on this revision, because a disproof is about a revision and
not a file:
* suite exit 0, "PASS: probe member credentials guards"
* bash -n rc=0 on the test under /bin/bash 3.2.57 and bash 5.3.9
* dropping the empty-parse special case -> FAIL: empty parser output
count: missing policy parser (jq) returned 0 field(s)
* arity threshold 5 -> 0 -> FAIL: short parser output status
* script restored byte-identical after each, green control after both
PR #523 extracted parse_policy_fields() but left about 25 lines of
explanatory comments at the old parse site in main(). That is the same
defect class as fleetd #500 itself — a stated fact that no longer
matches the code next to it — in the very file whose ticket history is
about it.
Three blocks moved, no code touched:
* "One parse pass" + the mapfile/process-substitution reasoning now sits
above parse_policy_fields(), which is what it describes.
* The arity-check block now sits inside the function, directly above
`if (( ${#_FIELDS[@]} < 5 ))`. At the old site it said "the slice just
below this" and "every line below this expects", both pointing at a
function call rather than the check. Reworded to name main() and its
slice explicitly.
* The pipefail note said the parser failure was "handled below"; the
handling is now above it, in the function.
The call site keeps a three-line pointer saying where the reasoning went.
Checked myself, on this revision:
* suite exit 0, "PASS: probe member credentials guards"
* bash -n rc=0 under /bin/bash 3.2.57 and bash 5.3.9
* two mutations killed, each proven applied two ways (mutant present AND
original gone), restored byte-identical, green control after each:
- dropping the empty-parse special case -> FAIL: empty parser output
count
- arity threshold 5 -> 0 -> FAIL: short parser output status