Summary
Discovered a critical bug in yq-to-jq pipelines: yq (kislyuk v3.4.3) returns JSON strings with literal quote characters (\") preserved in the output. Piping directly to jq breaks: the quotes are part of the string value, not JSON delimiters. Solution: implement strip_quotes() bash helper to clean the output before JSON parsing. This pattern applies to any bash script using yq output as JSON input.
What changed operationally
Before: eval-traces.sh (H3) failed silently when scoring traces — jq would error or return wrong values because yq output contained escaped quotes. After: Appliedstrip_quotes() function (lines 45-50 in eval-traces.sh) to strip leading/trailing escaped quotes before piping to jq. All traces now score correctly.
The fix:
Business impact
- H3 (trace evaluation) now produces accurate quality baselines (0.305-0.853 range validated)
- H4 (campaign activation) gates work correctly based on accurate scores
- H5-H8 refinement loop has correct baseline for regression detection
Operational takeaway
yq is powerful but has sharp edges. Always test yq output before piping to jq. If yq -r output is feeding JSON consumers, addstrip_quotes(). Document this in doctrines (BASH-EVAL-TRACE-PIPELINE.doctrine.md) for future bash maintainers.