render_report: severities are case-sensitive and unknown values silently become 'low' ('Critical' renders as Low, critical count 0)
还没有人认领这个 Issue。
评估
调研方向
从 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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bmad-code-org/bmad-builder 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
bmad-code-org/bmad-builder#157 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
bmad-code-org/bmad-builder#153 ·
-
难度 2/5 1-3 小时 新手友好度 77/100
bmad-code-org/bmad-builder#127 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
bmad-code-org/bmad-builder#123 ·
-
难度 2/5 1-3 小时 新手友好度 79/100
bmad-code-org/bmad-builder#121 ·
查看 bmad-code-org/bmad-builder 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
aws-samples/sample-per-model-bedrock#857 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
521xueweihan/HelloGitHub#4328 ·
-
documentation maintainer-managed
难度 2/5 1-3 小时 新手友好度 84/100
awslabs/visual-asset-management-system#1418 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复