From 90c5f7eaf163a2bb1567e6ff429d01322b2cd08e Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Fri, 17 Apr 2026 17:07:30 -0400 Subject: [PATCH] fix(setup): Verbose error reporting, strict tangling, and full path logging for brain.log --- literate/setup.org | 12 ++++++++---- opencortex.sh | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/literate/setup.org b/literate/setup.org index 8757101..3673308 100644 --- a/literate/setup.org +++ b/literate/setup.org @@ -30,7 +30,7 @@ setup_system() { echo -e "${BLUE}=== OpenCortex: Initializing System ===${NC}" echo -e "${YELLOW}--- Installing System Dependencies ---${NC}" if command_exists apt-get; then - sudo apt-get update && sudo apt-get install -y sbcl emacs-nox rlwrap netcat-openbsd curl git socat libssl-dev libncurses5-dev + sudo apt-get update && sudo apt-get install -y sbcl emacs-nox rlwrap netcat-openbsd curl git socat libssl-dev libncurses5-dev libffi-dev zlib1g-dev libsqlite3-dev fi if [ ! -d "$HOME/quicklisp" ]; then curl -O https://beta.quicklisp.org/quicklisp.lisp @@ -118,8 +118,11 @@ setup_system() { echo -e "\n${GREEN}✓ Brain is alive and responsive on port $PORT.${NC}" echo -e "${GREEN}✓ Setup complete. You can now run 'opencortex tui'.${NC}" else - echo -e "\n${RED}✗ Brain failed to wake up. Error Log from brain.log:${NC}" + echo -e "\n${RED}✗ Brain failed to wake up.${NC}" + echo -e "${YELLOW}Full Log Path: $(realpath "$SCRIPT_DIR/brain.log")${NC}" + echo -e "${YELLOW}--- LOG START ---${NC}" cat "$SCRIPT_DIR/brain.log" + echo -e "${YELLOW}--- LOG END ---${NC}" # Kill the background process if it exists pkill -f "sbcl.*opencortex" || true exit 1 @@ -142,9 +145,10 @@ if [[ "$1" == "--boot" ]]; then fi exec sbcl --non-interactive \ --eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \ - --eval "(setf *debugger-hook* (lambda (c h) (declare (ignore h)) (format t \"~a~%\" c) (uiop:quit 1)))" \ + --eval "(setf *debugger-hook* (lambda (c h) (declare (ignore h)) (format *error-output* \"FATAL LISP ERROR: ~a~%\" c) (uiop:print-backtrace :stream *error-output*) (uiop:quit 1)))" \ --eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \ - --eval "(ql:quickload :opencortex :silent t)" \ + --eval "(format t \"--- Quickloading OpenCortex ---~%\")" \ + --eval "(ql:quickload :opencortex)" \ --eval "(opencortex:main)" fi diff --git a/opencortex.sh b/opencortex.sh index bd8e107..c289834 100755 --- a/opencortex.sh +++ b/opencortex.sh @@ -21,7 +21,7 @@ setup_system() { echo -e "${BLUE}=== OpenCortex: Initializing System ===${NC}" echo -e "${YELLOW}--- Installing System Dependencies ---${NC}" if command_exists apt-get; then - sudo apt-get update && sudo apt-get install -y sbcl emacs-nox rlwrap netcat-openbsd curl git socat libssl-dev libncurses5-dev + sudo apt-get update && sudo apt-get install -y sbcl emacs-nox rlwrap netcat-openbsd curl git socat libssl-dev libncurses5-dev libffi-dev zlib1g-dev libsqlite3-dev fi if [ ! -d "$HOME/quicklisp" ]; then curl -O https://beta.quicklisp.org/quicklisp.lisp @@ -109,8 +109,11 @@ setup_system() { echo -e "\n${GREEN}✓ Brain is alive and responsive on port $PORT.${NC}" echo -e "${GREEN}✓ Setup complete. You can now run 'opencortex tui'.${NC}" else - echo -e "\n${RED}✗ Brain failed to wake up. Error Log from brain.log:${NC}" + echo -e "\n${RED}✗ Brain failed to wake up.${NC}" + echo -e "${YELLOW}Full Log Path: $(realpath "$SCRIPT_DIR/brain.log")${NC}" + echo -e "${YELLOW}--- LOG START ---${NC}" cat "$SCRIPT_DIR/brain.log" + echo -e "${YELLOW}--- LOG END ---${NC}" # Kill the background process if it exists pkill -f "sbcl.*opencortex" || true exit 1 @@ -133,9 +136,10 @@ if [[ "$1" == "--boot" ]]; then fi exec sbcl --non-interactive \ --eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \ - --eval "(setf *debugger-hook* (lambda (c h) (declare (ignore h)) (format t \"~a~%\" c) (uiop:quit 1)))" \ + --eval "(setf *debugger-hook* (lambda (c h) (declare (ignore h)) (format *error-output* \"FATAL LISP ERROR: ~a~%\" c) (uiop:print-backtrace :stream *error-output*) (uiop:quit 1)))" \ --eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \ - --eval "(ql:quickload :opencortex :silent t)" \ + --eval "(format t \"--- Quickloading OpenCortex ---~%\")" \ + --eval "(ql:quickload :opencortex)" \ --eval "(opencortex:main)" fi