fix(coord-send): drop the ~/.claude fallback in the skill's own script path

A Bash tool call never has CLAUDE_PLUGIN_ROOT set as a real shell variable --
only the skill's own markdown rendering resolves that bare token -- so the
${CLAUDE_PLUGIN_ROOT:-$HOME/.claude} fallback silently won every time the
engine line was actually executed, routing through whatever the operator's
personal ~/.claude/scripts/coord-send.sh happened to be instead of the
plugin's own bundled script. Same defect class board.sh was already fixed
for; coord-send still had it. Reported live by org-ops (2026-07-31): a
--fyi send hit an old deployed copy lacking the flag.

coord-selftest.sh grows three checks (156 -> 159) pinning the SKILL.md
engine line and ruling the fallback out entirely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJMJanRHkUhEf9EYxMpbM5
This commit is contained in:
Kjell Tore Guttormsen 2026-07-31 18:22:44 +02:00
commit 34f263cf28
2 changed files with 32 additions and 5 deletions

View file

@ -681,6 +681,27 @@ check "done: a named close is deliberate already and stays quiet" $?
/bin/rm -rf "$DDIR" 2>/dev/null
/bin/rm -rf "$RDIR" 2>/dev/null
# Section 28: coord-send/SKILL.md's own script-path expression must carry no
# fallback, matching the fix board.sh already shipped for the identical defect
# class. A Bash tool call never has CLAUDE_PLUGIN_ROOT set (only the harness's
# markdown rendering resolves it, and only for the bare ${CLAUDE_PLUGIN_ROOT}
# token) - so a `${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}` fallback silently wins
# every time the skill's engine line is actually executed, routing through
# whatever the operator's personal ~/.claude/scripts/ copy happens to be
# instead of the plugin's own bundled script. Reproduced live 2026-07-31: an
# org-ops session hit an old deployed coord-send.sh lacking --fyi even though
# the plugin cache had it. Fails loud (empty path) instead of failing silent.
CSKILL="$DIR/../skills/coord-send/SKILL.md"
[ -f "$CSKILL" ]; check "coord-send SKILL.md is where the selftest expects it" $?
grep -q 'CSEND="\${CLAUDE_PLUGIN_ROOT}/scripts/coord-send.sh"' "$CSKILL"
check "coord-send SKILL.md's engine line has no ~/.claude fallback" $?
# Scoped to the CSEND assignment itself, not the surrounding prose - the fix's
# own explanation has to be able to quote the broken pattern to warn against it.
if grep -q 'CSEND=.*CLAUDE_PLUGIN_ROOT:-' "$CSKILL"; then rc=1; else rc=0; fi
check "coord-send SKILL.md's CSEND assignment carries no fallback" "$rc"
echo "----"
echo "PASS=$PASS FAIL=$FAIL"
[ "$FAIL" -eq 0 ]