RTSG Intelligence Engine — Master Deployment Plan¶
Author: Jean-Paul Niko / Claude Date: 2026-03-15 Target: https://smarthub.my/ VPS: root@musclemap.me (72.62.83.202), 6 CPU, 32GB RAM, Linux Status: PLANNING → EXECUTION
0. Architecture Overview¶
┌─────────────────────────────────────────────────────────────┐
│ smarthub.my (Caddy) │
├──────────┬──────────┬───────────┬───────────┬───────────────┤
│ / │ /api │ /wiki │ /explore │ /docs │
│ Landing │ REST │ Existing │ RTSG 3D │ Math Papers │
│ (React) │ (Go) │ Wiki │ Explorer │ (Markdown) │
├──────────┴──────────┴───────────┴───────────┴───────────────┤
│ Reverse Proxy (Caddy) │
├──────────┬──────────┬───────────────────────────────────────┤
│ Go API │ Rust │ PostgreSQL + SQLite │
│ Server │ Compute │ NRTE Database │
│ (PM2) │ Engine │ Vector Store │
└──────────┴──────────┴───────────────────────────────────────┘
1. WORKSTREAM A: Frontend (TypeScript/React + Three.js)¶
Goal¶
Interactive 3D RTSG Dimension Explorer as the centerpiece of smarthub.my.
Features¶
- Pick any two RTSG dimensions (Relational, Topological, Geometric)
- Pick number system (ℝ, ℂ, ℚ_p for any p, full adeles 𝔸)
- Pick mathematical perspective (algebra, geometry, topology, number theory, category theory, analysis, differential geometry, trigonometry, calculus)
- 3D visualization of inner product shapes using Three.js / React Three Fiber
- Gram matrix heatmaps, eigenvalue spectra, radar plots
- Cross-dimensional coupling visualization
- Entity browser: load entities from NRTE database, see their shape signatures
- Document analysis: upload text, decompose into entity shapes
- Comparison mode: overlay shapes from different dimensions/number systems
Technology¶
- Framework: React 18 + TypeScript (strict mode)
- 3D: React Three Fiber (Three.js r128 wrapper) + drei helpers
- Charts: Recharts for 2D, custom Three.js meshes for 3D
- Styling: Tailwind CSS
- Build: Bun (fast bundler, runs on VPS)
- State: React context + useReducer (no external state library)
Sub-tasks¶
- Scaffold TypeScript React project with Bun
- Implement NRTE data model types
- Build dimension selector UI (dropdowns + visual cards)
- Build number system selector with live preview
- Build perspective switcher
- Implement inner product computation engine (all number systems)
- Build Gram matrix visualization component
- Build eigenvalue spectrum chart
- Build 3D shape renderer (Three.js mesh from Gram matrix eigenvectors)
- Build cross-dimensional heatmap
- Build entity browser (fetches from API)
- Build document upload + shape decomposition
- Build comparison overlay mode
- Build landing page with hero section
- Responsive layout + mobile support
- Bundle and deploy to /explore on Caddy
2. WORKSTREAM B: Backend API (Go → C)¶
Goal¶
RESTful API serving NRTE data, computing inner products, managing entities.
Endpoints¶
GET /api/v1/dimensions — List RTSG dimensions
GET /api/v1/dimensions/:id — Get dimension basis vectors
GET /api/v1/entities — List entities from NRTE DB
GET /api/v1/entities/:id — Get entity with shape data
POST /api/v1/inner-product — Compute ⟨v₁, v₂⟩ in chosen number system
POST /api/v1/gram-matrix — Compute full Gram matrix for a basis set
POST /api/v1/cross-product — Cross-dimensional inner product
POST /api/v1/analyze-document — Decompose text into entity shapes
GET /api/v1/number-systems — Available number systems + metadata
GET /api/v1/perspectives — Available math perspectives
POST /api/v1/transform — Apply matrix transformation to shape
GET /api/v1/health — Health check
Technology¶
- Language: Go 1.22 (primary), Rust (compute-intensive inner product kernels)
- Final target: Compile Go to C via cgo, Rust to C via FFI, link as modular daemons
- HTTP: net/http (stdlib) or Chi router
- Database: PostgreSQL (primary NRTE store) + SQLite (session cache)
- Process manager: PM2 (already on VPS)
- Serialization: JSON (API), MessagePack (internal)
Sub-tasks¶
- Define Go project structure (cmd/api, pkg/nrte, pkg/math, pkg/compute)
- Define NRTE database schema in PostgreSQL
- Implement entity CRUD handlers
- Implement inner product computation in Go (real, complex)
- Implement p-adic inner product in Rust (performance-critical)
- Implement adelic product computation in Rust
- Build Gram matrix endpoint
- Build cross-dimensional product endpoint
- Build document analysis pipeline (tokenize → entity lookup → shape assembly)
- Build health/metrics endpoints
- Write Go↔Rust FFI bridge (cgo + Rust cdylib)
- Compile to standalone C-linked binaries
- Configure PM2 process management
- Deploy behind Caddy reverse proxy
3. WORKSTREAM C: Database (NRTE)¶
Goal¶
Connect to and extend the existing noun-relation-thing-entity database.
Schema (PostgreSQL)¶
-- Core NRTE tables
CREATE TABLE entities (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
type TEXT NOT NULL, -- noun, relation, thing, entity
lojban_form TEXT, -- Lojban syntactic form
english TEXT, -- English representation
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE relations (
id SERIAL PRIMARY KEY,
subject_id INT REFERENCES entities(id),
predicate TEXT NOT NULL, -- relation type
object_id INT REFERENCES entities(id),
weight FLOAT DEFAULT 1.0,
metadata JSONB
);
-- RTSG shape layers
CREATE TABLE dimension_vectors (
id SERIAL PRIMARY KEY,
entity_id INT REFERENCES entities(id),
dimension TEXT NOT NULL, -- relational, topological, geometric
basis_index INT NOT NULL,
components FLOAT[] NOT NULL, -- vector components
number_system TEXT DEFAULT 'real'
);
CREATE TABLE gram_cache (
id SERIAL PRIMARY KEY,
dim1 TEXT NOT NULL,
dim2 TEXT NOT NULL,
number_sys TEXT NOT NULL,
matrix_data JSONB NOT NULL,
computed_at TIMESTAMPTZ DEFAULT NOW()
);
-- Vector embeddings for similarity search
CREATE TABLE embeddings (
id SERIAL PRIMARY KEY,
entity_id INT REFERENCES entities(id),
model TEXT NOT NULL,
vector FLOAT[] NOT NULL
);
Sub-tasks¶
- Audit existing NRTE database structure on VPS
- Design migration scripts for shape layers
- Implement entity import from existing Lojban/English data
- Build dimension_vectors population pipeline
- Build Gram cache for frequently computed matrices
- Set up pgvector extension for similarity search
- Create indexes for fast entity lookup
- Write seed data from current RTSG basis vectors
4. WORKSTREAM D: Wiki Architecture Update¶
Goal¶
Update all smarthub.my/wiki documents with latest math (Architecture v6.0, Kill Log, Stampacchia proof, No-Go theorem).
Documents to update/create¶
- RTSG Main Page — Update with v6.0 framework status
- Kill Log — Full 10-entry kill log with dates and sources
- Theorem A — Existence, uniqueness, coercivity (Section 2)
- Theorem B / Lemma M — Stampacchia truncation proof (Section 3)
- Weil Connection — Structural isomorphism + No-Go theorem (Section 4)
- Conclusion — Final verdict and open problems (Section 5)
- Computational Appendix — All simulation results and code
- RTSG Explorer Docs — API documentation for the new explorer
- NRTE Database Docs — Schema, entity types, relation types
- Deployment Architecture — This master plan, kept live
Sub-tasks¶
- Push Architecture v6.0 final to wiki
- Push Section 2 (Theorem A) to wiki
- Push Section 3 (Theorem B / Stampacchia) to wiki
- Push Section 4 (Weil Connection / No-Go) to wiki
- Push Section 5 (Conclusion) to wiki
- Push Kill Log as standalone page
- Create API documentation page
- Create NRTE schema documentation page
- Update main landing page with links to all new content
- Verify all cross-references and links
5. WORKSTREAM E: Deployment & DevOps¶
Goal¶
Everything running as modular daemons on the VPS, served by Caddy.
Caddy Configuration¶
smarthub.my {
# Static frontend
handle /explore/* {
root * /opt/smarthub/frontend/dist
file_server
try_files {path} /explore/index.html
}
# Go API
handle /api/* {
reverse_proxy localhost:8080
}
# Existing wiki
handle /wiki/* {
reverse_proxy localhost:3000
}
# Landing page
handle {
root * /opt/smarthub/landing
file_server
}
}
PM2 Process Configuration¶
apps:
- name: smarthub-api
script: /opt/smarthub/bin/api-server
instances: 2
exec_mode: cluster
- name: smarthub-compute
script: /opt/smarthub/bin/compute-engine
instances: 1
- name: smarthub-wiki
script: /opt/smarthub/wiki/server.js
instances: 1
Sub-tasks¶
- SSH into VPS and audit current Caddy config
- Audit current PM2 processes
- Create /opt/smarthub directory structure
- Deploy Go API binary
- Deploy Rust compute engine
- Deploy React frontend build
- Update Caddy config
- Configure PM2 for all services
- Set up log rotation
- Health check monitoring
6. EXECUTION ORDER¶
Phase 1: Foundation (can start now, no VPS access needed)¶
- Create master plan (this document)
- Write all Go API code locally
- Write all Rust compute code locally
- Build React frontend locally
- Push math documents to wiki via API
Phase 2: Database (needs VPS access)¶
- Audit existing NRTE database
- Run migration scripts
- Seed dimension vectors
Phase 3: Deploy (needs VPS SSH)¶
- Deploy binaries to VPS
- Update Caddy config
- Configure PM2
- Verify all endpoints
Phase 4: Integration¶
- Connect frontend to live API
- Connect API to live database
- End-to-end testing
- Update wiki with API docs
7. WHAT I CAN DO RIGHT NOW (This Session)¶
Without SSH access to the VPS, I can:
- ✅ Write the complete Go API server code
- ✅ Write the Rust compute engine code
- ✅ Build the full React/TypeScript frontend
- ✅ Push updated math documents to the wiki via the existing API
- ✅ Generate all SQL migration scripts
- ✅ Generate Caddy and PM2 configuration files
- ✅ Package everything for deployment
What requires your action (VPS SSH): - Installing Go/Rust/Bun on the VPS - Running database migrations - Deploying binaries - Updating Caddy config
8. TECHNOLOGY STACK SUMMARY¶
| Layer | Technology | Rationale |
|---|---|---|
| Frontend | React 18 + TypeScript + Three.js | 3D math viz, type safety |
| Build | Bun | Fast bundler, runs Go-like on server |
| API | Go 1.22 (Chi router) | Fast, simple, compiles to single binary |
| Compute | Rust (FFI to Go) | p-adic/adelic math needs performance |
| Final binary | C (via cgo + Rust cdylib) | Modular daemons in RAM |
| Primary DB | PostgreSQL + pgvector | NRTE store + vector search |
| Cache DB | SQLite | Session cache, Gram matrix cache |
| Process mgmt | PM2 | Already on VPS |
| Reverse proxy | Caddy | Already on VPS, auto-TLS |
| Wiki | Existing system | Already running at /wiki |