N'Ko Inscription System Architecture
| Component | Configuration | Status | |-----------|---------------|--------| | iPhone Sensor Logger | HTTP Push to cloud | **WORKING** | | cc-mcs-headless | Cloud: `[ip]:8765` | **DEPLOYED** | | Data path | Phone → Cloud Daemon → Supabase | **ESTABLISHED** |
Full Public Reader
N'Ko Inscription System Architecture
CRITICAL: Configuration Reference
DO NOT CHANGE THESE SETTINGS - They are already correctly configured:
| Component | Configuration | Status |
|---|---|---|
| iPhone Sensor Logger | HTTP Push to cloud | WORKING |
| cc-mcs-headless | Cloud: `[ip]:8765` | DEPLOYED |
| Data path | Phone → Cloud Daemon → Supabase | ESTABLISHED |
Data Flow
┌─────────────────────────────────────────────────────────────┐
│ iPhone Sensor Logger │
│ ├─ Sends: POST /api/data │
│ └─ Target: http://[ip]:8765/api/data │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ cc-mcs-headless (GCP Cloud VM) │
│ ├─ Receives sensor data at /api/data │
│ ├─ Converts to synthetic skeleton (skeleton_from_sensors) │
│ ├─ Runs inscription detection at 6Hz │
│ └─ Saves inscriptions to Supabase │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Supabase Database │
│ └─ Table: nko_inscriptions │
└─────────────────────────────────────────────────────────────┘10 Claim Types (All Implemented)
| # | Sigil | Name | Detection Trigger |
|---|---|---|---|
| 0 | ߛ | Stabilize | Variance decreasing > threshold |
| 1 | ߜ | Disperse | Variance increasing > threshold |
| 2 | ߕ | Transition | Curvature peak > 1.5 |
| 3 | ߙ | Return | Distance to known basin < 6.0 |
| 4 | ߡ | Dwell | Time in basin > 1.5s |
| 5 | ߚ | Oscillate | 3+ transitions between 2 basins at ≥0.2Hz |
| 6 | ߞ | Recover | Return to basin 0.5-10s after transition |
| 7 | ߣ | Novel | Distance from all basins > 10.0 |
| 8 | ߠ | PlaceShift | Place class changes (requires place data) |
| 9 | ߥ | Echo | Cosine similarity > 85 |
Key Files
| Purpose | Path |
|---|---|
| Claim Detector | `core/cc-inscription/src/detector/mod.rs` |
| Claim Types | `core/cc-inscription/src/claims/` |
| Sensor→Skeleton | `backend/cc-mcs/src-tauri/src/inscription_bridge.rs` |
| Inscription Runner | `backend/cc-mcs/src-tauri/src/inscription_runner.rs` |
| Main Daemon | `backend/cc-mcs/src-tauri/src/main_headless.rs` |
Deployment
Always use Cloud Build (Docker not available locally):
gcloud config set account [email]
gcloud config set project cc-mcs
gcloud builds submit --config=backend/cc-mcs/cloudbuild-daemon.yaml .Deploy to VM:
gcloud compute ssh cc-infrastructure-vm --zone=us-central1-a --command="docker pull gcr.io/cc-mcs/cc-mcs-daemon:latest && docker stop cc-mcs-daemon && docker rm cc-mcs-daemon && docker run -d --name cc-mcs-daemon --restart unless-stopped -p 8765:8001 -e SENSOR_PORT=8001 -e RUST_LOG=info -e SUPABASE_URL=https://aaqbofotpchgpyuohmmz.supabase.co -e 'SUPABASE_ANON_KEY=...' -e 'SUPABASE_SERVICE_KEY=...' gcr.io/cc-mcs/cc-mcs-daemon:latest"Threshold Configuration (detector/mod.rs)
PHONE SENSOR TUNING (2026-01-05):
Phone accelerometer produces noisier 63D z-vectors than mocopi skeleton.
These thresholds prevent spam while enabling claim variety.
DetectorConfig {
min_confidence: 0.5,
dispersion_window: 10.0,
curvature_threshold: 50.0, // PHONE: high to prevent jitter-triggered transitions
min_dwell_time: 1.0, // PHONE: faster dwell detection
oscillation_threshold: 0.15, // PHONE: slightly lower for oscillate detection
novelty_threshold: 100.0, // PHONE: high - 63D noise creates large distances
return_distance_threshold: 50.0, // PHONE: return within 50% of novelty threshold
variance_threshold: 0.01, // PHONE: lower for more stabilize/disperse
auto_register_basins: true,
max_basins: 20, // PHONE: fewer basins = more stable return/dwell
}Common Issues
### Issue: Only Novel/Transition claims detected
Root cause: Thresholds not calibrated for sensor data scale
Solution: Adjust thresholds in `detector/mod.rs`, rebuild, redeploy
### Issue: No inscriptions appearing
Check:
1. Is phone sensor logger running?
2. Check daemon logs: `docker logs cc-mcs-daemon | grep -i inscription`
3. Check database: `SELECT * FROM nko_inscriptions ORDER BY created_at DESC LIMIT 10`
### Issue: Context confusion about local vs cloud
REMEMBER:
- Phone ALWAYS sends to cloud ([ip]:8765)
- Local daemon is for development only
- Production = cloud daemon
Promotion Decision
Promote into a technical note or architecture paper with implementation anchors.
Source Anchor
Comp-Core/docs/NIP/INSCRIPTION_ARCHITECTURE.md
Detected Structure
Method · Figures · Code Anchors · Architecture