fix(commands): VOYAGE_ROOT resolves the installed plugin root (green)
Valgt the literal ${CLAUDE_PLUGIN_ROOT} because that is the form Claude
Code substitutes in a command's text (recorded sessions ran
node <cache>/voyage/5.11.1/lib/...); a :- default is never replaced and
the Bash env is empty. The fallback now picks the highest installed
version under cache/<marketplace>/voyage/<version>/ by version number
(mtime ranked 5.11.0 above 5.11.1 on the measuring machine). Without
this, /trekexecute's multi-session Step 0, plan verification (Phase 7),
/trekreview's criteria checks and /trekresearch's loop gate all exit 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
93e51615f3
commit
1636124152
3 changed files with 28 additions and 8 deletions
|
|
@ -526,10 +526,15 @@ ORDERS_DIR="$SESSION_DIR/orders"
|
|||
ORIGINAL_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||
# Resolve the plugin root ONCE (same reason as Phase 7: the variable is
|
||||
# substituted in this command's text but EMPTY in the Bash tool's env).
|
||||
VOYAGE_ROOT="${CLAUDE_PLUGIN_ROOT:-}"
|
||||
# Only the literal form is substituted (a `:-` default is never replaced); the
|
||||
# fallback takes the highest installed version under cache/<market>/voyage/.
|
||||
VOYAGE_ROOT="${CLAUDE_PLUGIN_ROOT}"
|
||||
case "$VOYAGE_ROOT" in
|
||||
/*) ;;
|
||||
*) VOYAGE_ROOT="$(ls -d "$HOME"/.claude/plugins/cache/*/voyage 2>/dev/null | head -1)" ;;
|
||||
*) VOYAGE_ROOT="$(ls -d "$HOME"/.claude/plugins/cache/*/voyage/[0-9]*/ 2>/dev/null \
|
||||
| awk -F/ '{ split($(NF-1), v, "."); printf "%09d%09d%09d %s\n", v[1], v[2], v[3], $0 }' \
|
||||
| sort | tail -1 | cut -d' ' -f2-)"
|
||||
VOYAGE_ROOT="${VOYAGE_ROOT%/}" ;;
|
||||
esac
|
||||
if [ ! -f "$VOYAGE_ROOT/lib/util/session-orders.mjs" ]; then
|
||||
echo "[voyage] session orders cannot be written - plugin root unresolved." >&2
|
||||
|
|
@ -1212,10 +1217,15 @@ carrying a second copy of the denylist.)
|
|||
# command's text but is EMPTY in the Bash tool's process env, and a bare
|
||||
# `node ${CLAUDE_PLUGIN_ROOT}/lib/…` then runs `node /lib/…`, which exits 1 —
|
||||
# indistinguishable from a criterion that failed.
|
||||
VOYAGE_ROOT="${CLAUDE_PLUGIN_ROOT:-}"
|
||||
# Only the literal form is substituted (a `:-` default is never replaced); the
|
||||
# fallback takes the highest installed version under cache/<market>/voyage/.
|
||||
VOYAGE_ROOT="${CLAUDE_PLUGIN_ROOT}"
|
||||
case "$VOYAGE_ROOT" in
|
||||
/*) ;;
|
||||
*) VOYAGE_ROOT="$(ls -d "$HOME"/.claude/plugins/cache/*/voyage 2>/dev/null | head -1)" ;;
|
||||
*) VOYAGE_ROOT="$(ls -d "$HOME"/.claude/plugins/cache/*/voyage/[0-9]*/ 2>/dev/null \
|
||||
| awk -F/ '{ split($(NF-1), v, "."); printf "%09d%09d%09d %s\n", v[1], v[2], v[3], $0 }' \
|
||||
| sort | tail -1 | cut -d' ' -f2-)"
|
||||
VOYAGE_ROOT="${VOYAGE_ROOT%/}" ;;
|
||||
esac
|
||||
if [ ! -f "$VOYAGE_ROOT/lib/verification/criteria-runner.mjs" ]; then
|
||||
echo "[voyage] plan verification could not run - plugin root unresolved (exit 2)."
|
||||
|
|
|
|||
|
|
@ -572,10 +572,15 @@ before it spends anything:
|
|||
# command's text but is EMPTY in the Bash tool's process env, and a bare
|
||||
# `node ${CLAUDE_PLUGIN_ROOT}/lib/…` then runs `node /lib/…`, which exits 1 —
|
||||
# indistinguishable from a gate that said no.
|
||||
VOYAGE_ROOT="${CLAUDE_PLUGIN_ROOT:-}"
|
||||
# Only the literal form is substituted (a `:-` default is never replaced); the
|
||||
# fallback takes the highest installed version under cache/<market>/voyage/.
|
||||
VOYAGE_ROOT="${CLAUDE_PLUGIN_ROOT}"
|
||||
case "$VOYAGE_ROOT" in
|
||||
/*) ;;
|
||||
*) VOYAGE_ROOT="$(ls -d "$HOME"/.claude/plugins/cache/*/voyage 2>/dev/null | head -1)" ;;
|
||||
*) VOYAGE_ROOT="$(ls -d "$HOME"/.claude/plugins/cache/*/voyage/[0-9]*/ 2>/dev/null \
|
||||
| awk -F/ '{ split($(NF-1), v, "."); printf "%09d%09d%09d %s\n", v[1], v[2], v[3], $0 }' \
|
||||
| sort | tail -1 | cut -d' ' -f2-)"
|
||||
VOYAGE_ROOT="${VOYAGE_ROOT%/}" ;;
|
||||
esac
|
||||
if [ ! -f "$VOYAGE_ROOT/lib/util/research-loop-cap.mjs" ]; then
|
||||
echo "[voyage] gates could not run — plugin root unresolved (exit 2). NOT a denial:"
|
||||
|
|
|
|||
|
|
@ -207,10 +207,15 @@ the reviewer judges the RESULT.
|
|||
# command's text but is EMPTY in the Bash tool's process env, and a bare
|
||||
# `node ${CLAUDE_PLUGIN_ROOT}/lib/…` then runs `node /lib/…`, which exits 1 —
|
||||
# indistinguishable from a criterion that failed.
|
||||
VOYAGE_ROOT="${CLAUDE_PLUGIN_ROOT:-}"
|
||||
# Only the literal form is substituted (a `:-` default is never replaced); the
|
||||
# fallback takes the highest installed version under cache/<market>/voyage/.
|
||||
VOYAGE_ROOT="${CLAUDE_PLUGIN_ROOT}"
|
||||
case "$VOYAGE_ROOT" in
|
||||
/*) ;;
|
||||
*) VOYAGE_ROOT="$(ls -d "$HOME"/.claude/plugins/cache/*/voyage 2>/dev/null | head -1)" ;;
|
||||
*) VOYAGE_ROOT="$(ls -d "$HOME"/.claude/plugins/cache/*/voyage/[0-9]*/ 2>/dev/null \
|
||||
| awk -F/ '{ split($(NF-1), v, "."); printf "%09d%09d%09d %s\n", v[1], v[2], v[3], $0 }' \
|
||||
| sort | tail -1 | cut -d' ' -f2-)"
|
||||
VOYAGE_ROOT="${VOYAGE_ROOT%/}" ;;
|
||||
esac
|
||||
if [ ! -f "$VOYAGE_ROOT/lib/verification/criteria-runner.mjs" ]; then
|
||||
echo "[voyage] success-criteria checks could not run - plugin root unresolved."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue