major restructure

This commit is contained in:
buenosairesam
2026-01-20 05:31:26 -03:00
parent 27b32deba4
commit e4052374db
328 changed files with 1018 additions and 10018 deletions

183
CLAUDE.md
View File

@@ -17,51 +17,58 @@ spr/
├── schema.json # Source of truth for models
├── build.py # Build tool
├── soleprint/ # Core framework (all systems inside)
│ ├── main.py # Hub entry point
│ ├── run.py # Bare-metal dev server
│ ├── index.html
│ ├── requirements.txt
│ ├── Dockerfile
│ ├── dataloader/
│ │
│ ├── artery/ # Connectors
│ │ ├── veins/ # Real API connectors (jira, slack, google)
│ │ ├── shunts/ # Fake connectors for testing
│ │ ├── pulses/ # Composed: Vein + Room + Depot
│ │ └── depots/
│ │
│ ├── atlas/ # Documentation
│ │ ├── books/ # Documentation (soleprint-only)
│ │ ├── templates/
│ │ ├── depots/
│ │ └── static/
│ │
│ └── station/ # Tools & execution
│ ├── tools/ # modelgen, datagen, tester, sbwrapper
│ ├── monitors/ # databrowse
│ └── desks/
├── cfg/ # Room configurations
│ ├── standalone/ # Base soleprint config
│ │ ├── config.json # Framework branding/terminology
│ │ ── data/ # Data files (veins.json, shunts.json, etc.)
│ └── amar/ # AMAR room config
├── config.json # Can rebrand (e.g., "pawprint")
├── data/ # Room-specific data files
│ ├── .env.example
│ ├── docker-compose.yml
│ ├── soleprint/ # Soleprint Docker config for this room
├── databrowse/depot/
│ ├── tester/tests/
│ │ ├── config.json
│ │ ── data/
│ └── soleprint/
└── amar/ # Amar room config
│ ├── config.json
│ ├── data/
│ ├── artery/ # Amar-specific (merged into output)
│ └── shunts/amar/
│ ├── atlas/ # Amar-specific books
│ │ └── books/
│ ├── station/ # Amar-specific tools config
│ │ └── tools/datagen/
│ ├── link/ # Bridge to managed app
│ ├── soleprint/ # Soleprint docker config
│ ├── databrowse/
│ ├── tester/
│ ├── monitors/
│ └── models/
├── ctrl/ # Build/run scripts
│ ├── build.sh # ./build.sh [room]
│ ├── start.sh # ./start.sh [room] [-d]
│ ├── stop.sh # ./stop.sh [room]
│ └── logs.sh # ./logs.sh [room]
├── artery/ # Vital connections
│ ├── veins/ # Stateless API connectors (jira, slack, google)
│ ├── shunts/ # Fake connectors for testing
│ ├── pulses/ # Composed: Vein + Room + Depot
│ └── plexus/ # Full apps: backend + frontend + DB
├── atlas/ # Documentation system
│ └── books/ # Soleprint docs (external via depots)
├── station/ # Tools & execution
│ ├── tools/ # modelgen, datagen, tester, sbwrapper
│ └── monitors/ # databrowse
├── soleprint/ # Core entry points (versioned)
│ ├── main.py
│ ├── run.py
│ ├── index.html
│ ├── requirements.txt
│ ├── Dockerfile
│ └── dataloader/
└── gen/ # Built instances (gitignored)
├── standalone/ # python build.py dev
└── amar/ # python build.py dev --cfg amar
├── standalone/
└── amar/
```
## The Four Systems
@@ -87,63 +94,47 @@ Vein ──────► Pulse ──────► Plexus
Shunt ─── Fake connector for testing
```
| Type | State | Frontend | Deploy |
|------|-------|----------|--------|
| Vein | None (or OAuth) | Optional test UI | With soleprint |
| Shunt | Configurable responses | Config UI | With soleprint |
| Pulse | Vein + config | Uses vein's | With soleprint |
| Plexus | Full app state | Required | Self-contained |
## Room Configuration
Each room in `cfg/` has:
- `config.json` - Framework branding/terminology (can rebrand soleprint)
- `data/` - Data files (veins.json, shunts.json, depots.json, etc.)
- Room-specific: databrowse depot, tester tests, monitors, models
- `config.json` - Framework branding/terminology
- `data/` - Data files (veins.json, shunts.json, etc.)
Managed rooms (like amar) also have:
- `docker-compose.yml` - Room's own services
- `soleprint/` - Soleprint Docker config for this room
- `.env.example` - Environment template
Room-specific system configs (merged into output):
- `artery/` - Room-specific shunts, pulses
- `atlas/` - Room-specific books
- `station/` - Room-specific tool configs (datagen, tester tests, etc.)
## Build & Run
### Commands
```bash
# Build
python build.py dev # -> gen/standalone/
python build.py dev --cfg amar # -> gen/amar/
python build.py dev --all # -> both
python build.py # -> gen/standalone/
python build.py --cfg amar # -> gen/amar/
python build.py --all # -> all rooms
# Run bare-metal
cd gen/standalone && python run.py
# Using ctrl scripts
./ctrl/build.sh # Build standalone
./ctrl/build.sh amar # Build amar
./ctrl/build.sh --all # Build all
./ctrl/start.sh # Start standalone
./ctrl/start.sh amar # Start amar
./ctrl/start.sh amar -d # Detached
./ctrl/stop.sh amar # Stop
./ctrl/logs.sh amar # View logs
# Bare-metal dev
cd gen/standalone && .venv/bin/python run.py
./ctrl/build.sh [room]
./ctrl/start.sh [room] [-d]
./ctrl/stop.sh [room]
```
### Adding a New Managed Room
## Adding a New Room
```bash
# 1. Create room config
mkdir -p cfg/clientx/data
mkdir -p cfg/newroom/data
cp cfg/standalone/config.json cfg/newroom/
cp -r cfg/standalone/data/* cfg/newroom/data/
# 2. Copy base config
cp cfg/standalone/config.json cfg/clientx/
cp -r cfg/standalone/data/* cfg/clientx/data/
# Add room-specific configs as needed:
# cfg/newroom/artery/shunts/...
# cfg/newroom/atlas/books/...
# cfg/newroom/station/tools/...
# 3. Customize as needed (shunts, depots, branding)
# 4. Build and run
python build.py dev --cfg clientx
./ctrl/start.sh clientx
python build.py --cfg newroom
```
## Ports
@@ -151,45 +142,25 @@ python build.py dev --cfg clientx
| Service | Port |
|---------|------|
| Soleprint | 12000 |
| Amar Backend | 8000 |
| Amar Frontend | 3000 |
## Tools
| Tool | Location | Purpose |
|------|----------|---------|
| modelgen | station/tools/modelgen | Model generation |
| datagen | station/tools/datagen | Test data generation |
| tester | station/tools/tester | BDD/playwright test runner |
| sbwrapper | station/tools/sbwrapper | Sidebar wrapper UI |
| databrowse | station/monitors/databrowse | SQL data browser |
## Integration with ppl/ (Infrastructure)
```
wdir/
├── spr/ # This repo (soleprint)
├── ppl/ # Pipelines & infrastructure
│ ├── pipelines/spr-standalone/ # CI/CD for standalone
│ ├── pipelines/spr-managed/ # Manual deploy for rooms
│ └── gateway/ # Nginx configs
└── ama/ # Amar source code
```
### Pipeline (standalone only)
- git push -> woodpecker -> build gen/standalone/ -> docker push -> deploy
- Managed rooms deploy manually (no pipeline for client code)
| Tool | Purpose |
|------|---------|
| modelgen | Generate models from config |
| datagen | Generate test data (uses faker) |
| tester | BDD/playwright test runner |
| graphgen | Generate navigable model graphs |
| databrowse | SQL data browser |
## External Paths
| What | Path |
|------|------|
| Amar Backend | /home/mariano/wdir/ama/amar_django_back |
| Amar Frontend | /home/mariano/wdir/ama/amar_frontend |
| Pipelines | /home/mariano/wdir/ppl |
## Files Ignored
- `gen/` - Regenerate with `python build.py dev`
- `gen/` - Regenerate with `python build.py`
- `fails/`, `def/` - Drafts
- `__pycache__/`, `.venv/`