Skip to content

fix(scripts): fall back to simple_yaml when PyYAML is absent during setup#81

Merged
danielvm-git merged 1 commit into
mainfrom
fix/setup-pyyaml-missing-77
Jul 19, 2026
Merged

fix(scripts): fall back to simple_yaml when PyYAML is absent during setup#81
danielvm-git merged 1 commit into
mainfrom
fix/setup-pyyaml-missing-77

Conversation

@danielvm-git

Copy link
Copy Markdown
Owner

Summary

bigpowers setup crashed on a stock macOS python3 without PyYAML (Issue #77). python-env.sh deliberately warns-and-continues without PyYAML, but two setup-path scripts hard-depended on it:

  • scripts/lib/srp-engine.pyimport yaml at module load → ModuleNotFoundError (the reported traceback).
  • scripts/validate-skill-yaml.pyexcept ImportError: sys.exit(2), which sync-post.sh turns into sync-skills: FAIL. A second landmine reached only once the first is fixed.

Fix

  • Both scripts now fall back to the repo's dependency-free scripts/lib/simple_yaml.py (story e38s01) via a _load_yaml shim — chosen over pip install (PEP 668 externally-managed-environment fragility).
  • simple_yaml.py gains double-quoted-escape unescaping and folded/literal block-scalar (> / |) support, so the PyYAML-free path is byte-identical to PyYAML across all skill frontmatter.
  • scripts/sync-skills.sh — corrected the misleading targets.yaml missing warning (it also fires when yq is absent).
  • New scripts/test-setup-no-pyyaml.sh recurrence guard; bug SoT in specs/bugs/.

Test plan

  • Reproduced the crash under a fresh no-PyYAML venv (srp-engine exit 1, validate exit 2); both now exit 0.
  • Full sync-skills.sh under a no-PyYAML interpreter → exit 0, zero drift in generated .cursor/.gemini/.pi artifacts.
  • scripts/test-setup-no-pyyaml.sh → 3/3 PASS (crash-free + fallback ≡ PyYAML for all skills).
  • Preflight: npm run compliance PASS · verification gates 11/11 · trace-stories --strict exit 0.
  • Verified zero blast radius on trace-matrix output (base vs modified simple_yaml identical).

Closes #77

…etup

bigpowers setup crashed on a stock python3 without PyYAML: srp-engine.py
imported yaml at module load (ModuleNotFoundError), and validate-skill-yaml.py
exited 2. Both now fall back to the dependency-free scripts/lib/simple_yaml.py.

simple_yaml gains double-quoted-escape unescaping and folded/literal block
scalar support so the PyYAML-free path is byte-identical to PyYAML across all
skill frontmatter. Also corrects the misleading "targets.yaml missing" warning,
which also fires when yq is absent.

Adds scripts/test-setup-no-pyyaml.sh as a recurrence guard.
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@danielvm-git
danielvm-git merged commit 2608c64 into main Jul 19, 2026
2 checks passed
@danielvm-git
danielvm-git deleted the fix/setup-pyyaml-missing-77 branch July 19, 2026 00:19
github-actions Bot pushed a commit that referenced this pull request Jul 19, 2026
## [2.77.2](v2.77.1...v2.77.2) (2026-07-19)

### Bug Fixes

* **scripts:** fall back to simple_yaml when PyYAML is absent during setup ([#81](#81)) ([2608c64](2608c64))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.77.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup command is failing on MacOS 15.7.2

1 participant