`darnit validate` crashes on openssf-baseline.toml summarising levels
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read packages/darnit/src/darnit/cli.py, especially cmd_validate and the level grouping near line 416; compare it with how darnit audit reads levels from tags. Reproduce with the bundled openssf-baseline.toml using the steps in the issue. Done means darnit validate exits 0 and prints the per-level breakdown for controls whose level is stored in tags.
Written by the indexing model from the issue text.
Description
Description
darnit validate on the bundled openssf-baseline.toml reports the framework as valid, then raises a TypeError and exits non-zero. The level breakdown in cmd_validate (packages/darnit/src/darnit/cli.py) groups controls by ctrl.level. The baseline TOML now keeps the level in tags, so ctrl.level is None for those controls, and sorted() fails when the keys mix int and None. darnit audit reads the level from tags and reports it correctly.
Steps to Reproduce
pip install "darnit-mcp==0.1.1" "darnit-core==0.1.1" "darnit-baseline==0.1.1"darnit validate "$(python -c 'import importlib.resources as r; print(r.files("darnit_baseline") / "openssf-baseline.toml")')"
Expected Behavior
Exit 0 with the per-level breakdown.
Actual Behavior
INFO: Framework 'openssf-baseline' is valid
INFO: Controls: 66
INFO: Adapters: 0
Traceback (most recent call last):
File "/opt/darnit/lib/python3.13/site-packages/darnit/cli.py", line 416, in cmd_validate
logger.info(f" By level: {', '.join(f'L{k}={v}' for k, v in sorted(by_level.items()))}")
TypeError: '<' not supported between instances of 'int' and 'NoneType'
Environment
- darnit version: 0.1.1
- Python version: 3.13
- OS: Debian trixie (Docker)
Additional Context
We hit this running darnit in Alpha-Omega's scrutineer, which bundles it in its runner image for an OpenSSF Baseline compliance scan, with darnit validate as a build-time smoke test. The same code is still on main at 24a4fed. Reading the level as ctrl.level or ctrl.tags.get("level") there would match what the audit path does.
- Dominant language
- Python
- Stars
- 22
- Forks
- 27
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 39
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from darnitdevorg/darnit
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
darnitdevorg/darnit#587 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
darnitdevorg/darnit#585 ·
Maintainers usually reply within 1 day
-
quality
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
darnitdevorg/darnit#523 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
darnitdevorg/darnit#516 ·
Maintainers usually reply within 1 day
-
good first issue module-core
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
darnitdevorg/darnit#506 ·
Maintainers usually reply within 1 day
All issues in darnitdevorg/darnit
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
[Bug]: Importing weave changes the process-wide localePossibly taken @himanshu748 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
UX
Difficulty 1/5 Under an hour Newbie friendliness 72/100
mediajunkie/piper-morgan-product#2008 · 2 comments ·