Skip to content

Commit fc80e4a

Browse files
chore(scripts): update commit automation workflow
1 parent 4481c9d commit fc80e4a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/smart-commit.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,24 @@ else
209209
echo
210210
echo 'Commit workflow complete.'
211211
fi
212+
213+
# -- State staleness warning --
214+
# If any feat: commit was created but .ai/state.adf wasn't in the changeset, warn.
215+
HAS_FEAT=0
216+
STATE_TOUCHED=0
217+
for group in "${GROUP_ORDER[@]}"; do
218+
msg="$(commit_message_for_group "$group")"
219+
if [[ "$msg" == feat* ]]; then
220+
HAS_FEAT=1
221+
fi
222+
files_in_group="${GROUP_FILES[$group]}"
223+
if echo "$files_in_group" | grep -q '\.ai/state\.adf'; then
224+
STATE_TOUCHED=1
225+
fi
226+
done
227+
228+
if [[ "$HAS_FEAT" -eq 1 && "$STATE_TOUCHED" -eq 0 && -f ".ai/state.adf" ]]; then
229+
echo
230+
echo ' [warn] feat: commit created but .ai/state.adf was not updated.'
231+
echo ' Consider updating STATE to reflect the new milestone/feature.'
232+
fi

0 commit comments

Comments
 (0)