Skip to content

fix(ops-yolo): extract STATE.md walker to bin/ops-gsd-states for shell portability#201

Merged
auroracapital merged 1 commit intomainfrom
fix/yolo-gsd-states-shell-portability
May 2, 2026
Merged

fix(ops-yolo): extract STATE.md walker to bin/ops-gsd-states for shell portability#201
auroracapital merged 1 commit intomainfrom
fix/yolo-gsd-states-shell-portability

Conversation

@auroracapital
Copy link
Copy Markdown
Collaborator

@auroracapital auroracapital commented May 2, 2026

Summary

  • Phase 1 data-gathering in skills/ops-yolo/SKILL.md used a bash-only parameter expansion (\${d/#\~/\$HOME}) inside a ! inline shell block.
  • When the host runs that block under 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-yolo returned `Shell command failed for pattern "```!\nfor d in $(jq …)"` with no Phase 2 spawn.
  • Fix: extract the loop to bin/ops-gsd-states with an explicit #!/usr/bin/env bash shebang. Same convention as every other Phase 1 block (each is already a thin shim around a bin script).

Test plan

  • bin/ops-gsd-states runs standalone, returns STATE.md aggregation, exit 0
  • Output format unchanged: === <basename> === header + STATE.md body + --- separator
  • No registry → silent exit 0 (matches old 2>/dev/null swallow behavior)
  • /ops:ops-yolo Phase 1 completes end-to-end after this lands

Note

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:yolo Phase 1 data gathering by replacing the inline jq/for loop (which used bash-only ~ expansion and could fail under sh) with a new bin/ops-gsd-states script that runs under bash and reuses lib/registry-path.sh.

The new script walks gsd: true projects from registry.json, concatenates any .planning/STATE.md files with the existing === name === header and --- separator, and exits cleanly when the registry is missing; skills/ops-yolo/SKILL.md now 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.

…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).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Warning

Rate limit exceeded

@auroracapital has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 29 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e7e19d03-a286-4f05-b6f2-45e872eb97d6

📥 Commits

Reviewing files that changed from the base of the PR and between 1c9cf63 and 9df11d6.

📒 Files selected for processing (2)
  • claude-ops/bin/ops-gsd-states
  • claude-ops/skills/ops-yolo/SKILL.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/yolo-gsd-states-shell-portability

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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 6 minutes and 29 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@auroracapital auroracapital merged commit c05b104 into main May 2, 2026
11 checks passed
@auroracapital auroracapital deleted the fix/yolo-gsd-states-shell-portability branch May 2, 2026 03:40
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9df11d6. Configure here.

auroracapital added a commit that referenced this pull request May 2, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant