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

Aperta
#129 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, yaml
Ambito
testing, tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Python
Stelle
220
Fork
54
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bmad-code-org/bmad-builder

Tutte le issue di bmad-code-org/bmad-builder

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.