RELEASE: Finalize Semantic Restructuring v0.1.0
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s

- Folders: literate->harness, src->library, system->environment, scripts->interfaces.
- Synchronized all :tangle paths and system definitions.
- Hardened .gitignore for binary and log artifacts.
- Consolidated all documentation into docs/.
This commit is contained in:
2026-04-21 12:41:50 -04:00
parent dd3873cd5e
commit 94a8a0ab0b
53 changed files with 475 additions and 760 deletions

View File

@@ -0,0 +1,46 @@
#!/bin/bash
# opencortex: Bare Metal Installation Script
# This script sets up the opencortex daemon on a Linux host (Debian/Fedora).
set -e
echo "--- opencortex: Bare Metal Installation ---"
# 1. Check Dependencies
echo "[1/4] Checking dependencies..."
for cmd in sbcl curl git ripgrep; do
if ! command -v $cmd &> /dev/null; then
echo "Error: $cmd is not installed. Please install it first."
exit 1
fi
done
# 2. Setup Quicklisp
if [ ! -d "$HOME/quicklisp" ]; then
echo "[2/4] Quicklisp not found. Installing..."
curl -O https://beta.quicklisp.org/quicklisp.lisp
sbcl --non-interactive --load quicklisp.lisp --eval '(quicklisp-quickstart:install)'
rm quicklisp.lisp
echo "Quicklisp installed."
else
echo "[2/4] Quicklisp already installed."
fi
# 3. Build standalone binary
echo "[3/4] Building standalone binary..."
PROJECT_ROOT=$(pwd)/../..
sbcl --non-interactive \
--eval "(push \"$PROJECT_ROOT/\" asdf:*central-registry*)" \
--eval "(ql:quickload :opencortex)" \
--eval "(asdf:make :opencortex)"
echo "Binary built: $PROJECT_ROOT/opencortex-server"
# 4. Instructions for Systemd
echo "[4/4] Installation complete."
echo ""
echo "To run as a systemd service:"
echo "1. Edit opencortex.service to set correct paths."
echo "2. sudo cp opencortex.service /etc/systemd/system/"
echo "3. sudo systemctl daemon-reload"
echo "4. sudo systemctl enable --now opencortex"

View File

@@ -0,0 +1,18 @@
[Unit]
Description=opencortex: Probabilistic-Deterministic Lisp Machine Kernel
After=network.target
[Service]
Type=simple
# Update User and WorkingDirectory to match your local setup
User=amr
WorkingDirectory=/home/amr/.openclaw/workspace/memex/5_projects/opencortex
ExecStart=/home/amr/.openclaw/workspace/memex/5_projects/opencortex/opencortex-server
Restart=always
RestartSec=10
# Environment variables can be loaded from the .env file
EnvironmentFile=/home/amr/.openclaw/workspace/memex/5_projects/opencortex/.env
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,32 @@
FROM debian:bullseye-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
sbcl \
emacs-nox \
curl \
git \
socat \
netcat-openbsd \
libssl-dev \
libncurses5-dev \
libffi-dev \
zlib1g-dev \
libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Quicklisp
RUN curl -O https://beta.quicklisp.org/quicklisp.lisp \
&& sbcl --non-interactive --load quicklisp.lisp --eval "(quicklisp-quickstart:install)" --eval "(ql-util:without-prompting (ql:add-to-init-file))" \
&& rm quicklisp.lisp
WORKDIR /app
COPY . .
# Initialize system in non-interactive mode
RUN mkdir -p /root/memex && ./opencortex.sh setup --non-interactive
EXPOSE 9105
CMD ["./opencortex.sh", "boot"]

View File

@@ -0,0 +1,19 @@
services:
opencortex:
build:
context: .
dockerfile: Dockerfile
container_name: opencortex
env_file: .env
volumes:
# Mount the entire memex directory (2 levels up from projects/opencortex)
- ../..:/memex
# Ensure signal-cli state is preserved
- signal-state:/root/.local/share/signal-cli
ports:
- "${ORG_AGENT_DAEMON_PORT:-9105}:9105"
- "${ORG_AGENT_WEB_PORT:-8080}:8080"
restart: unless-stopped
volumes:
signal-state:

View File

@@ -0,0 +1,14 @@
;; opencortex: Guix Environment Manifest
;; Usage: guix shell -m manifest.scm -- sbcl --eval ...
(specifications->manifest
'("sbcl"
"sbcl-cl-json"
"sbcl-bordeaux-threads"
"sbcl-usocket"
"sbcl-dexador"
"sbcl-cl-ppcre"
"ripgrep"
"git"
"curl"
"sqlite"))

View File

@@ -0,0 +1,33 @@
#+TITLE: LXC / Systemd-nspawn Deployment Guide
#+AUTHOR: opencortex
* Overview
For users who prefer containerization without the overhead or dependency on the Docker daemon, `opencortex` can be run within a standard Linux Container (LXC) or a systemd-nspawn container.
* Systemd-nspawn Setup (Fastest for Linux users)
1. **Create the container root:**
#+begin_src bash
sudo debootstrap --arch=amd64 bookworm /var/lib/machines/opencortex
#+end_src
2. **Start and enter the container:**
#+begin_src bash
sudo systemd-nspawn -D /var/lib/machines/opencortex
#+end_src
3. **Install dependencies (inside container):**
#+begin_src bash
apt-get update && apt-get install -y sbcl curl git ripgrep libsqlite3-dev build-essential
#+end_src
4. **Bind mount the Memex directory:**
Add this to your container startup or use the `--bind` flag:
#+begin_src bash
sudo systemd-nspawn -D /var/lib/machines/opencortex --bind /home/amr/.openclaw/workspace/memex
#+end_src
* Proxmox LXC Setup
1. Create a new LXC container using the Debian 12 template.
2. Ensure the network is bridged so Emacs can reach it.
3. Run the `deploy/bare-metal/install.sh` script inside the container.

View File

@@ -0,0 +1,22 @@
Vagrant.configure("2") do |config|
config.vm.box = "debian/bookworm64"
config.vm.network "forwarded_port", guest: 9105, host: 9105
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y sbcl curl git ripgrep libsqlite3-dev build-essential
# Setup for opencortex
mkdir -p /home/vagrant/opencortex
cp -r /vagrant/* /home/vagrant/opencortex/
chown -R vagrant:vagrant /home/vagrant/opencortex
# Build binary natively
sudo -u vagrant bash -c "cd /home/vagrant/opencortex && ./deploy/bare-metal/install.sh"
SHELL
end

View File

@@ -0,0 +1,21 @@
Vagrant.configure("2") do |config|
config.vm.box = "fedora/39-cloud-base"
config.vm.network "forwarded_port", guest: 9105, host: 9105
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
dnf install -y sbcl curl git ripgrep sqlite-devel make gcc
# Setup for opencortex
mkdir -p /home/vagrant/opencortex
cp -r /vagrant/* /home/vagrant/opencortex/
chown -R vagrant:vagrant /home/vagrant/opencortex
# Build binary natively
sudo -u vagrant bash -c "cd /home/vagrant/opencortex && ./deploy/bare-metal/install.sh"
SHELL
end