@@ -68,23 +68,20 @@ PRESENT_HEAD="$(git rev-parse HEAD)"
6868PRIOR_FULL=" $( git rev-parse " $PRIOR_HEAD " ) "
6969PRIOR_COUNT=" $( git ls-tree -r --name-only " $PRIOR_FULL " | wc -l | tr -d ' ' ) "
7070PRESENT_COUNT=" $( git ls-files | wc -l | tr -d ' ' ) "
71- DELTA_PERCENT=" $( python - << PY
72- prior=$PRIOR_COUNT
73- present=$PRESENT_COUNT
74- print(round(abs(present-prior)*100.0/prior, 1) if prior else 100.0)
75- PY
76- ) "
71+ DELTA_PERCENT=" $( awk -v prior=" $PRIOR_COUNT " -v present=" $PRESENT_COUNT " \
72+ ' BEGIN{d=present-prior; if (d<0) d=-d; printf "%.1f", (prior ? 100*d/prior : 100)}' ) "
7773
7874mapfile -t CHANGED < <( git diff --name-only " $PRIOR_FULL " " $PRESENT_HEAD " )
7975mapfile -t UNTRACKED < <( git ls-files --others --exclude-standard)
8076
8177invalidations=()
82- OVER20=" $( python -c " print(1 if float(' $DELTA_PERCENT ') > 20.0 else 0) " ) "
78+ OVER20=" $( awk -v d= " $DELTA_PERCENT " ' BEGIN{print (d>20)?1:0} ' ) "
8379if [[ " $OVER20 " == " 1" && " $ALLOW_LARGE_DELTA " != " 1" ]]; then
8480 invalidations+=(" inventory delta ${DELTA_PERCENT} % exceeds 20%" )
8581fi
8682
87- for p in " ${CHANGED[@]:- } " ; do
83+ for p in " ${CHANGED[@]} " ; do
84+ [[ -z " $p " ]] && continue
8885 case " $p " in
8986 LICENSE|SECURITY.md|audit.manifest.yml|.github/workflows/* )
9087 invalidations+=(" sensitive path changed: $p " )
@@ -113,7 +110,9 @@ echo "Prior tracked count: $PRIOR_COUNT"
113110echo " Present tracked count: $PRESENT_COUNT "
114111echo " Inventory delta: ${DELTA_PERCENT} %"
115112echo " Changed tracked paths: ${# CHANGED[@]} "
116- for p in " ${CHANGED[@]:- } " ; do echo " M $p " ; done
113+ for p in " ${CHANGED[@]} " ; do
114+ [[ -n " $p " ]] && echo " M $p "
115+ done
117116if [[ ${# UNTRACKED[@]} -gt 0 ]]; then
118117 echo " New untracked (non-ignored): ${# UNTRACKED[@]} "
119118 for p in " ${UNTRACKED[@]: 0: 20} " ; do echo " ? $p " ; done
@@ -137,7 +136,7 @@ if [[ "$DELTA_MODE" == "upgrade-to-full" ]]; then
137136else
138137 echo " 1. Read regulation/execution/RE_AUDIT_POLICY.md delta rules"
139138 echo " 2. G-21 full read only changed paths + dependency cone listed above"
140- echo " 3. Rescore gates affected by the change set"
139+ echo " 3. Rescore gates affected by the change set; carry forward others only when allowed "
141140 echo " 4. Update audits/$SLUG /audit-report.md and fill delta-audit-record.md"
142141fi
143142echo " 5. Refresh R-02, R-09 when audit mode is release or strict-product"
0 commit comments