diff --git a/.claude/hooks/goal_phase_eval.sh b/.claude/hooks/goal_phase_eval.sh index 8c7df41..8469459 100755 --- a/.claude/hooks/goal_phase_eval.sh +++ b/.claude/hooks/goal_phase_eval.sh @@ -18,9 +18,20 @@ F="$HOME/.claude/goals/${SID}.json" GOAL=$(jq -r '.goal // ""' "$F" 2>/dev/null) [ -z "$GOAL" ] && exit 0 +# Salir del estado ACTIVO de inmediato (sincrono, instantaneo): al parar no debe +# quedarse mostrando investigando/haciendo/testeando mientras el worker (haiku, +# background) afina el reposo a hecho/pendiente_revision/bloqueado/en_pausa. +CUR=$(jq -r '.phase // ""' "$F" 2>/dev/null) +case "$CUR" in + investigando|planificando|haciendo|testeando|puliendo) + TMP="${F}.prov.$$" + if jq '.phase="en_pausa"' "$F" > "$TMP" 2>/dev/null; then mv "$TMP" "$F"; else rm -f "$TMP"; fi + ;; +esac + [ -z "$TRANSCRIPT" ] && exit 0 [ -f "$TRANSCRIPT" ] || exit 0 -# Lanzar clasificacion en background; el hook retorna de inmediato. +# Afinar el reposo en background; el hook retorna de inmediato. nohup bash "$HOME/.claude/hooks/goal_phase_worker.sh" "$SID" "$TRANSCRIPT" "$F" >/dev/null 2>&1 & exit 0