render_report: severities are case-sensitive and unknown values silently become 'low' ('Critical' renders as Low, critical count 0)

オープン 初心者向け
#151 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
tooling

調査の方向性

まず scripts/render_report.py と assets/report-shell.html から始めます。issue で重大度の処理が指摘されているため、続いて validate() が grade をどのようにチェックするかを追います。重大度の検証と両方のレポート出力を対象とする既存のテストがあるか確認します。大文字と小文字が混在する既知の重大度が一貫して正規化され、未知の値で明確な検証エラーが発生し、再現した件数とグループ分けが正しい状態になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

scripts/render_report.py and assets/report-shell.html are identical in both builders. Neither validates finding.severity. Any value other than exactly critical|high|medium|low is silently mapped to low: by severity_counts() for the CLI summary and markdown, and by the shell's normalize() for the HTML. The findings JSON is written by LLM lenses, so "Critical", "HIGH" or "major" are realistic. The report then shows a critical problem as Low and reports 0 critical.

grade, by contrast, is validated strictly and case-sensitively ("Poor" is rejected), so the two fields are inconsistent.

Steps to reproduce

cat > f.json <<'EOF'
{"subject":"demo-skill","grade":"poor","findings":[
 {"id":"F1","lens":"security","severity":"Critical","title":"Deletes live config"},
 {"id":"F2","lens":"structure","severity":"HIGH","title":"Missing activation"},
 {"id":"F3","lens":"style","severity":"low","title":"Wordy"}]}
EOF
cd skills/bmad-workflow-builder
python3 scripts/render_report.py f.json --shell assets/report-shell.html -o r.html --md r.md
# {"counts": {"critical": 0, "high": 0, "medium": 0, "low": 3}, ...}
# r.md: "| Critical | 0 |"; F1/F2 listed under Low; r.html groups all three under Low

Expected behavior

Normalize case (severity.strip().lower()) in both Python and the shell, and reject anything still unknown in validate() with a clear error, the same way grade is handled. Never default an unknown severity to the lowest bucket.

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
主要言語
Python
スター
220
フォーク
54
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bmad-code-org/bmad-builder のほかの issue

bmad-code-org/bmad-builder の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。