Skip to content

CI nesting threshold proximity: 279/279 violations (0 headroom) #17830

@alex-solovyev

Description

@alex-solovyev

CI Nesting Threshold Proximity Warning

The shell nesting depth violation count is within 5 of the CI threshold.

  • Current violations: 279
  • CI threshold: 279 (from .agents/configs/complexity-thresholds.conf)
  • Headroom remaining: 0

Why this matters

The Complexity Analysis CI check fails when nesting depth violations exceed the threshold. When PRs add new scripts with deep nesting, they push the count over the threshold and block all open PRs. This happened 6 times in a short window (GH#17808).

Recommended actions

  1. Reduce nesting depth in the highest-depth scripts (run complexity-scan-helper.sh scan to identify them)
  2. Or bump the threshold in .agents/configs/complexity-thresholds.conf with a documented rationale

Files to check

Run locally to see current violators:

git ls-files '*.sh' | while read -r f; do
  d=$(awk 'BEGIN{d=0;m=0} /^[[:space:]]*#/{next} /[[:space:]]*(if|for|while|until|case)[[:space:]]/{d++;if(d>m)m=d} /[[:space:]]*(fi|done|esac)[[:space:]]*$||/^[[:space:]]*(fi|done|esac)$/{if(d>0)d--} END{print m}' "$f")
  [ "$d" -gt 8 ] && echo "$d $f"
done | sort -rn | head -20

aidevops.sh v3.6.171 plugin for OpenCode spent 10m on this as a headless bash routine.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingorigin:workerCreated by headless/pulse worker sessionstatus:doneTask is completetier:standardSonnet-tier: standard implementation, bug fixes, refactors

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions