fix: herdr integrations make the hook directory herdr names

herdr writes its hook file but not the directory, so on a fresh box
`herdr integration install omp` failed: omp had never created
~/.omp/agent/extensions. The step now reads the target path from
`herdr integration status` and makes its directory, only for an agent
that is present. The fake herdr fails like the real one when it is missing.
This commit is contained in:
bcherb2 committed 2026-11-18 03:02:50 -05:00
1 parent c710e1934d
commit 06b03c9528
3 files changed
+54 -11

No files matched your search

+18 -4
View File
@@ -145,16 +145,30 @@ go)
herdr)
# `herdr integration status` lists one `<agent>: <state> (...)` line per
# integration; FAKE_HERDR_CURRENT names the agents to report `current`,
# every other one is `not installed`. `install` is only logged.
# every other one is `not installed`. The paths are the real ones' shape.
# `install` writes nothing, but like the real herdr it fails when the
# target's directory is missing: herdr does not create ~/.omp/agent/extensions.
_herdr_target() {
case $1 in
pi) echo "$HOME/.pi/agent/extensions/herdr-agent-state.ts" ;;
omp) echo "$HOME/.omp/agent/extensions/herdr-omp-agent-state.ts" ;;
claude) echo "$HOME/.claude/hooks/herdr-agent-state.sh" ;;
codex) echo "$HOME/.codex/herdr-agent-state.sh" ;;
*) echo "$HOME/.$1/hooks/herdr-agent-state.sh" ;;
esac
}
case ${1:-}:${2:-} in
integration:status)
for _a in pi omp claude codex copilot; do
case " ${FAKE_HERDR_CURRENT:-} " in
*" $_a "*) printf '%s: current (v11) (%s/.fake/%s)\n' "$_a" "$HOME" "$_a" ;;
*) printf '%s: not installed (%s/.fake/%s)\n' "$_a" "$HOME" "$_a" ;;
*" $_a "*) printf '%s: current (v11) (%s)\n' "$_a" "$(_herdr_target "$_a")" ;;
*) printf '%s: not installed (%s)\n' "$_a" "$(_herdr_target "$_a")" ;;
esac
done ;;
integration:install) [ "$mode" = install ] && exit 1 ;;
integration:install)
[ "$mode" = install ] && exit 1
_t=$(_herdr_target "${3:-}")
[ -d "${_t%/*}" ] || { echo "error: ${_t%/*}: No such file or directory" >&2; exit 1; } ;;
esac
exit 0 ;;
nvim)
+13
View File
@@ -807,6 +807,17 @@ hasnt "…and prints no herdr section" "herdr integrations" "$out"
BOXENV='FAKE_FAIL=herdr:install'
out=$(box install 2>&1 | plain || true)
has "a failed integration is named" "herdr integration install claude failed" "$out"
# herdr writes the hook file but not its directory, and on a fresh box omp has
# never made ~/.omp/agent/extensions. The installer makes the directory herdr's
# own status names, and only for an agent that is present.
newbox; sh ./seal.sh "$SB/seal" --with herdr omp >/dev/null; BOXPATH=$SB/seal
pick core/ripgrep
out=$(box install 2>&1 | plain || true)
hasnt "omp installs with no extensions dir yet" "herdr integration install omp failed" "$out"
is "…the dir herdr names is made for it" "yes" \
"$([ -d "$SB/.omp/agent/extensions" ] && echo yes || echo no)"
is "…and none for an agent that is not here" "no" \
"$([ -d "$SB/.pi/agent/extensions" ] && echo yes || echo no)"
newbox; sh ./seal.sh "$SB/seal" --with claude codex >/dev/null; BOXPATH=$SB/seal
if grep -q '^herdr ' "$SB/seal/.shadowed" 2>/dev/null; then
printf ' \033[33mskip\033[0m herdr sits at an absolute path find_tool probes\n'
@@ -1511,6 +1522,8 @@ STEPS
"chezmoi init --apply --source $SB/.local/share/dotfiles-private" "$(cat "$LOG")"
has "…against the private tier's OWN config file" \
"-c $SB/.config/chezmoi/private.toml" "$(cat "$LOG")"
has "…and its OWN persistent state, not the public tier's" \
"--persistent-state $SB/.config/chezmoi/chezmoistate-private.boltdb" "$(cat "$LOG")"
is "…which is never the config the public tier rewrites" "0" \
"$(grep -c 'chezmoi/chezmoi.toml' "$LOG" || true)"
is "a later update can still authenticate" "1" \