validate-module.py: line-based YAML parser gives false fails and false passes; any '*-setup' folder hijacks detection

Đang mở
#129 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, yaml
Lĩnh vực
testing, tooling

Hướng nghiên cứu

Start with skills/bmad-module-builder/scripts/validate-module.py and trace parse_yaml_minimal() and find_setup_skill(); inspect the validator's tests if present. Reproduce the listed YAML, BOM, and setup-folder cases against a copy of skills/. Done means those cases match the expected behavior, including deterministic handling when multiple setup-skill candidates match.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

skills/bmad-module-builder/scripts/validate-module.py:

  1. parse_yaml_minimal() flattens every key: value at any indent, and drops values starting with >. Each change below was applied separately to a copy of bmb's own skills/, which passes with an eval-runner row added:
Change Validator Should be
description: > + indented text (valid YAML) fail: missing or empty required field: description pass
top-level code: removed, a variable block has nested code: nested-value pass, module_code: nested-value fail
module-help.csv saved with a UTF-8 BOM (Excel default) fail: CSV header mismatch: missing: module; extra: \ufeffmodule pass
  1. find_setup_skill() returns the first *-setup directory in raw iterdir() order. It doesn't require a SKILL.md. Adding an empty aaa-old-setup/ next to bmad-bmb-setup/ made the validator report 3 critical "Missing required file" findings against the wrong folder.

Steps to reproduce

cp -r skills /tmp/vm && cd /tmp/vm
mkdir aaa-old-setup
python3 <bmb>/skills/bmad-module-builder/scripts/validate-module.py .
# setup_skill: aaa-old-setup -> 3 critical findings

Expected behavior

  • Load module.yaml with a real YAML parser (yaml.safe_load), checking top-level keys only.
  • Read the CSV as utf-8-sig.
  • Treat only directories with SKILL.md and assets/module.yaml as setup-skill candidates. Error clearly when more than one matches, and sort candidates for deterministic output.

Environment

  • Model(s) used: n/a (deterministic script)
  • Agentic IDE used: n/a (scripts run directly)
  • BMad version: bmad-builder main @ d4a921c (v2.2.2 + #118)
  • Project language: Python 3.13, Linux
Ngôn ngữ chính
Python
Star
220
Fork
54
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bmad-code-org/bmad-builder

Tất cả issue của bmad-code-org/bmad-builder

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.