fix(ops-yolo): extract STATE.md walker to bin/ops-gsd-states for shell portability#201
Conversation
…l portability
The Phase 1 data-gathering block in skills/ops-yolo/SKILL.md used the bash-only
parameter expansion `${d/#\~/$HOME}` inside a `! ` inline shell block. When the
host runs that block under `sh`/`dash` (which Claude Code's pre-execution path
appears to do), the expansion is a syntax error and the whole block aborts
before the STATE.md aggregation runs — taking the rest of the YOLO session
data-gathering down with it.
Pull the loop into a real `bin/ops-gsd-states` script with `#!/usr/bin/env bash`
so the bashism is guaranteed to run under bash. Matches the convention of every
other Phase 1 block (each is already a thin shim around a bin script).
Behaviorally identical: same registry filter, same path expansion, same output
format ("=== <basename> ===" header + STATE.md body + "---" separator).
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 6 minutes and 29 seconds.Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 9df11d6. Configure here.
| cat "$state" | ||
| printf -- '---\n' | ||
| fi | ||
| done |
There was a problem hiding this comment.
pipefail causes non-zero exit when jq encounters unexpected registry content
Low Severity
The jq ... | while ... done pipeline is the last command in the script, and pipefail is set. If jq exits non-zero (e.g., registry contains {} with no .projects key, or .projects is null), the pipeline's exit status becomes non-zero and the script exits with failure. The old inline for d in $(jq ... 2>/dev/null) form silently produced an empty list on jq failure. The caller's || true prevents Phase 1 from breaking, but the script itself violates its documented "silent exit 0" contract for degraded-registry cases. Other bin scripts (like ops-git) avoid this by using for loops over command substitutions rather than piping into while.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 9df11d6. Configure here.
…203) Patch release rolling up the two YOLO reliability fixes merged this evening: - PR #201: extract STATE.md walker to bin/ops-gsd-states for shell portability. Restores Phase 1 data-gathering after the inline shell block silently aborted under sh/dash on the bash-only `${d/#\~/$HOME}` expansion. - PR #202: add CLAIM VERIFICATION GUARDRAIL to yolo-ceo / yolo-cto / yolo-cfo / yolo-coo so the agents stop reporting false-positive fires (verify against doppler/aws/git log before asserting; label UNVERIFIED when verification is impossible). Bumps: - plugin.json: 2.1.0 -> 2.1.1 - marketplace.json: 2.1.0 -> 2.1.1 - package.json (bin): 1.7.0 -> 1.7.1 CHANGELOG entry under [2.1.1] with details on both fixes and the real-world false-positive cases that motivated the verification rule. No breaking changes; drop-in replacement for 2.1.0.


Summary
skills/ops-yolo/SKILL.mdused a bash-only parameter expansion (\${d/#\~/\$HOME}) inside a!inline shell block.sh/dash, the expansion is a syntax error and the block aborts — taking the rest of the YOLO session data-gathering with it. Repro: invoking/ops:ops-yoloreturned `Shell command failed for pattern "```!\nfor d in $(jq …)"` with no Phase 2 spawn.bin/ops-gsd-stateswith an explicit#!/usr/bin/env bashshebang. Same convention as every other Phase 1 block (each is already a thin shim around a bin script).Test plan
bin/ops-gsd-statesruns standalone, returns STATE.md aggregation, exit 0=== <basename> ===header + STATE.md body +---separator2>/dev/nullswallow behavior)/ops:ops-yoloPhase 1 completes end-to-end after this landsNote
Low Risk
Low risk: refactors an inline shell snippet into a standalone script with the same output format, primarily improving shell portability and failure behavior.
Overview
Fixes
/ops:yoloPhase 1 data gathering by replacing the inlinejq/forloop (which used bash-only~expansion and could fail undersh) with a newbin/ops-gsd-statesscript that runs underbashand reuseslib/registry-path.sh.The new script walks
gsd: trueprojects fromregistry.json, concatenates any.planning/STATE.mdfiles with the existing=== name ===header and---separator, and exits cleanly when the registry is missing;skills/ops-yolo/SKILL.mdnow calls this script instead of embedding the loop.Reviewed by Cursor Bugbot for commit 9df11d6. Bugbot is set up for automated code reviews on this repo. Configure here.