Finding
File: src/raki/report/html_report.py:396 / src/raki/report/cli_summary.py:82
After PR #297, html_color_for_score() uses ZONE_THRESHOLDS where green >= 0.85, but cli_summary.color_for_score() (line 82) still uses the old green >= 0.80 / amber >= 0.60 constants. A score of 0.82 now renders as green in terminal output but yellow in the HTML report — a user-visible inconsistency between the two rendering paths.
The old HTML docstring explicitly stated "Matches the CLI color_for_score semantics", so this drift is likely unintentional.
Suggested Fix
Option A — share the threshold source:
- Import
ZONE_THRESHOLDS in cli_summary.py and update color_for_score() to use ZONE_THRESHOLDS["score"]["green"] / ZONE_THRESHOLDS["score"]["amber"].
Option B — revert HTML threshold:
- If 0.85 was not an intentional product decision, set
ZONE_THRESHOLDS["score"]["green"] = 0.80 to restore parity.
Option C — document the divergence:
- Add a code comment in both files explaining the intentional difference if it is a deliberate product choice.
Context
Found during review of PR #297 (ticket #287 — fix: severity distribution chart and zone coloring in score cards). Did not block the PR.
Acceptance criteria
Plan
- Extract
ZONE_THRESHOLDS to a shared location (or import from html_report.py into cli_summary.py)
- Update
cli_summary.color_for_score() to use ZONE_THRESHOLDS["score"]["green"] and ZONE_THRESHOLDS["score"]["amber"]
- Add tests comparing CLI and HTML output for boundary scores
- Towncrier fragment
Finding
File:
src/raki/report/html_report.py:396/src/raki/report/cli_summary.py:82After PR #297,
html_color_for_score()usesZONE_THRESHOLDSwhere green >= 0.85, butcli_summary.color_for_score()(line 82) still uses the old green >= 0.80 / amber >= 0.60 constants. A score of 0.82 now renders as green in terminal output but yellow in the HTML report — a user-visible inconsistency between the two rendering paths.The old HTML docstring explicitly stated "Matches the CLI color_for_score semantics", so this drift is likely unintentional.
Suggested Fix
Option A — share the threshold source:
ZONE_THRESHOLDSincli_summary.pyand updatecolor_for_score()to useZONE_THRESHOLDS["score"]["green"]/ZONE_THRESHOLDS["score"]["amber"].Option B — revert HTML threshold:
ZONE_THRESHOLDS["score"]["green"] = 0.80to restore parity.Option C — document the divergence:
Context
Found during review of PR #297 (ticket #287 — fix: severity distribution chart and zone coloring in score cards). Did not block the PR.
Acceptance criteria
color_for_score()and HTMLhtml_color_for_score()use the same thresholdsZONE_THRESHOLDSinhtml_report.py(single source of truth)changes/300.fix)Plan
ZONE_THRESHOLDSto a shared location (or import fromhtml_report.pyintocli_summary.py)cli_summary.color_for_score()to useZONE_THRESHOLDS["score"]["green"]andZONE_THRESHOLDS["score"]["amber"]