From b4078f40b7201d8427a650d628c9fcdfee3e989b Mon Sep 17 00:00:00 2001 From: Roberto Cano <3525807+robercano@users.noreply.github.com> Date: Sat, 8 Aug 2026 10:29:03 +0200 Subject: [PATCH] fix(posture-check): name the repo in the divergence alert The registry maps one unix user to several clones (recode-agent owns reCode, reDeploy and reDeFi), so a title keyed only on $user cannot say which checkout drifted. A real reDeFi alert was read as reCode, and the first move on receiving it was three manual git status runs to find the subject. Lead the title with the repo basename and put the absolute path on the first body line -- basenames can collide across agent homes, so the title is for triage and the body for certainty. Same relabel for the repo-missing alert, which had the identical ambiguity. Co-Authored-By: Claude Opus 5 (1M context) --- examples/dedicated-server/bin/posture-check.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/dedicated-server/bin/posture-check.sh b/examples/dedicated-server/bin/posture-check.sh index 3720efd..51daef0 100755 --- a/examples/dedicated-server/bin/posture-check.sh +++ b/examples/dedicated-server/bin/posture-check.sh @@ -30,7 +30,11 @@ alert() { # ---- 1. git divergence, per agent ----------------------------------------- while IFS=: read -r user repo; do case "${user:-}" in ''|\#*) continue ;; esac - [ -d "$repo" ] || { alert "BusyBee: $user repo missing" "no such path: $repo"; continue; } + # One user routinely owns several clones, so the user alone does not identify + # the alert -- lead with the repo name and keep the full path in the body, + # since two agents can hold same-named clones under different homes. + who="$(basename "$repo") ($user)" + [ -d "$repo" ] || { alert "BusyBee: $who repo missing" "no such path: $repo"; continue; } as_agent() { sudo -u "$user" git -C "$repo" "$@"; } as_agent fetch -q origin main 2>/dev/null @@ -38,8 +42,9 @@ while IFS=: read -r user repo; do drift=$(as_agent diff --stat origin/main -- $PATHS 2>/dev/null) if [ -n "$dirty" ] || [ -n "$drift" ]; then - alert "BusyBee: $user checkout diverges from origin/main" \ - "$(printf 'uncommitted:\n%s\n\nvs origin/main:\n%s\n' "$dirty" "$drift")" + alert "BusyBee: $who checkout diverges from origin/main" \ + "$(printf 'repo: %s\n\nuncommitted:\n%s\n\nvs origin/main:\n%s\n' \ + "$repo" "$dirty" "$drift")" fi done < "$CONF"