Skip to content

fix(posture-check): name the repo in the divergence alert - #229

Merged
robercano-ghbot merged 1 commit into
mainfrom
fix/posture-check-repo-in-alert
Aug 8, 2026
Merged

fix(posture-check): name the repo in the divergence alert#229
robercano-ghbot merged 1 commit into
mainfrom
fix/posture-check-repo-in-alert

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

Problem

/etc/recode-agents.conf maps one unix user to several clones — on the current box recode-agent owns reCode, reDeploy and reDeFi. The divergence alert titled itself with \$user only:

BusyBee: recode-agent checkout diverges from origin/main

That name is identical for all three rows, so the title cannot say which checkout drifted, and the body (a git status --porcelain + git diff --stat) carries no path either.

This bit for real: a drift alert for reDeFi was read as reCode, and resolving it took three manual git status runs across the registry just to identify the subject. A tripwire that can't name its subject costs more than it saves.

Change

examples/dedicated-server/bin/posture-check.sh — lead the title with the repo basename and put the absolute path on the first body line:

BusyBee: reDeFi (recode-agent) checkout diverges from origin/main

repo: /home/recode-agent/reDeFi

uncommitted:
M  .claude/scripts/arm-loop.sh
...

Basename in the title, full path in the body: basenames can collide across agent homes, so the title is for triage and the body for certainty. The repo missing alert gets the same relabel — it had the identical ambiguity.

The fence-coverage alerts in section 2 are deliberately untouched: those are genuinely per-user, not per-repo.

Testing

  • bash -n passes.
  • Rendered the new label loop against the real /etc/recode-agents.conf; all three registry rows now produce distinguishable titles.
  • Not executed end-to-end — an unstubbed run posts a live notification to the recode-notifications topic.

Deploying

No daemon-reload or restart needed. posture-check.service is Type=oneshot with ExecStart=/usr/local/sbin/posture-check.sh, so systemd re-reads the file from disk each tick — unlike the long-lived pr-loop/claude-rc units that pin their script in memory (issue #131).

sudo install -m 755 -o root -g root examples/dedicated-server/bin/posture-check.sh /usr/local/sbin/posture-check.sh

Already installed on the current box and verified against the built copy.

Not in scope

PATHS (line 19) is still ".claude/scripts self", so drift under .claude/systemd — the units that decide how the loop runs — remains invisible to the tripwire. That gap is real and showed up in the same incident; leaving it for a separate change.

🤖 Generated with Claude Code

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) <noreply@anthropic.com>
@robercano-ghbot
robercano-ghbot merged commit 08a61c2 into main Aug 8, 2026
9 checks passed
@robercano-ghbot
robercano-ghbot deleted the fix/posture-check-repo-in-alert branch August 8, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants