.forge/ci/steps/02_budget.sh 852 B 20 lines Raw
1 #!/bin/sh2 # 02_budget: byte-count hard budgets (PLAN M2).3 # root help <=300B/12 lines; --skill <=1000B/30 lines; each <cmd> -h <=250B/8 lines.4 set -e5 export CARGO_BUILD_JOBS=26 fail() { echo "budget fail: $1" >&2; exit 1; }7 check() {8   name="$1"; bytes="$2"; lines="$3"; maxb="$4"; maxl="$5"9   if [ "$bytes" -gt "$maxb" ]; then fail "$name ${bytes}B > ${maxb}B"; fi10   if [ "$lines" -gt "$maxl" ]; then fail "$name ${lines} lines > ${maxl}"; fi11 }12 bytes=$(f0rge | wc -c); lines=$(f0rge | wc -l)13 check "root help" "$bytes" "$lines" 300 1214 bytes=$(f0rge --skill | wc -c); lines=$(f0rge --skill | wc -l)15 check "--skill" "$bytes" "$lines" 1000 3016 for sub in issue pr task label milestone ci wiki release merge init skill; do17   bytes=$(f0rge "$sub" -h | wc -c); lines=$(f0rge "$sub" -h | wc -l)18   check "$sub -h" "$bytes" "$lines" 250 819 done20 echo "budgets ok"