fix(memory): test covers CLAUDE.global.md guard entry; doctor asserts exact global symlink target

This commit is contained in:
Bastien Chanot
2026-07-14 16:19:29 +02:00
parent 0f23f10767
commit e9a38a0268
3 changed files with 33 additions and 18 deletions
+11
View File
@@ -63,6 +63,17 @@ check_symlink() {
}
check_symlink "CLAUDE.md"
# check_symlink only asserts the canonical path lands inside $REPO — after a
# `git pull` without `link.sh`, ~/.claude/CLAUDE.md can still resolve inside
# $REPO but at the wrong file (the 29-line project CLAUDE.md instead of
# CLAUDE.global.md), passing green while the global doctrine is silently gone.
_claude_md_target=$(readlink "$HOME/.claude/CLAUDE.md" 2>/dev/null || true)
if [ "$_claude_md_target" != "$REPO/CLAUDE.global.md" ]; then
# shellcheck disable=SC2088 # literal label, not a tilde-expansion attempt
warn "~/.claude/CLAUDE.md points to $_claude_md_target — expected \
$REPO/CLAUDE.global.md; run: bash link.sh"
fi
unset _claude_md_target
check_symlink "settings.json"
check_symlink "agents"
check_symlink "skills"