v0.2.1: polish, deploy, CI, and literate refactor
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 11s

- Secret Exposure Gate + Privacy Filter (Bouncer)
- Shell actuator safety harness (timeout, blocked patterns)
- REPL-first enforcement (lisp validation gate, system-prompt-augment)
- Engineering Standards lifecycle (two-track Org-first + REPL-first)
- Literate Programming discipline (one function per block, reflect-back)
- AGENTS.md: thin routing layer, skills are authoritative
- SKILLS_DIR removed, ~/notes fallback eliminated
- opencortex.sh: multi-distro (Debian+Fedora), configure, install service, backup, restore, help
- infrastructure/opencortex.service (systemd user unit)
- Docker: updated to debian:trixie, fixed build context
- GitHub CI: lint + test workflows fixed, trigger on tags only
- Gitea CI: deploy workflow paths fixed
- README: one-line curl install, badges
- USER_MANUAL: Deployment section (bare metal, Docker, backup)
- .gitignore: skills/*.lisp and tests/*.lisp as generated artifacts
- Prose/block refactor across all 35 org files
- Test suite Tier 1: 43/45 pass (env-dependent failures isolated)
This commit is contained in:
2026-05-02 17:04:33 -04:00
parent 9e77958028
commit 41de20d3f1
67 changed files with 1943 additions and 1287 deletions

View File

@@ -1,9 +0,0 @@
(load (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))
(ql:quickload :croatoan :silent t)
(handler-case
(croatoan:with-screen (scr)
(format t "Screen height: ~s~%" (croatoan:height scr))
(format t "Screen width: ~s~%" (croatoan:width scr))
(finish-output))
(error (c) (format t "Croatoan Error: ~a~%" c)))
(uiop:quit 0)

View File

@@ -1,62 +0,0 @@
#!/bin/bash
# OpenCortex TUI Harness via GNU Screen
# Provides a persistent PTY for Croatoan/ncurses TUI testing.
set -euo pipefail
SESSION="oct-tui"
LOG="$HOME/.local/state/opencortex/tui-screen.log"
function cleanup() {
screen -S "$SESSION" -X quit 2>/dev/null || true
}
case "${1:-start}" in
start)
cleanup
mkdir -p "$(dirname "$LOG")"
export TERM=screen-256color
export SKILLS_DIR="$HOME/.local/share/opencortex/skills"
screen -dmS "$SESSION" bash -c '
sbcl --non-interactive \
--eval "(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))" \
--eval "(push (truename \"$HOME/.local/share/opencortex/\") asdf:*central-registry*)" \
--eval "(ql:quickload :opencortex/tui :silent t)" \
--eval "(opencortex.tui:main)" \
2>&1 | tee '"$LOG"'
echo "[TUI exited with code $?]"
sleep 3600
'
sleep 2
echo "TUI started in screen session '$SESSION'"
echo "Logs: $LOG"
;;
send)
shift
screen -S "$SESSION" -X stuff "$*"
;;
enter)
screen -S "$SESSION" -X stuff "$(printf '\r')"
;;
capture)
screen -S "$SESSION" -X hardcopy -h /tmp/oct-tui-capture.txt
cat /tmp/oct-tui-capture.txt
;;
log)
tail -f "$LOG"
;;
kill)
cleanup
echo "TUI session killed."
;;
*)
echo "Usage: $0 {start|send <text>|enter|capture|log|kill}"
exit 1
;;
esac

View File

@@ -1,48 +0,0 @@
(load (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))
(ql:quickload :usocket :silent t)
(defun frame-message (msg)
(let* ((payload (format nil "~s" msg))
(len (length payload)))
(format nil "~6,'0x~a" len payload)))
(defun test-hi ()
(handler-case
(let* ((socket (usocket:socket-connect "127.0.0.1" 9105))
(stream (usocket:socket-stream socket)))
(format t "Connected to daemon.~%")
;; Read HELLO
(let* ((len-buf (make-string 6))
(count (read-sequence len-buf stream)))
(when (= count 6)
(let* ((len (parse-integer len-buf :radix 16))
(msg-buf (make-string len)))
(read-sequence msg-buf stream)
(format t "Received HELLO: ~a~%" msg-buf))))
;; Send HI
(let* ((msg '(:TYPE :EVENT :META (:SOURCE :tui) :PAYLOAD (:SENSOR :user-input :TEXT "hi")))
(framed (frame-message msg)))
(format stream "~a" framed)
(finish-output stream)
(format t "Sent HI.~%"))
;; Wait for response
(loop
(let* ((len-buf (make-string 6))
(count (read-sequence len-buf stream)))
(if (= count 6)
(let* ((len (parse-integer len-buf :radix 16))
(msg-buf (make-string len)))
(read-sequence msg-buf stream)
(format t "Received Response: ~a~%" msg-buf)
(return))
(progn
(format t "Waiting...~%")
(sleep 1)))))
(usocket:socket-close socket))
(error (c) (format t "Error: ~a~%" c))))
(test-hi)
(uiop:quit 0)

View File

@@ -1,89 +0,0 @@
#!/bin/bash
# OpenCortex TUI Automated Test Harness
# Runs the TUI in a tmux pane, sends "hi", captures response.
set -euo pipefail
SESSION="opencortex-tui-test"
TUI_LOG="/tmp/opencortex-tui-test.log"
CAPTURE="/tmp/opencortex-tui-capture.txt"
TIMEOUT_SEC=30
echo "=== OpenCortex TUI Test Harness ==="
echo "Log: $TUI_LOG"
echo "Capture: $CAPTURE"
# Clean up any stale session
tmux kill-session -t "$SESSION" 2>/dev/null || true
# Verify daemon is running
if ! ss -tln | grep -q ':9105'; then
echo "ERROR: Daemon not running on port 9105"
echo "Start it with: cd ~/memex/projects/opencortex && ./opencortex.sh daemon"
exit 1
fi
# Create tmux session with TUI
echo "[1/5] Starting TUI in tmux session '$SESSION'..."
tmux new-session -d -s "$SESSION" \
-e OC_CONFIG_DIR="$HOME/.config/opencortex" \
-e OC_DATA_DIR="$HOME/.local/share/opencortex" \
-e SKILLS_DIR="$HOME/.local/share/opencortex/skills" \
-e TERM="screen-256color" \
"sbcl --non-interactive \
--eval '(load (merge-pathnames \"quicklisp/setup.lisp\" (user-homedir-pathname)))' \
--eval '(push (truename \"$HOME/.local/share/opencortex/\") asdf:*central-registry*)' \
--eval '(ql:quickload :opencortex/tui)' \
--eval '(opencortex.tui:main)' 2>&1 | tee $TUI_LOG"
sleep 3
# Capture initial state
tmux capture-pane -t "$SESSION" -p > "$CAPTURE"
echo "[2/5] Initial TUI state captured ($(wc -l < "$CAPTURE") lines)"
# Send message
echo "[3/5] Sending 'hi' + Enter..."
tmux send-keys -t "$SESSION" "hi" Enter
# Wait for response
echo "[4/5] Waiting up to ${TIMEOUT_SEC}s for response..."
for i in $(seq 1 $TIMEOUT_SEC); do
tmux capture-pane -t "$SESSION" -p > "$CAPTURE"
# Check if daemon response arrived (contains arrow-down marker or actual response text)
if grep -qE "(⬇|Hi|Hello|Neural Cascade)" "$CAPTURE"; then
echo " ✓ Response detected after ${i}s"
break
fi
sleep 1
done
# Final capture
tmux capture-pane -t "$SESSION" -p > "$CAPTURE"
echo "[5/5] Final capture ($(wc -l < "$CAPTURE") lines)"
# Extract and display results
echo ""
echo "=== SCREEN CAPTURE ==="
cat "$CAPTURE"
echo ""
echo "=== TUI LOG (last 20 lines) ==="
tail -20 "$TUI_LOG"
echo ""
# Check for errors
if grep -qE "(TUI Error|Connection lost|ERROR:)" "$TUI_LOG"; then
echo "❌ TEST FAILED: Errors detected in TUI log"
tmux kill-session -t "$SESSION" 2>/dev/null || true
exit 1
fi
if grep -qE "(⬇|Hi|Hello)" "$CAPTURE"; then
echo "✅ TEST PASSED: Response received from daemon"
else
echo "⚠️ TEST INCOMPLETE: No response marker found (daemon may have timed out)"
fi
# Cleanup
tmux kill-session -t "$SESSION" 2>/dev/null || true
echo "Done."