fix(mvp): Final TUI system definition, syntax fixes, and robust bootstrapper
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 20s
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 20s
This commit is contained in:
@@ -75,3 +75,12 @@ This system contains the empirical tests required by the Engineering Standards.
|
|||||||
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :memory-suite :opencortex-memory-tests))
|
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :memory-suite :opencortex-memory-tests))
|
||||||
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :immune-suite :opencortex-immune-system-tests))))
|
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :immune-suite :opencortex-immune-system-tests))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** TUI Client Definition
|
||||||
|
This system defines the native Croatoan TUI client.
|
||||||
|
|
||||||
|
#+begin_src lisp :tangle ../opencortex.asd
|
||||||
|
(defsystem :opencortex/tui
|
||||||
|
:depends-on (:opencortex :croatoan :usocket :bordeaux-threads)
|
||||||
|
:components ((:file "src/tui-client")))
|
||||||
|
#+end_src
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ setup_system() {
|
|||||||
sbcl --non-interactive \
|
sbcl --non-interactive \
|
||||||
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
|
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
|
||||||
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
||||||
--eval "(ql:quickload :opencortex)"
|
--eval "(ql:quickload '(:opencortex :croatoan))"
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -e "${RED}✗ Compilation or Loading failed.${NC}"
|
echo -e "${RED}✗ Compilation or Loading failed.${NC}"
|
||||||
@@ -171,7 +171,7 @@ if [[ "$1" == "--boot" ]]; then
|
|||||||
--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 "(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 "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
||||||
--eval "(format t \"--- Quickloading OpenCortex ---~%\")" \
|
--eval "(format t \"--- Quickloading OpenCortex ---~%\")" \
|
||||||
--eval "(ql:quickload :opencortex)" \
|
--eval "(ql:quickload '(:opencortex :croatoan))" \
|
||||||
--eval "(opencortex:main)"
|
--eval "(opencortex:main)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ if [[ "$1" == "tui" ]]; then
|
|||||||
exec sbcl --non-interactive \
|
exec sbcl --non-interactive \
|
||||||
--load ~/quicklisp/setup.lisp \
|
--load ~/quicklisp/setup.lisp \
|
||||||
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
||||||
--eval "(ql:quickload :opencortex/tui :silent t)" \
|
--eval "(ql:quickload '(:opencortex :croatoan)/tui :silent t)" \
|
||||||
--eval "(opencortex.tui:main)"
|
--eval "(opencortex.tui:main)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ The `initialize-all-skills` function is the unified orchestrator for the system
|
|||||||
'("org-skill-policy" "org-skill-bouncer"))))
|
'("org-skill-policy" "org-skill-bouncer"))))
|
||||||
(dolist (req mandatory-skills)
|
(dolist (req mandatory-skills)
|
||||||
(unless (member req sorted-files :key #'pathname-name :test #'string-equal)
|
(unless (member req sorted-files :key #'pathname-name :test #'string-equal)
|
||||||
(error "BOOT FAILURE: Mandatory skill '~a' not found in skills directory: ~a" req (uiop:native-namestring skills-dir))))
|
(error "BOOT FAILURE: Mandatory skill '~a' not found in skills directory: ~a" req (uiop:native-namestring skills-dir)))
|
||||||
|
|
||||||
(harness-log "==================================================")
|
(harness-log "==================================================")
|
||||||
(harness-log " LOADER: Initializing ~a skills..." (length sorted-files))
|
(harness-log " LOADER: Initializing ~a skills..." (length sorted-files))
|
||||||
|
|||||||
@@ -37,3 +37,7 @@
|
|||||||
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :boot-suite :opencortex-boot-tests))
|
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :boot-suite :opencortex-boot-tests))
|
||||||
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :memory-suite :opencortex-memory-tests))
|
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :memory-suite :opencortex-memory-tests))
|
||||||
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :immune-suite :opencortex-immune-system-tests))))
|
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :immune-suite :opencortex-immune-system-tests))))
|
||||||
|
|
||||||
|
(defsystem :opencortex/tui
|
||||||
|
:depends-on (:opencortex :croatoan :usocket :bordeaux-threads)
|
||||||
|
:components ((:file "src/tui-client")))
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ setup_system() {
|
|||||||
sbcl --non-interactive \
|
sbcl --non-interactive \
|
||||||
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
|
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
|
||||||
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
||||||
--eval "(ql:quickload :opencortex)"
|
--eval "(ql:quickload '(:opencortex :croatoan))"
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -e "${RED}✗ Compilation or Loading failed.${NC}"
|
echo -e "${RED}✗ Compilation or Loading failed.${NC}"
|
||||||
@@ -157,12 +157,12 @@ if [[ "$1" == "--boot" ]]; then
|
|||||||
fi
|
fi
|
||||||
done < "$SCRIPT_DIR/.env"
|
done < "$SCRIPT_DIR/.env"
|
||||||
fi
|
fi
|
||||||
exec sbcl --non-interactive \
|
exec sbcl --non-interactive \\
|
||||||
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
|
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
|
||||||
--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 "(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 "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
||||||
--eval "(format t \"--- Quickloading OpenCortex ---~%\")" \
|
--eval "(format t \"--- Quickloading OpenCortex ---~%\")" \
|
||||||
--eval "(ql:quickload :opencortex)" \
|
--eval "(ql:quickload '(:opencortex :croatoan))" \
|
||||||
--eval "(opencortex:main)"
|
--eval "(opencortex:main)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -182,34 +182,28 @@ if [[ "$1" == "tui" ]]; then
|
|||||||
|
|
||||||
# Launch TUI
|
# Launch TUI
|
||||||
echo -e "${BLUE}Launching Croatoan TUI...${NC}"
|
echo -e "${BLUE}Launching Croatoan TUI...${NC}"
|
||||||
exec sbcl --non-interactive \
|
exec sbcl --non-interactive \\
|
||||||
--load ~/quicklisp/setup.lisp \
|
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
|
||||||
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
--eval "(push (truename \"$SCRIPT_DIR/\") asdf:*central-registry*)" \
|
||||||
--eval "(ql:quickload :opencortex/tui :silent t)" \
|
--eval "(format t \"--- Loading TUI ---~%\")" --eval "(ql:quickload :opencortex/tui)" \
|
||||||
--eval "(opencortex.tui:main)"
|
--eval "(opencortex.tui:main)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
connect() {
|
connect() {
|
||||||
if command_exists socat && socat - TCP:$HOST:$PORT,connect-timeout=1 2>/dev/null; then
|
if nc -z $HOST $PORT 2>/dev/null; then return 0; fi
|
||||||
socat - TCP:$HOST:$PORT
|
|
||||||
return 0
|
|
||||||
elif command_exists nc && nc -z $HOST $PORT 2>/dev/null; then
|
|
||||||
nc $HOST $PORT
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if connect; then exit 0; fi
|
if [ -z "$1" ]; then
|
||||||
|
if ! connect; then
|
||||||
echo -e "${YELLOW}Brain is offline. Awakening...${NC}"
|
echo -e "${YELLOW}Brain is offline. Awakening...${NC}"
|
||||||
"$SCRIPT_DIR/opencortex.sh" --boot > "$SCRIPT_DIR/brain.log" 2>&1 &
|
"$SCRIPT_DIR/opencortex.sh" --boot > "$SCRIPT_DIR/brain.log" 2>&1 &
|
||||||
|
for i in {1..15}; do sleep 2; if connect; then break; fi; echo -n "."; done; echo ""
|
||||||
for i in {1..15}; do
|
fi
|
||||||
sleep 2
|
if connect; then
|
||||||
if connect; then exit 0; fi
|
if command_exists socat; then exec socat - TCP:$HOST:$PORT; else exec nc $HOST $PORT; fi
|
||||||
echo -n "."
|
else
|
||||||
done
|
echo -e "${RED}✗ Failed to connect to brain.${NC}"; exit 1
|
||||||
|
fi
|
||||||
echo -e "${RED}\n✗ Failed to connect to brain.${NC}"
|
fi
|
||||||
exit 1
|
|
||||||
|
|||||||
@@ -205,7 +205,7 @@
|
|||||||
'("org-skill-policy" "org-skill-bouncer"))))
|
'("org-skill-policy" "org-skill-bouncer"))))
|
||||||
(dolist (req mandatory-skills)
|
(dolist (req mandatory-skills)
|
||||||
(unless (member req sorted-files :key #'pathname-name :test #'string-equal)
|
(unless (member req sorted-files :key #'pathname-name :test #'string-equal)
|
||||||
(error "BOOT FAILURE: Mandatory skill '~a' not found in skills directory: ~a" req (uiop:native-namestring skills-dir))))
|
(error "BOOT FAILURE: Mandatory skill '~a' not found in skills directory: ~a" req (uiop:native-namestring skills-dir)))
|
||||||
|
|
||||||
(harness-log "==================================================")
|
(harness-log "==================================================")
|
||||||
(harness-log " LOADER: Initializing ~a skills..." (length sorted-files))
|
(harness-log " LOADER: Initializing ~a skills..." (length sorted-files))
|
||||||
|
|||||||
Reference in New Issue
Block a user