Skip to content

Guard unset CRITICAL_PREFIXES in coverage config#8

Merged
negillett merged 2 commits into
mainfrom
fix-coverage-prefix-guard
May 30, 2026
Merged

Guard unset CRITICAL_PREFIXES in coverage config#8
negillett merged 2 commits into
mainfrom
fix-coverage-prefix-guard

Conversation

@negillett

Copy link
Copy Markdown
Member

Summary

  • Use ${#CRITICAL_PREFIXES[@]:-0} so incomplete coverage-tiers.conf fails with the existing descriptive error instead of an unbound-variable crash under set -u
  • Add scripts/check-coverage_config_test.sh regression test

Follow-up to merged #7 (Bugbot low-severity review on tools #88).

Test plan

  • bash scripts/check-coverage_config_test.sh
  • bash scripts/run-coverage-gate.sh

Signed-off-by: Nathan Gillett <nathan@intentproof.io>
@cursor

cursor Bot commented May 30, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
CI/coverage script validation only; no runtime product or security impact.

Overview
Hardens critical-tier config validation in check-coverage.sh when coverage-tiers.conf sets CRITICAL_MIN but omits or leaves empty CRITICAL_PREFIXES. Instead of referencing an unset array under set -u, the script now checks that CRITICAL_PREFIXES is defined and non-empty before building rules; otherwise it exits with the existing message requiring CRITICAL_RULES or CRITICAL_MIN + CRITICAL_PREFIXES.

Adds scripts/check-coverage_config_test.sh to assert exit code 2 and that message for configs with only TOTAL_MIN or CRITICAL_MIN without prefixes.

Reviewed by Cursor Bugbot for commit d9f5de7. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 917afbd. Configure here.

Comment thread scripts/check-coverage.sh Outdated
Signed-off-by: Nathan Gillett <nathan@intentproof.io>
@negillett negillett merged commit c694ea9 into main May 30, 2026
6 checks passed
@negillett negillett deleted the fix-coverage-prefix-guard branch May 30, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant